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