var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}};$jscomp.arrayIterator=function(a){return{next:$jscomp.arrayIteratorImpl(a)}};$jscomp.makeIterator=function(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};
function parseHtml(a,b,c,f,n){n=void 0===n?!1:n;for(var h="",k,e=0;e<b;e++){var l=n?c:c[e];k=a;if(void 0===l)break;for(var g=0;g<=a.length;g++){var m=!1,q=!1,d="";"{"==a.charAt(g)?(m=!0,d="}"):"["==a.charAt(g)&&(q=m=!0,d="]");if(m)for(m=g;m;m++)if(a.charAt(m)==d){d="";for(var r=g;r<m+1;r++)d+=a.charAt(r);if(q)try{k=k.replace(d,window[d.substring(1,d.length-1)](l))}catch(t){}else k=k.replace(d,l[d.substring(1,d.length-1)]);break}}h+=k}""==h&&(h=f);return h}function getJSON(a){return $.getJSON(a)}
function getJSONCDS(a){return $.ajax(a,{xhrFields:{withCredentials:!0},crossDomain:!0})}function postJSONCDS(a,b){return $.ajax({type:"POST",url:a,xhrFields:{withCredentials:!0},crossDomain:!0,data:b,dataType:"json"})}function parseArrayArgs(a){var b=",";a=$jscomp.makeIterator(a);for(var c=a.next();!c.done;c=a.next())c=c.value,b="string"==typeof c?b+("'"+c+"',"):b+(c+",");return b.substring(0,b.length-1)}
function staticPageHelper(a,b,c,f,n,h,k,e,l){l=void 0===l?"":l;""!==b&&(b='<div class="text-center"><img src="'+(b+'" class="loading-rotate" width="250" height="250" /></div>'),$(c).html(b));getJSONCDS(a+"?limit="+h+"&page="+n+"&keyword="+k+l).done(function(g){$(c).html(parseHtml(f,h,g,e))})}
function multiPageHelper(a,b,c,f,n,h,k,e,l,g,m,q){q=void 0===q?"":q;""!==f&&(f='<div class="text-center"><img src="'+(f+'" class="loading-rotate" width="250" height="250" /></div>'),$(n).html(f));var d="";b&&b.constructor===Array&&(d=parseArrayArgs(b));$(h).html("");getJSONCDS(c+"?limit="+l+"&page="+e+"&keyword="+g+q).done(function(r){var t=!1,u="",p=r.pageCount,y=r.pageResults,w=e+1,v=e-1;var x=e+3;w>p&&(w=p);0==v&&(v=1);1<p&&(t=!0);if(t){5>p?(t=1,x=p):v==e-1?(t=e>=p-2?p-3:e-1,--x):t=e;u+='<button type="button" onclick="'+
a+"(1"+d+')" class="btn btn-danger">\u00ab</button>';u+='<button type="button" onclick="'+a+"("+v+d+')" class="btn btn-danger">\u2039</button>';for(i=t;i<=x;i++)i<=p&&(u+='<button type="button" onclick="'+a+"("+i+d+')" '+(i==e?'style="background-color:  #c82333;"':"")+'class="btn btn-danger">'+i+"</button>");u+='<button type="button" onclick="'+a+"("+w+d+')" class="btn btn-danger">\u203a</button>';u+='<button type="button" onclick="'+a+"("+p+d+')" class="btn btn-danger">\u00bb</button>'}$(n).html(parseHtml(k,
y,r,m));$(h).html(u)})}var Comments=function(a,b,c,f,n,h,k,e,l){this.assetid=a;this.commentsid=b;this.commentscontainer=c;this.buttonscontainer=f;this.successid=n;this.errorid=h;this.inputid=k;this.messageDelay=e;this.newObject=l;var g=this;getJSONCDS("https://api.alphaland.cc/game/info?id="+this.assetid).done(function(m){m.CommentsEnabled&&($(g.commentsid).show(),g.commentsPage())})};
Comments.prototype.commentsPage=function(a){multiPageHelper(this.newObject+".commentsPage",[],"https://api.alphaland.cc/comments/","https://api.alphaland.cc/logo",this.commentscontainer,this.buttonscontainer,'<div class="row mb-2"><div class="card w-100"><div class="card-body"><h6>Comment by <a class="red-a" href="/profile/view?id={userid}">{username}</a> : <a style="color:grey;">{date}</a></h6><div class="row marg-bot-15"><div class="col-sm-1"><a href="/profile/view?id={userid}"><img class="card-img-top marg-bot-15" src="{thumbnail}" style="width:4rem;border-radius:100%;"></a></div><div class="col-sm" style="overflow:hidden;"><p>{comment}</p></div></div></div></div></div>',
void 0===a?1:a,10,"","No comments","&assetId="+this.assetid)};Comments.prototype.submitComment=function(a){var b=this;postJSONCDS("https://api.alphaland.cc/comments/newcomment?assetId="+this.assetid,JSON.stringify({comment:a})).done(function(c){c=c.alert;var f=b.errorid;"Comment Placed"==c&&(f=b.successid,$(b.inputid).val(""),b.commentsPage());$(f).text(c);$(f).show();window.scrollTo({top:0,behavior:"smooth"});setTimeout(function(){$(f).hide()},b.messageDelay)})};