/*! * Chirpy v6.2.3 | © 2019 Cotes Chung | MIT Licensed | https://github.com/cotes2020/jekyll-theme-chirpy/ */ !function(){"use strict";function t(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e(t,e){for(var r=0;rt.length)&&(e=t.length);for(var r=0,n=new Array(e);r.container>.row"),v=$("#topbar-title"),g=$("search"),h=$("#search-result-wrapper"),b=$("#search-results"),y=$("#search-input"),C=$("#search-hints"),k=$("html,body"),w="loaded",T="unloaded",A="input-focus",j="d-flex",S=function(){function e(){t(this,e)}return r(e,null,[{key:"on",value:function(){e.offset=window.scrollY,k.scrollTop(0)}},{key:"off",value:function(){k.scrollTop(e.offset)}}]),e}();n(S,"offset",0),n(S,"resultVisible",!1);var E=function(){function e(){t(this,e)}return r(e,null,[{key:"on",value:function(){f.addClass(T),v.addClass(T),d.addClass(T),g.addClass(j),m.addClass(w)}},{key:"off",value:function(){m.removeClass(w),g.removeClass(j),f.removeClass(T),v.removeClass(T),d.removeClass(T)}}]),e}(),x=function(){function e(){t(this,e)}return r(e,null,[{key:"on",value:function(){S.resultVisible||(S.on(),h.removeClass(T),p.addClass(T),S.resultVisible=!0)}},{key:"off",value:function(){S.resultVisible&&(b.empty(),C.hasClass(T)&&C.removeClass(T),h.addClass(T),p.removeClass(T),S.off(),y.val(""),S.resultVisible=!1)}}]),e}();function I(){return m.hasClass(w)}$(".collapse");$(".code-header>button").children().attr("class");var M="data-src",F="data-lqip",O={SHIMMER:"shimmer",BLUR:"blur"};function R(t){$(this).parent().removeClass(t)}function D(){this.complete&&(this.hasAttribute(F)?R.call(this,O.BLUR):R.call(this,O.SHIMMER))}function P(){var t=$(this),e=t.attr(M);t.attr("src",encodeURI(e)),t.removeAttr(M)}var U,V,H=function(){function e(){t(this,e)}return r(e,null,[{key:"attrTimestamp",get:function(){return"data-ts"}},{key:"attrDateFormat",get:function(){return"data-df"}},{key:"locale",get:function(){return $("html").attr("lang").substring(0,2)}},{key:"getTimestamp",value:function(t){return Number(t.attr(e.attrTimestamp))}},{key:"getDateFormat",value:function(t){return t.attr(e.attrDateFormat)}}]),e}();U=$(window),V=$("#back-to-top"),U.on("scroll",(function(){U.scrollTop()>50?V.fadeIn():V.fadeOut()})),V.on("click",(function(){U.scrollTop(0)})),o(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map((function(t){return new bootstrap.Tooltip(t)})),0!==l.length&&l.off().on("click",(function(t){var e=$(t.target),r=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),r.trigger("blur")})),$("#sidebar-trigger").on("click",c.toggle),$("#mask").on("click",c.toggle),d.on("click",(function(){E.on(),x.on(),y.trigger("focus")})),m.on("click",(function(){E.off(),x.off()})),y.on("focus",(function(){g.addClass(A)})),y.on("focusout",(function(){g.removeClass(A)})),y.on("input",(function(){""===y.val()?I()?C.removeClass(T):x.off():(x.on(),I()&&C.addClass(T))})),dayjs.locale(H.locale),dayjs.extend(window.dayjs_plugin_localizedFormat),$("[".concat(H.attrTimestamp,"]")).each((function(){var t=dayjs.unix(H.getTimestamp($(this))),e=t.format(H.getDateFormat($(this)));$(this).text(e),$(this).removeAttr(H.attrTimestamp),$(this).removeAttr(H.attrDateFormat);var r=$(this).attr("data-bs-toggle");if(void 0!==r&&"tooltip"===r){var n=t.format("llll");$(this).attr("data-bs-title",n),new bootstrap.Tooltip($(this))}})),function(){var t=$("article img");t.length&&t.on("load",D),$('article img[loading="lazy"]').each((function(){this.complete&&R.call(this,O.SHIMMER)}));var e=$("article img[".concat(F,'="true"]'));e.length&&e.each(P)}()}();