- Add serve.py to resolve clean Quartz URLs to .html files - Regenerate Quartz site with correct baseUrl http://100.118.5.51:9120 - 196 HTML files emitted; all internal links now resolve
2 lines
73 KiB
JavaScript
2 lines
73 KiB
JavaScript
var Rn=Object.create;var Ne=Object.defineProperty;var Wn=Object.getOwnPropertyDescriptor;var Nn=Object.getOwnPropertyNames;var zn=Object.getPrototypeOf,On=Object.prototype.hasOwnProperty;var $n=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Kn=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nn(e))!On.call(t,i)&&i!==n&&Ne(t,i,{get:()=>e[i],enumerable:!(r=Wn(e,i))||r.enumerable});return t};var Un=(t,e,n)=>(n=t!=null?Rn(zn(t)):{},Kn(e||!t||!t.__esModule?Ne(n,"default",{value:t,enumerable:!0}):n,t));var fe=$n(()=>{});var C;function O(t,e,n){let r=typeof n,i=typeof t;if(r!=="undefined"){if(i!=="undefined"){if(n){if(i==="function"&&r===i)return function(o){return t(n(o))};if(e=t.constructor,e===n.constructor){if(e===Array)return n.concat(t);if(e===Map){var s=new Map(n);for(var u of t)s.set(u[0],u[1]);return s}if(e===Set){u=new Set(n);for(s of t.values())u.add(s);return u}}}return t}return n}return i==="undefined"?e:t}function Ct(t,e){return typeof t>"u"?e:t}function R(){return Object.create(null)}function U(t){return typeof t=="string"}function Lt(t){return typeof t=="object"}function Mt(t,e){if(U(e))t=t[e];else for(let n=0;t&&n<e.length;n++)t=t[e[n]];return t}var Vn=/[^\p{L}\p{N}]+/u,Jn=/(\d{3})/g,Xn=/(\D)(\d{3})/g,Zn=/(\d{3})(\D)/g,ze=/[\u0300-\u036f]/g;function vt(t={}){if(!this||this.constructor!==vt)return new vt(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}C=vt.prototype;C.assign=function(t){this.normalize=O(t.normalize,!0,this.normalize);let e=t.include,n=e||t.exclude||t.split,r;if(n||n===""){if(typeof n=="object"&&n.constructor!==RegExp){let i="";r=!e,e||(i+="\\p{Z}"),n.letter&&(i+="\\p{L}"),n.number&&(i+="\\p{N}",r=!!e),n.symbol&&(i+="\\p{S}"),n.punctuation&&(i+="\\p{P}"),n.control&&(i+="\\p{C}"),(n=n.char)&&(i+=typeof n=="object"?n.join(""):n);try{this.split=new RegExp("["+(e?"^":"")+i+"]+","u")}catch{this.split=/\s+/}}else this.split=n,r=n===!1||"a1a".split(n).length<2;this.numeric=O(t.numeric,r)}else{try{this.split=O(this.split,Vn)}catch{this.split=/\s+/}this.numeric=O(t.numeric,O(this.numeric,!0))}if(this.prepare=O(t.prepare,null,this.prepare),this.finalize=O(t.finalize,null,this.finalize),n=t.filter,this.filter=typeof n=="function"?n:O(n&&new Set(n),null,this.filter),this.dedupe=O(t.dedupe,!0,this.dedupe),this.matcher=O((n=t.matcher)&&new Map(n),null,this.matcher),this.mapper=O((n=t.mapper)&&new Map(n),null,this.mapper),this.stemmer=O((n=t.stemmer)&&new Map(n),null,this.stemmer),this.replacer=O(t.replacer,null,this.replacer),this.minlength=O(t.minlength,1,this.minlength),this.maxlength=O(t.maxlength,1024,this.maxlength),this.rtl=O(t.rtl,!1,this.rtl),(this.cache=n=O(t.cache,!0,this.cache))&&(this.F=null,this.L=typeof n=="number"?n:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(let i of this.matcher.keys())this.h+=(this.h?"|":"")+i;if(this.stemmer)for(let i of this.stemmer.keys())this.A+=(this.A?"|":"")+i;return this};C.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&>(this),this};C.addFilter=function(t){return typeof t=="function"?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&>(this),this};C.addMapper=function(t,e){return typeof t=="object"?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&>(this),this)};C.addMatcher=function(t,e){return typeof t=="object"?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&>(this),this)};C.addReplacer=function(t,e){return typeof t=="string"?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&>(this),this)};C.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(gt,50,this);this.normalize&&(typeof this.normalize=="function"?t=this.normalize(t):t=ze?t.normalize("NFKD").replace(ze,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(Xn,"$1 $2").replace(Zn,"$1 $2").replace(Jn,"$1 "));let n=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer),r=[],i=R(),s,u,o=this.split||this.split===""?t.split(this.split):[t];for(let c=0,f,h;c<o.length;c++)if((f=h=o[c])&&!(f.length<this.minlength||f.length>this.maxlength)){if(e){if(i[f])continue;i[f]=1}else{if(s===f)continue;s=f}if(n)r.push(f);else if(!this.filter||(typeof this.filter=="function"?this.filter(f):!this.filter.has(f))){if(this.cache&&f.length<=this.I)if(this.F){var l=this.D.get(f);if(l||l===""){l&&r.push(l);continue}}else this.F=setTimeout(gt,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));let d;for(;d!==f&&f.length>2;)d=f,f=f.replace(this.K,a=>this.stemmer.get(a))}if(f&&(this.mapper||this.dedupe&&f.length>1)){l="";for(let d=0,a="",D,p;d<f.length;d++)D=f.charAt(d),D===a&&this.dedupe||((p=this.mapper&&this.mapper.get(D))||p===""?p===a&&this.dedupe||!(a=p)||(l+=p):l+=a=D);f=l}if(this.matcher&&f.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),f=f.replace(this.J,d=>this.matcher.get(d))),f&&this.replacer)for(l=0;f&&l<this.replacer.length;l+=2)f=f.replace(this.replacer[l],this.replacer[l+1]);if(this.cache&&h.length<=this.I&&(this.D.set(h,f),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),f){if(f!==h)if(e){if(i[f])continue;i[f]=1}else{if(u===f)continue;u=f}r.push(f)}}}return this.finalize&&(r=this.finalize(r)||r),this.cache&&t.length<=this.H&&(this.B.set(t,r),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),r};function gt(t){t.F=null,t.B.clear(),t.D.clear()}function Fe(t,e,n){n||(e||typeof t!="object"?typeof e=="object"&&(n=e,e=0):n=t),n&&(t=n.query||t,e=n.limit||e);let r=""+(e||0);n&&(r+=(n.offset||0)+!!n.context+!!n.suggest+(n.resolve!==!1)+(n.resolution||this.resolution)+(n.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new mt);let i=this.cache.get(t+r);if(!i){let s=n&&n.cache;s&&(n.cache=!1),i=this.search(t,e,n),s&&(n.cache=s),this.cache.set(t+r,i)}return i}function mt(t){this.limit=t&&t!==!0?t:1e3,this.cache=new Map,this.h=""}mt.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)};mt.prototype.get=function(t){let e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e};mt.prototype.remove=function(t){for(let e of this.cache){let n=e[0];e[1].includes(t)&&this.cache.delete(n)}};mt.prototype.clear=function(){this.cache.clear(),this.h=""};var Oe={normalize:!1,numeric:!1,dedupe:!1},Ot={},ae=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),$e=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),Ke=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],Ue={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,\u00DF:2,d:3,t:3,l:4,m:5,n:5,r:6},_e={Exact:Oe,Default:Ot,Normalize:Ot,LatinBalance:{mapper:ae},LatinAdvanced:{mapper:ae,matcher:$e,replacer:Ke},LatinExtra:{mapper:ae,replacer:Ke.concat([/(?!^)[aeo]/g,""]),matcher:$e},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let n=0;n<t.length;n++){var e=t[n];let r=e.charAt(0),i=Ue[r];for(let s=1,u;s<e.length&&(u=e.charAt(s),u==="h"||u==="w"||!(u=Ue[u])||u===i||(r+=u,i=u,r.length!==4));s++);t[n]=r}}},CJK:{split:""},LatinExact:Oe,LatinDefault:Ot,LatinSimple:Ot};function Ve(t,e,n,r){let i=[];for(let s=0,u;s<t.index.length;s++)if(u=t.index[s],e>=u.length)e-=u.length;else{e=u[r?"splice":"slice"](e,n);let o=e.length;if(o&&(i=i.length?i.concat(e):e,n-=o,r&&(t.length-=o),!n))break;e=0}return i}function xt(t){if(!this||this.constructor!==xt)return new xt(t);this.index=t?[t]:[],this.length=t?t.length:0;let e=this;return new Proxy([],{get(n,r){if(r==="length")return e.length;if(r==="push")return function(i){e.index[e.index.length-1].push(i),e.length++};if(r==="pop")return function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()};if(r==="indexOf")return function(i){let s=0;for(let u=0,o,l;u<e.index.length;u++){if(o=e.index[u],l=o.indexOf(i),l>=0)return s+l;s+=o.length}return-1};if(r==="includes")return function(i){for(let s=0;s<e.index.length;s++)if(e.index[s].includes(i))return!0;return!1};if(r==="slice")return function(i,s){return Ve(e,i||0,s||e.length,!1)};if(r==="splice")return function(i,s){return Ve(e,i||0,s||e.length,!0)};if(r==="constructor")return Array;if(typeof r!="symbol")return(n=e.index[r/2**31|0])&&n[r]},set(n,r,i){return n=r/2**31|0,(e.index[n]||(e.index[n]=[]))[r]=i,e.length++,!0}})}xt.prototype.clear=function(){this.index.length=0};xt.prototype.push=function(){};function V(t=8){if(!this||this.constructor!==V)return new V(t);this.index=R(),this.h=[],this.size=0,t>32?(this.B=tn,this.A=BigInt(t)):(this.B=qe,this.A=t)}V.prototype.get=function(t){let e=this.index[this.B(t)];return e&&e.get(t)};V.prototype.set=function(t,e){var n=this.B(t);let r=this.index[n];r?(n=r.size,r.set(t,e),(n-=r.size)&&this.size++):(this.index[n]=r=new Map([[t,e]]),this.h.push(r),this.size++)};function J(t=8){if(!this||this.constructor!==J)return new J(t);this.index=R(),this.h=[],this.size=0,t>32?(this.B=tn,this.A=BigInt(t)):(this.B=qe,this.A=t)}J.prototype.add=function(t){var e=this.B(t);let n=this.index[e];n?(e=n.size,n.add(t),(e-=n.size)&&this.size++):(this.index[e]=n=new Set([t]),this.h.push(n),this.size++)};C=V.prototype;C.has=J.prototype.has=function(t){let e=this.index[this.B(t)];return e&&e.has(t)};C.delete=J.prototype.delete=function(t){let e=this.index[this.B(t)];e&&e.delete(t)&&this.size--};C.clear=J.prototype.clear=function(){this.index=R(),this.h=[],this.size=0};C.values=J.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e};C.keys=J.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e};C.entries=J.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};function qe(t){let e=2**this.A-1;if(typeof t=="number")return t&e;let n=0,r=this.A+1;for(let i=0;i<t.length;i++)n=(n*r^t.charCodeAt(i))&e;return this.A===32?n+2**31:n}function tn(t){let e=BigInt(2)**this.A-BigInt(1);var n=typeof t;if(n==="bigint")return t&e;if(n==="number")return BigInt(t)&e;n=BigInt(0);let r=this.A+BigInt(1);for(let i=0;i<t.length;i++)n=(n*r^BigInt(t.charCodeAt(i)))&e;return n}var Et,St;async function Qn(t){t=t.data;var e=t.task;let n=t.id,r=t.args;if(e==="init")St=t.options||{},(e=t.factory)?(Function("return "+e)()(self),Et=new self.FlexSearch.Index(St),delete self.FlexSearch):Et=new X(St),postMessage({id:n});else{let i;e==="export"&&(r[1]?(r[0]=St.export,r[2]=0,r[3]=1):r=null),e==="import"?r[0]&&(t=await St.import.call(Et,r[0]),Et.import(r[0],t)):((i=r&&Et[e].apply(Et,r))&&i.then&&(i=await i),i&&i.await&&(i=await i.await),e==="search"&&i.result&&(i=i.result)),postMessage(e==="search"?{id:n,msg:i}:{id:n})}}function ye(t){At.call(t,"add"),At.call(t,"append"),At.call(t,"search"),At.call(t,"update"),At.call(t,"remove"),At.call(t,"searchCache")}var ge,Je,Ut;function Yn(){ge=Ut=0}function At(t){this[t+"Async"]=function(){let e=arguments;var n=e[e.length-1];let r;if(typeof n=="function"&&(r=n,delete e[e.length-1]),ge?Ut||(Ut=Date.now()-Je>=this.priority*this.priority*3):(ge=setTimeout(Yn,0),Je=Date.now()),Ut){let s=this;return new Promise(u=>{setTimeout(function(){u(s[t+"Async"].apply(s,e))},0)})}let i=this[t].apply(this,e);return n=i.then?i:new Promise(s=>s(i)),r&&n.then(r),n}}var it=0;function dt(t={},e){function n(o){function l(c){c=c.data||c;let f=c.id,h=f&&s.h[f];h&&(h(c.msg),delete s.h[f])}if(this.worker=o,this.h=R(),this.worker)return i?this.worker.on("message",l):this.worker.onmessage=l,t.config?new Promise(function(c){it>1e9&&(it=0),s.h[++it]=function(){c(s)},s.worker.postMessage({id:it,task:"init",factory:r,options:t})}):(this.priority=t.priority||4,this.encoder=e||null,this.worker.postMessage({task:"init",factory:r,options:t}),this)}if(!this||this.constructor!==dt)return new dt(t);let r=typeof self<"u"?self._factory:typeof window<"u"?window._factory:null;r&&(r=r.toString());let i=typeof window>"u",s=this,u=Gn(r,i,t.worker);return u.then?u.then(function(o){return n.call(s,o)}):n.call(this,u)}rt("add");rt("append");rt("search");rt("update");rt("remove");rt("clear");rt("export");rt("import");dt.prototype.searchCache=Fe;ye(dt.prototype);function rt(t){dt.prototype[t]=function(){let e=this,n=[].slice.call(arguments);var r=n[n.length-1];let i;return typeof r=="function"&&(i=r,n.pop()),r=new Promise(function(s){t==="export"&&typeof n[0]=="function"&&(n[0]=null),it>1e9&&(it=0),e.h[++it]=s,e.worker.postMessage({task:t,id:it,args:n})}),i?(r.then(i),this):r}}function Gn(t,e,n){return e?typeof module<"u"?new(fe()).Worker(__dirname+"/worker/node.js"):Promise.resolve().then(()=>Un(fe(),1)).then(function(r){return new r.Worker(import.meta.dirname+"/node/node.mjs")}):t?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Qn.toString()],{type:"text/javascript"}))):new window.Worker(typeof n=="string"?n:import.meta.url.replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}Dt.prototype.add=function(t,e,n){if(Lt(t)&&(e=t,t=Mt(e,this.key)),e&&(t||t===0)){if(!n&&this.reg.has(t))return this.update(t,e);for(let o=0,l;o<this.field.length;o++){l=this.B[o];var r=this.index.get(this.field[o]);if(typeof l=="function"){var i=l(e);i&&r.add(t,i,n,!0)}else i=l.G,(!i||i(e))&&(l.constructor===String?l=[""+l]:U(l)&&(l=[l]),De(e,l,this.D,0,r,t,l[0],n))}if(this.tag)for(r=0;r<this.A.length;r++){var s=this.A[r];i=this.tag.get(this.F[r]);let o=R();if(typeof s=="function"){if(s=s(e),!s)continue}else{var u=s.G;if(u&&!u(e))continue;s.constructor===String&&(s=""+s),s=Mt(e,s)}if(i&&s){U(s)&&(s=[s]);for(let l=0,c,f;l<s.length;l++)if(c=s[l],!o[c]&&(o[c]=1,(u=i.get(c))?f=u:i.set(c,f=[]),!n||!f.includes(t))){if(f.length===2**31-1){if(u=new xt(f),this.fastupdate)for(let h of this.reg.values())h.includes(f)&&(h[h.indexOf(f)]=u);i.set(c,f=u)}f.push(t),this.fastupdate&&((u=this.reg.get(t))?u.push(f):this.reg.set(t,[f]))}}}if(this.store&&(!n||!this.store.has(t))){let o;if(this.h){o=R();for(let l=0,c;l<this.h.length;l++){if(c=this.h[l],(n=c.G)&&!n(e))continue;let f;if(typeof c=="function"){if(f=c(e),!f)continue;c=[c.O]}else if(U(c)||c.constructor===String){o[c]=e[c];continue}de(e,o,c,0,c[0],f)}}this.store.set(t,o||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this};function de(t,e,n,r,i,s){if(t=t[i],r===n.length-1)e[i]=s||t;else if(t)if(t.constructor===Array)for(e=e[i]=Array(t.length),i=0;i<t.length;i++)de(t,e,n,r,i);else e=e[i]||(e[i]=R()),i=n[++r],de(t,e,n,r,i)}function De(t,e,n,r,i,s,u,o){if(t=t[u])if(r===e.length-1){if(t.constructor===Array){if(n[r]){for(e=0;e<t.length;e++)i.add(s,t[e],!0,!0);return}t=t.join(" ")}i.add(s,t,o,!0)}else if(t.constructor===Array)for(u=0;u<t.length;u++)De(t,e,n,r,i,s,u,o);else u=e[++r],De(t,e,n,r,i,s,u,o)}function Ce(t,e,n,r){if(!t.length)return t;if(t.length===1)return t=t[0],t=n||t.length>e?t.slice(n,n+e):t,r?wt.call(this,t):t;let i=[];for(let s=0,u,o;s<t.length;s++)if((u=t[s])&&(o=u.length)){if(n){if(n>=o){n-=o;continue}u=u.slice(n,n+e),o=u.length,n=0}if(o>e&&(u=u.slice(0,e),o=e),!i.length&&o>=e)return r?wt.call(this,u):u;if(i.push(u),e-=o,!e)break}return i=i.length>1?[].concat.apply([],i):i[0],r?wt.call(this,i):i}function Gt(t,e,n,r){var i=r[0];if(i[0]&&i[0].query)return t[e].apply(t,i);if(!(e!=="and"&&e!=="not"||t.result.length||t.await||i.suggest))return r.length>1&&(i=r[r.length-1]),(r=i.resolve)?t.await||t.result:t;let s=[],u=0,o=0,l,c,f,h,d;for(e=0;e<r.length;e++)if(i=r[e]){var a=void 0;if(i.constructor===j)a=i.await||i.result;else if(i.then||i.constructor===Array)a=i;else{u=i.limit||0,o=i.offset||0,f=i.suggest,c=i.resolve,l=((h=i.highlight||t.highlight)||i.enrich)&&c,a=i.queue;let D=i.async||a,p=i.index,g=i.query;if(p?t.index||(t.index=p):p=t.index,g||i.tag){let F=i.field||i.pluck;if(F&&(!g||t.query&&!h||(t.query=g,t.field=F,t.highlight=h),p=p.index.get(F)),a&&(d||t.await)){d=1;let m,A=t.C.length,x=new Promise(function(b){m=b});(function(b,k){x.h=function(){k.index=null,k.resolve=!1;let B=D?b.searchAsync(k):b.search(k);return B.then?B.then(function(y){return t.C[A]=y=y.result||y,m(y),y}):(B=B.result||B,m(B),B)}})(p,Object.assign({},i)),t.C.push(x),s[e]=x;continue}else i.resolve=!1,i.index=null,a=D?p.searchAsync(i):p.search(i),i.resolve=c,i.index=p}else if(i.and)a=$t(i,"and",p);else if(i.or)a=$t(i,"or",p);else if(i.not)a=$t(i,"not",p);else if(i.xor)a=$t(i,"xor",p);else continue}a.await?(d=1,a=a.await):a.then?(d=1,a=a.then(function(D){return D.result||D})):a=a.result||a,s[e]=a}if(d&&!t.await&&(t.await=new Promise(function(D){t.return=D})),d){let D=Promise.all(s).then(function(p){for(let g=0;g<t.C.length;g++)if(t.C[g]===D){t.C[g]=function(){return n.call(t,p,u,o,l,c,f,h)};break}Ee(t)});t.C.push(D)}else if(t.await)t.C.push(function(){return n.call(t,s,u,o,l,c,f,h)});else return n.call(t,s,u,o,l,c,f,h);return c?t.await||t.result:t}function $t(t,e,n){t=t[e];let r=t[0]||t;return r.index||(r.index=n),n=new j(r),t.length>1&&(n=n[e].apply(n,t.slice(1))),n}j.prototype.or=function(){return Gt(this,"or",qn,arguments)};function qn(t,e,n,r,i,s,u){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=en(t,e,n,!1,this.h),n=0)),i&&(this.await=null),i?this.resolve(e,n,r,u):this}j.prototype.and=function(){return Gt(this,"and",ti,arguments)};function ti(t,e,n,r,i,s,u){if(!s&&!this.result.length)return i?this.result:this;let o;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let l=0;for(let c=0,f,h;c<t.length;c++)if((f=t[c])&&(h=f.length))l<h&&(l=h);else if(!s){l=0;break}l?(this.result=Jt(t,l,e,n,s,this.h,i),o=!0):this.result=[]}else s||(this.result=t);return i&&(this.await=null),i?this.resolve(e,n,r,u,o):this}j.prototype.xor=function(){return Gt(this,"xor",ei,arguments)};function ei(t,e,n,r,i,s,u){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{s=n;var o=this.h;let l=[],c=R(),f=0;for(let h=0,d;h<t.length;h++)if(d=t[h]){f<d.length&&(f=d.length);for(let a=0,D;a<d.length;a++)if(D=d[a])for(let p=0,g;p<D.length;p++)g=D[p],c[g]=c[g]?2:1}for(let h=0,d,a=0;h<f;h++)for(let D=0,p;D<t.length;D++)if((p=t[D])&&(d=p[h])){for(let g=0,F;g<d.length;g++)if(F=d[g],c[F]===1)if(s)s--;else if(i){if(l.push(F),l.length===e){t=l;break t}}else{let m=h+(D?o:0);if(l[m]||(l[m]=[]),l[m].push(F),++a===e){t=l;break t}}}t=l}this.result=t,o=!0}else s||(this.result=t);return i&&(this.await=null),i?this.resolve(e,n,r,u,o):this}j.prototype.not=function(){return Gt(this,"not",ni,arguments)};function ni(t,e,n,r,i,s,u){if(!s&&!this.result.length)return i?this.result:this;if(t.length&&this.result.length){t:{s=n;var o=[];t=new Set(t.flat().flat());for(let l=0,c,f=0;l<this.result.length;l++)if(c=this.result[l]){for(let h=0,d;h<c.length;h++)if(d=c[h],!t.has(d)){if(s)s--;else if(i){if(o.push(d),o.length===e){t=o;break t}}else if(o[l]||(o[l]=[]),o[l].push(d),++f===e){t=o;break t}}}t=o}this.result=t,o=!0}return i&&(this.await=null),i?this.resolve(e,n,r,u,o):this}function Vt(t,e,n,r,i){let s,u,o;typeof i=="string"?(s=i,i=""):s=i.template,u=s.indexOf("$1"),o=s.substring(u+2),u=s.substring(0,u);let l=i&&i.boundary,c=!i||i.clip!==!1,f=i&&i.merge&&o&&u&&new RegExp(o+" "+u,"g");i=i&&i.ellipsis;var h=0;if(typeof i=="object"){var d=i.template;h=d.length-2,i=i.pattern}typeof i!="string"&&(i=i===!1?"":"..."),h&&(i=d.replace("$1",i)),d=i.length-h;let a,D;typeof l=="object"&&(a=l.before,a===0&&(a=-1),D=l.after,D===0&&(D=-1),l=l.total||9e5),h=new Map;for(let et=0,Q,Wt,ot;et<e.length;et++){let nt;if(r)nt=e,ot=r;else{var p=e[et];if(ot=p.field,!ot)continue;nt=p.result}Wt=n.get(ot),Q=Wt.encoder,p=h.get(Q),typeof p!="string"&&(p=Q.encode(t),h.set(Q,p));for(let lt=0;lt<nt.length;lt++){var g=nt[lt].doc;if(!g||(g=Mt(g,ot),!g))continue;var F=g.trim().split(/\s+/);if(!F.length)continue;g="";var m=[];let ht=[];for(var A=-1,x=-1,b=0,k=0;k<F.length;k++){var B=F[k],y=Q.encode(B);y=y.length>1?y.join(" "):y[0];let w;if(y&&B){for(var v=B.length,M=(Q.split?B.replace(Q.split,""):B).length-y.length,T="",W=0,z=0;z<p.length;z++){var N=p[z];if(N){var P=N.length;P+=M<0?0:M,W&&P<=W||(N=y.indexOf(N),N>-1&&(T=(N?B.substring(0,N):"")+u+B.substring(N,N+P)+o+(N+P<v?B.substring(N+P):""),W=P,w=!0))}}T&&(l&&(A<0&&(A=g.length+(g?1:0)),x=g.length+(g?1:0)+T.length,b+=v,ht.push(m.length),m.push({match:T})),g+=(g?" ":"")+T)}if(!w)B=F[k],g+=(g?" ":"")+B,l&&m.push({text:B});else if(l&&b>=l)break}if(b=ht.length*(s.length-2),a||D||l&&g.length-b>l)if(b=l+b-d*2,k=x-A,a>0&&(k+=a),D>0&&(k+=D),k<=b)F=a?A-(a>0?a:0):A-((b-k)/2|0),m=D?x+(D>0?D:0):F+b,c||(F>0&&g.charAt(F)!==" "&&g.charAt(F-1)!==" "&&(F=g.indexOf(" ",F),F<0&&(F=0)),m<g.length&&g.charAt(m-1)!==" "&&g.charAt(m)!==" "&&(m=g.lastIndexOf(" ",m),m<x?m=x:++m)),g=(F?i:"")+g.substring(F,m)+(m<g.length?i:"");else{for(x=[],A={},b={},k={},B={},y={},T=M=v=0,z=W=1;;){var $=void 0;for(let w=0,I;w<ht.length;w++){if(I=ht[w],T)if(M!==T){if(k[w+1])continue;if(I+=T,A[I]){v-=d,b[w+1]=1,k[w+1]=1;continue}if(I>=m.length-1){if(I>=m.length){k[w+1]=1,I>=F.length&&(b[w+1]=1);continue}v-=d}if(g=m[I].text,P=D&&y[w])if(P>0){if(g.length>P)if(k[w+1]=1,c)g=g.substring(0,P);else continue;(P-=g.length)||(P=-1),y[w]=P}else{k[w+1]=1;continue}if(v+g.length+1<=l)g=" "+g,x[w]+=g;else if(c)$=l-v-1,$>0&&(g=" "+g.substring(0,$),x[w]+=g),k[w+1]=1;else{k[w+1]=1;continue}}else{if(k[w])continue;if(I-=M,A[I]){v-=d,k[w]=1,b[w]=1;continue}if(I<=0){if(I<0){k[w]=1,b[w]=1;continue}v-=d}if(g=m[I].text,P=a&&B[w])if(P>0){if(g.length>P)if(k[w]=1,c)g=g.substring(g.length-P);else continue;(P-=g.length)||(P=-1),B[w]=P}else{k[w]=1;continue}if(v+g.length+1<=l)g+=" ",x[w]=g+x[w];else if(c)$=g.length+1-(l-v),$>=0&&$<g.length&&(g=g.substring($)+" ",x[w]=g+x[w]),k[w]=1;else{k[w]=1;continue}}else{g=m[I].match,a&&(B[w]=a),D&&(y[w]=D),w&&v++;let _t;if(I?!w&&d&&(v+=d):(b[w]=1,k[w]=1),I>=F.length-1||I<m.length-1&&m[I+1].match?_t=1:d&&(v+=d),v-=s.length-2,!w||v+g.length<=l)x[w]=g;else{$=W=z=b[w]=0;break}_t&&(b[w+1]=1,k[w+1]=1)}v+=g.length,$=A[I]=1}if($)M===T?T++:M++;else{if(M===T?W=0:z=0,!W&&!z)break;W?(M++,T=M):T++}}g="";for(let w=0,I;w<x.length;w++)I=(b[w]?w?" ":"":(w&&!i?" ":"")+i)+x[w],g+=I;i&&!b[x.length]&&(g+=i)}f&&(g=g.replace(f," ")),nt[lt].highlight=g}if(r)break}return e}function j(t,e){if(!this||this.constructor!==j)return new j(t,e);let n=0,r,i,s,u,o,l;if(t&&t.index){let c=t;if(e=c.index,n=c.boost||0,i=c.query){s=c.field||c.pluck,u=c.highlight;let f=c.resolve;t=c.async||c.queue,c.resolve=!1,c.index=null,t=t?e.searchAsync(c):e.search(c),c.resolve=f,c.index=e,t=t.result||t}else t=[]}if(t&&t.then){let c=this;t=t.then(function(f){c.C[0]=c.result=f.result||f,Ee(c)}),r=[t],t=[],o=new Promise(function(f){l=f})}this.index=e||null,this.result=t||[],this.h=n,this.C=r||[],this.await=o||null,this.return=l||null,this.highlight=u||null,this.query=i||"",this.field=s||""}C=j.prototype;C.limit=function(t){if(this.await){let e=this;this.C.push(function(){return e.limit(t).result})}else if(this.result.length){let e=[];for(let n=0,r;n<this.result.length;n++)if(r=this.result[n])if(r.length<=t){if(e[n]=r,t-=r.length,!t)break}else{e[n]=r.slice(0,t);break}this.result=e}return this};C.offset=function(t){if(this.await){let e=this;this.C.push(function(){return e.offset(t).result})}else if(this.result.length){let e=[];for(let n=0,r;n<this.result.length;n++)(r=this.result[n])&&(r.length<=t?t-=r.length:(e[n]=r.slice(t),t=0));this.result=e}return this};C.boost=function(t){if(this.await){let e=this;this.C.push(function(){return e.boost(t).result})}else this.h+=t;return this};function Ee(t,e){let n=t.result;var r=t.await;t.await=null;for(let i=0,s;i<t.C.length;i++)if(s=t.C[i]){if(typeof s=="function")n=s(),t.C[i]=n=n.result||n,i--;else if(s.h)n=s.h(),t.C[i]=n=n.result||n,i--;else if(s.then)return t.await=r}return r=t.return,t.C=[],t.return=null,e||r(n),n}C.resolve=function(t,e,n,r,i){let s=this.await?Ee(this,!0):this.result;if(s.then){let u=this;return s.then(function(){return u.resolve(t,e,n,r,i)})}return s.length&&(typeof t=="object"?(r=t.highlight||this.highlight,n=!!r||t.enrich,e=t.offset,t=t.limit):(r=r||this.highlight,n=!!r||n),s=i?n?wt.call(this.index,s):s:Ce.call(this.index,s,t||100,e,n)),this.finalize(s,r)};C.finalize=function(t,e){if(t.then){let r=this;return t.then(function(i){return r.finalize(i,e)})}e&&t.length&&this.query&&(t=Vt(this.query,t,this.index.index,this.field,e));let n=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",n&&n(t),t};function Jt(t,e,n,r,i,s,u){let o=t.length,l=[],c,f;c=R();for(let h=0,d,a,D,p;h<e;h++)for(let g=0;g<o;g++)if(D=t[g],h<D.length&&(d=D[h]))for(let F=0;F<d.length;F++){if(a=d[F],(f=c[a])?c[a]++:(f=0,c[a]=1),p=l[f]||(l[f]=[]),!u){let m=h+(g||!i?0:s||0);p=p[m]||(p[m]=[])}if(p.push(a),u&&n&&f===o-1&&p.length-r===n)return r?p.slice(r):p}if(t=l.length)if(i)l=l.length>1?en(l,n,r,u,s):(l=l[0])&&n&&l.length>n||r?l.slice(r,n+r):l;else{if(t<o)return[];if(l=l[t-1],n||r)if(u)(l.length>n||r)&&(l=l.slice(r,n+r));else{i=[];for(let h=0,d;h<l.length;h++)if(d=l[h]){if(r&&d.length>r)r-=d.length;else if((n&&d.length>n||r)&&(d=d.slice(r,n+r),n-=d.length,r&&(r-=d.length)),i.push(d),!n)break}l=i}}return l}function en(t,e,n,r,i){let s=[],u=R(),o;var l=t.length;let c;if(r){for(i=l-1;i>=0;i--)if(c=(r=t[i])&&r.length){for(l=0;l<c;l++)if(o=r[l],!u[o]){if(u[o]=1,n)n--;else if(s.push(o),s.length===e)return s}}}else for(let f=l-1,h,d=0;f>=0;f--){h=t[f];for(let a=0;a<h.length;a++)if(c=(r=h[a])&&r.length){for(let D=0;D<c;D++)if(o=r[D],!u[o])if(u[o]=1,n)n--;else{let p=(a+(f<l-1&&i||0))/(f+1)|0;if((s[p]||(s[p]=[])).push(o),++d===e)return s}}}return s}function ii(t,e,n,r,i){let s=R(),u=[];for(let o=0,l;o<e.length;o++){l=e[o];for(let c=0;c<l.length;c++)s[l[c]]=1}if(i){for(let o=0,l;o<t.length;o++)if(l=t[o],s[l]){if(r)r--;else if(u.push(l),s[l]=0,n&&--n===0)break}}else for(let o=0,l,c;o<t.result.length;o++)for(l=t.result[o],e=0;e<l.length;e++)c=l[e],s[c]&&((u[o]||(u[o]=[])).push(c),s[c]=0);return u}R();Dt.prototype.search=function(t,e,n,r){n||(!e&&Lt(t)?(n=t,t=""):Lt(e)&&(n=e,e=0));let i=[];var s=[];let u,o,l,c,f,h,d=0,a=!0,D;if(n){n.constructor===Array&&(n={index:n}),t=n.query||t,u=n.pluck,o=n.merge,c=n.boost,h=u||n.field||(h=n.index)&&(h.index?null:h);var p=this.tag&&n.tag;l=n.suggest,a=n.resolve!==!1,f=n.cache,D=a&&this.store&&n.highlight;var g=!!D||a&&this.store&&n.enrich;e=n.limit||e;var F=n.offset||0;if(e||(e=a?100:0),p&&(!this.db||!r)){p.constructor!==Array&&(p=[p]);var m=[];for(let B=0,y;B<p.length;B++)if(y=p[B],y.field&&y.tag){var A=y.tag;if(A.constructor===Array)for(var x=0;x<A.length;x++)m.push(y.field,A[x]);else m.push(y.field,A)}else{A=Object.keys(y);for(let v=0,M,T;v<A.length;v++)if(M=A[v],T=y[M],T.constructor===Array)for(x=0;x<T.length;x++)m.push(M,T[x]);else m.push(M,T)}if(p=m,!t){if(s=[],m.length)for(p=0;p<m.length;p+=2){if(this.db){if(r=this.index.get(m[p]),!r)continue;s.push(r=r.db.tag(m[p+1],e,F,g))}else r=ri.call(this,m[p],m[p+1],e,F,g);i.push(a?{field:m[p],tag:m[p+1],result:r}:[r])}if(s.length){let B=this;return Promise.all(s).then(function(y){for(let v=0;v<y.length;v++)a?i[v].result=y[v]:i[v]=y[v];return a?i:new j(i.length>1?Jt(i,1,0,0,l,c):i[0],B)})}return a?i:new j(i.length>1?Jt(i,1,0,0,l,c):i[0],this)}}a||u||!(h=h||this.field)||(U(h)?u=h:(h.constructor===Array&&h.length===1&&(h=h[0]),u=h.field||h.index)),h&&h.constructor!==Array&&(h=[h])}h||(h=this.field);let b;m=(this.worker||this.db)&&!r&&[];for(let B=0,y,v,M;B<h.length;B++){if(v=h[B],this.db&&this.tag&&!this.B[B])continue;let T;if(U(v)||(T=v,v=T.field,t=T.query||t,e=Ct(T.limit,e),F=Ct(T.offset,F),l=Ct(T.suggest,l),D=a&&this.store&&Ct(T.highlight,D),g=!!D||a&&this.store&&Ct(T.enrich,g),f=Ct(T.cache,f)),r)y=r[B];else{A=T||n||{},x=A.enrich;var k=this.index.get(v);if(p&&(this.db&&(A.tag=p,A.field=h,b=k.db.support_tag_search),!b&&x&&(A.enrich=!1),b||(A.limit=0,A.offset=0)),y=f?k.searchCache(t,p&&!b?0:e,A):k.search(t,p&&!b?0:e,A),p&&!b&&(A.limit=e,A.offset=F),x&&(A.enrich=x),m){m[B]=y;continue}}if(M=(y=y.result||y)&&y.length,p&&M){if(A=[],x=0,this.db&&r){if(!b)for(k=h.length;k<r.length;k++){let W=r[k];if(W&&W.length)x++,A.push(W);else if(!l)return a?i:new j(i,this)}}else for(let W=0,z,N;W<p.length;W+=2){if(z=this.tag.get(p[W]),!z){if(l)continue;return a?i:new j(i,this)}if(N=(z=z&&z.get(p[W+1]))&&z.length)x++,A.push(z);else if(!l)return a?i:new j(i,this)}if(x){if(y=ii(y,A,e,F,a),M=y.length,!M&&!l)return a?y:new j(y,this);x--}}if(M)s[d]=v,i.push(y),d++;else if(h.length===1)return a?i:new j(i,this)}if(m){if(this.db&&p&&p.length&&!b)for(g=0;g<p.length;g+=2){if(s=this.index.get(p[g]),!s){if(l)continue;return a?i:new j(i,this)}m.push(s.db.tag(p[g+1],e,F,!1))}let B=this;return Promise.all(m).then(function(y){return n&&(n.resolve=a),y.length&&(y=B.search(t,e,n,y)),y})}if(!d)return a?i:new j(i,this);if(u&&(!g||!this.store))return i=i[0],a?i:new j(i,this);for(m=[],F=0;F<s.length;F++){if(p=i[F],g&&p.length&&typeof p[0].doc>"u"&&(this.db?m.push(p=this.index.get(this.field[0]).db.enrich(p)):p=wt.call(this,p)),u)return a?D?Vt(t,p,this.index,u,D):p:new j(p,this);i[F]={field:s[F],result:p}}if(g&&this.db&&m.length){let B=this;return Promise.all(m).then(function(y){for(let v=0;v<y.length;v++)i[v].result=y[v];return D&&(i=Vt(t,i,B.index,u,D)),o?Xe(i):i})}return D&&(i=Vt(t,i,this.index,u,D)),o?Xe(i):i};function Xe(t){let e=[],n=R(),r=R();for(let i=0,s,u,o,l,c,f,h;i<t.length;i++){s=t[i],u=s.field,o=s.result;for(let d=0;d<o.length;d++)c=o[d],typeof c!="object"?c={id:l=c}:l=c.id,(f=n[l])?f.push(u):(c.field=n[l]=[u],e.push(c)),(h=c.highlight)&&(f=r[l],f||(r[l]=f={},c.highlight=f),f[u]=h)}return e}function ri(t,e,n,r,i){return t=this.tag.get(t),t?(t=t.get(e),t?(e=t.length-r,e>0&&((n&&e>n||r)&&(t=t.slice(r,r+n)),i&&(t=wt.call(this,t))),t):[]):[]}function wt(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);let e=Array(t.length);for(let n=0,r;n<t.length;n++)r=t[n],e[n]={id:r,doc:this.store.get(r)};return e}function Dt(t){if(!this||this.constructor!==Dt)return new Dt(t);let e=t.document||t.doc||t,n,r;if(this.B=[],this.field=[],this.D=[],this.key=(n=e.key||e.id)&&Xt(n,this.D)||"id",(r=t.keystore||0)&&(this.keystore=r),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?r?new J(r):new Set:r?new V(r):new Map,this.h=(n=e.store||null)&&n&&n!==!0&&[],this.store=n?r?new V(r):new Map:null,this.cache=(n=t.cache||null)&&new mt(n),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=si.call(this,t,e),this.tag=null,(n=e.tag)&&(typeof n=="string"&&(n=[n]),n.length)){this.tag=new Map,this.A=[],this.F=[];for(let i=0,s,u;i<n.length;i++){if(s=n[i],u=s.field||s,!u)throw Error("The tag field from the document descriptor is undefined.");s.custom?this.A[i]=s.custom:(this.A[i]=Xt(u,this.D),s.filter&&(typeof this.A[i]=="string"&&(this.A[i]=new String(this.A[i])),this.A[i].G=s.filter)),this.F[i]=u,this.tag.set(u,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(let i of this.index.values())i.then&&t.push(i);if(t.length){let i=this;return Promise.all(t).then(function(s){let u=0;for(let o of i.index.entries()){let l=o[0],c=o[1];c.then&&(c=s[u],i.index.set(l,c),u++)}return i})}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}C=Dt.prototype;C.mount=function(t){let e=this.field;if(this.tag)for(let s=0,u;s<this.F.length;s++){u=this.F[s];var n=void 0;this.index.set(u,n=new X({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(u),n.tag=this.tag.get(u)}n=[];let r={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let s=0,u,o;s<e.length;s++){r.field=o=e[s],u=this.index.get(o);let l=new t.constructor(t.id,r);l.id=t.id,n[s]=l.mount(u),u.document=!0,s?u.bypass=!0:u.store=this.store}let i=this;return this.db=Promise.all(n).then(function(){i.db=!0})};C.commit=async function(){let t=[];for(let e of this.index.values())t.push(e.commit());await Promise.all(t),this.reg.clear()};C.destroy=function(){let t=[];for(let e of this.index.values())t.push(e.destroy());return Promise.all(t)};function si(t,e){let n=new Map,r=e.index||e.field||e;U(r)&&(r=[r]);for(let s=0,u,o;s<r.length;s++){if(u=r[s],U(u)||(o=u,u=u.field),o=Lt(o)?Object.assign({},t,o):t,this.worker){var i=void 0;i=(i=o.encoder)&&i.encode?i:new vt(typeof i=="string"?_e[i]:i||{}),i=new dt(o,i),n.set(u,i)}this.worker||n.set(u,new X(o,this.reg)),o.custom?this.B[s]=o.custom:(this.B[s]=Xt(u,this.D),o.filter&&(typeof this.B[s]=="string"&&(this.B[s]=new String(this.B[s])),this.B[s].G=o.filter)),this.field[s]=u}if(this.h){t=e.store,U(t)&&(t=[t]);for(let s=0,u,o;s<t.length;s++)u=t[s],o=u.field||u,u.custom?(this.h[s]=u.custom,u.custom.O=o):(this.h[s]=Xt(o,this.D),u.filter&&(typeof this.h[s]=="string"&&(this.h[s]=new String(this.h[s])),this.h[s].G=u.filter))}return n}function Xt(t,e){let n=t.split(":"),r=0;for(let i=0;i<n.length;i++)t=n[i],t[t.length-1]==="]"&&(t=t.substring(0,t.length-2))&&(e[r]=!0),t&&(n[r++]=t);return r<n.length&&(n.length=r),r>1?n:n[0]}C.append=function(t,e){return this.add(t,e,!0)};C.update=function(t,e){return this.remove(t).add(t,e)};C.remove=function(t){Lt(t)&&(t=Mt(t,this.key));for(var e of this.index.values())e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let n of this.tag.values())for(let r of n){e=r[0];let i=r[1],s=i.indexOf(t);s>-1&&(i.length>1?i.splice(s,1):n.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this};C.clear=function(){let t=[];for(let e of this.index.values()){let n=e.clear();n.then&&t.push(n)}if(this.tag)for(let e of this.tag.values())e.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this};C.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)};C.cleanup=function(){for(let t of this.index.values())t.cleanup();return this};C.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then(function(e){return e[0]&&e[0].doc||null}):this.store.get(t)||null};C.set=function(t,e){return typeof t=="object"&&(e=t,t=Mt(e,this.key)),this.store.set(t,e),this};C.searchCache=Fe;C.export=ui;C.import=oi;ye(Dt.prototype);function Ae(t,e=0){let n=[],r=[];e&&(e=25e4/e*5e3|0);for(let i of t.entries())r.push(i),r.length===e&&(n.push(r),r=[]);return r.length&&n.push(r),n}function we(t,e){e||(e=new Map);for(let n=0,r;n<t.length;n++)r=t[n],e.set(r[0],r[1]);return e}function nn(t,e=0){let n=[],r=[];e&&(e=25e4/e*1e3|0);for(let i of t.entries())r.push([i[0],Ae(i[1])[0]||[]]),r.length===e&&(n.push(r),r=[]);return r.length&&n.push(r),n}function rn(t,e){e||(e=new Map);for(let n=0,r,i;n<t.length;n++)r=t[n],i=e.get(r[0]),e.set(r[0],we(r[1],i));return e}function sn(t){let e=[],n=[];for(let r of t.keys())n.push(r),n.length===25e4&&(e.push(n),n=[]);return n.length&&e.push(n),e}function un(t,e){e||(e=new Set);for(let n=0;n<t.length;n++)e.add(t[n]);return e}function Zt(t,e,n,r,i,s,u=0){let o=r&&r.constructor===Array;var l=o?r.shift():r;if(!l)return this.export(t,e,i,s+1);if((l=t((e?e+".":"")+(u+1)+"."+n,JSON.stringify(l)))&&l.then){let c=this;return l.then(function(){return Zt.call(c,t,e,n,o?r:null,i,s,u+1)})}return Zt.call(this,t,e,n,o?r:null,i,s,u+1)}function ui(t,e,n=0,r=0){if(n<this.field.length){let u=this.field[n];if((e=this.index.get(u).export(t,u,n,r=1))&&e.then){let o=this;return e.then(function(){return o.export(t,u,n+1)})}return this.export(t,u,n+1)}let i,s;switch(r){case 0:i="reg",s=sn(this.reg),e=null;break;case 1:i="tag",s=this.tag&&nn(this.tag,this.reg.size),e=null;break;case 2:i="doc",s=this.store&&Ae(this.store),e=null;break;default:return}return Zt.call(this,t,e,i,s||null,n,r)}function oi(t,e){var n=t.split(".");n[n.length-1]==="json"&&n.pop();let r=n.length>2?n[0]:"";if(n=n.length>2?n[2]:n[1],this.worker&&r)return this.index.get(r).import(t);if(e){if(typeof e=="string"&&(e=JSON.parse(e)),r)return this.index.get(r).import(n,e);switch(n){case"reg":this.fastupdate=!1,this.reg=un(e,this.reg);for(let i=0,s;i<this.field.length;i++)s=this.index.get(this.field[i]),s.fastupdate=!1,s.reg=this.reg;if(this.worker){e=[];for(let i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=rn(e,this.tag);break;case"doc":this.store=we(e,this.store)}}}function Ze(t,e){let n="";for(let r of t.entries()){t=r[0];let i=r[1],s="";for(let u=0,o;u<i.length;u++){o=i[u]||[""];let l="";for(let c=0;c<o.length;c++)l+=(l?",":"")+(e==="string"?'"'+o[c]+'"':o[c]);l="["+l+"]",s+=(s?",":"")+l}s='["'+t+'",['+s+"]]",n+=(n?",":"")+s}return n}X.prototype.remove=function(t,e){let n=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(n){if(this.fastupdate){for(let r=0,i,s;r<n.length;r++)if((i=n[r])&&(s=i.length))if(i[s-1]===t)i.pop();else{let u=i.indexOf(t);u>=0&&i.splice(u,1)}}else jt(this.map,t),this.depth&&jt(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&on(this)),this.cache&&this.cache.remove(t),this};function jt(t,e){let n=0;var r=typeof e>"u";if(t.constructor===Array){for(let i=0,s,u,o;i<t.length;i++)if((s=t[i])&&s.length){if(r)return 1;if(u=s.indexOf(e),u>=0){if(s.length>1)return s.splice(u,1),1;if(delete t[i],n)return 1;o=1}else{if(o)return 1;n++}}}else for(let i of t.entries())r=i[0],jt(i[1],e)?n++:t.delete(r);return n}var li={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};X.prototype.add=function(t,e,n,r){if(e&&(t||t===0)){if(!r&&!n&&this.reg.has(t))return this.update(t,e);r=this.depth,e=this.encoder.encode(e,!r);let c=e.length;if(c){let f=R(),h=R(),d=this.resolution;for(let a=0;a<c;a++){let D=e[this.rtl?c-1-a:a];var i=D.length;if(i&&(r||!h[D])){var s=this.score?this.score(e,D,a,null,0):Kt(d,c,a),u="";switch(this.tokenize){case"tolerant":if(G(this,h,D,s,t,n),i>2){for(let p=1,g,F,m,A;p<i-1;p++)g=D.charAt(p),F=D.charAt(p+1),m=D.substring(0,p)+F,A=D.substring(p+2),u=m+g+A,G(this,h,u,s,t,n),u=m+A,G(this,h,u,s,t,n);G(this,h,D.substring(0,D.length-1),s,t,n)}break;case"full":if(i>2){for(let p=0,g;p<i;p++)for(s=i;s>p;s--){u=D.substring(p,s),g=this.rtl?i-1-p:p;var o=this.score?this.score(e,D,a,u,g):Kt(d,c,a,i,g);G(this,h,u,o,t,n)}break}case"bidirectional":case"reverse":if(i>1){for(o=i-1;o>0;o--){u=D[this.rtl?i-1-o:o]+u;var l=this.score?this.score(e,D,a,u,o):Kt(d,c,a,i,o);G(this,h,u,l,t,n)}u=""}case"forward":if(i>1){for(o=0;o<i;o++)u+=D[this.rtl?i-1-o:o],G(this,h,u,s,t,n);break}default:if(G(this,h,D,s,t,n),r&&c>1&&a<c-1)for(i=this.N,u=D,s=Math.min(r+1,this.rtl?a+1:c-a),o=1;o<s;o++){D=e[this.rtl?c-1-a-o:a+o],l=this.bidirectional&&D>u;let p=this.score?this.score(e,u,a,D,o-1):Kt(i+(c/2>i?0:1),c,a,s-1,o-1);G(this,f,l?u:D,p,t,n,l?D:u)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(n?{ins:t}:{del:t}),this.M&&on(this)),this};function G(t,e,n,r,i,s,u){let o,l;if(!(o=e[n])||u&&!o[u]){if(u?(e=o||(e[n]=R()),e[u]=1,l=t.ctx,(o=l.get(u))?l=o:l.set(u,l=t.keystore?new V(t.keystore):new Map)):(l=t.map,e[n]=1),(o=l.get(n))?l=o:l.set(n,l=o=[]),s){for(let c=0,f;c<o.length;c++)if((f=o[c])&&f.includes(i)){if(c<=r)return;f.splice(f.indexOf(i),1),t.fastupdate&&(e=t.reg.get(i))&&e.splice(e.indexOf(f),1);break}}if(l=l[r]||(l[r]=[]),l.push(i),l.length===2**31-1){if(e=new xt(l),t.fastupdate)for(let c of t.reg.values())c.includes(l)&&(c[c.indexOf(l)]=e);o[r]=l=e}t.fastupdate&&((r=t.reg.get(i))?r.push(l):t.reg.set(i,[l]))}}function Kt(t,e,n,r,i){return n&&t>1?e+(r||0)<=t?n+(i||0):(t-1)/(e+(r||0))*(n+(i||0))+1|0:0}X.prototype.search=function(t,e,n){if(n||(e||typeof t!="object"?typeof e=="object"&&(n=e,e=0):(n=t,t="")),n&&n.cache)return n.cache=!1,t=this.searchCache(t,e,n),n.cache=!0,t;let r=[],i,s,u,o=0,l,c,f,h,d;n&&(t=n.query||t,e=n.limit||e,o=n.offset||0,s=n.context,u=n.suggest,d=(l=n.resolve)&&n.enrich,f=n.boost,h=n.resolution,c=this.db&&n.tag),typeof l>"u"&&(l=this.resolve),s=this.depth&&s!==!1;let a=this.encoder.encode(t,!s);if(i=a.length,e=e||(l?100:0),i===1)return Ye.call(this,a[0],"",e,o,l,d,c);if(i===2&&s&&!u)return Ye.call(this,a[1],a[0],e,o,l,d,c);let D=R(),p=0,g;if(s&&(g=a[0],p=1),h||h===0||(h=g?this.N:this.resolution),this.db){if(this.db.search&&(n=this.db.search(this,a,e,o,u,l,d,c),n!==!1))return n;let F=this;return(async function(){for(let m,A;p<i;p++){if((A=a[p])&&!D[A]){if(D[A]=1,m=await me(F,A,g,0,0,!1,!1),m=Ge(m,r,u,h)){r=m;break}g&&(u&&m&&r.length||(g=A))}u&&g&&p===i-1&&!r.length&&(h=F.resolution,g="",p=-1,D=R())}return Qe(r,h,e,o,u,f,l)})()}for(let F,m;p<i;p++){if((m=a[p])&&!D[m]){if(D[m]=1,F=me(this,m,g,0,0,!1,!1),F=Ge(F,r,u,h)){r=F;break}g&&(u&&F&&r.length||(g=m))}u&&g&&p===i-1&&!r.length&&(h=this.resolution,g="",p=-1,D=R())}return Qe(r,h,e,o,u,f,l)};function Qe(t,e,n,r,i,s,u){let o=t.length,l=t;if(o>1)l=Jt(t,e,n,r,i,s,u);else if(o===1)return u?Ce.call(null,t[0],n,r):new j(t[0],this);return u?l:new j(l,this)}function Ye(t,e,n,r,i,s,u){return t=me(this,t,e,n,r,i,s,u),this.db?t.then(function(o){return i?o||[]:new j(o,this)}):t&&t.length?i?Ce.call(this,t,n,r):new j(t,this):i?[]:new j([],this)}function Ge(t,e,n,r){let i=[];if(t&&t.length){if(t.length<=r){e.push(t);return}for(let s=0,u;s<r;s++)(u=t[s])&&(i[s]=u);if(i.length){e.push(i);return}}if(!n)return i}function me(t,e,n,r,i,s,u,o){let l;return n&&(l=t.bidirectional&&e>n)&&(l=n,n=e,e=l),t.db?t.db.get(e,n,r,i,s,u,o):(t=n?(t=t.ctx.get(n))&&t.get(e):t.map.get(e),t)}function X(t,e){if(!this||this.constructor!==X)return new X(t);if(t){var n=U(t)?t:t.preset;n&&(t=Object.assign({},li[n],t))}else t={};n=t.context;let r=n===!0?{depth:1}:n||{},i=U(t.encoder)?_e[t.encoder]:t.encode||t.encoder||{};this.encoder=i.encode?i:typeof i=="object"?new vt(i):{encode:i},this.resolution=t.resolution||9,this.tokenize=n=(n=t.tokenize)&&n!=="default"&&n!=="exact"&&n||"strict",this.depth=n==="strict"&&r.depth||0,this.bidirectional=r.bidirectional!==!1,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(n=t.keystore||0)&&(this.keystore=n),this.map=n?new V(n):new Map,this.ctx=n?new V(n):new Map,this.reg=e||(this.fastupdate?n?new V(n):new Map:n?new J(n):new Set),this.N=r.resolution||3,this.rtl=i.rtl||t.rtl||!1,this.cache=(n=t.cache||null)&&new mt(n),this.resolve=t.resolve!==!1,(n=t.db)&&(this.db=this.mount(n)),this.M=t.commit!==!1,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}C=X.prototype;C.mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)};C.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)};C.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()};function on(t){t.commit_timer||(t.commit_timer=setTimeout(function(){t.commit_timer=null,t.db.commit(t)},1))}C.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this};C.append=function(t,e){return this.add(t,e,!0)};C.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)};C.update=function(t,e){let n=this,r=this.remove(t);return r&&r.then?r.then(()=>n.add(t,e)):this.add(t,e)};C.cleanup=function(){return this.fastupdate?(jt(this.map),this.depth&&jt(this.ctx),this):this};C.searchCache=Fe;C.export=function(t,e,n=0,r=0){let i,s;switch(r){case 0:i="reg",s=sn(this.reg);break;case 1:i="cfg",s=null;break;case 2:i="map",s=Ae(this.map,this.reg.size);break;case 3:i="ctx",s=nn(this.ctx,this.reg.size);break;default:return}return Zt.call(this,t,e,i,s,n,r)};C.import=function(t,e){if(e)switch(typeof e=="string"&&(e=JSON.parse(e)),t=t.split("."),t[t.length-1]==="json"&&t.pop(),t.length===3&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=un(e,this.reg);break;case"map":this.map=we(e,this.map);break;case"ctx":this.ctx=rn(e,this.ctx)}};C.serialize=function(t=!0){let e="",n="",r="";if(this.reg.size){let s;for(var i of this.reg.keys())s||(s=typeof i),e+=(e?",":"")+(s==="string"?'"'+i+'"':i);e="index.reg=new Set(["+e+"]);",n=Ze(this.map,s),n="index.map=new Map(["+n+"]);";for(let u of this.ctx.entries()){i=u[0];let o=Ze(u[1],s);o="new Map(["+o+"])",o='["'+i+'",'+o+"]",r+=(r?",":"")+o}r="index.ctx=new Map(["+r+"]);"}return t?"function inject(index){"+e+n+r+"}":e+n+r};ye(X.prototype);var ln=typeof window<"u"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Qt=["map","ctx","tag","reg","cfg"],pt=R();function Yt(t,e={}){if(!this||this.constructor!==Yt)return new Yt(t,e);typeof t=="object"&&(e=t,t=t.name),t||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(t?":"+t.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=e.field?e.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=e.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}C=Yt.prototype;C.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())};C.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),pt[t.id]||(pt[t.id]=[]),pt[t.id].push(t.field);let e=ln.open(t.id,1);return e.onupgradeneeded=function(){let n=t.db=this.result;for(let r=0,i;r<Qt.length;r++){i=Qt[r];for(let s=0,u;s<pt[t.id].length;s++)u=pt[t.id][s],n.objectStoreNames.contains(i+(i!=="reg"&&u?":"+u:""))||n.createObjectStore(i+(i!=="reg"&&u?":"+u:""))}},t.db=st(e,function(n){t.db=n,t.db.onversionchange=function(){t.close()}})};C.close=function(){this.db&&this.db.close(),this.db=null};C.destroy=function(){let t=ln.deleteDatabase(this.id);return st(t)};C.clear=function(){let t=[];for(let n=0,r;n<Qt.length;n++){r=Qt[n];for(let i=0,s;i<pt[this.id].length;i++)s=pt[this.id][i],t.push(r+(r!=="reg"&&s?":"+s:""))}let e=this.db.transaction(t,"readwrite");for(let n=0;n<t.length;n++)e.objectStore(t[n]).clear();return st(e)};C.get=function(t,e,n=0,r=0,i=!0,s=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);let u=this;return st(t).then(function(o){let l=[];if(!o||!o.length)return l;if(i){if(!n&&!r&&o.length===1)return o[0];for(let c=0,f;c<o.length;c++)if((f=o[c])&&f.length){if(r>=f.length){r-=f.length;continue}let h=n?r+Math.min(f.length-r,n):f.length;for(let d=r;d<h;d++)l.push(f[d]);if(r=0,l.length===n)break}return s?u.enrich(l):l}return o})};C.tag=function(t,e=0,n=0,r=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);let i=this;return st(t).then(function(s){return!s||!s.length||n>=s.length?[]:!e&&!n?s:(s=s.slice(n,n+e),r?i.enrich(s):s)})};C.enrich=function(t){typeof t!="object"&&(t=[t]);let e=this.db.transaction("reg","readonly").objectStore("reg"),n=[];for(let r=0;r<t.length;r++)n[r]=st(e.get(t[r]));return Promise.all(n).then(function(r){for(let i=0;i<r.length;i++)r[i]={id:t[i],doc:r[i]?JSON.parse(r[i]):null};return r})};C.has=function(t){return t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t),st(t).then(function(e){return!!e})};C.search=null;C.info=function(){};C.transaction=function(t,e,n){t+=t!=="reg"&&this.field?":"+this.field:"";let r=this.h[t+":"+e];if(r)return n.call(this,r);let i=this.db.transaction(t,e);this.h[t+":"+e]=r=i.objectStore(t);let s=n.call(this,r);return this.h[t+":"+e]=null,st(i).finally(function(){return s})};C.commit=async function(t){let e=t.commit_task,n=[];t.commit_task=[];for(let r=0,i;r<e.length;r++)i=e[r],i.del&&n.push(i.del);n.length&&await this.remove(n),t.reg.size&&(await this.transaction("map","readwrite",function(r){for(let i of t.map){let s=i[0],u=i[1];u.length&&(r.get(s).onsuccess=function(){let o=this.result;var l;if(o&&o.length){let c=Math.max(o.length,u.length);for(let f=0,h,d;f<c;f++)if((d=u[f])&&d.length){if((h=o[f])&&h.length)for(l=0;l<d.length;l++)h.push(d[l]);else o[f]=d;l=1}}else o=u,l=1;l&&r.put(o,s)})}}),await this.transaction("ctx","readwrite",function(r){for(let i of t.ctx){let s=i[0],u=i[1];for(let o of u){let l=o[0],c=o[1];c.length&&(r.get(s+":"+l).onsuccess=function(){let f=this.result;var h;if(f&&f.length){let d=Math.max(f.length,c.length);for(let a=0,D,p;a<d;a++)if((p=c[a])&&p.length){if((D=f[a])&&D.length)for(h=0;h<p.length;h++)D.push(p[h]);else f[a]=p;h=1}}else f=c,h=1;h&&r.put(f,s+":"+l)})}}}),t.store?await this.transaction("reg","readwrite",function(r){for(let i of t.store){let s=i[0],u=i[1];r.put(typeof u=="object"?JSON.stringify(u):1,s)}}):t.bypass||await this.transaction("reg","readwrite",function(r){for(let i of t.reg.keys())r.put(1,i)}),t.tag&&await this.transaction("tag","readwrite",function(r){for(let i of t.tag){let s=i[0],u=i[1];u.length&&(r.get(s).onsuccess=function(){let o=this.result;o=o&&o.length?o.concat(u):u,r.put(o,s)})}}),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())};function pe(t,e,n){let r=t.value,i,s=0;for(let u=0,o;u<r.length;u++){if(o=n?r:r[u]){for(let l=0,c,f;l<e.length;l++)if(f=e[l],c=o.indexOf(f),c>=0)if(i=1,o.length>1)o.splice(c,1);else{r[u]=[];break}s+=o.length}if(n)break}s?i&&t.update(r):t.delete(),t.continue()}C.remove=function(t){return typeof t!="object"&&(t=[t]),Promise.all([this.transaction("map","readwrite",function(e){e.openCursor().onsuccess=function(){let n=this.result;n&&pe(n,t)}}),this.transaction("ctx","readwrite",function(e){e.openCursor().onsuccess=function(){let n=this.result;n&&pe(n,t)}}),this.transaction("tag","readwrite",function(e){e.openCursor().onsuccess=function(){let n=this.result;n&&pe(n,t,!0)}}),this.transaction("reg","readwrite",function(e){for(let n=0;n<t.length;n++)e.delete(t[n])})])};function st(t,e){return new Promise((n,r)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,n(this.result)},t.onerror=t.onblocked=r,t=null})}var hn={Index:X,Charset:_e,Encoder:vt,Document:Dt,Worker:dt,Resolver:j,IndexedDB:Yt,Language:{}};var Ni=Object.hasOwnProperty;var gn,H,dn,hi,ut,cn,Dn,mn,ve,te,It,Fn,Te,Be,ke,ci,_n={},ne=[],fi=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,re=Array.isArray;function q(t,e){for(var n in e)t[n]=e[n];return t}function Se(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xe(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++dn,__i:-1,__u:0};return i==null&&H.vnode!=null&&H.vnode(s),s}function kt(t){return t.children}function ee(t,e){this.props=t,this.context=e}function Bt(t,e){if(e==null)return t.__?Bt(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Bt(t):null}function ai(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],i=[],s=q({},e);s.__v=e.__v+1,H.vnode&&H.vnode(s),An(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??Bt(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,di(r,s,i),e.__e=e.__=null,s.__e!=n&&yn(s)}}function yn(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),yn(t)}function fn(t){(!t.__d&&(t.__d=!0)&&ut.push(t)&&!ie.__r++||cn!=H.debounceRendering)&&((cn=H.debounceRendering)||Dn)(ie)}function ie(){try{for(var t,e=1;ut.length;)ut.length>e&&ut.sort(mn),t=ut.shift(),e=ut.length,ai(t)}finally{ut.length=ie.__r=0}}function Cn(t,e,n,r,i,s,u,o,l,c,f){var h,d,a,D,p,g,F,m=r&&r.__k||ne,A=e.length;for(l=pi(n,e,m,l,A),h=0;h<A;h++)(a=n.__k[h])!=null&&(d=a.__i!=-1&&m[a.__i]||_n,a.__i=h,g=An(t,a,d,i,s,u,o,l,c,f),D=a.__e,a.ref&&d.ref!=a.ref&&(d.ref&&Le(d.ref,null,a),f.push(a.ref,a.__c||D,a)),p==null&&D!=null&&(p=D),(F=!!(4&a.__u))||d.__k===a.__k?(l=En(a,l,t,F),F&&d.__e&&(d.__e=null)):typeof a.type=="function"&&g!==void 0?l=g:D&&(l=D.nextSibling),a.__u&=-7);return n.__e=p,l}function pi(t,e,n,r,i){var s,u,o,l,c,f=n.length,h=f,d=0;for(t.__k=new Array(i),s=0;s<i;s++)(u=e[s])!=null&&typeof u!="boolean"&&typeof u!="function"?(typeof u=="string"||typeof u=="number"||typeof u=="bigint"||u.constructor==String?u=t.__k[s]=xe(null,u,null,null,null):re(u)?u=t.__k[s]=xe(kt,{children:u},null,null,null):u.constructor===void 0&&u.__b>0?u=t.__k[s]=xe(u.type,u.props,u.key,u.ref?u.ref:null,u.__v):t.__k[s]=u,l=s+d,u.__=t,u.__b=t.__b+1,o=null,(c=u.__i=gi(u,n,l,h))!=-1&&(h--,(o=n[c])&&(o.__u|=2)),o==null||o.__v==null?(c==-1&&(i>f?d--:i<f&&d++),typeof u.type!="function"&&(u.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,u.__u|=4))):t.__k[s]=null;if(h)for(s=0;s<f;s++)(o=n[s])!=null&&(2&o.__u)==0&&(o.__e==r&&(r=Bt(o)),vn(o,o));return r}function En(t,e,n,r){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=En(i[s],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Bt(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function gi(t,e,n,r){var i,s,u,o=t.key,l=t.type,c=e[n],f=c!=null&&(2&c.__u)==0;if(c===null&&o==null||f&&o==c.key&&l==c.type)return n;if(r>(f?1:0)){for(i=n-1,s=n+1;i>=0||s<e.length;)if((c=e[u=i>=0?i--:s++])!=null&&(2&c.__u)==0&&o==c.key&&l==c.type)return u}return-1}function an(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||fi.test(e)?n:n+"px"}function qt(t,e,n,r,i){var s,u;t:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||an(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||an(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Fn,"$1")),u=e.toLowerCase(),e=u in t||e=="onFocusOut"||e=="onFocusIn"?u.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r?n[It]=r[It]:(n[It]=Te,t.addEventListener(e,s?ke:Be,s)):t.removeEventListener(e,s?ke:Be,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break t}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function pn(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[te]==null)e[te]=Te++;else if(e[te]<n[It])return;return n(H.event?H.event(e):e)}}}function An(t,e,n,r,i,s,u,o,l,c){var f,h,d,a,D,p,g,F,m,A,x,b,k,B,y,v=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),s=[o=e.__e=n.__e]),(f=H.__b)&&f(e);t:if(typeof v=="function")try{if(F=e.props,m=v.prototype&&v.prototype.render,A=(f=v.contextType)&&r[f.__c],x=f?A?A.props.value:f.__:r,n.__c?g=(h=e.__c=n.__c).__=h.__E:(m?e.__c=h=new v(F,x):(e.__c=h=new ee(F,x),h.constructor=v,h.render=mi),A&&A.sub(h),h.state||(h.state={}),h.__n=r,d=h.__d=!0,h.__h=[],h._sb=[]),m&&h.__s==null&&(h.__s=h.state),m&&v.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=q({},h.__s)),q(h.__s,v.getDerivedStateFromProps(F,h.__s))),a=h.props,D=h.state,h.__v=e,d)m&&v.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),m&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(m&&v.getDerivedStateFromProps==null&&F!==a&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(F,x),e.__v==n.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(F,h.__s,x)===!1){e.__v!=n.__v&&(h.props=F,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(M){M&&(M.__=e)}),ne.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&u.push(h);break t}h.componentWillUpdate!=null&&h.componentWillUpdate(F,h.__s,x),m&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(a,D,p)})}if(h.context=x,h.props=F,h.__P=t,h.__e=!1,b=H.__r,k=0,m)h.state=h.__s,h.__d=!1,b&&b(e),f=h.render(h.props,h.state,h.context),ne.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,b&&b(e),f=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++k<25);h.state=h.__s,h.getChildContext!=null&&(r=q(q({},r),h.getChildContext())),m&&!d&&h.getSnapshotBeforeUpdate!=null&&(p=h.getSnapshotBeforeUpdate(a,D)),B=f!=null&&f.type===kt&&f.key==null?wn(f.props.children):f,o=Cn(t,re(B)?B:[B],e,n,r,i,s,u,o,l,c),h.base=e.__e,e.__u&=-161,h.__h.length&&u.push(h),g&&(h.__E=h.__=null)}catch(M){if(e.__v=null,l||s!=null)if(M.then){for(e.__u|=l?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;s[s.indexOf(o)]=null,e.__e=o}else{for(y=s.length;y--;)Se(s[y]);be(e)}else e.__e=n.__e,e.__k=n.__k,M.then||be(e);H.__e(M,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):o=e.__e=Di(n.__e,e,n,r,i,s,u,l,c);return(f=H.diffed)&&f(e),128&e.__u?void 0:o}function be(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(be))}function di(t,e,n){for(var r=0;r<n.length;r++)Le(n[r],n[++r],n[++r]);H.__c&&H.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){H.__e(s,i.__v)}})}function wn(t){return typeof t!="object"||t==null||t.__b>0?t:re(t)?t.map(wn):q({},t)}function Di(t,e,n,r,i,s,u,o,l){var c,f,h,d,a,D,p,g=n.props||_n,F=e.props,m=e.type;if(m=="svg"?i="http://www.w3.org/2000/svg":m=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(c=0;c<s.length;c++)if((a=s[c])&&"setAttribute"in a==!!m&&(m?a.localName==m:a.nodeType==3)){t=a,s[c]=null;break}}if(t==null){if(m==null)return document.createTextNode(F);t=document.createElementNS(i,m,F.is&&F),o&&(H.__m&&H.__m(e,s),o=!1),s=null}if(m==null)g===F||o&&t.data==F||(t.data=F);else{if(s=s&&gn.call(t.childNodes),!o&&s!=null)for(g={},c=0;c<t.attributes.length;c++)g[(a=t.attributes[c]).name]=a.value;for(c in g)a=g[c],c=="dangerouslySetInnerHTML"?h=a:c=="children"||c in F||c=="value"&&"defaultValue"in F||c=="checked"&&"defaultChecked"in F||qt(t,c,null,a,i);for(c in F)a=F[c],c=="children"?d=a:c=="dangerouslySetInnerHTML"?f=a:c=="value"?D=a:c=="checked"?p=a:o&&typeof a!="function"||g[c]===a||qt(t,c,a,g[c],i);if(f)o||h&&(f.__html==h.__html||f.__html==t.innerHTML)||(t.innerHTML=f.__html),e.__k=[];else if(h&&(t.innerHTML=""),Cn(e.type=="template"?t.content:t,re(d)?d:[d],e,n,r,m=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,u,s?s[0]:n.__k&&Bt(n,0),o,l),s!=null)for(c=s.length;c--;)Se(s[c]);o||(c="value",m=="progress"&&D==null?t.removeAttribute("value"):D!=null&&(D!==t[c]||m=="progress"&&!D||m=="option"&&D!=g[c])&&qt(t,c,D,g[c],i),c="checked",p!=null&&p!=t[c]&&qt(t,c,p,g[c],i))}return t}function Le(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){H.__e(i,n)}}function vn(t,e,n){var r,i;if(H.unmount&&H.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Le(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){H.__e(s,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&vn(r[i],e,n||typeof t.type!="function");n||Se(t.__e),t.__c=t.__=t.__e=void 0}function mi(t,e,n){return this.constructor(t,n)}gn=ne.slice,H={__e:function(t,e,n,r){for(var i,s,u;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),u=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),u=i.__d),u)return i.__E=i}catch(o){t=o}throw t}},dn=0,hi=function(t){return t!=null&&t.constructor===void 0},ee.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=q({},this.state),typeof t=="function"&&(t=t(q({},n),this.props)),t&&q(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),fn(this))},ee.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),fn(this))},ee.prototype.render=kt,ut=[],Dn=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,mn=function(t,e){return t.__v.__b-e.__v.__b},ie.__r=0,ve=Math.random().toString(8),te="__d"+ve,It="__a"+ve,Fn=/(PointerCapture)$|Capture$/i,Te=0,Be=pn(!1),ke=pn(!0),ci=0;function _i(){return typeof document>"u"?"":document.body?.dataset?.basepath??""}function Me(t,e){let n=e??_i(),r=t.startsWith("/")?t:"/"+t;return n+r}function tt(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function xn(t,e){if(!t)return()=>{};let n=i=>{t.classList.contains("active")&&i.target===t&&(i.preventDefault(),i.stopPropagation(),e())},r=i=>{t.classList.contains("active")&&i.key==="Escape"&&(i.preventDefault(),e())};return t.addEventListener("click",n),document.addEventListener("keydown",r),()=>{t.removeEventListener("click",n),document.removeEventListener("keydown",r)}}function Bn(t,e){let n=t.querySelectorAll("[src], [href]");for(let r of Array.from(n)){let i=r.hasAttribute("href")?"href":"src",s=r.getAttribute(i);if(s&&!(s.startsWith("http://")||s.startsWith("https://")||s.startsWith("mailto:")||s.startsWith("tel:")||s.startsWith("#")||s.startsWith("/")||s.startsWith("data:")))try{let u=new URL(s,e).toString();r.setAttribute(i,u)}catch{continue}}}function se(t){return t.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'")}var je="basic",bt="",kn=8,yi=5,ue=30,Ci=t=>{let e=[],n=-1,r=-1,i=t.toLowerCase(),s=0;for(let u of i){let o=u.codePointAt(0);o>=12352&&o<=12447||o>=12448&&o<=12543||o>=19968&&o<=40959||o>=44032&&o<=55215||o>=131072&&o<=173791?(n!==-1&&(e.push(i.slice(n,r)),n=-1),e.push(u)):o===32||o===9||o===10||o===13?n!==-1&&(e.push(i.slice(n,r)),n=-1):(n===-1&&(n=s),r=s+1),s+=u.length}return n!==-1&&e.push(i.slice(n)),e},le=new hn.Document({encode:Ci,document:{id:"id",tag:"tags",index:[{field:"title",tokenize:"forward"},{field:"content",tokenize:"forward"},{field:"tags",tokenize:"forward"}]}}),Z=null,Ht=[],Pt=[],Ie=new Map;function oe(t){let e=t.split(/\s+/),n=[],r=[];for(let i of e)i.startsWith("#")&&i.length>1?n.push(i.substring(1)):i!=="#"&&r.push(i);return{tags:n,query:r.join(" ").trim()}}function bn(t){let e=t.split(/\s+/),n=e[e.length-1];return n&&n.startsWith("#")?n.substring(1):null}var Sn=new DOMParser;async function Ei(t){if(Ie.has(t))return Ie.get(t);let e=new URL(Me(t),window.location.origin).toString();try{let n=await fetch(e);if(!n.ok)return[];let r=await n.text(),i=Sn.parseFromString(r??"","text/html");Bn(i,e);let s=Array.from(i.getElementsByClassName("popover-hint"));return Ie.set(t,s),s}catch{return[]}}var He=[];function Ft(t){He.push(t)}function Ai(){He.forEach(t=>t()),He.length=0}async function wi(){let t=document.querySelectorAll(".search");for(let e of Array.from(t)){let n=e.querySelector(".search-container"),r=e.querySelector(".search-button"),i=e.querySelector(".search-bar"),s=e.querySelector(".search-layout");if(!n||!r||!i||!s)continue;let u=n.closest(".sidebar"),o=s.getAttribute("data-preview")==="true",l=s.getAttribute("data-field-priority"),c=l?JSON.parse(l):["title","content","tags"],f=s.querySelector(".results-container");f||(f=document.createElement("div"),f.className="results-container",f.setAttribute("role","listbox"),f.setAttribute("aria-label","Search results"),s.appendChild(f));let h=s.querySelector(".preview-container");o&&!h&&(h=document.createElement("div"),h.className="preview-container",s.appendChild(h));let d=document.createElement("div");d.className="tag-suggestions",d.setAttribute("role","listbox"),d.setAttribute("aria-label","Tag suggestions"),d.style.display="none";let a=i.parentElement;a.insertBefore(d,i.nextSibling);let D=document.createElement("span");D.className="ghost-text",D.setAttribute("aria-hidden","true"),a.insertBefore(D,i.nextSibling);let p=-1,g=[],F=!1,m=_=>{if(p<0||p>=g.length){D.textContent="";return}let E=g[p];if(!E.toLowerCase().startsWith(_.toLowerCase())){D.textContent="";return}let L=E.substring(_.length);D.innerHTML="";let S=document.createElement("span");S.style.visibility="hidden",S.textContent=i.value,D.appendChild(S),D.appendChild(document.createTextNode(L))},A=()=>{d.querySelectorAll(".tag-suggestion-item").forEach((L,S)=>{L.classList.toggle("active",S===p)});let E=bn(i.value)||"";m(E)},x=()=>{F=!1,p=-1,g=[],d.style.display="none",D.textContent=""},b=_=>{let E=i.value,L=E.lastIndexOf("#");L!==-1&&(i.value=E.substring(0,L)+"#"+_+" "),x(),i.focus(),i.dispatchEvent(new Event("input"))},k=_=>{if(Rt){if(g=_===""?Pt.slice(0,10):Pt.filter(E=>E.toLowerCase().startsWith(_.toLowerCase())).slice(0,10),g.length===0){x();return}p=0,F=!0,tt(d);for(let E=0;E<g.length;E++){let L=g[E],S=document.createElement("div");S.className="tag-suggestion-item"+(E===0?" active":""),S.setAttribute("role","option"),S.setAttribute("data-tag",L),S.setAttribute("data-index",String(E)),S.textContent="#"+L,d.appendChild(S)}d.style.display="block",m(_)}},B=_=>!F||g.length===0?!1:(_==="down"?p=Math.min(p+1,g.length-1):p=Math.max(p-1,0),A(),!0),y=null,v=0,M=null,T=()=>{n.classList.remove("active"),u&&(u.style.zIndex=""),r.setAttribute("aria-expanded","false"),i.value="",tt(f),h&&tt(h),s.classList.remove("display-results"),je="basic",y=null,x(),r.focus()},W=_=>{je=_,u&&(u.style.zIndex="9999"),n.classList.add("active"),r.setAttribute("aria-expanded","true"),i.focus()},z=async _=>{if(tt(f),_.length===0){let E=document.createElement("a");E.className="result-card no-match";let L=document.createElement("h3");L.textContent="No results.";let S=document.createElement("p");S.textContent="Try another search term?",E.appendChild(L),E.appendChild(S),f.appendChild(E),y=null,h&&tt(h)}else for(let E of _){let L=document.createElement("a");L.className="result-card",L.id=E.slug,L.href=Me(E.slug);let S=document.createElement("h3");if(S.className="card-title",S.innerHTML=E.title.replace(/<(?!\/?span\b)[^>]*>/gi,""),L.appendChild(S),E.tags.length>0){let K=document.createElement("ul");K.className="tags",K.innerHTML=E.tags.join(""),L.appendChild(K)}let Y=document.createElement("p");Y.className="card-description",Y.innerHTML=E.content.replace(/<(?!\/?span\b)[^>]*>/gi,""),L.appendChild(Y),f.appendChild(L)}},N=()=>Array.from(f.querySelectorAll(".result-card:not(.no-match)")),P=()=>{let _=oe(bt);return _.query||(_.tags.length>0?_.tags.join(" "):bt)},$=async _=>{if(!h||(tt(h),!_))return;let E=_.id,L=++v,S=await Ei(E);if(L!==v)return;let Y=P(),K=document.createElement("div");K.className="preview-inner";for(let ct of S){let yt=ct.cloneNode(!0);Y.trim()!==""&&(yt.innerHTML=vi(Y,yt)),K.appendChild(yt)}h.appendChild(K),requestAnimationFrame(()=>{let ct=Array.from(h.getElementsByClassName("highlight"));if(ct.length===0)return;ct.sort((he,ce)=>ce.innerHTML.length-he.innerHTML.length);let yt=ct[0],Nt=0,ft=yt;for(;ft&&ft!==h;)Nt+=ft.offsetTop,ft=ft.offsetParent;h.scrollTop=Math.max(0,Nt-50)})},et=_=>{y&&y.classList.remove("focus"),y=_,y&&(y.classList.add("focus"),y.scrollIntoView({block:"nearest"})),M&&clearTimeout(M),M=setTimeout(()=>$(y),150)},Q=_=>{let E=N();if(E.length===0){et(null);return}let L=Math.min(Math.max(_,0),E.length-1);et(E[L]??null)},Wt=()=>{let _=N();if(_.length===0)return;let E=y?_.indexOf(y):-1;Q(E+1)},ot=()=>{let _=N();if(_.length===0)return;let E=y?_.indexOf(y):_.length;Q(E-1)},nt=async _=>{let E=_.target.value;bt=E;let L=bn(E);L!==null?k(L):x();let S=oe(E),Y=S.query!==""||S.tags.length>0;if(s.classList.toggle("display-results",Y),je=S.tags.length>0&&!S.query?"tags":"basic",!Y){tt(f),h&&tt(h),y=null;return}let K;S.query?K=await le.searchAsync({query:S.query,limit:S.tags.length>0?1e4:kn,index:["title","content"]}):S.tags.length>0?K=await le.searchAsync({query:S.tags[0],limit:1e4,index:["tags"]}):K=[];let ct=at=>{let Tt=K.filter(zt=>zt.field===at);return Tt.length===0?[]:[...Tt[0].result]},Nt=[...new Set(c.flatMap(at=>ct(at)))].filter(at=>{if(S.tags.length===0)return!0;let Tt=Ht[at];if(!Tt)return!1;let zt=Z?.[Tt];if(!zt)return!1;let In=zt.tags||[];return S.tags.every(Hn=>In.some(Pn=>Pn.toLowerCase()===Hn.toLowerCase()))}),ft=S.query||(S.tags.length>0?S.tags.join(" "):E),he=Nt.map(at=>Bi(ft,at));await z(he.slice(0,kn));let ce=N();et(ce[0]??null)},lt=_=>{_.stopPropagation(),W("basic")};r.addEventListener("click",lt),Ft(()=>r.removeEventListener("click",lt)),i.addEventListener("input",nt),Ft(()=>i.removeEventListener("input",nt));let ht=_=>{if(F){if(_.key==="ArrowDown"){_.preventDefault(),B("down");return}if(_.key==="ArrowUp"){_.preventDefault(),B("up");return}if(_.key==="Tab"){_.preventDefault(),p>=0&&p<g.length&&b(g[p]);return}if(_.key==="Enter"&&!_.isComposing&&p>=0&&p<g.length){_.preventDefault(),b(g[p]);return}if(_.key==="Escape"){_.preventDefault(),x();return}}if(_.key==="ArrowUp"||_.shiftKey&&_.key==="Tab"){_.preventDefault(),ot();return}if(_.key==="ArrowDown"||_.key==="Tab"){_.preventDefault(),Wt();return}if(_.key==="Enter"&&!_.isComposing){let E=y;E instanceof HTMLAnchorElement&&(_.preventDefault(),I(),T(),E.click())}};i.addEventListener("keydown",ht),Ft(()=>i.removeEventListener("keydown",ht));let w=_=>{_.key==="k"&&(_.ctrlKey||_.metaKey)&&!_.shiftKey?(_.preventDefault(),n.classList.contains("active")?T():W("basic")):_.shiftKey&&(_.ctrlKey||_.metaKey)&&_.key.toLowerCase()==="k"&&(_.preventDefault(),W("tags"),i.value="#",i.dispatchEvent(new Event("input")))};document.addEventListener("keydown",w),Ft(()=>document.removeEventListener("keydown",w));let I=()=>{let _=oe(bt),E=_.query||(_.tags.length>0?_.tags.join(" "):bt);E.trim()&&sessionStorage.setItem("search-term",E.trim())},_t=_=>{let E=_.target.closest(".result-card");!E||E.classList.contains("no-match")||_ instanceof MouseEvent&&(_.altKey||_.ctrlKey||_.metaKey||_.shiftKey)||(I(),T())},Pe=_=>{let E=_.target.closest(".result-card");!E||E.classList.contains("no-match")||et(E)};f.addEventListener("click",_t),f.addEventListener("mouseover",Pe),Ft(()=>{f.removeEventListener("click",_t),f.removeEventListener("mouseover",Pe)});let Re=_=>{let E=_.target.closest(".tag-suggestion-item");if(!E)return;let L=E.getAttribute("data-tag");L&&b(L)},We=_=>{let E=_.target.closest(".tag-suggestion-item");if(!E)return;let L=E.getAttribute("data-index");L!==null&&(p=parseInt(L,10),A())};d.addEventListener("click",Re),d.addEventListener("mouseover",We),Ft(()=>{d.removeEventListener("click",Re),d.removeEventListener("mouseover",We)});let jn=xn(n,T);Ft(jn)}}function Ln(t){let e=t.split(/\s+/).filter(r=>r.trim()!==""),n=e.length;if(n>1)for(let r=1;r<n;r++)e.push(e.slice(0,r+1).join(" "));return e.sort((r,i)=>i.length-r.length)}function vi(t,e){let n=Ln(t).filter(c=>c.trim()!=="");if(n.length===0)return e.innerHTML;let r=Sn.parseFromString(e.innerHTML,"text/html"),i=n.map(c=>c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|");if(i==="")return e.innerHTML;let s=new RegExp(i,"gi"),u=r.createTreeWalker(r.body,NodeFilter.SHOW_TEXT),o=[],l=u.nextNode();for(;l;)o.push(l),l=u.nextNode();for(let c of o){let f=c.nodeValue??"";if(s.lastIndex=0,!s.test(f))continue;s.lastIndex=0;let h=r.createDocumentFragment(),d=0,a;for(;(a=s.exec(f))!==null;){a.index>d&&h.appendChild(r.createTextNode(f.slice(d,a.index)));let D=r.createElement("span");D.className="highlight",D.textContent=a[0],h.appendChild(D),d=a.index+a[0].length}d<f.length&&h.appendChild(r.createTextNode(f.slice(d))),c.parentNode?.replaceChild(h,c)}return r.body.innerHTML}function Tn(t,e,n){let r=Ln(t),i=se(e).split(/\s+/).filter(l=>l!==""),s=0,u=i.length-1;if(n){let l=d=>r.some(a=>d.toLowerCase().startsWith(a.toLowerCase())),c=i.map(l),f=0,h=0;for(let d=0;d<Math.max(i.length-ue,0);d++){let D=c.slice(d,d+ue).reduce((p,g)=>p+(g?1:0),0);D>=f&&(f=D,h=d)}s=Math.max(h-ue,0),u=Math.min(s+2*ue,i.length-1),i=i.slice(s,u)}let o=i.map(l=>{let c=l;for(let f of r)if(l.toLowerCase().includes(f.toLowerCase())){let h=new RegExp(f.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"gi");c=l.replace(h,d=>`<span class="highlight">${d}</span>`);break}return c}).join(" ");return(s===0?"":"...")+o+(u===i.length-1?"":"...")}function xi(t,e){return!e||e.length===0||t.length===0?[]:e.map(n=>{let r=se(n);return t.some(i=>n.toLowerCase().includes(i.toLowerCase()))?`<li><p class="match-tag">#${r}</p></li>`:`<li><p>#${r}</p></li>`}).slice(0,yi)}function Bi(t,e){let n=Ht[e];if(!n||!Z)return{id:e,slug:"",title:"",content:"",tags:[]};let r=Z[n];if(!r)return{id:e,slug:n,title:"",content:"",tags:[]};let i=oe(bt);return{id:e,slug:n,title:i.tags.length>0&&!i.query?se(r.title):Tn(t,r.title||""),content:Tn(t,r.content||"",!0),tags:xi(i.tags,r.tags)}}async function ki(){if(!Z)return;let t=0,e=[],n=new Set;for(let r of Object.keys(Z)){let i=Z[r];if(i){Ht[t]=r;for(let s of i.tags||[])n.add(s);e.push(le.addAsync(t,{id:t,slug:r,title:i.title||"",content:i.content||"",tags:i.tags||[]})),t++}}await Promise.all(e),Pt=[...n].sort()}async function bi(){return await fetchData}var Rt=!1;async function Ti(){Rt||(Z=await bi(),await ki(),Rt=!0)}async function Si(t){if(!Rt||!Z)return 0;let e=new Set(Pt),n=0;for(let r of Object.keys(t)){if(Z[r])continue;let i=t[r];if(!i)continue;let s=Ht.length;Ht[s]=r,Z[r]=i;for(let u of i.tags||[])e.add(u);await le.addAsync(s,{id:s,slug:r,title:i.title||"",content:i.content||"",tags:i.tags||[]}),n++}return Pt=[...e].sort(),n}document.addEventListener("content-index-updated",t=>{let e=t.detail;if(!Rt||!Z)return;let n=e?.slugs;!Array.isArray(n)||n.length===0||(async()=>{try{let r=await fetchData;if(!r||typeof r!="object")return;let i=r.content&&typeof r.content=="object"?r.content:r,s={};for(let u of n){let o=i[u];o&&typeof o=="object"&&(s[u]=o)}await Si(s)}catch{}})()});function Li(){let t=sessionStorage.getItem("search-term");t&&(sessionStorage.removeItem("search-term"),requestAnimationFrame(()=>{let e=".popover-hint h1, .popover-hint h2, .popover-hint h3, .popover-hint h4, .popover-hint h5, .popover-hint h6, article h1, article h2, article h3",n=".popover-hint p, .popover-hint li, .popover-hint td, .popover-hint th, .popover-hint blockquote, article p, article li",r=document.querySelectorAll(e),i=document.querySelectorAll(n),s=[...Array.from(r),...Array.from(i)];for(let u of s){let l=(u.textContent??"").toLowerCase().indexOf(t.toLowerCase());if(l===-1)continue;let c=document.createTreeWalker(u,NodeFilter.SHOW_TEXT),f=0,h,d=null,a=0,D=null,p=0;for(;h=c.nextNode();){let g=h.nodeValue?.length??0;if(!d&&f+g>l&&(d=h,a=l-f),d&&f+g>=l+t.length){D=h,p=l+t.length-f;break}f+=g}if(!(!d||!D)){try{let g=document.createRange();g.setStart(d,a),g.setEnd(D,p);let F=document.createElement("span");F.className="search-scroll-target",g.surroundContents(F),F.scrollIntoView({block:"center",behavior:"smooth"}),setTimeout(()=>{F.classList.add("fade-out"),setTimeout(()=>{let m=F.parentNode;m&&(m.replaceChild(document.createTextNode(F.textContent||""),F),m.normalize())},1e3)},2e3)}catch{u.scrollIntoView({block:"center",behavior:"smooth"})}break}}}))}async function Mn(){Ai(),await Ti(),await wi(),Li()}document.addEventListener("nav",Mn);document.addEventListener("render",Mn);
|