From 0b5e40e2bf5c62242ea1f5b368f01928e4aaef9c Mon Sep 17 00:00:00 2001 From: Cell <1024@lruihao.cn> Date: Fri, 3 Mar 2023 15:06:30 +0800 Subject: [PATCH] :bug: Fix: APlayer invades the click event of the anchor links, resulting in invalid Chinese anchor links scrolling (#292) --- CHANGELOG.md | 1 + assets/js/theme.min.js | 2 +- assets/js/theme.min.js.map | 2 +- src/js/theme.js | 8 +++++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cc8b2b3d4..39ffdde16 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ All notable changes to this project will be documented in this file. - :bug: Fix: missing parameter `requiredFields` for Valine - :bug: Fix: js.build is executed after fingerprint, resulting in the destruction of js integrity - :bug: Fix: toc fails when the toc aside is on the left +- :bug: Fix: APlayer invades the click event of the anchor links, resulting in invalid Chinese anchor links scrolling ([#292](https://github.com/hugo-fixit/FixIt/issues/292)) - :recycle: Refactor: image lazy loading ([#283](https://github.com/hugo-fixit/FixIt/pull/283)) - :recycle: Refactor: author's avatar of post or profile ([#288](https://github.com/hugo-fixit/FixIt/pull/288)) - :art: Style: fix `#comments` css style conflict ([#269](https://github.com/hugo-fixit/FixIt/issues/269)) diff --git a/assets/js/theme.min.js b/assets/js/theme.min.js index 02e5d7aa9..d90b4f488 100644 --- a/assets/js/theme.min.js +++ b/assets/js/theme.min.js @@ -1,3 +1,3 @@ -"use strict";function _objectDestructuringEmpty(obj){if(obj==null)throw new TypeError("Cannot destructure "+obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i.nested-item"),function($nestedItem){$nestedItem.addEventListener("click",function(){this.parentNode.querySelector(".sub-menu").classList.toggle("open");this.querySelector(".dropdown-icon").classList.toggle("open")})})}},{key:"initSwitchTheme",value:function initSwitchTheme(){var _this5=this;this.util.forEach(document.getElementsByClassName("theme-switch"),function($themeSwitch){$themeSwitch.addEventListener("click",function(){var _window$localStorage;document.body.dataset.theme=document.body.dataset.theme==="dark"?"light":"dark";_this5.isDark=!_this5.isDark;(_window$localStorage=window.localStorage)===null||_window$localStorage===void 0?void 0:_window$localStorage.setItem("theme",_this5.isDark?"dark":"light");var _iterator=_createForOfIteratorHelper(_this5.switchThemeEventSet),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var event=_step.value;event()}}catch(err){_iterator.e(err)}finally{_iterator.f()}},false)})}},{key:"initSearch",value:function initSearch(){var _searchConfig$maxResu,_searchConfig$snippet,_searchConfig$highlig,_searchConfig$isCaseS,_searchConfig$minMatc,_searchConfig$findAll,_searchConfig$locatio,_searchConfig$thresho,_searchConfig$distanc,_searchConfig$ignoreL,_searchConfig$useExte,_searchConfig$ignoreF,_this6=this;var searchConfig=this.config.search;var isMobile=this.util.isMobile();if(!searchConfig||isMobile&&this._searchMobileOnce||!isMobile&&this._searchDesktopOnce){return}var maxResultLength=(_searchConfig$maxResu=searchConfig.maxResultLength)!==null&&_searchConfig$maxResu!==void 0?_searchConfig$maxResu:10;var snippetLength=(_searchConfig$snippet=searchConfig.snippetLength)!==null&&_searchConfig$snippet!==void 0?_searchConfig$snippet:50;var highlightTag=(_searchConfig$highlig=searchConfig.highlightTag)!==null&&_searchConfig$highlig!==void 0?_searchConfig$highlig:"em";var isCaseSensitive=(_searchConfig$isCaseS=searchConfig.isCaseSensitive)!==null&&_searchConfig$isCaseS!==void 0?_searchConfig$isCaseS:false;var minMatchCharLength=(_searchConfig$minMatc=searchConfig.minMatchCharLength)!==null&&_searchConfig$minMatc!==void 0?_searchConfig$minMatc:1;var findAllMatches=(_searchConfig$findAll=searchConfig.findAllMatches)!==null&&_searchConfig$findAll!==void 0?_searchConfig$findAll:false;var location=(_searchConfig$locatio=searchConfig.location)!==null&&_searchConfig$locatio!==void 0?_searchConfig$locatio:0;var threshold=(_searchConfig$thresho=searchConfig.threshold)!==null&&_searchConfig$thresho!==void 0?_searchConfig$thresho:0.3;var distance=(_searchConfig$distanc=searchConfig.distance)!==null&&_searchConfig$distanc!==void 0?_searchConfig$distanc:100;var ignoreLocation=(_searchConfig$ignoreL=searchConfig.ignoreLocation)!==null&&_searchConfig$ignoreL!==void 0?_searchConfig$ignoreL:false;var useExtendedSearch=(_searchConfig$useExte=searchConfig.useExtendedSearch)!==null&&_searchConfig$useExte!==void 0?_searchConfig$useExte:false;var ignoreFieldNorm=(_searchConfig$ignoreF=searchConfig.ignoreFieldNorm)!==null&&_searchConfig$ignoreF!==void 0?_searchConfig$ignoreF:false;var suffix=isMobile?"mobile":"desktop";var $header=document.getElementById("header-".concat(suffix));var $searchInput=document.getElementById("search-input-".concat(suffix));var $searchToggle=document.getElementById("search-toggle-".concat(suffix));var $searchLoading=document.getElementById("search-loading-".concat(suffix));var $searchClear=document.getElementById("search-clear-".concat(suffix));if(isMobile){this._searchMobileOnce=true;$searchInput.addEventListener("focus",function(){_this6.disableScrollEvent=true;document.body.classList.add("blur");$header.classList.add("open")},false);document.getElementById("search-cancel-mobile").addEventListener("click",function(){_this6.disableScrollEvent=false;$header.classList.remove("open");document.body.classList.remove("blur");document.getElementById("menu-toggle-mobile").classList.remove("active");document.getElementById("menu-mobile").classList.remove("active");$searchLoading.style.display="none";$searchClear.style.display="none";_this6._searchMobile&&_this6._searchMobile.autocomplete.setVal("")},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this6._searchMobile&&_this6._searchMobile.autocomplete.setVal("")},false);this._searchMobileOnClickMask=this._searchMobileOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this6._searchMobile&&_this6._searchMobile.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchMobileOnClickMask)}else{this._searchDesktopOnce=true;$searchToggle.addEventListener("click",function(){document.body.classList.add("blur");$header.classList.add("open");$searchInput.focus()},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this6._searchDesktop&&_this6._searchDesktop.autocomplete.setVal("")},false);this._searchDesktopOnClickMask=this._searchDesktopOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this6._searchDesktop&&_this6._searchDesktop.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchDesktopOnClickMask)}$searchInput.addEventListener("input",function(){if($searchInput.value==="")$searchClear.style.display="none";else $searchClear.style.display="inline"},false);var initAutosearch=function initAutosearch(){var autosearch=autocomplete("#search-input-".concat(suffix),{hint:false,autoselect:true,dropdownMenuContainer:"#search-dropdown-".concat(suffix),clearOnSelected:true,cssClasses:{noPrefix:true},debug:true},{name:"search",source:function source(query,callback){$searchLoading.style.display="inline";$searchClear.style.display="none";var finish=function finish(results){$searchLoading.style.display="none";$searchClear.style.display="inline";callback(results)};if(searchConfig.type==="lunr"){var search=function search(){if(lunr.queryHandler){query=lunr.queryHandler(query)}var results={};_this6._index.search(query).forEach(function(_ref){var ref=_ref.ref,metadata=_ref.matchData.metadata;var matchData=_this6._indexData[ref];var uri=matchData.uri,title=matchData.title,context=matchData.content;if(results[uri]){return}var position=0;Object.values(metadata).forEach(function(_ref2){var content=_ref2.content;if(content){var matchPosition=content.position[0][0];if(matchPosition0){position+=context.substr(position,20).lastIndexOf(" ")+1;context="..."+context.substr(position,snippetLength)}else{context=context.substr(0,snippetLength)}Object.keys(metadata).forEach(function(key){title=title.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"));context=context.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"))});results[uri]={uri:uri,title:title,date:matchData.date,context:context}});return Object.values(results).slice(0,maxResultLength)};if(!_this6._index){fetch(searchConfig.lunrIndexURL).then(function(response){return response.json()}).then(function(data){var indexData={};_this6._index=lunr(function(){var _this7=this;if(searchConfig.lunrLanguageCode)this.use(lunr[searchConfig.lunrLanguageCode]);this.ref("objectID");this.field("title",{boost:50});this.field("tags",{boost:20});this.field("categories",{boost:20});this.field("content",{boost:10});this.metadataWhitelist=["position"];data.forEach(function(record){indexData[record.objectID]=record;_this7.add(record)})});_this6._indexData=indexData;finish(search())}).catch(function(err){console.error(err);finish([])})}else finish(search())}else if(searchConfig.type==="algolia"){_this6._algoliaIndex=_this6._algoliaIndex||algoliasearch(searchConfig.algoliaAppID,searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);_this6._algoliaIndex.search(query,{offset:0,length:maxResultLength*8,attributesToHighlight:["title"],attributesToSnippet:["content:".concat(snippetLength)],highlightPreTag:"<".concat(highlightTag,">"),highlightPostTag:"")}).then(function(_ref3){var hits=_ref3.hits;var results={};hits.forEach(function(_ref4){var uri=_ref4.uri,date=_ref4.date,title=_ref4._highlightResult.title,content=_ref4._snippetResult.content;if(results[uri]&&results[uri].context.length>content.value){return}results[uri]={uri:uri,title:title.value,date:date,context:content.value}});finish(Object.values(results).slice(0,maxResultLength))}).catch(function(err){console.error(err);finish([])})}else if(searchConfig.type==="fuse"){var _search=function _search(){var results={};window._index.search(query).forEach(function(_ref5){var item=_ref5.item,refIndex=_ref5.refIndex,matches=_ref5.matches;var title=item.title;var content=item.content;matches.forEach(function(_ref6){var indices=_ref6.indices,value=_ref6.value,key=_ref6.key;if(key==="content"){var offset=0;for(var i=0;i")+substr+"");content=content.substring(0,indices[i][0]+offset)+tag+content.substring(indices[i][1]+1+offset,content.length);offset+=highlightTag.length*2+5}}else if(key==="title"){var _offset=0;for(var _i=0;_i")+_substr+"");title=title.substring(0,indices[_i][0]+_offset)+_tag+title.substring(indices[_i][1]+1+_offset,content.length);_offset+=highlightTag.length*2+5}}});results[item.uri]={uri:item.uri,title:title,date:item.date,context:content}});return Object.values(results).slice(0,maxResultLength)};if(!window._index){fetch(searchConfig.fuseIndexURL).then(function(response){return response.json()}).then(function(data){var options={isCaseSensitive:isCaseSensitive,findAllMatches:findAllMatches,minMatchCharLength:minMatchCharLength,location:location,threshold:threshold,distance:distance,ignoreLocation:ignoreLocation,useExtendedSearch:useExtendedSearch,ignoreFieldNorm:ignoreFieldNorm,includeScore:false,shouldSort:true,includeMatches:true,keys:["content","title"]};window._index=new Fuse(data,options);finish(_search())}).catch(function(err){console.error(err);finish([])})}else finish(_search())}},templates:{suggestion:function suggestion(_ref7){var title=_ref7.title,date=_ref7.date,context=_ref7.context;return"
".concat(title,"").concat(date,"
").concat(context,"
")},empty:function empty(_ref8){var query=_ref8.query;return"
".concat(searchConfig.noResultsFound,": \"").concat(query,"\"
")},footer:function footer(_ref9){_objectDestructuringEmpty(_ref9);var _ref10=searchConfig.type==="algolia"?{searchType:"algolia",icon:"",href:"https://www.algolia.com/"}:searchConfig.type==="lunr"?{searchType:"Lunr.js",icon:"",href:"https://lunrjs.com/"}:{searchType:"Fuse.js",icon:"",href:"https://fusejs.io/"},searchType=_ref10.searchType,icon=_ref10.icon,href=_ref10.href;return"")}}});autosearch.on("autocomplete:selected",function(_event,suggestion,_dataset,_context){window.location.assign(suggestion.uri)});if(isMobile){_this6._searchMobile=autosearch}else{_this6._searchDesktop=autosearch}};if(searchConfig.lunrSegmentitURL&&!document.getElementById("lunr-segmentit")){var script=document.createElement("script");script.id="lunr-segmentit";script.src=searchConfig.lunrSegmentitURL;script.async=true;if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;initAutosearch()}}}else{script.onload=function(){initAutosearch()}}document.body.appendChild(script)}else{initAutosearch()}}},{key:"initDetails",value:function initDetails(){this.util.forEach(document.getElementsByClassName("details"),function($details){var $summary=$details.querySelector(".details-summary");$summary.addEventListener("click",function(){$details.classList.toggle("open")},false)})}},{key:"initLightGallery",value:function initLightGallery(){if(this.config.lightgallery){lightGallery(document.getElementById("content"),{plugins:[lgThumbnail,lgZoom],selector:".lightgallery",speed:400,hideBarsDelay:2000,allowMediaOverlap:true,exThumbImage:"data-thumbnail",toggleThumb:true,thumbWidth:80,thumbHeight:"60px",actualSize:false,showZoomInOutIcons:true,licenseKey:"none"})}}},{key:"initHighlight",value:function initHighlight(){var _this8=this;this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function($preChroma){var $chroma=document.createElement("div");$chroma.className=$preChroma.className;var $table=document.createElement("table");$chroma.appendChild($table);var $tbody=document.createElement("tbody");$table.appendChild($tbody);var $tr=document.createElement("tr");$tbody.appendChild($tr);var $td=document.createElement("td");$tr.appendChild($td);$preChroma.parentElement.replaceChild($chroma,$preChroma);$td.appendChild($preChroma)});this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function($chroma){var $codeElements=$chroma.querySelectorAll("pre.chroma > code");if($codeElements.length){var $code=$codeElements[$codeElements.length-1];var $header=document.createElement("div");$header.className="code-header "+$code.className.toLowerCase();var $title=document.createElement("span");$title.classList.add("code-title");$title.insertAdjacentHTML("afterbegin","");$title.addEventListener("click",function(){$chroma.classList.toggle("open")},false);$header.appendChild($title);var $ellipses=document.createElement("span");$ellipses.insertAdjacentHTML("afterbegin","");$ellipses.classList.add("ellipses");$ellipses.addEventListener("click",function(){$chroma.classList.add("open")},false);$header.appendChild($ellipses);if(_this8.config.code.editable){var $edit=document.createElement("span");$edit.classList.add("edit");$edit.insertAdjacentHTML("afterbegin",""));$edit.addEventListener("click",function(){var $iconKey=$edit.querySelector(".fa-key");var $iconLock=$edit.querySelector(".fa-lock");var $preChromas=$edit.parentElement.parentElement.querySelectorAll("pre.chroma");var $preChroma=$preChromas.length===2?$preChromas[1]:$preChromas[0];if($iconKey){$iconKey.classList.add("fa-lock");$iconKey.classList.remove("fa-key");$iconKey.title=_this8.config.code.editLockTitle;$preChroma.setAttribute("contenteditable",true);$preChroma.focus()}else{$iconLock.classList.add("fa-key");$iconLock.classList.remove("fa-lock");$iconLock.title=_this8.config.code.editUnLockTitle;$preChroma.setAttribute("contenteditable",false);$preChroma.blur()}},false);$header.appendChild($edit)}if(_this8.config.code.copyTitle){var $copy=document.createElement("span");$copy.insertAdjacentHTML("afterbegin","");$copy.classList.add("copy");var code=$code.innerText.trim();if(_this8.config.code.maxShownLines<0||code.split("\n").length<_this8.config.code.maxShownLines+2){$chroma.classList.add("open")}$copy.title=_this8.config.code.copyTitle;$copy.addEventListener("click",function(){navigator.clipboard.writeText(code).then(function(){_this8.util.animateCSS($code,"animate__flash")},function(){console.error("Clipboard write failed!","Your browser does not support clipboard API!")})},false);$header.appendChild($copy)}$chroma.insertBefore($header,$chroma.firstChild)}})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function($table){var $wrapper=document.createElement("div");$wrapper.className="table-wrapper";$table.parentElement.replaceChild($wrapper,$table);$wrapper.appendChild($table)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var num=1;num<=6;num++){this.util.forEach(document.querySelectorAll(".single .content > h"+num),function($header){$header.classList.add("header-link");$header.insertAdjacentHTML("afterbegin",""))})}}},{key:"initToc",value:function initToc(){var _this9=this;var $tocCore=document.getElementById("TableOfContents");if($tocCore===null){return}if(document.getElementById("toc-static").dataset.kept===true||this.util.isTocStatic()){var $tocContentStatic=document.getElementById("toc-content-static");if($tocCore.parentElement!==$tocContentStatic){$tocCore.parentElement.removeChild($tocCore);$tocContentStatic.appendChild($tocCore)}this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var $tocContentAuto=document.getElementById("toc-content-auto");if($tocCore.parentElement!==$tocContentAuto){$tocCore.parentElement.removeChild($tocCore);$tocContentAuto.appendChild($tocCore)}var $toc=document.getElementById("toc-auto");$toc.style.visibility="visible";this.util.animateCSS($toc,["animate__fadeIn","animate__faster"],true);var $postMeta=document.querySelector(".post-meta");$toc.style.marginTop="".concat($postMeta.offsetTop+$postMeta.clientHeight,"px");var $tocLinkElements=$tocCore.querySelectorAll("a:first-child");var $tocLiElements=$tocCore.getElementsByTagName("li");var $headerLinkElements=document.getElementsByClassName("header-link");var headerIsFixed=document.body.dataset.headerDesktop!=="normal";var headerHeight=document.getElementById("header-desktop").offsetHeight;document.querySelector(".container").addEventListener("resize",function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px")});this._tocOnScroll=this._tocOnScroll||function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px");_this9.util.forEach($tocLinkElements,function($tocLink){$tocLink.classList.remove("active")});_this9.util.forEach($tocLiElements,function($tocLi){$tocLi.classList.remove("has-active")});var INDEX_SPACING=20+(headerIsFixed?headerHeight:0);var activeTocIndex=$headerLinkElements.length-1;for(var i=0;i<$headerLinkElements.length-1;i++){var thisTop=$headerLinkElements[i].getBoundingClientRect().top;var nextTop=$headerLinkElements[i+1].getBoundingClientRect().top;if(i==0&&thisTop>INDEX_SPACING||thisTop<=INDEX_SPACING&&nextTop>INDEX_SPACING){activeTocIndex=i;break}}if(activeTocIndex!==-1){$tocLinkElements[activeTocIndex].classList.add("active");var $parent=$tocLinkElements[activeTocIndex].parentElement;while($parent!==$tocCore){$parent.classList.add("has-active");$parent=$parent.parentElement.parentElement}}};this._tocOnScroll();this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initTocListener",value:function initTocListener(){var _document$querySelect2,_this10=this;var $toc=document.getElementById("toc-auto");var $tocContentAuto=document.getElementById("toc-content-auto");(_document$querySelect2=document.querySelector("#toc-auto>.toc-title"))===null||_document$querySelect2===void 0?void 0:_document$querySelect2.addEventListener("click",function(){var animation=["animate__faster"];var tocHidden=$toc.classList.contains("toc-hidden");animation.push(tocHidden?"animate__fadeIn":"animate__fadeOut");$tocContentAuto.classList.remove(tocHidden?"animate__fadeOut":"animate__fadeIn");_this10.util.animateCSS($tocContentAuto,animation,true);$toc.classList.toggle("toc-hidden")},false)}},{key:"initMath",value:function initMath(){if(this.config.math){renderMathInElement(document.body,this.config.math)}}},{key:"initMermaid",value:function initMermaid(){var _this11=this;this._mermaidOnSwitchTheme=this._mermaidOnSwitchTheme||function(){var $mermaidElements=document.getElementsByClassName("mermaid");if($mermaidElements.length){var _this11$config$mermai;var themes=(_this11$config$mermai=_this11.config.mermaid.themes)!==null&&_this11$config$mermai!==void 0?_this11$config$mermai:["neutral","dark"];mermaid.initialize({startOnLoad:false,theme:_this11.isDark?themes[1]:themes[0],securityLevel:"loose"});_this11.util.forEach($mermaidElements,function($mermaid){mermaid.render("svg-"+$mermaid.id,_this11.data[$mermaid.id],function(svgCode){$mermaid.innerHTML=svgCode},$mermaid)})}};this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);this._mermaidOnSwitchTheme()}},{key:"initEcharts",value:function initEcharts(){var _this12=this;if(!this.config.echarts){return}echarts.registerTheme("light",this.config.echarts.lightTheme);echarts.registerTheme("dark",this.config.echarts.darkTheme);this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){_this12._echartsArr=_this12._echartsArr||[];for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].dispose()}_this12._echartsArr=[];_this12.util.forEach(document.getElementsByClassName("echarts"),function($echarts){var chart=echarts.init($echarts,_this12.isDark?"dark":"light",{renderer:"svg"});chart.setOption(JSON.parse(_this12.data[$echarts.id]));_this12._echartsArr.push(chart)})};this.switchThemeEventSet.add(this._echartsOnSwitchTheme);this._echartsOnSwitchTheme();this._echartsOnResize=this._echartsOnResize||function(){for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].resize()}};this.resizeEventSet.add(this._echartsOnResize)}},{key:"initMapbox",value:function initMapbox(){var _this13=this;if(this.config.mapbox){mapboxgl.accessToken=this.config.mapbox.accessToken;mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);this._mapboxArr=this._mapboxArr||[];this.util.forEach(document.getElementsByClassName("mapbox"),function($mapbox){var _this13$data$$mapbox$=_this13.data[$mapbox.id],lng=_this13$data$$mapbox$.lng,lat=_this13$data$$mapbox$.lat,zoom=_this13$data$$mapbox$.zoom,lightStyle=_this13$data$$mapbox$.lightStyle,darkStyle=_this13$data$$mapbox$.darkStyle,marked=_this13$data$$mapbox$.marked,navigation=_this13$data$$mapbox$.navigation,geolocate=_this13$data$$mapbox$.geolocate,scale=_this13$data$$mapbox$.scale,fullscreen=_this13$data$$mapbox$.fullscreen;var mapbox=new mapboxgl.Map({container:$mapbox,center:[lng,lat],zoom:zoom,minZoom:0.2,style:_this13.isDark?darkStyle:lightStyle,attributionControl:false});if(marked){new mapboxgl.Marker().setLngLat([lng,lat]).addTo(mapbox)}if(navigation){mapbox.addControl(new mapboxgl.NavigationControl,"bottom-right")}if(geolocate){mapbox.addControl(new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:true},showUserLocation:true,trackUserLocation:true}),"bottom-right")}if(scale){mapbox.addControl(new mapboxgl.ScaleControl)}if(fullscreen){mapbox.addControl(new mapboxgl.FullscreenControl)}mapbox.addControl(new MapboxLanguage);_this13._mapboxArr.push(mapbox)});this._mapboxOnSwitchTheme=this._mapboxOnSwitchTheme||function(){_this13.util.forEach(_this13._mapboxArr,function(mapbox){var $mapbox=mapbox.getContainer();var _this13$data$$mapbox$2=_this13.data[$mapbox.id],lightStyle=_this13$data$$mapbox$2.lightStyle,darkStyle=_this13$data$$mapbox$2.darkStyle;mapbox.setStyle(_this13.isDark?darkStyle:lightStyle);mapbox.addControl(new MapboxLanguage)})};this.switchThemeEventSet.add(this._mapboxOnSwitchTheme)}}},{key:"initTypeit",value:function initTypeit(){var _this14=this;if(this.config.typeit){var typeitConfig=this.config.typeit;var speed=typeitConfig.speed||100;var cursorSpeed=typeitConfig.cursorSpeed||1000;var cursorChar=typeitConfig.cursorChar||"|";Object.values(typeitConfig.data).forEach(function(group){var typeone=function typeone(i){var id=group[i];var instance=new TypeIt("#".concat(id),{strings:_this14.data[id],speed:speed,lifeLike:true,cursorSpeed:cursorSpeed,cursorChar:cursorChar,waitUntilVisible:true,afterComplete:function afterComplete(){if(i===group.length-1){if(typeitConfig.duration>=0){window.setTimeout(function(){instance.destroy()},typeitConfig.duration)}return}instance.destroy();typeone(i+1)}}).go()};typeone(0)})}}},{key:"initCommentLightGallery",value:function initCommentLightGallery(comments,images){document.querySelectorAll(comments).forEach(function($content){var $imgs=$content.querySelectorAll(images+":not([lightgallery-loaded])");$imgs.forEach(function($img){$img.setAttribute("lightgallery-loaded","");var $link=document.createElement("a");$link.setAttribute("class","comment-lightgallery");$link.setAttribute("href",$img.src);$link.append($img.cloneNode());$img.replaceWith($link)});if($imgs.length){lightGallery($content,{selector:".comment-lightgallery",actualSize:false,hideBarsDelay:2000,speed:400})}})}},{key:"initComment",value:function initComment(){var _this$config$comment,_this15=this;if(!((_this$config$comment=this.config.comment)!==null&&_this$config$comment!==void 0&&_this$config$comment.enable)){return}if(document.querySelector("#comments")){var $viewCommentsBtn=document.querySelector(".view-comments");$viewCommentsBtn.classList.remove("d-none");$viewCommentsBtn.addEventListener("click",function(){_this15.util.scrollIntoView("#comments")},false)}this.config.comment.expired&&document.querySelector("#comments").remove();if(this.config.comment.artalk){if(this.config.comment.expired){return Artalk.LoadCountWidget({server:this.config.comment.artalk.server,site:this.config.comment.artalk.site,pvEl:this.config.comment.artalk.pvEl,countEl:this.config.comment.artalk.countEl})}var artalk=new Artalk(this.config.comment.artalk);artalk.setDarkMode(this.isDark);this.switchThemeEventSet.add(function(){artalk.setDarkMode(_this15.isDark)});artalk.on("comments-loaded",function(){_this15.config.comment.artalk.lightgallery&&_this15.initCommentLightGallery(".atk-comment .atk-content","img:not([atk-emoticon])")});return artalk}if(this.config.comment.gitalk){this.config.comment.gitalk.body=decodeURI(window.location.href);var gitalk=new Gitalk(this.config.comment.gitalk);gitalk.render("gitalk");return gitalk}if(this.config.comment.valine){return new Valine(this.config.comment.valine)}if(this.config.comment.waline){if(this.config.comment.expired){this.config.comment.waline.pageview&&Waline.pageviewCount({serverURL:this.config.comment.waline.serverURL,path:window.location.pathname});return}return Waline.init(this.config.comment.waline)}if(this.config.comment.utterances){var utterancesConfig=this.config.comment.utterances;var script=document.createElement("script");script.src="https://utteranc.es/client.js";script.setAttribute("repo",utterancesConfig.repo);script.setAttribute("issue-term",utterancesConfig.issueTerm);if(utterancesConfig.label)script.setAttribute("label",utterancesConfig.label);script.setAttribute("theme",this.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme);script.crossOrigin="anonymous";script.async=true;document.getElementById("utterances").appendChild(script);this._utterancesOnSwitchTheme=this._utterancesOnSwitchTheme||function(){var _document$querySelect3;var message={type:"set-theme",theme:_this15.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme};(_document$querySelect3=document.querySelector(".utterances-frame"))===null||_document$querySelect3===void 0?void 0:_document$querySelect3.contentWindow.postMessage(message,"https://utteranc.es")};this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);return}if(this.config.comment.twikoo){var twikooConfig=this.config.comment.twikoo;if(twikooConfig.lightgallery){twikooConfig.onCommentLoaded=function(){_this15.initCommentLightGallery(".tk-comments .tk-content","img:not(.tk-owo-emotion)")}}twikoo.init(twikooConfig);if(twikooConfig.commentCount){twikoo.getCommentsCount({envId:twikooConfig.envId,region:twikooConfig.region,urls:[window.location.pathname],includeReply:false}).then(function(response){var twikooCommentCount=document.getElementById("twikoo-comment-count");if(twikooCommentCount)twikooCommentCount.innerHTML=response[0].count})}return}if(this.config.comment.giscus){var giscusConfig=this.config.comment.giscus;this._giscusOnSwitchTheme=this._giscusOnSwitchTheme||function(){var _document$querySelect4;var message={setConfig:{theme:_this15.isDark?giscusConfig.darkTheme:giscusConfig.lightTheme}};(_document$querySelect4=document.querySelector(".giscus-frame"))===null||_document$querySelect4===void 0?void 0:_document$querySelect4.contentWindow.postMessage({giscus:message},"https://giscus.app")};this.switchThemeEventSet.add(this._giscusOnSwitchTheme);var _this=this;_this.giscus2parentMsg=window.addEventListener("message",function(event){var $script=document.querySelector("#giscus>script");if($script){_this._giscusOnSwitchTheme();$script.parentElement.removeChild($script)}window.removeEventListener("message",_this.giscus2parentMsg)});return}}},{key:"initCookieconsent",value:function initCookieconsent(){this.config.cookieconsent&&cookieconsent.initialise(this.config.cookieconsent)}},{key:"initSiteTime",value:function initSiteTime(){var _this16=this;if(this.config.siteTime){this.siteTime=setInterval(this.getSiteTime,500);document.addEventListener("visibilitychange",function(){if(document.hidden){return clearInterval(_this16.siteTime)}_this16.siteTime=setInterval(_this16.getSiteTime,500)},false)}}},{key:"initServiceWorker",value:function initServiceWorker(){if(this.config.enablePWA&&"serviceWorker"in navigator){navigator.serviceWorker.register("/service-worker.min.js",{scope:"/"}).then(function(registration){}).catch(function(error){console.error("error: ",error)});navigator.serviceWorker.ready.then(function(registration){})}}},{key:"initWatermark",value:function initWatermark(){var _this$config$watermar,_document$querySelect5,_document$querySelect6;((_this$config$watermar=this.config.watermark)===null||_this$config$watermar===void 0?void 0:_this$config$watermar.enable)&&new Watermark({content:this.config.watermark.content||"".concat((_document$querySelect5=(_document$querySelect6=document.querySelector("footer .fixit-icon"))===null||_document$querySelect6===void 0?void 0:_document$querySelect6.outerHTML)!==null&&_document$querySelect5!==void 0?_document$querySelect5:""," FixIt Theme"),appendTo:this.config.watermark.appendto||".wrapper>main",opacity:this.config.watermark.opacity,width:this.config.watermark.width,height:this.config.watermark.height,rowSpacing:this.config.watermark.rowspacing,colSpacing:this.config.watermark.colspacing,rotate:this.config.watermark.rotate,fontSize:this.config.watermark.fontsize,fontFamily:this.config.watermark.fontfamily})}},{key:"initPangu",value:function initPangu(){var _this$config$pangu;if(!((_this$config$pangu=this.config.pangu)!==null&&_this$config$pangu!==void 0&&_this$config$pangu.enable)){return}var selector=this.config.pangu.selector;if(selector){if(selector.startsWith("#")){pangu.spacingElementById(selector.slice(1))}else if(selector.startsWith(".")){pangu.spacingElementByClassName(selector.slice(1))}else{pangu.spacingElementByTagName(selector)}return}pangu.autoSpacingPage()}},{key:"initFixItDecryptor",value:function initFixItDecryptor(){var _this17=this,_this$config$encrypti,_this$config$encrypti2;var $tocNodes=document.querySelectorAll("#toc-auto>.d-none, #toc-static.d-none");this.decryptor=new FixItDecryptor({decrypted:function decrypted(){_this17.initTwemoji();_this17.initDetails();_this17.initLightGallery();_this17.initHighlight();_this17.initTable();_this17.initHeaderLink();_this17.initMath();_this17.initMermaid();_this17.initEcharts();_this17.initTypeit();_this17.initMapbox();_this17.util.forEach($tocNodes,function($element){$element.classList.remove("d-none")});_this17.initToc();_this17.initTocListener();_this17.initPangu()},reset:function reset(){_this17.util.forEach($tocNodes,function($element){$element.classList.add("d-none")})}});if((_this$config$encrypti=this.config.encryption)!==null&&_this$config$encrypti!==void 0&&_this$config$encrypti.shortcode){this.decryptor.addEventListener("decrypted",function(){_this17.decryptor.initShortcodes()});this.decryptor.initShortcodes()}((_this$config$encrypti2=this.config.encryption)===null||_this$config$encrypti2===void 0?void 0:_this$config$encrypti2.all)&&this.decryptor.init()}},{key:"initMDevtools",value:function initMDevtools(){var _this$config,_this18=this;var type=(_this$config=this.config)===null||_this$config===void 0?void 0:_this$config.mDevtools;if(typeof window.orientation==="undefined"){return}if(type==="vConsole"){var vConsole=new VConsole({target:".widgets",theme:this.isDark?"dark":"light"});this._vConsoleOnSwitchTheme=this._vConsoleOnSwitchTheme||function(){vConsole.setOption("theme",_this18.isDark?"dark":"light")};this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme)}if(type==="eruda"){eruda.init({defaults:{theme:this.isDark?"Dark":"Light"}});this._erudaOnSwitchTheme=this._erudaOnSwitchTheme||function(){eruda.util.evalCss.setTheme(_this18.isDark?"Dark":"Light")};this.switchThemeEventSet.add(this._erudaOnSwitchTheme)}}},{key:"initAutoMark",value:function initAutoMark(){var _this19=this,_window$localStorage3;if(!this.config.autoBookmark){return}window.addEventListener("beforeunload",function(){var _window$localStorage2;(_window$localStorage2=window.localStorage)===null||_window$localStorage2===void 0?void 0:_window$localStorage2.setItem("fixit-bookmark/#".concat(location.pathname),_this19.util.getScrollTop())});var scrollTop=Number((_window$localStorage3=window.localStorage)===null||_window$localStorage3===void 0?void 0:_window$localStorage3.getItem("fixit-bookmark/#".concat(location.pathname)));if(scrollTop&&location.hash===""){window.scrollTo({top:scrollTop,behavior:"smooth"})}}},{key:"onScroll",value:function onScroll(){var _this20=this;var $headers=[];var ACCURACY=20;var $fixedButtons=document.querySelector(".fixed-buttons");var $backToTop=document.querySelector(".back-to-top");var $readingProgressBar=document.querySelector(".reading-progress-bar");if(document.body.dataset.headerDesktop==="auto"){$headers.push(document.getElementById("header-desktop"))}if(document.body.dataset.headerMobile==="auto"){$headers.push(document.getElementById("header-mobile"))}$backToTop===null||$backToTop===void 0?void 0:$backToTop.addEventListener("click",function(){_this20.util.scrollIntoView("body")});window.addEventListener("scroll",function(event){if(_this20.disableScrollEvent){event.preventDefault();return}var $mask=document.getElementById("mask");_this20.newScrollTop=_this20.util.getScrollTop();var scroll=_this20.newScrollTop-_this20.oldScrollTop;_this20.util.forEach($headers,function($header){if(scroll>ACCURACY){$header.classList.remove("animate__fadeInDown");_this20.util.animateCSS($header,["animate__fadeOutUp"],true);$mask.click()}else if(scroll<-ACCURACY){$header.classList.remove("animate__fadeOutUp");_this20.util.animateCSS($header,["animate__fadeInDown"],true);$mask.click()}});var contentHeight=document.body.scrollHeight-window.innerHeight;var scrollPercent=Math.max(Math.min(100*Math.max(_this20.newScrollTop,0)/contentHeight,100),0);if($readingProgressBar){$readingProgressBar.style.setProperty("--progress","".concat(scrollPercent.toFixed(2),"%"))}if($fixedButtons){if(scrollPercent>1){$fixedButtons.classList.remove("d-none","animate__fadeOut");_this20.util.animateCSS($fixedButtons,["animate__fadeIn"],true)}else{$fixedButtons.classList.remove("animate__fadeIn");_this20.util.animateCSS($fixedButtons,["animate__fadeOut"],true,function(){$fixedButtons.classList.contains("animate__fadeOut")&&$fixedButtons.classList.add("d-none")})}if($backToTop){$backToTop.querySelector("span").innerText="".concat(Math.round(scrollPercent),"%")}}var _iterator2=_createForOfIteratorHelper(_this20.scrollEventSet),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _event2=_step2.value;_event2()}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}_this20.oldScrollTop=_this20.newScrollTop},false)}},{key:"onResize",value:function onResize(){var _this21=this;var resizeBefore=this.util.isMobile();window.addEventListener("resize",function(){if(!_this21._resizeTimeout){_this21._resizeTimeout=window.setTimeout(function(){_this21._resizeTimeout=null;var _iterator3=_createForOfIteratorHelper(_this21.resizeEventSet),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var event=_step3.value;event()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}_this21.initToc();_this21.initMermaid();_this21.initSearch();var isMobile=_this21.util.isMobile();if(isMobile!==resizeBefore){document.getElementById("mask").click();resizeBefore=isMobile}},100)}},false)}},{key:"onClickMask",value:function onClickMask(){var _this22=this;document.getElementById("mask").addEventListener("click",function(){if(!document.body.classList.contains("blur")){return}var _iterator4=_createForOfIteratorHelper(_this22.clickMaskEventSet),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var event=_step4.value;event()}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}_this22.disableScrollEvent=false;document.body.classList.remove("blur")},false)}},{key:"init",value:function init(){var _this23=this;try{var _this$config$encrypti3;if(this.config.encryption){this.initFixItDecryptor()}else if(!((_this$config$encrypti3=this.config.encryption)!==null&&_this$config$encrypti3!==void 0&&_this$config$encrypti3.all)){this.initTwemoji();this.initDetails();this.initLightGallery();this.initHighlight();this.initTable();this.initHeaderLink();this.initMath();this.initMermaid();this.initEcharts();this.initTypeit();this.initMapbox();this.initPangu()}this.initThemeColor();this.initSVGIcon();this.initMenu();this.initSwitchTheme();this.initSearch();this.initCookieconsent();this.initSiteTime();this.initServiceWorker();this.initWatermark();this.initMDevtools();this.initAutoMark();window.setTimeout(function(){var _this23$config$encryp;_this23.initComment();if(!((_this23$config$encryp=_this23.config.encryption)!==null&&_this23$config$encryp!==void 0&&_this23$config$encryp.all)){_this23.initToc();_this23.initTocListener()}_this23.onScroll();_this23.onResize();_this23.onClickMask()},100)}catch(err){console.error(err)}}}]);return FixIt}();var themeInit=function themeInit(){window.fixit=new FixIt;window.fixit.init()};if(document.readyState!=="loading"){themeInit()}else{document.addEventListener("DOMContentLoaded",themeInit,false)} +"use strict";function _objectDestructuringEmpty(obj){if(obj==null)throw new TypeError("Cannot destructure "+obj)}function _createForOfIteratorHelper(o,allowArrayLike){var it=typeof Symbol!=="undefined"&&o[Symbol.iterator]||o["@@iterator"];if(!it){if(Array.isArray(o)||(it=_unsupportedIterableToArray(o))||allowArrayLike&&o&&typeof o.length==="number"){if(it)o=it;var i=0;var F=function F(){};return{s:F,n:function n(){if(i>=o.length)return{done:true};return{done:false,value:o[i++]}},e:function e(_e){throw _e},f:F}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var normalCompletion=true,didErr=false,err;return{s:function s(){it=it.call(o)},n:function n(){var step=it.next();normalCompletion=step.done;return step},e:function e(_e2){didErr=true;err=_e2},f:function f(){try{if(!normalCompletion&&it.return!=null)it.return()}finally{if(didErr)throw err}}}}function _defineProperty(obj,key,value){if(key in obj){Object.defineProperty(obj,key,{value:value,enumerable:true,configurable:true,writable:true})}else{obj[key]=value}return obj}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(o,minLen){if(!o)return;if(typeof o==="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor)n=o.constructor.name;if(n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}function _iterableToArray(iter){if(typeof Symbol!=="undefined"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _arrayLikeToArray(arr,len){if(len==null||len>arr.length)len=arr.length;for(var i=0,arr2=new Array(len);i.nested-item"),function($nestedItem){$nestedItem.addEventListener("click",function(){this.parentNode.querySelector(".sub-menu").classList.toggle("open");this.querySelector(".dropdown-icon").classList.toggle("open")})})}},{key:"initSwitchTheme",value:function initSwitchTheme(){var _this5=this;this.util.forEach(document.getElementsByClassName("theme-switch"),function($themeSwitch){$themeSwitch.addEventListener("click",function(){var _window$localStorage;document.body.dataset.theme=document.body.dataset.theme==="dark"?"light":"dark";_this5.isDark=!_this5.isDark;(_window$localStorage=window.localStorage)===null||_window$localStorage===void 0?void 0:_window$localStorage.setItem("theme",_this5.isDark?"dark":"light");var _iterator=_createForOfIteratorHelper(_this5.switchThemeEventSet),_step;try{for(_iterator.s();!(_step=_iterator.n()).done;){var event=_step.value;event()}}catch(err){_iterator.e(err)}finally{_iterator.f()}},false)})}},{key:"initSearch",value:function initSearch(){var _searchConfig$maxResu,_searchConfig$snippet,_searchConfig$highlig,_searchConfig$isCaseS,_searchConfig$minMatc,_searchConfig$findAll,_searchConfig$locatio,_searchConfig$thresho,_searchConfig$distanc,_searchConfig$ignoreL,_searchConfig$useExte,_searchConfig$ignoreF,_this6=this;var searchConfig=this.config.search;var isMobile=this.util.isMobile();if(!searchConfig||isMobile&&this._searchMobileOnce||!isMobile&&this._searchDesktopOnce){return}var maxResultLength=(_searchConfig$maxResu=searchConfig.maxResultLength)!==null&&_searchConfig$maxResu!==void 0?_searchConfig$maxResu:10;var snippetLength=(_searchConfig$snippet=searchConfig.snippetLength)!==null&&_searchConfig$snippet!==void 0?_searchConfig$snippet:50;var highlightTag=(_searchConfig$highlig=searchConfig.highlightTag)!==null&&_searchConfig$highlig!==void 0?_searchConfig$highlig:"em";var isCaseSensitive=(_searchConfig$isCaseS=searchConfig.isCaseSensitive)!==null&&_searchConfig$isCaseS!==void 0?_searchConfig$isCaseS:false;var minMatchCharLength=(_searchConfig$minMatc=searchConfig.minMatchCharLength)!==null&&_searchConfig$minMatc!==void 0?_searchConfig$minMatc:1;var findAllMatches=(_searchConfig$findAll=searchConfig.findAllMatches)!==null&&_searchConfig$findAll!==void 0?_searchConfig$findAll:false;var location=(_searchConfig$locatio=searchConfig.location)!==null&&_searchConfig$locatio!==void 0?_searchConfig$locatio:0;var threshold=(_searchConfig$thresho=searchConfig.threshold)!==null&&_searchConfig$thresho!==void 0?_searchConfig$thresho:0.3;var distance=(_searchConfig$distanc=searchConfig.distance)!==null&&_searchConfig$distanc!==void 0?_searchConfig$distanc:100;var ignoreLocation=(_searchConfig$ignoreL=searchConfig.ignoreLocation)!==null&&_searchConfig$ignoreL!==void 0?_searchConfig$ignoreL:false;var useExtendedSearch=(_searchConfig$useExte=searchConfig.useExtendedSearch)!==null&&_searchConfig$useExte!==void 0?_searchConfig$useExte:false;var ignoreFieldNorm=(_searchConfig$ignoreF=searchConfig.ignoreFieldNorm)!==null&&_searchConfig$ignoreF!==void 0?_searchConfig$ignoreF:false;var suffix=isMobile?"mobile":"desktop";var $header=document.getElementById("header-".concat(suffix));var $searchInput=document.getElementById("search-input-".concat(suffix));var $searchToggle=document.getElementById("search-toggle-".concat(suffix));var $searchLoading=document.getElementById("search-loading-".concat(suffix));var $searchClear=document.getElementById("search-clear-".concat(suffix));if(isMobile){this._searchMobileOnce=true;$searchInput.addEventListener("focus",function(){_this6.disableScrollEvent=true;document.body.classList.add("blur");$header.classList.add("open")},false);document.getElementById("search-cancel-mobile").addEventListener("click",function(){_this6.disableScrollEvent=false;$header.classList.remove("open");document.body.classList.remove("blur");document.getElementById("menu-toggle-mobile").classList.remove("active");document.getElementById("menu-mobile").classList.remove("active");$searchLoading.style.display="none";$searchClear.style.display="none";_this6._searchMobile&&_this6._searchMobile.autocomplete.setVal("")},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this6._searchMobile&&_this6._searchMobile.autocomplete.setVal("")},false);this._searchMobileOnClickMask=this._searchMobileOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this6._searchMobile&&_this6._searchMobile.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchMobileOnClickMask)}else{this._searchDesktopOnce=true;$searchToggle.addEventListener("click",function(){document.body.classList.add("blur");$header.classList.add("open");$searchInput.focus()},false);$searchClear.addEventListener("click",function(){$searchClear.style.display="none";_this6._searchDesktop&&_this6._searchDesktop.autocomplete.setVal("")},false);this._searchDesktopOnClickMask=this._searchDesktopOnClickMask||function(){$header.classList.remove("open");$searchLoading.style.display="none";$searchClear.style.display="none";_this6._searchDesktop&&_this6._searchDesktop.autocomplete.setVal("")};this.clickMaskEventSet.add(this._searchDesktopOnClickMask)}$searchInput.addEventListener("input",function(){if($searchInput.value==="")$searchClear.style.display="none";else $searchClear.style.display="inline"},false);var initAutosearch=function initAutosearch(){var autosearch=autocomplete("#search-input-".concat(suffix),{hint:false,autoselect:true,dropdownMenuContainer:"#search-dropdown-".concat(suffix),clearOnSelected:true,cssClasses:{noPrefix:true},debug:true},{name:"search",source:function source(query,callback){$searchLoading.style.display="inline";$searchClear.style.display="none";var finish=function finish(results){$searchLoading.style.display="none";$searchClear.style.display="inline";callback(results)};if(searchConfig.type==="lunr"){var search=function search(){if(lunr.queryHandler){query=lunr.queryHandler(query)}var results={};_this6._index.search(query).forEach(function(_ref){var ref=_ref.ref,metadata=_ref.matchData.metadata;var matchData=_this6._indexData[ref];var uri=matchData.uri,title=matchData.title,context=matchData.content;if(results[uri]){return}var position=0;Object.values(metadata).forEach(function(_ref2){var content=_ref2.content;if(content){var matchPosition=content.position[0][0];if(matchPosition0){position+=context.substr(position,20).lastIndexOf(" ")+1;context="..."+context.substr(position,snippetLength)}else{context=context.substr(0,snippetLength)}Object.keys(metadata).forEach(function(key){title=title.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"));context=context.replace(new RegExp("(".concat(key,")"),"gi"),"<".concat(highlightTag,">$1"))});results[uri]={uri:uri,title:title,date:matchData.date,context:context}});return Object.values(results).slice(0,maxResultLength)};if(!_this6._index){fetch(searchConfig.lunrIndexURL).then(function(response){return response.json()}).then(function(data){var indexData={};_this6._index=lunr(function(){var _this7=this;if(searchConfig.lunrLanguageCode)this.use(lunr[searchConfig.lunrLanguageCode]);this.ref("objectID");this.field("title",{boost:50});this.field("tags",{boost:20});this.field("categories",{boost:20});this.field("content",{boost:10});this.metadataWhitelist=["position"];data.forEach(function(record){indexData[record.objectID]=record;_this7.add(record)})});_this6._indexData=indexData;finish(search())}).catch(function(err){console.error(err);finish([])})}else finish(search())}else if(searchConfig.type==="algolia"){_this6._algoliaIndex=_this6._algoliaIndex||algoliasearch(searchConfig.algoliaAppID,searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);_this6._algoliaIndex.search(query,{offset:0,length:maxResultLength*8,attributesToHighlight:["title"],attributesToSnippet:["content:".concat(snippetLength)],highlightPreTag:"<".concat(highlightTag,">"),highlightPostTag:"")}).then(function(_ref3){var hits=_ref3.hits;var results={};hits.forEach(function(_ref4){var uri=_ref4.uri,date=_ref4.date,title=_ref4._highlightResult.title,content=_ref4._snippetResult.content;if(results[uri]&&results[uri].context.length>content.value){return}results[uri]={uri:uri,title:title.value,date:date,context:content.value}});finish(Object.values(results).slice(0,maxResultLength))}).catch(function(err){console.error(err);finish([])})}else if(searchConfig.type==="fuse"){var _search=function _search(){var results={};window._index.search(query).forEach(function(_ref5){var item=_ref5.item,refIndex=_ref5.refIndex,matches=_ref5.matches;var title=item.title;var content=item.content;matches.forEach(function(_ref6){var indices=_ref6.indices,value=_ref6.value,key=_ref6.key;if(key==="content"){var offset=0;for(var i=0;i")+substr+"");content=content.substring(0,indices[i][0]+offset)+tag+content.substring(indices[i][1]+1+offset,content.length);offset+=highlightTag.length*2+5}}else if(key==="title"){var _offset=0;for(var _i=0;_i")+_substr+"");title=title.substring(0,indices[_i][0]+_offset)+_tag+title.substring(indices[_i][1]+1+_offset,content.length);_offset+=highlightTag.length*2+5}}});results[item.uri]={uri:item.uri,title:title,date:item.date,context:content}});return Object.values(results).slice(0,maxResultLength)};if(!window._index){fetch(searchConfig.fuseIndexURL).then(function(response){return response.json()}).then(function(data){var options={isCaseSensitive:isCaseSensitive,findAllMatches:findAllMatches,minMatchCharLength:minMatchCharLength,location:location,threshold:threshold,distance:distance,ignoreLocation:ignoreLocation,useExtendedSearch:useExtendedSearch,ignoreFieldNorm:ignoreFieldNorm,includeScore:false,shouldSort:true,includeMatches:true,keys:["content","title"]};window._index=new Fuse(data,options);finish(_search())}).catch(function(err){console.error(err);finish([])})}else finish(_search())}},templates:{suggestion:function suggestion(_ref7){var title=_ref7.title,date=_ref7.date,context=_ref7.context;return"
".concat(title,"").concat(date,"
").concat(context,"
")},empty:function empty(_ref8){var query=_ref8.query;return"
".concat(searchConfig.noResultsFound,": \"").concat(query,"\"
")},footer:function footer(_ref9){_objectDestructuringEmpty(_ref9);var _ref10=searchConfig.type==="algolia"?{searchType:"algolia",icon:"",href:"https://www.algolia.com/"}:searchConfig.type==="lunr"?{searchType:"Lunr.js",icon:"",href:"https://lunrjs.com/"}:{searchType:"Fuse.js",icon:"",href:"https://fusejs.io/"},searchType=_ref10.searchType,icon=_ref10.icon,href=_ref10.href;return"")}}});autosearch.on("autocomplete:selected",function(_event,suggestion,_dataset,_context){window.location.assign(suggestion.uri)});if(isMobile){_this6._searchMobile=autosearch}else{_this6._searchDesktop=autosearch}};if(searchConfig.lunrSegmentitURL&&!document.getElementById("lunr-segmentit")){var script=document.createElement("script");script.id="lunr-segmentit";script.src=searchConfig.lunrSegmentitURL;script.async=true;if(script.readyState){script.onreadystatechange=function(){if(script.readyState=="loaded"||script.readyState=="complete"){script.onreadystatechange=null;initAutosearch()}}}else{script.onload=function(){initAutosearch()}}document.body.appendChild(script)}else{initAutosearch()}}},{key:"initDetails",value:function initDetails(){this.util.forEach(document.getElementsByClassName("details"),function($details){var $summary=$details.querySelector(".details-summary");$summary.addEventListener("click",function(){$details.classList.toggle("open")},false)})}},{key:"initLightGallery",value:function initLightGallery(){if(this.config.lightgallery){lightGallery(document.getElementById("content"),{plugins:[lgThumbnail,lgZoom],selector:".lightgallery",speed:400,hideBarsDelay:2000,allowMediaOverlap:true,exThumbImage:"data-thumbnail",toggleThumb:true,thumbWidth:80,thumbHeight:"60px",actualSize:false,showZoomInOutIcons:true,licenseKey:"none"})}}},{key:"initHighlight",value:function initHighlight(){var _this8=this;this.util.forEach(document.querySelectorAll(".highlight > pre.chroma"),function($preChroma){var $chroma=document.createElement("div");$chroma.className=$preChroma.className;var $table=document.createElement("table");$chroma.appendChild($table);var $tbody=document.createElement("tbody");$table.appendChild($tbody);var $tr=document.createElement("tr");$tbody.appendChild($tr);var $td=document.createElement("td");$tr.appendChild($td);$preChroma.parentElement.replaceChild($chroma,$preChroma);$td.appendChild($preChroma)});this.util.forEach(document.querySelectorAll(".highlight > .chroma"),function($chroma){var $codeElements=$chroma.querySelectorAll("pre.chroma > code");if($codeElements.length){var $code=$codeElements[$codeElements.length-1];var $header=document.createElement("div");$header.className="code-header "+$code.className.toLowerCase();var $title=document.createElement("span");$title.classList.add("code-title");$title.insertAdjacentHTML("afterbegin","");$title.addEventListener("click",function(){$chroma.classList.toggle("open")},false);$header.appendChild($title);var $ellipses=document.createElement("span");$ellipses.insertAdjacentHTML("afterbegin","");$ellipses.classList.add("ellipses");$ellipses.addEventListener("click",function(){$chroma.classList.add("open")},false);$header.appendChild($ellipses);if(_this8.config.code.editable){var $edit=document.createElement("span");$edit.classList.add("edit");$edit.insertAdjacentHTML("afterbegin",""));$edit.addEventListener("click",function(){var $iconKey=$edit.querySelector(".fa-key");var $iconLock=$edit.querySelector(".fa-lock");var $preChromas=$edit.parentElement.parentElement.querySelectorAll("pre.chroma");var $preChroma=$preChromas.length===2?$preChromas[1]:$preChromas[0];if($iconKey){$iconKey.classList.add("fa-lock");$iconKey.classList.remove("fa-key");$iconKey.title=_this8.config.code.editLockTitle;$preChroma.setAttribute("contenteditable",true);$preChroma.focus()}else{$iconLock.classList.add("fa-key");$iconLock.classList.remove("fa-lock");$iconLock.title=_this8.config.code.editUnLockTitle;$preChroma.setAttribute("contenteditable",false);$preChroma.blur()}},false);$header.appendChild($edit)}if(_this8.config.code.copyTitle){var $copy=document.createElement("span");$copy.insertAdjacentHTML("afterbegin","");$copy.classList.add("copy");var code=$code.innerText.trim();if(_this8.config.code.maxShownLines<0||code.split("\n").length<_this8.config.code.maxShownLines+2){$chroma.classList.add("open")}$copy.title=_this8.config.code.copyTitle;$copy.addEventListener("click",function(){navigator.clipboard.writeText(code).then(function(){_this8.util.animateCSS($code,"animate__flash")},function(){console.error("Clipboard write failed!","Your browser does not support clipboard API!")})},false);$header.appendChild($copy)}$chroma.insertBefore($header,$chroma.firstChild)}})}},{key:"initTable",value:function initTable(){this.util.forEach(document.querySelectorAll(".content table"),function($table){var $wrapper=document.createElement("div");$wrapper.className="table-wrapper";$table.parentElement.replaceChild($wrapper,$table);$wrapper.appendChild($table)})}},{key:"initHeaderLink",value:function initHeaderLink(){for(var num=1;num<=6;num++){this.util.forEach(document.querySelectorAll(".single .content > h"+num),function($header){$header.classList.add("header-link");$header.insertAdjacentHTML("afterbegin",""))})}}},{key:"initToc",value:function initToc(){var _this9=this;var $tocCore=document.getElementById("TableOfContents");if($tocCore===null){return}if(typeof APlayer==="function"){var $newTocCore=$tocCore.cloneNode(true);$tocCore.parentElement.replaceChild($newTocCore,$tocCore);$tocCore=$newTocCore}if(document.getElementById("toc-static").dataset.kept===true||this.util.isTocStatic()){var $tocContentStatic=document.getElementById("toc-content-static");if($tocCore.parentElement!==$tocContentStatic){$tocCore.parentElement.removeChild($tocCore);$tocContentStatic.appendChild($tocCore)}this._tocOnScroll&&this.scrollEventSet.delete(this._tocOnScroll)}else{var $tocContentAuto=document.getElementById("toc-content-auto");if($tocCore.parentElement!==$tocContentAuto){$tocCore.parentElement.removeChild($tocCore);$tocContentAuto.appendChild($tocCore)}var $toc=document.getElementById("toc-auto");$toc.style.visibility="visible";this.util.animateCSS($toc,["animate__fadeIn","animate__faster"],true);var $postMeta=document.querySelector(".post-meta");$toc.style.marginTop="".concat($postMeta.offsetTop+$postMeta.clientHeight,"px");var $tocLinkElements=$tocCore.querySelectorAll("a:first-child");var $tocLiElements=$tocCore.getElementsByTagName("li");var $headerLinkElements=document.getElementsByClassName("header-link");var headerIsFixed=document.body.dataset.headerDesktop!=="normal";var headerHeight=document.getElementById("header-desktop").offsetHeight;document.querySelector(".container").addEventListener("resize",function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px")});this._tocOnScroll=this._tocOnScroll||function(){$toc.style.marginBottom="".concat(document.querySelector(".container").clientHeight-document.querySelector(".post-footer").offsetTop,"px");_this9.util.forEach($tocLinkElements,function($tocLink){$tocLink.classList.remove("active")});_this9.util.forEach($tocLiElements,function($tocLi){$tocLi.classList.remove("has-active")});var INDEX_SPACING=20+(headerIsFixed?headerHeight:0);var activeTocIndex=$headerLinkElements.length-1;for(var i=0;i<$headerLinkElements.length-1;i++){var thisTop=$headerLinkElements[i].getBoundingClientRect().top;var nextTop=$headerLinkElements[i+1].getBoundingClientRect().top;if(i==0&&thisTop>INDEX_SPACING||thisTop<=INDEX_SPACING&&nextTop>INDEX_SPACING){activeTocIndex=i;break}}if(activeTocIndex!==-1){$tocLinkElements[activeTocIndex].classList.add("active");var $parent=$tocLinkElements[activeTocIndex].parentElement;while($parent!==$tocCore){$parent.classList.add("has-active");$parent=$parent.parentElement.parentElement}}};this._tocOnScroll();this.scrollEventSet.add(this._tocOnScroll)}}},{key:"initTocListener",value:function initTocListener(){var _document$querySelect2,_this10=this;var $toc=document.getElementById("toc-auto");var $tocContentAuto=document.getElementById("toc-content-auto");(_document$querySelect2=document.querySelector("#toc-auto>.toc-title"))===null||_document$querySelect2===void 0?void 0:_document$querySelect2.addEventListener("click",function(){var animation=["animate__faster"];var tocHidden=$toc.classList.contains("toc-hidden");animation.push(tocHidden?"animate__fadeIn":"animate__fadeOut");$tocContentAuto.classList.remove(tocHidden?"animate__fadeOut":"animate__fadeIn");_this10.util.animateCSS($tocContentAuto,animation,true);$toc.classList.toggle("toc-hidden")},false)}},{key:"initMath",value:function initMath(){if(this.config.math){renderMathInElement(document.body,this.config.math)}}},{key:"initMermaid",value:function initMermaid(){var _this11=this;this._mermaidOnSwitchTheme=this._mermaidOnSwitchTheme||function(){var $mermaidElements=document.getElementsByClassName("mermaid");if($mermaidElements.length){var _this11$config$mermai;var themes=(_this11$config$mermai=_this11.config.mermaid.themes)!==null&&_this11$config$mermai!==void 0?_this11$config$mermai:["neutral","dark"];mermaid.initialize({startOnLoad:false,theme:_this11.isDark?themes[1]:themes[0],securityLevel:"loose"});_this11.util.forEach($mermaidElements,function($mermaid){mermaid.render("svg-"+$mermaid.id,_this11.data[$mermaid.id],function(svgCode){$mermaid.innerHTML=svgCode},$mermaid)})}};this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);this._mermaidOnSwitchTheme()}},{key:"initEcharts",value:function initEcharts(){var _this12=this;if(!this.config.echarts){return}echarts.registerTheme("light",this.config.echarts.lightTheme);echarts.registerTheme("dark",this.config.echarts.darkTheme);this._echartsOnSwitchTheme=this._echartsOnSwitchTheme||function(){_this12._echartsArr=_this12._echartsArr||[];for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].dispose()}_this12._echartsArr=[];_this12.util.forEach(document.getElementsByClassName("echarts"),function($echarts){var chart=echarts.init($echarts,_this12.isDark?"dark":"light",{renderer:"svg"});chart.setOption(JSON.parse(_this12.data[$echarts.id]));_this12._echartsArr.push(chart)})};this.switchThemeEventSet.add(this._echartsOnSwitchTheme);this._echartsOnSwitchTheme();this._echartsOnResize=this._echartsOnResize||function(){for(var i=0;i<_this12._echartsArr.length;i++){_this12._echartsArr[i].resize()}};this.resizeEventSet.add(this._echartsOnResize)}},{key:"initMapbox",value:function initMapbox(){var _this13=this;if(this.config.mapbox){mapboxgl.accessToken=this.config.mapbox.accessToken;mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);this._mapboxArr=this._mapboxArr||[];this.util.forEach(document.getElementsByClassName("mapbox"),function($mapbox){var _this13$data$$mapbox$=_this13.data[$mapbox.id],lng=_this13$data$$mapbox$.lng,lat=_this13$data$$mapbox$.lat,zoom=_this13$data$$mapbox$.zoom,lightStyle=_this13$data$$mapbox$.lightStyle,darkStyle=_this13$data$$mapbox$.darkStyle,marked=_this13$data$$mapbox$.marked,navigation=_this13$data$$mapbox$.navigation,geolocate=_this13$data$$mapbox$.geolocate,scale=_this13$data$$mapbox$.scale,fullscreen=_this13$data$$mapbox$.fullscreen;var mapbox=new mapboxgl.Map({container:$mapbox,center:[lng,lat],zoom:zoom,minZoom:0.2,style:_this13.isDark?darkStyle:lightStyle,attributionControl:false});if(marked){new mapboxgl.Marker().setLngLat([lng,lat]).addTo(mapbox)}if(navigation){mapbox.addControl(new mapboxgl.NavigationControl,"bottom-right")}if(geolocate){mapbox.addControl(new mapboxgl.GeolocateControl({positionOptions:{enableHighAccuracy:true},showUserLocation:true,trackUserLocation:true}),"bottom-right")}if(scale){mapbox.addControl(new mapboxgl.ScaleControl)}if(fullscreen){mapbox.addControl(new mapboxgl.FullscreenControl)}mapbox.addControl(new MapboxLanguage);_this13._mapboxArr.push(mapbox)});this._mapboxOnSwitchTheme=this._mapboxOnSwitchTheme||function(){_this13.util.forEach(_this13._mapboxArr,function(mapbox){var $mapbox=mapbox.getContainer();var _this13$data$$mapbox$2=_this13.data[$mapbox.id],lightStyle=_this13$data$$mapbox$2.lightStyle,darkStyle=_this13$data$$mapbox$2.darkStyle;mapbox.setStyle(_this13.isDark?darkStyle:lightStyle);mapbox.addControl(new MapboxLanguage)})};this.switchThemeEventSet.add(this._mapboxOnSwitchTheme)}}},{key:"initTypeit",value:function initTypeit(){var _this14=this;if(this.config.typeit){var typeitConfig=this.config.typeit;var speed=typeitConfig.speed||100;var cursorSpeed=typeitConfig.cursorSpeed||1000;var cursorChar=typeitConfig.cursorChar||"|";Object.values(typeitConfig.data).forEach(function(group){var typeone=function typeone(i){var id=group[i];var instance=new TypeIt("#".concat(id),{strings:_this14.data[id],speed:speed,lifeLike:true,cursorSpeed:cursorSpeed,cursorChar:cursorChar,waitUntilVisible:true,afterComplete:function afterComplete(){if(i===group.length-1){if(typeitConfig.duration>=0){window.setTimeout(function(){instance.destroy()},typeitConfig.duration)}return}instance.destroy();typeone(i+1)}}).go()};typeone(0)})}}},{key:"initCommentLightGallery",value:function initCommentLightGallery(comments,images){document.querySelectorAll(comments).forEach(function($content){var $imgs=$content.querySelectorAll(images+":not([lightgallery-loaded])");$imgs.forEach(function($img){$img.setAttribute("lightgallery-loaded","");var $link=document.createElement("a");$link.setAttribute("class","comment-lightgallery");$link.setAttribute("href",$img.src);$link.append($img.cloneNode());$img.replaceWith($link)});if($imgs.length){lightGallery($content,{selector:".comment-lightgallery",actualSize:false,hideBarsDelay:2000,speed:400})}})}},{key:"initComment",value:function initComment(){var _this$config$comment,_this15=this;if(!((_this$config$comment=this.config.comment)!==null&&_this$config$comment!==void 0&&_this$config$comment.enable)){return}if(document.querySelector("#comments")){var $viewCommentsBtn=document.querySelector(".view-comments");$viewCommentsBtn.classList.remove("d-none");$viewCommentsBtn.addEventListener("click",function(){_this15.util.scrollIntoView("#comments")},false)}this.config.comment.expired&&document.querySelector("#comments").remove();if(this.config.comment.artalk){if(this.config.comment.expired){return Artalk.LoadCountWidget({server:this.config.comment.artalk.server,site:this.config.comment.artalk.site,pvEl:this.config.comment.artalk.pvEl,countEl:this.config.comment.artalk.countEl})}var artalk=new Artalk(this.config.comment.artalk);artalk.setDarkMode(this.isDark);this.switchThemeEventSet.add(function(){artalk.setDarkMode(_this15.isDark)});artalk.on("comments-loaded",function(){_this15.config.comment.artalk.lightgallery&&_this15.initCommentLightGallery(".atk-comment .atk-content","img:not([atk-emoticon])")});return artalk}if(this.config.comment.gitalk){this.config.comment.gitalk.body=decodeURI(window.location.href);var gitalk=new Gitalk(this.config.comment.gitalk);gitalk.render("gitalk");return gitalk}if(this.config.comment.valine){return new Valine(this.config.comment.valine)}if(this.config.comment.waline){if(this.config.comment.expired){this.config.comment.waline.pageview&&Waline.pageviewCount({serverURL:this.config.comment.waline.serverURL,path:window.location.pathname});return}return Waline.init(this.config.comment.waline)}if(this.config.comment.utterances){var utterancesConfig=this.config.comment.utterances;var script=document.createElement("script");script.src="https://utteranc.es/client.js";script.setAttribute("repo",utterancesConfig.repo);script.setAttribute("issue-term",utterancesConfig.issueTerm);if(utterancesConfig.label)script.setAttribute("label",utterancesConfig.label);script.setAttribute("theme",this.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme);script.crossOrigin="anonymous";script.async=true;document.getElementById("utterances").appendChild(script);this._utterancesOnSwitchTheme=this._utterancesOnSwitchTheme||function(){var _document$querySelect3;var message={type:"set-theme",theme:_this15.isDark?utterancesConfig.darkTheme:utterancesConfig.lightTheme};(_document$querySelect3=document.querySelector(".utterances-frame"))===null||_document$querySelect3===void 0?void 0:_document$querySelect3.contentWindow.postMessage(message,"https://utteranc.es")};this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);return}if(this.config.comment.twikoo){var twikooConfig=this.config.comment.twikoo;if(twikooConfig.lightgallery){twikooConfig.onCommentLoaded=function(){_this15.initCommentLightGallery(".tk-comments .tk-content","img:not(.tk-owo-emotion)")}}twikoo.init(twikooConfig);if(twikooConfig.commentCount){twikoo.getCommentsCount({envId:twikooConfig.envId,region:twikooConfig.region,urls:[window.location.pathname],includeReply:false}).then(function(response){var twikooCommentCount=document.getElementById("twikoo-comment-count");if(twikooCommentCount)twikooCommentCount.innerHTML=response[0].count})}return}if(this.config.comment.giscus){var giscusConfig=this.config.comment.giscus;this._giscusOnSwitchTheme=this._giscusOnSwitchTheme||function(){var _document$querySelect4;var message={setConfig:{theme:_this15.isDark?giscusConfig.darkTheme:giscusConfig.lightTheme}};(_document$querySelect4=document.querySelector(".giscus-frame"))===null||_document$querySelect4===void 0?void 0:_document$querySelect4.contentWindow.postMessage({giscus:message},"https://giscus.app")};this.switchThemeEventSet.add(this._giscusOnSwitchTheme);var _this=this;_this.giscus2parentMsg=window.addEventListener("message",function(event){var $script=document.querySelector("#giscus>script");if($script){_this._giscusOnSwitchTheme();$script.parentElement.removeChild($script)}window.removeEventListener("message",_this.giscus2parentMsg)});return}}},{key:"initCookieconsent",value:function initCookieconsent(){this.config.cookieconsent&&cookieconsent.initialise(this.config.cookieconsent)}},{key:"initSiteTime",value:function initSiteTime(){var _this16=this;if(this.config.siteTime){this.siteTime=setInterval(this.getSiteTime,500);document.addEventListener("visibilitychange",function(){if(document.hidden){return clearInterval(_this16.siteTime)}_this16.siteTime=setInterval(_this16.getSiteTime,500)},false)}}},{key:"initServiceWorker",value:function initServiceWorker(){if(this.config.enablePWA&&"serviceWorker"in navigator){navigator.serviceWorker.register("/service-worker.min.js",{scope:"/"}).then(function(registration){}).catch(function(error){console.error("error: ",error)});navigator.serviceWorker.ready.then(function(registration){})}}},{key:"initWatermark",value:function initWatermark(){var _this$config$watermar,_document$querySelect5,_document$querySelect6;((_this$config$watermar=this.config.watermark)===null||_this$config$watermar===void 0?void 0:_this$config$watermar.enable)&&new Watermark({content:this.config.watermark.content||"".concat((_document$querySelect5=(_document$querySelect6=document.querySelector("footer .fixit-icon"))===null||_document$querySelect6===void 0?void 0:_document$querySelect6.outerHTML)!==null&&_document$querySelect5!==void 0?_document$querySelect5:""," FixIt Theme"),appendTo:this.config.watermark.appendto||".wrapper>main",opacity:this.config.watermark.opacity,width:this.config.watermark.width,height:this.config.watermark.height,rowSpacing:this.config.watermark.rowspacing,colSpacing:this.config.watermark.colspacing,rotate:this.config.watermark.rotate,fontSize:this.config.watermark.fontsize,fontFamily:this.config.watermark.fontfamily})}},{key:"initPangu",value:function initPangu(){var _this$config$pangu;if(!((_this$config$pangu=this.config.pangu)!==null&&_this$config$pangu!==void 0&&_this$config$pangu.enable)){return}var selector=this.config.pangu.selector;if(selector){if(selector.startsWith("#")){pangu.spacingElementById(selector.slice(1))}else if(selector.startsWith(".")){pangu.spacingElementByClassName(selector.slice(1))}else{pangu.spacingElementByTagName(selector)}return}pangu.autoSpacingPage()}},{key:"initFixItDecryptor",value:function initFixItDecryptor(){var _this17=this,_this$config$encrypti,_this$config$encrypti2;var $tocNodes=document.querySelectorAll("#toc-auto>.d-none, #toc-static.d-none");this.decryptor=new FixItDecryptor({decrypted:function decrypted(){_this17.initTwemoji();_this17.initDetails();_this17.initLightGallery();_this17.initHighlight();_this17.initTable();_this17.initHeaderLink();_this17.initMath();_this17.initMermaid();_this17.initEcharts();_this17.initTypeit();_this17.initMapbox();_this17.util.forEach($tocNodes,function($element){$element.classList.remove("d-none")});_this17.initToc();_this17.initTocListener();_this17.initPangu()},reset:function reset(){_this17.util.forEach($tocNodes,function($element){$element.classList.add("d-none")})}});if((_this$config$encrypti=this.config.encryption)!==null&&_this$config$encrypti!==void 0&&_this$config$encrypti.shortcode){this.decryptor.addEventListener("decrypted",function(){_this17.decryptor.initShortcodes()});this.decryptor.initShortcodes()}((_this$config$encrypti2=this.config.encryption)===null||_this$config$encrypti2===void 0?void 0:_this$config$encrypti2.all)&&this.decryptor.init()}},{key:"initMDevtools",value:function initMDevtools(){var _this$config,_this18=this;var type=(_this$config=this.config)===null||_this$config===void 0?void 0:_this$config.mDevtools;if(typeof window.orientation==="undefined"){return}if(type==="vConsole"){var vConsole=new VConsole({target:".widgets",theme:this.isDark?"dark":"light"});this._vConsoleOnSwitchTheme=this._vConsoleOnSwitchTheme||function(){vConsole.setOption("theme",_this18.isDark?"dark":"light")};this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme)}if(type==="eruda"){eruda.init({defaults:{theme:this.isDark?"Dark":"Light"}});this._erudaOnSwitchTheme=this._erudaOnSwitchTheme||function(){eruda.util.evalCss.setTheme(_this18.isDark?"Dark":"Light")};this.switchThemeEventSet.add(this._erudaOnSwitchTheme)}}},{key:"initAutoMark",value:function initAutoMark(){var _this19=this,_window$localStorage3;if(!this.config.autoBookmark){return}window.addEventListener("beforeunload",function(){var _window$localStorage2;(_window$localStorage2=window.localStorage)===null||_window$localStorage2===void 0?void 0:_window$localStorage2.setItem("fixit-bookmark/#".concat(location.pathname),_this19.util.getScrollTop())});var scrollTop=Number((_window$localStorage3=window.localStorage)===null||_window$localStorage3===void 0?void 0:_window$localStorage3.getItem("fixit-bookmark/#".concat(location.pathname)));if(scrollTop&&location.hash===""){window.scrollTo({top:scrollTop,behavior:"smooth"})}}},{key:"onScroll",value:function onScroll(){var _this20=this;var $headers=[];var ACCURACY=20;var $fixedButtons=document.querySelector(".fixed-buttons");var $backToTop=document.querySelector(".back-to-top");var $readingProgressBar=document.querySelector(".reading-progress-bar");if(document.body.dataset.headerDesktop==="auto"){$headers.push(document.getElementById("header-desktop"))}if(document.body.dataset.headerMobile==="auto"){$headers.push(document.getElementById("header-mobile"))}$backToTop===null||$backToTop===void 0?void 0:$backToTop.addEventListener("click",function(){_this20.util.scrollIntoView("body")});window.addEventListener("scroll",function(event){if(_this20.disableScrollEvent){event.preventDefault();return}var $mask=document.getElementById("mask");_this20.newScrollTop=_this20.util.getScrollTop();var scroll=_this20.newScrollTop-_this20.oldScrollTop;_this20.util.forEach($headers,function($header){if(scroll>ACCURACY){$header.classList.remove("animate__fadeInDown");_this20.util.animateCSS($header,["animate__fadeOutUp"],true);$mask.click()}else if(scroll<-ACCURACY){$header.classList.remove("animate__fadeOutUp");_this20.util.animateCSS($header,["animate__fadeInDown"],true);$mask.click()}});var contentHeight=document.body.scrollHeight-window.innerHeight;var scrollPercent=Math.max(Math.min(100*Math.max(_this20.newScrollTop,0)/contentHeight,100),0);if($readingProgressBar){$readingProgressBar.style.setProperty("--progress","".concat(scrollPercent.toFixed(2),"%"))}if($fixedButtons){if(scrollPercent>1){$fixedButtons.classList.remove("d-none","animate__fadeOut");_this20.util.animateCSS($fixedButtons,["animate__fadeIn"],true)}else{$fixedButtons.classList.remove("animate__fadeIn");_this20.util.animateCSS($fixedButtons,["animate__fadeOut"],true,function(){$fixedButtons.classList.contains("animate__fadeOut")&&$fixedButtons.classList.add("d-none")})}if($backToTop){$backToTop.querySelector("span").innerText="".concat(Math.round(scrollPercent),"%")}}var _iterator2=_createForOfIteratorHelper(_this20.scrollEventSet),_step2;try{for(_iterator2.s();!(_step2=_iterator2.n()).done;){var _event2=_step2.value;_event2()}}catch(err){_iterator2.e(err)}finally{_iterator2.f()}_this20.oldScrollTop=_this20.newScrollTop},false)}},{key:"onResize",value:function onResize(){var _this21=this;var resizeBefore=this.util.isMobile();window.addEventListener("resize",function(){if(!_this21._resizeTimeout){_this21._resizeTimeout=window.setTimeout(function(){_this21._resizeTimeout=null;var _iterator3=_createForOfIteratorHelper(_this21.resizeEventSet),_step3;try{for(_iterator3.s();!(_step3=_iterator3.n()).done;){var event=_step3.value;event()}}catch(err){_iterator3.e(err)}finally{_iterator3.f()}_this21.initToc();_this21.initMermaid();_this21.initSearch();var isMobile=_this21.util.isMobile();if(isMobile!==resizeBefore){document.getElementById("mask").click();resizeBefore=isMobile}},100)}},false)}},{key:"onClickMask",value:function onClickMask(){var _this22=this;document.getElementById("mask").addEventListener("click",function(){if(!document.body.classList.contains("blur")){return}var _iterator4=_createForOfIteratorHelper(_this22.clickMaskEventSet),_step4;try{for(_iterator4.s();!(_step4=_iterator4.n()).done;){var event=_step4.value;event()}}catch(err){_iterator4.e(err)}finally{_iterator4.f()}_this22.disableScrollEvent=false;document.body.classList.remove("blur")},false)}},{key:"init",value:function init(){var _this23=this;try{var _this$config$encrypti3;if(this.config.encryption){this.initFixItDecryptor()}else if(!((_this$config$encrypti3=this.config.encryption)!==null&&_this$config$encrypti3!==void 0&&_this$config$encrypti3.all)){this.initTwemoji();this.initDetails();this.initLightGallery();this.initHighlight();this.initTable();this.initHeaderLink();this.initMath();this.initMermaid();this.initEcharts();this.initTypeit();this.initMapbox();this.initPangu()}this.initThemeColor();this.initSVGIcon();this.initMenu();this.initSwitchTheme();this.initSearch();this.initCookieconsent();this.initSiteTime();this.initServiceWorker();this.initWatermark();this.initMDevtools();this.initAutoMark();window.setTimeout(function(){var _this23$config$encryp;_this23.initComment();if(!((_this23$config$encryp=_this23.config.encryption)!==null&&_this23$config$encryp!==void 0&&_this23$config$encryp.all)){_this23.initToc();_this23.initTocListener()}_this23.onScroll();_this23.onResize();_this23.onClickMask()},100)}catch(err){console.error(err)}}}]);return FixIt}();var themeInit=function themeInit(){window.fixit=new FixIt;window.fixit.init()};if(document.readyState!=="loading"){themeInit()}else{document.addEventListener("DOMContentLoaded",themeInit,false)} //# sourceMappingURL=theme.min.js.map \ No newline at end of file diff --git a/assets/js/theme.min.js.map b/assets/js/theme.min.js.map index 4f439c8b3..3fdfc0a34 100644 --- a/assets/js/theme.min.js.map +++ b/assets/js/theme.min.js.map @@ -1 +1 @@ -{"version":3,"file":"theme.min.js","names":["Util","elements","handler","i","length","document","documentElement","body","scrollTop","window","matchMedia","matches","element","animation","reserved","callback","Array","isArray","classList","add","addEventListener","remove","once","date","Date","isNaN","getTime","selector","startsWith","getElementById","slice","querySelector","scrollIntoView","behavior","FixIt","now","run","config","siteTime","$runTimes","util","isValidDate","clearInterval","parentNode","runTime","days","Math","floor","hours","minutes","seconds","innerHTML","String","padStart","data","isDark","dataset","theme","newScrollTop","getScrollTop","oldScrollTop","scrollEventSet","Set","resizeEventSet","switchThemeEventSet","clickMaskEventSet","disableScrollEvent","objectFitImages","$meta","_themeColorOnSwitchTheme","content","dark","light","forEach","querySelectorAll","$icon","fetch","svgSrc","then","response","text","svg","$temp","createElement","insertAdjacentHTML","$svg","firstChild","$titleElements","getElementsByTagName","removeChild","parentElement","replaceChild","catch","err","console","error","twemoji","parse","initMenuDesktop","initMenuMobile","$item","style","minWidth","offsetWidth","$menuToggleMobile","$menuMobile","event","toggle","contains","_menuMobileOnClickMask","$nestedItem","getElementsByClassName","$themeSwitch","localStorage","setItem","searchConfig","search","isMobile","_searchMobileOnce","_searchDesktopOnce","maxResultLength","snippetLength","highlightTag","isCaseSensitive","minMatchCharLength","findAllMatches","location","threshold","distance","ignoreLocation","useExtendedSearch","ignoreFieldNorm","suffix","$header","$searchInput","$searchToggle","$searchLoading","$searchClear","display","_searchMobile","autocomplete","setVal","_searchMobileOnClickMask","focus","_searchDesktop","_searchDesktopOnClickMask","value","initAutosearch","autosearch","hint","autoselect","dropdownMenuContainer","clearOnSelected","cssClasses","noPrefix","debug","name","source","query","finish","results","type","lunr","queryHandler","_index","ref","metadata","matchData","_indexData","uri","title","context","position","Object","values","matchPosition","substr","lastIndexOf","keys","key","replace","RegExp","lunrIndexURL","json","indexData","lunrLanguageCode","use","field","boost","metadataWhitelist","record","objectID","_algoliaIndex","algoliasearch","algoliaAppID","algoliaSearchKey","initIndex","algoliaIndex","offset","attributesToHighlight","attributesToSnippet","highlightPreTag","highlightPostTag","hits","_highlightResult","_snippetResult","item","refIndex","indices","substring","tag","fuseIndexURL","options","includeScore","shouldSort","includeMatches","Fuse","templates","suggestion","empty","noResultsFound","footer","searchType","icon","href","on","_event","_dataset","_context","assign","lunrSegmentitURL","script","id","src","async","readyState","onreadystatechange","onload","appendChild","$details","$summary","lightgallery","lightGallery","plugins","lgThumbnail","lgZoom","speed","hideBarsDelay","allowMediaOverlap","exThumbImage","toggleThumb","thumbWidth","thumbHeight","actualSize","showZoomInOutIcons","licenseKey","$preChroma","$chroma","className","$table","$tbody","$tr","$td","$codeElements","$code","toLowerCase","$title","$ellipses","code","editable","$edit","editUnLockTitle","$iconKey","$iconLock","$preChromas","editLockTitle","setAttribute","blur","copyTitle","$copy","innerText","trim","maxShownLines","split","navigator","clipboard","writeText","animateCSS","insertBefore","$wrapper","num","$tocCore","kept","isTocStatic","$tocContentStatic","_tocOnScroll","delete","$tocContentAuto","$toc","visibility","$postMeta","marginTop","offsetTop","clientHeight","$tocLinkElements","$tocLiElements","$headerLinkElements","headerIsFixed","headerDesktop","headerHeight","offsetHeight","marginBottom","$tocLink","$tocLi","INDEX_SPACING","activeTocIndex","thisTop","getBoundingClientRect","top","nextTop","$parent","tocHidden","push","math","renderMathInElement","_mermaidOnSwitchTheme","$mermaidElements","themes","mermaid","initialize","startOnLoad","securityLevel","$mermaid","render","svgCode","echarts","registerTheme","lightTheme","darkTheme","_echartsOnSwitchTheme","_echartsArr","dispose","$echarts","chart","init","renderer","setOption","JSON","_echartsOnResize","resize","mapbox","mapboxgl","accessToken","setRTLTextPlugin","RTLTextPlugin","_mapboxArr","$mapbox","lng","lat","zoom","lightStyle","darkStyle","marked","navigation","geolocate","scale","fullscreen","Map","container","center","minZoom","attributionControl","Marker","setLngLat","addTo","addControl","NavigationControl","GeolocateControl","positionOptions","enableHighAccuracy","showUserLocation","trackUserLocation","ScaleControl","FullscreenControl","MapboxLanguage","_mapboxOnSwitchTheme","getContainer","setStyle","typeit","typeitConfig","cursorSpeed","cursorChar","group","typeone","instance","TypeIt","strings","lifeLike","waitUntilVisible","afterComplete","duration","setTimeout","destroy","go","comments","images","$content","$imgs","$img","$link","append","cloneNode","replaceWith","comment","enable","$viewCommentsBtn","expired","artalk","Artalk","LoadCountWidget","server","site","pvEl","countEl","setDarkMode","initCommentLightGallery","gitalk","decodeURI","Gitalk","valine","Valine","waline","pageview","Waline","pageviewCount","serverURL","path","pathname","utterances","utterancesConfig","repo","issueTerm","label","crossOrigin","_utterancesOnSwitchTheme","message","contentWindow","postMessage","twikoo","twikooConfig","onCommentLoaded","commentCount","getCommentsCount","envId","region","urls","includeReply","twikooCommentCount","count","giscus","giscusConfig","_giscusOnSwitchTheme","setConfig","_this","giscus2parentMsg","$script","removeEventListener","cookieconsent","initialise","setInterval","getSiteTime","hidden","enablePWA","serviceWorker","register","scope","registration","ready","watermark","Watermark","outerHTML","appendTo","appendto","opacity","width","height","rowSpacing","rowspacing","colSpacing","colspacing","rotate","fontSize","fontsize","fontFamily","fontfamily","pangu","spacingElementById","spacingElementByClassName","spacingElementByTagName","autoSpacingPage","$tocNodes","decryptor","FixItDecryptor","decrypted","initTwemoji","initDetails","initLightGallery","initHighlight","initTable","initHeaderLink","initMath","initMermaid","initEcharts","initTypeit","initMapbox","$element","initToc","initTocListener","initPangu","reset","encryption","shortcode","initShortcodes","all","mDevtools","orientation","vConsole","VConsole","target","_vConsoleOnSwitchTheme","eruda","defaults","_erudaOnSwitchTheme","evalCss","setTheme","autoBookmark","Number","getItem","hash","scrollTo","$headers","ACCURACY","$fixedButtons","$backToTop","$readingProgressBar","headerMobile","preventDefault","$mask","scroll","click","contentHeight","scrollHeight","innerHeight","scrollPercent","max","min","setProperty","toFixed","round","resizeBefore","_resizeTimeout","initSearch","initFixItDecryptor","initThemeColor","initSVGIcon","initMenu","initSwitchTheme","initCookieconsent","initSiteTime","initServiceWorker","initWatermark","initMDevtools","initAutoMark","initComment","onScroll","onResize","onClickMask","themeInit","fixit"],"sources":["../../src/js/theme.js"],"sourcesContent":["class Util {\n forEach(elements, handler) {\n elements = elements || [];\n for (let i = 0; i < elements.length; i++) {\n handler(elements[i]);\n }\n }\n\n getScrollTop() {\n return (document.documentElement ?? document.body).scrollTop;\n }\n\n isMobile() {\n return window.matchMedia('only screen and (max-width: 680px)').matches;\n }\n\n isTocStatic() {\n return window.matchMedia('only screen and (max-width: 960px)').matches;\n }\n\n /**\n * add animate to element\n * @param {Element} element animate element\n * @param {String|Array} animation animation name\n * @param {Boolean} reserved reserved animation\n * @param {Function} callback remove callback\n */\n animateCSS(element, animation, reserved, callback) {\n !Array.isArray(animation) && (animation = [animation]);\n element.classList.add('animate__animated', ...animation);\n element.addEventListener('animationend', () => {\n !reserved && element.classList.remove('animate__animated', ...animation);\n typeof callback === 'function' && callback();\n }, { once: true });\n }\n\n /**\n * date validator\n * @param {*} date may be date or not\n * @returns {Boolean}\n */\n isValidDate(date) {\n return date instanceof Date && !isNaN(date.getTime());\n }\n \n /**\n * scroll some element into view\n * @param {String} selector element to scroll\n */\n scrollIntoView(selector) {\n const element = selector.startsWith('#')\n ? document.getElementById(selector.slice(1))\n : document.querySelector(selector);\n element?.scrollIntoView({\n behavior: 'smooth'\n });\n }\n}\n\nclass FixIt {\n constructor() {\n this.config = window.config;\n this.data = this.config.data;\n this.isDark = document.body.dataset.theme === 'dark';\n this.util = new Util();\n this.newScrollTop = this.util.getScrollTop();\n this.oldScrollTop = this.newScrollTop;\n this.scrollEventSet = new Set();\n this.resizeEventSet = new Set();\n this.switchThemeEventSet = new Set();\n this.clickMaskEventSet = new Set();\n this.disableScrollEvent = false;\n window.objectFitImages && objectFitImages();\n }\n\n initThemeColor() {\n const $meta = document.querySelector('[name=\"theme-color\"]');\n if (!$meta) {\n return;\n }\n this._themeColorOnSwitchTheme = this._themeColorOnSwitchTheme || (() => {\n $meta.content = this.isDark ? $meta.dataset.dark : $meta.dataset.light;\n });\n this.switchThemeEventSet.add(this._themeColorOnSwitchTheme);\n this._themeColorOnSwitchTheme();\n }\n\n initSVGIcon() {\n this.util.forEach(document.querySelectorAll('[data-svg-src]'), ($icon) => {\n fetch($icon.dataset.svgSrc)\n .then((response) => response.text())\n .then((svg) => {\n const $temp = document.createElement('div');\n $temp.insertAdjacentHTML('afterbegin', svg);\n const $svg = $temp.firstChild;\n $svg.dataset.svgSrc = $icon.dataset.svgSrc\n $svg.classList.add('icon');\n const $titleElements = $svg.getElementsByTagName('title');\n $titleElements.length && $svg.removeChild($titleElements[0]);\n $icon.parentElement.replaceChild($svg, $icon);\n })\n .catch((err) => {\n console.error(err);\n });\n });\n }\n\n initTwemoji() {\n this.config.twemoji && twemoji.parse(document.body);\n }\n\n initMenu() {\n this.initMenuDesktop();\n this.initMenuMobile();\n }\n\n initMenuDesktop() {\n this.util.forEach(document.querySelectorAll('.has-children, #header-desktop .language'), ($item) => {\n $item.querySelector('.sub-menu').style.minWidth = `${$item.offsetWidth - 8}px`;\n });\n }\n\n initMenuMobile() {\n const $menuToggleMobile = document.getElementById('menu-toggle-mobile');\n const $menuMobile = document.getElementById('menu-mobile');\n $menuToggleMobile.addEventListener('click', (event) => {\n document.body.classList.toggle('blur');\n $menuToggleMobile.classList.toggle('active');\n $menuMobile.classList.toggle('active');\n this.disableScrollEvent = document.body.classList.contains('blur');\n }, false);\n this._menuMobileOnClickMask = this._menuMobileOnClickMask || (() => {\n $menuToggleMobile.classList.remove('active');\n $menuMobile.classList.remove('active');\n });\n this.clickMaskEventSet.add(this._menuMobileOnClickMask);\n // add nested menu toggler\n this.util.forEach(document.querySelectorAll('.menu-item>.nested-item'), ($nestedItem) => {\n $nestedItem.addEventListener('click', function () {\n this.parentNode.querySelector('.sub-menu').classList.toggle('open');\n this.querySelector('.dropdown-icon').classList.toggle('open');\n });\n });\n }\n\n initSwitchTheme() {\n this.util.forEach(document.getElementsByClassName('theme-switch'), ($themeSwitch) => {\n $themeSwitch.addEventListener('click', () => {\n document.body.dataset.theme = document.body.dataset.theme === 'dark' ? 'light' : 'dark';\n this.isDark = !this.isDark;\n window.localStorage?.setItem('theme', this.isDark ? 'dark' : 'light');\n for (let event of this.switchThemeEventSet) {\n event();\n }\n }, false);\n });\n }\n\n initSearch() {\n const searchConfig = this.config.search;\n const isMobile = this.util.isMobile();\n if (!searchConfig || (isMobile && this._searchMobileOnce) || (!isMobile && this._searchDesktopOnce)) {\n return;\n }\n // Initialize default search config\n const maxResultLength = searchConfig.maxResultLength ?? 10;\n const snippetLength = searchConfig.snippetLength ?? 50;\n const highlightTag = searchConfig.highlightTag ?? 'em';\n const isCaseSensitive = searchConfig.isCaseSensitive ?? false;\n const minMatchCharLength = searchConfig.minMatchCharLength ?? 1;\n const findAllMatches = searchConfig.findAllMatches ?? false;\n const location = searchConfig.location ?? 0;\n const threshold = searchConfig.threshold ?? 0.3;\n const distance = searchConfig.distance ?? 100;\n const ignoreLocation = searchConfig.ignoreLocation ?? false;\n const useExtendedSearch = searchConfig.useExtendedSearch ?? false;\n const ignoreFieldNorm = searchConfig.ignoreFieldNorm ?? false;\n const suffix = isMobile ? 'mobile' : 'desktop';\n const $header = document.getElementById(`header-${suffix}`);\n const $searchInput = document.getElementById(`search-input-${suffix}`);\n const $searchToggle = document.getElementById(`search-toggle-${suffix}`);\n const $searchLoading = document.getElementById(`search-loading-${suffix}`);\n const $searchClear = document.getElementById(`search-clear-${suffix}`);\n\n if (isMobile) {\n this._searchMobileOnce = true;\n $searchInput.addEventListener('focus', () => {\n this.disableScrollEvent = true;\n document.body.classList.add('blur');\n $header.classList.add('open');\n }, false);\n document.getElementById('search-cancel-mobile').addEventListener('click', () => {\n this.disableScrollEvent = false;\n $header.classList.remove('open');\n document.body.classList.remove('blur');\n document.getElementById('menu-toggle-mobile').classList.remove('active');\n document.getElementById('menu-mobile').classList.remove('active');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n this._searchMobileOnClickMask = this._searchMobileOnClickMask || (() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchMobileOnClickMask);\n } else {\n this._searchDesktopOnce = true;\n $searchToggle.addEventListener('click', () => {\n document.body.classList.add('blur');\n $header.classList.add('open');\n $searchInput.focus();\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n }, false);\n this._searchDesktopOnClickMask = this._searchDesktopOnClickMask ||(() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchDesktopOnClickMask);\n }\n $searchInput.addEventListener('input', () => {\n if ($searchInput.value === '') $searchClear.style.display = 'none';\n else $searchClear.style.display = 'inline';\n }, false);\n\n const initAutosearch = () => {\n const autosearch = autocomplete(`#search-input-${suffix}`,\n {\n hint: false,\n autoselect: true,\n dropdownMenuContainer: `#search-dropdown-${suffix}`,\n clearOnSelected: true,\n cssClasses: { noPrefix: true },\n debug: true\n },\n {\n name: 'search',\n source: (query, callback) => {\n $searchLoading.style.display = 'inline';\n $searchClear.style.display = 'none';\n const finish = (results) => {\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'inline';\n callback(results);\n };\n if (searchConfig.type === 'lunr') {\n const search = () => {\n if (lunr.queryHandler) {\n query = lunr.queryHandler(query);\n }\n const results = {};\n this._index.search(query).forEach(({ ref, matchData: { metadata } }) => {\n const matchData = this._indexData[ref];\n let { uri, title, content: context } = matchData;\n if (results[uri]) {\n return;\n }\n let position = 0;\n Object.values(metadata).forEach(({ content }) => {\n if (content) {\n const matchPosition = content.position[0][0];\n if (matchPosition < position || position === 0) {\n position = matchPosition;\n }\n }\n });\n position -= snippetLength / 5;\n if (position > 0) {\n position += context.substr(position, 20).lastIndexOf(' ') + 1;\n context = '...' + context.substr(position, snippetLength);\n } else {\n context = context.substr(0, snippetLength);\n }\n Object.keys(metadata).forEach((key) => {\n title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n context = context.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n });\n results[uri] = {\n uri: uri,\n title: title,\n date: matchData.date,\n context: context\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!this._index) {\n fetch(searchConfig.lunrIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const indexData = {};\n this._index = lunr(function () {\n if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);\n this.ref('objectID');\n this.field('title', { boost: 50 });\n this.field('tags', { boost: 20 });\n this.field('categories', { boost: 20 });\n this.field('content', { boost: 10 });\n this.metadataWhitelist = ['position'];\n data.forEach((record) => {\n indexData[record.objectID] = record;\n this.add(record);\n });\n });\n this._indexData = indexData;\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } else if (searchConfig.type === 'algolia') {\n this._algoliaIndex =\n this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);\n this._algoliaIndex\n .search(query, {\n offset: 0,\n length: maxResultLength * 8,\n attributesToHighlight: ['title'],\n attributesToSnippet: [`content:${snippetLength}`],\n highlightPreTag: `<${highlightTag}>`,\n highlightPostTag: ``\n })\n .then(({ hits }) => {\n const results = {};\n hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => {\n if (results[uri] && results[uri].context.length > content.value) {\n return;\n }\n results[uri] = {\n uri: uri,\n title: title.value,\n date: date,\n context: content.value\n };\n });\n finish(Object.values(results).slice(0, maxResultLength));\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else if (searchConfig.type === 'fuse') {\n const search = () => {\n const results = {};\n window._index.search(query).forEach(({ item, refIndex, matches }) => {\n let title = item.title;\n let content = item.content;\n matches.forEach(({ indices, value, key }) => {\n if (key === 'content') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = content.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n content = content.substring(0, indices[i][0] + offset) + tag + content.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n } else if (key === 'title') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = title.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n title = title.substring(0, indices[i][0] + offset) + tag + title.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n }\n });\n results[item.uri] = {\n uri: item.uri,\n title: title,\n date: item.date,\n context: content\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!window._index) {\n fetch(searchConfig.fuseIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const options = {\n isCaseSensitive: isCaseSensitive,\n findAllMatches: findAllMatches,\n minMatchCharLength: minMatchCharLength,\n location: location,\n threshold: threshold,\n distance: distance,\n ignoreLocation: ignoreLocation,\n useExtendedSearch: useExtendedSearch,\n ignoreFieldNorm: ignoreFieldNorm,\n includeScore: false,\n shouldSort: true,\n includeMatches: true,\n keys: ['content', 'title']\n };\n window._index = new Fuse(data, options);\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } \n },\n templates: {\n suggestion: ({ title, date, context }) =>\n `
${title}${date}
${context}
`,\n empty: ({ query }) => `
${searchConfig.noResultsFound}: \"${query}\"
`,\n footer: ({}) => {\n const { searchType, icon, href } =\n searchConfig.type === 'algolia'\n ? {\n searchType: 'algolia',\n icon: '',\n href: 'https://www.algolia.com/'\n }\n : (searchConfig.type === 'lunr'\n ? {\n searchType: 'Lunr.js',\n icon: '',\n href: 'https://lunrjs.com/'\n }\n : {\n searchType: 'Fuse.js',\n icon: '',\n href: 'https://fusejs.io/'\n })\n return ``;\n }\n }\n }\n );\n autosearch.on('autocomplete:selected', (_event, suggestion, _dataset, _context) => {\n window.location.assign(suggestion.uri);\n });\n if (isMobile) {\n this._searchMobile = autosearch;\n } else {\n this._searchDesktop = autosearch;\n }\n };\n if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {\n const script = document.createElement('script');\n script.id = 'lunr-segmentit';\n script.src = searchConfig.lunrSegmentitURL;\n script.async = true;\n if (script.readyState) {\n script.onreadystatechange = () => {\n if (script.readyState == 'loaded' || script.readyState == 'complete') {\n script.onreadystatechange = null;\n initAutosearch();\n }\n };\n } else {\n script.onload = () => {\n initAutosearch();\n };\n }\n document.body.appendChild(script);\n } else {\n initAutosearch();\n }\n }\n\n initDetails() {\n this.util.forEach(document.getElementsByClassName('details'), ($details) => {\n const $summary = $details.querySelector('.details-summary');\n $summary.addEventListener('click', () => {\n $details.classList.toggle('open');\n }, false);\n });\n }\n\n initLightGallery() {\n if (this.config.lightgallery) {\n lightGallery(document.getElementById('content'), {\n plugins: [lgThumbnail, lgZoom],\n selector: '.lightgallery',\n speed: 400,\n hideBarsDelay: 2000,\n allowMediaOverlap: true,\n exThumbImage: 'data-thumbnail',\n toggleThumb: true,\n thumbWidth: 80,\n thumbHeight: '60px',\n actualSize: false,\n showZoomInOutIcons: true,\n licenseKey: 'none'\n });\n }\n }\n\n initHighlight() {\n this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), ($preChroma) => {\n const $chroma = document.createElement('div');\n $chroma.className = $preChroma.className;\n const $table = document.createElement('table');\n $chroma.appendChild($table);\n const $tbody = document.createElement('tbody');\n $table.appendChild($tbody);\n const $tr = document.createElement('tr');\n $tbody.appendChild($tr);\n const $td = document.createElement('td');\n $tr.appendChild($td);\n $preChroma.parentElement.replaceChild($chroma, $preChroma);\n $td.appendChild($preChroma);\n });\n this.util.forEach(document.querySelectorAll('.highlight > .chroma'), ($chroma) => {\n const $codeElements = $chroma.querySelectorAll('pre.chroma > code');\n if ($codeElements.length) {\n const $code = $codeElements[$codeElements.length - 1];\n const $header = document.createElement('div');\n $header.className = 'code-header ' + $code.className.toLowerCase();\n // code title\n const $title = document.createElement('span');\n $title.classList.add('code-title');\n $title.insertAdjacentHTML('afterbegin', '');\n $title.addEventListener('click', () => {\n $chroma.classList.toggle('open');\n }, false);\n $header.appendChild($title);\n // ellipses icon\n const $ellipses = document.createElement('span');\n $ellipses.insertAdjacentHTML('afterbegin', '');\n $ellipses.classList.add('ellipses');\n $ellipses.addEventListener('click', () => {\n $chroma.classList.add('open');\n }, false);\n $header.appendChild($ellipses);\n // edit button\n if (this.config.code.editable) {\n const $edit = document.createElement('span');\n $edit.classList.add('edit');\n $edit.insertAdjacentHTML('afterbegin', ``);\n $edit.addEventListener('click', () => {\n const $iconKey = $edit.querySelector('.fa-key');\n const $iconLock = $edit.querySelector('.fa-lock');\n const $preChromas = $edit.parentElement.parentElement.querySelectorAll('pre.chroma');\n const $preChroma = $preChromas.length === 2 ? $preChromas[1] : $preChromas[0];\n if ($iconKey) {\n $iconKey.classList.add('fa-lock');\n $iconKey.classList.remove('fa-key');\n $iconKey.title = this.config.code.editLockTitle;\n $preChroma.setAttribute('contenteditable', true);\n $preChroma.focus();\n } else {\n $iconLock.classList.add('fa-key');\n $iconLock.classList.remove('fa-lock');\n $iconLock.title = this.config.code.editUnLockTitle;\n $preChroma.setAttribute('contenteditable', false);\n $preChroma.blur();\n }\n }, false);\n $header.appendChild($edit);\n }\n // copy button\n if (this.config.code.copyTitle) {\n const $copy = document.createElement('span');\n $copy.insertAdjacentHTML('afterbegin', '');\n $copy.classList.add('copy');\n // remove the leading and trailing whitespace of the code string\n const code = $code.innerText.trim();\n if (this.config.code.maxShownLines < 0 || code.split('\\n').length < this.config.code.maxShownLines + 2) {\n $chroma.classList.add('open');\n }\n $copy.title = this.config.code.copyTitle;\n $copy.addEventListener('click', () => {\n navigator.clipboard.writeText(code).then(() => {\n this.util.animateCSS($code, 'animate__flash');\n }, () => {\n console.error('Clipboard write failed!', 'Your browser does not support clipboard API!');\n });\n }, false);\n $header.appendChild($copy);\n }\n $chroma.insertBefore($header, $chroma.firstChild);\n }\n });\n }\n\n initTable() {\n this.util.forEach(document.querySelectorAll('.content table'), ($table) => {\n const $wrapper = document.createElement('div');\n $wrapper.className = 'table-wrapper';\n $table.parentElement.replaceChild($wrapper, $table);\n $wrapper.appendChild($table);\n });\n }\n\n initHeaderLink() {\n for (let num = 1; num <= 6; num++) {\n this.util.forEach(document.querySelectorAll('.single .content > h' + num), ($header) => {\n $header.classList.add('header-link');\n $header.insertAdjacentHTML('afterbegin', ``);\n });\n }\n }\n /**\n * init table of contents\n */\n initToc() {\n const $tocCore = document.getElementById('TableOfContents');\n if ($tocCore === null) {\n return;\n }\n if (document.getElementById('toc-static').dataset.kept === true || this.util.isTocStatic()) {\n const $tocContentStatic = document.getElementById('toc-content-static');\n if ($tocCore.parentElement !== $tocContentStatic) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentStatic.appendChild($tocCore);\n }\n this._tocOnScroll && this.scrollEventSet.delete(this._tocOnScroll);\n } else {\n const $tocContentAuto = document.getElementById('toc-content-auto');\n if ($tocCore.parentElement !== $tocContentAuto) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentAuto.appendChild($tocCore);\n }\n const $toc = document.getElementById('toc-auto');\n $toc.style.visibility = 'visible';\n this.util.animateCSS($toc, ['animate__fadeIn', 'animate__faster'], true);\n const $postMeta = document.querySelector('.post-meta');\n $toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;\n const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');\n const $tocLiElements = $tocCore.getElementsByTagName('li');\n const $headerLinkElements = document.getElementsByClassName('header-link');\n const headerIsFixed = document.body.dataset.headerDesktop !== 'normal';\n const headerHeight = document.getElementById('header-desktop').offsetHeight;\n document.querySelector('.container').addEventListener('resize', () => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n });\n this._tocOnScroll = this._tocOnScroll || (() => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n this.util.forEach($tocLinkElements, ($tocLink) => {\n $tocLink.classList.remove('active');\n });\n this.util.forEach($tocLiElements, ($tocLi) => {\n $tocLi.classList.remove('has-active');\n });\n const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n let activeTocIndex = $headerLinkElements.length - 1;\n for (let i = 0; i < $headerLinkElements.length - 1; i++) {\n const thisTop = $headerLinkElements[i].getBoundingClientRect().top;\n const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;\n if ((i == 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {\n activeTocIndex = i;\n break;\n }\n }\n if (activeTocIndex !== -1) {\n $tocLinkElements[activeTocIndex].classList.add('active');\n let $parent = $tocLinkElements[activeTocIndex].parentElement;\n while ($parent !== $tocCore) {\n $parent.classList.add('has-active');\n $parent = $parent.parentElement.parentElement;\n }\n }\n });\n this._tocOnScroll();\n this.scrollEventSet.add(this._tocOnScroll);\n }\n }\n\n initTocListener() {\n const $toc = document.getElementById('toc-auto');\n const $tocContentAuto = document.getElementById('toc-content-auto');\n document.querySelector('#toc-auto>.toc-title')?.addEventListener('click', () => {\n const animation = ['animate__faster'];\n const tocHidden = $toc.classList.contains('toc-hidden');\n animation.push(tocHidden ? 'animate__fadeIn' : 'animate__fadeOut');\n $tocContentAuto.classList.remove(tocHidden ? 'animate__fadeOut' : 'animate__fadeIn');\n this.util.animateCSS($tocContentAuto, animation, true);\n $toc.classList.toggle('toc-hidden');\n }, false);\n }\n\n initMath() {\n if (this.config.math) {\n renderMathInElement(document.body, this.config.math);\n }\n }\n\n initMermaid() {\n this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || (() => {\n const $mermaidElements = document.getElementsByClassName('mermaid');\n if ($mermaidElements.length) {\n const themes = this.config.mermaid.themes ?? ['neutral', 'dark'];\n mermaid.initialize({startOnLoad: false, theme: this.isDark ? themes[1] : themes[0], securityLevel: 'loose'});\n this.util.forEach($mermaidElements, $mermaid => {\n mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {\n $mermaid.innerHTML = svgCode;\n }, $mermaid);\n });\n }\n });\n this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);\n this._mermaidOnSwitchTheme();\n }\n\n initEcharts() {\n if (!this.config.echarts) {\n return;\n }\n echarts.registerTheme('light', this.config.echarts.lightTheme);\n echarts.registerTheme('dark', this.config.echarts.darkTheme);\n this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || (() => {\n this._echartsArr = this._echartsArr || [];\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].dispose();\n }\n this._echartsArr = [];\n this.util.forEach(document.getElementsByClassName('echarts'), ($echarts) => {\n const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });\n chart.setOption(JSON.parse(this.data[$echarts.id]));\n this._echartsArr.push(chart);\n });\n });\n this.switchThemeEventSet.add(this._echartsOnSwitchTheme);\n this._echartsOnSwitchTheme();\n this._echartsOnResize = this._echartsOnResize || (() => {\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].resize();\n }\n });\n this.resizeEventSet.add(this._echartsOnResize);\n }\n\n initMapbox() {\n if (this.config.mapbox) {\n mapboxgl.accessToken = this.config.mapbox.accessToken;\n mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);\n this._mapboxArr = this._mapboxArr || [];\n this.util.forEach(document.getElementsByClassName('mapbox'), ($mapbox) => {\n const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];\n const mapbox = new mapboxgl.Map({\n container: $mapbox,\n center: [lng, lat],\n zoom: zoom,\n minZoom: 0.2,\n style: this.isDark ? darkStyle : lightStyle,\n attributionControl: false\n });\n if (marked) {\n new mapboxgl.Marker().setLngLat([lng, lat]).addTo(mapbox);\n }\n if (navigation) {\n mapbox.addControl(new mapboxgl.NavigationControl(), 'bottom-right');\n }\n if (geolocate) {\n mapbox.addControl(\n new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true\n },\n showUserLocation: true,\n trackUserLocation: true\n }),\n 'bottom-right'\n );\n }\n if (scale) {\n mapbox.addControl(new mapboxgl.ScaleControl());\n }\n if (fullscreen) {\n mapbox.addControl(new mapboxgl.FullscreenControl());\n }\n mapbox.addControl(new MapboxLanguage());\n this._mapboxArr.push(mapbox);\n });\n this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {\n this.util.forEach(this._mapboxArr, (mapbox) => {\n const $mapbox = mapbox.getContainer();\n const { lightStyle, darkStyle } = this.data[$mapbox.id];\n mapbox.setStyle(this.isDark ? darkStyle : lightStyle);\n mapbox.addControl(new MapboxLanguage());\n });\n });\n this.switchThemeEventSet.add(this._mapboxOnSwitchTheme);\n }\n }\n\n initTypeit() {\n if (this.config.typeit) {\n const typeitConfig = this.config.typeit;\n const speed = typeitConfig.speed || 100;\n const cursorSpeed = typeitConfig.cursorSpeed || 1000;\n const cursorChar = typeitConfig.cursorChar || '|';\n Object.values(typeitConfig.data).forEach((group) => {\n const typeone = (i) => {\n const id = group[i];\n const instance = new TypeIt(`#${id}`, {\n strings: this.data[id],\n speed: speed,\n lifeLike: true,\n cursorSpeed: cursorSpeed,\n cursorChar: cursorChar,\n waitUntilVisible: true,\n afterComplete: () => {\n if (i === group.length - 1) {\n if (typeitConfig.duration >= 0) {\n window.setTimeout(() => {\n instance.destroy();\n }, typeitConfig.duration);\n }\n return;\n }\n instance.destroy();\n typeone(i + 1);\n }\n }).go();\n };\n typeone(0);\n });\n }\n }\n\n initCommentLightGallery(comments, images) {\n document.querySelectorAll(comments).forEach(($content) => {\n const $imgs = $content.querySelectorAll(images + ':not([lightgallery-loaded])');\n $imgs.forEach(($img) => {\n $img.setAttribute('lightgallery-loaded', '');\n const $link = document.createElement('a');\n $link.setAttribute('class', 'comment-lightgallery');\n $link.setAttribute('href', $img.src);\n $link.append($img.cloneNode());\n $img.replaceWith($link);\n });\n if ($imgs.length) {\n lightGallery($content, {\n selector: '.comment-lightgallery',\n actualSize: false,\n hideBarsDelay: 2000,\n speed: 400\n });\n }\n });\n }\n\n initComment() {\n if (!this.config.comment?.enable) {\n return;\n }\n // whether to show the view comments button\n if (document.querySelector('#comments')) {\n const $viewCommentsBtn = document.querySelector('.view-comments');\n $viewCommentsBtn.classList.remove('d-none');\n // view comments button click event\n $viewCommentsBtn.addEventListener('click', () => {\n this.util.scrollIntoView('#comments');\n }, false);\n }\n this.config.comment.expired && document.querySelector('#comments').remove();\n if (this.config.comment.artalk) {\n if (this.config.comment.expired) {\n return Artalk.LoadCountWidget({\n server: this.config.comment.artalk.server,\n site: this.config.comment.artalk.site,\n pvEl: this.config.comment.artalk.pvEl,\n countEl: this.config.comment.artalk.countEl\n })\n }\n const artalk = new Artalk(this.config.comment.artalk);\n artalk.setDarkMode(this.isDark);\n this.switchThemeEventSet.add(() => {\n artalk.setDarkMode(this.isDark);\n });\n artalk.on('comments-loaded', () => {\n this.config.comment.artalk.lightgallery && this.initCommentLightGallery('.atk-comment .atk-content', 'img:not([atk-emoticon])');\n });\n return artalk;\n }\n if (this.config.comment.gitalk) {\n this.config.comment.gitalk.body = decodeURI(window.location.href);\n const gitalk = new Gitalk(this.config.comment.gitalk);\n gitalk.render('gitalk');\n return gitalk;\n }\n if (this.config.comment.valine) {\n return new Valine(this.config.comment.valine);\n }\n if (this.config.comment.waline) {\n if (this.config.comment.expired) {\n this.config.comment.waline.pageview && Waline.pageviewCount({\n serverURL: this.config.comment.waline.serverURL,\n path: window.location.pathname\n });\n return;\n }\n return Waline.init(this.config.comment.waline);\n }\n if (this.config.comment.utterances) {\n const utterancesConfig = this.config.comment.utterances;\n const script = document.createElement('script');\n script.src = 'https://utteranc.es/client.js';\n script.setAttribute('repo', utterancesConfig.repo);\n script.setAttribute('issue-term', utterancesConfig.issueTerm);\n if (utterancesConfig.label) script.setAttribute('label', utterancesConfig.label);\n script.setAttribute('theme', this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme);\n script.crossOrigin = 'anonymous';\n script.async = true;\n document.getElementById('utterances').appendChild(script);\n this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || (() => {\n const message = {\n type: 'set-theme',\n theme: this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme\n };\n document.querySelector('.utterances-frame')?.contentWindow.postMessage(message, 'https://utteranc.es');\n });\n this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);\n return;\n }\n if (this.config.comment.twikoo) {\n const twikooConfig = this.config.comment.twikoo;\n if (twikooConfig.lightgallery) {\n twikooConfig.onCommentLoaded = () => {\n this.initCommentLightGallery('.tk-comments .tk-content', 'img:not(.tk-owo-emotion)');\n };\n }\n twikoo.init(twikooConfig);\n if (twikooConfig.commentCount) {\n // https://twikoo.js.org/api.html#get-comments-count\n twikoo\n .getCommentsCount({\n envId: twikooConfig.envId,\n region: twikooConfig.region,\n urls: [window.location.pathname],\n includeReply: false\n })\n .then(function (response) {\n const twikooCommentCount = document.getElementById('twikoo-comment-count');\n if (twikooCommentCount) twikooCommentCount.innerHTML = response[0].count;\n });\n }\n return;\n }\n if (this.config.comment.giscus) {\n const giscusConfig = this.config.comment.giscus;\n this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || (() => {\n const message = { setConfig: { theme: this.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme }};\n document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');\n });\n this.switchThemeEventSet.add(this._giscusOnSwitchTheme);\n const _this = this;\n _this.giscus2parentMsg = window.addEventListener('message', (event) => {\n const $script = document.querySelector('#giscus>script');\n if ($script){\n _this._giscusOnSwitchTheme();\n $script.parentElement.removeChild($script);\n }\n window.removeEventListener('message', _this.giscus2parentMsg);\n });\n return;\n }\n }\n\n initCookieconsent() {\n this.config.cookieconsent && cookieconsent.initialise(this.config.cookieconsent);\n }\n\n getSiteTime = () => {\n let now = new Date();\n let run = new Date(this.config.siteTime);\n let $runTimes = document.querySelector('.run-times');\n if (!this.util.isValidDate(run) || !$runTimes) {\n clearInterval(this.siteTime);\n $runTimes && $runTimes.parentNode.remove();\n return;\n }\n let runTime = (now - run) / 1000,\n days = Math.floor(runTime / 60 / 60 / 24),\n hours = Math.floor(runTime / 60 / 60 - 24 * days),\n minutes = Math.floor(runTime / 60 - 24 * 60 * days - 60 * hours),\n seconds = Math.floor((now - run) / 1000 - 24 * 60 * 60 * days - 60 * 60 * hours - 60 * minutes);\n $runTimes.innerHTML = `${days}, ${String(hours).padStart(2, 0)}:${String(minutes).padStart(2, 0)}:${String(seconds).padStart(2, 0)}`;\n document.querySelector('.site-time .d-none')?.classList.remove('d-none');\n };\n\n initSiteTime() {\n if (this.config.siteTime) {\n this.siteTime = setInterval(this.getSiteTime, 500);\n document.addEventListener('visibilitychange', () => {\n if (document.hidden) {\n return clearInterval(this.siteTime);\n }\n this.siteTime = setInterval(this.getSiteTime, 500);\n }, false);\n }\n }\n\n initServiceWorker() {\n if (this.config.enablePWA && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register('/service-worker.min.js', { scope: '/' })\n .then(function (registration) {\n // console.log('Service Worker Registered');\n })\n .catch(function (error) {\n console.error('error: ', error);\n });\n navigator.serviceWorker\n .ready\n .then(function (registration) {\n // console.log('Service Worker Ready');\n });\n }\n }\n\n initWatermark() {\n this.config.watermark?.enable &&\n new Watermark({\n content: this.config.watermark.content || `${document.querySelector('footer .fixit-icon')?.outerHTML ?? ''} FixIt Theme`,\n appendTo: this.config.watermark.appendto || '.wrapper>main',\n opacity: this.config.watermark.opacity,\n width: this.config.watermark.width,\n height: this.config.watermark.height,\n rowSpacing: this.config.watermark.rowspacing,\n colSpacing: this.config.watermark.colspacing,\n rotate: this.config.watermark.rotate,\n fontSize: this.config.watermark.fontsize,\n fontFamily: this.config.watermark.fontfamily\n });\n }\n\n initPangu() {\n if (!this.config.pangu?.enable) {\n return;\n }\n const selector = this.config.pangu.selector;\n if (selector) {\n if (selector.startsWith('#')) {\n pangu.spacingElementById(selector.slice(1));\n } else if (selector.startsWith('.')) {\n pangu.spacingElementByClassName(selector.slice(1));\n } else {\n pangu.spacingElementByTagName(selector)\n }\n return;\n }\n pangu.autoSpacingPage();\n }\n\n initFixItDecryptor() {\n const $tocNodes = document.querySelectorAll('#toc-auto>.d-none, #toc-static.d-none');\n this.decryptor = new FixItDecryptor({\n decrypted: () => {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.remove('d-none');\n });\n this.initToc();\n this.initTocListener();\n this.initPangu();\n },\n reset: () => {\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.add('d-none');\n });\n }\n });\n if (this.config.encryption?.shortcode) {\n this.decryptor.addEventListener('decrypted', () => {\n this.decryptor.initShortcodes();\n })\n this.decryptor.initShortcodes();\n }\n this.config.encryption?.all && this.decryptor.init();\n }\n\n initMDevtools() {\n const type = this.config?.mDevtools;\n if (typeof window.orientation === 'undefined') {\n return;\n }\n if (type === 'vConsole') {\n const vConsole = new VConsole({\n target: '.widgets',\n theme: this.isDark ? 'dark' : 'light'\n });\n this._vConsoleOnSwitchTheme = this._vConsoleOnSwitchTheme || (() => {\n vConsole.setOption('theme', this.isDark ? 'dark' : 'light');\n });\n this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme);\n }\n if(type === 'eruda') {\n eruda.init({\n defaults: { theme: this.isDark ? 'Dark' : 'Light' }\n });\n this._erudaOnSwitchTheme = this._erudaOnSwitchTheme || (() => {\n eruda.util.evalCss.setTheme(this.isDark ? 'Dark' : 'Light');\n });\n this.switchThemeEventSet.add(this._erudaOnSwitchTheme);\n }\n }\n\n initAutoMark() {\n if (!this.config.autoBookmark) {\n return;\n }\n window.addEventListener('beforeunload', () => {\n window.localStorage?.setItem(`fixit-bookmark/#${location.pathname}`, this.util.getScrollTop());\n });\n const scrollTop = Number(window.localStorage?.getItem(`fixit-bookmark/#${location.pathname}`));\n // If the page opens with a specific hash, just jump out\n if (scrollTop && location.hash === '') {\n window.scrollTo({ \n top: scrollTop,\n behavior: 'smooth'\n });\n }\n }\n\n onScroll() {\n const $headers = [];\n const ACCURACY = 20;\n const $fixedButtons = document.querySelector('.fixed-buttons');\n const $backToTop = document.querySelector('.back-to-top');\n const $readingProgressBar = document.querySelector('.reading-progress-bar');\n if (document.body.dataset.headerDesktop === 'auto') {\n $headers.push(document.getElementById('header-desktop'));\n }\n if (document.body.dataset.headerMobile === 'auto') {\n $headers.push(document.getElementById('header-mobile'));\n }\n // b2t button click event\n $backToTop?.addEventListener('click', () => {\n this.util.scrollIntoView('body');\n });\n window.addEventListener('scroll', (event) => {\n if (this.disableScrollEvent) {\n event.preventDefault();\n return;\n }\n const $mask = document.getElementById('mask');\n this.newScrollTop = this.util.getScrollTop();\n const scroll = this.newScrollTop - this.oldScrollTop;\n // header animation\n this.util.forEach($headers, ($header) => {\n if (scroll > ACCURACY) {\n $header.classList.remove('animate__fadeInDown');\n this.util.animateCSS($header, ['animate__fadeOutUp'], true);\n $mask.click();\n } else if (scroll < -ACCURACY) {\n $header.classList.remove('animate__fadeOutUp');\n this.util.animateCSS($header, ['animate__fadeInDown'], true);\n $mask.click();\n }\n });\n const contentHeight = document.body.scrollHeight - window.innerHeight;\n const scrollPercent = Math.max(Math.min(100 * Math.max(this.newScrollTop, 0) / contentHeight, 100), 0);\n if ($readingProgressBar) {\n $readingProgressBar.style.setProperty('--progress', `${scrollPercent.toFixed(2)}%`);\n }\n // whether to show fixed buttons\n if ($fixedButtons) {\n if (scrollPercent > 1) {\n $fixedButtons.classList.remove('d-none', 'animate__fadeOut');\n this.util.animateCSS($fixedButtons, ['animate__fadeIn'], true);\n } else {\n $fixedButtons.classList.remove('animate__fadeIn');\n this.util.animateCSS($fixedButtons, ['animate__fadeOut'], true, () => {\n $fixedButtons.classList.contains('animate__fadeOut') && $fixedButtons.classList.add('d-none');\n });\n }\n if ($backToTop) {\n $backToTop.querySelector('span').innerText = `${Math.round(scrollPercent)}%`;\n }\n }\n for (let event of this.scrollEventSet) {\n event();\n }\n this.oldScrollTop = this.newScrollTop;\n }, false);\n }\n\n onResize() {\n let resizeBefore = this.util.isMobile();\n window.addEventListener('resize', () => {\n if (!this._resizeTimeout) {\n this._resizeTimeout = window.setTimeout(() => {\n this._resizeTimeout = null;\n for (let event of this.resizeEventSet) {\n event();\n }\n this.initToc();\n this.initMermaid();\n this.initSearch();\n\n const isMobile = this.util.isMobile()\n if (isMobile !== resizeBefore) {\n document.getElementById('mask').click();\n resizeBefore = isMobile;\n }\n }, 100);\n }\n }, false);\n }\n\n onClickMask() {\n document.getElementById('mask').addEventListener('click', () => {\n if (!document.body.classList.contains('blur')) {\n return;\n }\n for (let event of this.clickMaskEventSet) {\n event();\n }\n this.disableScrollEvent = false;\n document.body.classList.remove('blur');\n }, false);\n }\n\n init() {\n try {\n if (this.config.encryption) {\n this.initFixItDecryptor();\n } else if (!this.config.encryption?.all) {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.initPangu();\n }\n this.initThemeColor();\n this.initSVGIcon();\n this.initMenu();\n this.initSwitchTheme();\n this.initSearch();\n this.initCookieconsent();\n this.initSiteTime();\n this.initServiceWorker();\n this.initWatermark();\n this.initMDevtools();\n this.initAutoMark();\n\n window.setTimeout(() => {\n this.initComment();\n if (!this.config.encryption?.all) {\n this.initToc();\n this.initTocListener();\n }\n this.onScroll();\n this.onResize();\n this.onClickMask();\n }, 100);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nconst themeInit = () => {\n window.fixit = new FixIt();\n window.fixit.init();\n};\n\nif (document.readyState !== 'loading') {\n themeInit();\n} else {\n document.addEventListener('DOMContentLoaded', themeInit, false);\n}\n"],"mappings":"u2FAAMA,KAAI,+FACR,iBAAQC,QAAQ,CAAEC,OAAO,CAAE,CACzBD,QAAQ,CAAGA,QAAQ,EAAI,EAAE,CACzB,IAAK,GAAIE,EAAC,CAAG,CAAC,CAAEA,CAAC,CAAGF,QAAQ,CAACG,MAAM,CAAED,CAAC,EAAE,CAAE,CACxCD,OAAO,CAACD,QAAQ,CAACE,CAAC,CAAC,CACrB,CACF,CAAC,4BAED,uBAAe,2BACb,MAAO,wBAACE,QAAQ,CAACC,eAAe,+DAAID,QAAQ,CAACE,IAAI,EAAEC,SACrD,CAAC,wBAED,mBAAW,CACT,MAAOC,OAAM,CAACC,UAAU,CAAC,oCAAoC,CAAC,CAACC,OACjE,CAAC,2BAED,sBAAc,CACZ,MAAOF,OAAM,CAACC,UAAU,CAAC,oCAAoC,CAAC,CAACC,OACjE,CAAC,0BASD,oBAAWC,OAAO,CAAEC,SAAS,CAAEC,QAAQ,CAAEC,QAAQ,CAAE,wBACjD,CAACC,KAAK,CAACC,OAAO,CAACJ,SAAS,CAAC,GAAKA,SAAS,CAAG,CAACA,SAAS,CAAC,CAAC,CACtD,oBAAAD,OAAO,CAACM,SAAS,EAACC,GAAG,2BAAC,mBAAmB,4BA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,GAAIhiB,MAAO,CAC1BzB,MAAM,CAACyjB,KAAK,CAAC1O,IAAI,EACnB,CAAC,CAED,GAAInV,QAAQ,CAACsO,UAAU,GAAK,SAAS,CAAE,CACrCsV,SAAS,EACX,CAAC,IAAM,CACL5jB,QAAQ,CAACe,gBAAgB,CAAC,kBAAkB,CAAE6iB,SAAS,CAAE,KAAK,CAChE"} \ No newline at end of file +{"version":3,"file":"theme.min.js","names":["Util","elements","handler","i","length","document","documentElement","body","scrollTop","window","matchMedia","matches","element","animation","reserved","callback","Array","isArray","classList","add","addEventListener","remove","once","date","Date","isNaN","getTime","selector","startsWith","getElementById","slice","querySelector","scrollIntoView","behavior","FixIt","now","run","config","siteTime","$runTimes","util","isValidDate","clearInterval","parentNode","runTime","days","Math","floor","hours","minutes","seconds","innerHTML","String","padStart","data","isDark","dataset","theme","newScrollTop","getScrollTop","oldScrollTop","scrollEventSet","Set","resizeEventSet","switchThemeEventSet","clickMaskEventSet","disableScrollEvent","objectFitImages","$meta","_themeColorOnSwitchTheme","content","dark","light","forEach","querySelectorAll","$icon","fetch","svgSrc","then","response","text","svg","$temp","createElement","insertAdjacentHTML","$svg","firstChild","$titleElements","getElementsByTagName","removeChild","parentElement","replaceChild","catch","err","console","error","twemoji","parse","initMenuDesktop","initMenuMobile","$item","style","minWidth","offsetWidth","$menuToggleMobile","$menuMobile","event","toggle","contains","_menuMobileOnClickMask","$nestedItem","getElementsByClassName","$themeSwitch","localStorage","setItem","searchConfig","search","isMobile","_searchMobileOnce","_searchDesktopOnce","maxResultLength","snippetLength","highlightTag","isCaseSensitive","minMatchCharLength","findAllMatches","location","threshold","distance","ignoreLocation","useExtendedSearch","ignoreFieldNorm","suffix","$header","$searchInput","$searchToggle","$searchLoading","$searchClear","display","_searchMobile","autocomplete","setVal","_searchMobileOnClickMask","focus","_searchDesktop","_searchDesktopOnClickMask","value","initAutosearch","autosearch","hint","autoselect","dropdownMenuContainer","clearOnSelected","cssClasses","noPrefix","debug","name","source","query","finish","results","type","lunr","queryHandler","_index","ref","metadata","matchData","_indexData","uri","title","context","position","Object","values","matchPosition","substr","lastIndexOf","keys","key","replace","RegExp","lunrIndexURL","json","indexData","lunrLanguageCode","use","field","boost","metadataWhitelist","record","objectID","_algoliaIndex","algoliasearch","algoliaAppID","algoliaSearchKey","initIndex","algoliaIndex","offset","attributesToHighlight","attributesToSnippet","highlightPreTag","highlightPostTag","hits","_highlightResult","_snippetResult","item","refIndex","indices","substring","tag","fuseIndexURL","options","includeScore","shouldSort","includeMatches","Fuse","templates","suggestion","empty","noResultsFound","footer","searchType","icon","href","on","_event","_dataset","_context","assign","lunrSegmentitURL","script","id","src","async","readyState","onreadystatechange","onload","appendChild","$details","$summary","lightgallery","lightGallery","plugins","lgThumbnail","lgZoom","speed","hideBarsDelay","allowMediaOverlap","exThumbImage","toggleThumb","thumbWidth","thumbHeight","actualSize","showZoomInOutIcons","licenseKey","$preChroma","$chroma","className","$table","$tbody","$tr","$td","$codeElements","$code","toLowerCase","$title","$ellipses","code","editable","$edit","editUnLockTitle","$iconKey","$iconLock","$preChromas","editLockTitle","setAttribute","blur","copyTitle","$copy","innerText","trim","maxShownLines","split","navigator","clipboard","writeText","animateCSS","insertBefore","$wrapper","num","$tocCore","APlayer","$newTocCore","cloneNode","kept","isTocStatic","$tocContentStatic","_tocOnScroll","delete","$tocContentAuto","$toc","visibility","$postMeta","marginTop","offsetTop","clientHeight","$tocLinkElements","$tocLiElements","$headerLinkElements","headerIsFixed","headerDesktop","headerHeight","offsetHeight","marginBottom","$tocLink","$tocLi","INDEX_SPACING","activeTocIndex","thisTop","getBoundingClientRect","top","nextTop","$parent","tocHidden","push","math","renderMathInElement","_mermaidOnSwitchTheme","$mermaidElements","themes","mermaid","initialize","startOnLoad","securityLevel","$mermaid","render","svgCode","echarts","registerTheme","lightTheme","darkTheme","_echartsOnSwitchTheme","_echartsArr","dispose","$echarts","chart","init","renderer","setOption","JSON","_echartsOnResize","resize","mapbox","mapboxgl","accessToken","setRTLTextPlugin","RTLTextPlugin","_mapboxArr","$mapbox","lng","lat","zoom","lightStyle","darkStyle","marked","navigation","geolocate","scale","fullscreen","Map","container","center","minZoom","attributionControl","Marker","setLngLat","addTo","addControl","NavigationControl","GeolocateControl","positionOptions","enableHighAccuracy","showUserLocation","trackUserLocation","ScaleControl","FullscreenControl","MapboxLanguage","_mapboxOnSwitchTheme","getContainer","setStyle","typeit","typeitConfig","cursorSpeed","cursorChar","group","typeone","instance","TypeIt","strings","lifeLike","waitUntilVisible","afterComplete","duration","setTimeout","destroy","go","comments","images","$content","$imgs","$img","$link","append","replaceWith","comment","enable","$viewCommentsBtn","expired","artalk","Artalk","LoadCountWidget","server","site","pvEl","countEl","setDarkMode","initCommentLightGallery","gitalk","decodeURI","Gitalk","valine","Valine","waline","pageview","Waline","pageviewCount","serverURL","path","pathname","utterances","utterancesConfig","repo","issueTerm","label","crossOrigin","_utterancesOnSwitchTheme","message","contentWindow","postMessage","twikoo","twikooConfig","onCommentLoaded","commentCount","getCommentsCount","envId","region","urls","includeReply","twikooCommentCount","count","giscus","giscusConfig","_giscusOnSwitchTheme","setConfig","_this","giscus2parentMsg","$script","removeEventListener","cookieconsent","initialise","setInterval","getSiteTime","hidden","enablePWA","serviceWorker","register","scope","registration","ready","watermark","Watermark","outerHTML","appendTo","appendto","opacity","width","height","rowSpacing","rowspacing","colSpacing","colspacing","rotate","fontSize","fontsize","fontFamily","fontfamily","pangu","spacingElementById","spacingElementByClassName","spacingElementByTagName","autoSpacingPage","$tocNodes","decryptor","FixItDecryptor","decrypted","initTwemoji","initDetails","initLightGallery","initHighlight","initTable","initHeaderLink","initMath","initMermaid","initEcharts","initTypeit","initMapbox","$element","initToc","initTocListener","initPangu","reset","encryption","shortcode","initShortcodes","all","mDevtools","orientation","vConsole","VConsole","target","_vConsoleOnSwitchTheme","eruda","defaults","_erudaOnSwitchTheme","evalCss","setTheme","autoBookmark","Number","getItem","hash","scrollTo","$headers","ACCURACY","$fixedButtons","$backToTop","$readingProgressBar","headerMobile","preventDefault","$mask","scroll","click","contentHeight","scrollHeight","innerHeight","scrollPercent","max","min","setProperty","toFixed","round","resizeBefore","_resizeTimeout","initSearch","initFixItDecryptor","initThemeColor","initSVGIcon","initMenu","initSwitchTheme","initCookieconsent","initSiteTime","initServiceWorker","initWatermark","initMDevtools","initAutoMark","initComment","onScroll","onResize","onClickMask","themeInit","fixit"],"sources":["../../src/js/theme.js"],"sourcesContent":["class Util {\n forEach(elements, handler) {\n elements = elements || [];\n for (let i = 0; i < elements.length; i++) {\n handler(elements[i]);\n }\n }\n\n getScrollTop() {\n return (document.documentElement ?? document.body).scrollTop;\n }\n\n isMobile() {\n return window.matchMedia('only screen and (max-width: 680px)').matches;\n }\n\n isTocStatic() {\n return window.matchMedia('only screen and (max-width: 960px)').matches;\n }\n\n /**\n * add animate to element\n * @param {Element} element animate element\n * @param {String|Array} animation animation name\n * @param {Boolean} reserved reserved animation\n * @param {Function} callback remove callback\n */\n animateCSS(element, animation, reserved, callback) {\n !Array.isArray(animation) && (animation = [animation]);\n element.classList.add('animate__animated', ...animation);\n element.addEventListener('animationend', () => {\n !reserved && element.classList.remove('animate__animated', ...animation);\n typeof callback === 'function' && callback();\n }, { once: true });\n }\n\n /**\n * date validator\n * @param {*} date may be date or not\n * @returns {Boolean}\n */\n isValidDate(date) {\n return date instanceof Date && !isNaN(date.getTime());\n }\n \n /**\n * scroll some element into view\n * @param {String} selector element to scroll\n */\n scrollIntoView(selector) {\n const element = selector.startsWith('#')\n ? document.getElementById(selector.slice(1))\n : document.querySelector(selector);\n element?.scrollIntoView({\n behavior: 'smooth'\n });\n }\n}\n\nclass FixIt {\n constructor() {\n this.config = window.config;\n this.data = this.config.data;\n this.isDark = document.body.dataset.theme === 'dark';\n this.util = new Util();\n this.newScrollTop = this.util.getScrollTop();\n this.oldScrollTop = this.newScrollTop;\n this.scrollEventSet = new Set();\n this.resizeEventSet = new Set();\n this.switchThemeEventSet = new Set();\n this.clickMaskEventSet = new Set();\n this.disableScrollEvent = false;\n window.objectFitImages && objectFitImages();\n }\n\n initThemeColor() {\n const $meta = document.querySelector('[name=\"theme-color\"]');\n if (!$meta) {\n return;\n }\n this._themeColorOnSwitchTheme = this._themeColorOnSwitchTheme || (() => {\n $meta.content = this.isDark ? $meta.dataset.dark : $meta.dataset.light;\n });\n this.switchThemeEventSet.add(this._themeColorOnSwitchTheme);\n this._themeColorOnSwitchTheme();\n }\n\n initSVGIcon() {\n this.util.forEach(document.querySelectorAll('[data-svg-src]'), ($icon) => {\n fetch($icon.dataset.svgSrc)\n .then((response) => response.text())\n .then((svg) => {\n const $temp = document.createElement('div');\n $temp.insertAdjacentHTML('afterbegin', svg);\n const $svg = $temp.firstChild;\n $svg.dataset.svgSrc = $icon.dataset.svgSrc\n $svg.classList.add('icon');\n const $titleElements = $svg.getElementsByTagName('title');\n $titleElements.length && $svg.removeChild($titleElements[0]);\n $icon.parentElement.replaceChild($svg, $icon);\n })\n .catch((err) => {\n console.error(err);\n });\n });\n }\n\n initTwemoji() {\n this.config.twemoji && twemoji.parse(document.body);\n }\n\n initMenu() {\n this.initMenuDesktop();\n this.initMenuMobile();\n }\n\n initMenuDesktop() {\n this.util.forEach(document.querySelectorAll('.has-children, #header-desktop .language'), ($item) => {\n $item.querySelector('.sub-menu').style.minWidth = `${$item.offsetWidth - 8}px`;\n });\n }\n\n initMenuMobile() {\n const $menuToggleMobile = document.getElementById('menu-toggle-mobile');\n const $menuMobile = document.getElementById('menu-mobile');\n $menuToggleMobile.addEventListener('click', (event) => {\n document.body.classList.toggle('blur');\n $menuToggleMobile.classList.toggle('active');\n $menuMobile.classList.toggle('active');\n this.disableScrollEvent = document.body.classList.contains('blur');\n }, false);\n this._menuMobileOnClickMask = this._menuMobileOnClickMask || (() => {\n $menuToggleMobile.classList.remove('active');\n $menuMobile.classList.remove('active');\n });\n this.clickMaskEventSet.add(this._menuMobileOnClickMask);\n // add nested menu toggler\n this.util.forEach(document.querySelectorAll('.menu-item>.nested-item'), ($nestedItem) => {\n $nestedItem.addEventListener('click', function () {\n this.parentNode.querySelector('.sub-menu').classList.toggle('open');\n this.querySelector('.dropdown-icon').classList.toggle('open');\n });\n });\n }\n\n initSwitchTheme() {\n this.util.forEach(document.getElementsByClassName('theme-switch'), ($themeSwitch) => {\n $themeSwitch.addEventListener('click', () => {\n document.body.dataset.theme = document.body.dataset.theme === 'dark' ? 'light' : 'dark';\n this.isDark = !this.isDark;\n window.localStorage?.setItem('theme', this.isDark ? 'dark' : 'light');\n for (let event of this.switchThemeEventSet) {\n event();\n }\n }, false);\n });\n }\n\n initSearch() {\n const searchConfig = this.config.search;\n const isMobile = this.util.isMobile();\n if (!searchConfig || (isMobile && this._searchMobileOnce) || (!isMobile && this._searchDesktopOnce)) {\n return;\n }\n // Initialize default search config\n const maxResultLength = searchConfig.maxResultLength ?? 10;\n const snippetLength = searchConfig.snippetLength ?? 50;\n const highlightTag = searchConfig.highlightTag ?? 'em';\n const isCaseSensitive = searchConfig.isCaseSensitive ?? false;\n const minMatchCharLength = searchConfig.minMatchCharLength ?? 1;\n const findAllMatches = searchConfig.findAllMatches ?? false;\n const location = searchConfig.location ?? 0;\n const threshold = searchConfig.threshold ?? 0.3;\n const distance = searchConfig.distance ?? 100;\n const ignoreLocation = searchConfig.ignoreLocation ?? false;\n const useExtendedSearch = searchConfig.useExtendedSearch ?? false;\n const ignoreFieldNorm = searchConfig.ignoreFieldNorm ?? false;\n const suffix = isMobile ? 'mobile' : 'desktop';\n const $header = document.getElementById(`header-${suffix}`);\n const $searchInput = document.getElementById(`search-input-${suffix}`);\n const $searchToggle = document.getElementById(`search-toggle-${suffix}`);\n const $searchLoading = document.getElementById(`search-loading-${suffix}`);\n const $searchClear = document.getElementById(`search-clear-${suffix}`);\n\n if (isMobile) {\n this._searchMobileOnce = true;\n $searchInput.addEventListener('focus', () => {\n this.disableScrollEvent = true;\n document.body.classList.add('blur');\n $header.classList.add('open');\n }, false);\n document.getElementById('search-cancel-mobile').addEventListener('click', () => {\n this.disableScrollEvent = false;\n $header.classList.remove('open');\n document.body.classList.remove('blur');\n document.getElementById('menu-toggle-mobile').classList.remove('active');\n document.getElementById('menu-mobile').classList.remove('active');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n }, false);\n this._searchMobileOnClickMask = this._searchMobileOnClickMask || (() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchMobile && this._searchMobile.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchMobileOnClickMask);\n } else {\n this._searchDesktopOnce = true;\n $searchToggle.addEventListener('click', () => {\n document.body.classList.add('blur');\n $header.classList.add('open');\n $searchInput.focus();\n }, false);\n $searchClear.addEventListener('click', () => {\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n }, false);\n this._searchDesktopOnClickMask = this._searchDesktopOnClickMask ||(() => {\n $header.classList.remove('open');\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'none';\n this._searchDesktop && this._searchDesktop.autocomplete.setVal('');\n });\n this.clickMaskEventSet.add(this._searchDesktopOnClickMask);\n }\n $searchInput.addEventListener('input', () => {\n if ($searchInput.value === '') $searchClear.style.display = 'none';\n else $searchClear.style.display = 'inline';\n }, false);\n\n const initAutosearch = () => {\n const autosearch = autocomplete(`#search-input-${suffix}`,\n {\n hint: false,\n autoselect: true,\n dropdownMenuContainer: `#search-dropdown-${suffix}`,\n clearOnSelected: true,\n cssClasses: { noPrefix: true },\n debug: true\n },\n {\n name: 'search',\n source: (query, callback) => {\n $searchLoading.style.display = 'inline';\n $searchClear.style.display = 'none';\n const finish = (results) => {\n $searchLoading.style.display = 'none';\n $searchClear.style.display = 'inline';\n callback(results);\n };\n if (searchConfig.type === 'lunr') {\n const search = () => {\n if (lunr.queryHandler) {\n query = lunr.queryHandler(query);\n }\n const results = {};\n this._index.search(query).forEach(({ ref, matchData: { metadata } }) => {\n const matchData = this._indexData[ref];\n let { uri, title, content: context } = matchData;\n if (results[uri]) {\n return;\n }\n let position = 0;\n Object.values(metadata).forEach(({ content }) => {\n if (content) {\n const matchPosition = content.position[0][0];\n if (matchPosition < position || position === 0) {\n position = matchPosition;\n }\n }\n });\n position -= snippetLength / 5;\n if (position > 0) {\n position += context.substr(position, 20).lastIndexOf(' ') + 1;\n context = '...' + context.substr(position, snippetLength);\n } else {\n context = context.substr(0, snippetLength);\n }\n Object.keys(metadata).forEach((key) => {\n title = title.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n context = context.replace(new RegExp(`(${key})`, 'gi'), `<${highlightTag}>$1`);\n });\n results[uri] = {\n uri: uri,\n title: title,\n date: matchData.date,\n context: context\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!this._index) {\n fetch(searchConfig.lunrIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const indexData = {};\n this._index = lunr(function () {\n if (searchConfig.lunrLanguageCode) this.use(lunr[searchConfig.lunrLanguageCode]);\n this.ref('objectID');\n this.field('title', { boost: 50 });\n this.field('tags', { boost: 20 });\n this.field('categories', { boost: 20 });\n this.field('content', { boost: 10 });\n this.metadataWhitelist = ['position'];\n data.forEach((record) => {\n indexData[record.objectID] = record;\n this.add(record);\n });\n });\n this._indexData = indexData;\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } else if (searchConfig.type === 'algolia') {\n this._algoliaIndex =\n this._algoliaIndex || algoliasearch(searchConfig.algoliaAppID, searchConfig.algoliaSearchKey).initIndex(searchConfig.algoliaIndex);\n this._algoliaIndex\n .search(query, {\n offset: 0,\n length: maxResultLength * 8,\n attributesToHighlight: ['title'],\n attributesToSnippet: [`content:${snippetLength}`],\n highlightPreTag: `<${highlightTag}>`,\n highlightPostTag: ``\n })\n .then(({ hits }) => {\n const results = {};\n hits.forEach(({ uri, date, _highlightResult: { title }, _snippetResult: { content } }) => {\n if (results[uri] && results[uri].context.length > content.value) {\n return;\n }\n results[uri] = {\n uri: uri,\n title: title.value,\n date: date,\n context: content.value\n };\n });\n finish(Object.values(results).slice(0, maxResultLength));\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else if (searchConfig.type === 'fuse') {\n const search = () => {\n const results = {};\n window._index.search(query).forEach(({ item, refIndex, matches }) => {\n let title = item.title;\n let content = item.content;\n matches.forEach(({ indices, value, key }) => {\n if (key === 'content') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = content.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n content = content.substring(0, indices[i][0] + offset) + tag + content.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n } else if (key === 'title') {\n let offset = 0;\n for (let i = 0; i < indices.length; i++) {\n const substr = title.substring(indices[i][0] + offset, indices[i][1] + 1 + offset);\n const tag = `<${highlightTag}>` + substr + ``;\n title = title.substring(0, indices[i][0] + offset) + tag + title.substring(indices[i][1] + 1 + offset, content.length);\n offset += highlightTag.length * 2 + 5;\n }\n }\n });\n results[item.uri] = {\n uri: item.uri,\n title: title,\n date: item.date,\n context: content\n };\n });\n return Object.values(results).slice(0, maxResultLength);\n };\n if (!window._index) {\n fetch(searchConfig.fuseIndexURL)\n .then((response) => response.json())\n .then((data) => {\n const options = {\n isCaseSensitive: isCaseSensitive,\n findAllMatches: findAllMatches,\n minMatchCharLength: minMatchCharLength,\n location: location,\n threshold: threshold,\n distance: distance,\n ignoreLocation: ignoreLocation,\n useExtendedSearch: useExtendedSearch,\n ignoreFieldNorm: ignoreFieldNorm,\n includeScore: false,\n shouldSort: true,\n includeMatches: true,\n keys: ['content', 'title']\n };\n window._index = new Fuse(data, options);\n finish(search());\n })\n .catch((err) => {\n console.error(err);\n finish([]);\n });\n } else finish(search());\n } \n },\n templates: {\n suggestion: ({ title, date, context }) =>\n `
${title}${date}
${context}
`,\n empty: ({ query }) => `
${searchConfig.noResultsFound}: \"${query}\"
`,\n footer: ({}) => {\n const { searchType, icon, href } =\n searchConfig.type === 'algolia'\n ? {\n searchType: 'algolia',\n icon: '',\n href: 'https://www.algolia.com/'\n }\n : (searchConfig.type === 'lunr'\n ? {\n searchType: 'Lunr.js',\n icon: '',\n href: 'https://lunrjs.com/'\n }\n : {\n searchType: 'Fuse.js',\n icon: '',\n href: 'https://fusejs.io/'\n })\n return ``;\n }\n }\n }\n );\n autosearch.on('autocomplete:selected', (_event, suggestion, _dataset, _context) => {\n window.location.assign(suggestion.uri);\n });\n if (isMobile) {\n this._searchMobile = autosearch;\n } else {\n this._searchDesktop = autosearch;\n }\n };\n if (searchConfig.lunrSegmentitURL && !document.getElementById('lunr-segmentit')) {\n const script = document.createElement('script');\n script.id = 'lunr-segmentit';\n script.src = searchConfig.lunrSegmentitURL;\n script.async = true;\n if (script.readyState) {\n script.onreadystatechange = () => {\n if (script.readyState == 'loaded' || script.readyState == 'complete') {\n script.onreadystatechange = null;\n initAutosearch();\n }\n };\n } else {\n script.onload = () => {\n initAutosearch();\n };\n }\n document.body.appendChild(script);\n } else {\n initAutosearch();\n }\n }\n\n initDetails() {\n this.util.forEach(document.getElementsByClassName('details'), ($details) => {\n const $summary = $details.querySelector('.details-summary');\n $summary.addEventListener('click', () => {\n $details.classList.toggle('open');\n }, false);\n });\n }\n\n initLightGallery() {\n if (this.config.lightgallery) {\n lightGallery(document.getElementById('content'), {\n plugins: [lgThumbnail, lgZoom],\n selector: '.lightgallery',\n speed: 400,\n hideBarsDelay: 2000,\n allowMediaOverlap: true,\n exThumbImage: 'data-thumbnail',\n toggleThumb: true,\n thumbWidth: 80,\n thumbHeight: '60px',\n actualSize: false,\n showZoomInOutIcons: true,\n licenseKey: 'none'\n });\n }\n }\n\n initHighlight() {\n this.util.forEach(document.querySelectorAll('.highlight > pre.chroma'), ($preChroma) => {\n const $chroma = document.createElement('div');\n $chroma.className = $preChroma.className;\n const $table = document.createElement('table');\n $chroma.appendChild($table);\n const $tbody = document.createElement('tbody');\n $table.appendChild($tbody);\n const $tr = document.createElement('tr');\n $tbody.appendChild($tr);\n const $td = document.createElement('td');\n $tr.appendChild($td);\n $preChroma.parentElement.replaceChild($chroma, $preChroma);\n $td.appendChild($preChroma);\n });\n this.util.forEach(document.querySelectorAll('.highlight > .chroma'), ($chroma) => {\n const $codeElements = $chroma.querySelectorAll('pre.chroma > code');\n if ($codeElements.length) {\n const $code = $codeElements[$codeElements.length - 1];\n const $header = document.createElement('div');\n $header.className = 'code-header ' + $code.className.toLowerCase();\n // code title\n const $title = document.createElement('span');\n $title.classList.add('code-title');\n $title.insertAdjacentHTML('afterbegin', '');\n $title.addEventListener('click', () => {\n $chroma.classList.toggle('open');\n }, false);\n $header.appendChild($title);\n // ellipses icon\n const $ellipses = document.createElement('span');\n $ellipses.insertAdjacentHTML('afterbegin', '');\n $ellipses.classList.add('ellipses');\n $ellipses.addEventListener('click', () => {\n $chroma.classList.add('open');\n }, false);\n $header.appendChild($ellipses);\n // edit button\n if (this.config.code.editable) {\n const $edit = document.createElement('span');\n $edit.classList.add('edit');\n $edit.insertAdjacentHTML('afterbegin', ``);\n $edit.addEventListener('click', () => {\n const $iconKey = $edit.querySelector('.fa-key');\n const $iconLock = $edit.querySelector('.fa-lock');\n const $preChromas = $edit.parentElement.parentElement.querySelectorAll('pre.chroma');\n const $preChroma = $preChromas.length === 2 ? $preChromas[1] : $preChromas[0];\n if ($iconKey) {\n $iconKey.classList.add('fa-lock');\n $iconKey.classList.remove('fa-key');\n $iconKey.title = this.config.code.editLockTitle;\n $preChroma.setAttribute('contenteditable', true);\n $preChroma.focus();\n } else {\n $iconLock.classList.add('fa-key');\n $iconLock.classList.remove('fa-lock');\n $iconLock.title = this.config.code.editUnLockTitle;\n $preChroma.setAttribute('contenteditable', false);\n $preChroma.blur();\n }\n }, false);\n $header.appendChild($edit);\n }\n // copy button\n if (this.config.code.copyTitle) {\n const $copy = document.createElement('span');\n $copy.insertAdjacentHTML('afterbegin', '');\n $copy.classList.add('copy');\n // remove the leading and trailing whitespace of the code string\n const code = $code.innerText.trim();\n if (this.config.code.maxShownLines < 0 || code.split('\\n').length < this.config.code.maxShownLines + 2) {\n $chroma.classList.add('open');\n }\n $copy.title = this.config.code.copyTitle;\n $copy.addEventListener('click', () => {\n navigator.clipboard.writeText(code).then(() => {\n this.util.animateCSS($code, 'animate__flash');\n }, () => {\n console.error('Clipboard write failed!', 'Your browser does not support clipboard API!');\n });\n }, false);\n $header.appendChild($copy);\n }\n $chroma.insertBefore($header, $chroma.firstChild);\n }\n });\n }\n\n initTable() {\n this.util.forEach(document.querySelectorAll('.content table'), ($table) => {\n const $wrapper = document.createElement('div');\n $wrapper.className = 'table-wrapper';\n $table.parentElement.replaceChild($wrapper, $table);\n $wrapper.appendChild($table);\n });\n }\n\n initHeaderLink() {\n for (let num = 1; num <= 6; num++) {\n this.util.forEach(document.querySelectorAll('.single .content > h' + num), ($header) => {\n $header.classList.add('header-link');\n $header.insertAdjacentHTML('afterbegin', ``);\n });\n }\n }\n /**\n * init table of contents\n */\n initToc() {\n let $tocCore = document.getElementById('TableOfContents');\n if ($tocCore === null) {\n return;\n }\n // It's a dirty hack to fix scroll bug of APlayer, see https://github.com/hugo-fixit/FixIt/issues/292\n if (typeof APlayer === 'function') {\n const $newTocCore = $tocCore.cloneNode(true);\n $tocCore.parentElement.replaceChild($newTocCore, $tocCore);\n $tocCore = $newTocCore;\n }\n if (document.getElementById('toc-static').dataset.kept === true || this.util.isTocStatic()) {\n const $tocContentStatic = document.getElementById('toc-content-static');\n if ($tocCore.parentElement !== $tocContentStatic) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentStatic.appendChild($tocCore);\n }\n this._tocOnScroll && this.scrollEventSet.delete(this._tocOnScroll);\n } else {\n const $tocContentAuto = document.getElementById('toc-content-auto');\n if ($tocCore.parentElement !== $tocContentAuto) {\n $tocCore.parentElement.removeChild($tocCore);\n $tocContentAuto.appendChild($tocCore);\n }\n const $toc = document.getElementById('toc-auto');\n $toc.style.visibility = 'visible';\n this.util.animateCSS($toc, ['animate__fadeIn', 'animate__faster'], true);\n const $postMeta = document.querySelector('.post-meta');\n $toc.style.marginTop = `${$postMeta.offsetTop + $postMeta.clientHeight}px`;\n const $tocLinkElements = $tocCore.querySelectorAll('a:first-child');\n const $tocLiElements = $tocCore.getElementsByTagName('li');\n const $headerLinkElements = document.getElementsByClassName('header-link');\n const headerIsFixed = document.body.dataset.headerDesktop !== 'normal';\n const headerHeight = document.getElementById('header-desktop').offsetHeight;\n document.querySelector('.container').addEventListener('resize', () => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n });\n this._tocOnScroll = this._tocOnScroll || (() => {\n $toc.style.marginBottom = `${document.querySelector('.container').clientHeight - document.querySelector('.post-footer').offsetTop}px`;\n this.util.forEach($tocLinkElements, ($tocLink) => {\n $tocLink.classList.remove('active');\n });\n this.util.forEach($tocLiElements, ($tocLi) => {\n $tocLi.classList.remove('has-active');\n });\n const INDEX_SPACING = 20 + (headerIsFixed ? headerHeight : 0);\n let activeTocIndex = $headerLinkElements.length - 1;\n for (let i = 0; i < $headerLinkElements.length - 1; i++) {\n const thisTop = $headerLinkElements[i].getBoundingClientRect().top;\n const nextTop = $headerLinkElements[i + 1].getBoundingClientRect().top;\n if ((i == 0 && thisTop > INDEX_SPACING) || (thisTop <= INDEX_SPACING && nextTop > INDEX_SPACING)) {\n activeTocIndex = i;\n break;\n }\n }\n if (activeTocIndex !== -1) {\n $tocLinkElements[activeTocIndex].classList.add('active');\n let $parent = $tocLinkElements[activeTocIndex].parentElement;\n while ($parent !== $tocCore) {\n $parent.classList.add('has-active');\n $parent = $parent.parentElement.parentElement;\n }\n }\n });\n this._tocOnScroll();\n this.scrollEventSet.add(this._tocOnScroll);\n }\n }\n\n initTocListener() {\n const $toc = document.getElementById('toc-auto');\n const $tocContentAuto = document.getElementById('toc-content-auto');\n document.querySelector('#toc-auto>.toc-title')?.addEventListener('click', () => {\n const animation = ['animate__faster'];\n const tocHidden = $toc.classList.contains('toc-hidden');\n animation.push(tocHidden ? 'animate__fadeIn' : 'animate__fadeOut');\n $tocContentAuto.classList.remove(tocHidden ? 'animate__fadeOut' : 'animate__fadeIn');\n this.util.animateCSS($tocContentAuto, animation, true);\n $toc.classList.toggle('toc-hidden');\n }, false);\n }\n\n initMath() {\n if (this.config.math) {\n renderMathInElement(document.body, this.config.math);\n }\n }\n\n initMermaid() {\n this._mermaidOnSwitchTheme = this._mermaidOnSwitchTheme || (() => {\n const $mermaidElements = document.getElementsByClassName('mermaid');\n if ($mermaidElements.length) {\n const themes = this.config.mermaid.themes ?? ['neutral', 'dark'];\n mermaid.initialize({startOnLoad: false, theme: this.isDark ? themes[1] : themes[0], securityLevel: 'loose'});\n this.util.forEach($mermaidElements, $mermaid => {\n mermaid.render('svg-' + $mermaid.id, this.data[$mermaid.id], svgCode => {\n $mermaid.innerHTML = svgCode;\n }, $mermaid);\n });\n }\n });\n this.switchThemeEventSet.add(this._mermaidOnSwitchTheme);\n this._mermaidOnSwitchTheme();\n }\n\n initEcharts() {\n if (!this.config.echarts) {\n return;\n }\n echarts.registerTheme('light', this.config.echarts.lightTheme);\n echarts.registerTheme('dark', this.config.echarts.darkTheme);\n this._echartsOnSwitchTheme = this._echartsOnSwitchTheme || (() => {\n this._echartsArr = this._echartsArr || [];\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].dispose();\n }\n this._echartsArr = [];\n this.util.forEach(document.getElementsByClassName('echarts'), ($echarts) => {\n const chart = echarts.init($echarts, this.isDark ? 'dark' : 'light', { renderer: 'svg' });\n chart.setOption(JSON.parse(this.data[$echarts.id]));\n this._echartsArr.push(chart);\n });\n });\n this.switchThemeEventSet.add(this._echartsOnSwitchTheme);\n this._echartsOnSwitchTheme();\n this._echartsOnResize = this._echartsOnResize || (() => {\n for (let i = 0; i < this._echartsArr.length; i++) {\n this._echartsArr[i].resize();\n }\n });\n this.resizeEventSet.add(this._echartsOnResize);\n }\n\n initMapbox() {\n if (this.config.mapbox) {\n mapboxgl.accessToken = this.config.mapbox.accessToken;\n mapboxgl.setRTLTextPlugin(this.config.mapbox.RTLTextPlugin);\n this._mapboxArr = this._mapboxArr || [];\n this.util.forEach(document.getElementsByClassName('mapbox'), ($mapbox) => {\n const { lng, lat, zoom, lightStyle, darkStyle, marked, navigation, geolocate, scale, fullscreen } = this.data[$mapbox.id];\n const mapbox = new mapboxgl.Map({\n container: $mapbox,\n center: [lng, lat],\n zoom: zoom,\n minZoom: 0.2,\n style: this.isDark ? darkStyle : lightStyle,\n attributionControl: false\n });\n if (marked) {\n new mapboxgl.Marker().setLngLat([lng, lat]).addTo(mapbox);\n }\n if (navigation) {\n mapbox.addControl(new mapboxgl.NavigationControl(), 'bottom-right');\n }\n if (geolocate) {\n mapbox.addControl(\n new mapboxgl.GeolocateControl({\n positionOptions: {\n enableHighAccuracy: true\n },\n showUserLocation: true,\n trackUserLocation: true\n }),\n 'bottom-right'\n );\n }\n if (scale) {\n mapbox.addControl(new mapboxgl.ScaleControl());\n }\n if (fullscreen) {\n mapbox.addControl(new mapboxgl.FullscreenControl());\n }\n mapbox.addControl(new MapboxLanguage());\n this._mapboxArr.push(mapbox);\n });\n this._mapboxOnSwitchTheme = this._mapboxOnSwitchTheme || (() => {\n this.util.forEach(this._mapboxArr, (mapbox) => {\n const $mapbox = mapbox.getContainer();\n const { lightStyle, darkStyle } = this.data[$mapbox.id];\n mapbox.setStyle(this.isDark ? darkStyle : lightStyle);\n mapbox.addControl(new MapboxLanguage());\n });\n });\n this.switchThemeEventSet.add(this._mapboxOnSwitchTheme);\n }\n }\n\n initTypeit() {\n if (this.config.typeit) {\n const typeitConfig = this.config.typeit;\n const speed = typeitConfig.speed || 100;\n const cursorSpeed = typeitConfig.cursorSpeed || 1000;\n const cursorChar = typeitConfig.cursorChar || '|';\n Object.values(typeitConfig.data).forEach((group) => {\n const typeone = (i) => {\n const id = group[i];\n const instance = new TypeIt(`#${id}`, {\n strings: this.data[id],\n speed: speed,\n lifeLike: true,\n cursorSpeed: cursorSpeed,\n cursorChar: cursorChar,\n waitUntilVisible: true,\n afterComplete: () => {\n if (i === group.length - 1) {\n if (typeitConfig.duration >= 0) {\n window.setTimeout(() => {\n instance.destroy();\n }, typeitConfig.duration);\n }\n return;\n }\n instance.destroy();\n typeone(i + 1);\n }\n }).go();\n };\n typeone(0);\n });\n }\n }\n\n initCommentLightGallery(comments, images) {\n document.querySelectorAll(comments).forEach(($content) => {\n const $imgs = $content.querySelectorAll(images + ':not([lightgallery-loaded])');\n $imgs.forEach(($img) => {\n $img.setAttribute('lightgallery-loaded', '');\n const $link = document.createElement('a');\n $link.setAttribute('class', 'comment-lightgallery');\n $link.setAttribute('href', $img.src);\n $link.append($img.cloneNode());\n $img.replaceWith($link);\n });\n if ($imgs.length) {\n lightGallery($content, {\n selector: '.comment-lightgallery',\n actualSize: false,\n hideBarsDelay: 2000,\n speed: 400\n });\n }\n });\n }\n\n initComment() {\n if (!this.config.comment?.enable) {\n return;\n }\n // whether to show the view comments button\n if (document.querySelector('#comments')) {\n const $viewCommentsBtn = document.querySelector('.view-comments');\n $viewCommentsBtn.classList.remove('d-none');\n // view comments button click event\n $viewCommentsBtn.addEventListener('click', () => {\n this.util.scrollIntoView('#comments');\n }, false);\n }\n this.config.comment.expired && document.querySelector('#comments').remove();\n if (this.config.comment.artalk) {\n if (this.config.comment.expired) {\n return Artalk.LoadCountWidget({\n server: this.config.comment.artalk.server,\n site: this.config.comment.artalk.site,\n pvEl: this.config.comment.artalk.pvEl,\n countEl: this.config.comment.artalk.countEl\n })\n }\n const artalk = new Artalk(this.config.comment.artalk);\n artalk.setDarkMode(this.isDark);\n this.switchThemeEventSet.add(() => {\n artalk.setDarkMode(this.isDark);\n });\n artalk.on('comments-loaded', () => {\n this.config.comment.artalk.lightgallery && this.initCommentLightGallery('.atk-comment .atk-content', 'img:not([atk-emoticon])');\n });\n return artalk;\n }\n if (this.config.comment.gitalk) {\n this.config.comment.gitalk.body = decodeURI(window.location.href);\n const gitalk = new Gitalk(this.config.comment.gitalk);\n gitalk.render('gitalk');\n return gitalk;\n }\n if (this.config.comment.valine) {\n return new Valine(this.config.comment.valine);\n }\n if (this.config.comment.waline) {\n if (this.config.comment.expired) {\n this.config.comment.waline.pageview && Waline.pageviewCount({\n serverURL: this.config.comment.waline.serverURL,\n path: window.location.pathname\n });\n return;\n }\n return Waline.init(this.config.comment.waline);\n }\n if (this.config.comment.utterances) {\n const utterancesConfig = this.config.comment.utterances;\n const script = document.createElement('script');\n script.src = 'https://utteranc.es/client.js';\n script.setAttribute('repo', utterancesConfig.repo);\n script.setAttribute('issue-term', utterancesConfig.issueTerm);\n if (utterancesConfig.label) script.setAttribute('label', utterancesConfig.label);\n script.setAttribute('theme', this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme);\n script.crossOrigin = 'anonymous';\n script.async = true;\n document.getElementById('utterances').appendChild(script);\n this._utterancesOnSwitchTheme = this._utterancesOnSwitchTheme || (() => {\n const message = {\n type: 'set-theme',\n theme: this.isDark ? utterancesConfig.darkTheme : utterancesConfig.lightTheme\n };\n document.querySelector('.utterances-frame')?.contentWindow.postMessage(message, 'https://utteranc.es');\n });\n this.switchThemeEventSet.add(this._utterancesOnSwitchTheme);\n return;\n }\n if (this.config.comment.twikoo) {\n const twikooConfig = this.config.comment.twikoo;\n if (twikooConfig.lightgallery) {\n twikooConfig.onCommentLoaded = () => {\n this.initCommentLightGallery('.tk-comments .tk-content', 'img:not(.tk-owo-emotion)');\n };\n }\n twikoo.init(twikooConfig);\n if (twikooConfig.commentCount) {\n // https://twikoo.js.org/api.html#get-comments-count\n twikoo\n .getCommentsCount({\n envId: twikooConfig.envId,\n region: twikooConfig.region,\n urls: [window.location.pathname],\n includeReply: false\n })\n .then(function (response) {\n const twikooCommentCount = document.getElementById('twikoo-comment-count');\n if (twikooCommentCount) twikooCommentCount.innerHTML = response[0].count;\n });\n }\n return;\n }\n if (this.config.comment.giscus) {\n const giscusConfig = this.config.comment.giscus;\n this._giscusOnSwitchTheme = this._giscusOnSwitchTheme || (() => {\n const message = { setConfig: { theme: this.isDark ? giscusConfig.darkTheme : giscusConfig.lightTheme }};\n document.querySelector('.giscus-frame')?.contentWindow.postMessage({ giscus: message }, 'https://giscus.app');\n });\n this.switchThemeEventSet.add(this._giscusOnSwitchTheme);\n const _this = this;\n _this.giscus2parentMsg = window.addEventListener('message', (event) => {\n const $script = document.querySelector('#giscus>script');\n if ($script){\n _this._giscusOnSwitchTheme();\n $script.parentElement.removeChild($script);\n }\n window.removeEventListener('message', _this.giscus2parentMsg);\n });\n return;\n }\n }\n\n initCookieconsent() {\n this.config.cookieconsent && cookieconsent.initialise(this.config.cookieconsent);\n }\n\n getSiteTime = () => {\n let now = new Date();\n let run = new Date(this.config.siteTime);\n let $runTimes = document.querySelector('.run-times');\n if (!this.util.isValidDate(run) || !$runTimes) {\n clearInterval(this.siteTime);\n $runTimes && $runTimes.parentNode.remove();\n return;\n }\n let runTime = (now - run) / 1000,\n days = Math.floor(runTime / 60 / 60 / 24),\n hours = Math.floor(runTime / 60 / 60 - 24 * days),\n minutes = Math.floor(runTime / 60 - 24 * 60 * days - 60 * hours),\n seconds = Math.floor((now - run) / 1000 - 24 * 60 * 60 * days - 60 * 60 * hours - 60 * minutes);\n $runTimes.innerHTML = `${days}, ${String(hours).padStart(2, 0)}:${String(minutes).padStart(2, 0)}:${String(seconds).padStart(2, 0)}`;\n document.querySelector('.site-time .d-none')?.classList.remove('d-none');\n };\n\n initSiteTime() {\n if (this.config.siteTime) {\n this.siteTime = setInterval(this.getSiteTime, 500);\n document.addEventListener('visibilitychange', () => {\n if (document.hidden) {\n return clearInterval(this.siteTime);\n }\n this.siteTime = setInterval(this.getSiteTime, 500);\n }, false);\n }\n }\n\n initServiceWorker() {\n if (this.config.enablePWA && 'serviceWorker' in navigator) {\n navigator.serviceWorker\n .register('/service-worker.min.js', { scope: '/' })\n .then(function (registration) {\n // console.log('Service Worker Registered');\n })\n .catch(function (error) {\n console.error('error: ', error);\n });\n navigator.serviceWorker\n .ready\n .then(function (registration) {\n // console.log('Service Worker Ready');\n });\n }\n }\n\n initWatermark() {\n this.config.watermark?.enable &&\n new Watermark({\n content: this.config.watermark.content || `${document.querySelector('footer .fixit-icon')?.outerHTML ?? ''} FixIt Theme`,\n appendTo: this.config.watermark.appendto || '.wrapper>main',\n opacity: this.config.watermark.opacity,\n width: this.config.watermark.width,\n height: this.config.watermark.height,\n rowSpacing: this.config.watermark.rowspacing,\n colSpacing: this.config.watermark.colspacing,\n rotate: this.config.watermark.rotate,\n fontSize: this.config.watermark.fontsize,\n fontFamily: this.config.watermark.fontfamily\n });\n }\n\n initPangu() {\n if (!this.config.pangu?.enable) {\n return;\n }\n const selector = this.config.pangu.selector;\n if (selector) {\n if (selector.startsWith('#')) {\n pangu.spacingElementById(selector.slice(1));\n } else if (selector.startsWith('.')) {\n pangu.spacingElementByClassName(selector.slice(1));\n } else {\n pangu.spacingElementByTagName(selector)\n }\n return;\n }\n pangu.autoSpacingPage();\n }\n\n initFixItDecryptor() {\n const $tocNodes = document.querySelectorAll('#toc-auto>.d-none, #toc-static.d-none');\n this.decryptor = new FixItDecryptor({\n decrypted: () => {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.remove('d-none');\n });\n this.initToc();\n this.initTocListener();\n this.initPangu();\n },\n reset: () => {\n this.util.forEach($tocNodes, ($element) => {\n $element.classList.add('d-none');\n });\n }\n });\n if (this.config.encryption?.shortcode) {\n this.decryptor.addEventListener('decrypted', () => {\n this.decryptor.initShortcodes();\n })\n this.decryptor.initShortcodes();\n }\n this.config.encryption?.all && this.decryptor.init();\n }\n\n initMDevtools() {\n const type = this.config?.mDevtools;\n if (typeof window.orientation === 'undefined') {\n return;\n }\n if (type === 'vConsole') {\n const vConsole = new VConsole({\n target: '.widgets',\n theme: this.isDark ? 'dark' : 'light'\n });\n this._vConsoleOnSwitchTheme = this._vConsoleOnSwitchTheme || (() => {\n vConsole.setOption('theme', this.isDark ? 'dark' : 'light');\n });\n this.switchThemeEventSet.add(this._vConsoleOnSwitchTheme);\n }\n if(type === 'eruda') {\n eruda.init({\n defaults: { theme: this.isDark ? 'Dark' : 'Light' }\n });\n this._erudaOnSwitchTheme = this._erudaOnSwitchTheme || (() => {\n eruda.util.evalCss.setTheme(this.isDark ? 'Dark' : 'Light');\n });\n this.switchThemeEventSet.add(this._erudaOnSwitchTheme);\n }\n }\n\n initAutoMark() {\n if (!this.config.autoBookmark) {\n return;\n }\n window.addEventListener('beforeunload', () => {\n window.localStorage?.setItem(`fixit-bookmark/#${location.pathname}`, this.util.getScrollTop());\n });\n const scrollTop = Number(window.localStorage?.getItem(`fixit-bookmark/#${location.pathname}`));\n // If the page opens with a specific hash, just jump out\n if (scrollTop && location.hash === '') {\n window.scrollTo({ \n top: scrollTop,\n behavior: 'smooth'\n });\n }\n }\n\n onScroll() {\n const $headers = [];\n const ACCURACY = 20;\n const $fixedButtons = document.querySelector('.fixed-buttons');\n const $backToTop = document.querySelector('.back-to-top');\n const $readingProgressBar = document.querySelector('.reading-progress-bar');\n if (document.body.dataset.headerDesktop === 'auto') {\n $headers.push(document.getElementById('header-desktop'));\n }\n if (document.body.dataset.headerMobile === 'auto') {\n $headers.push(document.getElementById('header-mobile'));\n }\n // b2t button click event\n $backToTop?.addEventListener('click', () => {\n this.util.scrollIntoView('body');\n });\n window.addEventListener('scroll', (event) => {\n if (this.disableScrollEvent) {\n event.preventDefault();\n return;\n }\n const $mask = document.getElementById('mask');\n this.newScrollTop = this.util.getScrollTop();\n const scroll = this.newScrollTop - this.oldScrollTop;\n // header animation\n this.util.forEach($headers, ($header) => {\n if (scroll > ACCURACY) {\n $header.classList.remove('animate__fadeInDown');\n this.util.animateCSS($header, ['animate__fadeOutUp'], true);\n $mask.click();\n } else if (scroll < -ACCURACY) {\n $header.classList.remove('animate__fadeOutUp');\n this.util.animateCSS($header, ['animate__fadeInDown'], true);\n $mask.click();\n }\n });\n const contentHeight = document.body.scrollHeight - window.innerHeight;\n const scrollPercent = Math.max(Math.min(100 * Math.max(this.newScrollTop, 0) / contentHeight, 100), 0);\n if ($readingProgressBar) {\n $readingProgressBar.style.setProperty('--progress', `${scrollPercent.toFixed(2)}%`);\n }\n // whether to show fixed buttons\n if ($fixedButtons) {\n if (scrollPercent > 1) {\n $fixedButtons.classList.remove('d-none', 'animate__fadeOut');\n this.util.animateCSS($fixedButtons, ['animate__fadeIn'], true);\n } else {\n $fixedButtons.classList.remove('animate__fadeIn');\n this.util.animateCSS($fixedButtons, ['animate__fadeOut'], true, () => {\n $fixedButtons.classList.contains('animate__fadeOut') && $fixedButtons.classList.add('d-none');\n });\n }\n if ($backToTop) {\n $backToTop.querySelector('span').innerText = `${Math.round(scrollPercent)}%`;\n }\n }\n for (let event of this.scrollEventSet) {\n event();\n }\n this.oldScrollTop = this.newScrollTop;\n }, false);\n }\n\n onResize() {\n let resizeBefore = this.util.isMobile();\n window.addEventListener('resize', () => {\n if (!this._resizeTimeout) {\n this._resizeTimeout = window.setTimeout(() => {\n this._resizeTimeout = null;\n for (let event of this.resizeEventSet) {\n event();\n }\n this.initToc();\n this.initMermaid();\n this.initSearch();\n\n const isMobile = this.util.isMobile()\n if (isMobile !== resizeBefore) {\n document.getElementById('mask').click();\n resizeBefore = isMobile;\n }\n }, 100);\n }\n }, false);\n }\n\n onClickMask() {\n document.getElementById('mask').addEventListener('click', () => {\n if (!document.body.classList.contains('blur')) {\n return;\n }\n for (let event of this.clickMaskEventSet) {\n event();\n }\n this.disableScrollEvent = false;\n document.body.classList.remove('blur');\n }, false);\n }\n\n init() {\n try {\n if (this.config.encryption) {\n this.initFixItDecryptor();\n } else if (!this.config.encryption?.all) {\n this.initTwemoji();\n this.initDetails();\n this.initLightGallery();\n this.initHighlight();\n this.initTable();\n this.initHeaderLink();\n this.initMath();\n this.initMermaid();\n this.initEcharts();\n this.initTypeit();\n this.initMapbox();\n this.initPangu();\n }\n this.initThemeColor();\n this.initSVGIcon();\n this.initMenu();\n this.initSwitchTheme();\n this.initSearch();\n this.initCookieconsent();\n this.initSiteTime();\n this.initServiceWorker();\n this.initWatermark();\n this.initMDevtools();\n this.initAutoMark();\n\n window.setTimeout(() => {\n this.initComment();\n if (!this.config.encryption?.all) {\n this.initToc();\n this.initTocListener();\n }\n this.onScroll();\n this.onResize();\n this.onClickMask();\n }, 100);\n } catch (err) {\n console.error(err);\n }\n }\n}\n\nconst themeInit = () => {\n window.fixit = new FixIt();\n window.fixit.init();\n};\n\nif (document.readyState !== 'loading') {\n themeInit();\n} else {\n document.addEventListener('DOMContentLoaded', themeInit, false);\n}\n"],"mappings":"u2FAAMA,KAAI,+FACR,iBAAQC,QAAQ,CAAEC,OAAO,CAAE,CACzBD,QAAQ,CAAGA,QAAQ,EAAI,EAAE,CACzB,IAAK,GAAIE,EAAC,CAAG,CAAC,CAAEA,CAAC,CAAGF,QAAQ,CAACG,MAAM,CAAED,CAAC,EAAE,CAAE,CACxCD,OAAO,CAACD,QAAQ,CAACE,CAAC,CAAC,CACrB,CACF,CAAC,4BAED,uBAAe,2BACb,MAAO,wBAACE,QAAQ,CAACC,eAAe,+DAAID,QAAQ,CAACE,IAAI,EAAEC,SACrD,CAAC,wBAED,mBAAW,CACT,MAAOC,OAAM,CAACC,UAAU,CAAC,oCAAoC,CAAC,CAACC,OACjE,CAAC,2BAED,sBAAc,CACZ,MAAOF,OAAM,CAACC,UAAU,CAAC,oCAAoC,CAAC,CAACC,OACjE,CAAC,0BASD,oBAAWC,OAAO,CAAEC,SAAS,CAAEC,QAAQ,CAAEC,QAAQ,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,CAClB,GAAI,yBAAC,OAAI,CAAC1hB,MAAM,CAACqe,UAAU,0CAAtB,sBAAwBG,GAAG,EAAE,CAChC,OAAI,CAACP,OAAO,EAAE,CACd,OAAI,CAACC,eAAe,EACtB,CACA,OAAI,CAACyD,QAAQ,EAAE,CACf,OAAI,CAACC,QAAQ,EAAE,CACf,OAAI,CAACC,WAAW,EAClB,CAAC,CAAE,GAAG,CACR,CAAE,MAAOre,GAAG,CAAE,CACZC,OAAO,CAACC,KAAK,CAACF,GAAG,CACnB,CACF,CAAC,oBAGH,GAAMse,UAAS,CAAG,QAAZA,UAAS,EAAS,CACtB1jB,MAAM,CAAC2jB,KAAK,CAAG,GAAIliB,MAAO,CAC1BzB,MAAM,CAAC2jB,KAAK,CAACzO,IAAI,EACnB,CAAC,CAED,GAAItV,QAAQ,CAACsO,UAAU,GAAK,SAAS,CAAE,CACrCwV,SAAS,EACX,CAAC,IAAM,CACL9jB,QAAQ,CAACe,gBAAgB,CAAC,kBAAkB,CAAE+iB,SAAS,CAAE,KAAK,CAChE"} \ No newline at end of file diff --git a/src/js/theme.js b/src/js/theme.js index fb40f8f30..3364b96ac 100644 --- a/src/js/theme.js +++ b/src/js/theme.js @@ -612,10 +612,16 @@ class FixIt { * init table of contents */ initToc() { - const $tocCore = document.getElementById('TableOfContents'); + let $tocCore = document.getElementById('TableOfContents'); if ($tocCore === null) { return; } + // It's a dirty hack to fix the bug of APlayer, see https://github.com/hugo-fixit/FixIt/issues/292 + if (typeof APlayer === 'function') { + const $newTocCore = $tocCore.cloneNode(true); + $tocCore.parentElement.replaceChild($newTocCore, $tocCore); + $tocCore = $newTocCore; + } if (document.getElementById('toc-static').dataset.kept === true || this.util.isTocStatic()) { const $tocContentStatic = document.getElementById('toc-content-static'); if ($tocCore.parentElement !== $tocContentStatic) {