PageSourceSearch

https://icfpcontest2020.github.io/static/js/main.3489b1f0.chunk.js

js icfpcontest2020.github.io collected 2026-10-03 09:19:33 UTC 164,012 bytes, 2 lines download raw bytes

1(this["webpackJsonpicfpc-site"]=this["webpackJsonpicfpc-site"]||[]).push([[0],{107:function(e,t,a){},108:function(e,t,a){},114:function(e,t,a){},197:function(e,t,a){},198:function(e,t,a){"use strict";a.r(t);var n=a(0),r=a.n(n),o=a(52),s=a.n(o),i=a(34),l=a(83),c=a(18),u=(a(107),a(108),a(9)),h=a(10),m=a(13),d=a(12),p=a(19),v=a(16),f=a(67),g=a.n(f),y=a(32),b=a.n(y),w="/rules",E="/registration",S="/login",x="/team",k="/submissions",_="/scoreboard",T="/testing",I="/games",A="/visualize",O="/blog",N="/post",R="#orgs",V="#pegoovka",C="#rating",L="#nonRating",M="#lightning",D="#full",j="#final",P=[{url:E,content:"Sign up"},{url:S,content:"Log in"},{url:O,content:"Blog"},{url:_+j,content:"Scoreboard"}],G=[{url:x,content:"Profile"},{url:k,content:"Submissions"},{url:T,content:"Testing"},{url:I+C,content:"Games"},{url:O+R,content:"Blog"},{url:_+j,content:"Scoreboard"}];function B(e){return r.a.createElement(r.a.Fragment,null,e.map((function(e){return r.a.createElement(p.c,{to:e.url,className:b.a.link,key:e.url,activeClassName:b.a.activeLink},e.content)})))}var F=function(e){var t=Boolean(e.team);return r.a.createElement("header",{className:b.a.root},r.a.createElement("h1",null,r.a.createElement(p.b,{to:"/",className:b.a.titleLink},"ICFP Programming Contest 2020"),r.a.createElement("div",{className:b.a.subtitle},"started on July 17, 2020 \xb7 ended on July 20, 2020")),!e.isTeamLoading&&r.a.createElement(r.a.Fragment,null,t?function(e){if(!e.team)return;return r.a.createElement("div",{className:b.a.navMenuLinks},B(G))}(e):r.a.createElement("div",{className:b.a.links},B(P))))},z="general",U=a(56),K=a.n(U),W=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).interval=void 0,e}return Object(h.a)(a,[{key:"componentDidMount",value:function(){var e=this.props.onClose;void 0!==e&&(this.interval=setTimeout(e,5e3))}},{key:"componentWillUnmount",value:function(){this.interval&&clearTimeout(this.interval)}},{key:"render",value:function(){var e=this.props,t=e.message,a=e.isError;return r.a.createElement("div",{className:K.a.root},r.a.createElement("div",{className:K.a.box+(a?" "+K.a.error:"")},t))}}]),a}(r.a.Component);var H=function(e){var t=e.closeError,a=e.error,n="string"===typeof a?a:a.message;return r.a.createElement(W,{message:n,isError:!0,onClose:t})},Z=a(5),J=a.n(Z);var Y=function(){return r.a.createElement("div",{className:J.a.root},r.a.createElement("section",{className:J.a.video},r.a.createElement("div",{className:J.a.subtitle},"Many thanks to all the participants!",r.a.createElement("br",null),"Watch the video and read the ",r.a.createElement(p.b,{to:N+"/2061",target:"_blank",rel:"noopener noreferrer"},"wrapping up blog post")),r.a.createElement("iframe",{title:"title-video",width:"666",height:"375",src:"https://www.youtube.com/embed/Me-0k5XGZWY",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})),r.a.createElement("section",{className:J.a.section},r.a.createElement("ul",{className:J.a.links},r.a.createElement("li",null,r.a.createElement("p",null,"Follow ",r.a.createElement("a",{href:"https://twitter.com/icfpcontest2020",target:"_blank",rel:"noopener noreferrer"},"Twitter")," for updates, talk in ",r.a.createElement("a",{href:"https://discord.com/invite/xvMJbas",target:"_blank",rel:"noopener noreferrer"},"Discord"),".")),r.a.createElement("li",null,r.a.createElement("p",null,"(Also, we had these ",r.a.createElement(p.b,{to:w,target:"_blank"},"rules"),".)")))),r.a.createElement("section",{className:J.a.section},r.a.createElement("h2",null,"Something to compete for"),r.a.createElement("ul",{className:J.a.features},r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83e\udd2a")),r.a.createElement("div",{className:J.a.features__title},"Fun & joy."),r.a.createElement("div",null,"These are noble feelings to pursue during the contest")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83c\udf96")),r.a.createElement("div",{className:J.a.features__title},"1st @ lightning division."),r.a.createElement("div",null,"One team will take the 1st place after 24 hours"),r.a.createElement("div",{className:J.a.features__pro},"Their tools will be named very suitable for rapid prototyping")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83c\udfc5")),r.a.createElement("div",{className:J.a.features__title},"Judges' prize."),r.a.createElement("div",null,"One team which will do something outstanding will take the judges' prize"),r.a.createElement("div",{className:J.a.features__pro},"This team will be named an extremely cool bunch of hackers")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83e\udd47")),r.a.createElement("div",{className:J.a.features__title},"1st @ full contest."),r.a.createElement("div",null,"One team will take the 1st place after 72 hours"),r.a.createElement("div",{className:J.a.features__pro},"Their tools will be named programming tools of choice for discriminating hackers")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83e\udd48")),r.a.createElement("div",{className:J.a.features__title},"2nd @ full contest."),r.a.createElement("div",null,"One team will take the 2nd place after 72 hours"),r.a.createElement("div",{className:J.a.features__pro},"Their tools will be named fine programming tools for many applications")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83e\udd49")),r.a.createElement("div",{className:J.a.features__title},"3rd @ full contest."),r.a.createElement("div",null,"One team will take the 3rd place after 72 hours"),r.a.createElement("div",{className:J.a.features__pro},"Their tools will be named not too shabby")))),r.a.createElement("section",{className:J.a.section},r.a.createElement("h2",null,"Look what has happened at Pegovka Observatory"),r.a.createElement("ul",{className:J.a.features},r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83d\ude31\ud83d\ude40")),r.a.createElement("div",null,"Read through a ",r.a.createElement("a",{href:"https://pegovka.space",target:"_blank",rel:"noopener noreferrer"},"surprising story")," of Russian astronomer Ivan Zaitsev")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83d\udc69\u200d\ud83d\udcbb\ud83d\udc68\u200d\ud83d\udcbb")),r.a.createElement("div",null,"Join the ",r.a.createElement("a",{href:"https://discord.com/invite/xvMJbas",target:"_blank",rel:"noopener noreferrer"},"collective chat")," with passionate participants")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.features__emoji},r.a.createElement("span",{role:"img","aria-label":""},"\ud83d\udcc8\ud83d\udcc9")),r.a.createElement("div",null,"Recollect what's already known via the ",r.a.createElement("a",{href:"https://message-from-space.readthedocs.io/en/latest/",target:"_blank",rel:"noopener noreferrer"},"Read the Docs")," page"))),r.a.createElement("ul",{className:J.a.videos},r.a.createElement("li",null,r.a.createElement("iframe",{title:"first-video",width:"300",height:"170",src:"https://www.youtube.com/embed/EjL-5EuQeCU",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})),r.a.createElement("li",null,r.a.createElement("iframe",{title:"second-video",width:"300",height:"170",src:"https://www.youtube.com/embed/j7kVUaZCcMU",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})),r.a.createElement("li",null,r.a.createElement("iframe",{title:"title-video",width:"300",height:"170",src:"https://www.youtube.com/embed/PzJ6gfo92oA",frameBorder:"0",allow:"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})))),r.a.createElement("section",{className:J.a.section}
1,r.a.createElement("h2",null,"Special thanks"),r.a.createElement("ul",{className:J.a.thanks},r.a.createElement("li",null,r.a.createElement("div",{className:J.a.thanks__title},r.a.createElement("a",{href:"https://www.icfpconference.org",target:"_blank",rel:"noopener noreferrer"},"ICFP")),r.a.createElement("div",{className:J.a.thanks__script},"for sponsoring ICFP Contest and making it happen for 23 years in a row")),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.thanks__title},r.a.createElement("a",{href:"https://tech.kontur.ru",target:"_blank",rel:"noopener noreferrer"},"Kontur")),r.a.createElement("div",{className:J.a.thanks__script},"for sponsoring ICFP Contest 2020 and employing the team of its organizers")))),r.a.createElement("section",{className:J.a.section},r.a.createElement("h2",null,"Warm wishes to our supporters"),r.a.createElement("ul",{className:J.a.supporters},r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://adventofcode.com",target:"_blank",rel:"noopener noreferrer"},"Advent of Code")),r.a.createElement("div",{className:J.a.supporters__script},"and its creator ",r.a.createElement("a",{href:"https://twitter.com/ericwastl",target:"_blank",rel:"noopener noreferrer"},"Eric\xa0Wastl"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://atcoder.jp",target:"_blank",rel:"noopener noreferrer"},"AtCoder")),r.a.createElement("div",{className:J.a.supporters__script},"and its founder ",r.a.createElement("a",{href:"https://twitter.com/chokudai",target:"_blank",rel:"noopener noreferrer"},"Naohiro\xa0Takahashi"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://codeforces.com/?locale=en",target:"_blank",rel:"noopener noreferrer"},"Codeforces")),r.a.createElement("div",{className:J.a.supporters__script},"and its founder ",r.a.createElement("a",{href:"https://twitter.com/MikeMirzayanov",target:"_blank",rel:"noopener noreferrer"},"Mike\xa0Mirzayanov"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://www.codingame.com",target:"_blank",rel:"noopener noreferrer"},"CodinGame")),r.a.createElement("div",{className:J.a.supporters__script},"and its community manager ",r.a.createElement("a",{href:"https://twitter.com/thibaud_jobert",target:"_blank",rel:"noopener noreferrer"},"Thibaud\xa0Jobert"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://devzen.ru",target:"_blank",rel:"noopener noreferrer"},"DevZen Podcast")),r.a.createElement("div",{className:J.a.supporters__script},"and its hosts ",r.a.createElement("a",{href:"https://twitter.com/SBozhko",target:"_blank",rel:"noopener noreferrer"},"Sveta"),", ",r.a.createElement("a",{href:"https://twitter.com/afiskon",target:"_blank",rel:"noopener noreferrer"},"Aleksander"),", ",r.a.createElement("a",{href:"https://twitter.com/gliush",target:"_blank",rel:"noopener noreferrer"},"Ivan"),", and\xa0",r.a.createElement("a",{href:"https://twitter.com/sum3rman",target:"_blank",rel:"noopener noreferrer"},"Valery"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://it-people.ru",target:"_blank",rel:"noopener noreferrer"},"IT People")),r.a.createElement("div",{className:J.a.supporters__script},"and its founder ",r.a.createElement("a",{href:"https://www.facebook.com/yulia.gerasimovich",target:"_blank",rel:"noopener noreferrer"},"Yulia\xa0Gerasimovich"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title},r.a.createElement("a",{href:"https://jugru.org/en/",target:"_blank",rel:"noopener noreferrer"},"JUG Ru Group")),r.a.createElement("div",{className:J.a.supporters__script},"and its producer ",r.a.createElement("a",{href:"https://twitter.com/23derevo",target:"_blank",rel:"noopener noreferrer"},"Alexey\xa0Fyodorov"))),r.a.createElement("li",null,r.a.createElement("div",{className:J.a.supporters__title}
1,"And also:"),r.a.createElement("div",{className:J.a.supporters__script},r.a.createElement("a",{href:"https://twitter.com/ilyasergey",target:"_blank",rel:"noopener noreferrer"},"Ilya\xa0Sergey"),", ",r.a.createElement("a",{href:"https://twitter.com/nikitonsky",target:"_blank",rel:"noopener noreferrer"},"Nikita\xa0Prokopov"),", and ",r.a.createElement("a",{href:"https://twitter.com/VBragilevsky",target:"_blank",rel:"noopener noreferrer"},"Vitaly\xa0Bragilevsky"))))))};var Q=function(){return r.a.createElement("main",null,r.a.createElement("h2",null,"Contest Rules"),r.a.createElement("h3",null,"1. Participants"),r.a.createElement("p",null,"This is an open contest. Anyone may participate in ICFP Programming Contest 2020 except for its Organizers. Employees of the company which Organizers are affiliated with are not eligible for prizes."),r.a.createElement("h3",null,"2. Teams"),r.a.createElement("p",null,"Contestants are free to organize themselves into teams of any size. A contestant may only be a member of a single team. Teams may not divide, merge, or collaborate after the start of the contest."),r.a.createElement("h3",null,"3. Registration"),r.a.createElement("p",null,"No advance registration or entry fee is required. Teams must register during the contest to obtain a team-specific private identifier that will be used for submissions and profiles. Teams using more than one private identifier during the contest may be disqualified."),r.a.createElement("h3",null,"4. Languages & platforms"),r.a.createElement("p",null,"Teams are free to use any programming language(s) on any platform(s). Some programming languages and platforms may require additional tuning of the submission system. Participants are encouraged to check the ",r.a.createElement("a",{href:"https://github.com/icfpcontest2020/dockerfiles/blob/master/README.md",target:"_blank",rel:"noopener noreferrer"},"supported languages and platforms")," in advance and inform Organizers if their language or platform of choice is missing."),r.a.createElement("h3",null,"5. Prizes"),r.a.createElement("p",null,"Teams wishing to be considered for prizes must submit source code at the end of the contest. The exact details of contest submissions will be announced at the start of the contest. Teams may submit multiple times during the contest."),r.a.createElement("p",null,"The Organizers will distribute US $2,000 in prize money between the teams that will take the 1st, the 2nd, and the 3rd places in the contest (full  72-hour division)."),r.a.createElement("h3",null,"6. Records"),r.a.createElement("p",null,"The Organizers retain the right to monitor, record, and investigate the submissions, other contest-related activities, or lack thereof, of contestants and team
1s. The records are used for the sole purpose of judgment and are discarded once the contest-related events are over."),r.a.createElement("h3",null,"7. Fair play"),r.a.createElement("p",null,"Contestants are kindly asked not to attempt to attack the contest server. That will spoil the fun for the other teams and the Organizers, who worked hard to bring you this experience. Violations of these rules, attempts to compromise the integrity of the contest infrastructure, attempts to interfere with other contestants, collusion between the teams, or attempts to contravene the spirit of the contest will lead to disqualification of the involved contestants and/or teams."),r.a.createElement("h3",null,"8. Intellectual property"),r.a.createElement("p",null,"Contestants retain ownership of all intellectual property rights in and to any submitted solutions, source code, custom tools, and related materials (\u201cSubmissions\u201d) that contestants had before submission. As a condition of submission, contestants grant the Organizers a non-exclusive, perpetual, irrevocable, worldwide, royalty-free license to use, reproduce, publish, distribute, publicly perform and publicly display the Submissions, allowing the Organizers to test and evaluate the Submissions for purposes of the contest."),r.a.createElement("h3",null,"9. Authority"),r.a.createElement("p",null,"All decisions of the Organizers are final."),r.a.createElement("h2",null,"Changelog"),r.a.createElement("h3",null,"Jul 6, 2020 \u2014 1. Participants"),r.a.createElement("p",null,"Organizers deem unfeasible to prevent ~9,000 employees of Kontur, the company which also employs the majority of Organizers, from participation in the contest. However, Organizers declare that they kept secret from their coworkers everything which may give them any competitive advantage. Therefore, Organizers have removed the limitation for employees of Kontur to participate in the contest. At the same time, Organizes have added the rule that employees of Kontur are not eligible for prizes."),r.a.createElement("h3",null,"Jul 6, 2020 \u2014 4. Languages & platforms"),r.a.createElement("p",null,"Organizers have decided to use a particular kind of ",r.a.createElement("a",{href:"https://github.com/icfpcontest2020/dockerfiles/blob/master/README.md",target:"_blank",rel:"noopener noreferrer"},"submission system")," for this contest which requires teams to use Git and Docker. Therefore, Organizers have added the suggestion for teams to check the supported languages and platforms in advance."),r.a.createElement("h3",null,"Jul 14, 2020 \u2014 5. Prizes"),r.a.createElement("p",null,"Organizers have clarified the amount of prize money awarded to the winning teams."))},q=a(70),X=a.n(q),$={teamName:"",gitRepositoryUrl:"",customData_country:"World",customData_peopleAmount:"",customData_email:""},ee=a(3),te=a.n(ee),ae=a(11),ne=a(8),re=a(6),oe=a(48),se=a.n(oe),ie=a(36),le=a.n(ie),ce=a(54),ue=ce,he=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(u.a)(this,a),(n=t.call(this,e)).onChange=function(e){return function(t){var a=t.target.value;n.setState({teamInfo:Object(re.a)(Object(re.a)({},n.state.teamInfo),{},Object(ne.a)({},e,a))})}},n.registerTeam=function(){var e=Object(ae.a)(te.a.mark((function e(t){return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.preventDefault(),n.validate()){e.next=3;break}return e.abrupt("return");case 3:n.props.onSubmit(n.state.teamInfo);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.state={teamInfo:Object(re.a)({},e.startValue),validations:{}},n}return Object(h.a)(a,[{key:"render",value:function(){var e,t=this.props,a=t.isEditForm,n=t.loading;return e=a?n?"Updating...":"Update":n?"Registering...":"Register",r.a.createElement("form",{className:le.a.form,onSubmit:this.registerTeam},this.renderRow("Team name *","teamName",!0,{autoFocus:!a,maxLength:100}),this.renderRow("Contact email *","customData_email",!0,{type:"email",maxLength:100}),this.renderRow("Repository SSH URL *","gitRepositoryUrl",!0,{maxLength:1024,placeholder:"[email protected]:user/repo.git"}),this.renderCountrySelect(),this.renderRow("Team size","customData_peopleAmount",!1,{type:"number",maxLength:100}),r.a.createElement("div",{className:se.a.buttonRow}
1,r.a.createElement("span",null),r.a.createElement("div",null,r.a.createElement("button",{type:"submit",disabled:n},e))))}},{key:"renderRow",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3?arguments[3]:void 0,o=this.state.validations,s=t in o;return r.a.createElement("label",{className:se.a.row},r.a.createElement("span",null,e),r.a.createElement("span",{style:{width:"100%"}},r.a.createElement("input",Object.assign({className:s?" "+se.a.error:"",name:t,value:this.state.teamInfo[t],required:a,onChange:this.onChange(t)},n)),s&&r.a.createElement(W,{message:o[t],isError:!0})))}},{key:"renderCountrySelect",value:function(){return r.a.createElement("label",{className:se.a.row},r.a.createElement("span",null,"Your country"),r.a.createElement("select",{name:"customData_country",value:this.state.teamInfo.customData_country,onChange:this.onChange("customData_country")},ue.map((function(e){return r.a.createElement("option",{value:e.value,key:e.value},e.text)}))))}},{key:"validate",value:function(){var e=this.state.teamInfo,t=e.teamName,a=e.gitRepositoryUrl,n={};return t||(n.teamName="Team Name is required for registration"),a||(n.gitRepositoryUrl="Repository SSH URL is required for registration"),/[^@]+@[^@:]+/.test(a)||(n.gitRepositoryUrl="Make sure the url you enter is a valid SSH URL"),this.setState({validations:n}),0===Object.keys(n).length}}]),a}(r.a.Component);var me=function(e){return r.a.createElement("div",{className:X.a.root},r.a.createElement("h2",null,"Team Registration"),r.a.createElement("div",{className:X.a.disclaimer},r.a.createElement("p",null,"As part of registration, we kindly ask to create a private Git repository for your team and provide its SSH URL."),r.a.createElement("p",null,"Don't worry, all information you enter here can be updated later.")),r.a.createElement(he,{startValue:$,onSubmit:e.register,loading:e.loading}))},de="_START",pe="_FINISH",ve="application/json";function fe(e){return we(e,{})}function ge(e,t){return we(e,{method:"POST",headers:{"Content-Type":ve},body:t?JSON.stringify(t):void 0})}function ye(e,t){return we(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t})}function be(e,t){return we(e,{method:"PATCH",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:t})}function we(e,t){return fetch(e,t).then(function(){var e=Object(ae.a)(te.a.mark((function e(t){var a,n,r,o;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=null===(a=t.headers.get("Content-Type"))||void 0===a?void 0:a.split(";")[0],!t.ok||n!==ve){e.next=3;break}return e.abrupt("return",t.json());case 3:if(!t.ok){e.next=5;break}return e.abrupt("return");case 5:if(n!==ve){e.next=10;break}return e.next=8,t.json();case 8:return r=e.sent,e.abrupt("return",Promise.reject(r.message||r.error||JSON.stringify(r)));case 10:return o="Something went wrong. Server answer is ".concat(t.status).concat(t.statusText?":"+t.statusText:""),e.abrupt("return",Promise.reject(o));case 12:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}())}var Ee="https://icfpc2020-api.testkontur.ru",Se="".concat(Ee,"/teams"),xe="".concat(Se,"/register"),ke="".concat(Se,"/current"),_e="".concat(Ee,"/submissions"),Te="".concat(_e,"/other-teams"),Ie="".concat(Ee,"/events/"),Ae="".concat(Ee,"/scoreboard"),Oe="".concat(Ae,"/lightning"),Ne="".concat(Ae,"/finals"),Re="".concat(Ee,"/tournaments"),Ve="".concat(Re,"/current"),Ce="".concat(Ee,"/games"),Le="".concat(Ce,"/non-rating"),Me="".concat(Le,"/run"),De="".concat(Ee,"/logs"),je=function(e){return{type:"SET_ERROR",payload:e}};function Pe(e){return Object.entries(e).map((function(e){return"".concat(e[0],"=").concat(encodeURIComponent(e[1]))})).join("&")}var Ge=a(47);function Be(e){return Object.entries(e).map((function(e){var t=Object(Ge.a)(e,2),a=t[0],n=t[1];return"".concat(a,"=").concat(encodeURIComponent(n))})).join("&")}var Fe=function(e){return{type:"UPDATE_API_KEY",payload:e}},ze=function(e){return{type:"UPDATE_TEAM",payload:e}},Ue=function(){return{type:"LOAD_TEAM"+de}},Ke=function(){return{type:"LOAD_TEAM"+pe}};var We=function(e){return{type:"",payload:e}}
1,He=Object(c.b)((function(e){return{loading:e.team.teamLoading}}),(function(e){return{register:function(t){return e((a=We(t),function(){var e=Object(ae.a)(te.a.mark((function e(t){var n,r;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(Ue()),n=Pe(a.payload),e.prev=2,e.next=5,ye(xe,n);case 5:r=e.sent,window.localStorage.setItem("apiKey",r.apiKey),t(Fe(r.apiKey)),t(ze(r)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),t(je(e.t0));case 14:return e.prev=14,t(Ke()),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t){return e.apply(this,arguments)}}()));var a}}}))(me),Ze=a(57),Je=a.n(Ze),Ye=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(e){var n;return Object(u.a)(this,a),(n=t.call(this,e)).onChange=function(e){n.setState({apiKey:e.target.value})},n.onSubmit=function(){var e=Object(ae.a)(te.a.mark((function e(t){var a;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t.preventDefault(),a=n.state.apiKey,n.props.login(a);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),n.state={apiKey:""},n}return Object(h.a)(a,[{key:"render",value:function(){var e=this.props.loading;return r.a.createElement("div",null,r.a.createElement("h2",null,"Log In"),r.a.createElement("form",{className:"".concat(Je.a.form," ").concat(le.a.form),onSubmit:this.onSubmit},r.a.createElement("label",{className:Je.a.row},r.a.createElement("span",null,"API key"),r.a.createElement("input",{name:"apiKey",required:!0,autoFocus:!0,onChange:this.onChange})),r.a.createElement("label",{className:Je.a.buttonRow},r.a.createElement("span",null),r.a.createElement("div",null,r.a.createElement("button",{type:"submit",disabled:e},e?"Logging In...":"Log In")))))}}]),a}(r.a.Component),Qe=Object(c.b)((function(e){return{loading:e.team.teamLoading}}),(function(e){return{login:function(t){return e((a=We(t),function(){var e=Object(ae.a)(te.a.mark((function e(t){var n,r;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(Ue()),n="".concat(ke,"?").concat(Be({apiKey:a.payload})),e.prev=2,e.next=5,fe(n);case 5:r=e.sent,window.localStorage.setItem("apiKey",a.payload),t(Fe(a.payload)),t(ze(r)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(2),t(je(e.t0));case 14:return e.prev=14,t(Ke()),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[2,11,14,17]])})));return function(t){return e.apply(this,arguments)}}()));var a}}}))(Ye),qe=a(85),Xe=a.n(qe),$e=a(86),et=a.n($e),tt=a(87),at=a.n(tt),nt=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={showToast:!1},e.showToast=function(){e.setState({showToast:!0})},e.closeToast=function(){e.setState({showToast:!1})},e}return Object(h.a)(a,[{key:"render",value:function(){var e=this.state.showToast,t=this.props.rows||1;return r.a.createElement("form",{className:"".concat(et.a.root," ").concat(le.a.form)},1===t&&r.a.createElement("input",{type:"text",disabled:!0,value:this.props.value}),1!==t&&r.a.createElement("textarea",{disabled:!0,rows:t,value:this.props.value}),r.a.createElement("div",null,r.a.createElement(at.a,{text:this.props.value},r.a.createElement("button",{type:"button",onClick:this.showToast},"Copy ",this.props.name))),e&&r.a.createElement(W,{message:"Copied to clipboard",onClose:this.closeToast}))}}]),a}(r.a.Component);var rt,ot=function(e){var t=e.team;if(!t)return null;var a={teamName:t.teamName,gitRepositoryUrl:t.gitRepositoryUrl,customData_peopleAmount:t.customData.peopleAmount||"",customData_country:t.customData.country||"",customData_email:t.customData.email||""};return r.a.createElement("main",{className:Xe.a.root},r.a.createElement("h2",null,"Profile: ",t.teamName),r.a.createElement("h3",null,"API key"),r.a.createElement("p",null,"Beware not to lose your API key. Use it:"),r.a.createElement("ul",null,r.a.createElement("li",null,"to log in to the team profile (this page)"),r.a.createElement("li",null,"to send requests to Organizers' server")),r.a.createElement("br",null),r.a.
1createElement(nt,{name:"API key",value:t.apiKey}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("h3",null,"Deploy key"),r.a.createElement("p",null,"Add it to your repository as per ",r.a.createElement("a",{href:"https://github.com/icfpcontest2020/dockerfiles#getting-started",target:"_blank",rel:"noopener noreferrer"},"submission rules"),"."),r.a.createElement(nt,{name:"Deploy key",value:t.deployKey}),r.a.createElement("br",null),r.a.createElement("br",null),r.a.createElement("h3",null,"Team Info"),r.a.createElement("div",null,r.a.createElement(he,{startValue:a,loading:e.loading,onSubmit:e.editTeam,isEditForm:!0})))},st=Object(c.b)((function(e){return{team:e.team.team,loading:e.team.teamLoading}}),(function(e){return{editTeam:function(t){return e((a=We(t),function(){var e=Object(ae.a)(te.a.mark((function e(t,n){var r,o,s,i,l;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(Ue()),r=n(),o=r.team.apiKey,s="".concat(ke,"?").concat(Be({apiKey:o})),i=Pe(a.payload),e.prev=5,e.next=8,be(s,i);case 8:l=e.sent,t(ze(l)),e.next=15;break;case 12:e.prev=12,e.t0=e.catch(5),t(je(e.t0));case 15:return e.prev=15,t(Ke()),e.finish(15);case 18:case"end":return e.stop()}}),e,null,[[5,12,15,18]])})));return function(t,a){return e.apply(this,arguments)}}()));var a}}}))(ot),it=a(21),lt=a.n(it);!function(e){e.Building="Building",e.Testing="Testing",e.Failed_Build="Failed_Build",e.Failed_Test="Failed_Test",e.Failed_Unknown="Failed_Unknown",e.Succeeded="Succeeded"}(rt||(rt={}));var ct=a(88),ut=a.n(ct),ht=new Intl.DateTimeFormat("en-US",{hour:"2-digit",minute:"2-digit",month:"short",day:"2-digit",hour12:!1});var mt=function(e){var t=e.dateStr,a=new Date(t);return r.a.createElement("span",{className:ut.a.root,title:Intl.DateTimeFormat().resolvedOptions().timeZone},ht.format(a))};var dt=function(e){return r.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",width:"25px",height:"20px",viewBox:"20 60 110 90",enableBackground:"new 0 0 150 190",xmlSpace:"preserve"},r.a.createElement("path",{fillRule:"evenodd",clipRule:"evenodd",fill:e.color||"#00bfff",d:"M95.693,86.301c-4.998-4.416-10.621-5.84-14.584-3.823 c-2.53,1.289-4.058,3.9-4.397,7.361l1.697,0.188l2.094,8.631c12.766,0.131,25.108,0.266,33.579,0.337 c6.308,0.053,10.649,1.572,10.649,10.935c0,9.363,0.229,22.767,0.198,28.352c-0.034,6.369-4.154,8.633-9.891,8.726 c-3.172,0.051-65.049-0.578-81.744-0.048c-5.542,0.176-8.242-3.824-8.355-10.988c-0.114-7.164,0.158-18.532,0.158-26.877 c0-8.346,3.366-10.778,10.192-10.778c7.658,0,19.349,0.092,31.781,0.209l2.19-9.509l1.489,0.165 c0.569-5.47,3.272-9.826,7.636-12.047c6.188-3.15,14.329-1.372,21.244,4.641c6.601,5.737,16.484,4.271,21.189-2.913l4.268,3.754 C119.143,92.188,104.568,94.142,95.693,86.301z M112.932,137.325c4.271-4.271-2.671-10.989-7.141-6.52 C101.407,135.189,107.864,142.391,112.932,137.325z M98.204,137.325c4.271-4.271-2.671-10.989-7.141-6.52 C86.679,135.189,93.137,142.391,98.204,137.325z M94.136,124.476c4.077-0.017,12.968-0.183,16.218-0.112 c11.747,0.255,10.067-16.551,1.118-16.775c-8.747-0.219-14.666-0.085-18.694-0.015C82.342,107.754,82.887,124.521,94.136,124.476z M59.696,121.976l-8.083,0.284v-6.991l-8.083,0.172l-0.161,7.109l-8.094,0.285l0.344,7.223l7.576,0.108l-0.181,7.974h8.599v-7.854 l8.083,0.116V121.976z M98.204,119.188c-5.067,5.066-11.525-2.135-7.141-6.52C95.533,108.2,102.476,114.917,98.204,119.188z M112.932,119.188c-5.067,5.066-11.524-2.135-7.141-6.52C110.261,108.2,117.203,114.917,112.932,119.188z"}))},pt=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).state={showChangeSubmission:!1},e.getSubmissions=function(){e.props.loadSubmissions()},e.stopEvent=function(e){e.stopPropagation()},e.closeToast=function(){e.setState({showChangeSubmission:!1})},e.activateSubmission=function(t){return function(){t.active||t.status!==rt.Succeeded||e.props.activateSubmission(t.submissionId)}},e}return Object(h.a)(a,[{key:"componentDidMount",value:function(){this.props.submissions||this.get
1Submissions()}},{key:"componentDidUpdate",value:function(e){this.checkLastSeenSubmission(e),this.checkActiveSubmissionChange(e)}},{key:"render",value:function(){var e=this.props.team,t=this.state.showChangeSubmission;return e?r.a.createElement("div",null,r.a.createElement("h2",null,"Submissions: ",e.teamName),r.a.createElement("p",{className:lt.a.help},"A successful submission should ",r.a.createElement("code",{className:lt.a.branch},"join")," and ",r.a.createElement("code",{className:lt.a.branch},"start")," a game on ",r.a.createElement("a",{href:"https://message-from-space.readthedocs.io/en/latest/game.html#join",target:"_blank",rel:"noopener noreferrer"},"the alien server"),".",r.a.createElement("br",null),"Note that any starter kit is no longer a successful submission."),this.renderSubmissions(),this.renderHelpMessage(),t&&r.a.createElement(W,{message:"Active submission changed",onClose:this.closeToast})):null}},{key:"renderSubmissions",value:function(){var e=this,t=this.props.submissions;return r.a.createElement("table",{className:lt.a.table},r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",
1null,"#"),r.a.createElement("th",null,"Commit Message"),r.a.createElement("th",null,"Created At"),r.a.createElement("th",null,"Status"),r.a.createElement("th",null,"Build"),r.a.createElement("th",null,"Test"),r.a.createElement("th",null,"In Rating Games"))),r.a.createElement("tbody",null,t&&0===t.length&&r.a.createElement("tr",null,r.a.createElement("td",{colSpan:7,style:{textAlign:"center"}},r.a.createElement("p",null,"No submissions yet."))),t&&t.map((function(t){return e.renderRow(t)}))))}},{key:"renderRow",value:function(e){var t,a,n=this.props.team,o=(t={},Object(ne.a)(t,rt.Failed_Build,"Build failed"),Object(ne.a)(t,rt.Failed_Test,"Test failed"),Object(ne.a)(t,rt.Failed_Unknown,"Failed"),Object(ne.a)(t,rt.Succeeded,"Test passed"),t)[e.status]||e.status,s=-1!==o.toLowerCase().indexOf("failed");return r.a.createElement("tr",{key:e.commitHash+e.createdAt,className:e.status!==rt.Succeeded?"":lt.a.succeeded,onClick:this.activateSubmission(e)},r.a.createElement("td",null,null===(a=e.commitHash)||void 0===a?void 0:a.substring(0,6)),r.a.createElement("td",null,r.a.createElement("span",{className:lt.a.pre},e.branchName&&r.a.createElement("span",{className:lt.a.branch},"[",e.branchName,"] "),e.commitMessage)),r.a.createElement("td",null,r.a.createElement(mt,{dateStr:e.createdAt})),r.a.createElement("td",{className:s?lt.a.statusFailed:""},o),r.a.createElement("td",null,e.buildLogKey&&n&&r.a.createElement("a",{target:"_blank",rel:"noopener nofollow noreferrer",className:lt.a.logLink,onClick:this.stopEvent,href:"https://icfpc2020-api.testkontur.ru/logs/?logKey=".concat(encodeURIComponent(e.buildLogKey),"&apiKey=").concat(n.apiKey)},"Log")),r.a.createElement("td",null,e.attackerTestLogKey&&n&&r.a.createElement("div",null,r.a.createElement("a",{target:"_blank",rel:"noopener nofollow noreferrer",className:lt.a.logLink,onClick:this.stopEvent,href:"https://icfpc2020-api.testkontur.ru/logs/?logKey=".concat(encodeURIComponent(e.attackerTestLogKey),"&apiKey=").concat(n.apiKey)},"Attacker Log")),e.defenderTestLogKey&&n&&r.a.createElement("div",null,r.a.createElement("a",{target:"_blank",rel:"noopener nofollow noreferrer",className:lt.a.logLink,onClick:this.stopEvent,href:"https://icfpc2020-api.testkontur.ru/logs/?logKey=".concat(encodeURIComponent(e.defenderTestLogKey),"&apiKey=").concat(n.apiKey)},"Defender Log"))),r.a.createElement("td",null,e.active?r.a.createElement(dt,null):r.a.createElement("button",{className:lt.a.icon},r.a.createElement(dt,null)," play")))}},{key:"renderHelpMessage",value:function(){return r.a.createElement("div",{className:lt.a.help},r.a.createElement("p",null,"Please note that the ",r.a.createElement("code",{className:lt.a.branch},"[submission]")," branch is required."),r.a.createElement("p",null,"If you need assistance, please read the ",r.a.createElement("a",{href:"https://github.com/icfpcontest2020/dockerfiles/blob/master/README.md",target:"_blank",rel:"noopener noreferrer"},"submission rules"),", then file an ",r.a.createElement("a",{href:"https://github.com/icfpcontest2020/dockerfiles/issues/new?labels=submissions&template=submissions.md&title=Submissions%3A+",target:"_blank",rel:"noopener noreferrer"},"issue"),"."))}},{key:"checkLastSeenSubmission",value:function(e){var t,a;if(this.props.submissions&&this.props.submissions.length>0){var n=this.props.submissions,r=!e.submissions&&Boolean(this.props.submissions),o=e.submissions&&(null===(t=e.submissions[0])||void 0===t?void 0:t.submissionId)!==(null===(a=n[0])||void 0===a?void 0:a.submissionId);if(r||o){var s,i=null===(s=n[0])||void 0===s?void 0:s.submissionId;this.props.updateLastSeenSubmission(i)}}}},{key:"checkActiveSubmissionChange",value:function(e){if(this.props.submissions&&e.submissions){var t=this.props.submissions.find((function(e){return e.active})),a=e.submissions.find((function(e){return e.active}));t&&t.submissionId!==(null===a||void 0===a?void 0:a.submissionId)&&this.setState({showChangeSubmission:!0})}}}]),a}(r.a.Component),vt=function(e){return{type:"LOAD_CURRENT_TOURNAMENT",payload:e}};var ft=function(){return{type:"RUN_NON_RATING_GAME"+pe}};function gt(){return function(){var e=Object(ae.a)(te.a.mark((function e(t,a){var n,r,o,s;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=a(),r=n.team.apiKey,o="".concat(_e,"?").concat(Be({apiKey:r})),e.prev=3,e.next=6,fe(o);case 6:s=e.sent,t({type:"LOAD_SUBMISSIONS",payload:s}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(3),t(je(e.t0));case 13:case"end":return e.stop()}}),e,null,[[3,10]])})));return function(t,a){return e.apply(this,arguments)}}()}
1var yt=Object(c.b)((function(e){return{team:e.team.team,submissions:e.submissions.submissions}}),(function(e){return{loadSubmissions:function(){return e(gt())},updateLastSeenSubmission:function(t){return e((a=We(t),function(e){e({type:"UPDATE_LAST_SEEN_SUBMISSION",payload:a.payload})}));var a},activateSubmission:function(t){return e((a=We(t),function(){var e=Object(ae.a)(te.a.mark((function e(t,n){var r,o,s;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=n(),o=r.team.apiKey,s="".concat((i=a.payload,"".concat(_e,"/").concat(i,"/activate")),"?").concat(Be({apiKey:o})),e.prev=3,e.next=6,ge(s,null);case 6:t({type:"ACTIVATE_SUBMISSION",payload:a.payload}),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),t(je(e.t0));case 12:case"end":return e.stop()}var i}),e,null,[[3,9]])})));return function(t,a){return e.apply(this,arguments)}}()));var a}}}))(pt),bt=(a(114),a(39)),wt=a.n(bt);var Et=function(e){var t=e.location.hash;return r.a.createElement("nav",{className:wt.a.root},r.a.createElement("ul",{className:wt.a.list},e.tabs.map((function(e){return r.a.createElement("li",{className:wt.a.listItem,key:e.text},r.a.createElement(p.b,{to:e.hash,className:wt.a.link+(t===e.hash?" "+wt.a.active:"")},e.text))}))))},St=a(55),xt=a(4),kt=a.n(xt),_t=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(e=t.call.apply(t,[this].concat(o))).state={sortBy:z,sortDirection:At.decrease},e.cellForProblem=function(t){var a=e.state,n=a.sortBy,o=a.sortDirection,s=t.problemId,i=t.description;"request"===s&&(s="R"),"submission"===s&&(s="T",i="Made submission passed the test"),s.startsWith("tutorial")&&(s=s.replace("tutorial:",""));var l="".concat(kt.a.sortButton," ").concat(n===t.problemId?o===At.decrease?kt.a.sortDown:kt.a.sortUp:"");return r.a.createElement("th",{key:t.problemId,className:kt.a.alignRight,title:i},r.a.createElement("button",{onClick:e.changeSorted(t.problemId),className:l},s))},e.renderRow=function(t,a){var n=e.props,o=n.team,s=n.scoreboard,i=t.team;return r.a.createElement("tr",{key:a,className:(null===o||void 0===o?void 0:o.teamId)===i.teamId?kt.a.activeTeam:""},r.a.createElement("td",{className:kt.a.alignCenter},a+1),Vt.renderTeamName(i),s.problems.map((function(a){return e.renderScoreCell(a,t)})),r.a.createElement("td",{className:kt.a.score},t.score),r.a.createElement("td",{className:kt.a.alignRight},r.a.createElement(mt,{dateStr:t.solvedAt})))},e.changeSorted=function(t){return function(){if(t!==e.state.sortBy)e.setState({sortBy:t,sortDirection:At.decrease});else{var a=e.state.sortDirection===At.decrease?At.increase:At.decrease;e.setState({sortDirection:a})}}},e}return Object(h.a)(a,[{key:"render",value:function(){var e=this.state,t=e.sortBy,a=e.sortDirection,n=this.props,o=n.scoreboard,s=n.team,i=Object(St.a)(o.teams).sort(function(e,t){return function(a,n){var r,o;if(e===z)r={score:a.score,solvedAt:a.solvedAt},o={score:n.score,solvedAt:n.solvedAt};else{var s=a.problems[e],i=n.problems[e];r=s||{score:0,solvedAt:new Date(0)},o=i||{score:0,solvedAt:new Date(0)}}return t===At.decrease?r.score>o.score?-1:r.score<o.score?1:r.solvedAt<o.solvedAt?-1:r.solvedAt>o.solvedAt?1:0:r.score<o.score?-1:r.score>o.score?1:r.solvedAt>o.solvedAt?-1:r.solvedAt<o.solvedAt?1:0}}(t,a)),l=!!o.frozenAt&&new Date(o.frozenAt)<=new Date;return r.a.createElement(r.a.Fragment,null,r.a.createElement("h2",null,"Scoreboard",s&&": "+s.teamName," ",l&&r.a.createElement("span",{className:kt.a.frozenTitle}," (frozen at ",r.a.createElement(mt,{dateStr:o.frozenAt}),")")),r.a.createElement("table",{className:kt.a.table},this.renderHead(i),r.a.createElement("tbody",null,i&&i.map(this.renderRow))))}},{key:"renderHead",value:function(e){var t=this,a=this.props,n=a.scoreboard,o=a.team,s=this.state,i=s.sortBy,l=s.sortDirection,c=n.problems.length>0,u=c?2:1,h="".concat(kt.a.sortButton," ").concat(i===z?l===At.decrease?kt.a.sortDown:kt.a.sortUp:"");return r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",{style:{width:40},rowSpan:u},"#"),r.a.createElement("th",{rowSpan:u,className:kt.a.alignLeft},"Team Name"),c&&r.a.createElement("th",{colSpan:n.problems.length},"Problems"),r.a.createElement("th",{style:{width:70},className:kt.a.score,rowSpan:u}
1,r.a.createElement("button",{className:h,onClick:this.changeSorted(z)},"Score")),r.a.createElement("th",{rowSpan:u,className:kt.a.alignRight},"Solved at")),c&&r.a.createElement("tr",null,n.problems.map(this.cellForProblem)),e&&e.map((function(e,t){return{team:e,i:t}})).filter((function(e){return e.team.team.teamId===(null===o||void 0===o?void 0:o.teamId)&&e.i>5})).map((function(e){return t.renderRow(e.team,e.i)})))}},{key:"renderScoreCell",value:function(e,t){return r.a.createElement("td",{key:e.problemId,className:kt.a.alignRight,title:e.problemId in t.problems?"Solved at ".concat(Vt.createDate(t.problems[e.problemId].solvedAt)):void 0},e.problemId in t.problems?t.problems[e.problemId].score:r.a.createElement("span",{className:kt.a.lighten},"\u2014"))}}]),a}(r.a.Component);var Tt=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(e){var n;Object(u.a)(this,a),(n=t.call(this,e)).renderTournamentHeadCell=function(e){var t=n.state,a=t.sortBy,o=t.openTournament,s="".concat(kt.a.sortButton," ").concat(a===e.tournamentId?kt.a.sortDown:""),i=o===e.tournamentId,l=r.a.createElement("button",{onClick:n.changeSorted(e.tournamentId),className:s},e.tournamentId),c="".concat(kt.a.smallRow);return r.a.createElement("td",{key:e.tournamentId,rowSpan:i?1:2,colSpan:i?4:1,className:i?c:kt.a.alignRight,title:e.startedAt?"Started at ".concat(Vt.createDate(e.startedAt)):void 0},i?e.tournamentId:l)},n.renderOpenTournamentHeadCell=function(e){var t=n.state.sortBy,a="".concat(kt.a.sortButton," ").concat(t===e.tournamentId?kt.a.sortDown:""),o="".concat(kt.a.alignRight," ").concat(kt.a.details),s="".concat(kt.a.alignRight," ").concat(kt.a.details," ").concat(kt.a.sortDetails);return[r.a.createElement("td",{key:"rating",className:o},"Rating"),r.a.createElement("td",{key:"mu",className:o},"\u03bc"),r.a.createElement("td",{key:"sigma",className:o},"\u03c3"),r.a.createElement("td",{key:e.tournamentId,className:s,title:e.startedAt?"Started at ".concat(Vt.createDate(e.startedAt)):void 0},r.a.createElement("button",{onClick:n.changeSorted(e.tournamentId),className:a},"Score"))]},n.renderRow=function(e,t){var a,o=n.props.scoreboard,s=n.props.team,i=e.team;return r.a.createElement("tr",{key:e.team.teamId,className:(null===s||void 0===s?void 0:s.teamId)===i.teamId?kt.a.activeTeam:""},r.a.createElement("td",{className:kt.a.alignRight},t+1),Vt.renderTeamName(i,t+1),r.a.createElement("td",null,null===(a=e.tournaments[8])||void 0===a?void 0:a.submission.platform),o.tournaments.filter(It).map((function(t){return n.renderTournamentCell(t,e)})),r.a.createElement("td",{className:kt.a.score},e.score))},n.renderTournamentCell=function(e,t){var a=n.state.openTournament===e.tournamentId,o=e.tournamentId in t.tournaments,s="".concat(kt.a.alignRight," ").concat(kt.a.details),i="".concat(kt.a.alignRight," ").concat(kt.a.details," ").concat(kt.a.sortDetails);return[a&&r.a.createElement("td",{key:"rating",className:s},o&&t.tournaments[e.tournamentId].rating.conservativeRating.toFixed(2)),a&&r.a.
1createElement("td",{key:"mu",className:s},o&&t.tournaments[e.tournamentId].rating.mu.toFixed(2)),a&&r.a.createElement("td",{key:"sigma",className:s},o&&t.tournaments[e.tournamentId].rating.sigma.toFixed(2)),r.a.createElement("td",{key:e.tournamentId,className:a?i:kt.a.alignRight},o?t.tournaments[e.tournamentId].score:r.a.createElement("span",{className:kt.a.lighten},"\u2014"))]},n.changeSorted=function(e){return function(){e!==n.state.sortBy&&n.setState({sortBy:e,openTournament:"string"===typeof e?n.state.openTournament:e})}};var o=a.getCurrentTournament(e.scoreboard.tournaments);return n.state={sortBy:z,openTournament:(null===o||void 0===o?void 0:o.tournamentId)||null,currentTournament:o},n}return Object(h.a)(a,[{key:"render",value:function(){var e=this.props,t=e.scoreboard,a=e.team,n=this.state.sortBy,o=!!t.frozenAt&&new Date(t.frozenAt)<=new Date,s=Object(St.a)(t.teams).sort(function(e){return function(t,a){var n=e===z?t.score:t.tournaments[e],r=e===z?a.score:a.tournaments[e];if(!n&&!r)return 0;if(!n&&r)return 1;if(n&&!r)return-1;var o="number"===typeof n?n:n.rating.conservativeRating||0,s="number"===typeof r?r:r.rating.conservativeRating||0;return o>s?-1:o<s?1:0}}(n));return r.a.createElement(r.a.Fragment,null,r.a.createElement("h2",null,"Scoreboard",a&&": "+a.teamName," ",o&&r.a.createElement("span",{className:kt.a.frozenTitle}," (frozen at ",r.a.createElement(mt,{dateStr:t.frozenAt}),")")),this.renderTopText(),r.a.createElement("table",{className:kt.a.table},this.renderHead(s),r.a.createElement("tbody",null,s.map(this.renderRow))))}},{key:"renderTopText",value:function(){var e=this.state.currentTournament;return r.a.createElement(r.a.Fragment,null,r.a.createElement("p",{className:kt.a.help},"Ratings are calculated using ",r.a.createElement("a",{href:"https://en.wikipedia.org/wiki/TrueSkill",target:"_blank",rel:"noopener noreferrer"},"TrueSkill ranking system"),". Read more about stages and scoring in ",r.a.createElement("a",{href:"https://message-from-space.readthedocs.io/en/latest/game.html#scoring",target:"_blank",rel:"noopener noreferrer"},"our documentation"),"."),e&&r.a.createElement("p",{className:kt.a.help},"Current stage #",null===e||void 0===e?void 0:e.tournamentId," ends ",r.a.createElement(mt,{dateStr:(null===e||void 0===e?void 0:e.finishedAt)||""})))}},{key:"renderHead",value:function(e){var t=this,a=this.props,n=a.scoreboard,o=a.team,s=this.state,i=s.sortBy,l=s.openTournament,c=n.tournaments,u=c.filter(It),h="".concat(kt.a.sortButton," ").concat(i===z?kt.a.sortDown:""),m=c.find((function(e){return e.tournamentId===l}));return r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",{style:{width:40},rowSpan:3},"#"),r.a.createElement("th",{rowSpan:3,className:kt.a.alignLeft},"Team Name"),r.a.createElement("th",{rowSpan:3,className:kt.a.alignLeft},"Platform"),r.a.createElement("th",{colSpan:u.length+(m?3:0)},"Stages"),r.a.createElement("th",{style:{width:70},className:kt.a.score,rowSpan:3}
1,r.a.createElement("button",{onClick:this.changeSorted(z),className:h},"Total Score"))),r.a.createElement("tr",null,u.map(this.renderTournamentHeadCell)),r.a.createElement("tr",null,m&&this.renderOpenTournamentHeadCell(m)),e&&e.map((function(e,t){return{team:e,i:t}})).filter((function(e){return e.team.team.teamId===(null===o||void 0===o?void 0:o.teamId)&&e.i>5})).map((function(e){return t.renderRow(e.team,e.i)})))}}],[{key:"getCurrentTournament",value:function(e){return e.find((function(e){return e.acceptSubmissions&&e.runGames}))}}]),a}(r.a.Component);function It(e){return!(!e.acceptSubmissions||!e.runGames)||!e.acceptSubmissions}var At,Ot=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(e=t.call.apply(t,[this].concat(o))).renderRow=function(t,a){var n=e.props.team,o=t.team;return r.a.createElement("tr",{key:a,className:(null===n||void 0===n?void 0:n.teamId)===o.teamId?kt.a.activeTeam:""},r.a.createElement("td",{className:kt.a.alignCenter},a+1),Vt.renderTeamName(o),r.a.createElement("td",null,t.submission.platform),r.a.createElement("td",{className:kt.a.score},"number"===typeof t.score?t.score:"?"))},e}return Object(h.a)(a,[{key:"render",value:function(){var e=this.props,t=e.scoreboard,a=e.team;return r.a.createElement(r.a.Fragment,null,r.a.createElement("h2",null,"Scoreboard",a&&": "+a.teamName),r.a.createElement("table",{className:kt.a.table},this.renderHead(),r.a.createElement("tbody",null,t.teams&&t.teams.map(this.renderRow))))}},{key:"renderHead",value:function(){var e=this,t=this.props,a=t.scoreboard,n=t.team;return r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",{style:{width:40}},"#"),r.a.createElement("th",{className:kt.a.alignLeft}
1,"Team Name"),r.a.createElement("th",null,"Platform"),r.a.createElement("th",{style:{width:70},className:kt.a.score},"Score")),a.teams&&a.teams.map((function(e,t){return{team:e,i:t}})).filter((function(e){return e.team.team.teamId===(null===n||void 0===n?void 0:n.teamId)&&e.i>5})).map((function(t){return e.renderRow(t.team,t.i)})))}}]),a}(r.a.Component);!function(e){e.increase="increase",e.decrease="decrease"}(At||(At={}));var Nt=[{text:"Lightning",hash:M},{text:"Full Round",hash:D},{text:"Final",hash:j}],Rt=ce,Vt=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){return Object(u.a)(this,a),t.apply(this,arguments)}return Object(h.a)(a,[{key:"componentDidMount",value:function(){this.props.loadProblemScoreboard(),this.props.loadTotalScoreboard(),this.props.loadFinalScoreboard()}},{key:"render",value:function(){var e=this.props,t=e.location,a=e.totalScoreboard,n=e.lightningScoreboard,o=e.finalScoreboard,s=t.hash;return r.a.createElement("div",null,r.a.createElement(Et,{tabs:Nt,location:t}),s===M&&n&&r.a.createElement(_t,{team:this.props.team,scoreboard:n}),(!s||s===D)&&a&&r.a.createElement(Tt,{team:this.props.team,scoreboard:a}),s===j&&o&&r.a.createElement(Ot,{team:this.props.team,scoreboard:o}))}}],[{key:"renderTeamName",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,a=e.customData.country,n=Rt.find((function(e){return e.value===a})),o="The Cat is #1!!"===e.teamName&&-1!==t?"The Cat is #1!!".replace("1","".concat(t)):e.teamName;return r.a.createElement("td",null,r.a.createElement("span",{className:"flag-icons ".concat(null===n||void 0===n?void 0:n.shortValue),title:null===n||void 0===n?void 0:n.text}),"\xa0",o)}},{key:"createDate",value:function(e){var t=new Date(e);return ht.format(t)}}]),a}(r.a.Component),Ct=Vt;function Lt(){return function(){var e=Object(ae.a)(te.a.mark((function e(t){var a;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fe(Oe);case 3:a=e.sent,t({type:"LOAD_PROBLEM_SCOREBOARD",payload:a}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(je(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()}function Mt(){return function(){var e=Object(ae.a)(te.a.mark((function e(t){var a;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fe(Ae);case 3:a=e.sent,t({type:"LOAD_SCOREBOARD",payload:a}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(je(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}()}var Dt=Object(c.b)((function(e){return{team:e.team.team,lightningScoreboard:e.scoreboard.lightningScoreboard,totalScoreboard:e.scoreboard.totalScoreboard,finalScoreboard:e.scoreboard.finalScoreboard}}),(function(e){return{loadProblemScoreboard:function(){return e(Lt())},loadTotalScoreboard:function(){return e(Mt())},loadFinalScoreboard:function(){return e(function(){var e=Object(ae.a)(te.a.mark((function e(t){var a;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,fe(Ne);case 3:a=e.sent,t({type:"LOAD_FINAL_SCOREBOARD",payload:a}),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),t(je(e.t0));case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}())}}}))(Ct),jt=a(71),Pt=a.n(jt),Gt=a(89),Bt=a.n(Gt),Ft=a(40),zt=a.n(Ft);var Ut=function(e){var t=e.title,a=e.date,n=e.author,o=e.text,s=e.isInList,i=e.id,l=new Intl.DateTimeFormat("en-GB",{timeZoneName:"short",hour:"numeric",minute:"2-digit",month:"long",day:"numeric",year:"numeric"});return r.a.createElement("article",{className:zt.a.root+" container"},r.a.createElement("header",{className:zt.a.header},function(e,t,a){if(!e)return r.a.createElement("h2",{className:zt.a.title},t);return r.a.createElement("h3",{className:zt.a.title},r.a.createElement(p.b,{to:"".concat(N,"/").concat(a)},t))}(s,t,i),r.a.createElement("div",{className:zt.a.subtitle},r.a.createElement("time",null,l.format(new Date(a))),", by ",n)),r.a.createElement(Bt.a,{linkTarget:"_blank",escapeHtml:!1,source:o}))};function Kt(e){return r.a.createElement("main",{className:Pt.a.root},e.posts.map((function(e){return r.a.createElement("div",{className:Pt.a.listItem,key:e.id},r.a.createElement(Ut,Object.assign({},e,{isInList:!0})))})))}var Wt=a(44),Ht=a(45),Zt=[{text:"Contest Updates",hash:R},{text:"Pegovka",hash:V}];var Jt=function(e){var t=e.location,a=t.hash;return r.a.createElement("div",null,r.a.createElement(Et,{tabs:Zt,location:t}),r.a.createElement(Kt,{posts:a===V?Wt:Ht}))},Yt=a(49),Qt=a.n(Yt);var qt,Xt=function(e){var t=e.match.params.postId,a=Wt.findIndex((function(e){return e.id===parseInt(t,10)})),n=Ht.findIndex((function(e){return e.id===parseInt(t,10)}));if(-1===a&&-1===n)return r.a.createElement("p",null,"404: Post Not Found");var o=-1!==a?a:n,s=-1!==a?Wt:Ht,i=s[o],l=o>0&&s[o-1],c=o<s.length-1&&s[o+1];return r.a.createElement("div",{className:Qt.a.root},r.a.createElement(Ut,Object.assign({},i,{isInList:!1})),r.a.createElement("footer",{className:Qt.a.footer+" container"}
1,r.a.createElement("div",{className:Qt.a.footerItem},c&&r.a.createElement(r.a.Fragment,null,"Prev: ",r.a.createElement(p.b,{to:"".concat(N,"/").concat(c.id)},c.title))),r.a.createElement("div",{className:Qt.a.footerItem},l&&r.a.createElement(r.a.Fragment,null,"Next: ",r.a.createElement(p.b,{to:"".concat(N,"/").concat(l.id)},l.title)))))},$t=a(28),ea=a.n($t),ta=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(e=t.call.apply(t,[this].concat(o))).state={attacker:null,defender:null},e.renderSubmissionRow=function(t){var a;return r.a.createElement("tr",{key:t.commitHash+t.createdAt},r.a.createElement("td",null,t.submissionId),r.a.createElement("td",null,null===(a=t.commitHash)||void 0===a?void 0:a.substr(0,6)),r.a.createElement("td",{className:ea.a.pre},t.commitMessage),r.a.createElement("td",{className:ea.a.buttons},e.renderRunButton(t.submissionId,"attacker"),e.renderRunButton(t.submissionId,"defender")))},e.chooseDefender=function(t){var a=t.target.value;e.setState({defender:a})},e.chooseAttacker=function(t){var a=t.target.value;e.setState({attacker:a})},e.clearSelection=function(){e.setState({defender:null,attacker:null})},e.runSelection=function(){var t=e.state,a=t.attacker,n=t.defender;a&&n&&(e.props.runNonRatingGame({attacker:a,defender:n}),e.setState({attacker:null,defender:null}))},e}return Object(h.a)(a,[{key:"componentDidMount",value:function(){var e=this.props,t=e.submissions,a=e.loadSubmissions,n=e.loadOtherTeamSubmissions;t||a(),n()}},{key:"render",value:function(){var e=this.props.justStarted,t=this.state,a=t.attacker,n=t.defender;return r.a.createElement("div",{className:ea.a.root},this.renderUserSubmissions(),this.renderOtherTeamsSubmissions(),(a||n)&&r.a.createElement(W,{message:this.renderToastContent()}),e&&!a&&!n&&r.a.createElement(W,{message:this.renderSuccessToastContent()}))}},{key:"renderUserSubmissions",value:function(){var e=this.props.submissions;return r.a.createElement("div",null,r.a.createElement("h3",null,"Your submissions"),r.a.createElement("table",{className:ea.a.table},r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",
1null,"Id"),r.a.createElement("th",null,"Hash"),r.a.createElement("th",null,"Commit message"),r.a.createElement("th",null,"Choose"))),r.a.createElement("tbody",null,null===e||void 0===e?void 0:e.filter((function(e){return e.status===rt.Succeeded})).map(this.renderSubmissionRow))))}},{key:"renderOtherTeamsSubmissions",value:function(){var e=this,t=this.props.otherTeams;return r.a.createElement("div",null,r.a.createElement("h3",null,"Other"),r.a.createElement("table",{className:ea.a.table},r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",null,"#"),r.a.createElement("th",null,"Team name"),r.a.createElement("th",null,"Choose"))),r.a.createElement("tbody",null,null===t||void 0===t?void 0:t.map((function(t,a){return e.renderOtherTeamSubmissionRow(t,a,e.props.team)})))))}},{key:"renderOtherTeamSubmissionRow",value:function(e,t,a){return a&&a.teamId===e.team.teamId?null:r.a.createElement("tr",{key:e.team.teamId},r.a.createElement("td",null,t+1),r.a.createElement("td",null,e.team.teamName),r.a.createElement("td",{className:ea.a.buttons},this.renderRunButton(e.submissionId,"attacker"),this.renderRunButton(e.submissionId,"defender")))}},{key:"renderRunButton",value:function(e,t){var a=this.state[t],n=e.toString()===a,o="attacker"===t?"orange":"teal";return r.a.createElement("label",{className:ea.a.chooseButton,title:"play as ".concat(t)},r.a.createElement("input",{type:"radio",name:t,value:e,onChange:"attacker"===t?this.chooseAttacker:this.chooseDefender,checked:n,className:ea.a.radio}),r.a.createElement(dt,{color:!a||n?o:"grey"}))}},{key:"renderToastContent",value:function(){var e=this.state,t=e.attacker,a=e.defender;return r.a.createElement("div",null,this.createToastText(),r.a.createElement("button",{className:ea.a.toastButton,onClick:this.clearSelection},"cancel"),t&&a&&r.a.createElement("button",{className:ea.a.toastButton,onClick:this.runSelection},"run"))}},{key:"renderSuccessToastContent",value:function(){return r.a.createElement("div",null,"Non Rating game is running. It will be ",r.a.createElement(p.b,{to:I+L},"here"))}},{key:"createToastText",value:function(){var e=this.state,t=e.attacker,a=e.defender,n="You choose ";return t&&(n+="".concat(this.createSubmissionText(t)," as attacker")),t&&a&&(n+=" and "),a&&(n+="".concat(this.createSubmissionText(a)," as defender")),n}},{key:"createSubmissionText",value:function(e){var t=this.props,a=t.submissions,n=t.otherTeams,r=null===a||void 0===a?void 0:a.find((function(t){return t.submissionId.toString()===e})),o=null===n||void 0===n?void 0:n.find((function(t){return t.submissionId.toString()===e}));return r?"your submission #".concat(e):o?"team ".concat(o.team.teamName,"#").concat(e," submission"):"submission #".concat(e)}}]),a}(r.a.Component),aa=Object(c.b)((function(e){return{team:e.team.team,submissions:e.submissions.submissions,otherTeams:e.submissions.otherTeamSubmissions,justStarted:e.submissions.justStarted}}),(function(e){return{loadSubmissions:function(){return e(gt())},loadOtherTeamSubmissions:function(){return e(function(){var e=Object(ae.a)(te.a.mark((function e(t,a){var n,r,o,s,i,l,c;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a(),r=n.team.apiKey,o=n.tournament.current,e.prev=3,o){e.next=12;break}return e.next=7,fe(Ve);case 7:i=e.sent,t(vt(i)),s=i.tournamentId,e.next=13;break;case 12:s=o.tournamentId;case 13:return l="".concat(Te,"?").concat(Be({apiKey:r,tournamentId:s})),e.next=16,fe(l);case 16:c=e.sent,t({type:"LOAD_OTHER_TEAMS_SUBMISSION",payload:c}),e.next=23;break;case 20:e.prev=20,e.t0=e.catch(3),t(je(e.t0));case 23:case"end":return e.stop()}}),e,null,[[3,20]])})));return function(t,a){return e.apply(this,arguments)}}())},runNonRatingGame:function(t){return e((a=We(t),function(){var e=Object(ae.a)(te.a.mark((function e(t,n){var r,o,s;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t({type:"RUN_NON_RATING_GAME"+de}),r=n(),o=r.team.apiKey,s="".concat(Me,"?").concat(Be({apiKey:o,attackerSubmissionId:a.payload.attacker,defenderSubmissionId:a.payload.defender})),e.prev=4,e.next=7,ge(s,null);case 7:t({type:"RUN_NON_RATING_GAME_SUCCESS"}),setTimeout((function(){return t(ft())}),3e3),e.next=15;break;case 11:e.prev=11,e.t0=e.catch(4),t(je(e.t0)),t(ft());case 15:case"end":return e.stop()}}),e,null,[[4,11]])})));return function(t,a){return e.apply(this,arguments)}}()));var a}}}))(ta),na=a(58),ra=a.n(na);!function(e){e.Nobody="Nobody",e.Attacker="Attacker",e.Defender="Defender"}(qt||(qt={}));var oa,sa,ia,la=[{text:"Rating",hash:C},{text:"Non-Rating",hash:L}];!function(e){e.attacker="attacker",e.defender="defender"}
1(oa||(oa={})),(ia=sa||(sa={})).inProgress="In progress",ia.win="Win",ia.lose="Lose",ia.draw="Draw";var ca=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return(e=t.call.apply(t,[this].concat(o))).renderRow=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=e.props.team,o=e.calcGameResult(t);return r.a.createElement("tr",{key:t.gameId},r.a.createElement("td",{className:o?ra.a[o]:void 0,style:{whiteSpace:"nowrap"}},o),r.a.createElement("td",null,t.attacker.team.teamName,a&&(null===n||void 0===n?void 0:n.teamId)===t.attacker.team.teamId?" #"+t.attacker.submissionId:""),r.a.createElement("td",null,t.defender.team.teamName,a&&(null===n||void 0===n?void 0:n.teamId)===t.defender.team.teamId?" #"+t.defender.submissionId:""),r.a.createElement("td",null,o===sa.inProgress?null:e.renderLogLinks(t)),r.a.createElement("td",null,o!==sa.inProgress&&void 0!==t.ticks&&t.ticks>=0&&r.a.createElement("a",{href:"/#".concat(A,"?game=").concat(t.gameId),rel:"noopener noreferrer",target:"_blank"},"Watch")),r.a.createElement("td",null,e.renderStats(t)))},e}return Object(h.a)(a,[{key:"componentDidMount",value:function(){this.props.ratingGames||this.props.loadRatingGames(),this.props.nonRatingGames||this.props.loadNonRatingGames()}},{key:"render",value:function(){var e=this.props.location.hash;return r.a.createElement("div",null,r.a.createElement(Et,{tabs:la,location:this.props.location}),(!e||e===C)&&this.renderRatingGames(),e===L&&this.renderNonRatingGames())}},{key:"renderRatingGames",value:function(){var e=this,t=this.props.ratingGames;return r.a.createElement("table",{className:ra.a.table},this.renderTableHeader(),r.a.createElement("tbody",null,t&&t.map((function(t){return e.renderRow(t)}))))}},{key:"renderNonRatingGames",value:function(){var e=this,t=this.props.nonRatingGames;return r.a.createElement("table",{className:ra.a.table},this.renderTableHeader(),r.a.createElement("tbody",null,t&&t.map((function(t){return e.renderRow(t,!0)}))))}},{key:"renderTableHeader",value:function(){return r.a.createElement("thead",null,r.a.createElement("tr",null,r.a.createElement("th",
1null,"Result"),r.a.createElement("th",null,"Attacker"),r.a.createElement("th",null,"Defender"),r.a.createElement("th",null,"Logs"),r.a.createElement("th",null,"Viz"),r.a.createElement("th",null,"Stats")))}},{key:"renderLogLinks",value:function(e){var t=this.props.team;return r.a.createElement(r.a.Fragment,null,e.attacker.debugLog&&r.a.createElement("div",null,r.a.createElement("a",{href:"".concat(De,"?").concat(Be({logKey:e.attacker.debugLog,apiKey:null===t||void 0===t?void 0:t.apiKey})),rel:"noopener noreferrer",target:"_blank"},"attacker debug log")),e.defender.debugLog&&r.a.createElement("div",null,r.a.createElement("a",{href:"".concat(De,"?").concat(Be({logKey:e.defender.debugLog,apiKey:null===t||void 0===t?void 0:t.apiKey})),rel:"noopener noreferrer",target:"_blank"},"defender debug log")))}},{key:"renderStats",value:function(e){return r.a.createElement(r.a.Fragment,null,e.createdAt&&r.a.createElement("div",{style:{whiteSpace:"nowrap"}},"Start: ",r.a.createElement(mt,{dateStr:e.createdAt})),e.finishedAt&&r.a.createElement("div",{style:{whiteSpace:"nowrap"}},"Finish: ",r.a.createElement(mt,{dateStr:e.finishedAt})),!!e.ticks&&r.a.createElement("div",{style:{whiteSpace:"nowrap"}},"Duration: ",e.ticks||0," ",1!==e.ticks?"ticks":"tick"),e.defender.timeout&&r.a.createElement("div",{style:{whiteSpace:"nowrap"}},"Defender timeout"),e.attacker.timeout&&r.a.createElement("div",{style:{whiteSpace:"nowrap"}},"Attacker timeout"))}},{key:"calcGameResult",value:function(e){var t=this.props.team;if(!t)return null;if(!e.winner)return sa.inProgress;if(e.winner===qt.Nobody)return sa.draw;var a=null;return e.attacker.team.teamId===t.teamId&&(a=oa.attacker),e.defender.team.teamId===t.teamId&&(a=oa.defender),a&&e.attacker.team.teamId!==e.defender.team.teamId?e.winner.toLowerCase()===a?sa.win:sa.lose:e.winner+" wins"}}]),a}(r.a.Component);function ua(){return function(){var e=Object(ae.a)(te.a.mark((function e(t,a){var n,r,o,s,i,l,c;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a(),r=n.team.apiKey,o=n.tournament.current,e.prev=3,o){e.next=12;break}return e.next=7,fe(Ve);case 7:i=e.sent,t(vt(i)),s=i.tournamentId,e.next=13;break;case 12:s=o.tournamentId;case 13:return l="".concat(Le,"?").concat(Be({apiKey:r,tournamentId:s})),e.next=16,fe(l);case 16:c=e.sent,t({type:"LOAD_NON_RATING_GAMES",payload:c}),e.next=23;break;case 20:e.prev=20,e.t0=e.catch(3),t(je(e.t0));case 23:case"end":return e.stop()}}),e,null,[[3,20]])})));return function(t,a){return e.apply(this,arguments)}}()}var ha=Object(c.b)((function(e){var t,a;return{team:e.team.team,ratingGames:null===(t=e.games.rating)||void 0===t?void 0:t.games,nonRatingGames:null===(a=e.games.nonRating)||void 0===a?void 0:a.games}}),(function(e){return{loadRatingGames:function(){return e(function(){var e=Object(ae.a)(te.a.mark((function e(t,a){var n,r,o,s,i,l,c;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=a(),r=n.team.apiKey,o=n.tournament.current,e.prev=3,o){e.next=12;break}return e.next=7,fe(Ve);case 7:i=e.sent,t(vt(i)),s=i.tournamentId,e.next=13;break;case 12:s=o.tournamentId;case 13:return l="".concat(Ce,"?").concat(Be({apiKey:r,tournamentId:s})),e.next=16,fe(l);case 16:c=e.sent,t({type:"LOAD_RATING_GAMES",payload:c}),e.next=23;break;case 20:e.prev=20,e.t0=e.catch(3),t(je(e.t0));case 23:case"end":return e.stop()}}),e,null,[[3,20]])})));return function(t,a){return e.apply(this,arguments)}}())},loadNonRatingGames:function(){return e(ua())}}}))(ca);function ma(e){var t=e.team,a=e.isTeamLoading;return r.a.createElement(v.d,null,r.a.createElement(v.b,{exact:!0,path:"/",component:Y}),r.a.createElement(v.b,{path:w,component:Q}),r.a.createElement(v.b,{path:E,children:function(){return da(t,r.a.createElement(He,null))}}),r.a.createElement(v.b,{path:S,children:function(){return da(t,r.a.createElement(Qe,null))}}),r.a.createElement(v.b,{path:x,children:function(){return pa(t,a,r.a.createElement(st,null))}}),r.a.createElement(v.b,{path:k,children:function(){return pa(t,a,r.a.createElement(yt,null))}}),r.a.createElement(v.b,{path:_,component:Dt}),r.a.createElement(v.b,{path:O,component:Jt}),r.a.createElement(v.b,{path:"".concat(N,"/:postId"),component:Xt}),r.a.createElement(v.b,{path:T,children:function(){return pa(t,a,r.a.createElement(aa,null))}}),r.a.createElement(v.b,{path:I,children:function(e){var n=e.location;return pa(t,a,r.a.createElement(ha,{location:n}))}}),r.a.createElement(v.b,{path:_,children:function(e){var t=e.location;return r.a.createElement(Dt,{location:t})}}))}function da(e,t){return e?r.a.createElement(v.a,{to:x}):t}function pa(e,t,a){return e||t?e?a:null:r.a.createElement(v.a,{to:S})}var va,fa,ga,ya,ba=a(72),wa=a(92);!function(e){e.Submission="Submission",e.Scoreboard="Scoreboard",e.LightningScoreboard="LightningScoreboard",e.NonRatingGame="NonRatingGame",e.Team="Team"}(va||(va={})),function(e){e.Added="Added",e.BuildStatusChanged="BuildStatusChanged",e.Activated="Activated",e.TestStatusChanged="TestStatusChanged"}(fa||(fa={})),function(e){e.Added="Added",e.Finished="Finished"}(ga||(ga={})),function(e){e.Updated="Updated",e.Activated="Activated",e.Deactivated="Deactivated"}(ya||(ya={}));var Ea,Sa,xa,ka,_a,Ta=a(15);a(197);function Ia(e){return{role:e[0],score:e[1],status:e[2]}}function Aa(e){return{planet:e[0]&&e[0][1]?Oa(e[0]):void 0,ticks:e[1].map(Na)}}function Oa(e){return{radius:e[0],safeRadius:e[1]}}function Na(e){return{tick:e[0],ships:e[1].map(Ra)}}function Ra(e){return{ship:Va(e[0]),appliedCommands:e[1].map((function(e){return function(e){var t=e[0];switch(t){case ka.SplitShip:return{type:t,matter:{fuel:e[1][0],lasers:e[1][1],radiators:e[1][2],engines:e[1][3]}};case ka.BurnFuel:return{type:t,velocity:{x:e[1][0],y:e[1][1]}};case ka.Detonate:return{type:t,power:e[1],powerDecreaseStep:e[2]};case ka.Shoot:return{type:t,target:{x:e[1][0],y:e[1][1]},power:e[2],damage:e[3],damageDecreaseFactor:e[4]};default:return null}}(e)}))}}function Va(e){return{role:e[0],shipId:e[1],position:{x:e[2][0],y:e[2][1]},velocity:{x:e[3][0],y:e[3][1]},matter:{fuel:e[4][0],lasers:e[4][1],radiators:e[4][2],engines:e[4][3]},temperature:e[5],criticalTemperature:e[6],maxFuelBurnSpeed:e[7]}}!function(e){e[e.AttackDefense=0]="AttackDefense",e[e.Tutorial_Fly=1]="Tutorial_Fly",e[e.Tutorial_Detonate=2]="Tutorial_Detonate",e[e.Tutorial_Burn=3]="Tutorial_Burn",e[e.Tutorial_BurnWithOverheat=4]="Tutorial_BurnWithOverheat",e[e.Tutorial_Radiators=5]="Tutorial_Radiators",e[e.Tutorial_ShootOne=6]="Tutorial_ShootOne",e[e.Tutorial_ShootZeroTempTarget=7]="Tutorial_ShootZeroTempTarget",e[e.Tutorial_ShootAttackers=8]="Tutorial_ShootAttackers",e[e.Tutorial_FlyAndShootTarget=9]="Tutorial_FlyAndShootTarget",e[e.Tutorial_Split=10]="Tutorial_Split",e[e.Tutorial_Planet=11]="Tutorial_Planet",e[e.Tutorial_ShootSatellite=12]="Tutorial_ShootSatellite",e[e.Tutorial_KillDefenderBoss=13]="Tutorial_KillDefenderBoss"}(Ea||(Ea={})),function(e){e[e.New=0]="New",e[e.Joined=1]="Joined",e[e.InProgress=2]="InProgress",e[e.Finished=3]="Finished"}(Sa||(Sa={})),function(e){e[e.NotJoined=0]="NotJoined",e[e.Thinking=1]="Thinking",e[e.ReadyToGo=2]="ReadyToGo",e[e.Won=3]="Won",e[e.Lost=4]="Lost",e[e.Tied=5]="Tied"}(xa||(xa={})),function(e){e[e.BurnFuel=0]="BurnFuel",e[e.Detonate=1]="Detonate",e[e.Shoot=2]="Shoot",e[e.SplitShip=3]="SplitShip"}(ka||(ka={})),function(e){e[e.Attacker=0]="Attacker",e[e.Defender=1]="Defender"}(_a||(_a={}));var Ca,La=function(){function e(t,a){Object(u.a)(this,e),this.ctx=void 0,this.canvas=void 0,this.cellSize=void 0,this.ctx=t,this.canvas=a,this.cellSize=10}return Object(h.a)(e,[{key:"clearSpace",value:function(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height)}},{key:"drawTrajectories",value:function(e,t){if(t){this.ctx.globalAlpha=.5;var a,n=Object(Ta.a)(e);try{for(n.s();!(a=n.n()).done;){var r=a.value,o=rn(r.ship,15),s=new Path2D;s.moveTo(this.toScreenX(r.ship.position.x+.5),this.toScreenY(r.ship.position.y+.5));var i,l=Object(Ta.a)(o);try{for(l.s();!(i=l.n()).done;){var c=i.value,u=this.toScreenX(c.x+.5),h=this.toScreenY(c.y+.5);s.lineTo(u,h)}}catch(m){l.e(m)}finally{l.f()}
1this.ctx.strokeStyle=this.shipColor(r.ship),this.ctx.stroke(s)}}catch(m){n.e(m)}finally{n.f()}this.ctx.globalAlpha=1}}},{key:"drawLaser",value:function(e,t,a){var n=t.target,r=t.damage,o=t.damageDecreaseFactor,s=new Path2D;s.moveTo(this.toScreenX(e.position.x+.5),this.toScreenY(e.position.y+.5)),s.lineTo(this.toScreenX(n.x+.5),this.toScreenY(n.y+.5)),this.ctx.fillStyle="white",this.ctx.fill(this.createRect(n.x,n.y,a(r,o))),this.ctx.strokeStyle="yellow",this.ctx.stroke(s)}},{key:"drawDetonation",value:function(e,t){var a=t.power/t.powerDecreaseStep-1;this.ctx.fillStyle="magenta",this.ctx.fill(this.createRect(e.position.x,e.position.y,a))}},{key:"drawShipsAndCommands",value:function(e,t,a,n,r){this.drawCommands(t,r);var o,s=Object(Ta.a)(t);try{for(s.s();!(o=s.n()).done;){var i=o.value;this.drawShip(i.ship)}}catch(l){s.e(l)}finally{s.f()}}},{key:"drawCommands",value:function(e,t){var a,n=Object(Ta.a)(e);try{for(n.s();!(a=n.n()).done;){var r,o=a.value,s=Object(Ta.a)(o.appliedCommands);try{for(s.s();!(r=s.n()).done;){var i=r.value;i.type===ka.Detonate?this.drawDetonation(o.ship,i):i.type===ka.Shoot&&this.drawLaser(o.ship,i,t)}}catch(l){s.e(l)}finally{s.f()}}}catch(l){n.e(l)}finally{n.f()}}},{key:"drawPlanet",value:function(e){this.ctx.fillStyle="white",this.ctx.fill(this.createRect(0,0,e))}},{key:"drawSafePlace",value:function(e){this.ctx.fillStyle="rgb(0,0,0)",this.ctx.fill(this.createRect(0,0,e))}},{key:"drawShip",value:function(e){var t=e.position;this.ctx.fillStyle=this.shipColor(e),this.ctx.fill(this.createRect(t.x,t.y))}},{key:"createRect",value:function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Path2D,r=(2*a+1)*this.cellSize,o=this.toScreenX(e-a),s=this.toScreenY(t-a),i=4;return r<i&&(o-=(i-r)/2,s-=(i-r)/2,r=i),n.rect(o,s,r,r),n}},{key:"toScreenX",value:function(e){return this.canvas.width/2-this.cellSize/2+e*this.cellSize}},{key:"toScreenY",value:function(e){return this.canvas.height/2-this.cellSize/2+e*this.cellSize}},{key:"fitInScreen",value:function(e){var t=this.toScreenX(e.x),a=this.toScreenY(e.y);return t>0&&t<this.canvas.width&&a>0&&a<this.canvas.height}},{key:"adjustScale",value:function(e){for(var t=this;this.cellSize>.4&&e.some((function(e){return!t.fitInScreen(e.ship.position)}));)this.cellSize/=1.2}},{key:"shipColor",value:function(e){return e.role===_a.Defender?"teal":"orange"}},{key:"setTimePerTick",value:function(e){}}]),e}(),Ma=a(1);function Da(e){var t,a=e.role,n=e.matter,r=[];if(ja(r,n.engines,Ca.Engine),ja(r,n.radiators,Ca.Radiator),ja(r,n.lasers,Ca.Laser),ja(r,n.fuel,Ca.Fuel),a===_a.Defender)for(var o=0;o<r.length;o++)t=o+1,r[o].position=Ba(t,Wa,Ka,!0);else!function(e){for(var t=new Set,a=2,n=1;n<e.length;n++){for(var r=void 0,o=void 0;r=Pa(a),o="".concat(r.x," ").concat(r.y," ").concat(r.z),a++,t.has(o););e[n].position=r,t.add(o)}}(r);return r}function ja(e,t,a){for(var n=0;n<t;n++)e.push({position:new Ma.Q,type:a})}function Pa(e){return Ba(e,Ga,Ua,!1)}function Ga(e){return 1===e?1:6*e*e}function Ba(e,t,a,n){var r=function(e,t){var a=1,n=0;for(;;){var r=t(a);if(n+r>=e)break;a++,n+=r}return{layer:a,indexOnLayer:e-n}}(e,t),o=r.layer,s=r.indexOnLayer;if(1===o)return new Ma.Q;var i,l=(s-1)%6+1,c=Math.ceil(s/6),u=o%2===(n?0:1);if(u&&1===c)i=new Ma.P(0,0);else{var h=(c-1-(u?1:0))%4+1,m=a(u,Math.ceil((c-(u?1:0))/4));i=1===h?m:3===h?new Ma.P(m.y,-m.x):2===h?new Ma.P(-m.x,-m.y):new Ma.P(-m.y,m.x)}return function(e,t,a){var n=new Ma.Q(e.x,t-1,e.y);2===a&&(n=n.applyAxisAngle(new Ma.Q(0,0,1),Ma.v.degToRad(180)),n=new Ma.Q(n.x,n.y,-n.z));3===a&&(n=(n=n.applyAxisAngle(new Ma.Q(0,0,1),Ma.v.degToRad(90))).applyAxisAngle(new Ma.Q(1,0,0),Ma.v.degToRad(-90)),n=new Ma.Q(-n.x,n.y,n.z),n=new Ma.Q(-n.x,n.y,-n.z));4===a?n=(n=n.applyAxisAngle(new Ma.Q(0,0,1),Ma.v.degToRad(-90))).applyAxisAngle(new Ma.Q(1,0,0),Ma.v.degToRad(90)):5===a?n=n.applyAxisAngle(new Ma.Q(1,0,0),Ma.v.degToRad(90)):6===a&&(n=n.applyAxisAngle(new Ma.Q(1,0,0),Ma.v.degToRad(-90)),n=new Ma.Q(-n.x,n.y,n.z));return n=new Ma.Q(Math.round(n.x),Math.round(n.y),Math.round(n.z))}(i,o,l)}!function(e){e[e.Engine=0]="Engine",e[e.Radiator=1]="Radiator",e[e.Laser=2]="Laser",e[e.Fuel=3]="Fuel"}(Ca||(Ca={}));var Fa=[[1,1],[1,2],[2,1],[2,2],[1,3],[2,3],[3,1],[3,2],[1,4],[3,3],[2,4],[3,4]],za=[[1,1],[2,1],[1,2],[2,2],[3,1],[3,2],[2,3],[3,3]];function Ua(e,t){if(e){var a=Object(Ge.a)(Fa[t-1],2),n=a[0],r=a[1];return new Ma.P(-2*n,2*(r-1))}var o=Object(Ge.a)(za[t-1],2),s=o[0],i=o[1];return new Ma.P(-2*s+1,2*i-1)}function Ka(e,t){var a=e?t>2?2:1:t>4?3:t>1?2:1,n=e?1===a?t:t-2:1===a?t:2===a?t-1:t-4;return new Ma.P(2*-a+(e?0:1)+(n-1),n-1)}function Wa(e){return 1===e?1:6*(e-1)*(e-1)}var Ha=a(96),Za=a(93),Ja=a(97),Ya=a(94),Qa=a(46),qa=a(95),Xa=function(){function e(t,a,n,r){Object(u.a)(this,e),this.ctx=void 0,this.canvas=void 0,this.simulate=void 0,this.scene=void 0,this.renderer=void 0,this.camera=void 0,this.bloomComposer=void 0,this.cameraRotationLon=0,this.cameraRotationLat=0,this.onPointerDownPointerX=0,this.onPointerDownPointerY=0,this.onStartRotateLon=0,this.onStartRotateLat=0,this.cameraRotationLonDelta=0,this.cameraRotationLatDelta=0,this.dampingFactor=.05,this.rotationSpeed=.008,this.zoom=1,this.zoomDelta=0,this.maxZoom=30,this.minZoom=.4,this.zoomDampingFactor=.02,this.shipIdInView=void 0,this.isGeneralView=!0,this.lookAt=new Ma.Q,this.cameraPosition=new Ma.Q,this.prevShipsAndCommands=void 0,this.shipsAndCommands=[],this.nextShipsAndCommands=void 0,this.notDrawShips=!0,this.shipInViewFlyClockwise=!1,this.isAutoPlay=!1,this.shipsOnScene=[],this.detonationsOnScene=[],this.laserLinesOnScene=[],this.laserShootRadiiOnScene=[],this.exh
1austsOnScene=[],this.shipCubeSize=1/7/.7,this.planet=void 0,this.planetGlow=void 0,this.timePerTick=void 0,this.startTime=+new Date,this.lastTickTime=0,this.skyTex=void 0,this.planetOpacityTex=void 0,this.shipComponentsMaterials=[],this.shipSpriteMaterial=void 0,this.explosionMeshes=[],this.mixers=[],this.fxaaPass=void 0,this.bind(),this.ctx=t,this.canvas=a,this.simulate=r,this.timePerTick=n,this.scene=new Ma.F,this.renderer=new Ma.T({canvas:this.canvas,antialias:!1}),this.renderer.setSize(a.scrollWidth,a.scrollHeight);var o=new Ma.K;this.skyTex=o.load("images/Galaxy2.jpg"),this.planetOpacityTex=o.load("images/Planet.png"),this.camera=new Ma.C(50,a.scrollWidth/a.scrollHeight,1,1e4),this.drawStarsSphere(),this.createLight(),this.initShipComponentsMaterials(o),this.shipSpriteMaterial=new Ma.J({color:16777215,sizeAttenuation:!1,opacity:.7});var s=new Za.a(this.scene,this.camera),i=new Ja.a(new Ma.P(this.canvas.width,this.canvas.height),.8,.6,.3);this.fxaaPass=new Qa.a(qa.a),this.bloomComposer=new Ha.a(this.renderer),this.bloomComposer.renderToScreen=!0,this.bloomComposer.addPass(s),this.bloomComposer.addPass(i),this.bloomComposer.addPass(this.fxaaPass),this.canvas.addEventListener("mousedown",this.onDocumentMouseDown,!1),this.animate()}return Object(h.a)(e,[{key:"setZoomDelta",value:function(e){this.zoomDelta+=e}},{key:"initShipComponentsMaterials",value:function(e){var t=e.load("images/Pixel Bump.png"),a=e.load("images/Engine2.png"),n=e.load("images/Fuel.png"),r=e.load("images/Lazers.png"),o=e.load("images/Radiators.png"),s=new Ma.y({map:a,shininess:100,bumpMap:t,specular:.5,bumpScale:.007}),i=s.clone();i.map=o,i.bumpMap=t;var l=s.clone();l.map=r,l.bumpMap=t;var c=s.clone();c.map=n,c.bumpMap=t,this.shipComponentsMaterials=[{component:Ca.Engine,material:s},{component:Ca.Radiator,material:i},{component:Ca.Laser,material:l},{component:Ca.Fuel,material:c}]}},{key:"createLight",value:function(){var e=new Ma.o(8146324,1);e.position.set(-.8,1,.1),e.target.position.set(0,0,0),this.scene.add(e),this.scene.add(e.target);var t=new Ma.o(16777215,.7);t.position.set(1,-1,0),t.target.position.set(0,.1,0),this.scene.add(t),this.scene.add(t.target),this.scene.add(new Ma.b(3553610,1))}},{key:"bind",value:function(){this.onDocumentMouseMove=this.onDocumentMouseMove.bind(this),this.onDocumentMouseUp=this.onDocumentMouseUp.bind(this),this.onDocumentMouseLeave=this.onDocumentMouseLeave.bind(this),this.onDocumentMouseDown=this.onDocumentMouseDown.bind(this),this.animate=this.animate.bind(this)}},{key:"animate",value:function(){this.render(),requestAnimationFrame(this.animate)}},{key:"onDocumentMouseDown",value:function(e){e.preventDefault(),this.onPointerDownPointerX=e.clientX,this.onPointerDownPointerY=e.clientY,this.onStartRotateLon=this.cameraRotationLon,this.onStartRotateLat=this.cameraRotationLat,this.canvas.addEventListener("mousemove",this.onDocumentMouseMove,!1),this.canvas.addEventListener("mouseup",this.onDocumentMouseUp,!1),this.canvas.addEventListener("mouseleave",this.onDocumentMouseLeave,!1)}},{key:"onDocumentMouseMove",value:function(e){this.cameraRotationLonDelta+=(this.onPointerDownPointerX-e.clientX)*this.rotationSpeed,this.cameraRotationLatDelta+=-(this.onPointerDownPointerY-e.clientY)*this.rotationSpeed,this.onStartRotateLon+=this.cameraRotationLonDelta,this.onStartRotateLat+=this.cameraRotationLatDelta}},{key:"onDocumentMouseLeave",value:function(){this.onDocumentMouseUp()}},{key:"onDocumentMouseUp",value:function(){this.canvas.removeEventListener("mousemove",this.onDocumentMouseMove,!1),this.canvas.removeEventListener("mouseup",this.onDocumentMouseUp,!1),this.canvas.removeEventListener("mouseleave",this.onDocumentMouseLeave,!1)}},{key:"adjustScale",value:function(e){}},{key:"clearSpace",value:function(){}},{key:"drawShipsAndCommands",value:function(e,t,a,n,r){for(var o=0;o<this.mixers.length;o++)this.mixers[o].stopAllAction();this.mixers=[],this.lastTickTime=+new Date-this.startTime,this.prevShipsAndCommands=e,this.shipsAndCommands=t,this.nextShipsAndCommands=a,this.isAutoPlay=n,this.drawShips(t),this.drawCommands(r)}},{key:"drawShips",value:function(e){var t,a={},n=Object(Ta.a)(e);try{for(n.s();!(t=n.n()).done;){var r=t.value.ship,o=this.notDrawShips?void 0:this.drawShip(r);void 0!==o&&(a[r.shipId]=o)}}catch(l){n.e(l)}finally{n.f()}for(var s=0;s<this.explosionMeshes.length;s++)this.scene.remove(this.explosionMeshes[s]);for(var i in this.explosionMeshes=[],this.shipsOnScene)(this.shipsOnScene.hasOwnProperty(i)&&!a.hasOwnProperty(i)||this.shipsOnScene.hasOwnProperty(i)&&a.hasOwnProperty(i)&&this.shipsOnScene[i].components.length!==a[i].components.length)&&(this.processExplosion(a,+i,e),this.scene.remove(this.shipsOnScene[i].mesh));this.shipsOnScene=a}},{key:"processExplosion",value:function(e,t,a){var n=e.hasOwnProperty(t)?e[t].components.length:0,r=a.filter((function(e){return e.ship.shipId===+t})),o=r.length>0?r[0].appliedCommands:void 0,s=0===r.length?void 0:this.simulate(r[0].ship,1,!0)[0],i=0;if(void 0!==o)for(var l=0;l<o.length;l++){var c=o[l];if(c.type===ka.BurnFuel){var u=c.velocity;i+=Math.abs(u.x)+Math.abs(u.y)}else if(c.type===ka.SplitShip){var h=c.matter;i+=h.fuel+h.lasers+h.radiators+h.engines}}var m=this.shipsOnScene[t].components.length-n-i,d=e.hasOwnProperty(t)?e[t].mesh.position:this.shipsOnScene[t].mesh.position;if(m>0){for(var p=[],v=n;v<n+m;v++)p.push(this.shipsOnScene[t].components[v]);this.drawShipExplosion(d,$a(void 0===s?d:s),p)}}},{key:"drawShipExplosion",value:function(e,t,a){for(var n=a.length,r=0;r<n;r++){var o=a[r],s=new Ma.f(1,1,1),i=this.shipComponentsMaterials[+o.type].material.clone();i.transparent=!0;var l=new Ma.w(s,i);l.scale.multiplyScalar(this.shipCubeSize),l.position.copy(e);var c=Math.log(n),u=o.position.clone().multiplyScalar(this.shipCubeSize/2),h=new Ma.Q(u.x*(1+Math.random()*c),u.y*(1+Math.random()*c),(Math.random()-.5)*c),m=e.clone().add(u),d=t.clone().add(h),p=new Ma.R(".position",[0,1],[m.x,m.y,m.z,d.x,d.y,d.z]),v=new Ma.R(".scale",[0,1],[this.shipCubeSize,this.shipCubeSize,this.shipCubeSize,.2*this.shipCubeSize,.2*this.shipCubeSize,.2*this.shipCubeSize]),f=new Ma.z(".material.opacity",[0,1],[1,0]),g=new Ma.l(".material.color",[0,.5,1],[1,1,1,1,0,0,1,0,0],Ma.t),y=new Ma.c("Action",1,[v,p,f,g]),b=new Ma.d(l),w=b.clipAction(y);this.explosionMeshes.push(l),this.mixers.push(b),w.play(),this.scene.add(l)}}},{key:"drawShip",value:function(e){var t,a,n,r=function(e){var t=e.matter;return t.engines+t.radiators+t.lasers+t.fuel}(e);if(this.shipsOnScene.hasOwnProperty(e.shipId)&&this.shipsOnScene[e.shipId].components.length===r){var o=this.shipsOnScene[e.shipId];t=o.mesh,a=o.components,n=o.sprite}else{var s=this.createShip(e);if(t=null===s||void 0===s?void 0:s.mesh,a=null===s||void 0===s?void 0:s.components,n=null===s||void 0===s?void 0:s.sprite,void 0===t)return;this.scene.add(t)}if(void 0!==t&&void 0!==a&&void 0!==n)return t.position.copy($a(e.position)),t.lookAt(t.position.clone().add($a(e.velocity))),{mesh:t,sprite:n,components:a}}},{key:"createShip",value:function(e){for(var t=Da(e),a=[[],[],[],[]],n=new Ma.A,r=void 0,o=0;o<t.length;
1o++){var s=t[o],i=new Ma.f(1+.001*o,1+.001*o,1+.001*o);n.position.set(.7*s.position.x,.7*s.position.y,.7*s.position.z),n.updateMatrix(),i.applyMatrix4(n.matrix),0===o?r=new Ma.w(i,this.shipComponentsMaterials[+s.type].material):a[+s.type].push(i)}if(void 0!==r){for(var l=0;l<4;l++){var c=a[l];if(0!==c.length){var u=1===c.length?c[0]:Ya.a.mergeBufferGeometries(c),h=new Ma.w(u,this.shipComponentsMaterials[l].material);r.add(h)}}r.scale.multiplyScalar(this.shipCubeSize);var m=this.shipSpriteMaterial.clone();m.color.set(this.shipColor(e));var d=new Ma.I(m);return r.add(d),d.scale.multiplyScalar(.013),{mesh:r,sprite:d,components:t}}}},{key:"drawCommands",value:function(e){this.removeOldObjectsFromScene();var t,a=Object(Ta.a)(this.shipsAndCommands);try{for(a.s();!(t=a.n()).done;){var n,r=t.value,o=Object(Ta.a)(r.appliedCommands);try{for(o.s();!(n=o.n()).done;){var s=n.value;s.type===ka.Detonate?this.drawDetonation(r.ship,s):s.type===ka.Shoot&&this.drawLaser(r.ship,s,e)}}catch(d){o.e(d)}finally{o.f()}}}catch(d){a.e(d)}finally{a.f()}if(void 0!==this.nextShipsAndCommands){var i,l=Object(Ta.a)(this.nextShipsAndCommands);try{for(l.s();!(i=l.n()).done;){var c=i.value;if(void 0!==this.shipsOnScene[c.ship.shipId]){var u,h=Object(Ta.a)(c.appliedCommands);try{for(h.s();!(u=h.n()).done;){var m=u.value;m.type===ka.BurnFuel&&this.drawExhaust(c.ship,m)}}catch(d){h.e(d)}finally{h.f()}}}}catch(d){l.e(d)}finally{l.f()}}}},{key:"removeOldObjectsFromScene",value:function(){var e,t=Object(Ta.a)(this.detonationsOnScene);try{for(t.s();!(e=t.n()).done;){var a=e.value;this.scene.remove(a.outerSphere)}}catch(m){t.e(m)}finally{t.f()}this.detonationsOnScene=[];var n,r=Object(Ta.a)(this.laserLinesOnScene);try{for(r.s();!(n=r.n()).done;){var o=n.value;this.scene.remove(o.laser)}}catch(m){r.e(m)}finally{r.f()}this.laserLinesOnScene=[];var s,i=Object(Ta.a)(this.laserShootRadiiOnScene);try{for(i.s();!(s=i.n()).done;){var l=s.value;this.scene.remove(l.shoot)}}catch(m){i.e(m)}finally{i.f()}this.laserShootRadiiOnScene=[];var c,u=Object(Ta.a)(this.exhaustsOnScene);try{for(u.s();!(c=u.n()).done;){var h=c.value;this.scene.remove(h.mesh)}}catch(m){u.e(m)}finally{u.f()}}},{key:"drawLaser",value:function(e,t,a){var n=t.target,r=t.damage,o=t.damageDecreaseFactor,s=new Ma.x({color:new Ma.k(.8,.8,.8),transparent:!0}),i=$a(e.position),l=$a(n),c=new Ma.n(.1,.1,i.distanceTo(l),8),u=new Ma.w(c,s),h=new Ma.G({uniforms:{c:{type:"f",value:.5},p:{type:"f",value:4.7},glowColor:{type:"c",value:new Ma.k(1,0,0)},viewVector:{type:"v3",value:this.camera.position}},vertexShader:en,fragmentShader:tn,side:Ma.q,blending:Ma.a,transparent:!0}),m=new Ma.n(.2,.2,i.distanceTo(l),8),d=new Ma.w(m,h);this.laserLinesOnScene.push({laser:u,glow:d,target:l,shipId:e.shipId}),u.add(d),this.scene.add(u);var p=new Ma.z(".material.opacity",[0,1/3,1],[1,0,0]),v=new Ma.R(".scale",[0,1/3,1],[1,1,1,0,1,0,0,1,0]),f=new Ma.c("Action",1,[p,v]),g=new Ma.d(u),y=g.clipAction(f);this.mixers.push(g),y.play();var b=new Ma.x({color:new Ma.k(1,.9,.9),opacity:.1,transparent:!0,side:Ma.q}),w=new Ma.H(1.4*a(r,o),30,30),E=new Ma.w(w,b);E.position.copy($a(t.target));var S=new Ma.w(w.clone(),b.clone());S.material.side=Ma.e,E.add(S),this.laserShootRadiiOnScene.push({shoot:E,innerSphere:S,glow:new Ma.w});var x=new Ma.R(".scale",[0,.3,0],[.2,.2,.2,.9,.9,.9,1,1,1]),k=new Ma.z(".material.opacity",[0,.1,.5,.8,1],[.01,.1,.05,0,0]),_=new Ma.c("Action",1,[x,k]),T=new Ma.d(E),I=T.clipAction(_);this.mixers.push(T),I.play();var A=new Ma.d(S),O=A.clipAction(_);this.mixers.push(A),O.play(),this.scene.add(E)}},{key:"drawDetonation",value:function(e,t){var a=t.power/t.powerDecreaseStep-1,n=new Ma.x({color:new Ma.k(1,.9,.9),opacity:.1,transparent:!0,side:Ma.q}),r=new Ma.H(1.4*a,30,30),o=new Ma.w(r,n);o.position.copy($a(e.position));var s=new Ma.w(r.clone(),n.clone());s.material.side=Ma.e,o.add(s),this.detonationsOnScene.push({outerSphere:o,innerSphere:s});var i=new Ma.R(".scale",[0,.3,0],[.2,.2,.2,.9,.9,.9,1,1,1]),l=new Ma.z(".material.opacity",[0,.1,.5,.8,1],[.05,.2,.1,0,0]),c=new Ma.c("Action",1,[i,l]),u=new Ma.d(o),h=u.clipAction(c);this.mixers.push(u),h.play();var m=new Ma.d(s),d=m.clipAction(c);this.mixers.push(m),d.play(),this.scene.add(o)}},{key:"drawExhaust",value:function(e,t){var a=this.shipsOnScene[e.shipId];if(void 0!==a){var n=$a(t.velocity),r=this.shipCubeSize,o=Math.abs(n.x)>1||Math.abs(n.y)>1?2:1,s=new Ma.G({uniforms:{c:{type:"f",value:.3},p:{type:"f",value:4},glowColor:{type:"c",value:new Ma.k(0,0,0)},viewVector:{type:"v3",value:this.camera.position}},vertexShader:en,fragmentShader:tn,side:Ma.e,blending:Ma.a,transparent:!0}),i=new Ma.m(r,3*r*o,30,1,!0);i.translate(0,r*(3+o-1),0),0===n.x&&n.y<0?i.rotateZ(Ma.v.degToRad(180)):i.rotateZ(-1*Math.sign(n.x)*new Ma.Q(0,1,0).angleTo(n.normalize()));var l=new Ma.w(i,s),c=new Ma.w(i.clone(),new Ma.x({color:10066329,opacity:0,transparent:!0}));c.add(l),c.position.copy(a.mesh.position),this.scene.add(c),this.exh
1austsOnScene.push({mesh:c,glow:l,shipId:e.shipId})}}},{key:"drawPlanet",value:function(e){if(void 0===this.planet){var t=new Ma.y({color:new Ma.k(.5,.5,.5),transparent:!0,alphaTest:.5,side:Ma.p,alphaMap:this.planetOpacityTex}),a=new Ma.g(1,1,1,2,2,2);this.planet=new Ma.w(a,t);var n=2*e+1;this.planet.scale.set(n,n,n),this.planet.position.set(0,0,0);var r=new Ma.x({color:new Ma.k(.02,.02,.03),opacity:.5,transparent:!0,side:Ma.p}),o=new Ma.w(a.clone().scale(.999,.999,.999),r);this.planet.add(o);var s=new Ma.G({uniforms:{c:{type:"f",value:.9},p:{type:"f",value:5.6},glowColor:{type:"c",value:new Ma.k(12303291)},viewVector:{type:"v3",value:this.camera.position}},vertexShader:en,fragmentShader:tn,side:Ma.q,blending:Ma.a,transparent:!0}),i=this.planet.geometry.clone(),l=new Ma.w(i,s);l.scale.multiplyScalar(.99),this.planet.add(l),this.planetGlow=l,this.scene.add(this.planet)}}},{key:"drawSafePlace",value:function(e){}},{key:"drawTrajectories",value:function(e,t){}},{key:"updateShipsIntermediatePositions",value:function(){var e=this;if(void 0!==this.nextShipsAndCommands&&this.isAutoPlay)for(var t=+new Date-this.startTime-this.lastTickTime,a=Math.min(t/this.timePerTick,1),n=function(t){var n,r=e.shipsAndCommands[t].ship,o=r.shipId,s=e.nextShipsAndCommands.filter((function(e){return e.ship.shipId===o}));if(0===s.length)return"continue";var i=s[0].ship,l=null===(n=e.shipsOnScene[o])||void 0===n?void 0:n.mesh;if(void 0===l)return"continue";var c={x:r.position.x*(1-a)+i.position.x*a,y:r.position.y*(1-a)+i.position.y*a};l.position.copy($a(c));var u={x:r.velocity.x*(1-a)+i.velocity.x*a,y:r.velocity.y*(1-a)+i.velocity.y*a};l.lookAt(l.position.clone().add($a(u)))},r=0;r<this.shipsAndCommands.length;r++)n(r)}},{key:"updateLaserPositions",value:function(){var e,t=Object(Ta.a)(this.laserLinesOnScene);try{for(t.s();!(e=t.n()).done;){var a=e.value,n=a.laser,r=this.shipsOnScene[a.shipId];if(void 0!==r){var o=r.mesh.position,s=a.target;n.scale.setY(o.distanceTo(s)/n.geometry.parameters.height),n.position.copy(o.clone().add(s).multiplyScalar(.5)),n.lookAt(s),n.rotateOnAxis(new Ma.Q(1,0,0),Ma.v.degToRad(90))}}}catch(i){t.e(i)}finally{t.f()}}},{key:"setNextShipInView",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;this.isGeneralView=!1;var a=void 0===this.shipsOnScene?void 0:Object.keys(this.shipsOnScene);if(void 0!==a&&0!==a.length){if(void 0===this.shipIdInView)return this.shipIdInView=+a[0],void this.updateShipInViewFlyClockwise();var n=t?a.reverse().find((function(t){return+t<e.shipIdInView})):a.find((function(t){return+t>e.shipIdInView}));this.shipIdInView=void 0===n?t?+a[a.length-1]:+a[0]:+n,this.updateShipInViewFlyClockwise()}}},{key:"updateShipInViewFlyClockwise",value:function(){var e=this;if(void 0!==this.shipIdInView){var t=this.shipsAndCommands.filter((function(t){return t.ship.shipId===e.shipIdInView}));if(0!==t.length){var a=t[0],n=$a(a.ship.position),r=$a(a.ship.velocity);0===r.x&&0===r.y&&void 0!==this.nextShipsAndCommands&&(n=$a((a=(t=this.nextShipsAndCommands.filter((function(t){return t.ship.shipId===e.shipIdInView})))[0]).ship.position),r=$a(a.ship.velocity)),this.shipInViewFlyClockwise=n.x<0&&r.y>0||n.x>0&&r.y<0||0===r.y&&(n.y<0&&r.x<0||n.y>0&&r.x>0)}}}},{key:"setPreviousShipInView",value:function(){this.setNextShipInView(!0)}},{key:"switchGeneralView",value:function(){this.isGeneralView=!this.isGeneralView,this.isGeneralView||void 0!==this.shipIdInView||(this.shipIdInView=+Object.keys(this.shipsOnScene)[0],this.updateShipInViewFlyClockwise()),this.cameraRotationLon=0,this.cameraRotationLat=0}},{key:"setCameraNotRotated",value:function(){if(this.isGeneralView)this.cameraPosition=new Ma.Q(25,-75,35),this.lookAt=new Ma.Q;else{var e=void 0===this.shipIdInView?void 0:this.shipsOnScene[this.shipIdInView];if(void 0===e)return;var t=e.mesh.position.clone().cross(new Ma.Q(0,0,1)).normalize(),a=this.shipInViewFlyClockwise?-1:1;this.cameraPosition=e.mesh.position.clone().add(t.multiplyScalar(5*a)).add(e.mesh.position.clone().normalize().multiplyScalar(3)),this.lookAt=e.mesh.position.clone()}}},{key:"updateCamera",value:function(){this.setCameraNotRotated(),this.cameraRotationLat+=this.cameraRotationLatDelta*this.dampingFactor,this.cameraRotationLon+=this.cameraRotationLonDelta*this.dampingFactor,this.cameraRotationLat=Math.max(-89,Math.min(89,this.cameraRotationLat)),this.cameraRotationLonDelta*=1-this.dampingFactor,this.cameraRotationLatDelta*=1-this.dampingFactor;var e=1-this.zoomDelta*this.zoomDampingFactor;this.zoom=Math.min(Math.max(this.zoom*e,this.minZoom),this.maxZoom),this.zoomDelta+=-this.zoomDelta*this.zoomDampingFactor;var t=this.cameraPosition.clone().sub(this.lookAt),a=t.length()*this.zoom,n=Ma.v.radToDeg(Math.asin(t.z/a)),r=Ma.v.radToDeg(Math.atan2(t.y,t.x)),o=Math.max(-89,Math.min(89,this.cameraRotationLat+n)),s=this.cameraRotationLon+r,i=Ma.v.degToRad(o),l=Ma.v.degToRad(s);this.camera.position.x=this.lookAt.x+a*Math.cos(i)*Math.cos(l),this.camera.position.y=this.lookAt.y+a*Math.cos(i)*Math.sin(l),this.camera.position.z=this.lookAt.z+a*Math.sin(i),this.camera.up=new Ma.Q(0,0,1),this.camera.lookAt(this.lookAt),this.camera.updateProjectionMatrix()}},{key:"updateRenderer",value:function(){var e=new Ma.P;this.renderer.getSize(e);var t=null!==document.fullscreenElement,a=t?window.screen.width:this.canvas.width,n=t?window.screen.height:this.canvas.height;e.width===a&&e.height===n||(this.renderer.setSize(a,n),this.bloomComposer.setSize(a,n),this.camera.aspect=a/n,this.camera.updateProjectionMatrix(),this.fxaaPass.material.uniforms.resolution.value.x=1/a,this.fxaaPass.material.uniforms.resolution.value.y=1/n)}},{key:"updateGlows",value:function(){var e=+new Date-this.startTime-this.lastTickTime,t=Math.min(e/this.timePerTick,1);void 0!==this.planetGlow&&this.updateGlow(this.planetGlow);var a,n=Object(Ta.a)(this.laserLinesOnScene);try{for(n.s();!(a=n.n()).done;){var r=a.value.glow;
1if(this.updateGlow(r),this.isAutoPlay)r.material.uniforms.c={type:"f",value:.5*Math.max(1-3*t,0)}}}catch(o){n.e(o)}finally{n.f()}}},{key:"updateGlow",value:function(e){var t=new Ma.Q;t=e.getWorldPosition(t),e.material.uniforms.viewVector.value=(new Ma.Q).subVectors(this.camera.position,t)}},{key:"updateExhausts",value:function(){var e,t=+new Date-this.startTime-this.lastTickTime,a=Math.min(t/this.timePerTick,1),n=Object(Ta.a)(this.exhaustsOnScene);try{for(n.s();!(e=n.n()).done;){var r=e.value,o=r.glow;if(this.updateGlow(o),this.isAutoPlay){var s=o.material.uniforms,i=a<.6?0:Math.max(1-(a-.6)/.4,0);s.glowColor={type:"c",value:new Ma.k(.6*i,.5*i,.5*i)},r.mesh.material.opacity=.25*i;var l=this.shipsOnScene[r.shipId];if(void 0===l)continue;r.mesh.position.copy(l.mesh.position)}}}catch(c){n.e(c)}finally{n.f()}}},{key:"updateExplosions",value:function(){if(this.isAutoPlay){var e,t=+new Date-this.startTime-this.lastTickTime,a=Math.min(t/this.timePerTick,1),n=Object(Ta.a)(this.mixers);try{for(n.s();!(e=n.n()).done;){e.value.setTime(a)}}catch(r){n.e(r)}finally{n.f()}}}},{key:"fixShootRadiiSphereOpacity",value:function(){var e,t=Object(Ta.a)(this.laserShootRadiiOnScene);try{for(t.s();!(e=t.n()).done;){var a=e.value,n=a.shoot;a.innerSphere.position.copy(n.position.clone().sub(this.camera.position).normalize().multiplyScalar(.01))}}catch(l){t.e(l)}finally{t.f()}var r,o=Object(Ta.a)(this.detonationsOnScene);try{for(o.s();!(r=o.n()).done;){var s=r.value,i=s.outerSphere;s.innerSphere.position.copy(i.position.clone().sub(this.camera.position).normalize().multiplyScalar(.01))}}catch(l){o.e(l)}finally{o.f()}}},{key:"render",value:function(){if(this.updateShipsIntermediatePositions(),this.updateLaserPositions(),this.updateGlows(),this.updateExplosions(),this.updateExhausts(),+new Date-this.startTime-this.lastTickTime>this.timePerTick){for(var e=0;e<this.mixers.length;e++)this.mixers[e].stopAllAction();this.mixers=[]}this.updateCamera(),this.fixShootRadiiSphereOpacity(),this.updateRenderer(),this.bloomComposer.render()}},{key:"drawStarsSphere",value:function(){var e=new Ma.x({map:this.skyTex,side:Ma.e}),t=new Ma.H(2e3,24,24),a=new Ma.w(t,e);a.lookAt(0,1,0),this.scene.add(a)}},{key:"setTimePerTick",value:function(e){this.timePerTick=e}},{key:"shipColor",value:function(e){return e.role===_a.Defender?4259837:16762227}}]),e}();function $a(e){return new Ma.Q(e.x,-e.y,0)}var en="\nuniform vec3 viewVector;\nuniform float c;\nuniform float p;\nvarying float intensity;\nvoid main()\n{\n    vec3 vNormal = normalize( normalMatrix * normal );\n    vec3 vNormel = normalize( normalMatrix * viewVector );\n    intensity = pow( c - dot(vNormal, vNormel), p );\n\n    gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n}",tn="\nuniform vec3 glowColor;\nvarying float intensity;\nvoid main()\n{\n    vec3 glow = glowColor * intensity;\n    gl_FragColor = vec4( glow, 1.0 );\n}",an=function(){function e(t,a){Object(u.a)(this,e),this.renderer2d=void 0,this.renderer3d=void 0,this.renderer2d=t,this.renderer3d=a}return Object(h.a)(e,[{key:"setTimePerTick",value:function(e){this.renderer2d.setTimePerTick(e),this.renderer3d.setTimePerTick(e)}},{key:"adjustScale",value:function(e){this.renderer2d.adjustScale(e),this.renderer3d.adjustScale(e)}},{key:"clearSpace",value:function(){this.renderer2d.clearSpace(),this.renderer3d.clearSpace()}},{key:"drawShipsAndCommands",value:function(e,t,a,n,r){this.renderer2d.drawShipsAndCommands(e,t,a,n,r),this.renderer3d.drawShipsAndCommands(e,t,a,n,r)}},{key:"drawPlanet",value:function(e){this.renderer2d.drawPlanet(e),this.renderer3d.drawPlanet(e)}},{key:"drawSafePlace",value:function(e){this.renderer2d.drawSafePlace(e),this.renderer3d.drawSafePlace(e)}},{key:"drawTrajectories",value:function(e,t){this.renderer2d.drawTrajectories(e,t),this.renderer3d.drawTrajectories(e,t)}}]),e}();function nn(e,t,a){var n,r=document.getElementById("field2d"),o=document.getElementById("field3d"),s=document.getElementById("console");if(r&&o&&s){var i=!0,l=100,c=r,u=c.getContext("2d");if(u){var h=new La(u,c),m=o,d=m.getContext("webgl");
1if(d){var p=new Xa(d,m,l,rn);m.hidden=!0;var v,f=new an(h,p),g=0,y={isSucceeded:(v=e)[0],gameType:v[1],gameStatus:v[2],ticks:v[3],players:v[4].map(Ia),gameLog:v[5]&&0!==v[5][0]?Aa(v[5]):void 0},b=void 0===(null===(n=y.gameLog)||void 0===n?void 0:n.ticks.length)?0:y.gameLog.ticks.length;!function(){if(!y.gameLog)return;for(var e=y.gameLog.ticks[b-1],t=0;t<5;t++)y.gameLog.ticks.push({tick:b+t,ships:[]});var a,n=Object(Ta.a)(e.ships);try{for(n.s();!(a=n.n()).done;)for(var r=a.value,o=rn(r.ship,5),s=0;s<5;s++){var i={ship:Object(re.a)(Object(re.a)({},r.ship),{},{position:o[s]}),appliedCommands:[]};y.gameLog.ticks[b+s].ships.push(i)}}catch(l){n.e(l)}finally{n.f()}}();var w=!0,E=0,S=!1,x=null,k=function(){_(),L()};window.addEventListener("resize",k),document.body.addEventListener("keydown",T),c.addEventListener("mousedown",R),m.addEventListener("mousedown",R),c.addEventListener("mouseup",V),m.addEventListener("mouseup",V),m.addEventListener("wheel",(function(e){if(!y.gameLog||i)return;e.deltaY>0?p.setZoomDelta(5e-4*e.deltaY):p.setZoomDelta(1/(1-5e-4*e.deltaY)-1);return e.preventDefault(),!1})),_(),L(),A()}}}function _(){c.width=window.innerWidth-64,c.height=window.innerHeight-260+t,m.width=window.innerWidth-64,m.height=window.innerHeight-260+t}function T(e){if(y.gameLog){var t=e.code;if("ArrowRight"===t||"KeyD"===t)C(1,b),I();else if("ArrowLeft"===t||"KeyA"===t)C(-1,b),I();else if("Home"===t||"KeyQ"===t)g=0,I(),i||(p.isGeneralView=!0,p.cameraRotationLon=0,p.cameraRotationLat=0);else if("End"===t||"KeyE"===t)g=b-1,I();else if("Equal"===t){if(!i)return void p.setZoomDelta(-.02);h.cellSize*=1.2}else if("Minus"===t){if(!i)return void p.setZoomDelta(.02);h.cellSize>.4&&(h.cellSize/=1.2)}else if("Comma"===t)l=Math.min(1e3,l+10),I(),A();else if("Period"===t)l=Math.max(20,l-10),I(),A();else if("KeyP"===t||"Space"===t)E?I():A();else if("Digit1"===t){var a=document.getElementsByClassName("instruction")[0];m.hidden=!i,c.hidden=i,i?(l=1e3,a.classList.add("only3d"),p.notDrawShips=!1):(l=100,a.classList.remove("only3d")),i=!i,f.setTimePerTick(l),S&&(I(),A())}else if("KeyW"===t||"KeyS"===t||"KeyZ"===t){if(i)return;"KeyZ"===t?p.switchGeneralView():"KeyW"===t?p.setNextShipInView():p.setPreviousShipInView()}else{if("Enter"!==t||i)return;var n=m;null===document.fullscreenElement&&(m.requestFullscreen?m.requestFullscreen():n.webkitRequestFullscreen?n.webkitRequestFullscreen():n.mozRequestFullscreen&&n.mozRequestFullscreen())}e.preventDefault(),L()}}function I(){clearTimeout(E),S=!1,E=0}function A(){S=!0,E=setInterval(O,l)}function O(){y.gameLog&&(C(1,y.gameLog.ticks.length),L(),g>=(i?b:y.gameLog.ticks.length-1)&&(I(),a&&(window.removeEventListener("resize",k),document.body.removeEventListener("keydown",T),c.removeEventListener("click",N),m.removeEventListener("click",N),a())))}function N(){w=!w,L()}function R(){x=Date.now()}function V(){null==x||Date.now()-x>200||(x=null,N())}function C(e,t){y.gameLog&&(g=Math.min(t-1,Math.max(0,g+e)))}function L(){if(y.gameLog){var e=g<y.gameLog.ticks.length-1;!function(e,t,a,n){var r=t.ships;f.adjustScale(r),f.clearSpace(),y.gameLog&&y.gameLog.planet&&y.gameLog.planet.safeRadius>=0&&f.drawSafePlace(y.gameLog.planet.safeRadius);y.gameLog&&y.gameLog.planet&&y.gameLog.planet.radius>=0&&f.drawPlanet(y.gameLog.planet.radius);if(f.drawTrajectories(r,w),f.drawShipsAndCommands(null===e||void 0===e?void 0:e.ships,r,null===a||void 0===a?void 0:a.ships,n,on),g<b){var o,i="".concat(t.tick),l=Object(Ta.a)(r);try{for(l.s();!(o=l.n()).done;){var c=o.value;i+='<p style="color: '.concat(sn(c.ship),'">').concat(JSON.stringify(c),"</p>")}}catch(u){l.e(u)}finally{l.f()}s&&(s.innerHTML=i)}}(g>0?y.gameLog.ticks[g-1]:void 0,y.gameLog.ticks[g],e?y.gameLog.ticks[g+1]:void 0,S)}}}function rn(e,t){for(var a=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],n=[],r=Math.sign(t),o={position:e.position,velocity:{x:e.velocity.x*r,y:e.velocity.y*r}},s=0;s<Math.abs(t);s++){var i=Math.abs(o.position.x),l=Math.abs(o.position.y),c=Math.max(i,l),u=Object(re.a)({},o.velocity);a&&(i===c&&(u.x-=Math.sign(o.position.x)*r),l===c&&(u.y-=Math.sign(o.position.y)*r)),o.velocity=u,o.position={x:o.position.x+o.velocity.x,y:o.position.y+o.velocity.y},n.push(o.position)}return n}function on(e,t){for(var a=0,n=e;0!==n;)a++,n=Math.floor(n/t);return a-1}function sn(e){return e.role===_a.Defender?"teal":"orange"}function ln(){return window.location.hash.replace(/#\/[^?]*\?/,"").split("&").map((function(e){return e.split("=")})).reduce((function(e,t){return e[t[0].toLowerCase()]=t[1],e}),{})}var cn=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(){var e;Object(u.a)(this,a);for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return(e=t.call.apply(t,[this].concat(r))).runAutoGames=Object(ae.a)(te.a.mark((function t(){var a,n,r,o,s;return te.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(a=e.props.apiKey){t.next=3;break}return t.abrupt("return");case 3:return t.next=5,fetch("".concat(Ce,"/interesting-games/?").concat(Be({apiKey:a}))).then((function(e){return e.json()}));case 5:n=t.sent,r=Object(Ta.a)(n),t.prev=7,s=te.a.mark((function t(){var a,n;return te.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return a=o.value,n=new Promise((function(t){e.getLog(a,void 0,(function(){t()}))})),t.next=4,n;case 4:case"end":return t.stop()}}),t)})),r.s();case 10:if((o=r.n()).done){t.next=14;break}return t.delegateYield(s(),"t0",12);case 12:t.next=10;break;case 14:t.next=19;break;case 16:t.prev=16,t.t1=t.catch(7),r.e(t.t1);case 19:return t.prev=19,r.f(),t.finish(19);case 22:e.runAutoGames();case 23:case"end":return t.stop()}}),t,null,[[7,16,19,22]])}))),e.getLog=function(){var t=Object(ae.a)(te.a.mark((function t(a,n,r){var o,s,i,l,c,u,h,m;return te.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!a){t.next=19;break}return t.prev=1,o="".concat(Ce,"/log?").concat(Be({gameId:a})),t.next=5,fetch(o).then((function(e){return e.text()}));case 5:return s=t.sent,i=s.replace(/\(/g,"[").replace(/\)/g,"]"),l="".concat(Ce,"/").concat(a,"?").concat(Be({})),t.next=10,fetch(l).then((function(e){return e.json()}));case 10:c=t.sent,nn(JSON.parse(i),r?50:0,r),e.renderTitle(c),t.next=18;break;case 15:t.prev=15,t.t0=t.catch(1),r&&r();case 18:return t.abrupt("return");case 19:if(!n){t.next=33;break}return t.prev=20,u="".concat(Ce,"/log?").concat(Be({playerKey:n})),t.next=24,fetch(u).then((function(e){return e.text()}));case 24:h=t.sent,m=h.replace(/\(/g,"[").replace(/\)/g,"]"),nn(JSON.parse(m),r?200:40,r),t.next=32;break;case 29:t.prev=29,t.t1=t.catch(20),r&&r();case 32:return t.abrupt("return");case 33:case"end":return t.stop()}}),t,null,[[1,15],[20,29]])}
1)));return function(e,a,n){return t.apply(this,arguments)}}(),e}return Object(h.a)(a,[{key:"componentDidMount",value:function(){this.runGame()}},{key:"runGame",value:function(){var e=ln(),t=e.game,a=e.playerkey;e.autogames?this.runAutoGames():(t||a)&&this.getLog(t,a)}},{key:"render",value:function(){var e=ln(),t=e.game,a={color:"gray"},n=e.autogames;return r.a.createElement("div",{id:"visualizerWrapper"},!n&&r.a.createElement("ul",{className:"instruction"},r.a.createElement("li",null,r.a.createElement("span",{style:a},"Controls:")," A D Q E ",r.a.createElement("span",{style:a},"/")," \u2190 \u2192 Home End"),r.a.createElement("li",null,r.a.createElement("span",{style:a},"Autoplay:")," Space , . -"),r.a.createElement("li",null,r.a.createElement("span",{style:a},"Zoom:")," + -"),r.a.createElement("li",null,r.a.createElement("span",{style:a},"2D/3D:")," 1"),r.a.createElement("li",{className:"only2dcontrol"},r.a.createElement("span",{style:a},"Trajectories:")," click"),r.a.createElement("li",{className:"only3dcontrol"},r.a.createElement("span",{style:a},"3D camera:")," W S Z"),r.a.createElement("li",{className:"only3dcontrol"},r.a.createElement("span",{style:a},"Fullscreen:")," Enter")),t&&r.a.createElement("h3",{id:"title"},"\xa0"),r.a.createElement("canvas",{id:"field2d",width:800,height:500}),r.a.createElement("canvas",{id:"field3d",width:800,height:500}),r.a.createElement("div",{id:"console"}))}},{key:"renderTitle",value:function(e){var t=document.getElementById("title");if(t){var a=e.attacker.team.teamName,n=e.defender.team.teamName,r=e.winner&&e.winner!==qt.Nobody?e.winner:null,o='<span class="attacker '.concat(r===qt.Defender?"streak":"",'">').concat(a,"</span>"),s='<span class="defender '.concat(r===qt.Attacker?"streak":"",'">').concat(n,"</span>");t.innerHTML="".concat(s," vs ").concat(o)}}}]),a}(r.a.Component);function un(){var e;try{var t=ln();t.apikey?(e=t.apikey,window.localStorage.setItem("apiKey",e)):e=window.localStorage.getItem("apiKey")}catch(a){}return e}var hn=function(e){Object(m.a)(a,e);var t=Object(d.a)(a);function a(e){var n;Object(u.a)(this,a),(n=t.call(this,e)).listener=void 0,n.deleteApiKey=function(){try{window.localStorage.getItem("apiKey")===n.props.apiKey&&window.localStorage.removeItem("apiKey")}catch(e){}n.setState({hasApiKey:!1}),n.props.updateApiKey(null),n.props.updateTeam(null)},n.closeError=function(){n.props.setError(null)};var r=un();return n.state={hasApiKey:Boolean(r),apiKey:r},n}return Object(h.a)(a,[{key:"componentDidMount",value:function(){var e=un();e&&(this.props.updateApiKey(e),this.props.loadTeam())}},{key:"componentWillUnmount",value:function(){this.listener&&this.listener.close()}},{key:"componentDidUpdate",value:function(e){var t=!e.team&&Boolean(this.props.team);Boolean(e.team)&&!this.props.team&&this.listener&&this.listener.close(),t&&this.addListeners()}},{key:"render",value:function(){var e=this.state,t=e.hasApiKey,a=e.apiKey,n=this.props,o=n.team,s=n.error,i=t&&!o;return r.a.createElement(r.a.Fragment,null,r.a.createElement(p.a,null,r.a.createElement(v.d,null,r.a.createElement(v.b,{path:A,children:function(){return r.a.createElement(cn,{apiKey:a})}}),r.a.createElement(v.b,null,r.a.createElement("div",{className:g.a.container},r.a.createElement(F,{team:o,isTeamLoading:i,logout:this.deleteApiKey}),r.a.createElement("div",{className:g.a.narrowContainer},r.a.createElement(ma,{team:o,isTeamLoading:i})))))),null!==s&&r.a.createElement(H,{error:s,closeError:this.closeError}))}},{key:"addListeners",value:function(){var e=this;this.props.apiKey&&(this.listener=function(e,t){var a={},n=!1,r=!1,o="".concat(Ie,"?").concat(Be({sticky:Object(wa.uuid)(),apiKey:e})),s=(new ba.a).withUrl(o).withAutomaticReconnect().configureLogging(ba.b.Information).build();function i(){return l.apply(this,arguments)}function l(){return(l=Object(ae.a)(te.a.mark((function e(){return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,s.start();
1case 5:r=!0,console.log("connected"),e.next=14;break;case 9:return e.prev=9,e.t0=e.catch(2),console.log("failed to start",e.t0),setTimeout((function(){return i()}),1e4),e.abrupt("return");case 14:return e.next=16,h();case 16:case"end":return e.stop()}}),e,null,[[2,9]])})))).apply(this,arguments)}function c(){return u.apply(this,arguments)}function u(){return(u=Object(ae.a)(te.a.mark((function e(){return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,s.stop();case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),console.log("failed to stop",e.t0);case 8:case"end":return e.stop()}}),e,null,[[0,5]])})))).apply(this,arguments)}function h(){return m.apply(this,arguments)}function m(){return(m=Object(ae.a)(te.a.mark((function e(){var t;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!(t=Object.entries(a).filter((function(e){return e[1]})).map((function(e){return e[0]}))).length){e.next=7;break}return e.next=5,s.send("subscribe",t.join(","));case 5:e.next=9;break;case 7:return e.next=9,s.send("subscribe",0);case 9:console.log("subscribed",t),e.next=17;break;case 12:return e.prev=12,e.t0=e.catch(0),console.log("failed to subscribe",e.t0),e.next=17,c();case 17:case"end":return e.stop()}}),e,null,[[0,12]])})))).apply(this,arguments)}return s.onclose(Object(ae.a)(te.a.mark((function e(){return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:console.log("closed"),r=!1,n||setTimeout((function(){return i()}),1e4);case 3:case"end":return e.stop()}}),e)})))),s.on("onEvent",(function(e,a){n||(console.log(e,a),t(e,a))})),i(),{close:function(){n=!0,c()},subscribe:function(e){a[e]=!0,r&&h()},unsubscribe:function(){var e=Object(ae.a)(te.a.mark((function e(t){return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a[t]=!1,r&&h();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}}(this.props.apiKey,(function(t,a){if(a)switch(t){case va.Submission:return e.props.loadSubmissions();case va.Team:return e.props.loadTeam();case va.LightningScoreboard:return e.props.loadLightningScoreboard();case va.Scoreboard:return e.props.loadScoreboard();case va.NonRatingGame:return e.props.loadNonRatingGames()}})),this.listener.subscribe(va.Submission),this.listener.subscribe(va.Team),this.listener.subscribe(va.LightningScoreboard),this.listener.subscribe(va.Scoreboard),this.listener.subscribe(va.NonRatingGame))}}]),a}(r.a.Component),mn=Object(c.b)((function(e){return{apiKey:e.team.apiKey,team:e.team.team,error:e.app.error}}),(function(e){return{updateApiKey:function(t){return e((a=We(t),function(e){e(Fe(a.payload))}));var a},updateTeam:function(t){return e((a=We(t),function(e){e(ze(a.payload))}));var a},loadTeam:function(){return e(function(){var e=Object(ae.a)(te.a.mark((function e(t,a){var n,r,o,s;return te.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t(Ue()),n=a(),r=n.team.apiKey,o="".concat(ke,"?").concat(Be({apiKey:r})),e.prev=4,e.next=7,fe(o);case 7:s=e.sent,t(ze(s)),e.next=14;break;case 11:e.prev=11,e.t0=e.catch(4),t(je(e.t0));case 14:return e.prev=14,t(Ke()),e.finish(14);case 17:case"end":return e.stop()}}),e,null,[[4,11,14,17]])})));return function(t,a){return e.apply(this,arguments)}}())},setError:function(t){return e((a=We(t),function(e){e(je(a.payload))}));var a},loadSubmissions:function(){return e(gt())},loadLightningScoreboard:function(){return e(Lt())},loadScoreboard:function(){return e(Mt())},loadNonRatingGames:function(){return e(ua())}}}))(hn),dn={error:null};var pn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:dn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR":return Object(re.a)(Object(re.a)({},e),{},{error:t.payload});default:return e}}
1,vn={apiKey:null,team:null,teamLoading:!1};var fn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:vn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_API_KEY":return Object(re.a)(Object(re.a)({},e),{},{apiKey:t.payload});case"UPDATE_TEAM":return Object(re.a)(Object(re.a)({},e),{},{team:t.payload});case"LOAD_TEAM"+de:return Object(re.a)(Object(re.a)({},e),{},{teamLoading:!0});case"LOAD_TEAM"+pe:return Object(re.a)(Object(re.a)({},e),{},{teamLoading:!1});default:return e}},gn={submissions:null,lastSeen:null,otherTeamSubmissions:null,running:!1,justStarted:!1};var yn=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:gn,a=arguments.length>1?arguments[1]:void 0;switch(a.type){case"LOAD_SUBMISSIONS":return Object(re.a)(Object(re.a)({},t),{},{submissions:a.payload});case"UPDATE_LAST_SEEN_SUBMISSION":return Object(re.a)(Object(re.a)({},t),{},{lastSeen:a.payload});case"ACTIVATE_SUBMISSION":return Object(re.a)(Object(re.a)({},t),{},{submissions:null===(e=t.submissions)||void 0===e?void 0:e.map((function(e){return e.submissionId===a.payload?Object(re.a)(Object(re.a)({},e),{},{active:!0}):e.active?Object(re.a)(Object(re.a)({},e),{},{active:!1}):e}))});case"LOAD_OTHER_TEAMS_SUBMISSION":return Object(re.a)(Object(re.a)({},t),{},{otherTeamSubmissions:a.payload});case"RUN_NON_RATING_GAME"+de:return Object(re.a)(Object(re.a)({},t),{},{running:!0});case"RUN_NON_RATING_GAME_SUCCESS":return Object(re.a)(Object(re.a)({},t),{},{running:!1,justStarted:!0});case"RUN_NON_RATING_GAME"+pe:return Object(re.a)(Object(re.a)({},t),{},{running:!1,justStarted:!1});default:return t}},bn={lightningScoreboard:null,totalScoreboard:null,finalScoreboard:null};var wn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:bn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOAD_PROBLEM_SCOREBOARD":return Object(re.a)(Object(re.a)({},e),{},{lightningScoreboard:t.payload});case"LOAD_SCOREBOARD":return Object(re.a)(Object(re.a)({},e),{},{totalScoreboard:t.payload});case"LOAD_FINAL_SCOREBOARD":return Object(re.a)(Object(re.a)({},e),{},{finalScoreboard:t.payload});default:return e}},En={current:null};var Sn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:En,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOAD_CURRENT_TOURNAMENT":return Object(re.a)(Object(re.a)({},e),{},{current:t.payload});default:return e}},xn={rating:null,nonRating:null};var kn=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:xn,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"LOAD_RATING_GAMES":return Object(re.a)(Object(re.a)({},e),{},{rating:t.payload});case"LOAD_NON_RATING_GAMES":return Object(re.a)(Object(re.a)({},e),{},{nonRating:t.payload});default:return e}},_n=Object(i.c)({app:pn,team:fn,submissions:yn,scoreboard:wn,tournament:Sn,games:kn}),Tn=Object(i.d)(_n,Object(i.a)(l.a));s.a.render(r.a.createElement(c.a,{store:Tn},r.a.createElement(mn,null)),document.getElementById("root"))},21:function(e,t,a){e.exports={checklist:"styles_checklist__2EPJ5",table:"styles_table__1V-km",pre:"styles_pre__sSo32",statusFailed:"styles_statusFailed__Tnzla",logLink:"styles_logLink__1LR70",branch:"styles_branch__1zqjP",help:"styles_help__1bSOq",icon:"styles_icon__cvhNe",succeeded:"styles_succeeded__1UWXK"}},28:function(e,t,a){e.exports={root:"styles_root__7CnG0",table:"styles_table__3R6dw",pre:"styles_pre__22RU1",radio:"styles_radio__1cLrw",buttons:"styles_buttons__2cvGr",chooseButton:"styles_chooseButton__2oe2V",toastButton:"styles_toastButton__3eM7i"}},32:function(e,t,a){e.exports={root:"styles_root__2e9Hh",subtitle:"styles_subtitle__Cnbu2",note:"styles_note__3GPDT",blink:"styles_blink__1lnWj",wide:"styles_wide__8QXQS",navMenu:"styles_navMenu__21UOb",navMenuLinks:"styles_navMenuLinks__2uUkI",logoutWrapper:"styles_logoutWrapper__3pqjI",links:"styles_links__21dbQ",link:"styles_link__3vf9Z",activeLink:"styles_activeLink__3cx_h",titleLink:"styles_titleLink__3mE_7",logoutLink:"styles_logoutLink__1fnhg"}},36:function(e,t,a){e.exports={form:"forms_form__3YnzN"}},39:function(e,t,a){e.exports={root:"styles_root__1yrlt",list:"styles_list__3I-q0",listItem:"styles_listItem__1gwLr",link:"styles_link__2wKUa",active:"styles_active__3YV-O"}}
1,4:function(e,t,a){e.exports={table:"styles_table__yP7pN",alignLeft:"styles_alignLeft__3pZ7p",alignCenter:"styles_alignCenter__iu3xM",alignRight:"styles_alignRight__1iauJ",lighten:"styles_lighten__-4OgN",problemsHeader:"styles_problemsHeader__2-O8S",activeTeam:"styles_activeTeam__1rxXI",problemScore:"styles_problemScore__15jnr",score:"styles_score__1WsB6",sortButton:"styles_sortButton__16pYX",sortDown:"styles_sortDown__1xiRz",sortUp:"styles_sortUp__3mx9g",details:"styles_details__kEHM7",sortDetails:"styles_sortDetails__xNinA",smallRow:"styles_smallRow__3Cdm3",frozenTitle:"styles_frozenTitle__3qiVq",help:"styles_help__1D0Dt"}},40:function(e,t,a){e.exports={root:"styles_root__1fIrI",title:"styles_title__3Gvai",subtitle:"styles_subtitle__356-R",header:"styles_header__Gm18o"}},44:function(e){e.exports=JSON.parse('[{"id":1033,"date":"2020-07-17T17:10:00.450+05:00","author":"Ivan Zaitsev","title":"Ping \u2014 Pong!","text":"Hi.\\n\\nAs you have recently suggested on [Discord](https://discord.gg/xvMJbas), we have transmitted the modulated representation of number 42 to a possible location of the recently discovered spacecraft.\\n\\nOh my\u2014 Oh my goggles! It looks like we\'ve made the right thing! At least I hope so.\\n\\nThe spacecraft is not going anywhere. It is transmitting new messages! We have already received a bunch of them and it looks like more are coming.  \\n\\nI will decode them and add to [previous messages](https://message-from-space.readthedocs.io/en/latest/index.html). If only you had enough time and dedication to help the scientific community to understand them for the greater good of the humankind!"},{"id":1032,"date":"2020-07-16T18:03:28.940+05:00","author":"Ivan Zaitsev","title":"It\u2019s a Tra... Spacecraft!","text":"<iframe width=\\"640\\" height=\\"340\\" src=\\"https://www.youtube.com/embed/6ks0Gzc1SOE\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\nOK, folks. This is BIG. We\u2019ve just got the [new message](https://message-from-space.readthedocs.io/en/latest/message15.html).\\n\\n![message 15](/images/message15.png)\\n\\nAnd even if I don\u2019t understand the whole meaning of it, it is obvious that it is coming from a spacecraft that is flying nearby our planet.\\n\\nWe will try to locate this spacecraft and send a message to it. Meanwhile you keep [deciphering the message](https://discord.gg/xvMJbas). Your work is very important. Keep up!"},{"id":1031,"date":"2020-07-12T18:02:23.001+05:00","author":"Ivan Zaitsev","title":"Following the Advice of Our Audience","text":"During the last few days several people have asked me via the [Discord chat](https://discord.gg/xvMJbas) to share the original raw transmission data from our telescope. I don\u2019t see the point in doing this, because all the transmissions so far seem uniform. Sharing images is much more convenient than sharing WAV files: image files consume less bandwidth and are much easier to comprehend visually.\\n\\nBut thinking about this and discussing this idea inspired our team to further investigate the variations in strength and carrier frequency of the transmissions. \\n\\nFirst of all, the carrier frequency decreases over time. This kind of observation is usually explained by the Doppler effect and suggests that the source is accelerating in a direction away from us.\\n\\nSecond, the strength of the signal increases ever-so-slightly from one transmission to another. This effect suggests that the source is moving towards us.\\n\\nWe\u2019re not ready to make any hard statements at this time. Our equipment is not perfect, and this effect can be caused by slight deviations of the positioning of our antenna. But if true, these observations may suggest that the source of the transmissions is moving towards the Earth and is slowing down.\\n\\nAs usual, join us in the [Discord chat](https://discord.gg/xvMJbas) to decipher [today\u2019s message](https://message-from-space.readthedocs.io/en/latest/message10.html)."},{"id":1030,"date":"2020-07-10T17:59:56.834+05:00","author":"Ivan Zaitsev","title":"Not a Reflection Either","text":"We\u2019re still receiving regular radio transmissions from the same region of the sky. You can see the eighth one in [our documentation](https://message-from-space.readthedocs.io/en/latest/message8.html) and join the dicussion in [our chat](https://discord.gg/xvMJbas).\\n\\nAs far as our investigation goes, we\u2019ve checked all the registered objects in this specific sector: comets, asteroids, satellites, known space garbage. Any one of these objects could theoretically reflect a signal from elsewhere, even from the Earth. Neither of these objects f
1its the uniform time pattern of the transmissions. We have to rule out this possibility.\\n\\nIt is also peculiar that no other observatories have reported receiving any similar messages yet. We will continue our search for knowledge."},{"id":1029,"date":"2020-07-08T18:00:01.302+05:00","author":"Ivan Zaitsev","title":"The Origin Is Still Unknown","text":"We\u2019ve checked the specifications of each piece of our radio equipment and analyzed the archives of our observations for the past five years. We found nothing that would support our suspicion of a terrestrial origin of the signal.\\n\\nWe\u2019ve also consulted with several computer security specialists and checked the raw telescope data to rule out malicious hacker activity. So far our investigation results support the extraterrestrial origin theory.\\n\\nOur research group will continue the investigation. Meanwhile, [join us](https://discord.gg/xvMJbas) in dechipering [today\u2019s message](https://message-from-space.readthedocs.io/en/latest/message6.html)."},{"id":1028,"date":"2020-07-08T02:32:55.089+05:00","author":"Ivan Zaitsev","title":"What Do We Know So Far?","text":"We\u2019ve got five radio transmissions while monitoring a region of sky around HD 190360. We\u2019re not sure of the source, but we strongly suspect that they are not coming from a star system 52 lightyears away.\\n\\nWe suspect that humans are the intended recipients of these messages because the transmissions are so precisely synchronized with the rotation of our planet. So far each message was received around 12:45 UTC every day, except for the first one.\\n\\nThe messages are frequency-encoded bit sequences that align neatly into 2D rectangles suggested by a frame. We have some theories on how to interpret them. Most of the theories are speculative until we get more information.\\n\\nThe first two messages introduce glyphs used to denote the natural numbers. The third message extends this construction to the negative numbers. The fourth message probably introduces the equality sign. The fifth message probably introduces the successor (+1) function for numbers and the application operator.\\n\\nThanks to our [Discord chat](https://discord.gg/xvMJbas) participants, we have nice tooling that allows us to render images from a radio transmission and to annotate these images with known glyph interpretations:\\n\\n![annotated image from day 5](/images/message5-annotated-full.svg)"},{"id":1027,"date":"2020-07-06T18:03:30.422+05:00","author":"Ivan Zaitsev","title":"Not a Distant Planet?","text":"Today I\u2019ve got good news and also somewhat worrying news for you.\\n\\nFirst, there is a transmission. Posted to [docs](https://message-from-space.readthedocs.io/en/latest/message4.html), as always. Some new glyphs for you to decipher.\\n\\nSecond, I think we have something to worry about. There is a strong suspicion among my colleagues that this signal comes not from a distant planet at all. We will thoroughly investigate this and try to eliminate possible terrestrial and low-orbit sources of this signal. I\u2019ll get back to you with more details later."},{"id":1026,"date":"2020-07-05T18:00:09.078+05:00","author":"Ivan Zaitsev","title":"Once Is Luck, Twice Is Coincidence, Three Times Is a Pattern","text":"Not entirely unexpected, we got a third message today. I\u2019ve already posted it to our [documentation page](https://message-from-space.readthedocs.io/en/latest/message3.html). Can somebody take a look?\\n\\nFeels like this is not the last one. What\u2019s weird: we get these transmissions precisely at the same time each day, **around 12:45 UTC**. It\u2019s almost like whatever sends them knows about us, and our planet is the intended target of these messages. Otherwise, why would timing of these messages be synchronized to the rotation of our planet?\\n\\nI\u2019ll be monitoring our radiotelescope carefully during the same time window tomorrow, expecting more answers from the Universe.\\n\\nJoin me in our [Discord chat](https://discord.gg/xvMJbas) to share your ideas and interpretations!"},{"id":1025,"date":"2020-07-04T18:02:34.670+05:00","author":"Ivan Zaitsev","title":"One Small Step for Scientists and Engineers, a Giant Leap for Mankind","text":"<iframe width=\\"640\\" height=\\"360\\" src=\\"https://www.youtube.com/embed/j7kVUaZCcMU\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\n Hi.\\n\\nYesterday I posted a video asking for your help deciphering a strange radio signal from space. Thanks to my friends from the [ICFP Contest](https://twitter.com/icfpcontest2020/status/1278965948461056000), it was a tremendous success.\\n\\nWith help from enthusiasts all over the world we were able to make [great progress](https://message-from-space.readthedocs.io/en/latest/radio-transmission-recording.html) in understanding the message. Thank y
1ou very much to all the participants!\\n\\nFirst of all, we understand that the signal is probably a sequence of frequency-encoded ones and zeroes. When arranged into a particular two-dimensional grid they look like a picture that makes sense to a human eye!\\n\\n![transmission signal in 2d](images/radio-transmission-2d.png)\\n\\nSecond, we have some theories on how to interpret this picture. It looks like a binary encoding of numbers from 1 to 8 that follows a regular pattern that can be extended further to construct any natural number. However, we don\u2019t have any hard data to support our construction\u2026\\n\\n![how to encode numbers](images/numbers-encoding4.png)\\n\\nOkay, here is the exciting part! I just got a second message! I\u2019m going to apply the code I got from you yesterday to convert this second signal into a picture. I\u2019ll post this picture to [a separate page](https://message-from-space.readthedocs.io/en/latest/message2.html) in our documentation so we can collaborate on the explanation.\\n\\nSo excited! Can\u2019t wait to [work with you](https://discord.gg/xvMJbas) once again!"},{"id":1024,"date":"2020-07-03T12:10:18.321+05:00","author":"Ivan Zaitsev","title":"A Personal Ap
1peal to Scientists and Engineers From All Over the World","text":"<iframe width=\\"640\\" height=\\"360\\" src=\\"https://www.youtube.com/embed/EjL-5EuQeCU\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\n Hello.\\n\\nMy name is Ivan Zaitsev. I\'m a staff astronomer at Pegovka observatory in the Urals region of Russia.\\n\\nSeveral days ago we have been monitoring radio signals from a small region of sky around [HD 190360](http://simbad.u-strasbg.fr/simbad/sim-id?Ident=HD+190360) for our exoplanet research purposes. We have registered a peculiar radio transmission which cannot be attributed to any natural source in this area.\\n\\nWe tried to analyze and decode this message. But we don\'t have any trained deciphering specialists here on site, and we don\'t have appropriate software to analyze this message. We have made very little progress so far.\\n\\nI believe that decoding this message can lead to a major breakthrough in our understanding of the Universe. I believe that science should be a joint effort. Together we can crack this problem much faster that any single research group.\\n\\nThat\'s why I decided to publish a [recording of this message](https://message-from-space.readthedocs.io/en/latest/_downloads/822b494d13eb35a97f159e041a004fa9/radio-transmission-recording.wav) and create a [special documentation page](https://message-from-space.readthedocs.io/en/latest/radio-transmission-recording.html) to collaborate on the explanation.\\n\\nIf you have any idea at all on how to decode and explain the message, please send a Pull Request to the [appropriate page](https://github.com/zaitsev85/message-from-space/blob/master/source/radio-transmission-recording.rst)! We cannot move forward without this!\\n\\nSincerely,\\nIvan Zaitsev\\n\\nP.S. Don\'t hesitate to join my personal [chat server](https://discord.gg/xvMJbas) to combine our efforts in the spirit of open scientific collaboration."},{"id":1023,"date":"2015-06-29T18:04:55.780+05:00","author":"Ivan Zaitsev","title":"No Title","text":"![flowers](/images/flowers.jpeg)\\n\\nPetunias look great this year!"},{"id":0,"date":"2008-03-21T02:14:43.890+05:00","author":"Ivan Zaitsev","title":"First Post","text":"Dear diary,\\n\\nI don\'t know why I\'m here. Maybe one day I\'ll need a place for amazing news about space. So I\'ll try to blog something interesting once in a while."}]')},45:function(e){e.exports=JSON.parse('[{"id":2063,"date":"2020-07-29T00:00:45.000+03:00","author":"Igor Lukanin","title":"REALLY AWAITING Your Feedback and Self-Nominations for the Judges\' Prize","text":"Hi. A week after the end of the contest, we\'re finally publishing the [survey to collect your feedback](https://forms.gle/jPRK3TQxyeY4TcMr7) which is very much appreciated. Please share!\\n\\nWe\'ll use this feedback to better understand the outcomes of our aspirations and decisions during the preparation phase and during the 72 hours of the contest. That\'s why we encourage you to be as verbose as you can. Upon the completion of this survey, you\'ll be able to see all the answers. Thank you in advance!\\n\\nPlease note that <b>filling out the second page of this survey is required if you wish your team to be considered for the Judges\' Prize</b>. Also, please double-check that your team\'s repository is public and contains a README where you share your experience, pictures, videos, and write-ups."},{"id":2062,"date":"2020-07-23T13:00:00.000+03:00","author":"Igor Lukanin","title":"Teams in the Pre-Final Scoreboard","text":"We\'re ready to publish the [pre-final scoreboard](https://icfpcontest2020.github.io/#/scoreboard#final) which contains 95 teams. These teams have made their final submission for the 8th stage and the final stage of the [full round](https://icfpcontest2020.github.io/#/scoreboard#full).\\n\\nFor teams on positions from 1 to 20, the actual position and the score are hidden. Instead, these teams are sorted in the alphabetical order. All other teams are shown with their actual position and total score after the 8th stage.\\n\\nTherefore, if your team\'s position and score are hidden, it indicates that your team have made it to the final stage. Your team\'s position and score will be revealed at the [ICFP 2020](https://conf.researchr.org/home/icfp-2020) in August."},{"id":2061,"date":"2020-07-20T18:00:00.000+05:00","author":"Igor Lukanin","title":"The Contest Has Ended","text":"<iframe width=\\"640\\" height=\\"340\\" src=\\"https://www.youtube.com/embed/Me-0k5XGZWY\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\nSo\u2026 it\u2019s over.\\n\\nAfter the countdown reached zero, the alien spacecraft has sent us one final transmission that looked like a single player key. We deduced that this is an invitation to the final battle. So we took the best algorithm we have, written by team <b>-inaudible-</b>, and joined the game\u2026 <b>And we won.</b> The spacecraft has left the orbit immediately after the end of the game and didn\u2019t send us any further messages.\\n\\nWhat was it all about? What happens next? What is our prize? Is it just the right for our species to exist? Is it an invitation to some elite club of advanced civilisations? We don\u2019t know. Our visitors did not give us any answers.\\n\\nWe sincerely thank all the participants of the ICFP Contest 2020. That was our honor and great pleasure to organize this contest for you.\\n\\nIn the end we can only hope that you all had a good time. Please, do share your experience, opinions, pictures and write-ups! We hope to meet you all at the International Conference on Functional Programming in August.\\n\\n<b>In the next 7 days,</b> we kindly ask you to do the following:\\n\\n1. Make your repository (specified in the team profile) public. We\'ve obfuscated your email in the profile so don\'t be afraid to leak your API key. Don\'t forget to commit your \u201cgalaxy evaluator\u201d (or \u201cGalaxy Pad\u201d), if any, to the repository. Add a README, share your experience, pictures, videos, and write-ups. Definitely do s
1o, if you wish your team to be considered for a prize.\\n\\n2. Optionally, leave feedback by filling out [this survey](https://forms.gle/jPRK3TQxyeY4TcMr7).\\n\\nWarm regards,\\n\\nAlexander Khramtsov, Alexey Kirpichnikov, Andrey Kostousov, Igor Lukanin, Ivan Dashkevich, Nika Samokhina, Nikita Sivukhin, Pavel Egorov"},{"id":2060,"date":"2020-07-20T15:45:00.000+05:00","author":"Igor Lukanin","title":"Important: Final Stage of the Local Tournament","text":"Hi. We have published the clarified rules of the Final Alien Deadline and the [final stage of the tournament](https://message-from-space.readthedocs.io/en/latest/game.html#scoring).\\n\\nAfter the end of the contest you won\'t be able to push new submissions. But you\'ll have 30 minutes to decide which one of your submissions will play the final stage.\\n\\nHappy hacking!"},{"id":2059,"date":"2020-07-19T14:15:00.000+05:00","author":"Igor Lukanin","title":"Relatively Fresh News From the World of Reverse-Engineering","text":"Numerous clicks had to be applied to our \u201c[galaxy evaluator](https://icfpcontest2020.github.io/#/post/2055)\u201d to evolve our understanding of the alien protocol. We believe that it\'s a major achievement. Here\'s why:\\n\\nFirst, it enabled us to create the game visualizer (behold it in <b>Games</b> section).\\n\\nSecond, we included every bit of this novel knowledge into the [documentation](https://message-from-space.readthedocs.io/en/latest/game.html#protocol). We think this would help teams to take part in the \u201clocal tournament\u201c. We mean, definitely have a look at it.\\n\\nP.S. Seriously, isn\'t it [beautiful](https://twitter.com/icfpcontest2020/status/1284633483005100034)?"},{"id":2058,"date":"2020-07-19T01:40:00.000+05:00","author":"Igor Lukanin","title":"Please Evaluate Our Galaxy Evaluator","text":"Running the galaxy protocol from the [message #42](https://message-from-space.readthedocs.io/en/latest/message42.html) may still be a tough thing to do. Pavel Egorov has written a short \u201c[galaxy evaluator](https://message-from-space.readthedocs.io/en/latest/implementation.html)\u201d which is guaranteed to work. It\'s in pseudo code so no team will get competitive advantage using it."},{"id":2057,"date":"2020-07-18T22:45:00.000+05:00","author":"Igor Lukanin","title":"Full Contest Scoring Rules","text":"As promised, we\'ve published the [scoring rules](https://message-from-space.readthedocs.io/en/latest/game.html#scoring) for the full contest.\\n\\nWe\'ve triggered the re-evaluation of your submissions. Note that any starter kit is no longer a successful submission. Please check if your submission is still successful.\\n\\nHappy hacking!"},{"id":2056,"date":"2020-07-18T18:45:00.000+05:00","author":"Igor Lukanin","title":"HOW TO ACTUALLY WIN THE CONTEST","text":"Hi. We have news!\\n\\nAfter a little bit of tinkering with our own \u201c[galaxy evaluator](https://icfpcontest2020.github.io/#/post/2055)\u201d we\'ve come to understanding about the true meaning of images we get by running any \u201cevaluator\u201d.\\n\\nWe were able to understand what the \u201caliens\u201d [want to express](https://message-from-space.readthedocs.io/en/latest/game.html).\\n\\nSince we have to combine this \u201calien story\u201d with the ICFP Contest, we\'ve decided to recognize the winners of the \u201c[local tournament](https://message-from-space.readthedocs.io/en/latest/game.html)\u201c as the winners of the ICFP Contest. The exact scoring rules will be published soon.\\n\\nWe encourage you to study the \u201calien story\u201d, bravely fight the \u201cbattles\u201d, and gloriously win the \u201clocal tournament\u201d. Good luck!"},{"id":2055,"date":"2020-07-18T16:30:00.000+05:00","author":"Igor Lukanin","title":"Galaxy Notes","text":"We\'re so much thrilled to watch the teams progressing through the lightning round (which ends on July 18 at 13:00 UTC) and posting [beautiful images](https://twitter.com/icfpcontest2020/status/1284413782937280512) of their galaxies in [Discord](https://discord.gg/xvMJbas). It took some time and effort to create our own \u201cgalaxy evaluator\u201d and render our own images properly.\\n\\nFirst, we decided to [overlay all images](https://twitter.com/icfpcontest2020/status/1284425816458383360) with different opacities.\\n\\nSecond, we found a way to [enter two-dimensional vectors](https://twitter.com/icfpcontest2020/status/1284432081787944960) into the evaluator. We use mouse 
1clicks for that as every click produces a convenient <b>(x,y)</b> pair.\\n\\nThird, we\'ve got our hands on the galaxy. [So beautiful!](https://twitter.com/icfpcontest2020/status/1284432799009824768)\\n\\nFourth, we continued to explore. We immediately saw that our evaluator sent something to our own proxy! And we\'ve got [very complicated images](https://twitter.com/icfpcontest2020/status/1284435466209693696) as a result. As of this moment, we have no idea about their meaning.\\n\\nWe hope that our galaxy notes will help you to render your own images!\\n\\nP.S. We\'re glad to see that participants continue to contribute more detailed interpretations of the messages. In particular, we like the [message #38](https://message-from-space.readthedocs.io/en/latest/message38.html)."},{"id":2054,"date":"2020-07-18T04:15:00.000+05:00","author":"Igor Lukanin","title":"How to Run the Galaxy (Video Course)","text":"Running the galaxy protocol from the [message #42](https://message-from-space.readthedocs.io/en/latest/message42.html) may be a tough thing to do. Pavel Egorov has recorded a short video course which addresses this issue. Watch [Part 1](https://www.youtube.com/watch?v=Jfd20wOImnI), [Part 2](https://www.youtube.com/watch?v=oU4RAEQCTDE), and [Part 3](https://www.youtube.com/watch?v=A4WdLfHWZF0).\\n\\nPart 1. Tree construction and evaluation:\\n\\n<iframe width=\\"640\\" height=\\"340\\" src=\\"https://www.youtube.com/embed/Jfd20wOImnI\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\nPart 2. Lazy evaluation:\\n\\n<iframe width=\\"640\\" height=\\"340\\" src=\\"https://www.youtube.com/embed/oU4RAEQCTDE\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\nPart 3. S-combinators and caching:\\n\\n<iframe width=\\"640\\" height=\\"340\\" src=\\"https://www.youtube.com/embed/A4WdLfHWZF0\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>"},{"id":2053,"date":"2020-07-18T00:00:00.000+05:00","author":"Igor Lukanin","title":"Galaxy as an Interaction Protocol","text":"We\'ve compiled all knowledge available in [Discord](https://discord.gg/xvMJbas) about the message #42 and updated the docs. Have a look at the [interpretation](https://message-from-space.readthedocs.io/en/latest/message42.html) if you\'re confused or in need of a gentle nudge."},{"id":2052,"date":"2020-07-17T22:30:00.000+05:00","author":"Igor Lukanin","title":"SCORE POINTS & WIN CONTEST","text":"Okay, we\'re ready to publish the [REALLY HUGE message](https://icfpcontest2020.github.io/#/post/2049). We\'ve decided not to render it as an image and just [publish it as text](https://message-from-space.readthedocs.io/en/latest/message42.html). Really, who has a monitor this large?\\n\\nWe\'ve also enabled the [scoreboard](https://icfpcontest2020.github.io/#/scoreboard). To score points and win the lightning round (which ends on July 18 at 13:00 UTC), we ask you to make progress with understanding that REALLY HUGE message. Feel free to collaborate in [Discord](https://discord.gg/xvMJbas) or play secretly.\\n\\nNote that you can get 1 point right now for using the [proxy](https://icfpcontest2020.github.io/#/post/2051). Also, for historical reasons, you can still get 1 point for making a successful [submission](https://github.com/icfpcontest2020/dockerfiles/blob/master/README.md)."},{"id":2051,"date":"2020-07-17T21:55:00.000+05:00","author":"Igor Lukanin","title":"A Proxy to Send Messages to Space","text":"Ready!\\n\\nWe\'ve added a few <b>AlienApi</b> methods to the API we\'ve already prepared for the contest and glued them to the antenna at Pegovka Observatory. Hope it\'ll be working flawlessly.\\n\\nSo, here\'s our [Swagger documentation](https://icfpc2020-api.testkontur.ru/swagger) for the API.\\n\\nAll you need is the API key from your team profile."},{"id":2050,"date":"2020-07-17T21:25:00.000+05:00","author":"Igor Lukanin","title":"Everyone Has a Say","text":"When Ivan Zaitsev read the suggestion to transmit something to the spacecraft again in regard to the [message #36](https://message-from-space.readthedocs.io/en/latest/message36.html) in [Discord](https://discord.gg/xvMJbas), he was energized. We modulated a list of a single zero element for Ivan, and he transmitted that message with his antenna at Pegovka Observatory.\\n\\nAnd\u2026 he got the response! This one: <b>110110000111011111100001001111110101000000</b>.\\n\\nWhen Ivan repeated the transmission after approximately 10 seconds, he received another response: <b>110110000111011111100001001111110100110000</b>.\\n\\nNeither Ivan, nor we have any idea about the meaning of these responses. That\'s why now we\'re going to create a proxy so any team is able to transmit something and get something in return.\\n\\nCan\'t wait to share this proxy with you!"},{"id":2049,"date":"2020-07-17T19:25:00.000+05:00","author":"Igor Lukanin","title":"A Huge Message is Coming, and Text is Better Than Images","text":"We\'re really amused by the great progress you\'re making with [decoding the messages](https://message-from-space.readthedocs.io/en/latest/). We\'re monitoring the chat in [Discord](https://discord.gg/xvMJbas) for your suggestions on the meaning of messages and names for unknown symbols appearing in these messages. We\'re updating the documentation accordingly. Keep going!\\n\\
1nAt the same time, we have more news from Pegovka Observatory! Our friend Ivan Zaitsev says that a new message which appears to be REALLY HUGE is being received right now. We don\'t really know if we\'ll be able to render this message as an image. In this case, we\'ll post this message as text. That is why it is very important that you give names to unknown symbols in the messages.\\n\\nWe\'ll make a new post when this REALLY HUGE message is ready."},{"id":2048,"date":"2020-07-17T18:00:00.000+05:00","author":"Igor Lukanin","title":"Welcome to the Contest","text":"<iframe width=\\"640\\" height=\\"340\\" src=\\"https://www.youtube.com/embed/PzJ6gfo92oA\\" frameborder=\\"0\\" allow=\\"accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture\\" allowfullscreen></iframe>\\n\\nDear participants of the ICFP Contest 2020. We have prepared a great contest for you! But we have strong reasons to throw it out and ask you to put your efforts into something else.\\n\\nOur friend Ivan Zaitsev, a staff astronomer at Pegovka Observatory, has recently become a part of a very peculiar story. During the last two weeks he has received many messages from an unidentified source which was later recognized as a spacecraft. Ivan has made some progress in decoding and understanding the messages but recently the spacecraft has [transmitted a lot more](https://message-from-space.readthedocs.io/en/latest/).\\n\\nPlease help to decode the messages! The humankind needs your help.\\n\\nIvan will be right here with the ICFP Contest organizers. Reach out to him on [Discord](https://discord.gg/xvMJbas)."}]')},48:function(e,t,a){e.exports={row:"styles_row__1BPlo",buttonRow:"styles_buttonRow__1LLhO",blackText:"styles_blackText__1nUbW",error:"styles_error__7j77G"}},49:function(e,t,a){e.exports={root:"styles_root__BUQrS",footer:"styles_footer__OF_kJ",footerItem:"styles_footerItem__JxyTB"}},5:function(e,t,a){e.exports={root:"styles_root__2xfq7",subtitle:"styles_subtitle__3h6J1",audiences:"styles_audiences__19Dt0",audiences__emoji:"styles_audiences__emoji__14Rms",audiences__scope:"styles_audiences__scope__3mOb8",timer:"styles_timer__2AN8b",timer__download:"styles_timer__download__2TgKw",section:"styles_section__3heFa",section__title:"styles_section__title__g5_Gi",section__cta:"styles_section__cta__2Ajtu",features:"styles_features__2ceUO",features__double:"styles_features__double__58VQ0",features__emoji:"styles_features__emoji__Se29P",features__title:"styles_features__title__6TdBU",features__pro:"styles_features__pro__2v0M3",demos:"styles_demos__SQAUW",tweet:"styles_tweet__1TlJk",videos:"styles_videos__Hy-LD",thanks:"styles_thanks__14zDs",thanks__title:"styles_thanks__title__1SWZB",thanks__script:"styles_thanks__script__2XAoZ",supporters:"styles_supporters__2at3v",supporters__title:"styles_supporters__title__39ocH",supporters__script:"styles_supporters__script__b6DMP",video:"styles_video__1EF-v",links:"styles_links__wwjfB"}},54:function(e){e.exports=JSON.parse('[{"value":"World","text":"World","shortValue":"WW"},{"value":"EUR","text":"European Union","shortValue":"EU"},{"value":"AFG","text":"Afghanistan","shortValue":"AF"},{"value":"ALA","text":"\xc5land Islands","shortValue":"AX"},{"value":"ALB","text":"Albania","shortValue":"AL"},{"value":"DZA","text":"Algeria","shortValue":"DZ"},{"value":"ASM","text":"American Samoa","shortValue":"AS"},{"value":"AND","text":"Andorra","shortValue":"AD"},{"value":"AGO","text":"Angola","shortValue":"AO"},{"value":"AIA","text":"Anguilla","shortValue":"AI"},{"value":"ATA","text":"Antarctica","shortValue":"AQ"},{"value":"ATG","text":"Antigua and Barbuda","shortValue":"AG"},{"value":"ARG","text":"Argentina","shortValue":"AR"},{"value":"ARM","text":"Armenia","shortValue":"AM"},{"value":"ABW","text":"Aruba","shortValue":"AW"},{"value":"AUS","text":"Australia","shortValue":"AU"},{"value":"AUT","text":"Austria","shortValue":"AT"},{"value":"AZE","text":"Azerbaijan","shortValue":"AZ"},{"value":"BHS","text":"Bahamas","shortValue":"BS"},{"value":"BHR","text":"Bahrain","shortValue":"BH"},{"value":"BGD","text":"Bangladesh","shortValue":"BD"},{"value":"BRB","text":"Barbados","shortValue":"BB"},{"value":"BLR","text":"Belarus","shortValue":"BY"},{"value":"BEL","text":"Belgium","shortValue":"BE"},{"value":"BLZ","text":"Belize","shortValue":"BZ"},{"value":"BEN","text":"Benin","shortValue":"BJ"},{"value":"BMU","text":"Bermuda","shortValue":"BM"},{"value":"BTN","text":"Bhutan","shortValue":"BT"},{"value":"BOL","text":"Bolivia, Plurinational State of","shortValue":"BO"},{"value":"BES","text":"Bonaire, Sint Eustatius and Saba","shortValue":"BQ"},{"value":"BIH","text":"Bosnia and Herzegovina","shortValue":"BA"},{"value":"BWA","text":"Botswana","shortValue":"BW"},{"value":"BVT","text":"Bouvet Island","shortValue":"BV"},{"value":"BRA","text":"Brazil","shortValue":"BR"},{"value":"IOT","text":"British Indian Ocean Territory","shortValue":"IO"},{"value":"BRN","text":"Brunei Darussalam","shortValue":"BN"},{"value":"BGR","text":"Bulgaria","shortValue":"BG"},{"value":"BFA","text":"Burkina Faso","shortValue":"BF"}
1,{"value":"BDI","text":"Burundi","shortValue":"BI"},{"value":"KHM","text":"Cambodia","shortValue":"KH"},{"value":"CMR","text":"Cameroon","shortValue":"CM"},{"value":"CAN","text":"Canada","shortValue":"CA"},{"value":"CPV","text":"Cape Verde","shortValue":"CV"},{"value":"CYM","text":"Cayman Islands","shortValue":"KY"},{"value":"CAF","text":"Central African Republic","shortValue":"CF"},{"value":"TCD","text":"Chad","shortValue":"TD"},{"value":"CHL","text":"Chile","shortValue":"CL"},{"value":"CHN","text":"China","shortValue":"CN"},{"value":"CXR","text":"Christmas Island","shortValue":"CX"},{"value":"CCK","text":"Cocos (Keeling) Islands","shortValue":"CC"},{"value":"COL","text":"Colombia","shortValue":"CO"},{"value":"COM","text":"Comoros","shortValue":"KM"},{"value":"COG","text":"Congo","shortValue":"CG"},{"value":"COD","text":"Congo, the Democratic Republic of the","shortValue":"CD"},{"value":"COK","text":"Cook Islands","shortValue":"CK"},{"value":"CRI","text":"Costa Rica","shortValue":"CR"},{"value":"CIV","text":"C\xf4te d\'Ivoire","shortValue":"CI"},{"value":"HRV","text":"Croatia","shortValue":"HR"},{"value":"CUB","text":"Cuba","shortValue":"CU"},{"value":"CUW","text":"Cura\xe7ao","shortValue":"CW"},{"value":"CYP","text":"Cyprus","shortValue":"CY"},{"value":"CZE","text":"Czech Republic","shortValue":"CZ"},{"value":"DNK","text":"Denmark","shortValue":"DK"},{"value":"DJI","text":"Djibouti","shortValue":"DJ"},{"value":"DMA","text":"Dominica","shortValue":"DM"},{"value":"DOM","text":"Dominican Republic","shortValue":"DO"},{"value":"ECU","text":"Ecuador","shortValue":"EC"},{"value":"EGY","text":"Egypt","shortValue":"EG"},{"value":"SLV","text":"El Salvador","shortValue":"SV"},{"value":"GNQ","text":"Equatorial Guinea","shortValue":"GQ"},{"value":"ERI","text":"Eritrea","shortValue":"ER"},{"value":"EST","text":"Estonia","shortValue":"EE"},{"value":"ETH","text":"Ethiopia","shortValue":"ET"},{"value":"FLK","text":"Falkland Islands (Malvinas)","shortValue":"FK"},{"value":"FRO","text":"Faroe Islands","shortValue":"FO"},{"value":"FJI","text":"Fiji","shortValue":"FJ"},{"value":"FIN","text":"Finland","shortValue":"FI"},{"value":"FRA","text":"France","shortValue":"FR"},{"value":"GUF","text":"French Guiana","shortValue":"GF"},{"value":"PYF","text":"French Polynesia","shortValue":"PF"},{"value":"ATF","text":"French Southern Territories","shortValue":"TF"},{"value":"GAB","text":"Gabon","shortValue":"GA"},{"value":"GMB","text":"Gambia","shortValue":"GM"},{"value":"GEO","text":"Georgia","shortValue":"GE"},{"value":"DEU","text":"Germany","shortValue":"DE"},{"value":"GHA","text":"Ghana","shortValue":"GH"},{"value":"GIB","text":"Gibraltar","shortValue":"GI"},{"value":"GRC","text":"Greece","shortValue":"GR"},{"value":"GRL","text":"Greenland","shortValue":"GL"},{"value":"GRD","text":"Grenada","shortValue":"GD"},{"value":"GLP","text":"Guadeloupe","shortValue":"GP"},{"value":"GUM","text":"Guam","shortValue":"GU"},{"value":"GTM","text":"Guatemala","shortValue":"GT"},{"value":"GGY","text":"Guernsey","shortValue":"GG"},{"value":"GIN","text":"Guinea","shortValue":"GN"},{"value":"GNB","text":"Guinea-Bissau","shortValue":"GW"},{"value":"GUY","text":"Guyana","shortValue":"GY"},{"value":"HTI","text":"Haiti","shortValue":"HT"},{"value":"HMD","text":"Heard Island and McDonald Islands","shortValue":"HM"},{"value":"VAT","text":"Holy See (Vatican City State)","shortValue":"VA"},{"value":"HND","text":"Honduras","shortValue":"HN"},{"value":"HKG","text":"Hong Kong","shortValue":"HK"},{"value":"HUN","text":"Hungary","shortValue":"HU"},{"value":"ISL","text":"Iceland","shortValue":"IS"},{"value":"IND","text":"India","shortValue":"IN"},{"value":"IDN","text":"Indonesia","shortValue":"ID"},{"value":"IRN","text":"Iran, Islamic Republic of","shortValue":"IR"},{"value":"IRQ","text":"Iraq","shortValue":"IQ"},{"value":"IRL","text":"Ireland","shortValue":"IE"},{"value":"IMN","text":"Isle of Man","shortValue":"IM"},{"value":"ISR","text":"Israel","shortValue":"IL"},{"value":"ITA","text":"Italy","shortValue":"IT"},{"value":"JAM","text":"Jamaica","shortValue":"JM"},{"value":"JPN","text":"Japan","shortValue":"JP"},{"value":"JEY","text":"Jersey","shortValue":"JE"},{"value":"JOR","text":"Jordan","shortValue":"JO"},{"value":"KAZ","text":"Kazakhstan","shortValue":"KZ"},{"value":"KEN","text":"Kenya","shortValue":"KE"},{"value":"KIR","text":"Kiribati","shortValue":"KI"},{"value":"PRK","text":"Korea, Democratic People\'s Republic of","shortValue":"KP"},{"value":"KOR","text":"Korea, Republic of","shortValue":"KR"},{"value":"KWT","text":"Kuwait","shortValue":"KW"},{"value":"KGZ","text":"Kyrgyzstan","shortValue":"KG"},{"value":"LAO","text":"Lao People\'s Democratic Republic","shortValue":"LA"},{"value":"LVA","text":"Latvia","shortValue":"LV"},{"value":"LBN","text":"Lebanon","shortValue":"LB"},{"value":"LSO","text":"Lesotho","shortValue":"LS"},{"value":"LBR","text":"Liberia","shortValue":"LR"},{"value":"LBY","text":"Libya","shortValue":"LY"},{"value":"LIE","text":"Liechtenstein","shortValue":"LI"},{"value":"LTU","text":"Lithuania","shortValue":"LT"},{"value":"LUX","text":"Luxembourg","shortValue":"LU"},{"value":"MAC","text":"Macao","shortValue":"MO"},{"value":"MKD","text":"Macedonia, the former Yugoslav Republic of","shortValue":"MK"},{"value":"MDG","text":"Madagascar","shortValue":"MG"},{"value":"MWI","text":"Malawi","shortValue":"MW"},{"value":"MYS","text":"Malaysia","shortValue":"MY"},{"value":"MDV","text":"Maldives","shortValue":"MV"},{"value":"MLI","text":"Mali","shortValue":"ML"},{"value":"MLT","text":"Malta","shortValue":"MT"},{"value":"MHL","text":"Marshall Islands","shortValue":"MH"},{"value":"MTQ","text":"Martinique","shortValue":"MQ"},{"value":"MRT","text":"Mauritania","shortValue":"MR"},{"value":"MUS","text":"Mauritius","shortValue":"MU"},{"value":"MYT","text":"Mayotte","shortValue":"YT"},{"value":"MEX","text":"Mexico","shortValue":"MX"},{"value":"FSM","text":"Micronesia, Federated States of","shortValue":"FM"},{"value":"MDA","text":"Moldova, Republic of","shortValue":"MD"},{"value":"MCO","text":"Monaco","shortValue":"MC"},{"value":"MNG","text":"Mongolia","shortValue":"MN"},{"value":"MNE","text":"Montenegro","shortValue":"ME"},{"value":"MSR","text":"Montserrat","shortValue":"MS"},{"value":"MAR","text":"Morocco","shortValue":"MA"},{"value":"MOZ","text":"Mozambique","shortValue":"MZ"},{"value":"MMR","text":"Myanmar","shortValue":"MM"},{"value":"NAM","text":"Namibia","shortValue":"NA"},{"value":"NRU","text":"Nauru","shortValue":"NR"},{"value":"NPL","text":"Nepal","shortValue":"NP"},{"value":"NLD","text":"Netherlands","shortValue":"NL"},{"value":"NCL","text":"New Caledonia","shortValue":"NC"},{"value":"NZL","text":"New Zealand","shortValue":"NZ"},{"value":"NIC","text":"Nicaragua","shortValue":"NI"},{"value":"NER","text":"Niger","shortValue":"NE"},{"value":"NGA","text":"Nigeria","shortValue":"NG"},{"value":"NIU","text":"Niue","shortValue":"NU"},{"value":"NFK","text":"Norfolk Island","shortValue":"NF"},{"value":"MNP","text":"Northern Mariana Islands","shortValue":"MP"},{"value":"NOR","text":"Norway","shortValue":"NO"},{"value":"OMN","text":"Oman","shortValue":"OM"},{"value":"PAK","text":"Pakistan","shortValue":"PK"},{"value":"PLW","text":"Palau","shortValue":"PW"},{"value":"PSE","text":"Palestinian Territory, Occupied","shortValue":"PS"},{"value":"PAN","text":"Panama","shortValue":"PA"},{"value":"PNG","text":"Papua New Guinea","shortValue":"PG"},{"value":"PRY","text":"Paraguay","shortValue":"PY"},{"value":"PER","text":"Peru","shortValue":"PE"},{"value":"PHL","text":"Philippines","shortValue":"PH"},{"value":"PCN","text":"Pitcairn","shortValue":"PN"},{"value":"POL","text":"Poland","shortValue":"PL"},{"value":"PRT","text":"Portugal","shortValue":"PT"},{"value":"PRI","text":"Puerto Rico","shortValue":"PR"},{"value":"QAT","text":"Qatar","shortValue":"QA"},{"value":"REU","text":"R\xe9union","shortValue":"RE"},{"value":"ROU","text":"Romania","shortValue":"RO"},{"value":"RUS","text":"Russian Federation","shortValue":"RU"},{"value":"RWA","text":"Rwanda","shortValue":"RW"},{"value":"BLM","text":"Saint Barth\xe9lemy","shortValue":"BL"},{"value":"SHN","text":"Saint Helena, Ascension and Tristan da Cunha","shortValue":"SH"},{"value":"KNA","text":"Saint Kitts and Nevis","shortValue":"KN"},{"value":"LCA","text":"Saint Lucia","shortValue":"LC"},{"value":"MAF","text":"Saint Martin (French part)","shortValue":"MF"},{"value":"SPM","text":"Saint Pierre and Miquelon","shortValue":"PM"},{"value":"VCT","text":"Saint Vincent and the Grenadines","shortValue":"VC"},{"value":"WSM","text":"Samoa","shortValue":"WS"},{"value":"SMR","text":"San Marino","shortValue":"SM"},{"value":"STP","text":"Sao Tome and Principe","shortValue":"ST"},{"value":"SAU","text":"Saudi Arabia","shortValue":"SA"},{"value":"SEN","text":"Senegal","shortValue":"SN"},{"value":"SRB","text":"Serbia","shortValue":"RS"},{"value":"SYC","text":"Seychelles","shortValue":"SC"},{"value":"SLE","text":"Sierra Leone","shortValue":"SL"},{"value":"SGP","text":"Singapore","shortValue":"SG"},{"value":"SXM","text":"Sint Maarten (Dutch part)","shortValue":"SX"},{"value":"SVK","text":"Slovakia","shortValue":"SK"},{"value":"SVN","text":"Slovenia","shortValue":"SI"},{"value":"SLB","text":"Solomon Islands","shortValue":"SB"},{"value":"SOM","text":"Somalia","shortValue":"SO"},{"value":"ZAF","text":"South Africa","shortValue":"ZA"},{"value":"SGS","text":"South Georgia and the South Sandwich Islands","shortValue":"GS"},{"value":"SSD","text":"South Sudan","shortValue":"SS"},{"value":"ESP","text":"Spain","shortValue":"ES"},{"value":"LKA","text":"Sri Lanka","shortValue":"LK"},{"value":"SDN","text":"Sudan","shortValue":"SD"},{"value":"SUR","text":"Suriname","shortValue":"SR"},{"value":"SJM","text":"Svalbard and Jan Mayen","shortValue":"SJ"},{"value":"SWZ","text":"Swaziland","shortValue":"SZ"},{"value":"SWE","text":"Sweden","shortValue":"SE"},{"value":"CHE","text":"Switzerland","shortValue":"CH"},{"value":"SYR","text":"Syrian Arab Republic","shortValue":"SY"},{"value":"TWN","text":"Taiwan","shortValue":"TW"},{"value":"TJK","text":"Tajikistan","shortValue":"TJ"},{"value":"TZA","text":"Tanzania, United Republic of","shortValue":"TZ"},{"value":"THA","text":"Thailand","shortValue":"TH"},{"value":"TLS","text":"Timor-Leste","shortValue":"TL"},{"value":"TGO","text":"Togo","shortValue":"TG"},{"value":"TKL","text":"Tokelau","shortValue":"TK"},{"value":"TON","text":"Tonga","shortValue":"TO"},{"value":"TTO","text":"Trinidad and Tobago","shortValue":"TT"},{"value":"TUN","text":"Tunisia","shortValue":"TN"},{"value":"TUR","text":"Turkey","shortValue":"TR"},{"value":"TKM","text":"Turkmenistan","shortValue":"TM"},{"value":"TCA","text":"Turks and Caicos Islands","shortValue":"TC"},{"value":"TUV","text":"Tuvalu","shortValue":"TV"},{"value":"UGA","text":"Uganda","shortValue":"UG"},{"value":"UKR","text":"Ukraine","shortValue":"UA"},{"value":"ARE","text":"United Arab Emirates","shortValue":"AE"},{"value":"GBR","text":"United Kingdom","shortValue":"GB"},{"value":"USA","text":"United States","shortValue":"US"},{"value":"UMI","text":"United States Minor Outlying Islands","shortValue":"UM"},{"value":"URY","text":"Uruguay","shortValue":"UY"},{"value":"UZB","text":"Uzbekistan","shortValue":"UZ"},{"value":"VUT","text":"Vanuatu","shortValue":"VU"},{"value":"VEN","text":"Venezuela, Bolivarian Republic of","shortValue":"VE"},{"value":"VNM","text":"Viet Nam","shortValue":"VN"},{"value":"VGB","text":"Virgin Islands, British","shortValue":"VG"},{"value":"VIR","text":"Virgin Islands, U.S.","shortValue":"VI"},{"value":"WLF","text":"Wallis and Futuna","shortValue":"WF"},{"value":"ESH","text":"Western Sahara","shortValue":"EH"},{"value":"YEM","text":"Yemen","shortValue":"YE"},{"value":"ZMB","text":"Zambia","shortValue":"ZM"},{"value":"ZWE","text":"Zimbabwe","shortValue":"ZW"}]')},56:function(e,t,a){e.exports={root:"styles_root__q7V3z",box:"styles_box__4f_RE",error:"styles_error__35IO7"}},57:function(e,t,a){e.exports={form:"styles_form__2Ebhh",row:"styles_row__3N1E7",buttonRow:"styles_buttonRow__3VxaM"}},58:function(e,t,a){e.exports={table:"styles_table__1aa56",Win:"styles_Win__2ox4t",Lose:"styles_Lose__5tYHt",Draw:"styles_Draw__F5_02"}},67:function(e,t,a){e.exports={container:"styles_container__fAA0Z",narrowContainer:"styles_narrowContainer__TZDE3"}},70:function(e,t,a){e.exports={root:"styles_root__2DNLe",disclaimer:"styles_disclaimer__40iq
1-"}},71:function(e,t,a){e.exports={listItem:"styles_listItem__2Glde",root:"styles_root__1b49X"}},85:function(e,t,a){e.exports={root:"styles_root__2cSWM",value:"styles_value__2NNr2",form:"styles_form__3ly6z",row:"styles_row__2sZ9r",buttonRow:"styles_buttonRow__26sw-"}},86:function(e,t,a){e.exports={root:"styles_root__1Tz1F",delimiter:"styles_delimiter__zRs7s",branch:"styles_branch__2eebS"}},88:function(e,t,a){e.exports={root:"style_root__qqxoi"}},98:function(e,t,a){e.exports=a(198)}},[[98,1,2]]]);
2//# sourceMappingURL=main.3489b1f0.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.