/*! * Chirpy v5.6.0 (https://github.com/cotes2020/jekyll-theme-chirpy/) * © 2019 Cotes Chung * MIT Licensed */ !function(){"use strict";var o=$(".mode-toggle");function t(o,t){if(!(o instanceof t))throw new TypeError("Cannot call a class as a function")}function e(o,t){for(var e=0;e0}},{key:"topbarLocked",value:function(){return!0===o.topbarIsLocked}},{key:"unlockTopbar",value:function(){o.topbarIsLocked=!1}},{key:"getTopbarHeight",value:function(){return H.outerHeight()}},{key:"orientationLocked",value:function(){return!0===o.orientationIsLocked}},{key:"lockOrientation",value:function(){o.orientationIsLocked=!0}},{key:"unLockOrientation",value:function(){o.orientationIsLocked=!1}}]),o}();r(M,"scrollUpCount",0),r(M,"topbarIsLocked",!1),r(M,"orientationIsLocked",!1);var N,R=$("#search-input"),_=M.getTopbarHeight(),q=0;function A(){0!==$(window).scrollTop()&&(M.lockOrientation(),M.hideTopbar())}function Y(){var o=screen.orientation;o?o.onchange=function(){var t=o.type;"landscape-primary"!==t&&"landscape-secondary"!==t||A()}:$(window).on("orientationchange",(function(){$(window).width()<$(window).height()&&A()})),$(window).on("scroll",(function(){N||(N=!0)})),setInterval((function(){N&&(!function(){var o=$(window).scrollTop();if(!(Math.abs(q-o)<=_)){if(o>q)M.hideTopbar(),R.is(":focus")&&R.trigger("blur");else if(o+$(window).height()<$(document).height()){if(M.hasScrollUpTask())return;M.topbarLocked()?M.unlockTopbar():M.orientationLocked()?M.unLockOrientation():M.showTopbar()}q=o}}(),N=!1)}),250)}var z="l_",B="h_",D=$(".collapse");$(".code-header>button").children().attr("class"),$(window).on("scroll",(function(){$(window).scrollTop()>50&&"none"===$("#sidebar-trigger").css("display")?$("#back-to-top").fadeIn():$("#back-to-top").fadeOut()})),$("#back-to-top").on("click",(function(){return $("body,html").animate({scrollTop:0},800),!1})),$('[data-toggle="tooltip"]').tooltip(),0!==o.length&&o.off().on("click",(function(o){var t=$(o.target),e=t.prop("tagName")==="button".toUpperCase()?t:t.parent();modeToggle.flipMode(),e.trigger("blur")})),$("#sidebar-trigger").on("click",s.toggle),$("#mask").on("click",s.toggle),function(){if(0!==u.length&&!u.hasClass("dynamic-title")&&!f.is(":hidden")){var o=u.text().trim(),t=!1,e=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(o)&&(o=o.replace(/[0-9]/g,"").trim()),u.offset().top<$(window).scrollTop()&&f.text(o),new IntersectionObserver((function(n){if(t){var r=$(window).scrollTop(),a=e