/
main.min.js
11 lines (11 loc) · 44.4 KB
/
main.min.js
1
2
3
4
5
6
7
8
9
10
11
/**
* Typecho-Theme-Aria - 书写自己的篇章
*
* @author Siphils
* @email siphils16@gmail.com
* @version v1.8.4
* @link https://eriri.ink
* @license GNU General Public License v2.0
*
*/
!function(t,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.Headroom=e()}(this,function(){"use strict";function t(t){this.callback=t,this.ticking=!1}function o(t,e){var n;e=function t(e){if(arguments.length<=0)throw new Error("Missing arguments in extend function");var n,o,i,r=e||{};for(o=1;o<arguments.length;o++){var a=arguments[o]||{};for(n in a)"object"!=typeof r[n]||(i=r[n])&&"undefined"!=typeof window&&(i===window||i.nodeType)?r[n]=r[n]||a[n]:r[n]=t(r[n],a[n])}return r}(e,o.options),this.lastKnownScrollY=0,this.elem=t,this.tolerance=(n=e.tolerance)===Object(n)?n:{down:n,up:n},this.classes=e.classes,this.offset=e.offset,this.scroller=e.scroller,this.initialised=!1,this.onPin=e.onPin,this.onUnpin=e.onUnpin,this.onTop=e.onTop,this.onNotTop=e.onNotTop,this.onBottom=e.onBottom,this.onNotBottom=e.onNotBottom}var e={bind:!!function(){}.bind,classList:"classList"in document.documentElement,rAF:!!(window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame)};return window.requestAnimationFrame=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame,t.prototype={constructor:t,update:function(){this.callback&&this.callback(),this.ticking=!1},requestTick:function(){this.ticking||(requestAnimationFrame(this.rafCallback||(this.rafCallback=this.update.bind(this))),this.ticking=!0)},handleEvent:function(){this.requestTick()}},o.prototype={constructor:o,init:function(){if(o.cutsTheMustard)return this.debouncer=new t(this.update.bind(this)),this.elem.classList.add(this.classes.initial),setTimeout(this.attachEvent.bind(this),100),this},destroy:function(){var t=this.classes;for(var e in this.initialised=!1,t)t.hasOwnProperty(e)&&this.elem.classList.remove(t[e]);this.scroller.removeEventListener("scroll",this.debouncer,!1)},attachEvent:function(){this.initialised||(this.lastKnownScrollY=this.getScrollY(),this.initialised=!0,this.scroller.addEventListener("scroll",this.debouncer,!1),this.debouncer.handleEvent())},unpin:function(){var t=this.elem.classList,e=this.classes;!t.contains(e.pinned)&&t.contains(e.unpinned)||(t.add(e.unpinned),t.remove(e.pinned),this.onUnpin&&this.onUnpin.call(this))},pin:function(){var t=this.elem.classList,e=this.classes;t.contains(e.unpinned)&&(t.remove(e.unpinned),t.add(e.pinned),this.onPin&&this.onPin.call(this))},top:function(){var t=this.elem.classList,e=this.classes;t.contains(e.top)||(t.add(e.top),t.remove(e.notTop),this.onTop&&this.onTop.call(this))},notTop:function(){var t=this.elem.classList,e=this.classes;t.contains(e.notTop)||(t.add(e.notTop),t.remove(e.top),this.onNotTop&&this.onNotTop.call(this))},bottom:function(){var t=this.elem.classList,e=this.classes;t.contains(e.bottom)||(t.add(e.bottom),t.remove(e.notBottom),this.onBottom&&this.onBottom.call(this))},notBottom:function(){var t=this.elem.classList,e=this.classes;t.contains(e.notBottom)||(t.add(e.notBottom),t.remove(e.bottom),this.onNotBottom&&this.onNotBottom.call(this))},getScrollY:function(){return void 0!==this.scroller.pageYOffset?this.scroller.pageYOffset:void 0!==this.scroller.scrollTop?this.scroller.scrollTop:(document.documentElement||document.body.parentNode||document.body).scrollTop},getViewportHeight:function(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight},getElementPhysicalHeight:function(t){return Math.max(t.offsetHeight,t.clientHeight)},getScrollerPhysicalHeight:function(){return this.scroller===window||this.scroller===document.body?this.getViewportHeight():this.getElementPhysicalHeight(this.scroller)},getDocumentHeight:function(){var t=document.body,e=document.documentElement;return Math.max(t.scrollHeight,e.scrollHeight,t.offsetHeight,e.offsetHeight,t.clientHeight,e.clientHeight)},getElementHeight:function(t){return Math.max(t.scrollHeight,t.offsetHeight,t.clientHeight)},getScrollerHeight:function(){return this.scroller===window||this.scroller===document.body?this.getDocumentHeight():this.getElementHeight(this.scroller)},isOutOfBounds:function(t){var e=t<0,n=t+this.getScrollerPhysicalHeight()>this.getScrollerHeight();return e||n},toleranceExceeded:function(t,e){return Math.abs(t-this.lastKnownScrollY)>=this.tolerance[e]},shouldUnpin:function(t,e){var n=t>this.lastKnownScrollY,o=t>=this.offset;return n&&o&&e},shouldPin:function(t,e){var n=t<this.lastKnownScrollY,o=t<=this.offset;return n&&e||o},update:function(){var t=this.getScrollY(),e=t>this.lastKnownScrollY?"down":"up",n=this.toleranceExceeded(t,e);this.isOutOfBounds(t)||(t<=this.offset?this.top():this.notTop(),t+this.getViewportHeight()>=this.getScrollerHeight()?this.bottom():this.notBottom(),this.shouldUnpin(t,n)?this.unpin():this.shouldPin(t,n)&&this.pin(),this.lastKnownScrollY=t)}},o.options={tolerance:{up:0,down:0},offset:0,scroller:window,classes:{pinned:"headroom--pinned",unpinned:"headroom--unpinned",top:"headroom--top",notTop:"headroom--not-top",bottom:"headroom--bottom",notBottom:"headroom--not-bottom",initial:"headroom"}},o.cutsTheMustard=void 0!==e&&e.rAF&&e.bind&&e.classList,o});var hexcase=0,b64pad="";function hex_md5(t){return rstr2hex(rstr_md5(str2rstr_utf8(t)))}function b64_md5(t){return rstr2b64(rstr_md5(str2rstr_utf8(t)))}function any_md5(t,e){return rstr2any(rstr_md5(str2rstr_utf8(t)),e)}function hex_hmac_md5(t,e){return rstr2hex(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))}function b64_hmac_md5(t,e){return rstr2b64(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)))}function any_hmac_md5(t,e,n){return rstr2any(rstr_hmac_md5(str2rstr_utf8(t),str2rstr_utf8(e)),n)}function md5_vm_test(){return"900150983cd24fb0d6963f7d28e17f72"==hex_md5("abc").toLowerCase()}function rstr_md5(t){return binl2rstr(binl_md5(rstr2binl(t),8*t.length))}function rstr_hmac_md5(t,e){var n=rstr2binl(t);16<n.length&&(n=binl_md5(n,8*t.length));for(var o=Array(16),i=Array(16),r=0;r<16;r++)o[r]=909522486^n[r],i[r]=1549556828^n[r];var a=binl_md5(o.concat(rstr2binl(e)),512+8*e.length);return binl2rstr(binl_md5(i.concat(a),640))}function rstr2hex(t){for(var e,n=hexcase?"0123456789ABCDEF":"0123456789abcdef",o="",i=0;i<t.length;i++)e=t.charCodeAt(i),o+=n.charAt(e>>>4&15)+n.charAt(15&e);return o}function rstr2b64(t){for(var e="",n=t.length,o=0;o<n;o+=3)for(var i=t.charCodeAt(o)<<16|(o+1<n?t.charCodeAt(o+1)<<8:0)|(o+2<n?t.charCodeAt(o+2):0),r=0;r<4;r++)8*o+6*r>8*t.length?e+=b64pad:e+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(i>>>6*(3-r)&63);return e}function rstr2any(t,e){var n,o,i,r,a,s=e.length,c=Array(Math.ceil(t.length/2));for(n=0;n<c.length;n++)c[n]=t.charCodeAt(2*n)<<8|t.charCodeAt(2*n+1);var l=Math.ceil(8*t.length/(Math.log(e.length)/Math.log(2))),u=Array(l);for(o=0;o<l;o++){for(a=Array(),n=r=0;n<c.length;n++)r=(r<<16)+c[n],r-=(i=Math.floor(r/s))*s,(0<a.length||0<i)&&(a[a.length]=i);u[o]=r,c=a}var d="";for(n=u.length-1;0<=n;n--)d+=e.charAt(u[n]);return d}function str2rstr_utf8(t){for(var e,n,o="",i=-1;++i<t.length;)e=t.charCodeAt(i),n=i+1<t.length?t.charCodeAt(i+1):0,55296<=e&&e<=56319&&56320<=n&&n<=57343&&(e=65536+((1023&e)<<10)+(1023&n),i++),e<=127?o+=String.fromCharCode(e):e<=2047?o+=String.fromCharCode(192|e>>>6&31,128|63&e):e<=65535?o+=String.fromCharCode(224|e>>>12&15,128|e>>>6&63,128|63&e):e<=2097151&&(o+=String.fromCharCode(240|e>>>18&7,128|e>>>12&63,128|e>>>6&63,128|63&e));return o}function str2rstr_utf16le(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(255&t.charCodeAt(n),t.charCodeAt(n)>>>8&255);return e}function str2rstr_utf16be(t){for(var e="",n=0;n<t.length;n++)e+=String.fromCharCode(t.charCodeAt(n)>>>8&255,255&t.charCodeAt(n));return e}function rstr2binl(t){for(var e=Array(t.length>>2),n=0;n<e.length;n++)e[n]=0;for(n=0;n<8*t.length;n+=8)e[n>>5]|=(255&t.charCodeAt(n/8))<<n%32;return e}function binl2rstr(t){for(var e="",n=0;n<32*t.length;n+=8)e+=String.fromCharCode(t[n>>5]>>>n%32&255);return e}function binl_md5(t,e){t[e>>5]|=128<<e%32,t[14+(e+64>>>9<<4)]=e;for(var n=1732584193,o=-271733879,i=-1732584194,r=271733878,a=0;a<t.length;a+=16){var s=n,c=o,l=i,u=r;o=md5_ii(o=md5_ii(o=md5_ii(o=md5_ii(o=md5_hh(o=md5_hh(o=md5_hh(o=md5_hh(o=md5_gg(o=md5_gg(o=md5_gg(o=md5_gg(o=md5_ff(o=md5_ff(o=md5_ff(o=md5_ff(o,i=md5_ff(i,r=md5_ff(r,n=md5_ff(n,o,i,r,t[a+0],7,-680876936),o,i,t[a+1],12,-389564586),n,o,t[a+2],17,606105819),r,n,t[a+3],22,-1044525330),i=md5_ff(i,r=md5_ff(r,n=md5_ff(n,o,i,r,t[a+4],7,-176418897),o,i,t[a+5],12,1200080426),n,o,t[a+6],17,-1473231341),r,n,t[a+7],22,-45705983),i=md5_ff(i,r=md5_ff(r,n=md5_ff(n,o,i,r,t[a+8],7,1770035416),o,i,t[a+9],12,-1958414417),n,o,t[a+10],17,-42063),r,n,t[a+11],22,-1990404162),i=md5_ff(i,r=md5_ff(r,n=md5_ff(n,o,i,r,t[a+12],7,1804603682),o,i,t[a+13],12,-40341101),n,o,t[a+14],17,-1502002290),r,n,t[a+15],22,1236535329),i=md5_gg(i,r=md5_gg(r,n=md5_gg(n,o,i,r,t[a+1],5,-165796510),o,i,t[a+6],9,-1069501632),n,o,t[a+11],14,643717713),r,n,t[a+0],20,-373897302),i=md5_gg(i,r=md5_gg(r,n=md5_gg(n,o,i,r,t[a+5],5,-701558691),o,i,t[a+10],9,38016083),n,o,t[a+15],14,-660478335),r,n,t[a+4],20,-405537848),i=md5_gg(i,r=md5_gg(r,n=md5_gg(n,o,i,r,t[a+9],5,568446438),o,i,t[a+14],9,-1019803690),n,o,t[a+3],14,-187363961),r,n,t[a+8],20,1163531501),i=md5_gg(i,r=md5_gg(r,n=md5_gg(n,o,i,r,t[a+13],5,-1444681467),o,i,t[a+2],9,-51403784),n,o,t[a+7],14,1735328473),r,n,t[a+12],20,-1926607734),i=md5_hh(i,r=md5_hh(r,n=md5_hh(n,o,i,r,t[a+5],4,-378558),o,i,t[a+8],11,-2022574463),n,o,t[a+11],16,1839030562),r,n,t[a+14],23,-35309556),i=md5_hh(i,r=md5_hh(r,n=md5_hh(n,o,i,r,t[a+1],4,-1530992060),o,i,t[a+4],11,1272893353),n,o,t[a+7],16,-155497632),r,n,t[a+10],23,-1094730640),i=md5_hh(i,r=md5_hh(r,n=md5_hh(n,o,i,r,t[a+13],4,681279174),o,i,t[a+0],11,-358537222),n,o,t[a+3],16,-722521979),r,n,t[a+6],23,76029189),i=md5_hh(i,r=md5_hh(r,n=md5_hh(n,o,i,r,t[a+9],4,-640364487),o,i,t[a+12],11,-421815835),n,o,t[a+15],16,530742520),r,n,t[a+2],23,-995338651),i=md5_ii(i,r=md5_ii(r,n=md5_ii(n,o,i,r,t[a+0],6,-198630844),o,i,t[a+7],10,1126891415),n,o,t[a+14],15,-1416354905),r,n,t[a+5],21,-57434055),i=md5_ii(i,r=md5_ii(r,n=md5_ii(n,o,i,r,t[a+12],6,1700485571),o,i,t[a+3],10,-1894986606),n,o,t[a+10],15,-1051523),r,n,t[a+1],21,-2054922799),i=md5_ii(i,r=md5_ii(r,n=md5_ii(n,o,i,r,t[a+8],6,1873313359),o,i,t[a+15],10,-30611744),n,o,t[a+6],15,-1560198380),r,n,t[a+13],21,1309151649),i=md5_ii(i,r=md5_ii(r,n=md5_ii(n,o,i,r,t[a+4],6,-145523070),o,i,t[a+11],10,-1120210379),n,o,t[a+2],15,718787259),r,n,t[a+9],21,-343485551),n=safe_add(n,s),o=safe_add(o,c),i=safe_add(i,l),r=safe_add(r,u)}return Array(n,o,i,r)}function md5_cmn(t,e,n,o,i,r){return safe_add(bit_rol(safe_add(safe_add(e,t),safe_add(o,r)),i),n)}function md5_ff(t,e,n,o,i,r,a){return md5_cmn(e&n|~e&o,t,e,i,r,a)}function md5_gg(t,e,n,o,i,r,a){return md5_cmn(e&o|n&~o,t,e,i,r,a)}function md5_hh(t,e,n,o,i,r,a){return md5_cmn(e^n^o,t,e,i,r,a)}function md5_ii(t,e,n,o,i,r,a){return md5_cmn(n^(e|~o),t,e,i,r,a)}function safe_add(t,e){var n=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(n>>16)<<16|65535&n}function bit_rol(t,e){return t<<e|t>>>32-e}!function(){function n(t,e){var n=document.createElement("div");n.className="notyf";var o=document.createElement("div");o.className="notyf-wrapper";var i=document.createElement("div");i.className="notyf-icon";var r=document.createElement("i");r.className=e;var a=document.createElement("div");a.className="notyf-message",a.innerHTML=t,i.appendChild(r),o.appendChild(i),o.appendChild(a),n.appendChild(o);var s=this;return setTimeout(function(){n.className+=" disappear",n.addEventListener(s.animationEnd,function(t){t.target==n&&s.container.removeChild(n)});var t=s.notifications.indexOf(n);s.notifications.splice(t,1)},s.options.delay),n}this.Notyf=function(){this.notifications=[];var t={delay:2e3,alertIcon:"notyf-alert-icon",confirmIcon:"notyf-confirm-icon"};arguments[0]&&"object"==typeof arguments[0]?this.options=function(t,e){for(property in e)e.hasOwnProperty(property)&&(t[property]=e[property]);return t}(t,arguments[0]):this.options=t;var e=document.createDocumentFragment(),n=document.createElement("div");n.className="notyf-container",e.appendChild(n),document.body.appendChild(e),this.container=n,this.animationEnd=function(){var t,e=document.createElement("fake"),n={transition:"animationend",OTransition:"oAnimationEnd",MozTransition:"animationend",WebkitTransition:"webkitAnimationEnd"};for(t in n)if(void 0!==e.style[t])return n[t]}()},this.Notyf.prototype.alert=function(t){var e=n.call(this,t,this.options.alertIcon);e.className+=" alert",this.container.appendChild(e),this.notifications.push(e)},this.Notyf.prototype.confirm=function(t){var e=n.call(this,t,this.options.confirmIcon);e.className+=" confirm",this.container.appendChild(e),this.notifications.push(e)}}(),function(t,e){"function"==typeof define&&define.amd?define([],function(){return e(t)}):"object"==typeof exports?module.exports=e(t):t.SmoothScroll=e(t)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(C){"use strict";var x={ignore:"[data-scroll-ignore]",header:null,topOnEmptyHash:!0,speed:500,clip:!0,offset:0,easing:"easeInOutCubic",customEasing:null,updateURL:!0,popstate:!0,emitEvents:!0},S=function(){for(var n={},t=0;t<arguments.length;t++)!function(t){for(var e in t)t.hasOwnProperty(e)&&(n[e]=t[e])}(arguments[t]);return n},s=function(e){var n;try{n=decodeURIComponent(e)}catch(t){n=e}return n},c=function(t){"#"===t.charAt(0)&&(t=t.substr(1));for(var e,n=String(t),o=n.length,i=-1,r="",a=n.charCodeAt(0);++i<o;){if(0===(e=n.charCodeAt(i)))throw new InvalidCharacterError("Invalid character: the input contains U+0000.");r+=1<=e&&e<=31||127==e||0===i&&48<=e&&e<=57||1===i&&48<=e&&e<=57&&45===a?"\\"+e.toString(16)+" ":128<=e||45===e||95===e||48<=e&&e<=57||65<=e&&e<=90||97<=e&&e<=122?n.charAt(i):"\\"+n.charAt(i)}var s;try{s=decodeURIComponent("#"+r)}catch(t){s="#"+r}return s},T=function(){return Math.max(document.body.scrollHeight,document.documentElement.scrollHeight,document.body.offsetHeight,document.documentElement.offsetHeight,document.body.clientHeight,document.documentElement.clientHeight)},O=function(t){return t?(e=t,parseInt(C.getComputedStyle(e).height,10)+t.offsetTop):0;var e},$=function(t,e,n,o){if(e.emitEvents&&"function"==typeof C.CustomEvent){var i=new CustomEvent(t,{bubbles:!0,detail:{anchor:n,toggle:o}});document.dispatchEvent(i)}};return function(o,t){var y,i,b,_,e,E,w={cancelScroll:function(t){cancelAnimationFrame(E),E=null,t||$("scrollCancel",y)}};w.animateScroll=function(a,s,t){var e,n,c=S(y||x,t||{}),l="[object Number]"===Object.prototype.toString.call(a),o=l||!a.tagName?null:a;if(l||o){var u=C.pageYOffset;c.header&&!b&&(b=document.querySelector(c.header)),_||(_=O(b));var d,i,r,f=l?a:function(t,e,n,o){var i=0;if(t.offsetParent)for(;i+=t.offsetTop,t=t.offsetParent;);return i=Math.max(i-e-n,0),o&&(i=Math.min(i,T()-C.innerHeight)),i}(o,_,parseInt("function"==typeof c.offset?c.offset(a,s):c.offset,10),c.clip),h=f-u,m=T(),p=0,g=function(t,e){var n,o,i,r=C.pageYOffset;if(t==e||r==e||(u<e&&C.innerHeight+r)>=m)return w.cancelScroll(!0),o=e,i=l,0===(n=a)&&document.body.focus(),i||(n.focus(),document.activeElement!==n&&(n.setAttribute("tabindex","-1"),n.focus(),n.style.outline="none"),C.scrollTo(0,o)),$("scrollStop",c,a,s),!(E=d=null)},v=function(t){var e,n,o;d||(d=t),i=(p+=t-d)/parseInt(c.speed,10),r=u+h*(n=i=1<i?1:i,"easeInQuad"===(e=c).easing&&(o=n*n),"easeOutQuad"===e.easing&&(o=n*(2-n)),"easeInOutQuad"===e.easing&&(o=n<.5?2*n*n:(4-2*n)*n-1),"easeInCubic"===e.easing&&(o=n*n*n),"easeOutCubic"===e.easing&&(o=--n*n*n+1),"easeInOutCubic"===e.easing&&(o=n<.5?4*n*n*n:(n-1)*(2*n-2)*(2*n-2)+1),"easeInQuart"===e.easing&&(o=n*n*n*n),"easeOutQuart"===e.easing&&(o=1- --n*n*n*n),"easeInOutQuart"===e.easing&&(o=n<.5?8*n*n*n*n:1-8*--n*n*n*n),"easeInQuint"===e.easing&&(o=n*n*n*n*n),"easeOutQuint"===e.easing&&(o=1+--n*n*n*n*n),"easeInOutQuint"===e.easing&&(o=n<.5?16*n*n*n*n*n:1+16*--n*n*n*n*n),e.customEasing&&(o=e.customEasing(n)),o||n),C.scrollTo(0,Math.floor(r)),g(r,f)||(E=C.requestAnimationFrame(v),d=t)};0===C.pageYOffset&&C.scrollTo(0,0),e=a,n=c,l||history.pushState&&n.updateURL&&history.pushState({smoothScroll:JSON.stringify(n),anchor:e.id},document.title,e===document.documentElement?"#top":"#"+e.id),$("scrollStart",c,a,s),w.cancelScroll(!0),C.requestAnimationFrame(v)}};var n=function(t){if(!("matchMedia"in C&&C.matchMedia("(prefers-reduced-motion)").matches)&&0===t.button&&!t.metaKey&&!t.ctrlKey&&"closest"in t.target&&(i=t.target.closest(o))&&"a"===i.tagName.toLowerCase()&&!t.target.closest(y.ignore)&&i.hostname===C.location.hostname&&i.pathname===C.location.pathname&&/#/.test(i.href)){var e=c(s(i.hash)),n=y.topOnEmptyHash&&"#"===e?document.documentElement:document.querySelector(e);(n=n||"#top"!==e?n:document.documentElement)&&(t.preventDefault(),w.animateScroll(n,i))}},r=function(t){if(history.state.smoothScroll&&history.state.smoothScroll===JSON.stringify(y)&&history.state.anchor){var e=document.querySelector(c(s(history.state.anchor)));e&&w.animateScroll(e,null,{updateURL:!1})}},a=function(t){e||(e=setTimeout(function(){e=null,_=O(b)},66))};return w.destroy=function(){y&&(document.removeEventListener("click",n,!1),C.removeEventListener("resize",a,!1),C.removeEventListener("popstate",r,!1),w.cancelScroll(),E=e=_=b=i=y=null)},w.init=function(t){if(!("querySelector"in document&&"addEventListener"in C&&"requestAnimationFrame"in C&&"closest"in C.Element.prototype))throw"Smooth Scroll: This browser does not support the required JavaScript methods and browser APIs.";w.destroy(),y=S(x,t||{}),b=y.header?document.querySelector(y.header):null,_=O(b),document.addEventListener("click",n,!1),b&&C.addEventListener("resize",a,!1),y.updateURL&&y.popstate&&C.addEventListener("popstate",r,!1)},w.init(t),w}}),function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.NProgress=e()}(this,function(){function n(t,e,n){return t<e?e:n<t?n:t}function u(t){return 100*(-1+t)}function i(t,e){return 0<=("string"==typeof t?t:r(t)).indexOf(" "+e+" ")}function a(t,e){var n=r(t),o=n+e;i(n,e)||(t.className=o.substring(1))}function e(t,e){var n,o=r(t);i(t,e)&&(n=o.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function r(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function s(t){t&&t.parentNode&&t.parentNode.removeChild(t)}var o,c,d={version:"0.2.0"},f=d.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'<div class="bar" role="bar"><div class="peg"></div></div><div class="spinner" role="spinner"><div class="spinner-icon"></div></div>'};d.configure=function(t){var e,n;for(e in t)void 0!==(n=t[e])&&t.hasOwnProperty(e)&&(f[e]=n);return this},d.status=null,d.set=function(r){var t=d.isStarted();r=n(r,f.minimum,1),d.status=1===r?null:r;var a=d.render(!t),s=a.querySelector(f.barSelector),c=f.speed,l=f.easing;return a.offsetWidth,h(function(t){var e,n,o,i;""===f.positionUsing&&(f.positionUsing=d.getPositioningCSS()),m(s,(e=r,n=c,o=l,(i="translate3d"===f.positionUsing?{transform:"translate3d("+u(e)+"%,0,0)"}:"translate"===f.positionUsing?{transform:"translate("+u(e)+"%,0)"}:{"margin-left":u(e)+"%"}).transition="all "+n+"ms "+o,i)),1===r?(m(a,{transition:"none",opacity:1}),a.offsetWidth,setTimeout(function(){m(a,{transition:"all "+c+"ms linear",opacity:0}),setTimeout(function(){d.remove(),t()},c)},c)):setTimeout(t,c)}),this},d.isStarted=function(){return"number"==typeof d.status},d.start=function(){d.status||d.set(0);var t=function(){setTimeout(function(){d.status&&(d.trickle(),t())},f.trickleSpeed)};return f.trickle&&t(),this},d.done=function(t){return t||d.status?d.inc(.3+.5*Math.random()).set(1):this},d.inc=function(t){var e=d.status;return e?("number"!=typeof t&&(t=(1-e)*n(Math.random()*e,.1,.95)),e=n(e+t,0,.994),d.set(e)):d.start()},d.trickle=function(){return d.inc(Math.random()*f.trickleRate)},c=o=0,d.promise=function(t){return t&&"resolved"!==t.state()&&(0===c&&d.start(),o++,c++,t.always(function(){0==--c?(o=0,d.done()):d.set((o-c)/o)})),this},d.render=function(t){if(d.isRendered())return document.getElementById("nprogress");a(document.documentElement,"nprogress-busy");var e=document.createElement("div");e.id="nprogress",e.innerHTML=f.template;var n,o=e.querySelector(f.barSelector),i=t?"-100":u(d.status||0),r=document.querySelector(f.parent);return m(o,{transition:"all 0 linear",transform:"translate3d("+i+"%,0,0)"}),f.showSpinner||(n=e.querySelector(f.spinnerSelector))&&s(n),r!=document.body&&a(r,"nprogress-custom-parent"),r.appendChild(e),e},d.remove=function(){e(document.documentElement,"nprogress-busy"),e(document.querySelector(f.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&s(t)},d.isRendered=function(){return!!document.getElementById("nprogress")},d.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var h=function(){function e(){var t=n.shift();t&&t(e)}var n=[];return function(t){n.push(t),1==n.length&&e()}}(),m=function(){function o(t){return t=t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()}),e[t]||(e[t]=function(t){var e=document.body.style;if(t in e)return t;for(var n,o=a.length,i=t.charAt(0).toUpperCase()+t.slice(1);o--;)if((n=a[o]+i)in e)return n;return t}(t))}function r(t,e,n){e=o(e),t.style[e]=n}var a=["Webkit","O","Moz","ms"],e={};return function(t,e){var n,o,i=arguments;if(2==i.length)for(n in e)void 0!==(o=e[n])&&e.hasOwnProperty(n)&&r(t,n,o);else r(t,i[1],i[2])}}();return d}),function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.ClipboardJS=e():t.ClipboardJS=e()}(this,function(){return function(n){var o={};function i(t){if(o[t])return o[t].exports;var e=o[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}return i.m=n,i.c=o,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)i.d(n,o,function(t){return e[t]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=0)}([function(t,e,n){"use strict";var i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=o(n(1)),s=o(n(3)),c=o(n(4));function o(t){return t&&t.__esModule?t:{default:t}}var l=function(t){function o(t,e){!function(t,e){if(!(t instanceof o))throw new TypeError("Cannot call a class as a function")}(this);var n=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}(this,(o.__proto__||Object.getPrototypeOf(o)).call(this));return n.resolveOptions(e),n.listenClick(t),n}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}(o,s.default),r(o,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof t.action?t.action:this.defaultAction,this.target="function"==typeof t.target?t.target:this.defaultTarget,this.text="function"==typeof t.text?t.text:this.defaultText,this.container="object"===i(t.container)?t.container:document.body}},{key:"listenClick",value:function(t){var e=this;this.listener=(0,c.default)(t,"click",function(t){return e.onClick(t)})}},{key:"onClick",value:function(t){var e=t.delegateTarget||t.currentTarget;this.clipboardAction&&(this.clipboardAction=null),this.clipboardAction=new a.default({action:this.action(e),target:this.target(e),text:this.text(e),container:this.container,trigger:e,emitter:this})}},{key:"defaultAction",value:function(t){return u("action",t)}},{key:"defaultTarget",value:function(t){var e=u("target",t);if(e)return document.querySelector(e)}},{key:"defaultText",value:function(t){return u("text",t)}},{key:"destroy",value:function(){this.listener.destroy(),this.clipboardAction&&(this.clipboardAction.destroy(),this.clipboardAction=null)}}],[{key:"isSupported",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:["copy","cut"],e="string"==typeof t?[t]:t,n=!!document.queryCommandSupported;return e.forEach(function(t){n=n&&!!document.queryCommandSupported(t)}),n}}]),o}();function u(t,e){var n="data-clipboard-"+t;if(e.hasAttribute(n))return e.getAttribute(n)}t.exports=l},function(t,e,n){"use strict";var o,i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r=function(){function o(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}return function(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),t}}(),a=(o=n(2))&&o.__esModule?o:{default:o},s=function(){function n(t){!function(t,e){if(!(t instanceof n))throw new TypeError("Cannot call a class as a function")}(this),this.resolveOptions(t),this.initSelection()}return r(n,[{key:"resolveOptions",value:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{};this.action=t.action,this.container=t.container,this.emitter=t.emitter,this.target=t.target,this.text=t.text,this.trigger=t.trigger,this.selectedText=""}},{key:"initSelection",value:function(){this.text?this.selectFake():this.target&&this.selectTarget()}},{key:"selectFake",value:function(){var t=this,e="rtl"==document.documentElement.getAttribute("dir");this.removeFake(),this.fakeHandlerCallback=function(){return t.removeFake()},this.fakeHandler=this.container.addEventListener("click",this.fakeHandlerCallback)||!0,this.fakeElem=document.createElement("textarea"),this.fakeElem.style.fontSize="12pt",this.fakeElem.style.border="0",this.fakeElem.style.padding="0",this.fakeElem.style.margin="0",this.fakeElem.style.position="absolute",this.fakeElem.style[e?"right":"left"]="-9999px";var n=window.pageYOffset||document.documentElement.scrollTop;this.fakeElem.style.top=n+"px",this.fakeElem.setAttribute("readonly",""),this.fakeElem.value=this.text,this.container.appendChild(this.fakeElem),this.selectedText=(0,a.default)(this.fakeElem),this.copyText()}},{key:"removeFake",value:function(){this.fakeHandler&&(this.container.removeEventListener("click",this.fakeHandlerCallback),this.fakeHandler=null,this.fakeHandlerCallback=null),this.fakeElem&&(this.container.removeChild(this.fakeElem),this.fakeElem=null)}},{key:"selectTarget",value:function(){this.selectedText=(0,a.default)(this.target),this.copyText()}},{key:"copyText",value:function(){var e=void 0;try{e=document.execCommand(this.action)}catch(t){e=!1}this.handleResult(e)}},{key:"handleResult",value:function(t){this.emitter.emit(t?"success":"error",{action:this.action,text:this.selectedText,trigger:this.trigger,clearSelection:this.clearSelection.bind(this)})}},{key:"clearSelection",value:function(){this.trigger&&this.trigger.focus(),window.getSelection().removeAllRanges()}},{key:"destroy",value:function(){this.removeFake()}},{key:"action",set:function(){var t=0<arguments.length&&void 0!==arguments[0]?arguments[0]:"copy";if(this._action=t,"copy"!==this._action&&"cut"!==this._action)throw new Error('Invalid "action" value, use either "copy" or "cut"')},get:function(){return this._action}},{key:"target",set:function(t){if(void 0!==t){if(!t||"object"!==(void 0===t?"undefined":i(t))||1!==t.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===this.action&&t.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===this.action&&(t.hasAttribute("readonly")||t.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');this._target=t}},get:function(){return this._target}}]),n}();t.exports=s},function(t,e){t.exports=function(t){var e;if("SELECT"===t.nodeName)t.focus(),e=t.value;else if("INPUT"===t.nodeName||"TEXTAREA"===t.nodeName){var n=t.hasAttribute("readonly");n||t.setAttribute("readonly",""),t.select(),t.setSelectionRange(0,t.value.length),n||t.removeAttribute("readonly"),e=t.value}else{t.hasAttribute("contenteditable")&&t.focus();var o=window.getSelection(),i=document.createRange();i.selectNodeContents(t),o.removeAllRanges(),o.addRange(i),e=o.toString()}return e}},function(t,e){function n(){}n.prototype={on:function(t,e,n){var o=this.e||(this.e={});return(o[t]||(o[t]=[])).push({fn:e,ctx:n}),this},once:function(t,e,n){var o=this;function i(){o.off(t,i),e.apply(n,arguments)}return i._=e,this.on(t,i,n)},emit:function(t){for(var e=[].slice.call(arguments,1),n=((this.e||(this.e={}))[t]||[]).slice(),o=0,i=n.length;o<i;o++)n[o].fn.apply(n[o].ctx,e);return this},off:function(t,e){var n=this.e||(this.e={}),o=n[t],i=[];if(o&&e)for(var r=0,a=o.length;r<a;r++)o[r].fn!==e&&o[r].fn._!==e&&i.push(o[r]);return i.length?n[t]=i:delete n[t],this}},t.exports=n},function(t,e,n){var f=n(5),h=n(6);t.exports=function(t,e,n){if(!t&&!e&&!n)throw new Error("Missing required arguments");if(!f.string(e))throw new TypeError("Second argument must be a String");if(!f.fn(n))throw new TypeError("Third argument must be a Function");if(f.node(t))return u=e,d=n,(l=t).addEventListener(u,d),{destroy:function(){l.removeEventListener(u,d)}};if(f.nodeList(t))return a=t,s=e,c=n,Array.prototype.forEach.call(a,function(t){t.addEventListener(s,c)}),{destroy:function(){Array.prototype.forEach.call(a,function(t){t.removeEventListener(s,c)})}};if(f.string(t))return o=t,i=e,r=n,h(document.body,o,i,r);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList");var o,i,r,a,s,c,l,u,d}},function(t,n){n.node=function(t){return void 0!==t&&t instanceof HTMLElement&&1===t.nodeType},n.nodeList=function(t){var e=Object.prototype.toString.call(t);return void 0!==t&&("[object NodeList]"===e||"[object HTMLCollection]"===e)&&"length"in t&&(0===t.length||n.node(t[0]))},n.string=function(t){return"string"==typeof t||t instanceof String},n.fn=function(t){return"[object Function]"===Object.prototype.toString.call(t)}},function(t,e,n){var a=n(7);function r(t,e,n,o,i){var r=function(e,n,t,o){return function(t){t.delegateTarget=a(t.target,n),t.delegateTarget&&o.call(e,t)}}.apply(this,arguments);return t.addEventListener(n,r,i),{destroy:function(){t.removeEventListener(n,r,i)}}}t.exports=function(t,e,n,o,i){return"function"==typeof t.addEventListener?r.apply(null,arguments):"function"==typeof n?r.bind(null,document).apply(null,arguments):("string"==typeof t&&(t=document.querySelectorAll(t)),Array.prototype.map.call(t,function(t){return r(t,e,n,o,i)}))}},function(t,e){if("undefined"!=typeof Element&&!Element.prototype.matches){var n=Element.prototype;n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}t.exports=function(t,e){for(;t&&9!==t.nodeType;){if("function"==typeof t.matches&&t.matches(e))return t;t=t.parentNode}}}])}),function(o,i){"use strict";function e(t){try{var e=i.querySelectorAll("code.hljs,code.nohighlight");for(var n in e)e.hasOwnProperty(n)&&r(e[n],t)}catch(t){o.console.error("LineNumbers error: ",t)}}function r(t,e){var n;"object"==typeof t&&(n=function(){t.innerHTML=a(t,e)},o.setTimeout(n,0))}function a(t,e){var n=(e=e||{singleLine:!1}).singleLine?0:1;return function t(e){var n=e.childNodes;for(var o in n)if(n.hasOwnProperty(o)){var i=n[o];0<(i.textContent.trim().match(g)||[]).length&&(0<i.childNodes.length?t(i):s(i.parentNode))}}(t),function(t,e){var n=c(t);if(""===n[n.length-1].trim()&&n.pop(),n.length>e){for(var o="",i=0,r=n.length;i<r;i++)o+=l('<tr><td class="{0}"><div class="{1} {2}" {3}="{5}"></div></td><td class="{4}"><div class="{1}">{6}</div></td></tr>',[h,d,m,p,f,i+1,0<n[i].length?n[i]:" "]);return l('<table class="{0}">{1}</table>',[u,o])}return t}(t.innerHTML,n)}function s(t){var e=t.className;if(/hljs-/.test(e)){for(var n=c(t.innerHTML),o=0,i="";o<n.length;o++){i+=l('<span class="{0}">{1}</span>\n',[e,0<n[o].length?n[o]:" "])}t.innerHTML=i.trim()}}function c(t){return 0===t.length?[]:t.split(g)}function l(t,n){return t.replace(/\{(\d+)\}/g,function(t,e){return n[e]?n[e]:t})}var t,u="hljs-ln",d="hljs-ln-line",f="hljs-ln-code",h="hljs-ln-numbers",m="hljs-ln-n",p="data-line-number",g=/\r\n|\r|\n/g;o.hljs?(o.hljs.initLineNumbersOnLoad=function(t){"interactive"===i.readyState||"complete"===i.readyState?e(t):o.addEventListener("DOMContentLoaded",function(){e(t)})},o.hljs.lineNumbersBlock=r,o.hljs.lineNumbersValue=function(t,e){if("string"==typeof t){var n=document.createElement("code");return n.innerHTML=t,a(n,e)}},(t=i.createElement("style")).type="text/css",t.innerHTML=l(".{0}{border-collapse:collapse}.{0} td{padding:0}.{1}:before{content:attr({2})}",[u,m,p]),i.getElementsByTagName("head")[0].appendChild(t)):o.console.error("highlight.js not detected!")}(window,document),$.fn.extend({animateCss:function(t,e){var n=function(t){var e={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"mozAnimationEnd",WebkitAnimation:"webkitAnimationEnd"};for(var n in e)if(void 0!==t.style[n])return e[n]}(document.createElement("div"));return this.addClass("animated "+t).one(n,function(){$(this).removeClass("animated "+t),"function"==typeof e&&e($(this))}),this}}),window.Aria={init:function(){this.action.init(),THEME_CONFIG.USE_PJAX&&this.pjax(),THEME_CONFIG.USE_FANCYBOX&&this.fancybox(),THEME_CONFIG.SHOW_HITOKOTO&&this.hitokoto(),this.hljs.init(),this.commentPlus.init(),THEME_CONFIG.USE_LAZYLOAD&&this.lazyload(),this.postOther.init(),this.toc.init(),console.log("%cVer "+THEME_CONFIG.THEME_VERSION+"%cAria By Siphils https://eriri.ink","color: #fff; background: #435561; padding:6px;","color: #fff; background: #435561cf; padding:6px;")},pjax:function(){$(document).pjax('a[href="'+THEME_CONFIG.SITE_URL+'"],a[href^="'+THEME_CONFIG.SITE_URL+'"]:not(a[target="_blank"], [no-pjax],a[rel~="nofollow"])',{container:"#pjax-container",fragment:"#pjax-container",timeout:8e3}).on("pjax:send",function(){NProgress.start(),Aria.doPjaxStartAction()}).on("pjax:complete",function(){NProgress.done(),Aria.doPjaxCompleteAction(),"function"==typeof Aria.reloadAction&&Aria.reloadAction()})},doPjaxStartAction:function(){$("#header").toggleClass("slideOutUp"),$("#body").toggleClass("fadeOut"),$("#wrapper").hide()},doPjaxCompleteAction:function(){$("#header").removeClass("slideOutUp").addClass("slideInDown"),$("#body").removeClass("fadeOut").addClass("fadeIn"),THEME_CONFIG.USE_FANCYBOX&&this.fancybox(),THEME_CONFIG.SHOW_HITOKOTO&&this.hitokoto(),THEME_CONFIG.USE_LAZYLOAD&&this.lazyload(),this.hljs.init(),this.commentPlus.init(),this.postOther.init(),this.toc.init(),"undefined"!=typeof _hmt&&_hmt.push(["_trackPageview",location.pathname+location.search]),window._gaq&&_gaq.push(["_trackPageview"]),window.ga&&ga("send","pageview",{page:location.pathname,title:document.title}),"undefined"!=typeof MathJax&&MathJax.Hub.Queue(["Typeset",MathJax.Hub]),"function"==typeof loadMeting&&loadMeting(),this.action.closeNav()},fancybox:function(){($(".post-content img").length||$(".comment-content img").length)&&($("img:not([class~='link-avatar'],[no-fancybox])",".post-content").wrap(function(){return'<a href="'+this.src+'" data-caption="'+this.title+'" no-pjax class="fancybox" data-fancybox="gallery" style="outline:0"></a>'}),$("img",".comment-text").wrap(function(){return'<a href="'+this.src+'" data-caption="'+this.title+'" no-pjax class="fancybox" style="outline:0"></a>'}),$("a.fancybox").fancybox({animationEffect:"zoom-in-out",animationDuration:500,transitionEffect:"tube",transitionDuration:500,spinnerTpl:'<img style="position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);" src="'+THEME_CONFIG.THEME_URL+'/assets/img/loading.svg">'}))},hitokoto:function(){$.ajax({type:"GET",url:THEME_CONFIG.HITOKOTO_ORIGIN,success:function(t){$("#hitokoto").html(t)}})},hljs:{init:function(){$("pre code").each(function(t,e){hljs.highlightBlock(e),$(e).parent().attr({class:"highlight-wrap"}),$(e).attr({id:"hljs-"+t});var n=null==$(this).attr("class").match(/lang-(\w+)/)?"CODE":$(this).attr("class").match(/lang-(\w+)/)[1].toUpperCase();$(this).attr("data-lang",n),$(this).after('<a class="copy-code" href="javascript:" data-clipboard-target="#hljs-'+t+'" title="拷贝代码"><i class="iconfont icon-aria-copy"></i></a>')}),hljs.initLineNumbersOnLoad(),this.clipboard()},clipboard:function(){var t=new ClipboardJS(".copy-code"),e=new Notyf({delay:3e3});t.on("success",function(t){e.confirm("代码成功拷贝到剪贴板!"),t.clearSelection()}),t.on("error",function(t){e.alertL("代码拷贝失败!")})}},lazyload:function(){$("img:not([no-lazyload])").each(function(){$(this).attr("data-original",$(this).attr("src")),$(this).attr("src",THEME_CONFIG.THEME_URL+"/assets/img/loading.svg")}),$(".lazyload").lazyload({effect:"fadeIn"}),$("img:not([no-lazyload])").lazyload({effect:"fadeIn"})},postOther:{init:function(){this.postQrCode(),this.postReward()},postQrCode:function(){THEME_CONFIG.SHOW_QRCODE&&$(".post-qrcode").length&&$(".post-qrcode>a").on("click",function(){"none"!==$(".post-qrcode>div").css("display")?$(".post-qrcode>div").fadeOut():$(".post-qrcode>div").fadeIn().css("display","block")})},postReward:function(){THEME_CONFIG.SHOW_REWARD&&$(".post-reward").length&&$(".post-reward>a").on("click",function(){"none"!==$(".post-reward>ul").css("display")?$(".post-reward>ul").fadeOut():$(".post-reward>ul").fadeIn().css("display","flex")})}}},Aria.commentPlus={init:function(){this.emotion(),this.image(),this.ajaxAvatar(),THEME_CONFIG.USE_AJAX_COMMENT&&this.ajaxComment()},emotion:function(){if($(".OwO").length)new OwO({logo:'<i class="iconfont icon-aria-emotion"></i>表情',container:document.getElementsByClassName("OwO")[0],target:document.getElementsByClassName("textarea")[0],api:THEME_CONFIG.OWO_JSON,position:"down",width:"100%",maxHeight:"250px"})},image:function(){$(".comment-image").length&&($(".comment-image")[0].onclick=function(){$("textarea")[0].value+="![图片描述](图片地址)"})},ajaxAvatar:function(){if($("#comment-cur-avatar").length){var t=document.getElementById("comment-cur-avatar"),e=document.getElementById("mail");function n(){email_value=e.value,email_md5=hex_md5(email_value),new_gravatar=THEME_CONFIG.GRAVATAR_PREFIX+email_md5+"?s=64&r=G",t.setAttribute("src",new_gravatar)}e.value&&n(),-1!=navigator.userAgent.toLowerCase().indexOf("webkit")?e.onblur=n:e.onchange=n,n()}},ajaxComment:function(){var c="",n=function(){$(".comment-reply a").click(function(){c=$(this).parent().parent().parent().parent().attr("id")}),$(".cancel-comment-reply a").click(function(){c=""})};n(),$("#comment-form").submit(function(){var e=$(".submit").eq(0),i=$("#comment-form"),r="",a=new Notyf({delay:3e3}),t=$(this).serializeArray();function s(t){e.attr("disabled",!1).css("cursor","pointer"),i.css({opacity:"1"}),$("textarea",i).css({background:"initial"}),$("input,textarea",i).attr("disabled",!1),t&&($("#textarea").val(""),c=""),n()}return e.attr("disabled",!0).css("cursor","not-allowed"),i.css({opacity:".5"}),$("textarea",i).css({background:'url("'+THEME_CONFIG.THEME_URL+'/assets/img/loading.svg") center center no-repeat'}),$("input,textarea",i).attr("disabled",!0),$.ajax({type:$(this).attr("method"),url:$(this).attr("action"),data:t,success:function(t){if(!$("#comments",t).length){var e="error"===$("title").eq(0).text().trim().toLowerCase()?$(".container",t).eq(0).text():"评论提交失败!";return a.alert(e),s(!1),!1}var n,o;$("input,textarea",i).attr("disabled",!1),$("#textarea").val(""),r=$(".comment-list",t).html().match(/id=\"?comment-\d+/g).join().match(/\d+/g).sort(function(t,e){return t-e}).pop(),""===c?($(".comment-list").length?$(".prev").length||(n=$("#li-comment-"+r,t),$(".comment-list").first().prepend(n.addClass("animated fadeInUp"))):(n=$("#li-comment-"+r,t),$("#response").after('<div class="comment-data"><ol class="comment-list"></ol></div>'),$(".comment-list").first().prepend(n.addClass("animated fadeInUp"))),$("html,body").animate({scrollTop:$("#response").offset().top-100},1e3)):(n=$("#li-comment-"+r,t),$("#"+c).find(".comment-children").length||$("#"+c).append('<div class="comment-children"><ol class="comment-list"></ol></div>'),$("#"+c+" .comment-children .comment-list").first().prepend(n.addClass("animated fadeInUp")),TypechoComment.cancelReply()),o=parseInt($("#response").text()),$("#response").html($("#response").html().replace(/\d+/,o+1)),s(!0),a.confirm("评论提交成功!")},error:function(t){console.log("Ajax Comment Error"),window.location.reload()}}),!1})}},Aria.action={init:function(){this.headroom(),this.gotop(),this.closeNav(),this.nav(),this.search()},headroom:function(){var t=document.querySelector("#nav-menu");new Headroom(t).init()},gotop:function(){$(window).scroll(function(){100<$(window).scrollTop()?($("#go-top").fadeIn(500),$("#site-avatar").css({height:"25px",width:"25px",margin:"19.5px 5px 0 0"})):($("#go-top").fadeOut(500,function(){$("#go-top").css("display","none")}),$("#site-avatar").css({height:"35px",width:"35px",margin:"14.5px 5px 0 0"}))}),$("#go-top").click(function(){return $("#go-top").animate({opacity:0}),$("body,html").animate({scrollTop:0},1e3,function(){$("#go-top").animate({opacity:1})}),!1})},nav:function(){$("#nav-menu-btn").click(function(t){$("#nav-vertical").addClass("nav-open"),$("#wrapper").show()}),$("#nav-vertical>.close").on("click",function(){$("#nav-vertical").removeClass("nav-open"),$("#wrapper").hide()}),$("#wrapper").click(function(){$("#nav-vertical").removeClass("nav-open"),$("#wrapper").hide()}),$(".nav-right-item").hover(function(){$(".nav-sub",this).show(),$(".nav-sub",this).animateCss("flipInX")},function(){$(".nav-sub",this).hide()})},closeNav:function(){return $("#nav-vertical").hasClass("nav-open")&&($("#nav-vertical").removeClass("nav-open"),$("#wrapper").removeClass("wrapper-open")),!1},search:function(){"flex"==$("#search-box").css("display")&&$("#search-box").css("display","none"),$("#nav-search-btn").on("click",function(){$("#search-box").css("display","flex"),$("#search-box").animateCss("zoomIn",function(t){})}),$("#search-box>.close").on("click",function(){$("#search-box").hide()})},toc:function(){$("#toc-container").css("left",parseInt($(".post").eq(0).css("width"))+30+20+"px"),$(window).resize(function(){$("#toc-container").css("left",parseInt($(".post").eq(0).css("width"))+30+20+"px")})}},Aria.toc={},Aria.toc.init=function(){if($("#toc").length){this.createDirectory(document.getElementsByClassName("post-content")[0],document.getElementById("toc"),!0);new SmoothScroll('a[href*="#"]');$("#toc-container").height($(".post-body").eq(0).height())}},Aria.toc.children=function(t,e){var n,o,i,r=[],a="object"==typeof e,s="string"==typeof e;for(o=0,i=t.length;o<i;o++)1!==(n=t[o]).nodeType&&9!==n.nodeType||!(!e||a&&e.test(n.tagName.toLowerCase())||s&&n.tagName.toLowerCase()===e)||r.push(n);return r},Aria.toc.createDirectory=function(t,e,n){var o,i,r,a,s,c,l,u,d,f=[],h=[];for(o=function(t,e,n){for(var o,i,r=Aria.toc.children(t.childNodes,/^h[1-4]$/),a=[],s=1,c=1,l=0;r.length;)i=r.shift(),e.push(i.innerHTML),s<(o=+i.tagName.match(/\d/)[0])?(a.push(1),c+=1):o===c||c<o&&o<=s?(a.push(0),c=c):o<c&&(a.push(o-c),c=o),l+=a[a.length-1],s=o,i.id=i.id||"toc-"+i.innerHTML,n.push(i.id);return 0!==l&&1===a[0]&&(a[0]=0),a}(t,f,h),a=i=document.createElement("ul"),dirNum=[0],u=0,d=o.length;u<d;u++){if(1===(r=o[u]))s=document.createElement("ul"),a.lastElementChild||a.appendChild(document.createElement("li")),a.lastElementChild.appendChild(s),a=s,dirNum.push(0);else if(r<0)for(r*=2;r++;)r%2&&dirNum.pop(),a=a.parentNode;dirNum[dirNum.length-1]++,c=document.createElement("li"),(l=document.createElement("a")).href="#"+h[u],l.innerHTML=n?dirNum.join(".")+" "+f[u]:f[u],c.appendChild(l),a.appendChild(c)}e.appendChild(i)},window.onload=Aria.init();