PageSourceSearch

https://ahmadbuhari.com/assets/js/dist/post.min.js

js ahmadbuhari.com collected 2026-09-25 20:05:17 UTC 11,872 bytes, 6 lines download raw bytes

1/*!
2 * Chirpy v5.6.1 (https://github.com/cotes2020/jekyll-theme-chirpy/)
3 * © 2019 Cotes Chung
4 * MIT Licensed
5 */
6!function(){"use strict";var t=$(".mode-toggle");function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,a(n.key),n)}}function n(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function r(t,e,o){return(e=a(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function a(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var o=t[Symbol.toPrimitive];if(void 0!==o){var n=o.call(t,e||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}var i=$("body"),c="sidebar-display",l=function(){function t(){e(this,t)}return n(t,null,[{key:"toggle",value:function(){!1===t.isExpanded?i.attr(c,""):i.removeAttr(c),t.isExpanded=!t.isExpanded}}]),t}();r(l,"isExpanded",!1);var s="div.post>h1:first-of-type",u=$(s),f=$("#topbar-title"),p=f.text().trim();var d=$("#sidebar-trigger"),h=$("#search-trigger"),g=$("#search-cancel"),v=$("#main"),m=$("#topbar-title"),y=$("#search-wrapper"),b=$("#search-result-wrapper"),w=$("#search-results"),k=$("#search-input"),C=$("#search-hints"),T=$("html,body"),S="loaded",x="unloaded",E="input-focus",I="d-flex",L=function(){function t(){e(this,t)}return n(t,null,[{key:"on",value:function(){t.offset=window.scrollY,T.scrollTop(0)}},{key:"off",value:function(){T.scrollTop(t.offset)}}]),t}();r(L,"offset",0),r(L,"resultVisible",!1);var P=function(){function t(){e(this,t)}return n(t,null,[{key:"on",value:function(){d.addClass(x),m.addClass(x),h.addClass(x),y.addClass(I),g.addClass(S)}},{key:"off",value:function(){g.removeClass(S),y.removeClass(I),d.removeClass(x),m.removeClass(x),h.removeClass(x)}}]),t}(),_=function(){function t(){e(this,t)}return n(t,null,[{key:"on",value:function(){L.resultVisible||(L.on(),b.removeClass(x),v.addClass(x),L.resultVisible=!0)}},{key:"off",value:function(){L.resultVisible&&(w.empty(),C.hasClass(x)&&C.removeClass(x),b.addClass(x),v.removeClass(x),L.off(),k.val(""),L.resultVisible=!1)}}]),t}();function O(){return g.hasClass(S)}var K="data-topbar-visible",R=$("body"),V=$("#topbar-wrapper"),Y=function(){function t(){e(this,t)}return n(t,null,[{key:"hideTopbar",value:function(){R.attr(K,"false")}},{key:"showTopbar",value:function(){R.attr(K,"true")}},{key:"addScrollUpTask",value:function(){t.scrollUpCount+=1,t.topbarIsLocked||(t.topbarIsLocked=!0)}},{key:"popScrollUpTask",value:function(){t.scrollUpCount-=1}},{key:"hasScrollUpTask",value:function(){return t.scrollUpCount>0}},{key:"topbarLocked",value:function(){return!0===t.topbarIsLocked}},{key:"unlockTopbar",value:function(){t.topbarIsLocked=!1}},{key:"getTopbarHeight",value:function(){return V.outerHeight()}},{key:"orientationLocked",value:function(){return!0===t.orientationIsLocked}},{key:"lockOrientation",value:function(){t.orientationIsLocked=!0}},{key:"unLockOrientation",value:function(){t.orientationIsLocked=!1}}]),t}();r(Y,"scrollUpCount",0),r(Y,"topbarIsLocked",!1),r(Y,"orientationIsLocked",!1);var F,N=$("#search-input"),U=Y.getTopbarHeight(),j=0;function A(){0!==$(window).scrollTop()&&(Y.lockOrientation(),Y.hideTopbar())}function M(){var t=screen.orientation;t?t.onchange=function(){var e=t.type;"landscape-primary"!==e&&"landscape-secondary"!==e||A()}:$(window).on("orientationchange",(function(){$(window).width()<$(window).height()&&A()})),$(window).on("scroll",(function(){F||(F=!0)})),setInterval((function(){F&&(!function(){var t=$(window).scrollTop();if(!(Math.abs(j-t)<=U)){if(t>j)Y.hideTopbar(),N.is(":focus")&&N.trigger("blur");else if(t+$(window).height()<$(document).height()){if(Y.hasScrollUpTask())return;Y.topbarLocked()?Y.unlockTopbar():Y.orientationLocked()?Y.unLockOrientation():Y.showTopbar()}j=t}}(),F=!1)}),250)}$(".collapse");var D=".code-header>button",H="fas fa-check",J="timeout",q="data-title-succeed",z="data-original-title",B=2e3;
6function G(t){if($(t)[0].hasAttribute(J)){var e=$(t).attr(J);if(Number(e)>Date.now())return!0}return!1}function Q(t){$(t).attr(J,Date.now()+B)}function W(t){$(t).removeAttr(J)}var X=$(D).children().attr("class");var Z=function(){function t(){e(this,t)}return n(t,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(e){return Number(e.attr(t.attrTimestamp))}},{key:"getDateFormat",value:function(e){return e.attr(t.attrDateFormat)}}]),t}();var tt,et,ot=(tt=!1,function(){var t=tt;return tt||(tt=!0),t}),nt=function(){function t(t){return $(t).attr("content")}function e(e){var o=t(e);return void 0!==o&&!1!==o}return{getProxyMeta:function(){return t("meta[name=pv-proxy-endpoint]")},getLocalMeta:function(){return t("meta[name=pv-cache-path]")},hasProxyMeta:function(){return e("meta[name=pv-proxy-endpoint]")},hasLocalMeta:function(){return e("meta[name=pv-cache-path]")}}}(),rt=function(){var t={KEY_PV:"pv",KEY_PV_SRC:"pv_src",KEY_CREATION:"pv_created_date"},e="same-origin",o="cors";function n(t){return localStorage.getItem(t)}function r(t,e){localStorage.setItem(t,e)}function a(e,o){r(t.KEY_PV,e),r(t.KEY_PV_SRC,o),r(t.KEY_CREATION,(new Date).toJSON())}return{keysCount:function(){return Object.keys(t).length},hasCache:function(){return null!==localStorage.getItem(t.KEY_PV)},getCache:function(){return JSON.parse(localStorage.getItem(t.KEY_PV))},saveLocalCache:function(t){a(t,e)},saveProxyCache:function(t){a(t,o)},isExpired:function(){var e=new Date(n(t.KEY_CREATION));return e.setHours(e.getHours()+1),Date.now()>=e.getTime()},isFromLocal:function(){return n(t.KEY_PV_SRC)===e},isFromProxy:function(){return n(t.KEY_PV_SRC)===o},newerThan:function(t){return rt.getCache().totalsForAllResults["ga:pageviews"]>t.totalsForAllResults["ga:pageviews"]},inspectKeys:function(){if(localStorage.length===rt.keysCount())for(var e=0;e<localStorage.length;e++){switch(localStorage.key(e)){case t.KEY_PV:case t.KEY_PV_SRC:case t.KEY_CREATION:break;default:return void localStorage.clear()}}else localStorage.clear()}}}();function at(t,e,o,n){var r=function(t,e){var o=0;if(void 0!==e)for(var n=0;n<e.length;++n)if(e[parseInt(n,10)][0]===t){o+=parseInt(e[parseInt(n,10)][1],10);break}return o}(e,t);if(r=0===r?1:r,n){var a=parseInt(o.text().replace(/,/g,""),10);r>a&&function(t,e,o){if(t<e){var n=new CountUp(o,t,e);n.error?console.error(n.error):n.start()}}(a,r,o.attr("id"))}else o.text((new Intl.NumberFormat).format(r))}function it(t){if(void 0!==t){var e=ot(),o=t.rows;if($("#post-list").length>0)$(".post-preview").each((function(){var t=$(this).find("a").attr("href");at(o,t,$(this).find(".pageviews"),e)}));else if($(".post").length>0){var n=window.location.pathname;at(o,n,$("#pv"),e)}}}function ct(){nt.hasProxyMeta()&&$.ajax({type:"GET",url:nt.getProxyMeta(),dataType:"jsonp",success:function(t){it(t),rt.saveProxyCache(JSON.stringify(t))},error:function(t,e,o){console.log("Failed to load pageviews from proxy server: "+o)}})}function lt(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return fetch(nt.getLocalMeta()).then((function(t){return t.json()})).then((function(e){t&&rt.isFromProxy()&&rt.newerThan(e)||(it(e),rt.saveLocalCache(JSON.stringify(e)))}))}$(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!==t.length&&t.off().on("click",(function(t){var e=$(t.target),o=e.prop("tagName")==="button".toUpperCase()?e:e.parent();modeToggle.flipMode(),o.trigger("blur")})),$("#sidebar-trigger").on("click",l.toggle),$("#mask").on("click",l.toggle),function(){if(0!==u.length&&!u.hasClass("dynamic-title")&&!f.is(":hidden")){var t=u.text().trim(),e=!1,o=0;($("#page-category").length||$("#page-tag").length)&&/\s/.test(t)&&(t=t.replace(/[0-9]/g,"").trim()),u.offset().top<$(window).scrollTop()&&f.text(t),new IntersectionObserver((function(n){if(e){var r=$(window).scrollTop(),a=o<r;o=r;var i=n[0];a?0===i.intersectionRatio&&f.text(t):1===i.intersectionRatio&&f.text(p)}else e=!0}),{rootMargin:"-48px 0px 0px 0px",threshold:[0,1]}).observe(document.querySelector(s)),f.on("click",(function(){$("body,html").animate({scrollTop:0},800)}))}}(),h.on("click",(function(){P.on(),_.on(),k.trigger("focus")})),g.on("click",(function(){P.off(),_.off()})),k.on("focus",(function(){y.addClass(E)})),k.on("focusout",(function(){y.removeClass(E)})),k.on("input",(function(){""===k.val()?O()?C.removeClass(x):_.off():(_.on(),O()&&C.addClass(x))})),M(),$("#core-wrapper img[data-src]")<=0||($(".popup").magnificPopup({type:"image",closeOnContentClick:!0,showCloseBtn:!1,zoom:{enabled:!0,duration:300,easing:"ease-in-out"}}),document.addEventListener("lazyloaded",(function(t){$(t.target).parent().removeClass("shimmer")}))),dayjs.locale(Z.locale),dayjs.extend(window.dayjs_plugin_localizedFormat),$("[".concat(Z.attrTimestamp,"]")).each((function(){var t=dayjs.unix(Z.getTimestamp($(this))),e=t.format(Z.getDateFormat($(this)));$(this).text(e),$(this).removeAttr(Z.attrTimestamp),$(this).removeAttr(Z.attrDateFormat);var o=$(this).attr("data-toggle");if(void 0!==o&&"tooltip"===o){var n=t.format("llll");$(this).attr("data-original-title",n)}})),et=new ClipboardJS(D,{target:function(t){return t.parentNode.nextElementSibling.querySelector("code .rouge-code")}}),$(D).tooltip({trigger:"hover",placement:"left"}),et.on("success",(function(t){t.clearSelection();var e=t.trigger;G(e)||(function(t){$(t).children().attr("class",H)}
6(e),function(t){var e=$(t).attr(q);$(t).attr(z,e).tooltip("show")}(e),Q(e),setTimeout((function(){!function(t){$(t).tooltip("hide").removeAttr(z)}(e),function(t){$(t).children().attr("class",X)}(e),W(e)}),B))})),$("#copy-link").on("click",(function(t){var e=$(t.target);G(e)||navigator.clipboard.writeText(window.location.href).then((function(){var t=e.attr(z),o=e.attr(q);e.attr(z,o).tooltip("show"),Q(e),setTimeout((function(){e.attr(z,t),W(e)}),B)}))})),document.querySelector("#core-wrapper h2,#core-wrapper h3")&&tocbot.init({tocSelector:"#toc",contentSelector:".post-content",ignoreSelector:"[data-toc-skip]",headingSelector:"h2, h3",orderedList:!1,scrollSmooth:!1}),function(){var t=$("#topbar-title"),e="scroll-focus";$("a[href*='#']:not([href='#']):not([href='#0'])").on("click",(function(o){if(this.pathname.replace(/^\//,"")===location.pathname.replace(/^\//,"")&&location.hostname===this.hostname){var n=decodeURI(this.hash),r=RegExp(/^#fnref:/).test(n),a=!r&&RegExp(/^#fn:/).test(n),i="#"+$.escapeSelector(n.substring(1)),c=$(i),l=t.is(":visible"),s=$(window).width()<$(window).height();if(void 0!==c){o.preventDefault(),history.pushState&&history.pushState(null,null,n);var u=$(window).scrollTop(),f=c.offset().top-=8;f<u?(Y.hideTopbar(),Y.addScrollUpTask(),l&&s&&(f-=Y.getTopbarHeight())):l&&s&&(f-=Y.getTopbarHeight()),$("html").animate({scrollTop:f},500,(function(){c.trigger("focus");var t=$("[".concat(e,"=true]"));t.length&&t.attr(e,"false");var o=$(":target");if(o.length&&o.attr(e,"false"),(a||r)&&c.attr(e,"true"),c.is(":focus"))return!1;c.attr("tabindex","-1"),c.trigger("focus"),Y.hasScrollUpTask()&&Y.popScrollUpTask()}))}}}))}(),$(".pageviews").length<=0||(rt.inspectKeys(),rt.hasCache()?(it(rt.getCache()),rt.isExpired()?nt.hasLocalMeta()?lt(!0).then(ct):ct():rt.isFromLocal()&&ct()):nt.hasLocalMeta()?lt().then(ct):ct())}();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.