PageSourceSearch

https://blog.kurokobo.com/ts/main.1ff1e5fdc4e178ed422e50aa407526dc552f26342d729343fded19416194382c.js

js kurokobo.com collected 2026-10-05 20:12:48 UTC 8,192 bytes, 8 lines download raw bytes

1(()=>{var C=(e,t=500)=>{e.classList.add("transiting"),e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.height=e.offsetHeight+"px",e.offsetHeight,e.style.overflow="hidden",e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0",window.setTimeout(()=>{e.classList.remove("show"),e.style.removeProperty("height"),e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"),e.classList.remove("transiting")},t)},I=(e,t=500)=>{e.classList.add("transiting"),e.style.removeProperty("display"),e.classList.add("show");let i=e.offsetHeight;e.style.overflow="hidden",e.style.height="0",e.style.paddingTop="0",e.style.paddingBottom="0",e.style.marginTop="0",e.style.marginBottom="0",e.offsetHeight,e.style.transitionProperty="height, margin, padding",e.style.transitionDuration=t+"ms",e.style.height=i+"px",e.style.removeProperty("padding-top"),e.style.removeProperty("padding-bottom"),e.style.removeProperty("margin-top"),e.style.removeProperty("margin-bottom"),window.setTimeout(()=>{e.style.removeProperty("height"),e.style.removeProperty("overflow"),e.style.removeProperty("transition-duration"),e.style.removeProperty("transition-property"),e.classList.remove("transiting")},t)},B=(e,t=500)=>window.getComputedStyle(e).display==="none"?I(e,t):C(e,t);function v(){let e=document.getElementById("toggle-menu");e&&e.addEventListener("click",()=>{document.getElementById("main-menu").classList.contains("transiting")||(document.body.classList.toggle("show-menu"),B(document.getElementById("main-menu"),300),e.classList.toggle("is-active"))})}function A(e,t,i){var n=document.createElement(e);for(let o in t)if(o&&t.hasOwnProperty(o)){let s=t[o];o=="dangerouslySetInnerHTML"?n.innerHTML=s.__html:s===!0?n.setAttribute(o,o):s!==!1&&s!=null&&n.setAttribute(o,s.toString())}for(let o=2;o<arguments.length;o++){let s=arguments[o];s&&n.appendChild(s.nodeType==null?document.createTextNode(s.toString()):s)}return n}var g=A;var p=class{localStorageKey="StackColorScheme";currentScheme;systemPreferScheme;constructor(t){this.bindMatchMedia(),this.currentScheme=this.getSavedScheme(),window.matchMedia("(prefers-color-scheme: dark)").matches===!0?this.systemPreferScheme="dark":this.systemPreferScheme="light",this.dispatchEvent(document.documentElement.dataset.scheme),t&&this.bindClick(t),document.body.style.transition==""&&document.body.style.setProperty("transition","background-color .3s ease")}saveScheme(){localStorage.setItem(this.localStorageKey,this.currentScheme)}bindClick(t){t.addEventListener("click",i=>{this.isDark()?this.currentScheme="light":this.currentScheme="dark",this.setBodyClass(),this.currentScheme==this.systemPreferScheme&&(this.currentScheme="auto"),this.saveScheme()})}isDark(){return this.currentScheme=="dark"||this.currentScheme=="auto"&&this.systemPreferScheme=="dark"}dispatchEvent(t){let i=new CustomEvent("onColorSchemeChange",{detail:t});window.dispatchEvent(i)}setBodyClass(){this.isDark()?document.documentElement.dataset.scheme="dark":document.documentElement.dataset.scheme="light",this.dispatchEvent(document.documentElement.dataset.scheme)}getSavedScheme(){let t=localStorage.getItem(this.localStorageKey);return t=="light"||t=="dark"||t=="auto"?t:"auto"}bindMatchMedia(){window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",t=>{t.matches?this.systemPreferScheme="dark":this.systemPreferScheme="light",this.setBodyClass()})}},E=p;function f(e){let t;return()=>{t&&window.cancelAnimationFrame(t),t=window.requestAnimationFrame(()=>e())}}var q=".article-content h1[id], .article-content h2[id], .article-content h3[id], .article-content h4[id], .article-content h5[id], .article-content h6[id]",S="#TableOfContents",L="#TableOfContents li",w="active-class";function x(e,t){let i=e.querySelector("a").offsetHeight,n=e.offsetTop-t.offsetHeight/2+i/2-t.offsetTop;n<0&&(n=0),t.scrollTo({top:n,behavior:"smooth"})}function D(e){let t={};return e.forEach(i=>
1{let n=i.querySelector("a");if(n){let o=n.getAttribute("href");o.startsWith("#")&&(t[o.slice(1)]=i)}}),t}function T(e){let t=[];return e.forEach(i=>{t.push({id:i.id,offset:i.offsetTop})}),t.sort((i,n)=>i.offset-n.offset),t}function b(){let e=document.querySelectorAll(q);if(!e){console.warn("No header matched query",e);return}let t=document.querySelector(S);if(!t){console.warn("No toc matched query",S);return}let i=document.querySelectorAll(L);if(!i){console.warn("No navigation matched query",L);return}let n=T(e),o=!1;t.addEventListener("mouseenter",f(()=>o=!0)),t.addEventListener("mouseleave",f(()=>o=!1));let s,a=D(i);function u(){let h=document.documentElement.scrollTop||document.body.scrollTop,d;n.forEach(m=>{h>=m.offset-20&&(d=document.getElementById(m.id))});let c;d&&(c=a[d.id]),d&&!c?console.debug("No link found for section",d):c!==s&&(s&&s.classList.remove(w),c&&(c.classList.add(w),o||x(c,t)),s=c)}window.addEventListener("scroll",f(u));function l(){n=T(e),u()}let r=document.querySelector(".article-content");r&&new ResizeObserver(f(l)).observe(r),window.addEventListener("resize",f(l))}var O="a[href]";function k(){document.querySelectorAll(O).forEach(e=>{e.getAttribute("href").startsWith("#")&&e.addEventListener("click",i=>{i.preventDefault();let n=decodeURI(e.getAttribute("href").substring(1)),o=document.getElementById(n),s=o.getBoundingClientRect().top-document.documentElement.getBoundingClientRect().top;window.history.pushState({},"",e.getAttribute("href")),scrollTo({top:s,behavior:"smooth"})})})}function M(){let e=document.querySelectorAll(".pagination-jump-trigger"),t=document.getElementById("pagination-jump-dialog");if(!t||e.length===0)return;let i=document.querySelector(".pagination"),n=document.getElementById("pagination-jump-input"),o=t.querySelector(".pagination-jump-form"),s=typeof t.showModal=="function"&&typeof t.close=="function",a=null;if(!s||!i||!n||!o)return;let u=()=>{t.classList.contains("closing")||(t.classList.add("closing"),t.addEventListener("animationend",()=>{t.classList.remove("closing"),t.close(),a?.isConnected&&a.focus()},{once:!0}))};e.forEach(l=>{l.addEventListener("click",()=>{let r=document.activeElement;a=r instanceof HTMLElement?r:l,t.showModal(),n.value="",n.focus()})}),t.addEventListener("cancel",l=>{l.preventDefault(),u()}),t.addEventListener("click",l=>{let r=t.getBoundingClientRect();r.top<=l.clientY&&l.clientY<=r.top+r.height&&r.left<=l.clientX&&l.clientX<=r.left+r.width||u()}),n.addEventListener("keydown",l=>{l.key==="Enter"&&(l.preventDefault(),o.reportValidity()&&o.dispatchEvent(new Event("submit",{cancelable:!0,bubbles:!0})))}),o.addEventListener("submit",l=>{if(l.preventDefault(),!o.checkValidity()){o.reportValidity();return}let r=parseInt(n.value);if(isNaN(r)||r<1)return;let h=parseInt(i.dataset.total||"0");if(r>h)return;let d=i.dataset.firstUrl||"",c=i.dataset.formatUrl||"",m="";r===1?m=d:m=c.replace(/2([^\d]*)$/,`${r}$1`),m&&(window.location.href=m),u()})}var y={copied:"Copied!",copy:"Copy"};function H(){let e=document.querySelectorAll(".article-content div.highlight"),t=y.copy,i=y.copied;if(!navigator.clipboard){console.warn("Clipboard API not supported, copy button will not work.");return}e.forEach(n=>{let o=document.createElement("button");o.innerHTML=t,o.classList.add("copyCodeButton"),n.appendChild(o);let s=n.querySelector("code[data-lang]");s&&o.addEventListener("click",()=>{navigator.clipboard.writeText(s.textContent).then(()=>{o.textContent=i,setTimeout(()=>{o.textContent=t},1e3)}).catch(a=>{alert(a),console.log("Something went wrong",a)})})})}var P={init:()=>{v(),document.querySelector(".article-content")&&(k(),b(),H()),M(),new E(document.getElementById("dark-mode-toggle"))}};window.addEventListener("load",()=>{setTimeout(function(){P.init()},0)});window.Stack=P;window.createElement=g;})();
2/*!
3*   Hugo Theme Stack
4*
5*   @author: Jimmy Cai
6*   @website: https://jimmycai.com
7*   @link: https://github.com/CaiJimmy/hugo-theme-stack
8*/

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.