/*!
* DisqusJS | v1.2.5
* Author: SukkaW
* Link: https://github.com/SukkaW/DisqusJS
* License: MIT
*/"use strict";function _typeof(s){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(s){return typeof s}:function(s){return s&&"function"==typeof Symbol&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s})(s)}!function(s,e){"function"==typeof define&&define.amd?define("DisqusJS",[],e):"object"===("undefined"==typeof module?"undefined":_typeof(module))&&module.exports?module.exports=e():s.DisqusJS=e()}("undefined"!=typeof self?self:void 0,function(){return function(s){var l=document,y=function(s){return l.getElementById(s)},n=function(s,e,t){var n=new XMLHttpRequest;n.open("GET",encodeURI(s),!0),n.onload=function(){if(200<=n.status&&n.status<300||304===n.status){var s=JSON.parse(n.responseText);e(s)}else o()},n.timeout=4500,n.ontimeout=function(s){t(s)},n.onerror=function(s){t(s)},n.send()},b=function(s,e){try{localStorage.setItem(s,e)}catch(s){}},c=function(s){var e=function(s){return s<10?"0".concat(s):s};s=Date.parse(new Date(s));var t=(s=new Date(s+288e5)).getFullYear(),n=e(s.getMonth()+1),o=e(s.getDate()),a=e(s.getHours()),r=e(s.getMinutes());return"".concat(t,"-").concat(n,"-").concat(o," ").concat(a,":").concat(r)};function e(){if(window.DISQUS)window.DISQUS.reset({reload:!0,config:function(){this.page.identifier=D.config.identifier,this.page.url=D.config.url,this.page.title=D.config.title}});else{var s=l.createElement("script");y("disqus_thread").innerHTML='
评论完整模式加载中...如果长时间无法加载,请针对 disq.us | disquscdn.com | disqus.com 启用代理,或使用
评论基础模式',y("dsqjs-force-dsqjs").addEventListener("click",r),s.src="https://".concat(D.config.shortname,".disqus.com/embed.js"),s.setAttribute("data-timestamp",+new Date),(l.head||l.body).appendChild(s)}}function L(){y("disqus_thread").innerHTML='
';for(var s=["disqus.com","".concat(D.config.shortname,".disqus.com")],n=0,o=0,a=function(){s.length===n&&n===o?k():s.length===n&&r()},e=function(s){var e=new Image,t=setTimeout(function(){e.onerror=e.onload=null,n++,a()},3e3);e.onerror=function(){clearTimeout(t),n++,a()},e.onload=function(){clearTimeout(t),n++,o++,a()},e.src="https://".concat(s,"/favicon.ico?").concat(+new Date)},t=0;t
',y("dsqjs-msg").innerHTML='评论基础模式加载中。如需完整体验请针对 disq.us | disquscdn.com | disqus.com 启用代理并 | 。',y("dsqjs-reload-disqus").addEventListener("click",L),y("dsqjs-force-disqus").addEventListener("click",k),y("dsqjs-order-".concat(D.sortType)).setAttribute("checked","true");var s="".concat(D.config.api,"3.0/threads/list.json?forum=").concat(D.config.shortname,"&thread=ident:").concat(D.config.identifier,"&api_key=").concat(a());n(s,function(s){if(0===s.code&&1===s.response.length){var e=s.response[0];D.page={id:e.id,title:e.title,isClosed:e.isClosed,length:e.posts,comment:[]},y("dsqjs-comment-num").innerHTML=D.page.length,D.config.siteName&&(y("dsqjs-site-name").innerHTML=D.config.siteName),t()}else 0===s.code&&1!==s.response.length?(y("dsqjs-msg").innerHTML='该 Thread 并没有初始化,是否 进行初始化?',y("dsqjs-force-disqus").addEventListener("click",k)):o()},function(s){o()})}();var t=function m(s){var f=y("dsqjs-load-more"),q=l.getElementsByClassName("dsqjs-order-radio"),p=l.getElementsByClassName("dsqjs-has-more-btn"),g=function s(){var e=!0,t=!1,n=void 0;try{for(var o,a=q[Symbol.iterator]();!(e=(o=a.next()).done);e=!0)o.value.removeEventListener("change",h)}catch(s){t=!0,n=s}finally{try{e||null==a.return||a.return()}finally{if(t)throw n}}f.removeEventListener("click",s);var r=!0,i=!1,c=void 0;try{for(var d,l=p[Symbol.iterator]();!(r=(d=l.next()).done);r=!0)d.value.removeEventListener("click",L)}catch(s){i=!0,c=s}finally{try{r||null==l.return||l.return()}finally{if(i)throw c}}m(D.page.next)},u=function(){s?(f.classList.remove("dsqjs-disabled"),f.innerHTML="加载更多评论失败,点击重试",f.addEventListener("click",g)):o()},h=function s(e){D.sortType=e.target.getAttribute("value"),b("disqus.sort",D.sortType);var t=!0,n=!1,o=void 0;try{for(var a,r=q[Symbol.iterator]();!(t=(a=r.next()).done);t=!0)a.value.removeEventListener("change",s)}catch(s){n=!0,o=s}finally{try{t||null==r.return||r.return()}finally{if(n)throw o}}f.removeEventListener("click",g);var i=!0,c=!1,d=void 0;try{for(var l,u=p[Symbol.iterator]();!(i=(l=u.next()).done);i=!0)l.value.removeEventListener("click",L)}catch(s){c=!0,d=s}finally{try{i||null==u.return||u.return()}finally{if(c)throw d}}D.page.comment=[],D.page.next="",y("dsqjs-post-container").innerHTML='正在切换排序方式...
',f.classList.add("dsqjs-hide"),m()};s=s?"&cursor=".concat(s):"",f.classList.add("dsqjs-disabled");var v={parseDate:function(s){return Date.parse(new Date(s.createdAt))},parentAsc:function(s,e){return s.parent&&e.parent?v.parseDate(s)-v.parseDate(e):0}},e="".concat(D.config.api,"3.0/threads/listPostsThreaded?forum=").concat(D.config.shortname,"&thread=").concat(D.page.id).concat(s,"&api_key=").concat(a(),"&order=").concat(D.sortType);n(e,function(s){if(0===s.code&&0