colortheme-5cd55a83.bundle.min.js 5.3 KB

1
  1. (()=>{var t={7148:function(t){var e,r,n,i;e=this,r=this&&this.define,n={version:"2.14.3",areas:{},apis:{},nsdelim:".",inherit:function(t,e){for(var r in t)e.hasOwnProperty(r)||Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r));return e},stringify:function(t,e){return void 0===t||"function"==typeof t?t+"":JSON.stringify(t,e||n.replace)},parse:function(t,e){try{return JSON.parse(t,e||n.revive)}catch(e){return t}},fn:function(t,e){for(var r in n.storeAPI[t]=e,n.apis)n.apis[r][t]=e},get:function(t,e){return t.getItem(e)},set:function(t,e,r){t.setItem(e,r)},remove:function(t,e){t.removeItem(e)},key:function(t,e){return t.key(e)},length:function(t){return t.length},clear:function(t){t.clear()},Store:function(t,e,r){var i=n.inherit(n.storeAPI,(function(t,e,r){return 0===arguments.length?i.getAll():"function"==typeof e?i.transact(t,e,r):void 0!==e?i.set(t,e,r):"string"==typeof t||"number"==typeof t?i.get(t):"function"==typeof t?i.each(t):t?i.setAll(t,e):i.clear()}));i._id=t;try{var s="__store2_test";e.setItem(s,"ok"),i._area=e,e.removeItem(s)}catch(t){i._area=n.storage("fake")}return i._ns=r||"",n.areas[t]||(n.areas[t]=i._area),n.apis[i._ns+i._id]||(n.apis[i._ns+i._id]=i),i},storeAPI:{area:function(t,e){var r=this[t];return r&&r.area||(r=n.Store(t,e,this._ns),this[t]||(this[t]=r)),r},namespace:function(t,e,r){if(r=r||this._delim||n.nsdelim,!t)return this._ns?this._ns.substring(0,this._ns.length-r.length):"";var i=t,s=this[i];if(!(s&&s.namespace||((s=n.Store(this._id,this._area,this._ns+i+r))._delim=r,this[i]||(this[i]=s),e)))for(var a in n.areas)s.area(a,n.areas[a]);return s},isFake:function(t){return t?(this._real=this._area,this._area=n.storage("fake")):!1===t&&(this._area=this._real||this._area),"fake"===this._area.name},toString:function(){return"store"+(this._ns?"."+this.namespace():"")+"["+this._id+"]"},has:function(t){return this._area.has?this._area.has(this._in(t)):!!(this._in(t)in this._area)},size:function(){return this.keys().length},each:function(t,e){for(var r=0,i=n.length(this._area);r<i;r++){var s=this._out(n.key(this._area,r));if(void 0!==s&&!1===t.call(this,s,this.get(s),e))break;i>n.length(this._area)&&(i--,r--)}return e||this},keys:function(t){return this.each((function(t,e,r){r.push(t)}),t||[])},get:function(t,e){var r,i=n.get(this._area,this._in(t));return"function"==typeof e&&(r=e,e=null),null!==i?n.parse(i,r):null!=e?e:i},getAll:function(t){return this.each((function(t,e,r){r[t]=e}),t||{})},transact:function(t,e,r){var n=this.get(t,r),i=e(n);return this.set(t,void 0===i?n:i),this},set:function(t,e,r){var i,s=this.get(t);return null!=s&&!1===r?e:("function"==typeof r&&(i=r,r=void 0),n.set(this._area,this._in(t),n.stringify(e,i),r)||s)},setAll:function(t,e){var r,n;for(var i in t)n=t[i],this.set(i,n,e)!==n&&(r=!0);return r},add:function(t,e,r){var i=this.get(t);if(i instanceof Array)e=i.concat(e);else if(null!==i){var s=typeof i;if(s===typeof e&&"object"===s){for(var a in e)i[a]=e[a];e=i}else e=i+e}return n.set(this._area,this._in(t),n.stringify(e,r)),e},remove:function(t,e){var r=this.get(t,e);return n.remove(this._area,this._in(t)),r},clear:function(){return this._ns?this.each((function(t){n.remove(this._area,this._in(t))}),1):n.clear(this._area),this},clearAll:function(){var t=this._area;for(var e in n.areas)n.areas.hasOwnProperty(e)&&(this._area=n.areas[e],this.clear());return this._area=t,this},_in:function(t){return"string"!=typeof t&&(t=n.stringify(t)),this._ns?this._ns+t:t},_out:function(t){return this._ns?t&&0===t.indexOf(this._ns)?t.substring(this._ns.length):void 0:t}},storage:function(t){return n.inherit(n.storageAPI,{items:{},name:t})},storageAPI:{length:0,has:function(t){return this.items.hasOwnProperty(t)},key:function(t){var e=0;for(var r in this.items)if(this.has(r)&&t===e++)return r},setItem:function(t,e){this.has(t)||this.length++,this.items[t]=e},removeItem:function(t){this.has(t)&&(delete this.items[t],this.length--)},getItem:function(t){return this.has(t)?this.items[t]:null},clear:function(){for(var t in this.items)this.removeItem(t)}}},(i=n.Store("local",function(){try{return localStorage}catch(t){}}())).local=i,i._=n,i.area("session",function(){try{return sessionStorage}catch(t){}}()),i.area("page",n.storage("page")),"function"==typeof r&&void 0!==r.amd?r("store2",[],(function(){return i})):t.exports?t.exports=i:(e.store&&(n.conflict=e.store),e.store=i)}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var s=e[n]={exports:{}};return t[n].call(s.exports,s,s.exports,r),s.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{"use strict";var t=r(7148),e=r.n(t);const n="auto",i="hugo-geekdoc",s=[n,"dark","light"];function a(t=!0){if(e().isFake())return;let r=e().namespace(i),a=document.documentElement,o=s.includes(r.get("color-theme"))?r.get("color-theme"):n;a.setAttribute("class","color-toggle-"+o),o===n?a.removeAttribute("color-theme"):a.setAttribute("color-theme",o),t||location.reload()}a(),document.addEventListener("DOMContentLoaded",(t=>{document.getElementById("gdoc-color-theme").onclick=function(){let t=e().namespace(i),r=t.get("color-theme")||n,o=function(t=[],e){let r=t.indexOf(e),n=0;return r<t.length-1&&(n=r+1),n}(s,r);t.set("color-theme",s[o]),a(!1)}}))})()})();