ant-gitment
Version:
A comment plugin based on gitment
15 lines (13 loc) • 79.8 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("TopGitment",[],t):"object"==typeof exports?exports.TopGitment=t():e.TopGitment=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.LS_ACCESS_TOKEN_KEY="gitment-comments-token",t.LS_USER_KEY="gitment-user-info",t.NOT_INITIALIZED_ERROR=new Error("Comments Not Initialized")},function(e,t,n){var r=n(9)(n(2),n(10),null,null,null);e.exports=r.exports},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(4),i=n.n(r);t.default={name:"top-gitment",props:["options"],directives:{comment:{bind:function(e,t){new i.a({id:t.value.id+"",owner:t.value.owner,repo:t.value.repo,oauth:{client_id:t.value.oauth.client_id,client_secret:t.value.oauth.client_secret}}).render(e)}}}}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n.n(r),o={install:function(e){e.component(i.a.name,i.a)}};"undefined"!=typeof window&&window.Vue&&window.Vue.use(o),t.default=o},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){e[t]=function(n){var r=(0,u.getTargetContainer)(n),i=e.theme[t]||e.defaultTheme[t];return(0,a.autorun)(function(){var t=i(e.state,e);r.firstChild?r.replaceChild(t,r.firstChild):r.appendChild(t)}),r}}var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=n(8),s=n(0),u=n(7),c=n(6),l=function(e){return e&&e.__esModule?e:{default:e}}(c),d=function(){function e(){var t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r(this,e),this.defaultTheme=l.default,this.useTheme(l.default),Object.assign(this,{id:window.location.href,title:window.document.title,link:window.location.href,desc:"",labels:[],theme:l.default,oauth:{},perPage:20,maxCommentHeight:250},n),this.useTheme(this.theme);var i={};try{var o=localStorage.getItem(s.LS_USER_KEY);this.accessToken&&o&&Object.assign(i,JSON.parse(o),{fromCache:!0})}catch(e){localStorage.removeItem(s.LS_USER_KEY)}this.state=(0,a.observable)({user:i,error:null,meta:{},comments:void 0,reactions:[],commentReactions:{},currentPage:1});var c=u.Query.parse();if(c.code){var d=this.oauth,p=d.client_id,h=d.client_secret,f=c.code;delete c.code;var m=u.Query.stringify(c),v=""+window.location.origin+window.location.pathname+m+window.location.hash;history.replaceState({},"",v),Object.assign(this,{id:v,link:v},n),this.state.user.isLoggingIn=!0,u.http.post("https://gh-oauth.imsun.net",{code:f,client_id:p,client_secret:h},"").then(function(e){t.accessToken=e.access_token,t.update()}).catch(function(e){t.state.user.isLoggingIn=!1,alert(e)})}else this.update()}return o(e,[{key:"accessToken",get:function(){return localStorage.getItem(s.LS_ACCESS_TOKEN_KEY)},set:function(e){localStorage.setItem(s.LS_ACCESS_TOKEN_KEY,e)}},{key:"loginLink",get:function(){var e=this.oauth.redirect_uri||window.location.href,t=Object.assign({scope:"public_repo",redirect_uri:e},this.oauth);return"https://github.com/login/oauth/authorize"+u.Query.stringify(t)}}]),o(e,[{key:"init",value:function(){var e=this;return this.createIssue().then(function(){return e.loadComments()}).then(function(t){return e.state.error=null,t})}},{key:"useTheme",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.theme=t,Object.keys(this.theme).forEach(function(t){return i(e,t)})}},{key:"update",value:function(){var e=this;return Promise.all([this.loadMeta(),this.loadUserInfo()]).then(function(){return Promise.all([e.loadComments().then(function(){return e.loadCommentReactions()}),e.loadReactions()])}).catch(function(t){return e.state.error=t})}},{key:"markdown",value:function(e){return u.http.post("/markdown",{text:e,mode:"gfm"})}},{key:"createIssue",value:function(){var e=this,t=this.id,n=this.owner,r=this.repo,i=this.title,o=this.link,a=this.desc,s=this.labels;return u.http.post("/repos/"+n+"/"+r+"/issues",{title:i,labels:s.concat(["gitment",t]),body:o+"\n\n"+a}).then(function(t){return e.state.meta=t,t})}},{key:"getIssue",value:function(){return this.state.meta.id?Promise.resolve(this.state.meta):this.loadMeta()}},{key:"post",value:function(e){var t=this;return this.getIssue().then(function(t){return u.http.post(t.comments_url,{body:e},"")}).then(function(e){t.state.meta.comments++;var n=Math.ceil(t.state.meta.comments/t.perPage);return t.state.currentPage===n&&t.state.comments.push(e),e})}},{key:"loadMeta",value:function(){var e=this,t=this.id,n=this.owner,r=this.repo;return u.http.get("/repos/"+n+"/"+r+"/issues",{creator:n,labels:t}).then(function(t){return t.length?(e.state.meta=t[0],t[0]):Promise.reject(s.NOT_INITIALIZED_ERROR)})}},{key:"loadComments",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.state.currentPage;return this.getIssue().then(function(n){return u.http.get(n.comments_url,{page:t,per_page:e.perPage},"")}).then(function(t){return e.state.comments=t,t})}},{key:"loadUserInfo",value:function(){var e=this;return this.accessToken?u.http.get("/user").then(function(t){return e.state.user=t,localStorage.setItem(s.LS_USER_KEY,JSON.stringify(t)),t}):(this.logout(),Promise.resolve({}))}},{key:"loadReactions",value:function(){var e=this;return this.accessToken?this.getIssue().then(function(e){return e.reactions.total_count?u.http.get(e.reactions.url,{},""):[]}).then(function(t){return e.state.reactions=t,t}):(this.state.reactions=[],Promise.resolve([]))}},{key:"loadCommentReactions",value:function(){var e=this;if(!this.accessToken)return this.state.commentReactions={},Promise.resolve([]);var t=this.state.comments,n={};return Promise.all(t.map(function(t){if(!t.reactions.total_count)return[];var n=e.owner,r=e.repo;return u.http.get("/repos/"+n+"/"+r+"/issues/comments/"+t.id+"/reactions",{})})).then(function(r){return t.forEach(function(e,t){n[e.id]=r[t]}),e.state.commentReactions=n,n})}},{key:"login",value:function(){window.location.href=this.loginLink}},{key:"logout",value:function(){localStorage.removeItem(s.LS_ACCESS_TOKEN_KEY),localStorage.removeItem(s.LS_USER_KEY),this.state.user={}}},{key:"goto",value:function(e){return this.state.currentPage=e,this.state.comments=void 0,this.loadComments(e)}},{key:"like",value:function(){var e=this;if(!this.accessToken)return alert("Login to Like"),Promise.reject();var t=this.owner,n=this.repo;return u.http.post("/repos/"+t+"/"+n+"/issues/"+this.state.meta.number+"/reactions",{content:"heart"}).then(function(t){e.state.reactions.push(t),e.state.meta.reactions.heart++})}},{key:"unlike",value:function(){var e=this;if(!this.accessToken)return Promise.reject();var t=this.state,n=t.user,r=t.reactions,i=r.findIndex(function(e){return e.user.login===n.login});return u.http.delete("/reactions/"+r[i].id).then(function(){r.splice(i,1),e.state.meta.reactions.heart--})}},{key:"likeAComment",value:function(e){var t=this;if(!this.accessToken)return alert("Login to Like"),Promise.reject();var n=this.owner,r=this.repo,i=this.state.comments.find(function(t){return t.id===e});return u.http.post("/repos/"+n+"/"+r+"/issues/comments/"+e+"/reactions",{content:"heart"}).then(function(n){t.state.commentReactions[e].push(n),i.reactions.heart++})}},{key:"unlikeAComment",value:function(e){if(!this.accessToken)return Promise.reject();var t=this.state.commentReactions[e],n=this.state.comments.find(function(t){return t.id===e}),r=this.state.user,i=t.findIndex(function(e){return e.user.login===r.login});return u.http.delete("/reactions/"+t[i].id).then(function(){t.splice(i,1),n.reactions.heart--})}}]),e}();e.exports=d},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});t.close='<svg class="gitment-close-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M37.304 11.282l1.414 1.414-26.022 26.02-1.414-1.413z"/><path d="M12.696 11.282l26.022 26.02-1.414 1.415-26.022-26.02z"/></svg>',t.github='<svg class="gitment-github-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 10c-8.3 0-15 6.7-15 15 0 6.6 4.3 12.2 10.3 14.2.8.1 1-.3 1-.7v-2.6c-4.2.9-5.1-2-5.1-2-.7-1.7-1.7-2.2-1.7-2.2-1.4-.9.1-.9.1-.9 1.5.1 2.3 1.5 2.3 1.5 1.3 2.3 3.5 1.6 4.4 1.2.1-1 .5-1.6 1-2-3.3-.4-6.8-1.7-6.8-7.4 0-1.6.6-3 1.5-4-.2-.4-.7-1.9.1-4 0 0 1.3-.4 4.1 1.5 1.2-.3 2.5-.5 3.8-.5 1.3 0 2.6.2 3.8.5 2.9-1.9 4.1-1.5 4.1-1.5.8 2.1.3 3.6.1 4 1 1 1.5 2.4 1.5 4 0 5.8-3.5 7-6.8 7.4.5.5 1 1.4 1 2.8v4.1c0 .4.3.9 1 .7 6-2 10.2-7.6 10.2-14.2C40 16.7 33.3 10 25 10z"/></svg>',t.heart='<svg class="gitment-heart-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 39.7l-.6-.5C11.5 28.7 8 25 8 19c0-5 4-9 9-9 4.1 0 6.4 2.3 8 4.1 1.6-1.8 3.9-4.1 8-4.1 5 0 9 4 9 9 0 6-3.5 9.7-16.4 20.2l-.6.5zM17 12c-3.9 0-7 3.1-7 7 0 5.1 3.2 8.5 15 18.1 11.8-9.6 15-13 15-18.1 0-3.9-3.1-7-7-7-3.5 0-5.4 2.1-6.9 3.8L25 17.1l-1.1-1.3C22.4 14.1 20.5 12 17 12z"/></svg>',t.spinner='<svg class="gitment-spinner-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 50 50"><path d="M25 18c-.6 0-1-.4-1-1V9c0-.6.4-1 1-1s1 .4 1 1v8c0 .6-.4 1-1 1z"/><path opacity=".3" d="M25 42c-.6 0-1-.4-1-1v-8c0-.6.4-1 1-1s1 .4 1 1v8c0 .6-.4 1-1 1z"/><path opacity=".3" d="M29 19c-.2 0-.3 0-.5-.1-.4-.3-.6-.8-.3-1.3l4-6.9c.3-.4.8-.6 1.3-.3.4.3.6.8.3 1.3l-4 6.9c-.2.2-.5.4-.8.4z"/><path opacity=".3" d="M17 39.8c-.2 0-.3 0-.5-.1-.4-.3-.6-.8-.3-1.3l4-6.9c.3-.4.8-.6 1.3-.3.4.3.6.8.3 1.3l-4 6.9c-.2.2-.5.4-.8.4z"/><path opacity=".93" d="M21 19c-.3 0-.6-.2-.8-.5l-4-6.9c-.3-.4-.1-1 .3-1.3.4-.3 1-.1 1.3.3l4 6.9c.3.4.1 1-.3 1.3-.2.2-.3.2-.5.2z"/><path opacity=".3" d="M33 39.8c-.3 0-.6-.2-.8-.5l-4-6.9c-.3-.4-.1-1 .3-1.3.4-.3 1-.1 1.3.3l4 6.9c.3.4.1 1-.3 1.3-.2.1-.3.2-.5.2z"/><path opacity=".65" d="M17 26H9c-.6 0-1-.4-1-1s.4-1 1-1h8c.6 0 1 .4 1 1s-.4 1-1 1z"/><path opacity=".3" d="M41 26h-8c-.6 0-1-.4-1-1s.4-1 1-1h8c.6 0 1 .4 1 1s-.4 1-1 1z"/><path opacity=".86" d="M18.1 21.9c-.2 0-.3 0-.5-.1l-6.9-4c-.4-.3-.6-.8-.3-1.3.3-.4.8-.6 1.3-.3l6.9 4c.4.3.6.8.3 1.3-.2.3-.5.4-.8.4z"/><path opacity=".3" d="M38.9 33.9c-.2 0-.3 0-.5-.1l-6.9-4c-.4-.3-.6-.8-.3-1.3.3-.4.8-.6 1.3-.3l6.9 4c.4.3.6.8.3 1.3-.2.3-.5.4-.8.4z"/><path opacity=".44" d="M11.1 33.9c-.3 0-.6-.2-.8-.5-.3-.4-.1-1 .3-1.3l6.9-4c.4-.3 1-.1 1.3.3.3.4.1 1-.3 1.3l-6.9 4c-.1.2-.3.2-.5.2z"/><path opacity=".3" d="M31.9 21.9c-.3 0-.6-.2-.8-.5-.3-.4-.1-1 .3-1.3l6.9-4c.4-.3 1-.1 1.3.3.3.4.1 1-.3 1.3l-6.9 4c-.2.2-.3.2-.5.2z"/></svg>'},function(e,t,n){"use strict";function r(e,t){var n=e.meta,r=e.user,i=e.reactions,o=document.createElement("div");o.lang="en-US",o.className="gitment-container gitment-header-container";var a=document.createElement("span"),s=i.find(function(e){return"heart"===e.content&&e.user.login===r.login});a.className="gitment-header-like-btn",a.innerHTML="\n "+c.heart+"\n "+(s?"Unlike":"Like")+"\n "+(n.reactions&&n.reactions.heart?" • <strong>"+n.reactions.heart+"</strong> Liked":"")+"\n ",s?(a.classList.add("liked"),a.onclick=function(){return t.unlike()}):(a.classList.remove("liked"),a.onclick=function(){return t.like()}),o.appendChild(a);var u=document.createElement("span");u.innerHTML="\n "+(n.comments?" • <strong>"+n.comments+"</strong> Comments":"")+"\n ",o.appendChild(u);var l=document.createElement("a");return l.className="gitment-header-issue-link",l.href=n.html_url,l.target="_blank",l.innerText="Issue Page",o.appendChild(l),o}function i(e,t){var n=e.meta,r=e.comments,i=e.commentReactions,o=e.currentPage,a=e.user,s=e.error,u=document.createElement("div");if(u.lang="en-US",u.className="gitment-container gitment-comments-container",s){var d=document.createElement("div");if(d.className="gitment-comments-error",s===l.NOT_INITIALIZED_ERROR&&a.login&&a.login.toLowerCase()===t.owner.toLowerCase()){var p=document.createElement("div"),h=document.createElement("button");h.className="gitment-comments-init-btn",h.onclick=function(){h.setAttribute("disabled",!0),t.init().catch(function(e){h.removeAttribute("disabled"),alert(e)})},h.innerText="Initialize Comments",p.appendChild(h),d.appendChild(p)}else d.innerText=s;return u.appendChild(d),u}if(void 0===r){var f=document.createElement("div");return f.innerText="Loading comments...",f.className="gitment-comments-loading",u.appendChild(f),u}if(!r.length){var m=document.createElement("div");return m.className="gitment-comments-empty",m.innerText="No Comment Yet",u.appendChild(m),u}var v=document.createElement("ul");if(v.className="gitment-comments-list",r.forEach(function(e){var n=new Date(e.created_at),r=new Date(e.updated_at),o=document.createElement("li");o.className="gitment-comment",o.innerHTML='\n <a class="gitment-comment-avatar" href="'+e.user.html_url+'" target="_blank">\n <img class="gitment-comment-avatar-img" src="'+e.user.avatar_url+'"/>\n </a>\n <div class="gitment-comment-main">\n <div class="gitment-comment-header">\n <a class="gitment-comment-name" href="'+e.user.html_url+'" target="_blank">\n '+e.user.login+'\n </a>\n commented on\n <span title="'+n+'">'+n.toDateString()+"</span>\n "+(n.toString()!==r.toString()?' • <span title="comment was edited at '+r+'">edited</span>':"")+'\n <div class="gitment-comment-like-btn">'+c.heart+" "+(e.reactions.heart||"")+'</div>\n </div>\n <div class="gitment-comment-body gitment-markdown">'+e.body_html+"</div>\n </div>\n ";var s=o.querySelector(".gitment-comment-like-btn");i[e.id]&&i[e.id].find(function(e){return"heart"===e.content&&e.user.login===a.login})?(s.classList.add("liked"),s.onclick=function(){return t.unlikeAComment(e.id)}):(s.classList.remove("liked"),s.onclick=function(){return t.likeAComment(e.id)});var u=document.createElement("img"),l=o.querySelector(".gitment-comment-body");u.className="gitment-hidden",u.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",u.onload=function(){l.clientHeight>t.maxCommentHeight&&(l.classList.add("gitment-comment-body-folded"),l.style.maxHeight=t.maxCommentHeight+"px",l.title="Click to Expand",l.onclick=function(){l.classList.remove("gitment-comment-body-folded"),l.style.maxHeight="",l.title="",l.onclick=null})},o.appendChild(u),v.appendChild(o)}),u.appendChild(v),n){var g=Math.ceil(n.comments/t.perPage);if(g>1){var b=document.createElement("ul");if(b.className="gitment-comments-pagination",o>1){var y=document.createElement("li");y.className="gitment-comments-page-item",y.innerText="Previous",y.onclick=function(){return t.goto(o-1)},b.appendChild(y)}for(var w=1;w<=g;w++)!function(e){var n=document.createElement("li");n.className="gitment-comments-page-item",n.innerText=e,n.onclick=function(){return t.goto(e)},o===e&&n.classList.add("gitment-selected"),b.appendChild(n)}(w);if(o<g){var _=document.createElement("li");_.className="gitment-comments-page-item",_.innerText="Next",_.onclick=function(){return t.goto(o+1)},b.appendChild(_)}u.appendChild(b)}}return u}function o(e,t){var n=e.user,r=e.error,i=document.createElement("div");i.lang="en-US",i.className="gitment-container gitment-editor-container";var o=n.login&&!r?"":"disabled",a=n.login?"":"Login to Comment";i.innerHTML="\n "+(n.login?'<a class="gitment-editor-avatar" href="'+n.html_url+'" target="_blank">\n <img class="gitment-editor-avatar-img" src="'+n.avatar_url+'"/>\n </a>':n.isLoggingIn?'<div class="gitment-editor-avatar">'+c.spinner+"</div>":'<a class="gitment-editor-avatar" href="'+t.loginLink+'" title="login with GitHub">\n '+c.github+"\n </a>")+'\n </a>\n <div class="gitment-editor-main">\n <div class="gitment-editor-header">\n <nav class="gitment-editor-tabs">\n <button class="gitment-editor-tab gitment-selected">Write</button>\n <button class="gitment-editor-tab">Preview</button>\n </nav>\n <div class="gitment-editor-login">\n '+(n.login?'<a class="gitment-editor-logout-link">Logout</a>':n.isLoggingIn?"Logging in...":'<a class="gitment-editor-login-link" href="'+t.loginLink+'">Login</a> with GitHub')+'\n </div>\n </div>\n <div class="gitment-editor-body">\n <div class="gitment-editor-write-field">\n <textarea placeholder="Leave a comment" title="'+a+'" '+o+'></textarea>\n </div>\n <div class="gitment-editor-preview-field gitment-hidden">\n <div class="gitment-editor-preview gitment-markdown"></div>\n </div>\n </div>\n </div>\n <div class="gitment-editor-footer">\n <a class="gitment-editor-footer-tip" href="https://guides.github.com/features/mastering-markdown/" target="_blank">\n Styling with Markdown is supported\n </a>\n <button class="gitment-editor-submit" title="'+a+'" '+o+">Comment</button>\n </div>\n ",n.login&&(i.querySelector(".gitment-editor-logout-link").onclick=function(){return t.logout()});var s=i.querySelector(".gitment-editor-write-field"),l=i.querySelector(".gitment-editor-preview-field"),d=s.querySelector("textarea");d.oninput=function(){d.style.height="auto";var e=window.getComputedStyle(d,null),t=parseInt(e.height,10),n=d.clientHeight,r=d.scrollHeight;n<r&&(d.style.height=t+r-n+"px")};var p=i.querySelectorAll(".gitment-editor-tab"),h=u(p,2),f=h[0],m=h[1];f.onclick=function(){f.classList.add("gitment-selected"),m.classList.remove("gitment-selected"),s.classList.remove("gitment-hidden"),l.classList.add("gitment-hidden"),d.focus()},m.onclick=function(){m.classList.add("gitment-selected"),f.classList.remove("gitment-selected"),l.classList.remove("gitment-hidden"),s.classList.add("gitment-hidden");var e=l.querySelector(".gitment-editor-preview"),n=d.value.trim();if(!n)return void(e.innerText="Nothing to preview");e.innerText="Loading preview...",t.markdown(n).then(function(t){return e.innerHTML=t})};var v=i.querySelector(".gitment-editor-submit");return v.onclick=function(){v.innerText="Submitting...",v.setAttribute("disabled",!0),t.post(d.value.trim()).then(function(e){d.value="",d.style.height="auto",v.removeAttribute("disabled"),v.innerText="Comment"}).catch(function(e){alert(e),v.removeAttribute("disabled"),v.innerText="Comment"})},i}function a(){var e=document.createElement("div");return e.lang="en-US",e.className="gitment-container gitment-footer-container",e.innerHTML='\n Powered by\n <a class="gitment-footer-project-link" href="https://github.com/imsun/gitment" target="_blank">\n Gitment\n </a>\n ',e}function s(e,t){var n=document.createElement("div");return n.lang="en-US",n.className="gitment-container gitment-root-container",n.appendChild(t.renderHeader(e,t)),n.appendChild(t.renderComments(e,t)),n.appendChild(t.renderEditor(e,t)),n.appendChild(t.renderFooter(e,t)),n}Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),c=n(5),l=n(0);t.default={render:s,renderHeader:r,renderComments:i,renderEditor:o,renderFooter:a}},function(e,t,n){"use strict";function r(e){return e instanceof Element?e:s(e)?document.getElementById(e):document.createElement("div")}function i(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"https://api.github.com",i=new XMLHttpRequest,o=localStorage.getItem(a.LS_ACCESS_TOKEN_KEY),s=""+r+t,c=null;"GET"!==e&&"DELETE"!==e||(s+=u.stringify(n));var l=new Promise(function(e,t){i.addEventListener("load",function(){var n=i.getResponseHeader("content-type"),r=i.responseText;if(!/json/.test(n))return void e(r);var o=i.responseText?JSON.parse(r):{};o.message?t(new Error(o.message)):e(o)}),i.addEventListener("error",function(e){return t(e)})});return i.open(e,s,!0),i.setRequestHeader("Accept","application/vnd.github.squirrel-girl-preview, application/vnd.github.html+json"),o&&i.setRequestHeader("Authorization","token "+o),"GET"!==e&&"DELETE"!==e&&(c=JSON.stringify(n),i.setRequestHeader("Content-Type","application/json")),i.send(c),l}}Object.defineProperty(t,"__esModule",{value:!0}),t.http=t.Query=t.isString=void 0;var o=function(){function e(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}return function(t,n){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}();t.getTargetContainer=r;var a=n(0),s=t.isString=function(e){return"[object String]"===toString.call(e)},u=t.Query={parse:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window.location.search;if(!e)return{};var t="?"===e[0]?e.substring(1):e,n={};return t.split("&").forEach(function(e){var t=e.split("="),r=o(t,2),i=r[0],a=r[1];i&&(n[i]=a)}),n},stringify:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"?",n=Object.keys(e).map(function(t){return t+"="+encodeURIComponent(e[t]||"")}).join("&");return n?t+n:""}};t.http={get:i("GET"),post:i("POST"),delete:i("DELETE"),put:i("PUT")}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){function r(e,t){function n(){this.constructor=e}Wt(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function i(e){return e.interceptors&&e.interceptors.length>0}function o(e,t){var n=e.interceptors||(e.interceptors=[]);return n.push(t),ke(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function a(e,t){var n=ht();try{var r=e.interceptors;if(r)for(var i=0,o=r.length;i<o&&(t=r[i](t),Se(!t||t.type,"Intercept handlers should return nothing or a change object"),t);i++);return t}finally{ft(n)}}function s(e){return e.changeListeners&&e.changeListeners.length>0}function u(e,t){var n=e.changeListeners||(e.changeListeners=[]);return n.push(t),ke(function(){var e=n.indexOf(t);-1!==e&&n.splice(e,1)})}function c(e,t){var n=ht(),r=e.changeListeners;if(r){r=r.slice();for(var i=0,o=r.length;i<o;i++)r[i](t);ft(n)}}function l(){return!!Dn.spyListeners.length}function d(e){if(Dn.spyListeners.length)for(var t=Dn.spyListeners,n=0,r=t.length;n<r;n++)t[n](e)}function p(e){d(je({},e,{spyReportStart:!0}))}function h(e){d(e?je({},e,Xt):Xt)}function f(e){return Dn.spyListeners.push(e),ke(function(){var t=Dn.spyListeners.indexOf(e);-1!==t&&Dn.spyListeners.splice(t,1)})}function m(){return"function"==typeof Symbol&&Symbol.iterator||"@@iterator"}function v(e){Se(!0!==e[Qt],"Illegal state: cannot recycle array as iterator"),Re(e,Qt,!0);var t=-1;return Re(e,"next",function(){return t++,{done:t>=this.length,value:t<this.length?this[t]:void 0}}),e}function g(e,t){Re(e,m(),t)}function b(e){return{enumerable:!1,configurable:!1,get:function(){return this.get(e)},set:function(t){this.set(e,t)}}}function y(e){Object.defineProperty(rn.prototype,""+e,b(e))}function w(e){for(var t=en;t<e;t++)y(t);en=e}function _(e){return Te(e)&&an(e.$mobx)}function x(e){return ln[e]}function S(e,t){Se("function"==typeof t,x("m026")),Se("string"==typeof e&&e.length>0,"actions should have valid names, got: '"+e+"'");var n=function(){return O(e,t,this,arguments)};return n.originalFn=t,n.isMobxAction=!0,n}function O(e,t,n,r){var i=k(e,t,n,r);try{return t.apply(n,r)}finally{A(i)}}function k(e,t,n,r){var i=l()&&!!e,o=0;if(i){o=Date.now();var a=r&&r.length||0,s=new Array(a);if(a>0)for(var u=0;u<a;u++)s[u]=r[u];p({type:"action",name:e,fn:t,object:n,arguments:s})}var c=ht();return Ze(),{prevDerivation:c,prevAllowStateChanges:j(!0),notifySpy:i,startTime:o}}function A(e){C(e.prevAllowStateChanges),et(),ft(e.prevDerivation),e.notifySpy&&h({time:Date.now()-e.startTime})}function E(e){Se(null===Dn.trackingDerivation,x("m028")),Dn.strictMode=e,Dn.allowStateChanges=!e}function T(){return Dn.strictMode}function I(e,t){var n,r=j(e);try{n=t()}finally{C(r)}return n}function j(e){var t=Dn.allowStateChanges;return Dn.allowStateChanges=e,t}function C(e){Dn.allowStateChanges=e}function L(e,t,n,r,i){function o(o,a,s,u,c){if(void 0===c&&(c=0),Se(i||M(arguments),"This function is a decorator, but it wasn't invoked like a decorator"),s){Ce(o,"__mobxLazyInitializers")||Le(o,"__mobxLazyInitializers",o.__mobxLazyInitializers&&o.__mobxLazyInitializers.slice()||[]);var l=s.value,d=s.initializer;return o.__mobxLazyInitializers.push(function(t){e(t,a,d?d.call(t):l,u,s)}),{enumerable:r,configurable:!0,get:function(){return!0!==this.__mobxDidRunLazyInitializers&&P(this),t.call(this,a)},set:function(e){!0!==this.__mobxDidRunLazyInitializers&&P(this),n.call(this,a,e)}}}var p={enumerable:r,configurable:!0,get:function(){return this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]||R(this,a,void 0,e,u,s),t.call(this,a)},set:function(t){this.__mobxInitializedProps&&!0===this.__mobxInitializedProps[a]?n.call(this,a,t):R(this,a,t,e,u,s)}};return(arguments.length<3||5===arguments.length&&c<3)&&Object.defineProperty(o,a,p),p}return i?function(){if(M(arguments))return o.apply(null,arguments);var e=arguments,t=arguments.length;return function(n,r,i){return o(n,r,i,e,t)}}:o}function R(e,t,n,r,i,o){Ce(e,"__mobxInitializedProps")||Le(e,"__mobxInitializedProps",{}),e.__mobxInitializedProps[t]=!0,r(e,t,n,i,o)}function P(e){!0!==e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers&&(Le(e,"__mobxDidRunLazyInitializers",!0),e.__mobxDidRunLazyInitializers&&e.__mobxLazyInitializers.forEach(function(t){return t(e)}))}function M(e){return(2===e.length||3===e.length)&&"string"==typeof e[1]}function V(e){return function(t,n,r){if(r&&"function"==typeof r.value)return r.value=S(e,r.value),r.enumerable=!1,r.configurable=!0,r;if(void 0!==r&&void 0!==r.get)throw new Error("[mobx] action is not expected to be used with getters");return dn(e).apply(this,arguments)}}function D(e,t,n){var r="string"==typeof e?e:e.name||"<unnamed action>",i="function"==typeof e?e:t,o="function"==typeof e?t:n;return Se("function"==typeof i,x("m002")),Se(0===i.length,x("m003")),Se("string"==typeof r&&r.length>0,"actions should have valid names, got: '"+r+"'"),O(r,i,o,void 0)}function N(e){return"function"==typeof e&&!0===e.isMobxAction}function z(e,t,n){var r=function(){return O(t,n,e,arguments)};r.isMobxAction=!0,Le(e,t,r)}function U(e,t){return e===t}function $(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||De(e,t)}function B(e,t){return!("number"!=typeof e||"number"!=typeof t||!isNaN(e)||!isNaN(t))||U(e,t)}function H(e,t,n){function r(){o(s)}var i,o,a;"string"==typeof e?(i=e,o=t,a=n):(i=e.name||"Autorun@"+_e(),o=e,a=t),Se("function"==typeof o,x("m004")),Se(!1===N(o),x("m005")),a&&(o=o.bind(a));var s=new Kn(i,function(){this.track(r)});return s.schedule(),s.getDisposer()}function K(e,t,n,r){var i,o,a,s;return"string"==typeof e?(i=e,o=t,a=n,s=r):(i="When@"+_e(),o=e,a=t,s=n),H(i,function(e){if(o.call(s)){e.dispose();var t=ht();a.call(s),ft(t)}})}function G(e,t,n,r){function i(){a(l)}var o,a,s,u;"string"==typeof e?(o=e,a=t,s=n,u=r):(o=e.name||"AutorunAsync@"+_e(),a=e,s=t,u=n),Se(!1===N(a),x("m006")),void 0===s&&(s=1),u&&(a=a.bind(u));var c=!1,l=new Kn(o,function(){c||(c=!0,setTimeout(function(){c=!1,l.isDisposed||l.track(i)},s))});return l.schedule(),l.getDisposer()}function q(e,t,n){function r(){if(!c.isDisposed){var n=!1;c.track(function(){var t=e(c);n=a||!u(o,t),o=t}),a&&i.fireImmediately&&t(o,c),a||!0!==n||t(o,c),a&&(a=!1)}}arguments.length>3&&xe(x("m007")),le(e)&&xe(x("m008"));var i;i="object"==typeof n?n:{},i.name=i.name||e.name||t.name||"Reaction@"+_e(),i.fireImmediately=!0===n||!0===i.fireImmediately,i.delay=i.delay||0,i.compareStructural=i.compareStructural||i.struct||!1,t=hn(i.name,i.context?t.bind(i.context):t),i.context&&(e=e.bind(i.context));var o,a=!0,s=!1,u=i.equals?i.equals:i.compareStructural||i.struct?fn.structural:fn.default,c=new Kn(i.name,function(){a||i.delay<1?r():s||(s=!0,setTimeout(function(){s=!1,r()},i.delay))});return c.schedule(),c.getDisposer()}function W(e,t){if(ne(e)&&e.hasOwnProperty("$mobx"))return e.$mobx;Se(Object.isExtensible(e),x("m035")),Ie(e)||(t=(e.constructor.name||"ObservableObject")+"@"+_e()),t||(t="ObservableObject@"+_e());var n=new gn(e,t);return Re(e,"$mobx",n),n}function Y(e,t,n,r){if(e.values[t]&&!vn(e.values[t]))return Se("value"in n,"The property "+t+" in "+e.name+" is already observable, cannot redefine it as computed property"),void(e.target[t]=n.value);if("value"in n)if(le(n.value)){var i=n.value;J(e,t,i.initialValue,i.enhancer)}else N(n.value)&&!0===n.value.autoBind?z(e.target,t,n.value.originalFn):vn(n.value)?X(e,t,n.value):J(e,t,n.value,r);else F(e,t,n.get,n.set,fn.default,!0)}function J(e,t,n,r){if(Me(e.target,t),i(e)){var o=a(e,{object:e.target,name:t,type:"add",newValue:n});if(!o)return;n=o.newValue}n=(e.values[t]=new un(n,r,e.name+"."+t,!1)).value,Object.defineProperty(e.target,t,Q(t)),te(e,e.target,t,n)}function F(e,t,n,r,i,o){o&&Me(e.target,t),e.values[t]=new mn(n,e.target,i,e.name+"."+t,r),o&&Object.defineProperty(e.target,t,Z(t))}function X(e,t,n){var r=e.name+"."+t;n.name=r,n.scope||(n.scope=e.target),e.values[t]=n,Object.defineProperty(e.target,t,Z(t))}function Q(e){return bn[e]||(bn[e]={configurable:!0,enumerable:!0,get:function(){return this.$mobx.values[e].get()},set:function(t){ee(this,e,t)}})}function Z(e){return yn[e]||(yn[e]={configurable:!0,enumerable:!1,get:function(){return this.$mobx.values[e].get()},set:function(t){return this.$mobx.values[e].set(t)}})}function ee(e,t,n){var r=e.$mobx,o=r.values[t];if(i(r)){var u=a(r,{type:"update",object:e,name:t,newValue:n});if(!u)return;n=u.newValue}if((n=o.prepareNewValue(n))!==sn){var d=s(r),f=l(),u=d||f?{type:"update",object:e,oldValue:o.value,name:t,newValue:n}:null;f&&p(u),o.setNewValue(n),d&&c(r,u),f&&h()}}function te(e,t,n,r){var i=s(e),o=l(),a=i||o?{type:"add",object:t,name:n,newValue:r}:null;o&&p(a),i&&c(e,a),o&&h()}function ne(e){return!!Te(e)&&(P(e),wn(e.$mobx))}function re(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(_(e)||jn(e))throw new Error(x("m019"));if(ne(e)){var n=e.$mobx;return n.values&&!!n.values[t]}return!1}return ne(e)||!!e.$mobx||Ft(e)||Wn(e)||vn(e)}function ie(e){return Se(!!e,":("),L(function(t,n,r,i,o){Me(t,n),Se(!o||!o.get,x("m022")),J(W(t,void 0),n,r,e)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){ee(this,e,t)},!0,!1)}function oe(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return se(e,pe,t)}function ae(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return se(e,fe,t)}function se(e,t,n){Se(arguments.length>=2,x("m014")),Se("object"==typeof e,x("m015")),Se(!jn(e),x("m016")),n.forEach(function(e){Se("object"==typeof e,x("m017")),Se(!re(e),x("m018"))});for(var r=W(e),i={},o=n.length-1;o>=0;o--){var a=n[o];for(var s in a)if(!0!==i[s]&&Ce(a,s)){if(i[s]=!0,e===a&&!Pe(e,s))continue;var u=Object.getOwnPropertyDescriptor(a,s);Y(r,s,u,t)}}return e}function ue(e){if(void 0===e&&(e=void 0),"string"==typeof arguments[1])return _n.apply(null,arguments);if(Se(arguments.length<=1,x("m021")),Se(!le(e),x("m020")),re(e))return e;var t=pe(e,void 0,void 0);return t!==e?t:En.box(e)}function ce(e){xe("Expected one or two arguments to observable."+e+". Did you accidentally try to use observable."+e+" as decorator?")}function le(e){return"object"==typeof e&&null!==e&&!0===e.isMobxModifierDescriptor}function de(e,t){return Se(!le(t),"Modifiers cannot be nested"),{isMobxModifierDescriptor:!0,initialValue:t,enhancer:e}}function pe(e,t,n){return le(e)&&xe("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),re(e)?e:Array.isArray(e)?En.array(e,n):Ie(e)?En.object(e,n):$e(e)?En.map(e,n):e}function he(e,t,n){return le(e)&&xe("You tried to assign a modifier wrapped value to a collection, please define modifiers when creating the collection, not when modifying it"),void 0===e||null===e?e:ne(e)||_(e)||jn(e)?e:Array.isArray(e)?En.shallowArray(e,n):Ie(e)?En.shallowObject(e,n):$e(e)?En.shallowMap(e,n):xe("The shallow modifier / decorator can only used in combination with arrays, objects and maps")}function fe(e){return e}function me(e,t,n){if(De(e,t))return t;if(re(e))return e;if(Array.isArray(e))return new rn(e,me,n);if($e(e))return new In(e,me,n);if(Ie(e)){var r={};return W(r,n),se(r,me,[e]),r}return e}function ve(e,t,n){return De(e,t)?t:e}function ge(e,t){return void 0===t&&(t=void 0),be.apply(void 0,arguments)}function be(e,t){return void 0===t&&(t=void 0),O("",e)}function ye(e){return Oe("`mobx.map` is deprecated, use `new ObservableMap` or `mobx.observable.map` instead"),En.map(e)}function we(){return"undefined"!=typeof window?window:e}function _e(){return++Dn.mobxGuid}function xe(e,t){throw Se(!1,e,t),"X"}function Se(e,t,n){if(!e)throw new Error("[mobx] Invariant failed: "+t+(n?" in '"+n+"'":""))}function Oe(e){return-1===Ln.indexOf(e)&&(Ln.push(e),console.error("[mobx] Deprecated: "+e),!0)}function ke(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}}function Ae(e){var t=[];return e.forEach(function(e){-1===t.indexOf(e)&&t.push(e)}),t}function Ee(e,t,n){return void 0===t&&(t=100),void 0===n&&(n=" - "),e?e.slice(0,t).join(n)+(e.length>t?" (... and "+(e.length-t)+"more)":""):""}function Te(e){return null!==e&&"object"==typeof e}function Ie(e){if(null===e||"object"!=typeof e)return!1;var t=Object.getPrototypeOf(e);return t===Object.prototype||null===t}function je(){for(var e=arguments[0],t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var i in r)Ce(r,i)&&(e[i]=r[i])}return e}function Ce(e,t){return Pn.call(e,t)}function Le(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!0,configurable:!0,value:n})}function Re(e,t,n){Object.defineProperty(e,t,{enumerable:!1,writable:!1,configurable:!0,value:n})}function Pe(e,t){var n=Object.getOwnPropertyDescriptor(e,t);return!n||!1!==n.configurable&&!1!==n.writable}function Me(e,t){Se(Pe(e,t),"Cannot make property '"+t+"' observable, it is not configurable and writable in the target object")}function Ve(e){var t=[];for(var n in e)t.push(n);return t}function De(e,t){if(null===e&&null===t)return!0;if(void 0===e&&void 0===t)return!0;if("object"!=typeof e)return e===t;var n=ze(e),r=Ue(e);if(n!==ze(t))return!1;if(r!==Ue(t))return!1;if(n){if(e.length!==t.length)return!1;for(var i=e.length-1;i>=0;i--)if(!De(e[i],t[i]))return!1;return!0}if(r){if(e.size!==t.size)return!1;var o=!0;return e.forEach(function(e,n){o=o&&De(t.get(n),e)}),o}if("object"==typeof e&&"object"==typeof t){if(null===e||null===t)return!1;if(Ue(e)&&Ue(t))return e.size===t.size&&De(En.shallowMap(e).entries(),En.shallowMap(t).entries());if(Ve(e).length!==Ve(t).length)return!1;for(var a in e){if(!(a in t))return!1;if(!De(e[a],t[a]))return!1}return!0}return!1}function Ne(e,t){var n="isMobX"+e;return t.prototype[n]=!0,function(e){return Te(e)&&!0===e[n]}}function ze(e){return Array.isArray(e)||_(e)}function Ue(e){return $e(e)||jn(e)}function $e(e){return void 0!==we().Map&&e instanceof we().Map}function Be(){return"function"==typeof Symbol&&Symbol.toPrimitive||"@@toPrimitive"}function He(e){return null===e?null:"object"==typeof e?""+e:e}function Ke(){zn=!0,we().__mobxInstanceCount--}function Ge(){Oe("Using `shareGlobalState` is not recommended, use peer dependencies instead. See https://github.com/mobxjs/mobx/issues/1082 for details."),Nn=!0;var e=we(),t=Dn;if(e.__mobservableTrackingStack||e.__mobservableViewStack)throw new Error("[mobx] An incompatible version of mobservable is already loaded.");if(e.__mobxGlobal&&e.__mobxGlobal.version!==t.version)throw new Error("[mobx] An incompatible version of mobx is already loaded.");e.__mobxGlobal?Dn=e.__mobxGlobal:e.__mobxGlobal=t}function qe(){return Dn}function We(){Dn.resetId++;var e=new Vn;for(var t in e)-1===Mn.indexOf(t)&&(Dn[t]=e[t]);Dn.allowStateChanges=!Dn.strictMode}function Ye(e){return e.observers&&e.observers.length>0}function Je(e){return e.observers}function Fe(e,t){var n=e.observers.length;n&&(e.observersIndexes[t.__mapid]=n),e.observers[n]=t,e.lowestObserverState>t.dependenciesState&&(e.lowestObserverState=t.dependenciesState)}function Xe(e,t){if(1===e.observers.length)e.observers.length=0,Qe(e);else{var n=e.observers,r=e.observersIndexes,i=n.pop();if(i!==t){var o=r[t.__mapid]||0;o?r[i.__mapid]=o:delete r[i.__mapid],n[o]=i}delete r[t.__mapid]}}function Qe(e){e.isPendingUnobservation||(e.isPendingUnobservation=!0,Dn.pendingUnobservations.push(e))}function Ze(){Dn.inBatch++}function et(){if(0==--Dn.inBatch){bt();for(var e=Dn.pendingUnobservations,t=0;t<e.length;t++){var n=e[t];n.isPendingUnobservation=!1,0===n.observers.length&&n.onBecomeUnobserved()}Dn.pendingUnobservations=[]}}function tt(e){var t=Dn.trackingDerivation;null!==t?t.runId!==e.lastAccessedBy&&(e.lastAccessedBy=t.runId,t.newObserving[t.unboundDepsCount++]=e):0===e.observers.length&&Qe(e)}function nt(e){if(e.lowestObserverState!==Bn.STALE){e.lowestObserverState=Bn.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Bn.UP_TO_DATE&&r.onBecomeStale(),r.dependenciesState=Bn.STALE}}}function rt(e){if(e.lowestObserverState!==Bn.STALE){e.lowestObserverState=Bn.STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Bn.POSSIBLY_STALE?r.dependenciesState=Bn.STALE:r.dependenciesState===Bn.UP_TO_DATE&&(e.lowestObserverState=Bn.UP_TO_DATE)}}}function it(e){if(e.lowestObserverState===Bn.UP_TO_DATE){e.lowestObserverState=Bn.POSSIBLY_STALE;for(var t=e.observers,n=t.length;n--;){var r=t[n];r.dependenciesState===Bn.UP_TO_DATE&&(r.dependenciesState=Bn.POSSIBLY_STALE,r.onBecomeStale())}}}function ot(e){return e instanceof Hn}function at(e){switch(e.dependenciesState){case Bn.UP_TO_DATE:return!1;case Bn.NOT_TRACKING:case Bn.STALE:return!0;case Bn.POSSIBLY_STALE:for(var t=ht(),n=e.observing,r=n.length,i=0;i<r;i++){var o=n[i];if(vn(o)){try{o.get()}catch(e){return ft(t),!0}if(e.dependenciesState===Bn.STALE)return ft(t),!0}}return mt(e),ft(t),!1}}function st(){return null!==Dn.trackingDerivation}function ut(e){var t=e.observers.length>0;Dn.computationDepth>0&&t&&xe(x("m031")+e.name),!Dn.allowStateChanges&&t&&xe(x(Dn.strictMode?"m030a":"m030b")+e.name)}function ct(e,t,n){mt(e),e.newObserving=new Array(e.observing.length+100),e.unboundDepsCount=0,e.runId=++Dn.runId;var r=Dn.trackingDerivation;Dn.trackingDerivation=e;var i;try{i=t.call(n)}catch(e){i=new Hn(e)}return Dn.trackingDerivation=r,lt(e),i}function lt(e){for(var t=e.observing,n=e.observing=e.newObserving,r=Bn.UP_TO_DATE,i=0,o=e.unboundDepsCount,a=0;a<o;a++){var s=n[a];0===s.diffValue&&(s.diffValue=1,i!==a&&(n[i]=s),i++),s.dependenciesState>r&&(r=s.dependenciesState)}for(n.length=i,e.newObserving=null,o=t.length;o--;){var s=t[o];0===s.diffValue&&Xe(s,e),s.diffValue=0}for(;i--;){var s=n[i];1===s.diffValue&&(s.diffValue=0,Fe(s,e))}r!==Bn.UP_TO_DATE&&(e.dependenciesState=r,e.onBecomeStale())}function dt(e){var t=e.observing;e.observing=[];for(var n=t.length;n--;)Xe(t[n],e);e.dependenciesState=Bn.NOT_TRACKING}function pt(e){var t=ht(),n=e();return ft(t),n}function ht(){var e=Dn.trackingDerivation;return Dn.trackingDerivation=null,e}function ft(e){Dn.trackingDerivation=e}function mt(e){if(e.dependenciesState!==Bn.UP_TO_DATE){e.dependenciesState=Bn.UP_TO_DATE;for(var t=e.observing,n=t.length;n--;)t[n].lowestObserverState=Bn.UP_TO_DATE}}function vt(e){Se(this&&this.$mobx&&Wn(this.$mobx),"Invalid `this`"),Se(!this.$mobx.errorHandler,"Only one onErrorHandler can be registered"),this.$mobx.errorHandler=e}function gt(e){return Dn.globalReactionErrorHandlers.push(e),function(){var t=Dn.globalReactionErrorHandlers.indexOf(e);t>=0&&Dn.globalReactionErrorHandlers.splice(t,1)}}function bt(){Dn.inBatch>0||Dn.isRunningReactions||qn(yt)}function yt(){Dn.isRunningReactions=!0;for(var e=Dn.pendingReactions,t=0;e.length>0;){++t===Gn&&(console.error("Reaction doesn't converge to a stable state after "+Gn+" iterations. Probably there is a cycle in the reactive function: "+e[0]),e.splice(0));for(var n=e.splice(0),r=0,i=n.length;r<i;r++)n[r].runReaction()}Dn.isRunningReactions=!1}function wt(e){var t=qn;qn=function(n){return e(function(){return t(n)})}}function _t(e){return Oe("asReference is deprecated, use observable.ref instead"),En.ref(e)}function xt(e){return Oe("asStructure is deprecated. Use observable.struct, computed.struct or reaction options instead."),En.struct(e)}function St(e){return Oe("asFlat is deprecated, use observable.shallow instead"),En.shallow(e)}function Ot(e){return Oe("asMap is deprecated, use observable.map or observable.shallowMap instead"),En.map(e||{})}function kt(e){return L(function(t,n,r,i,o){Se(void 0!==o,x("m009")),Se("function"==typeof o.get,x("m010")),F(W(t,""),n,o.get,o.set,e,!1)},function(e){var t=this.$mobx.values[e];if(void 0!==t)return t.get()},function(e,t){this.$mobx.values[e].set(t)},!1,!1)}function At(e,t){if("object"==typeof e&&null!==e){if(_(e))return Se(void 0===t,x("m036")),e.$mobx.atom;if(jn(e)){var n=e;if(void 0===t)return At(n._keys);var r=n._data[t]||n._hasMap[t];return Se(!!r,"the entry '"+t+"' does not exist in the observable map '"+Tt(e)+"'"),r}if(P(e),t&&!e.$mobx&&e[t],ne(e)){if(!t)return xe("please specify a property");var r=e.$mobx.values[t];return Se(!!r,"no observable property '"+t+"' found on the observable object '"+Tt(e)+"'"),r}if(Ft(e)||vn(e)||Wn(e))return e}else if("function"==typeof e&&Wn(e.$mobx))return e.$mobx;return xe("Cannot obtain atom from "+e)}function Et(e,t){return Se(e,"Expecting some object"),void 0!==t?Et(At(e,t)):Ft(e)||vn(e)||Wn(e)?e:jn(e)?e:(P(e),e.$mobx?e.$mobx:void Se(!1,"Cannot obtain administration from "+e))}function Tt(e,t){var n;return n=void 0!==t?At(e,t):ne(e)||jn(e)?Et(e):At(e),n.name}function It(e,t){if(null===e||void 0===e)return!1;if(void 0!==t){if(!1===ne(e))return!1;var n=At(e,t);return vn(n)}return vn(e)}function jt(e,t,n,r){return"function"==typeof n?Lt(e,t,n,r):Ct(e,t,n)}function Ct(e,t,n){return Et(e).observe(t,n)}function Lt(e,t,n,r){return Et(e,t).observe(n,r)}function Rt(e,t,n){return"function"==typeof n?Mt(e,t,n):Pt(e,t)}function Pt(e,t){return Et(e).intercept(t)}function Mt(e,t,n){return Et(e,t).intercept(n)}function Vt(e,t){return st()||console.warn(x("m013")),Fn(e,{context:t}).get()}function Dt(e,t,n){function r(r){return t&&n.push([e,r]),r}if(void 0===t&&(t=!0),void 0===n&&(n=[]),re(e)){if(t&&null===n&&(n=[]),t&&null!==e&&"object"==typeof e)for(var i=0,o=n.length;i<o;i++)if(n[i][0]===e)return n[i][1];if(_(e)){var a=r([]),s=e.map(function(e){return Dt(e,t,n)});a.length=s.length;for(var i=0,o=s.length;i<o;i++)a[i]=s[i];return a}if(ne(e)){var a=r({});for(var u in e)a[u]=Dt(e[u],t,n);return a}if(jn(e)){var c=r({});return e.forEach(function(e,r){return c[r]=Dt(e,t,n)}),c}if(cn(e))return Dt(e.get(),t,n)}return e}function Nt(e,t){Se("function"==typeof e&&e.length<2,"createTransformer expects a function that accepts one argument");var n={},i=Dn.resetId,o=function(i){function o(t,n){var r=i.call(this,function(){return e(n)},void 0,fn.default,"Transformer-"+e.name+"-"+t,void 0)||this;return r.sourceIdentifier=t,r.sourceObject=n,r}return r(o,i),o.prototype.onBecomeUnobserved=function(){var e=this.value;i.prototype.onBecomeUnobserved.call(this),delete n[this.sourceIdentifier],t&&t(e,this.sourceObject)},o}(mn);return function(e){i!==Dn.resetId&&(n={},i=Dn.resetId);var t=zt(e),r=n[t];return r?r.get():(r=n[t]=new o(t,e),r.get())}}function zt(e){if("string"==typeof e||"number"==typeof e)return e;if(null===e||"object"!=typeof e)throw new Error("[mobx] transform expected some kind of object or primitive value, got: "+e);var t=e.$transformId;return void 0===t&&(t=_e(),Le(e,"$transformId",t)),t}function Ut(e){return console.log(e),e}function $t(e,t){switch(arguments.length){case 0:if(!(e=Dn.trackingDerivation))return Ut(x("m024"));break;case 2:e=At(e,t)}return e=At(e),vn(e)?Ut(e.whyRun()):Wn(e)?Ut(e.whyRun()):xe(x("m025"))}function Bt(e,t){return Ht(At(e,t))}function Ht(e){var t={name:e.name};return e.observing&&e.observing.length>0&&(t.dependencies=Ae(e.observing).map(Ht)),t}function Kt(e,t){return Gt(At(e,t))}function Gt(e){var t={name:e.name};return Ye(e)&&(t.observers=Je(e).map(Gt)),t}function qt(e,t,n){var r;if(jn(e)||_(e)||cn(e))r=Et(e);else{if(!ne(e))return xe("Expected observable map, object or array as first array");if("string"!=typeof t)return xe("InterceptReads can only be used with a specific property, not with an object in general");r=Et(e,t)}return void 0!==r.dehancer?xe("An intercept reader was already established"):(r.dehancer="function"==typeof t?t:n,function(){r.dehancer=void 0})}n.d(t,"extras",function(){return Xn}),n.d(t,"Reaction",function(){return Kn}),n.d(t,"untracked",function(){return pt}),n.d(t,"IDerivationState",function(){return Bn}),n.d(t,"Atom",function(){return Jt}),n.d(t,"BaseAtom",function(){return Yt}),n.d(t,"useStrict",function(){return E}),n.d(t,"isStrictModeEnabled",function(){return T}),n.d(t,"spy",function(){return f}),n.d(t,"comparer",function(){return fn}),n.d(t,"asReference",function(){return _t}),n.d(t,"asFlat",function(){return St}),n.d(t,"asStructure",function(){return xt}),n.d(t,"asMap",function(){return Ot}),n.d(t,"isModifierDescriptor",function(){return le}),n.d(t,"isObservableObject",function(){return ne}),n.d(t,"isBoxedObservable",function(){return cn}),n.d(t,"isObservableArray",function(){return _}),n.d(t,"ObservableMap",function(){return In}),n.d(t,"isObservableMap",function(){return jn}),n.d(t,"map",function(){return ye}),n.d(t,"transaction",function(){return ge}),n.d(t,"observable",function(){return En}),n.d(t,"IObservableFactories",function(){return An}),n.d(t,"computed",function(){return Fn}),n.d(t,"isObservable",function(){return re}),n.d(t,"isComputed",function(){return It}),n.d(t,"extendObservable",function(){return oe}),n.d(t,"extendShallowObservable",function(){return ae}),n.d(t,"observe",function(){return jt}),n.d(t,"intercept",function(){return Rt}),n.d(t,"autorun",function(){return H}),n.d(t,"autorunAsync",function(){return G}),n.d(t,"when",function(){return K}),n.d(t,"reaction",function(){return q}),n.d(t,"action",function(){return hn}),n.d(t,"isAction",function(){return N}),n.d(t,"runInAction",function(){return D}),n.d(t,"expr",function(){return Vt}),n.d(t,"toJS",function(){return Dt}),n.d(t,"createTransformer",function(){return Nt}),n.d(t,"whyRun",function(){return $t}),n.d(t,"isArrayLike",function(){return ze});/*! *****************************************************************************
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
this file except in compliance with the License. You may obtain a copy of the
License at http://www.apache.org/licenses/LICENSE-2.0
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
MERCHANTABLITY OR NON-INFRINGEMENT.
See the Apache Version 2.0 License for specific language governing permissions
and limitations under the License.
***************************************************************************** */
var Wt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},Yt=function(){function e(e){void 0===e&&(e="Atom@"+_e()),this.name=e,this.isPendingUnobservation=!0,this.observers=[],this.observersIndexes={},this.diffValue=0,this.lastAccessedBy=0,this.lowestObserverState=Bn.NOT_TRACKING}return e.prototype.onBecomeUnobserved=function(){},e.prototype.reportObserved=function(){tt(this)},e.prototype.reportChanged=function(){Ze(),nt(this),et()},e.prototype.toString=function(){return this.name},e}(),Jt=function(e){function t(t,n,r){void 0===t&&(t="Atom@"+_e()),void 0===n&&(n=Rn),void 0===r&&(r=Rn);var i=e.call(this,t)||this;return i.name=t,i.onBecomeObservedHandler=n,i.onBecomeUnobservedHandler=r,i.isPendingUnobservation=!1,i.isBeingTracked=!1,i}return r(t,e),t.prototype.reportObserved=function(){return Ze(),e.prototype.reportObserved.call(this),this.isBeingTracked||(this.isBeingTracked=!0,this.onBecomeObservedHandler()),et(),!!Dn.trackingDerivation},t.prototype.onBecomeUnobserved=function(){this.isBeingTracked=!1,this.onBecomeUnobservedHandler()},t}(Yt),Ft=Ne("Atom",Yt),Xt={spyReportEnd:!0},Qt="__$$iterating",Zt=function(){var e=!1,t={};return Object.defineProperty(t,"0",{set:function(){e=!0}}),Object.create(t)[0]=1,!1===e}(),en=0,tn=function(){function e(){}return e}();!function(e,t){void 0!==Object.setPrototypeOf?Object.setPrototypeOf(e.prototype,t):void 0!==e.prototype.__proto__?e.prototype.__proto__=t:e.prototype=t}(tn,Array.prototype),Object.isFrozen(Array)&&["constructor","push","shift","concat","pop","unshift","replace","find","findIndex","splice","reverse","sort"].forEach(function(e){Object.defineProperty(tn.prototype,e,{