typedoc-theme-oxide 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,4 +4,4 @@ A TypeDoc theme looks just like [rustdoc](https://doc.rust-lang.org/stable/std/)
4
4
 
5
5
  ## Example
6
6
 
7
- https://balthild.github.io/typedoc-theme-oxide
7
+ https://balthild.github.io/typedoc-theme-oxide/
@@ -1,2 +1,2 @@
1
- body.rustdoc{--code-background:var(--code-block-background-color)}:target{display:block}.tsd-anchor-icon{display:none}.sidebar-elems .block li.parent-module a{letter-spacing:.1em}.impl-items>.toggle>summary+.docblock:empty{margin-bottom:-.75em}.docblock :last-child{margin-bottom:0}.docblock pre>button{display:none}.item-table.comment-tags{grid-template-columns:auto 1fr}.item-table.comment-tags .stab{padding:1px 5px}rustdoc-toolbar #help-button .shortcuts{width:100%}rustdoc-toolbar #help-button .bottom,rustdoc-toolbar #help-button .infos,rustdoc-toolbar #help-button .top{display:none}oxide-search-results .search-results.active{display:grid;grid-template-columns:min-content 1fr}oxide-search-results .search-results.active>.result-item{grid-template-areas:none}oxide-search-results .search-results.active>.result-item,oxide-search-results .search-results.active>.result-item .result-name{display:grid;grid-column:1/3;grid-template-columns:subgrid}oxide-search-results .search-results.active>.result-item .result-name .typename{grid-column:1/2;white-space:nowrap;width:auto}oxide-search-results .search-results.active>.result-item .result-name .path{grid-column:2/3}oxide-search-results .search-results.active>.result-item .result-name .path span{display:inline-block}
1
+ body.rustdoc{--code-background:var(--code-block-background-color)}.sidebar-elems .block li.parent-module a{letter-spacing:.1em}:target{display:block}a.token,span.token{color:var(--main-color)}.tsd-anchor-icon{display:none}.impl-items>.toggle>summary+.docblock:empty{margin-bottom:-.75em}.structfield{--code-background:none}.docblock :last-child{margin-bottom:0}.docblock pre>button{display:none}.item-table.comment-tags{grid-template-columns:auto 1fr}.item-table.comment-tags .stab{padding:1px 5px}rustdoc-toolbar #help-button .shortcuts{width:100%}rustdoc-toolbar #help-button .bottom,rustdoc-toolbar #help-button .infos,rustdoc-toolbar #help-button .top{display:none}oxide-search-results .search-results.active{display:grid;grid-template-columns:min-content 1fr}oxide-search-results .search-results.active>.result-item{grid-template-areas:none}oxide-search-results .search-results.active>.result-item,oxide-search-results .search-results.active>.result-item .result-name{display:grid;grid-column:1/3;grid-template-columns:subgrid}oxide-search-results .search-results.active>.result-item .result-name .typename{grid-column:1/2;white-space:nowrap;width:auto}oxide-search-results .search-results.active>.result-item .result-name .path{grid-column:2/3}oxide-search-results .search-results.active>.result-item .result-name .path span{display:inline-block}
2
2
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA,aACE,oDACF,CAEA,QACE,aACF,CAEA,iBACE,YACF,CAEA,yCACE,mBACF,CAEA,4CACE,oBACF,CAGE,sBACE,eACF,CAEA,qBACE,YACF,CAGF,yBACE,8BAKF,CAHE,+BACE,eACF,CAIA,wCACE,UACF,CAEA,2GACE,YACF,CAGF,4CACE,YAAa,CACb,qCA8BF,CA5BE,yDAEE,wBAyBF,CArBE,+HALA,YAAa,CAGb,eAAkB,CADlB,6BAuBA,CAdE,gFACE,eAAkB,CAElB,kBAAmB,CADnB,UAGF,CAEA,4EACE,eAKF,CAHE,iFACE,oBACF","file":"index.css","sourcesContent":["body.rustdoc {\n --code-background: var(--code-block-background-color);\n}\n\n:target {\n display: block;\n}\n\n.tsd-anchor-icon {\n display: none;\n}\n\n.sidebar-elems .block li.parent-module a {\n letter-spacing: 0.1em;\n}\n\n.impl-items > .toggle > summary + .docblock:empty {\n margin-bottom: -0.75em;\n}\n\n.docblock {\n :last-child {\n margin-bottom: 0;\n }\n\n pre > button {\n display: none;\n }\n}\n\n.item-table.comment-tags {\n grid-template-columns: auto 1fr;\n\n .stab {\n padding: 1px 5px;\n }\n}\n\nrustdoc-toolbar #help-button {\n .shortcuts {\n width: 100%;\n }\n\n .infos, .top, .bottom {\n display: none;\n }\n}\n\noxide-search-results .search-results.active {\n display: grid;\n grid-template-columns: min-content 1fr;\n\n > .result-item {\n display: grid;\n grid-template-areas: none;\n grid-template-columns: subgrid;\n grid-column: 1 / 3;\n\n .result-name {\n display: grid;\n grid-template-columns: subgrid;\n grid-column: 1 / 3;\n /* align-items: initial; */\n\n .typename {\n grid-column: 1 / 2;\n width: auto;\n white-space: nowrap;\n /* line-height: 1.5rem; */\n }\n\n .path {\n grid-column: 2 / 3;\n\n span {\n display: inline-block;\n }\n }\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["style.css"],"names":[],"mappings":"AAAA,aACE,oDACF,CAEA,yCACE,mBACF,CAEA,QACE,aACF,CAEA,mBACE,uBACF,CAEA,iBACE,YACF,CAEA,4CACE,oBACF,CAEA,aACE,sBACF,CAGE,sBACE,eACF,CAEA,qBACE,YACF,CAGF,yBACE,8BAKF,CAHE,+BACE,eACF,CAIA,wCACE,UACF,CAEA,2GACE,YACF,CAGF,4CACE,YAAa,CACb,qCA8BF,CA5BE,yDAEE,wBAyBF,CArBE,+HALA,YAAa,CAGb,eAAkB,CADlB,6BAuBA,CAdE,gFACE,eAAkB,CAElB,kBAAmB,CADnB,UAGF,CAEA,4EACE,eAKF,CAHE,iFACE,oBACF","file":"index.css","sourcesContent":["body.rustdoc {\n --code-background: var(--code-block-background-color);\n}\n\n.sidebar-elems .block li.parent-module a {\n letter-spacing: 0.1em;\n}\n\n:target {\n display: block;\n}\n\na.token, span.token {\n color: var(--main-color);\n}\n\n.tsd-anchor-icon {\n display: none;\n}\n\n.impl-items > .toggle > summary + .docblock:empty {\n margin-bottom: -0.75em;\n}\n\n.structfield {\n --code-background: none;\n}\n\n.docblock {\n :last-child {\n margin-bottom: 0;\n }\n\n pre > button {\n display: none;\n }\n}\n\n.item-table.comment-tags {\n grid-template-columns: auto 1fr;\n\n .stab {\n padding: 1px 5px;\n }\n}\n\nrustdoc-toolbar #help-button {\n .shortcuts {\n width: 100%;\n }\n\n .infos, .top, .bottom {\n display: none;\n }\n}\n\noxide-search-results .search-results.active {\n display: grid;\n grid-template-columns: min-content 1fr;\n\n > .result-item {\n display: grid;\n grid-template-areas: none;\n grid-template-columns: subgrid;\n grid-column: 1 / 3;\n\n .result-name {\n display: grid;\n grid-template-columns: subgrid;\n grid-column: 1 / 3;\n /* align-items: initial; */\n\n .typename {\n grid-column: 1 / 2;\n width: auto;\n white-space: nowrap;\n /* line-height: 1.5rem; */\n }\n\n .path {\n grid-column: 2 / 3;\n\n span {\n display: inline-block;\n }\n }\n }\n }\n}\n"]}
@@ -44,16 +44,8 @@ const ht=t=>(e,i)=>{void 0!==i?i.addInitializer((()=>{customElements.define(t,e)
44
44
  * Hosted by Nextapps GmbH
45
45
  * https://github.com/nextapps-de/flexsearch
46
46
  */
47
- var le;function he(t,e,i){const r=typeof i,n=typeof t;if("undefined"!==r){if("undefined"!==n){if(i){if("function"===n&&r===n)return function(e){return t(i(e))};if((e=t.constructor)===i.constructor){if(e===Array)return i.concat(t);if(e===Map){var s=new Map(i);for(var o of t)s.set(o[0],o[1]);return s}if(e===Set){for(s of(o=new Set(i),t.values()))o.add(s);return o}}}return t}return i}return"undefined"===n?e:t}function ce(){return Object.create(null)}function ue(t){return"string"==typeof t}function fe(t){return"object"==typeof t}function de(t,e){if(ue(e))t=t[e];else for(let i=0;t&&i<e.length;i++)t=t[e[i]];return t}(()=>{let t,e=oe,i=[],r=[];(class n extends e{static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[Ft],ne(null,null,t,{kind:"field",name:"_project",static:!1,private:!1,access:{has:t=>"_project"in t,get:t=>t._project,set:(t,e)=>{t._project=e}},metadata:n},i,r),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}type="reference";name;typeArguments;get reflection(){if("number"==typeof this._target)return this._project?.getReflectionById(this._target);const t=this._project?.getReflectionsFromSymbolId(this._target);if(!t?.length)return;const e=this.preferValues?Zt.ValueReferenceTarget:Zt.TypeReferenceTarget;return t.find((t=>t.kindOf(e)))||t.find((t=>t.kindOf(~e)))}highlightedProperties;get symbolId(){if(!this.reflection&&"object"==typeof this._target)return this._target}isIntentionallyBroken(){return!("object"!=typeof this._target||!this._project?.symbolIdHasBeenRemoved(this._target))||(-1===this._target||this.refersToTypeParameter)}toDeclarationReference(){return{resolutionStart:"global",moduleSource:this.package,symbolReference:{path:this.qualifiedName.split(".").map((t=>({path:t,navigation:"."})))}}}qualifiedName;package;externalUrl;refersToTypeParameter=!1;preferValues=!1;_target;_project=se(this,i,void 0);constructor(t,e,i,n){super(),se(this,r),this.name=t,this._target="number"==typeof e?e:"variant"in e?e.id:e,this._project=i,this.qualifiedName=n}static createUnresolvedReference(t,e,i,r){return new n(t,e,i,r)}static createResolvedReference(t,e,i){return new n(t,e,i,t)}static createBrokenReference(t,e){return new n(t,-1,e,t)}getTypeString(){const t=this.reflection?this.reflection.name:this.name;let e="";return this.typeArguments&&this.typeArguments.length>0&&(e+="<",e+=this.typeArguments.map((t=>t.stringify(ae.referenceTypeArgument))).join(", "),e+=">"),t+e}needsParenthesis(){return!1}toObject(t){let e;e="number"==typeof this._target?this._target:this._project?.symbolIdHasBeenRemoved(this._target)?-1:this.reflection?this.reflection.id:this._target.toObject();const i={type:this.type,target:e,typeArguments:t.toObjectsOptional(this.typeArguments),name:this.name,package:this.package,externalUrl:this.externalUrl};return this.name!==this.qualifiedName&&(i.qualifiedName=this.qualifiedName),this.refersToTypeParameter&&(i.refersToTypeParameter=!0),"number"!=typeof e&&this.preferValues&&(i.preferValues=!0),this.highlightedProperties&&(i.highlightedProperties=Object.fromEntries(Array.from(this.highlightedProperties.entries(),(([t,e])=>[t,Kt.serializeDisplayParts(e)])))),i}fromObject(t,e){if(this.typeArguments=t.reviveMany(e.typeArguments,(e=>t.constructType(e))),"number"==typeof e.target&&-1!==e.target?t.defer((i=>{const r=i.getReflectionById(t.oldIdToNewId[e.target]??-1);r?(this._project=i,this._target=r.id):t.logger.warn(Ut.serialized_project_referenced_0_not_part_of_project(JSON.stringify(e.target)))})):-1===e.target?this._target=-1:(this._project=t.project,this._target=new Vt(e.target)),this.qualifiedName=e.qualifiedName??e.name,this.package=e.package,this.refersToTypeParameter=!!e.refersToTypeParameter,this.preferValues=!!e.preferValues,e.highlightedProperties){this.highlightedProperties=new Map;for(const[i,r]of Object.entries(e.highlightedProperties))this.highlightedProperties.set(i,Kt.deserializeDisplayParts(t,r))}}})})();const ge=/[^\p{L}\p{N}]+/u,pe=/(\d{3})/g,me=/(\D)(\d{3})/g,ye=/(\d{3})(\D)/g,be=/[\u0300-\u036f]/g;function ve(t={}){if(!this||this.constructor!==ve)return new ve(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}function _e(t){t.H=null,t.B.clear(),t.G.clear()}let we,xe,ke,Se,$e;async function Ae(t){var e=(t=t.data).task;const i=t.id;let r=t.args;if("init"===e)xe=t.options||{},(e=t.factory)?(Function("return "+e)()(self),we=new self.FlexSearch.Index(xe),delete self.FlexSearch):we=new Ci(xe),postMessage({id:i});else{let n;"export"===e&&(r[1]?(r[0]=xe.export,r[2]=0,r[3]=1):r=null),"import"===e?r[0]&&(t=await xe.import.call(we,r[0]),we.import(r[0],t)):(n=r&&we[e].apply(we,r))&&n.then&&(n=await n),postMessage("search"===e?{id:i,msg:n}:{id:i})}}function Pe(t){Te.call(t,"add"),Te.call(t,"append"),Te.call(t,"search"),Te.call(t,"update"),Te.call(t,"remove"),Te.call(t,"searchCache")}function je(){ke=$e=0}function Te(t){this[t+"Async"]=function(){const e=arguments;var i=e[e.length-1];let r;if("function"==typeof i&&(r=i,delete e[e.length-1]),ke?$e||($e=Date.now()-Se>=this.priority*this.priority*3):(ke=setTimeout(je,0),Se=Date.now()),$e){const i=this;return new Promise((r=>{setTimeout((function(){r(i[t+"Async"].apply(i,e))}),0)}))}const n=this[t].apply(this,e);return i=n.then?n:new Promise((t=>t(n))),r&&i.then(r),i}}(le=ve.prototype).assign=function(t){this.normalize=he(t.normalize,!0,this.normalize);let e,i=t.include,r=i||t.exclude||t.split;if(r||""===r){if("object"==typeof r&&r.constructor!==RegExp){let t="";e=!i,i||(t+="\\p{Z}"),r.letter&&(t+="\\p{L}"),r.number&&(t+="\\p{N}",e=!!i),r.symbol&&(t+="\\p{S}"),r.punctuation&&(t+="\\p{P}"),r.control&&(t+="\\p{C}"),(r=r.char)&&(t+="object"==typeof r?r.join(""):r);try{this.split=new RegExp("["+(i?"^":"")+t+"]+","u")}catch(t){this.split=/\s+/}}else this.split=r,e=!1===r||2>"a1a".split(r).length;this.numeric=he(t.numeric,e)}else{try{this.split=he(this.split,ge)}catch(t){this.split=/\s+/}this.numeric=he(t.numeric,he(this.numeric,!0))}if(this.prepare=he(t.prepare,null,this.prepare),this.finalize=he(t.finalize,null,this.finalize),r=t.filter,this.filter="function"==typeof r?r:he(r&&new Set(r),null,this.filter),this.dedupe=he(t.dedupe,!0,this.dedupe),this.matcher=he((r=t.matcher)&&new Map(r),null,this.matcher),this.mapper=he((r=t.mapper)&&new Map(r),null,this.mapper),this.stemmer=he((r=t.stemmer)&&new Map(r),null,this.stemmer),this.replacer=he(t.replacer,null,this.replacer),this.minlength=he(t.minlength,1,this.minlength),this.maxlength=he(t.maxlength,1024,this.maxlength),this.rtl=he(t.rtl,!1,this.rtl),(this.cache=r=he(t.cache,!0,this.cache))&&(this.H=null,this.S="number"==typeof r?r:2e5,this.B=new Map,this.G=new Map,this.L=this.K=128),this.h="",this.M=null,this.A="",this.N=null,this.matcher)for(const t of this.matcher.keys())this.h+=(this.h?"|":"")+t;if(this.stemmer)for(const t of this.stemmer.keys())this.A+=(this.A?"|":"")+t;return this},le.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.N=null,this.cache&&_e(this),this},le.addFilter=function(t){return"function"==typeof t?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&_e(this),this},le.addMapper=function(t,e){return"object"==typeof t?this.addReplacer(t,e):1<t.length?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&_e(this),this)},le.addMatcher=function(t,e){return"object"==typeof t?this.addReplacer(t,e):2>t.length&&(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.M=null,this.cache&&_e(this),this)},le.addReplacer=function(t,e){return"string"==typeof t?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&_e(this),this)},le.encode=function(t,e){if(this.cache&&t.length<=this.K)if(this.H){if(this.B.has(t))return this.B.get(t)}else this.H=setTimeout(_e,50,this);this.normalize&&(t="function"==typeof this.normalize?this.normalize(t):be?t.normalize("NFKD").replace(be,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&3<t.length&&(t=t.replace(me,"$1 $2").replace(ye,"$1 $2").replace(pe,"$1 "));const i=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let r,n,s=[],o=ce(),a=this.split||""===this.split?t.split(this.split):[t];for(let t,h,c=0;c<a.length;c++)if((t=h=a[c])&&!(t.length<this.minlength||t.length>this.maxlength)){if(e){if(o[t])continue;o[t]=1}else{if(r===t)continue;r=t}if(i)s.push(t);else if(!this.filter||("function"==typeof this.filter?this.filter(t):!this.filter.has(t))){if(this.cache&&t.length<=this.L)if(this.H){var l=this.G.get(t);if(l||""===l){l&&s.push(l);continue}}else this.H=setTimeout(_e,50,this);if(this.stemmer){let e;for(this.N||(this.N=new RegExp("(?!^)("+this.A+")$"));e!==t&&2<t.length;)e=t,t=t.replace(this.N,(t=>this.stemmer.get(t)))}if(t&&(this.mapper||this.dedupe&&1<t.length)){l="";for(let e,i,r=0,n="";r<t.length;r++)e=t.charAt(r),e===n&&this.dedupe||((i=this.mapper&&this.mapper.get(e))||""===i?i===n&&this.dedupe||!(n=i)||(l+=i):l+=n=e);t=l}if(this.matcher&&1<t.length&&(this.M||(this.M=new RegExp("("+this.h+")","g")),t=t.replace(this.M,(t=>this.matcher.get(t)))),t&&this.replacer)for(l=0;t&&l<this.replacer.length;l+=2)t=t.replace(this.replacer[l],this.replacer[l+1]);if(this.cache&&h.length<=this.L&&(this.G.set(h,t),this.G.size>this.S&&(this.G.clear(),this.L=this.L/1.1|0)),t){if(t!==h)if(e){if(o[t])continue;o[t]=1}else{if(n===t)continue;n=t}s.push(t)}}}return this.finalize&&(s=this.finalize(s)||s),this.cache&&t.length<=this.K&&(this.B.set(t,s),this.B.size>this.S&&(this.B.clear(),this.K=this.K/1.1|0)),s};let Oe=0;function Ee(e={},i){function r(t){function r(t){const e=(t=t.data||t).id,i=e&&o.h[e];i&&(i(t.msg),delete o.h[e])}if(this.worker=t,this.h=ce(),this.worker)return s?this.worker.on("message",r):this.worker.onmessage=r,e.config?new Promise((function(t){o.h[++Oe]=function(){t(o),1e9<Oe&&(Oe=0)},o.worker.postMessage({id:Oe,task:"init",factory:n,options:e})})):(this.worker.postMessage({task:"init",factory:n,options:e}),this.priority=e.priority||4,i&&(this.encoder=i),this)}if(!this||this.constructor!==Ee)return new Ee(e);let n="undefined"!=typeof self?self._factory:"undefined"!=typeof window?window._factory:null;n&&(n=n.toString());const s="undefined"==typeof window,o=this,a=function(e,i,r){return i?"undefined"!=typeof module?new(require("worker_threads").Worker)(__dirname+"/worker/node.js"):import("worker_threads").then((function(t){return new t.Worker(void 0+"/node/node.mjs")})):e?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Ae.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof r?r:(t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("index.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js"),{type:"module"})}(n,s,e.worker);return a.then?a.then((function(t){return r.call(o,t)})):r.call(this,a)}function Ce(t){Ee.prototype[t]=function(){const e=this,i=[].slice.call(arguments);var r=i[i.length-1];let n;return"function"==typeof r&&(n=r,i.pop()),r=new Promise((function(r){"export"===t&&"function"==typeof i[0]&&(i[0]=null),e.h[++Oe]=r,e.worker.postMessage({task:t,id:Oe,args:i})})),n?(r.then(n),this):r}}function Me(t,e=0){let i=[],r=[];e&&(e=25e4/e*5e3|0);for(const n of t.entries())r.push(n),r.length===e&&(i.push(r),r=[]);return r.length&&i.push(r),i}function Ne(t,e){e||(e=new Map);for(let i,r=0;r<t.length;r++)i=t[r],e.set(i[0],i[1]);return e}function Ie(t,e=0){let i=[],r=[];e&&(e=25e4/e*1e3|0);for(const n of t.entries())r.push([n[0],Me(n[1])[0]]),r.length===e&&(i.push(r),r=[]);return r.length&&i.push(r),i}function De(t,e){e||(e=new Map);for(let i,r,n=0;n<t.length;n++)i=t[n],r=e.get(i[0]),e.set(i[0],Ne(i[1],r));return e}function ze(t){let e=[],i=[];for(const r of t.keys())i.push(r),25e4===i.length&&(e.push(i),i=[]);return i.length&&e.push(i),e}function Re(t,e){e||(e=new Set);for(let i=0;i<t.length;i++)e.add(t[i]);return e}function Fe(t,e,i,r,n,s,o=0){const a=r&&r.constructor===Array;var l=a?r.shift():r;if(!l)return this.export(t,e,n,s+1);if((l=t((e?e+".":"")+(o+1)+"."+i,JSON.stringify(l)))&&l.then){const h=this;return l.then((function(){return Fe.call(h,t,e,i,a?r:null,n,s,o+1)}))}return Fe.call(this,t,e,i,a?r:null,n,s,o+1)}function Le(t,e){let i="";for(const r of t.entries()){t=r[0];const n=r[1];let s="";for(let t,i=0;i<n.length;i++){t=n[i]||[""];let r="";for(let i=0;i<t.length;i++)r+=(r?",":"")+("string"===e?'"'+t[i]+'"':t[i]);r="["+r+"]",s+=(s?",":"")+r}s='["'+t+'",['+s+"]]",i+=(i?",":"")+s}return i}function Ue(t,e,i,r){let n=[];for(let s,o=0;o<t.index.length;o++)if(s=t.index[o],e>=s.length)e-=s.length;else{const o=(e=s[r?"splice":"slice"](e,i)).length;if(o&&(n=n.length?n.concat(e):e,i-=o,r&&(t.length-=o),!i))break;e=0}return n}function Be(t){if(!this||this.constructor!==Be)return new Be(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get:(t,i)=>"length"===i?e.length:"push"===i?function(t){e.index[e.index.length-1].push(t),e.length++}:"pop"===i?function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()}:"indexOf"===i?function(t){let i=0;for(let r,n,s=0;s<e.index.length;s++){if(r=e.index[s],n=r.indexOf(t),0<=n)return i+n;i+=r.length}return-1}:"includes"===i?function(t){for(let i=0;i<e.index.length;i++)if(e.index[i].includes(t))return!0;return!1}:"slice"===i?function(t,i){return Ue(e,t||0,i||e.length,!1)}:"splice"===i?function(t,i){return Ue(e,t||0,i||e.length,!0)}:"constructor"===i?Array:"symbol"!=typeof i?(t=e.index[i/2**31|0])&&t[i]:void 0,set:(t,i,r)=>(t=i/2**31|0,(e.index[t]||(e.index[t]=[]))[i]=r,e.length++,!0)})}function qe(t=8){if(!this||this.constructor!==qe)return new qe(t);this.index=ce(),this.h=[],this.size=0,32<t?(this.B=We,this.A=BigInt(t)):(this.B=Ve,this.A=t)}function He(t=8){if(!this||this.constructor!==He)return new He(t);this.index=ce(),this.h=[],this.size=0,32<t?(this.B=We,this.A=BigInt(t)):(this.B=Ve,this.A=t)}function Ve(t){let e=2**this.A-1;if("number"==typeof t)return t&e;let i=0,r=this.A+1;for(let n=0;n<t.length;n++)i=(i*r^t.charCodeAt(n))&e;return 32===this.A?i+2**31:i}function We(t){let e=BigInt(2)**this.A-BigInt(1);var i=typeof t;if("bigint"===i)return t&e;if("number"===i)return BigInt(t)&e;i=BigInt(0);let r=this.A+BigInt(1);for(let n=0;n<t.length;n++)i=(i*r^BigInt(t.charCodeAt(n)))&e;return i}function Ge(t,e,i,r,n,s){if(t=t[n],r===i.length-1)e[n]=s||t;else if(t)if(t.constructor===Array)for(e=e[n]=Array(t.length),n=0;n<t.length;n++)Ge(t,e,i,r,n);else e=e[n]||(e[n]=ce()),n=i[++r],Ge(t,e,i,r,n)}function Je(t,e,i,r,n,s,o,a){if(t=t[o])if(r===e.length-1){if(t.constructor===Array){if(i[r]){for(e=0;e<t.length;e++)n.add(s,t[e],!0,!0);return}t=t.join(" ")}n.add(s,t,a,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)Je(t,e,i,r,n,s,o,a);else o=e[++r],Je(t,e,i,r,n,s,o,a);else n.db&&n.remove(s)}function Ke(t,e,i,r){if(!t.length)return t;if(1===t.length)return t=t[0],t=i||t.length>e?e?t.slice(i,i+e):t.slice(i):t,r?ui.call(this,t):t;let n=[];for(let s,o,a=0;a<t.length;a++)if((s=t[a])&&(o=s.length)){if(i){if(i>=o){i-=o;continue}i<o&&(s=e?s.slice(i,i+e):s.slice(i),o=s.length,i=0)}if(o>e&&(s=s.slice(0,e),o=e),!n.length&&o>=e)return r?ui.call(this,s):s;if(n.push(s),!(e-=o))break}return n=1<n.length?[].concat.apply([],n):n[0],r?ui.call(this,n):n}function Ze(t,e,i){var r=i[0];if(r.then)return Promise.all(i).then((function(i){return t[e].apply(t,i)}));if(r[0]&&r[0].index)return t[e].apply(t,r);r=[];let n,s,o,a,l,h=[],c=0,u=0;for(let d,g=0;g<i.length;g++)if(d=i[g]){var f=void 0;if(d.constructor===ni)f=d.result;else if(d.constructor===Array)f=d;else{let e;if(c=d.limit||0,u=d.offset||0,o=d.suggest,s=d.resolve,n=(a=d.highlight&&s)||d.enrich&&s,d.index?t.index=e=d.index:e=t.index,d.query||d.tag)(f=d.field||d.pluck)&&(e=t.index.index.get(f)),d.resolve=!1,f=e.search(d).result,d.resolve=s,a&&(l=d.query);else if(d.and)f=t.and(d.and);else if(d.or)f=t.or(d.or);else if(d.xor)f=t.xor(d.xor);else{if(!d.not)continue;f=t.not(d.not)}}if(f.then)h.push(f);else if(f.length)r[g]=f;else if(!o&&("and"===e||"xor"===e)){r=[];break}}return{O:r,P:h,limit:c,offset:u,enrich:n,resolve:s,suggest:o,highlight:a,W:l}}function Qe(t,e,i,r,n,s){if(e.length){const o=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return Qe.call(o,t,[],i,r,n,s)}))}return t.length&&(this.result.length&&t.push(this.result),2>t.length?this.result=t[0]:(this.result=oi(t,i,r,!1,this.h),r=0)),s?this.resolve(i,r,n):this}function Xe(t,e,i,r,n,s,o){if(e.length){const a=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return Xe.call(a,t,[],i,r,n,s,o)}))}if(t.length)if(this.result.length&&t.unshift(this.result),2>t.length)this.result=t[0];else{if(e=function(t){let e=0;for(let i,r=0;r<t.length;r++)(i=t[r])&&e<i.length&&(e=i.length);return e}(t))return this.result=si(t,e,i,r,o,this.h,s),s?n?ui.call(this.index,this.result):this.result:this;this.result=[]}else o||(this.result=t);return s?this.resolve(i,r,n):this}function Ye(t,e,i,r,n,s,o){if(e.length){const a=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return Ye.call(a,t,[],i,r,n,s,o)}))}if(t.length){if(this.result.length&&t.unshift(this.result),!(2>t.length))return this.result=ti.call(this,t,i,r,s,this.h),s?n?ui.call(this.index,this.result):this.result:this;this.result=t[0]}else o||(this.result=t);return s?this.resolve(i,r,n):this}function ti(t,e,i,r,n){const s=[],o=ce();let a=0;for(let e,i=0;i<t.length;i++)if(e=t[i]){a<e.length&&(a=e.length);for(let t,i=0;i<e.length;i++)if(t=e[i])for(let e,i=0;i<t.length;i++)e=t[i],o[e]=o[e]?2:1}for(let l,h=0,c=0;h<a;h++)for(let a,u=0;u<t.length;u++)if((a=t[u])&&(l=a[h]))for(let t,a=0;a<l.length;a++)if(t=l[a],1===o[t])if(i)i--;else if(r){if(s.push(t),s.length===e)return s}else{const i=h+(u?n:0);if(s[i]||(s[i]=[]),s[i].push(t),++c===e)return s}return s}function ei(t,e,i,r,n,s,o){if(e.length){const a=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return ei.call(a,t,[],i,r,n,s,o)}))}if(t.length&&this.result.length)this.result=ii.call(this,t,i,r,s);else if(s)return this.resolve(i,r,n);return s?n?ui.call(this.index,this.result):this.result:this}function ii(t,e,i,r){const n=[];t=new Set(t.flat().flat());for(let s,o=0,a=0;o<this.result.length;o++)if(s=this.result[o])for(let l,h=0;h<s.length;h++)if(l=s[h],!t.has(l))if(i)i--;else if(r){if(n.push(l),n.length===e)return n}else if(n[o]||(n[o]=[]),n[o].push(l),++a===e)return n;return n}function ri(t,e,i,r,n){let s,o,a;"string"==typeof n?(s=n,n=""):s=n.template,o=s.indexOf("$1"),a=s.substring(o+2),o=s.substring(0,o);let l=n&&n.boundary,h=!n||!1!==n.clip,c=n&&n.merge&&a&&o&&new RegExp(a+" "+o,"g");var u=0;if("object"==typeof(n=n&&n.ellipsis)){var f=n.template;u=f.length-2,n=n.pattern}let d,g;"string"!=typeof n&&(n=!1===n?"":"..."),u&&(n=f.replace("$1",n)),f=n.length-u,"object"==typeof l&&(d=l.before,0===d&&(d=-1),g=l.after,0===g&&(g=-1),l=l.total||9e5),u=new Map;for(let M,N,I,D=0;D<e.length;D++){let z;if(r)z=e,I=r;else{var p=e[D];if(I=p.field,!I)continue;z=p.result}N=i.get(I),M=N.encoder,"string"!=typeof(p=u.get(M))&&(p=M.encode(t),u.set(M,p));for(let t=0;t<z.length;t++){var m=z[t].doc;if(!m)continue;if(!(m=de(m,I)))continue;var y=m.trim().split(/\s+/);if(!y.length)continue;m="";var b=[];let e=[];for(var v=-1,_=-1,w=0,x=0;x<y.length;x++){var k=y[x],S=M.encode(k);let t;if((S=1<S.length?S.join(" "):S[0])&&k){for(var $=k.length,A=(M.split?k.replace(M.split,""):k).length-S.length,P="",j=0,T=0;T<p.length;T++){var O=p[T];if(O){var E=O.length;E+=A,j&&E<=j||-1<(O=S.indexOf(O))&&(P=(O?k.substring(0,O):"")+o+k.substring(O,O+E)+a+(O+E<$?k.substring(O+E):""),j=E,t=!0)}}P&&(l&&(0>v&&(v=m.length+(m?1:0)),_=m.length+(m?1:0)+P.length,w+=$,e.push(b.length),b.push({match:P})),m+=(m?" ":"")+P)}if(t){if(l&&w>=l)break}else m+=(m?" ":"")+(k=y[x]),l&&b.push({text:k})}if(w=e.length*(s.length-2),d||g||l&&m.length-w>l)if(x=_-v,0<d&&(x+=d),0<g&&(x+=g),x<=(w=l+w-2*f))y=d?v-(0<d?d:0):v-((w-x)/2|0),b=g?_+(0<g?g:0):y+w,h||(0<y&&" "!==m.charAt(y)&&" "!==m.charAt(y-1)&&(0>(y=m.indexOf(" ",y))&&(y=0)),b<m.length&&" "!==m.charAt(b-1)&&" "!==m.charAt(b)&&((b=m.lastIndexOf(" ",b))<_?b=_:++b)),m=(y?n:"")+m.substring(y,b)+(b<m.length?n:"");else{for(_=[],v={},w={},x={},k={},S={},P=A=$=0,T=j=1;;){var C=void 0;for(let t,i=0;i<e.length;i++){if(t=e[i],P)if(A!==P){if(x[i+1])continue;if(t+=P,v[t]){$-=f,w[i+1]=1,x[i+1]=1;continue}if(t>=b.length-1){if(t>=b.length){x[i+1]=1,t>=y.length&&(w[i+1]=1);continue}$-=f}if(m=b[t].text,E=g&&S[i]){if(!(0<E)){x[i+1]=1;continue}if(m.length>E){if(x[i+1]=1,!h)continue;m=m.substring(0,E)}(E-=m.length)||(E=-1),S[i]=E}if($+m.length+1<=l)m=" "+m,_[i]+=m;else{if(!h){x[i+1]=1;continue}0<(C=l-$-1)&&(m=" "+m.substring(0,C),_[i]+=m),x[i+1]=1}}else{if(x[i])continue;if(t-=A,v[t]){$-=f,x[i]=1,w[i]=1;continue}if(0>=t){if(0>t){x[i]=1,w[i]=1;continue}$-=f}if(m=b[t].text,E=d&&k[i]){if(!(0<E)){x[i]=1;continue}if(m.length>E){if(x[i]=1,!h)continue;m=m.substring(m.length-E)}(E-=m.length)||(E=-1),k[i]=E}if($+m.length+1<=l)m+=" ",_[i]=m+_[i];else{if(!h){x[i]=1;continue}0<=(C=m.length+1-(l-$))&&C<m.length&&(m=m.substring(C)+" ",_[i]=m+_[i]),x[i]=1}}else{let e;if(m=b[t].match,d&&(k[i]=d),g&&(S[i]=g),i&&$++,t?!i&&f&&($+=f):(w[i]=1,x[i]=1),t>=y.length-1||t<b.length-1&&b[t+1].match?e=1:f&&($+=f),$-=s.length-2,i&&!($+m.length<=l)){C=j=T=w[i]=0;break}_[i]=m,e&&(w[i+1]=1,x[i+1]=1)}$+=m.length,C=v[t]=1}if(C)A===P?P++:A++;else{if(A===P?j=0:T=0,!j&&!T)break;j?P=++A:P++}}m="";for(let t,e=0;e<_.length;e++)t=(e&&w[e]?" ":(e&&!n?" ":"")+n)+_[e],m+=t;n&&!w[_.length]&&(m+=n)}c&&(m=m.replace(c," ")),z[t].highlight=m}if(r)break}return e}function ni(t,e){return this&&this.constructor===ni?t&&t.index?(t.resolve=!1,this.index=t.index,this.h=t.boost||0,this.result=this.index.search(t).result,this):(this.index=e||null,this.result=t||[],void(this.h=0)):new ni(t,e)}function si(t,e,i,r,n,s,o){const a=t.length;let l,h,c=[];l=ce();for(let u,f,d,g,p=0;p<e;p++)for(let e=0;e<a;e++)if(d=t[e],p<d.length&&(u=d[p]))for(let t=0;t<u.length;t++){if(f=u[t],(h=l[f])?l[f]++:(h=0,l[f]=1),g=c[h]||(c[h]=[]),!o){let t=p+(e||!n?0:s||0);g=g[t]||(g[t]=[])}if(g.push(f),o&&i&&h===a-1&&g.length-r===i)return r?g.slice(r):g}if(t=c.length)if(n)c=1<c.length?oi(c,i,r,o,s):(c=c[0]).length>i||r?c.slice(r,i+r):c;else{if(t<a)return[];if(c=c[t-1],i||r)if(o)(c.length>i||r)&&(c=c.slice(r,i+r));else{n=[];for(let t,e=0;e<c.length;e++)if(t=c[e])if(r&&t.length>r)r-=t.length;else if((i&&t.length>i||r)&&(t=t.slice(r,i+r),i-=t.length,r&&(r-=t.length)),n.push(t),!i)break;c=n}}return c}function oi(t,e,i,r,n){const s=[],o=ce();let a;var l=t.length;let h;if(r){for(n=l-1;0<=n;n--)if(h=(r=t[n])&&r.length)for(l=0;l<h;l++)if(a=r[l],!o[a])if(o[a]=1,i)i--;else if(s.push(a),s.length===e)return s}else for(let c,u=l-1,f=0;0<=u;u--){c=t[u];for(let t=0;t<c.length;t++)if(h=(r=c[t])&&r.length)for(let c=0;c<h;c++)if(a=r[c],!o[a])if(o[a]=1,i)i--;else{let i=(t+(u<l-1&&n||0))/(u+1)|0;if((s[i]||(s[i]=[])).push(a),++f===e)return s}}return s}function ai(t,e,i){const r=ce(),n=[];for(let t,i=0;i<e.length;i++){t=e[i];for(let e=0;e<t.length;e++)r[t[e]]=1}if(i)for(let e,i=0;i<t.length;i++)e=t[i],r[e]&&(n.push(e),r[e]=0);else for(let i,s,o=0;o<t.result.length;o++)for(i=t.result[o],e=0;e<i.length;e++)s=i[e],r[s]&&((n[o]||(n[o]=[])).push(s),r[s]=0);return n}function li(t,e){return void 0===t?e:t}function hi(t){const e=[],i=ce();for(let r,n,s=0;s<t.length;s++){r=t[s],n=r.result;for(let t,s,o,a=0;a<n.length;a++)s=n[a],"object"!=typeof s&&(s={id:s}),t=s.id,(o=i[t])?o.push(r.field):(s.field=i[t]=[r.field],e.push(s))}return e}function ci(t,e,i,r,n){return(t=this.tag.get(t))?(e=(t=t&&t.get(e))&&t.length-r)&&0<e?((i&&e>i||r)&&(t=t.slice(r,r+i)),n&&(t=ui.call(this,t)),t):void 0:[]}function ui(t){if(!this||!this.store)return t;const e=Array(t.length);for(let i,r=0;r<t.length;r++)i=t[r],e[r]={id:i,doc:this.store.get(i)};return e}Ce("add"),Ce("append"),Ce("search"),Ce("update"),Ce("remove"),Ce("clear"),Ce("export"),Ce("import"),Pe(Ee.prototype),Be.prototype.clear=function(){this.index.length=0},Be.prototype.destroy=function(){this.proxy=this.index=null},Be.prototype.push=function(){},qe.prototype.get=function(t){const e=this.index[this.B(t)];return e&&e.get(t)},qe.prototype.set=function(t,e){var i=this.B(t);let r=this.index[i];r?(i=r.size,r.set(t,e),(i-=r.size)&&this.size++):(this.index[i]=r=new Map([[t,e]]),this.h.push(r),this.size++)},He.prototype.add=function(t){var e=this.B(t);let i=this.index[e];i?(e=i.size,i.add(t),(e-=i.size)&&this.size++):(this.index[e]=i=new Set([t]),this.h.push(i),this.size++)},(le=qe.prototype).has=He.prototype.has=function(t){const e=this.index[this.B(t)];return e&&e.has(t)},le.delete=He.prototype.delete=function(t){const e=this.index[this.B(t)];e&&e.delete(t)&&this.size--},le.clear=He.prototype.clear=function(){this.index=ce(),this.h=[],this.size=0},le.values=He.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e},le.keys=He.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e},le.entries=He.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e},vi.prototype.add=function(t,e,i){if(fe(t)&&(t=de(e=t,this.key)),e&&(t||0===t)){if(!i&&this.reg.has(t))return this.update(t,e);for(let s,o=0;o<this.field.length;o++){s=this.F[o];var r=this.index.get(this.field[o]);if("function"==typeof s){var n=s(e);n&&r.add(t,n,!1,!0)}else(!(n=s.I)||n(e))&&(s.constructor===String?s=[""+s]:ue(s)&&(s=[s]),Je(e,s,this.J,0,r,t,s[0],i))}if(this.tag)for(r=0;r<this.D.length;r++){var s=this.D[r];n=this.tag.get(this.R[r]);let a=ce();if("function"==typeof s){if(!(s=s(e)))continue}else{var o=s.I;if(o&&!o(e))continue;s.constructor===String&&(s=""+s),s=de(e,s)}if(n&&s){ue(s)&&(s=[s]);for(let e,r,l=0;l<s.length;l++)if(e=s[l],!a[e]&&(a[e]=1,(o=n.get(e))?r=o:n.set(e,r=[]),!i||!r.includes(t))){if(r.length===2**31-1){if(o=new Be(r),this.fastupdate)for(let t of this.reg.values())t.includes(r)&&(t[t.indexOf(r)]=o);n.set(e,r=o)}r.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(r):this.reg.set(t,[r]))}}}if(this.store&&(!i||!this.store.has(t))){let r;if(this.C){r=ce();for(let t,n=0;n<this.C.length;n++){if(t=this.C[n],(i=t.I)&&!i(e))continue;let s;if("function"==typeof t){if(s=t(e),!s)continue;t=[t.V]}else if(ue(t)||t.constructor===String){r[t]=e[t];continue}Ge(e,r,t,0,t[0],s)}}this.store.set(t,r||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this},ni.prototype.or=function(){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s}=Ze(this,"or",arguments);return Qe.call(this,t,e,i,r,n,s)},ni.prototype.and=function(){let t,e,i,r,n=this.result.length;if(!n){const s=arguments[0];s&&(n=!!s.suggest,r=s.resolve,t=s.limit,e=s.offset,i=s.enrich&&r)}if(n){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s,suggest:o}=Ze(this,"and",arguments);return Xe.call(this,t,e,i,r,n,s,o)}return r?this.resolve(t,e,i):this},ni.prototype.xor=function(){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s,suggest:o}=Ze(this,"xor",arguments);return Ye.call(this,t,e,i,r,n,s,o)},ni.prototype.not=function(){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s,suggest:o}=Ze(this,"not",arguments);return ei.call(this,t,e,i,r,n,s,o)},ni.prototype.limit=function(t){if(this.result.length){const e=[];for(let i,r=0;r<this.result.length;r++)if(i=this.result[r]){if(!(i.length<=t)){e[r]=i.slice(0,t);break}if(e[r]=i,!(t-=i.length))break}this.result=e}return this},ni.prototype.offset=function(t){if(this.result.length){const e=[];for(let i,r=0;r<this.result.length;r++)(i=this.result[r])&&(i.length<=t?t-=i.length:(e[r]=i.slice(t),t=0));this.result=e}return this},ni.prototype.boost=function(t){return this.h+=t,this},ni.prototype.resolve=function(t,e,i){const r=this.index;let n=this.result;return this.result=this.index=null,n.length&&("object"==typeof t&&(i=t.enrich,e=t.offset,t=t.limit),n=Ke.call(r,n,t||100,e,i)),n},vi.prototype.search=function(t,e,i,r){if(i||(!e&&fe(t)?(i=t,t=""):fe(e)&&(i=e,e=0)),i&&i.cache){i.cache=!1;var n=this.searchCache(t,e,i);return i.cache=!0,n}let s=[];var o=[];let a,l,h,c,u,f,d,g=0,p=!0;if(i){i.constructor===Array&&(i={index:i}),t=i.query||t,a=i.pluck,l=i.merge,c=i.boost,u=a||i.field||(u=i.index)&&(u.index?null:u);var m=this.tag&&i.tag;h=i.suggest,f=(p=!1!==i.resolve)&&this.store&&i.highlight,n=!!f||p&&this.store&&i.enrich,e=i.limit||e;var y=i.offset||0;if(e||(e=p?100:0),m&&(!this.db||!r)){m.constructor!==Array&&(m=[m]);var b=[];for(let t,e=0;e<m.length;e++)if(t=m[e],t.field&&t.tag){var v=t.tag;if(v.constructor===Array)for(var _=0;_<v.length;_++)b.push(t.field,v[_]);else b.push(t.field,v)}else{v=Object.keys(t);for(let e,i,r=0;r<v.length;r++)if(e=v[r],i=t[e],i.constructor===Array)for(_=0;_<i.length;_++)b.push(e,i[_]);else b.push(e,i)}if(m=b,!t){if(o=[],b.length)for(m=0;m<b.length;m+=2){if(this.db){if(!(r=this.index.get(b[m])))continue;o.push(r=r.db.tag(b[m+1],e,y,n))}else r=ci.call(this,b[m],b[m+1],e,y,n);s.push(p?{field:b[m],tag:b[m+1],result:r}:[r])}if(o.length){const t=this;return Promise.all(o).then((function(e){for(let t=0;t<e.length;t++)p?s[t].result=e[t]:s[t]=e[t];return p?s:new ni(1<s.length?si(s,1,0,0,h,c):s[0],t)}))}return p?s:new ni(1<s.length?si(s,1,0,0,h,c):s[0],this)}}p||a||!(u=u||this.field)||(ue(u)?a=u:(u.constructor===Array&&1===u.length&&(u=u[0]),a=u.field||u.index)),u&&u.constructor!==Array&&(u=[u])}u||(u=this.field),b=(this.worker||this.db)&&!r&&[];for(let a,l,c,w=0;w<u.length;w++){if(l=u[w],this.db&&this.tag&&!this.F[w])continue;let x;if(ue(l)||(x=l,l=x.field,t=x.query||t,e=li(x.limit,e),y=li(x.offset,y),h=li(x.suggest,h),f=p&&this.store&&li(x.highlight,f),n=!!f||p&&this.store&&li(x.enrich,n)),r)a=r[w];else{if(v=x||i,_=this.index.get(l),m&&(this.db&&(v.tag=m,d=_.db.support_tag_search,v.field=u),d||(v.enrich=!1)),b){b[w]=_.search(t,e,v),v&&n&&(v.enrich=n);continue}a=_.search(t,e,v),v&&n&&(v.enrich=n)}if(c=a&&(p?a.length:a.result.length),m&&c){if(v=[],_=0,this.db&&r){if(!d)for(let t=u.length;t<r.length;t++){let e=r[t];if(e&&e.length)_++,v.push(e);else if(!h)return p?s:new ni(s,this)}}else for(let t,e,i=0;i<m.length;i+=2){if(t=this.tag.get(m[i]),!t){if(h)continue;return p?s:new ni(s,this)}if(e=(t=t&&t.get(m[i+1]))&&t.length)_++,v.push(t);else if(!h)return p?s:new ni(s,this)}if(_){if(a=ai(a,v,p),c=a.length,!c&&!h)return p?a:new ni(a,this);_--}}if(c)o[g]=l,s.push(a),g++;else if(1===u.length)return p?s:new ni(s,this)}if(b){if(this.db&&m&&m.length&&!d)for(n=0;n<m.length;n+=2){if(!(o=this.index.get(m[n]))){if(h)continue;return p?s:new ni(s,this)}b.push(o.db.tag(m[n+1],e,y,!1))}const r=this;return Promise.all(b).then((function(n){return n.length?r.search(t,e,i,n):n}))}if(!g)return p?s:new ni(s,this);if(a&&(!n||!this.store))return s=s[0],p||(s.index=this),s;for(b=[],y=0;y<o.length;y++){if(m=s[y],n&&m.length&&void 0===m[0].doc&&(this.db?b.push(m=this.index.get(this.field[0]).db.enrich(m)):m=ui.call(this,m)),a)return p?f?ri(t,m,this.index,a,f):m:new ni(m,this);s[y]={field:o[y],result:m}}if(n&&this.db&&b.length){const e=this;return Promise.all(b).then((function(i){for(let t=0;t<i.length;t++)s[t].result=i[t];return l?hi(s):f?ri(t,s,e.index,a,f):s}))}return l?hi(s):f?ri(t,s,this.index,a,f):s};const fi={normalize:!1,numeric:!1,dedupe:!1},di={},gi=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"]]),pi=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),mi=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],yi={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,"ß":2,d:3,t:3,l:4,m:5,n:5,r:6};var bi={Exact:fi,Default:di,Normalize:di,LatinBalance:{mapper:gi},LatinAdvanced:{mapper:gi,matcher:pi,replacer:mi},LatinExtra:{mapper:gi,replacer:mi.concat([/(?!^)[aeo]/g,""]),matcher:pi},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let i=0;i<t.length;i++){var e=t[i];let r=e.charAt(0),n=yi[r];for(let t,i=1;i<e.length&&(t=e.charAt(i),"h"===t||"w"===t||!(t=yi[t])||t===n||(r+=t,n=t,4!==r.length));i++);t[i]=r}}},CJK:{split:""},LatinExact:fi,LatinDefault:di,LatinSimple:di};function vi(t){if(!this||this.constructor!==vi)return new vi(t);const e=t.document||t.doc||t;let i,r;if(this.F=[],this.field=[],this.J=[],this.key=(i=e.key||e.id)&&wi(i,this.J)||"id",(r=t.keystore||0)&&(this.keystore=r),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?r?new He(r):new Set:r?new qe(r):new Map,this.C=(i=e.store||null)&&i&&!0!==i&&[],this.store=i&&(r?new qe(r):new Map),this.cache=(i=t.cache||null)&&new ki(i),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=_i.call(this,t,e),this.tag=null,(i=e.tag)&&("string"==typeof i&&(i=[i]),i.length)){this.tag=new Map,this.D=[],this.R=[];for(let t,e,r=0;r<i.length;r++){if(t=i[r],e=t.field||t,!e)throw Error("The tag field from the document descriptor is undefined.");t.custom?this.D[r]=t.custom:(this.D[r]=wi(e,this.J),t.filter&&("string"==typeof this.D[r]&&(this.D[r]=new String(this.D[r])),this.D[r].I=t.filter)),this.R[r]=e,this.tag.set(e,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const e of this.index.values())e.then&&t.push(e);if(t.length){const e=this;return Promise.all(t).then((function(t){let i=0;for(const r of e.index.entries()){const n=r[0];let s=r[1];s.then&&(s=t[i],e.index.set(n,s),i++)}return e}))}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}function _i(t,e){const i=new Map;let r=e.index||e.field||e;ue(r)&&(r=[r]);for(let e,s,o=0;o<r.length;o++){if(e=r[o],ue(e)||(s=e,e=e.field),s=fe(s)?Object.assign({},t,s):t,this.worker){var n=void 0;n=new Ee(s,n=(n=s.encoder)&&n.encode?n:new ve("string"==typeof n?bi[n]:n)),i.set(e,n)}this.worker||i.set(e,new Ci(s,this.reg)),s.custom?this.F[o]=s.custom:(this.F[o]=wi(e,this.J),s.filter&&("string"==typeof this.F[o]&&(this.F[o]=new String(this.F[o])),this.F[o].I=s.filter)),this.field[o]=e}if(this.C){ue(t=e.store)&&(t=[t]);for(let e,i,r=0;r<t.length;r++)e=t[r],i=e.field||e,e.custom?(this.C[r]=e.custom,e.custom.V=i):(this.C[r]=wi(i,this.J),e.filter&&("string"==typeof this.C[r]&&(this.C[r]=new String(this.C[r])),this.C[r].I=e.filter))}return i}function wi(t,e){const i=t.split(":");let r=0;for(let n=0;n<i.length;n++)"]"===(t=i[n])[t.length-1]&&(t=t.substring(0,t.length-2))&&(e[r]=!0),t&&(i[r++]=t);return r<i.length&&(i.length=r),1<r?i:i[0]}function xi(t,e,i){const r=(e?""+t:"object"==typeof t?""+t.query:t).toLowerCase();this.cache||(this.cache=new ki);let n=this.cache.get(r);if(!n){if(n=this.search(t,e,i),n.then){const t=this;n.then((function(e){return t.cache.set(r,e),e}))}this.cache.set(r,n)}return n}function ki(t){this.limit=t&&!0!==t?t:1e3,this.cache=new Map,this.h=""}function Si(t,e){let i=0;var r=void 0===e;if(t.constructor===Array){for(let n,s,o=0;o<t.length;o++)if((n=t[o])&&n.length)if(r)i++;else{if(s=n.indexOf(e),0<=s){1<n.length?(n.splice(s,1),i++):delete t[o];break}i++}}else for(let n of t.entries()){r=n[0];const s=Si(n[1],e);s?i+=s:t.delete(r)}return i}(le=vi.prototype).mount=function(t){let e=this.field;if(this.tag)for(let t,r=0;r<this.R.length;r++){t=this.R[r];var i=void 0;this.index.set(t,i=new Ci({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(t),i.tag=this.tag.get(t)}i=[];const r={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let n,s,o=0;o<e.length;o++){r.field=s=e[o],n=this.index.get(s);const a=new t.constructor(t.id,r);a.id=t.id,i[o]=a.mount(n),n.document=!0,o?n.bypass=!0:n.store=this.store}const n=this;return this.db=Promise.all(i).then((function(){n.db=!0}))},le.commit=async function(t,e){const i=[];for(const r of this.index.values())i.push(r.commit(t,e));await Promise.all(i),this.reg.clear()},le.destroy=function(){const t=[];for(const e of this.index.values())t.push(e.destroy());return Promise.all(t)},le.append=function(t,e){return this.add(t,e,!0)},le.update=function(t,e){return this.remove(t).add(t,e)},le.remove=function(t){for(var e of(fe(t)&&(t=de(t,this.key)),this.index.values()))e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let i of this.tag.values())for(let r of i){e=r[0];const n=r[1],s=n.indexOf(t);-1<s&&(1<n.length?n.splice(s,1):i.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},le.clear=function(){const t=[];for(const e of this.index.values()){const i=e.clear();i.then&&t.push(i)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},le.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},le.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},le.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then((function(t){return t[0]&&t[0].doc||null})):this.store.get(t)||null},le.set=function(t,e){return"object"==typeof t&&(t=de(e=t,this.key)),this.store.set(t,e),this},le.searchCache=xi,le.export=function(t,e,i=0,r=0){if(i<this.field.length){const n=this.field[i];if((e=this.index.get(n).export(t,n,i,r=1))&&e.then){const r=this;return e.then((function(){return r.export(t,n,i+1)}))}return this.export(t,n,i+1)}let n,s;switch(r){case 0:n="reg",s=ze(this.reg),e=null;break;case 1:n="tag",s=this.tag&&Ie(this.tag,this.reg.size),e=null;break;case 2:n="doc",s=this.store&&Me(this.store),e=null;break;default:return}return Fe.call(this,t,e,n,s,i,r)},le.import=function(t,e){var i=t.split(".");"json"===i[i.length-1]&&i.pop();const r=2<i.length?i[0]:"";if(i=2<i.length?i[2]:i[1],this.worker&&r)return this.index.get(r).import(t);if(e){if("string"==typeof e&&(e=JSON.parse(e)),r)return this.index.get(r).import(i,e);switch(i){case"reg":this.fastupdate=!1,this.reg=Re(e,this.reg);for(let t,e=0;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){e=[];for(const i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=De(e,this.tag);break;case"doc":this.store=Ne(e,this.store)}}},Pe(vi.prototype),ki.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)},ki.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e},ki.prototype.remove=function(t){for(const e of this.cache){const i=e[0];e[1].includes(t)&&this.cache.delete(i)}},ki.prototype.clear=function(){this.cache.clear(),this.h=""},Ci.prototype.remove=function(t,e){const i=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(i){if(this.fastupdate){for(let e,r=0;r<i.length;r++)if(e=i[r])if(2>e.length)e.pop();else{const r=e.indexOf(t);r===i.length-1?e.pop():e.splice(r,1)}}else Si(this.map,t),this.depth&&Si(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.T&&Mi(this)),this.cache&&this.cache.remove(t),this};const $i={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};function Ai(t,e,i,r,n,s,o){let a,l=o?t.ctx:t.map;if((!e[i]||o&&!(a=e[i])[o])&&(o?((e=a||(e[i]=ce()))[o]=1,(a=l.get(o))?l=a:l.set(o,l=new Map)):e[i]=1,(a=l.get(i))?l=a:l.set(i,l=a=[]),l=l[r]||(l[r]=[]),!s||!l.includes(n))){if(l.length===2**31-1){if(e=new Be(l),t.fastupdate)for(let i of t.reg.values())i.includes(l)&&(i[i.indexOf(l)]=e);a[r]=l=e}l.push(n),t.fastupdate&&((r=t.reg.get(n))?r.push(l):t.reg.set(n,[l]))}}function Pi(t,e,i,r,n){return i&&1<t?e+(r||0)<=t?i+(n||0):(t-1)/(e+(r||0))*(i+(n||0))+1|0:0}function ji(t,e,i,r,n,s,o){let a=t.length,l=t;if(1<a)l=si(t,e,i,r,n,s,o);else if(1===a)return o?Ke.call(null,t[0],i,r):new ni(t[0],this);return o?l:new ni(l,this)}function Ti(t,e,i,r,n,s,o){return t=Ei(this,t,e,i,r,n,s,o),this.db?t.then((function(t){return n?t||[]:new ni(t,this)})):t&&t.length?n?Ke.call(this,t,i,r):new ni(t,this):n?[]:new ni([],this)}function Oi(t,e,i,r){let n=[];if(t&&t.length){if(t.length<=r)return void e.push(t);for(let e,i=0;i<r;i++)(e=t[i])&&(n[i]=e);if(n.length)return void e.push(n)}if(!i)return n}function Ei(t,e,i,r,n,s,o,a){let l;return i&&(l=t.bidirectional&&e>i)&&(l=i,i=e,e=l),t.db?t.db.get(e,i,r,n,s,o,a):t=i?(t=t.ctx.get(i))&&t.get(e):t.map.get(e)}function Ci(t,e){if(!this||this.constructor!==Ci)return new Ci(t);if(t){var i=ue(t)?t:t.preset;i&&(t=Object.assign({},$i[i],t))}else t={};const r=!0===(i=t.context)?{depth:1}:i||{},n=ue(t.encoder)?bi[t.encoder]:t.encode||t.encoder||{};this.encoder=n.encode?n:"object"==typeof n?new ve(n):{encode:n},this.resolution=t.resolution||9,this.tokenize=i=(i=t.tokenize)&&"default"!==i&&"exact"!==i&&i||"strict",this.depth="strict"===i&&r.depth||0,this.bidirectional=!1!==r.bidirectional,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(i=t.keystore||0)&&(this.keystore=i),this.map=i?new qe(i):new Map,this.ctx=i?new qe(i):new Map,this.reg=e||(this.fastupdate?i?new qe(i):new Map:i?new He(i):new Set),this.U=r.resolution||3,this.rtl=n.rtl||t.rtl||!1,this.cache=(i=t.cache||null)&&new ki(i),this.resolve=!1!==t.resolve,(i=t.db)&&(this.db=this.mount(i)),this.T=!1!==t.commit,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}function Mi(t){t.commit_timer||(t.commit_timer=setTimeout((function(){t.commit_timer=null,t.db.commit(t,void 0,void 0)}),1))}Ci.prototype.add=function(t,e,i,r){if(e&&(t||0===t)){if(!r&&!i&&this.reg.has(t))return this.update(t,e);r=this.depth;const h=(e=this.encoder.encode(e,!r)).length;if(h){const c=ce(),u=ce(),f=this.resolution;for(let d=0;d<h;d++){let g=e[this.rtl?h-1-d:d];var n=g.length;if(n&&(r||!u[g])){var s=this.score?this.score(e,g,d,null,0):Pi(f,h,d),o="";switch(this.tokenize){case"full":if(2<n){for(let r,l=0;l<n;l++)for(s=n;s>l;s--){o=g.substring(l,s),r=this.rtl?n-1-l:l;var a=this.score?this.score(e,g,d,o,r):Pi(f,h,d,n,r);Ai(this,u,o,a,t,i)}break}case"bidirectional":case"reverse":if(1<n){for(a=n-1;0<a;a--){o=g[this.rtl?n-1-a:a]+o;var l=this.score?this.score(e,g,d,o,a):Pi(f,h,d,n,a);Ai(this,u,o,l,t,i)}o=""}case"forward":if(1<n){for(a=0;a<n;a++)Ai(this,u,o+=g[this.rtl?n-1-a:a],s,t,i);break}default:if(Ai(this,u,g,s,t,i),r&&1<h&&d<h-1)for(n=ce(),o=this.U,s=g,a=Math.min(r+1,this.rtl?d+1:h-d),n[s]=1,l=1;l<a;l++)if((g=e[this.rtl?h-1-d-l:d+l])&&!n[g]){n[g]=1;const r=this.score?this.score(e,s,d,g,l-1):Pi(o+(h/2>o?0:1),h,d,a-1,l-1),u=this.bidirectional&&g>s;Ai(this,c,u?s:g,r,t,i,u?g:s)}}}}this.fastupdate||this.reg.add(t)}else e=""}return this.db&&(e||this.commit_task.push({del:t}),this.T&&Mi(this)),this},Ci.prototype.search=function(t,e,i){if(i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):(i=t,t="")),i&&i.cache)return i.cache=!1,t=this.searchCache(t,e,i),i.cache=!0,t;let r,n,s,o,a,l,h,c,u=[],f=0;i&&(t=i.query||t,e=i.limit||e,f=i.offset||0,n=i.context,s=i.suggest,c=(o=i.resolve)&&i.enrich,l=i.boost,h=i.resolution,a=this.db&&i.tag),void 0===o&&(o=this.resolve),n=this.depth&&!1!==n;let d=this.encoder.encode(t,!n);if(r=d.length,e=e||(o?100:0),1===r)return Ti.call(this,d[0],"",e,f,o,c,a);if(2===r&&n&&!s)return Ti.call(this,d[1],d[0],e,f,o,c,a);let g,p=ce(),m=0;if(n&&(g=d[0],m=1),h||0===h||(h=g?this.U:this.resolution),this.db){if(this.db.search&&!1!==(i=this.db.search(this,d,e,f,s,o,c,a)))return i;const t=this;return async function(){for(let e,i;m<r;m++){if((i=d[m])&&!p[i]){if(p[i]=1,e=await Ei(t,i,g,0,0,!1,!1),e=Oi(e,u,s,h)){u=e;break}g&&(s&&e&&u.length||(g=i))}s&&g&&m===r-1&&!u.length&&(h=t.resolution,g="",m=-1,p=ce())}return ji(u,h,e,f,s,l,o)}()}for(let t,e;m<r;m++){if((e=d[m])&&!p[e]){if(p[e]=1,t=Ei(this,e,g,0,0,!1,!1),t=Oi(t,u,s,h)){u=t;break}g&&(s&&t&&u.length||(g=e))}s&&g&&m===r-1&&!u.length&&(h=this.resolution,g="",m=-1,p=ce())}return ji(u,h,e,f,s,l,o)},(le=Ci.prototype).mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},le.commit=function(t,e){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this,t,e)},le.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},le.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=[{clear:!0}]),this},le.append=function(t,e){return this.add(t,e,!0)},le.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},le.update=function(t,e){const i=this,r=this.remove(t);return r&&r.then?r.then((()=>i.add(t,e))):this.add(t,e)},le.cleanup=function(){return this.fastupdate?(Si(this.map),this.depth&&Si(this.ctx),this):this},le.searchCache=xi,le.export=function(t,e,i=0,r=0){let n,s;switch(r){case 0:n="reg",s=ze(this.reg);break;case 1:n="cfg",s=null;break;case 2:n="map",s=Me(this.map,this.reg.size);break;case 3:n="ctx",s=Ie(this.ctx,this.reg.size);break;default:return}return Fe.call(this,t,e,n,s,i,r)},le.import=function(t,e){if(e)switch("string"==typeof e&&(e=JSON.parse(e)),t=t.split("."),"json"===t[t.length-1]&&t.pop(),3===t.length&&t.shift(),t=1<t.length?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=Re(e,this.reg);break;case"map":this.map=Ne(e,this.map);break;case"ctx":this.ctx=De(e,this.ctx)}},le.serialize=function(t=!0){let e="",i="",r="";if(this.reg.size){let t;for(var n of this.reg.keys())t||(t=typeof n),e+=(e?",":"")+("string"===t?'"'+n+'"':n);e="index.reg=new Set(["+e+"]);",i=Le(this.map,t),i="index.map=new Map(["+i+"]);";for(const e of this.ctx.entries()){n=e[0];let i=Le(e[1],t);i="new Map(["+i+"])",i='["'+n+'",'+i+"]",r+=(r?",":"")+i}r="index.ctx=new Map(["+r+"]);"}return t?"function inject(index){"+e+i+r+"}":e+i+r},Pe(Ci.prototype);const Ni="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Ii=["map","ctx","tag","reg","cfg"],Di=ce();function zi(t,e,i){const r=t.value;let n,s=0;for(let t,o=0;o<r.length;o++){if(t=i?r:r[o]){for(let i,s,a=0;a<e.length;a++)if(s=e[a],i=t.indexOf(s),0<=i){if(n=1,!(1<t.length)){r[o]=[];break}t.splice(i,1)}s+=t.length}if(i)break}s?n&&t.update(r):t.delete(),t.continue()}function Ri(t,e){return new Promise(((i,r)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,i(this.result)},t.onerror=t.onblocked=r,t=null}))}le=function t(e,i={}){if(!this||this.constructor!==t)return new t(e,i);"object"==typeof e&&(i=e,e=e.name),e||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(e?":"+e.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=i.field?i.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=i.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}.prototype,le.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},le.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist(),Di[t.id]||(Di[t.id]=[]),Di[t.id].push(t.field);const e=Ni.open(t.id,1);return e.onupgradeneeded=function(){const e=t.db=this.result;for(let i,r=0;r<Ii.length;r++){i=Ii[r];for(let r,n=0;n<Di[t.id].length;n++)r=Di[t.id][n],e.objectStoreNames.contains(i+("reg"!==i&&r?":"+r:""))||e.createObjectStore(i+("reg"!==i&&r?":"+r:""))}},t.db=Ri(e,(function(e){t.db=e,t.db.onversionchange=function(){t.close()}}))},le.close=function(){this.db&&this.db.close(),this.db=null},le.destroy=function(){return Ri(Ni.deleteDatabase(this.id))},le.clear=function(){const t=[];for(let e,i=0;i<Ii.length;i++){e=Ii[i];for(let i,r=0;r<Di[this.id].length;r++)i=Di[this.id][r],t.push(e+("reg"!==e&&i?":"+i:""))}const e=this.db.transaction(t,"readwrite");for(let i=0;i<t.length;i++)e.objectStore(t[i]).clear();return Ri(e)},le.get=function(t,e,i=0,r=0,n=!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);const o=this;return Ri(t).then((function(t){let e=[];if(!t||!t.length)return e;if(n){if(!i&&!r&&1===t.length)return t[0];for(let n,s=0;s<t.length;s++)if((n=t[s])&&n.length){if(r>=n.length){r-=n.length;continue}const t=i?r+Math.min(n.length-r,i):n.length;for(let i=r;i<t;i++)e.push(n[i]);if(r=0,e.length===i)break}return s?o.enrich(e):e}return t}))},le.tag=function(t,e=0,i=0,r=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const n=this;return Ri(t).then((function(t){return!t||!t.length||i>=t.length?[]:e||i?(t=t.slice(i,i+e),r?n.enrich(t):t):t}))},le.enrich=function(t){"object"!=typeof t&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),i=[];for(let r=0;r<t.length;r++)i[r]=Ri(e.get(t[r]));return Promise.all(i).then((function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e}))},le.has=function(t){return Ri(t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t)).then((function(t){return!!t}))},le.search=null,le.info=function(){},le.transaction=function(t,e,i){t+="reg"!==t&&this.field?":"+this.field:"";let r=this.h[t+":"+e];if(r)return i.call(this,r);let n=this.db.transaction(t,e);this.h[t+":"+e]=r=n.objectStore(t);const s=i.call(this,r);return this.h[t+":"+e]=null,Ri(n).finally((function(){return n=r=null,s}))},le.commit=async function(t,e,i){if(e)await this.clear(),t.commit_task=[];else{let r=t.commit_task;t.commit_task=[];for(let t,i=0;i<r.length;i++){if(t=r[i],t.clear){await this.clear(),e=!0;break}r[i]=t.del}e||(i||(r=r.concat(function(t){const e=[];for(const i of t.keys())e.push(i);return e}(t.reg))),r.length&&await this.remove(r))}t.reg.size&&(await this.transaction("map","readwrite",(function(i){for(const r of t.map){const t=r[0],n=r[1];n.length&&(e?i.put(n,t):i.get(t).onsuccess=function(){let e=this.result;var r;if(e&&e.length){const t=Math.max(e.length,n.length);for(let i,s,o=0;o<t;o++)if((s=n[o])&&s.length){if((i=e[o])&&i.length)for(r=0;r<s.length;r++)i.push(s[r]);else e[o]=s;r=1}}else e=n,r=1;r&&i.put(e,t)})}})),await this.transaction("ctx","readwrite",(function(i){for(const r of t.ctx){const t=r[0],n=r[1];for(const r of n){const n=r[0],s=r[1];s.length&&(e?i.put(s,t+":"+n):i.get(t+":"+n).onsuccess=function(){let e=this.result;var r;if(e&&e.length){const t=Math.max(e.length,s.length);for(let i,n,o=0;o<t;o++)if((n=s[o])&&n.length){if((i=e[o])&&i.length)for(r=0;r<n.length;r++)i.push(n[r]);else e[o]=n;r=1}}else e=s,r=1;r&&i.put(e,t+":"+n)})}}})),t.store?await this.transaction("reg","readwrite",(function(e){for(const i of t.store){const t=i[0],r=i[1];e.put("object"==typeof r?JSON.stringify(r):1,t)}})):t.bypass||await this.transaction("reg","readwrite",(function(e){for(const i of t.reg.keys())e.put(1,i)})),t.tag&&await this.transaction("tag","readwrite",(function(e){for(const i of t.tag){const t=i[0],r=i[1];r.length&&(e.get(t).onsuccess=function(){let i=this.result;i=i&&i.length?i.concat(r):r,e.put(i,t)})}})),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())},le.remove=function(t){return"object"!=typeof t&&(t=[t]),Promise.all([this.transaction("map","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&zi(e,t)}})),this.transaction("ctx","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&zi(e,t)}})),this.transaction("tag","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&zi(e,t,!0)}})),this.transaction("reg","readwrite",(function(e){for(let i=0;i<t.length;i++)e.delete(t[i])}))])};const Fi=bi,Li=ve,Ui=vi;async function Bi(){const t=new Ui({document:{id:"id",store:!0,index:[{field:"name",tokenize:"bidirectional",priority:9,encoder:new Li(Fi.LatinBalance).assign({normalize(t){let e=t.replace(/\d+/g," ").split(/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/);return e.length>1&&e.push(t),e.join(" ").toLowerCase()}})},{field:"comment",tokenize:"default",encoder:Fi.LatinSoundex}],tag:[]}}),e=`${document.documentElement.dataset.base}assets/oxide`,i=await async function(t){const e=await fetch(t),i=(await e.blob()).stream().pipeThrough(new DecompressionStream("deflate"));return await new Response(i).json()}(`${e}/search-index.deflate`);for(const[e,r]of Object.entries(i))t.import(e,r);return t}document.addEventListener("DOMContentLoaded",(async()=>{const t=document.querySelector("rustdoc-search .search-form"),e=document.querySelector("rustdoc-search .search-input"),i=document.getElementById("main-content"),r=document.getElementById("alternative-display");let n,s;t.addEventListener("submit",(t=>{t.preventDefault(),t.stopPropagation()})),e.addEventListener("input",function(t,e,i){var r=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Pt(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),Dt(t,e,{leading:r,maxWait:e,trailing:n})}((async t=>{n||(n=Bi());const e=t.target.value?.trim(),[o,a]=e?[i,r]:[r,i];o.classList.add("hidden"),a.classList.remove("hidden"),s?.abort(),s=new AbortController;const l=s.signal;await async function(t,e,i){if(e.aborted||!t.length)return;const r=await i.search({query:t,enrich:!0,merge:!0});if(e.aborted)return;const n=document.querySelector('meta[name="rustdoc-vars"]'),s=document.querySelector("oxide-search-results#search");s.loading=!1,s.project=n.dataset.currentCrate,s.query=t,s.items=r.map((t=>t.doc)).filter((t=>null!=t))}(e,l,await n)}),300))})),(()=>{let t,r,n,s,o,a,l=[ht("oxide-search-results")],h=[],c=at,u=[],f=[],d=[],g=[],p=[],m=[],y=[],b=[];var v=class extends c{static{r=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[ft({attribute:!1})],s=[ft({attribute:!1})],o=[ft({attribute:!1})],a=[ft({attribute:!1})],e(this,null,n,{kind:"accessor",name:"loading",static:!1,private:!1,access:{has:t=>"loading"in t,get:t=>t.loading,set:(t,e)=>{t.loading=e}},metadata:i},u,f),e(this,null,s,{kind:"accessor",name:"project",static:!1,private:!1,access:{has:t=>"project"in t,get:t=>t.project,set:(t,e)=>{t.project=e}},metadata:i},d,g),e(this,null,o,{kind:"accessor",name:"query",static:!1,private:!1,access:{has:t=>"query"in t,get:t=>t.query,set:(t,e)=>{t.query=e}},metadata:i},p,m),e(this,null,a,{kind:"accessor",name:"items",static:!1,private:!1,access:{has:t=>"items"in t,get:t=>t.items,set:(t,e)=>{t.items=e}},metadata:i},y,b),e(null,t={value:r},l,{kind:"class",name:r.name,metadata:i},null,h),v=r=t.value,i&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}static base=document.documentElement.dataset.base;static classes={[Zt.ClassMember]:"fn",[Zt.Function]:"fn",[Zt.Property]:"fn",[Zt.Method]:"fn",[Zt.CallSignature]:"fn",[Zt.IndexSignature]:"fn",[Zt.GetSignature]:"fn",[Zt.SetSignature]:"fn",[Zt.Accessor]:"fn",[Zt.ConstructorSignature]:"primitive",[Zt.Constructor]:"primitive",[Zt.EnumMember]:"macro",[Zt.Variable]:"macro"};#t=i(this,u,!0);get loading(){return this.#t}set loading(t){this.#t=t}#e=(i(this,f),i(this,d,""));get project(){return this.#e}set project(t){this.#e=t}#i=(i(this,g),i(this,p,""));get query(){return this.#i}set query(t){this.#i=t}#r=(i(this,m),i(this,y,[]));get items(){return this.#r}set items(t){this.#r=t}createRenderRoot(){return this}render(){if(this.loading)return q`
48
- <div class="main-heading">
49
- <h1 class="search-results-title">Results</h1>
50
- </div>
51
-
52
- <div id="results">
53
- <div class="search-failed active">
54
- Loading...
55
- </div>
56
- </div>
47
+ var le;function he(t,e,i){const r=typeof i,n=typeof t;if("undefined"!==r){if("undefined"!==n){if(i){if("function"===n&&r===n)return function(e){return t(i(e))};if((e=t.constructor)===i.constructor){if(e===Array)return i.concat(t);if(e===Map){var s=new Map(i);for(var o of t)s.set(o[0],o[1]);return s}if(e===Set){for(s of(o=new Set(i),t.values()))o.add(s);return o}}}return t}return i}return"undefined"===n?e:t}function ce(){return Object.create(null)}function ue(t){return"string"==typeof t}function fe(t){return"object"==typeof t}function de(t,e){if(ue(e))t=t[e];else for(let i=0;t&&i<e.length;i++)t=t[e[i]];return t}(()=>{let t,e=oe,i=[],r=[];(class n extends e{static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[Ft],ne(null,null,t,{kind:"field",name:"_project",static:!1,private:!1,access:{has:t=>"_project"in t,get:t=>t._project,set:(t,e)=>{t._project=e}},metadata:n},i,r),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}type="reference";name;typeArguments;get reflection(){if("number"==typeof this._target)return this._project?.getReflectionById(this._target);const t=this._project?.getReflectionsFromSymbolId(this._target);if(!t?.length)return;const e=this.preferValues?Zt.ValueReferenceTarget:Zt.TypeReferenceTarget;return t.find((t=>t.kindOf(e)))||t.find((t=>t.kindOf(~e)))}highlightedProperties;get symbolId(){if(!this.reflection&&"object"==typeof this._target)return this._target}isIntentionallyBroken(){return!("object"!=typeof this._target||!this._project?.symbolIdHasBeenRemoved(this._target))||(-1===this._target||this.refersToTypeParameter)}toDeclarationReference(){return{resolutionStart:"global",moduleSource:this.package,symbolReference:{path:this.qualifiedName.split(".").map((t=>({path:t,navigation:"."})))}}}qualifiedName;package;externalUrl;refersToTypeParameter=!1;preferValues=!1;_target;_project=se(this,i,void 0);constructor(t,e,i,n){super(),se(this,r),this.name=t,this._target="number"==typeof e?e:"variant"in e?e.id:e,this._project=i,this.qualifiedName=n}static createUnresolvedReference(t,e,i,r){return new n(t,e,i,r)}static createResolvedReference(t,e,i){return new n(t,e,i,t)}static createBrokenReference(t,e){return new n(t,-1,e,t)}getTypeString(){const t=this.reflection?this.reflection.name:this.name;let e="";return this.typeArguments&&this.typeArguments.length>0&&(e+="<",e+=this.typeArguments.map((t=>t.stringify(ae.referenceTypeArgument))).join(", "),e+=">"),t+e}needsParenthesis(){return!1}toObject(t){let e;e="number"==typeof this._target?this._target:this._project?.symbolIdHasBeenRemoved(this._target)?-1:this.reflection?this.reflection.id:this._target.toObject();const i={type:this.type,target:e,typeArguments:t.toObjectsOptional(this.typeArguments),name:this.name,package:this.package,externalUrl:this.externalUrl};return this.name!==this.qualifiedName&&(i.qualifiedName=this.qualifiedName),this.refersToTypeParameter&&(i.refersToTypeParameter=!0),"number"!=typeof e&&this.preferValues&&(i.preferValues=!0),this.highlightedProperties&&(i.highlightedProperties=Object.fromEntries(Array.from(this.highlightedProperties.entries(),(([t,e])=>[t,Kt.serializeDisplayParts(e)])))),i}fromObject(t,e){if(this.typeArguments=t.reviveMany(e.typeArguments,(e=>t.constructType(e))),"number"==typeof e.target&&-1!==e.target?t.defer((i=>{const r=i.getReflectionById(t.oldIdToNewId[e.target]??-1);r?(this._project=i,this._target=r.id):t.logger.warn(Ut.serialized_project_referenced_0_not_part_of_project(JSON.stringify(e.target)))})):-1===e.target?this._target=-1:(this._project=t.project,this._target=new Vt(e.target)),this.qualifiedName=e.qualifiedName??e.name,this.package=e.package,this.refersToTypeParameter=!!e.refersToTypeParameter,this.preferValues=!!e.preferValues,e.highlightedProperties){this.highlightedProperties=new Map;for(const[i,r]of Object.entries(e.highlightedProperties))this.highlightedProperties.set(i,Kt.deserializeDisplayParts(t,r))}}})})();const ge=/[^\p{L}\p{N}]+/u,pe=/(\d{3})/g,me=/(\D)(\d{3})/g,ye=/(\d{3})(\D)/g,be=/[\u0300-\u036f]/g;function ve(t={}){if(!this||this.constructor!==ve)return new ve(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}function _e(t){t.H=null,t.B.clear(),t.G.clear()}let we,xe,ke,Se,$e;async function Ae(t){var e=(t=t.data).task;const i=t.id;let r=t.args;if("init"===e)xe=t.options||{},(e=t.factory)?(Function("return "+e)()(self),we=new self.FlexSearch.Index(xe),delete self.FlexSearch):we=new Ci(xe),postMessage({id:i});else{let n;"export"===e&&(r[1]?(r[0]=xe.export,r[2]=0,r[3]=1):r=null),"import"===e?r[0]&&(t=await xe.import.call(we,r[0]),we.import(r[0],t)):(n=r&&we[e].apply(we,r))&&n.then&&(n=await n),postMessage("search"===e?{id:i,msg:n}:{id:i})}}function Pe(t){Te.call(t,"add"),Te.call(t,"append"),Te.call(t,"search"),Te.call(t,"update"),Te.call(t,"remove"),Te.call(t,"searchCache")}function je(){ke=$e=0}function Te(t){this[t+"Async"]=function(){const e=arguments;var i=e[e.length-1];let r;if("function"==typeof i&&(r=i,delete e[e.length-1]),ke?$e||($e=Date.now()-Se>=this.priority*this.priority*3):(ke=setTimeout(je,0),Se=Date.now()),$e){const i=this;return new Promise((r=>{setTimeout((function(){r(i[t+"Async"].apply(i,e))}),0)}))}const n=this[t].apply(this,e);return i=n.then?n:new Promise((t=>t(n))),r&&i.then(r),i}}(le=ve.prototype).assign=function(t){this.normalize=he(t.normalize,!0,this.normalize);let e,i=t.include,r=i||t.exclude||t.split;if(r||""===r){if("object"==typeof r&&r.constructor!==RegExp){let t="";e=!i,i||(t+="\\p{Z}"),r.letter&&(t+="\\p{L}"),r.number&&(t+="\\p{N}",e=!!i),r.symbol&&(t+="\\p{S}"),r.punctuation&&(t+="\\p{P}"),r.control&&(t+="\\p{C}"),(r=r.char)&&(t+="object"==typeof r?r.join(""):r);try{this.split=new RegExp("["+(i?"^":"")+t+"]+","u")}catch(t){this.split=/\s+/}}else this.split=r,e=!1===r||2>"a1a".split(r).length;this.numeric=he(t.numeric,e)}else{try{this.split=he(this.split,ge)}catch(t){this.split=/\s+/}this.numeric=he(t.numeric,he(this.numeric,!0))}if(this.prepare=he(t.prepare,null,this.prepare),this.finalize=he(t.finalize,null,this.finalize),r=t.filter,this.filter="function"==typeof r?r:he(r&&new Set(r),null,this.filter),this.dedupe=he(t.dedupe,!0,this.dedupe),this.matcher=he((r=t.matcher)&&new Map(r),null,this.matcher),this.mapper=he((r=t.mapper)&&new Map(r),null,this.mapper),this.stemmer=he((r=t.stemmer)&&new Map(r),null,this.stemmer),this.replacer=he(t.replacer,null,this.replacer),this.minlength=he(t.minlength,1,this.minlength),this.maxlength=he(t.maxlength,1024,this.maxlength),this.rtl=he(t.rtl,!1,this.rtl),(this.cache=r=he(t.cache,!0,this.cache))&&(this.H=null,this.S="number"==typeof r?r:2e5,this.B=new Map,this.G=new Map,this.L=this.K=128),this.h="",this.M=null,this.A="",this.N=null,this.matcher)for(const t of this.matcher.keys())this.h+=(this.h?"|":"")+t;if(this.stemmer)for(const t of this.stemmer.keys())this.A+=(this.A?"|":"")+t;return this},le.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.N=null,this.cache&&_e(this),this},le.addFilter=function(t){return"function"==typeof t?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&_e(this),this},le.addMapper=function(t,e){return"object"==typeof t?this.addReplacer(t,e):1<t.length?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&_e(this),this)},le.addMatcher=function(t,e){return"object"==typeof t?this.addReplacer(t,e):2>t.length&&(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.M=null,this.cache&&_e(this),this)},le.addReplacer=function(t,e){return"string"==typeof t?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&_e(this),this)},le.encode=function(t,e){if(this.cache&&t.length<=this.K)if(this.H){if(this.B.has(t))return this.B.get(t)}else this.H=setTimeout(_e,50,this);this.normalize&&(t="function"==typeof this.normalize?this.normalize(t):be?t.normalize("NFKD").replace(be,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&3<t.length&&(t=t.replace(me,"$1 $2").replace(ye,"$1 $2").replace(pe,"$1 "));const i=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let r,n,s=[],o=ce(),a=this.split||""===this.split?t.split(this.split):[t];for(let t,h,c=0;c<a.length;c++)if((t=h=a[c])&&!(t.length<this.minlength||t.length>this.maxlength)){if(e){if(o[t])continue;o[t]=1}else{if(r===t)continue;r=t}if(i)s.push(t);else if(!this.filter||("function"==typeof this.filter?this.filter(t):!this.filter.has(t))){if(this.cache&&t.length<=this.L)if(this.H){var l=this.G.get(t);if(l||""===l){l&&s.push(l);continue}}else this.H=setTimeout(_e,50,this);if(this.stemmer){let e;for(this.N||(this.N=new RegExp("(?!^)("+this.A+")$"));e!==t&&2<t.length;)e=t,t=t.replace(this.N,(t=>this.stemmer.get(t)))}if(t&&(this.mapper||this.dedupe&&1<t.length)){l="";for(let e,i,r=0,n="";r<t.length;r++)e=t.charAt(r),e===n&&this.dedupe||((i=this.mapper&&this.mapper.get(e))||""===i?i===n&&this.dedupe||!(n=i)||(l+=i):l+=n=e);t=l}if(this.matcher&&1<t.length&&(this.M||(this.M=new RegExp("("+this.h+")","g")),t=t.replace(this.M,(t=>this.matcher.get(t)))),t&&this.replacer)for(l=0;t&&l<this.replacer.length;l+=2)t=t.replace(this.replacer[l],this.replacer[l+1]);if(this.cache&&h.length<=this.L&&(this.G.set(h,t),this.G.size>this.S&&(this.G.clear(),this.L=this.L/1.1|0)),t){if(t!==h)if(e){if(o[t])continue;o[t]=1}else{if(n===t)continue;n=t}s.push(t)}}}return this.finalize&&(s=this.finalize(s)||s),this.cache&&t.length<=this.K&&(this.B.set(t,s),this.B.size>this.S&&(this.B.clear(),this.K=this.K/1.1|0)),s};let Oe=0;function Ee(e={},i){function r(t){function r(t){const e=(t=t.data||t).id,i=e&&o.h[e];i&&(i(t.msg),delete o.h[e])}if(this.worker=t,this.h=ce(),this.worker)return s?this.worker.on("message",r):this.worker.onmessage=r,e.config?new Promise((function(t){o.h[++Oe]=function(){t(o),1e9<Oe&&(Oe=0)},o.worker.postMessage({id:Oe,task:"init",factory:n,options:e})})):(this.worker.postMessage({task:"init",factory:n,options:e}),this.priority=e.priority||4,i&&(this.encoder=i),this)}if(!this||this.constructor!==Ee)return new Ee(e);let n="undefined"!=typeof self?self._factory:"undefined"!=typeof window?window._factory:null;n&&(n=n.toString());const s="undefined"==typeof window,o=this,a=function(e,i,r){return i?"undefined"!=typeof module?new(require("worker_threads").Worker)(__dirname+"/worker/node.js"):import("worker_threads").then((function(t){return new t.Worker(void 0+"/node/node.mjs")})):e?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Ae.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof r?r:(t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("index.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js"),{type:"module"})}(n,s,e.worker);return a.then?a.then((function(t){return r.call(o,t)})):r.call(this,a)}function Ce(t){Ee.prototype[t]=function(){const e=this,i=[].slice.call(arguments);var r=i[i.length-1];let n;return"function"==typeof r&&(n=r,i.pop()),r=new Promise((function(r){"export"===t&&"function"==typeof i[0]&&(i[0]=null),e.h[++Oe]=r,e.worker.postMessage({task:t,id:Oe,args:i})})),n?(r.then(n),this):r}}function Me(t,e=0){let i=[],r=[];e&&(e=25e4/e*5e3|0);for(const n of t.entries())r.push(n),r.length===e&&(i.push(r),r=[]);return r.length&&i.push(r),i}function Ne(t,e){e||(e=new Map);for(let i,r=0;r<t.length;r++)i=t[r],e.set(i[0],i[1]);return e}function Ie(t,e=0){let i=[],r=[];e&&(e=25e4/e*1e3|0);for(const n of t.entries())r.push([n[0],Me(n[1])[0]]),r.length===e&&(i.push(r),r=[]);return r.length&&i.push(r),i}function De(t,e){e||(e=new Map);for(let i,r,n=0;n<t.length;n++)i=t[n],r=e.get(i[0]),e.set(i[0],Ne(i[1],r));return e}function ze(t){let e=[],i=[];for(const r of t.keys())i.push(r),25e4===i.length&&(e.push(i),i=[]);return i.length&&e.push(i),e}function Re(t,e){e||(e=new Set);for(let i=0;i<t.length;i++)e.add(t[i]);return e}function Fe(t,e,i,r,n,s,o=0){const a=r&&r.constructor===Array;var l=a?r.shift():r;if(!l)return this.export(t,e,n,s+1);if((l=t((e?e+".":"")+(o+1)+"."+i,JSON.stringify(l)))&&l.then){const h=this;return l.then((function(){return Fe.call(h,t,e,i,a?r:null,n,s,o+1)}))}return Fe.call(this,t,e,i,a?r:null,n,s,o+1)}function Le(t,e){let i="";for(const r of t.entries()){t=r[0];const n=r[1];let s="";for(let t,i=0;i<n.length;i++){t=n[i]||[""];let r="";for(let i=0;i<t.length;i++)r+=(r?",":"")+("string"===e?'"'+t[i]+'"':t[i]);r="["+r+"]",s+=(s?",":"")+r}s='["'+t+'",['+s+"]]",i+=(i?",":"")+s}return i}function Ue(t,e,i,r){let n=[];for(let s,o=0;o<t.index.length;o++)if(s=t.index[o],e>=s.length)e-=s.length;else{const o=(e=s[r?"splice":"slice"](e,i)).length;if(o&&(n=n.length?n.concat(e):e,i-=o,r&&(t.length-=o),!i))break;e=0}return n}function Be(t){if(!this||this.constructor!==Be)return new Be(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get:(t,i)=>"length"===i?e.length:"push"===i?function(t){e.index[e.index.length-1].push(t),e.length++}:"pop"===i?function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()}:"indexOf"===i?function(t){let i=0;for(let r,n,s=0;s<e.index.length;s++){if(r=e.index[s],n=r.indexOf(t),0<=n)return i+n;i+=r.length}return-1}:"includes"===i?function(t){for(let i=0;i<e.index.length;i++)if(e.index[i].includes(t))return!0;return!1}:"slice"===i?function(t,i){return Ue(e,t||0,i||e.length,!1)}:"splice"===i?function(t,i){return Ue(e,t||0,i||e.length,!0)}:"constructor"===i?Array:"symbol"!=typeof i?(t=e.index[i/2**31|0])&&t[i]:void 0,set:(t,i,r)=>(t=i/2**31|0,(e.index[t]||(e.index[t]=[]))[i]=r,e.length++,!0)})}function qe(t=8){if(!this||this.constructor!==qe)return new qe(t);this.index=ce(),this.h=[],this.size=0,32<t?(this.B=We,this.A=BigInt(t)):(this.B=Ve,this.A=t)}function He(t=8){if(!this||this.constructor!==He)return new He(t);this.index=ce(),this.h=[],this.size=0,32<t?(this.B=We,this.A=BigInt(t)):(this.B=Ve,this.A=t)}function Ve(t){let e=2**this.A-1;if("number"==typeof t)return t&e;let i=0,r=this.A+1;for(let n=0;n<t.length;n++)i=(i*r^t.charCodeAt(n))&e;return 32===this.A?i+2**31:i}function We(t){let e=BigInt(2)**this.A-BigInt(1);var i=typeof t;if("bigint"===i)return t&e;if("number"===i)return BigInt(t)&e;i=BigInt(0);let r=this.A+BigInt(1);for(let n=0;n<t.length;n++)i=(i*r^BigInt(t.charCodeAt(n)))&e;return i}function Ge(t,e,i,r,n,s){if(t=t[n],r===i.length-1)e[n]=s||t;else if(t)if(t.constructor===Array)for(e=e[n]=Array(t.length),n=0;n<t.length;n++)Ge(t,e,i,r,n);else e=e[n]||(e[n]=ce()),n=i[++r],Ge(t,e,i,r,n)}function Je(t,e,i,r,n,s,o,a){if(t=t[o])if(r===e.length-1){if(t.constructor===Array){if(i[r]){for(e=0;e<t.length;e++)n.add(s,t[e],!0,!0);return}t=t.join(" ")}n.add(s,t,a,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)Je(t,e,i,r,n,s,o,a);else o=e[++r],Je(t,e,i,r,n,s,o,a);else n.db&&n.remove(s)}function Ke(t,e,i,r){if(!t.length)return t;if(1===t.length)return t=t[0],t=i||t.length>e?e?t.slice(i,i+e):t.slice(i):t,r?ui.call(this,t):t;let n=[];for(let s,o,a=0;a<t.length;a++)if((s=t[a])&&(o=s.length)){if(i){if(i>=o){i-=o;continue}i<o&&(s=e?s.slice(i,i+e):s.slice(i),o=s.length,i=0)}if(o>e&&(s=s.slice(0,e),o=e),!n.length&&o>=e)return r?ui.call(this,s):s;if(n.push(s),!(e-=o))break}return n=1<n.length?[].concat.apply([],n):n[0],r?ui.call(this,n):n}function Ze(t,e,i){var r=i[0];if(r.then)return Promise.all(i).then((function(i){return t[e].apply(t,i)}));if(r[0]&&r[0].index)return t[e].apply(t,r);r=[];let n,s,o,a,l,h=[],c=0,u=0;for(let d,g=0;g<i.length;g++)if(d=i[g]){var f=void 0;if(d.constructor===ni)f=d.result;else if(d.constructor===Array)f=d;else{let e;if(c=d.limit||0,u=d.offset||0,o=d.suggest,s=d.resolve,n=(a=d.highlight&&s)||d.enrich&&s,d.index?t.index=e=d.index:e=t.index,d.query||d.tag)(f=d.field||d.pluck)&&(e=t.index.index.get(f)),d.resolve=!1,f=e.search(d).result,d.resolve=s,a&&(l=d.query);else if(d.and)f=t.and(d.and);else if(d.or)f=t.or(d.or);else if(d.xor)f=t.xor(d.xor);else{if(!d.not)continue;f=t.not(d.not)}}if(f.then)h.push(f);else if(f.length)r[g]=f;else if(!o&&("and"===e||"xor"===e)){r=[];break}}return{O:r,P:h,limit:c,offset:u,enrich:n,resolve:s,suggest:o,highlight:a,W:l}}function Qe(t,e,i,r,n,s){if(e.length){const o=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return Qe.call(o,t,[],i,r,n,s)}))}return t.length&&(this.result.length&&t.push(this.result),2>t.length?this.result=t[0]:(this.result=oi(t,i,r,!1,this.h),r=0)),s?this.resolve(i,r,n):this}function Xe(t,e,i,r,n,s,o){if(e.length){const a=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return Xe.call(a,t,[],i,r,n,s,o)}))}if(t.length)if(this.result.length&&t.unshift(this.result),2>t.length)this.result=t[0];else{if(e=function(t){let e=0;for(let i,r=0;r<t.length;r++)(i=t[r])&&e<i.length&&(e=i.length);return e}(t))return this.result=si(t,e,i,r,o,this.h,s),s?n?ui.call(this.index,this.result):this.result:this;this.result=[]}else o||(this.result=t);return s?this.resolve(i,r,n):this}function Ye(t,e,i,r,n,s,o){if(e.length){const a=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return Ye.call(a,t,[],i,r,n,s,o)}))}if(t.length){if(this.result.length&&t.unshift(this.result),!(2>t.length))return this.result=ti.call(this,t,i,r,s,this.h),s?n?ui.call(this.index,this.result):this.result:this;this.result=t[0]}else o||(this.result=t);return s?this.resolve(i,r,n):this}function ti(t,e,i,r,n){const s=[],o=ce();let a=0;for(let e,i=0;i<t.length;i++)if(e=t[i]){a<e.length&&(a=e.length);for(let t,i=0;i<e.length;i++)if(t=e[i])for(let e,i=0;i<t.length;i++)e=t[i],o[e]=o[e]?2:1}for(let l,h=0,c=0;h<a;h++)for(let a,u=0;u<t.length;u++)if((a=t[u])&&(l=a[h]))for(let t,a=0;a<l.length;a++)if(t=l[a],1===o[t])if(i)i--;else if(r){if(s.push(t),s.length===e)return s}else{const i=h+(u?n:0);if(s[i]||(s[i]=[]),s[i].push(t),++c===e)return s}return s}function ei(t,e,i,r,n,s,o){if(e.length){const a=this;return Promise.all(e).then((function(e){t=[];for(let i,r=0;r<e.length;r++)(i=e[r]).length&&(t[r]=i);return ei.call(a,t,[],i,r,n,s,o)}))}if(t.length&&this.result.length)this.result=ii.call(this,t,i,r,s);else if(s)return this.resolve(i,r,n);return s?n?ui.call(this.index,this.result):this.result:this}function ii(t,e,i,r){const n=[];t=new Set(t.flat().flat());for(let s,o=0,a=0;o<this.result.length;o++)if(s=this.result[o])for(let l,h=0;h<s.length;h++)if(l=s[h],!t.has(l))if(i)i--;else if(r){if(n.push(l),n.length===e)return n}else if(n[o]||(n[o]=[]),n[o].push(l),++a===e)return n;return n}function ri(t,e,i,r,n){let s,o,a;"string"==typeof n?(s=n,n=""):s=n.template,o=s.indexOf("$1"),a=s.substring(o+2),o=s.substring(0,o);let l=n&&n.boundary,h=!n||!1!==n.clip,c=n&&n.merge&&a&&o&&new RegExp(a+" "+o,"g");var u=0;if("object"==typeof(n=n&&n.ellipsis)){var f=n.template;u=f.length-2,n=n.pattern}let d,g;"string"!=typeof n&&(n=!1===n?"":"..."),u&&(n=f.replace("$1",n)),f=n.length-u,"object"==typeof l&&(d=l.before,0===d&&(d=-1),g=l.after,0===g&&(g=-1),l=l.total||9e5),u=new Map;for(let M,N,I,D=0;D<e.length;D++){let z;if(r)z=e,I=r;else{var p=e[D];if(I=p.field,!I)continue;z=p.result}N=i.get(I),M=N.encoder,"string"!=typeof(p=u.get(M))&&(p=M.encode(t),u.set(M,p));for(let t=0;t<z.length;t++){var m=z[t].doc;if(!m)continue;if(!(m=de(m,I)))continue;var y=m.trim().split(/\s+/);if(!y.length)continue;m="";var b=[];let e=[];for(var v=-1,_=-1,w=0,x=0;x<y.length;x++){var k=y[x],S=M.encode(k);let t;if((S=1<S.length?S.join(" "):S[0])&&k){for(var $=k.length,A=(M.split?k.replace(M.split,""):k).length-S.length,P="",j=0,T=0;T<p.length;T++){var O=p[T];if(O){var E=O.length;E+=A,j&&E<=j||-1<(O=S.indexOf(O))&&(P=(O?k.substring(0,O):"")+o+k.substring(O,O+E)+a+(O+E<$?k.substring(O+E):""),j=E,t=!0)}}P&&(l&&(0>v&&(v=m.length+(m?1:0)),_=m.length+(m?1:0)+P.length,w+=$,e.push(b.length),b.push({match:P})),m+=(m?" ":"")+P)}if(t){if(l&&w>=l)break}else m+=(m?" ":"")+(k=y[x]),l&&b.push({text:k})}if(w=e.length*(s.length-2),d||g||l&&m.length-w>l)if(x=_-v,0<d&&(x+=d),0<g&&(x+=g),x<=(w=l+w-2*f))y=d?v-(0<d?d:0):v-((w-x)/2|0),b=g?_+(0<g?g:0):y+w,h||(0<y&&" "!==m.charAt(y)&&" "!==m.charAt(y-1)&&(0>(y=m.indexOf(" ",y))&&(y=0)),b<m.length&&" "!==m.charAt(b-1)&&" "!==m.charAt(b)&&((b=m.lastIndexOf(" ",b))<_?b=_:++b)),m=(y?n:"")+m.substring(y,b)+(b<m.length?n:"");else{for(_=[],v={},w={},x={},k={},S={},P=A=$=0,T=j=1;;){var C=void 0;for(let t,i=0;i<e.length;i++){if(t=e[i],P)if(A!==P){if(x[i+1])continue;if(t+=P,v[t]){$-=f,w[i+1]=1,x[i+1]=1;continue}if(t>=b.length-1){if(t>=b.length){x[i+1]=1,t>=y.length&&(w[i+1]=1);continue}$-=f}if(m=b[t].text,E=g&&S[i]){if(!(0<E)){x[i+1]=1;continue}if(m.length>E){if(x[i+1]=1,!h)continue;m=m.substring(0,E)}(E-=m.length)||(E=-1),S[i]=E}if($+m.length+1<=l)m=" "+m,_[i]+=m;else{if(!h){x[i+1]=1;continue}0<(C=l-$-1)&&(m=" "+m.substring(0,C),_[i]+=m),x[i+1]=1}}else{if(x[i])continue;if(t-=A,v[t]){$-=f,x[i]=1,w[i]=1;continue}if(0>=t){if(0>t){x[i]=1,w[i]=1;continue}$-=f}if(m=b[t].text,E=d&&k[i]){if(!(0<E)){x[i]=1;continue}if(m.length>E){if(x[i]=1,!h)continue;m=m.substring(m.length-E)}(E-=m.length)||(E=-1),k[i]=E}if($+m.length+1<=l)m+=" ",_[i]=m+_[i];else{if(!h){x[i]=1;continue}0<=(C=m.length+1-(l-$))&&C<m.length&&(m=m.substring(C)+" ",_[i]=m+_[i]),x[i]=1}}else{let e;if(m=b[t].match,d&&(k[i]=d),g&&(S[i]=g),i&&$++,t?!i&&f&&($+=f):(w[i]=1,x[i]=1),t>=y.length-1||t<b.length-1&&b[t+1].match?e=1:f&&($+=f),$-=s.length-2,i&&!($+m.length<=l)){C=j=T=w[i]=0;break}_[i]=m,e&&(w[i+1]=1,x[i+1]=1)}$+=m.length,C=v[t]=1}if(C)A===P?P++:A++;else{if(A===P?j=0:T=0,!j&&!T)break;j?P=++A:P++}}m="";for(let t,e=0;e<_.length;e++)t=(e&&w[e]?" ":(e&&!n?" ":"")+n)+_[e],m+=t;n&&!w[_.length]&&(m+=n)}c&&(m=m.replace(c," ")),z[t].highlight=m}if(r)break}return e}function ni(t,e){return this&&this.constructor===ni?t&&t.index?(t.resolve=!1,this.index=t.index,this.h=t.boost||0,this.result=this.index.search(t).result,this):(this.index=e||null,this.result=t||[],void(this.h=0)):new ni(t,e)}function si(t,e,i,r,n,s,o){const a=t.length;let l,h,c=[];l=ce();for(let u,f,d,g,p=0;p<e;p++)for(let e=0;e<a;e++)if(d=t[e],p<d.length&&(u=d[p]))for(let t=0;t<u.length;t++){if(f=u[t],(h=l[f])?l[f]++:(h=0,l[f]=1),g=c[h]||(c[h]=[]),!o){let t=p+(e||!n?0:s||0);g=g[t]||(g[t]=[])}if(g.push(f),o&&i&&h===a-1&&g.length-r===i)return r?g.slice(r):g}if(t=c.length)if(n)c=1<c.length?oi(c,i,r,o,s):(c=c[0]).length>i||r?c.slice(r,i+r):c;else{if(t<a)return[];if(c=c[t-1],i||r)if(o)(c.length>i||r)&&(c=c.slice(r,i+r));else{n=[];for(let t,e=0;e<c.length;e++)if(t=c[e])if(r&&t.length>r)r-=t.length;else if((i&&t.length>i||r)&&(t=t.slice(r,i+r),i-=t.length,r&&(r-=t.length)),n.push(t),!i)break;c=n}}return c}function oi(t,e,i,r,n){const s=[],o=ce();let a;var l=t.length;let h;if(r){for(n=l-1;0<=n;n--)if(h=(r=t[n])&&r.length)for(l=0;l<h;l++)if(a=r[l],!o[a])if(o[a]=1,i)i--;else if(s.push(a),s.length===e)return s}else for(let c,u=l-1,f=0;0<=u;u--){c=t[u];for(let t=0;t<c.length;t++)if(h=(r=c[t])&&r.length)for(let c=0;c<h;c++)if(a=r[c],!o[a])if(o[a]=1,i)i--;else{let i=(t+(u<l-1&&n||0))/(u+1)|0;if((s[i]||(s[i]=[])).push(a),++f===e)return s}}return s}function ai(t,e,i){const r=ce(),n=[];for(let t,i=0;i<e.length;i++){t=e[i];for(let e=0;e<t.length;e++)r[t[e]]=1}if(i)for(let e,i=0;i<t.length;i++)e=t[i],r[e]&&(n.push(e),r[e]=0);else for(let i,s,o=0;o<t.result.length;o++)for(i=t.result[o],e=0;e<i.length;e++)s=i[e],r[s]&&((n[o]||(n[o]=[])).push(s),r[s]=0);return n}function li(t,e){return void 0===t?e:t}function hi(t){const e=[],i=ce();for(let r,n,s=0;s<t.length;s++){r=t[s],n=r.result;for(let t,s,o,a=0;a<n.length;a++)s=n[a],"object"!=typeof s&&(s={id:s}),t=s.id,(o=i[t])?o.push(r.field):(s.field=i[t]=[r.field],e.push(s))}return e}function ci(t,e,i,r,n){return(t=this.tag.get(t))?(e=(t=t&&t.get(e))&&t.length-r)&&0<e?((i&&e>i||r)&&(t=t.slice(r,r+i)),n&&(t=ui.call(this,t)),t):void 0:[]}function ui(t){if(!this||!this.store)return t;const e=Array(t.length);for(let i,r=0;r<t.length;r++)i=t[r],e[r]={id:i,doc:this.store.get(i)};return e}Ce("add"),Ce("append"),Ce("search"),Ce("update"),Ce("remove"),Ce("clear"),Ce("export"),Ce("import"),Pe(Ee.prototype),Be.prototype.clear=function(){this.index.length=0},Be.prototype.destroy=function(){this.proxy=this.index=null},Be.prototype.push=function(){},qe.prototype.get=function(t){const e=this.index[this.B(t)];return e&&e.get(t)},qe.prototype.set=function(t,e){var i=this.B(t);let r=this.index[i];r?(i=r.size,r.set(t,e),(i-=r.size)&&this.size++):(this.index[i]=r=new Map([[t,e]]),this.h.push(r),this.size++)},He.prototype.add=function(t){var e=this.B(t);let i=this.index[e];i?(e=i.size,i.add(t),(e-=i.size)&&this.size++):(this.index[e]=i=new Set([t]),this.h.push(i),this.size++)},(le=qe.prototype).has=He.prototype.has=function(t){const e=this.index[this.B(t)];return e&&e.has(t)},le.delete=He.prototype.delete=function(t){const e=this.index[this.B(t)];e&&e.delete(t)&&this.size--},le.clear=He.prototype.clear=function(){this.index=ce(),this.h=[],this.size=0},le.values=He.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e},le.keys=He.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e},le.entries=He.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e},vi.prototype.add=function(t,e,i){if(fe(t)&&(t=de(e=t,this.key)),e&&(t||0===t)){if(!i&&this.reg.has(t))return this.update(t,e);for(let s,o=0;o<this.field.length;o++){s=this.F[o];var r=this.index.get(this.field[o]);if("function"==typeof s){var n=s(e);n&&r.add(t,n,!1,!0)}else(!(n=s.I)||n(e))&&(s.constructor===String?s=[""+s]:ue(s)&&(s=[s]),Je(e,s,this.J,0,r,t,s[0],i))}if(this.tag)for(r=0;r<this.D.length;r++){var s=this.D[r];n=this.tag.get(this.R[r]);let a=ce();if("function"==typeof s){if(!(s=s(e)))continue}else{var o=s.I;if(o&&!o(e))continue;s.constructor===String&&(s=""+s),s=de(e,s)}if(n&&s){ue(s)&&(s=[s]);for(let e,r,l=0;l<s.length;l++)if(e=s[l],!a[e]&&(a[e]=1,(o=n.get(e))?r=o:n.set(e,r=[]),!i||!r.includes(t))){if(r.length===2**31-1){if(o=new Be(r),this.fastupdate)for(let t of this.reg.values())t.includes(r)&&(t[t.indexOf(r)]=o);n.set(e,r=o)}r.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(r):this.reg.set(t,[r]))}}}if(this.store&&(!i||!this.store.has(t))){let r;if(this.C){r=ce();for(let t,n=0;n<this.C.length;n++){if(t=this.C[n],(i=t.I)&&!i(e))continue;let s;if("function"==typeof t){if(s=t(e),!s)continue;t=[t.V]}else if(ue(t)||t.constructor===String){r[t]=e[t];continue}Ge(e,r,t,0,t[0],s)}}this.store.set(t,r||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this},ni.prototype.or=function(){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s}=Ze(this,"or",arguments);return Qe.call(this,t,e,i,r,n,s)},ni.prototype.and=function(){let t,e,i,r,n=this.result.length;if(!n){const s=arguments[0];s&&(n=!!s.suggest,r=s.resolve,t=s.limit,e=s.offset,i=s.enrich&&r)}if(n){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s,suggest:o}=Ze(this,"and",arguments);return Xe.call(this,t,e,i,r,n,s,o)}return r?this.resolve(t,e,i):this},ni.prototype.xor=function(){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s,suggest:o}=Ze(this,"xor",arguments);return Ye.call(this,t,e,i,r,n,s,o)},ni.prototype.not=function(){const{O:t,P:e,limit:i,offset:r,enrich:n,resolve:s,suggest:o}=Ze(this,"not",arguments);return ei.call(this,t,e,i,r,n,s,o)},ni.prototype.limit=function(t){if(this.result.length){const e=[];for(let i,r=0;r<this.result.length;r++)if(i=this.result[r]){if(!(i.length<=t)){e[r]=i.slice(0,t);break}if(e[r]=i,!(t-=i.length))break}this.result=e}return this},ni.prototype.offset=function(t){if(this.result.length){const e=[];for(let i,r=0;r<this.result.length;r++)(i=this.result[r])&&(i.length<=t?t-=i.length:(e[r]=i.slice(t),t=0));this.result=e}return this},ni.prototype.boost=function(t){return this.h+=t,this},ni.prototype.resolve=function(t,e,i){const r=this.index;let n=this.result;return this.result=this.index=null,n.length&&("object"==typeof t&&(i=t.enrich,e=t.offset,t=t.limit),n=Ke.call(r,n,t||100,e,i)),n},vi.prototype.search=function(t,e,i,r){if(i||(!e&&fe(t)?(i=t,t=""):fe(e)&&(i=e,e=0)),i&&i.cache){i.cache=!1;var n=this.searchCache(t,e,i);return i.cache=!0,n}let s=[];var o=[];let a,l,h,c,u,f,d,g=0,p=!0;if(i){i.constructor===Array&&(i={index:i}),t=i.query||t,a=i.pluck,l=i.merge,c=i.boost,u=a||i.field||(u=i.index)&&(u.index?null:u);var m=this.tag&&i.tag;h=i.suggest,f=(p=!1!==i.resolve)&&this.store&&i.highlight,n=!!f||p&&this.store&&i.enrich,e=i.limit||e;var y=i.offset||0;if(e||(e=p?100:0),m&&(!this.db||!r)){m.constructor!==Array&&(m=[m]);var b=[];for(let t,e=0;e<m.length;e++)if(t=m[e],t.field&&t.tag){var v=t.tag;if(v.constructor===Array)for(var _=0;_<v.length;_++)b.push(t.field,v[_]);else b.push(t.field,v)}else{v=Object.keys(t);for(let e,i,r=0;r<v.length;r++)if(e=v[r],i=t[e],i.constructor===Array)for(_=0;_<i.length;_++)b.push(e,i[_]);else b.push(e,i)}if(m=b,!t){if(o=[],b.length)for(m=0;m<b.length;m+=2){if(this.db){if(!(r=this.index.get(b[m])))continue;o.push(r=r.db.tag(b[m+1],e,y,n))}else r=ci.call(this,b[m],b[m+1],e,y,n);s.push(p?{field:b[m],tag:b[m+1],result:r}:[r])}if(o.length){const t=this;return Promise.all(o).then((function(e){for(let t=0;t<e.length;t++)p?s[t].result=e[t]:s[t]=e[t];return p?s:new ni(1<s.length?si(s,1,0,0,h,c):s[0],t)}))}return p?s:new ni(1<s.length?si(s,1,0,0,h,c):s[0],this)}}p||a||!(u=u||this.field)||(ue(u)?a=u:(u.constructor===Array&&1===u.length&&(u=u[0]),a=u.field||u.index)),u&&u.constructor!==Array&&(u=[u])}u||(u=this.field),b=(this.worker||this.db)&&!r&&[];for(let a,l,c,w=0;w<u.length;w++){if(l=u[w],this.db&&this.tag&&!this.F[w])continue;let x;if(ue(l)||(x=l,l=x.field,t=x.query||t,e=li(x.limit,e),y=li(x.offset,y),h=li(x.suggest,h),f=p&&this.store&&li(x.highlight,f),n=!!f||p&&this.store&&li(x.enrich,n)),r)a=r[w];else{if(v=x||i,_=this.index.get(l),m&&(this.db&&(v.tag=m,d=_.db.support_tag_search,v.field=u),d||(v.enrich=!1)),b){b[w]=_.search(t,e,v),v&&n&&(v.enrich=n);continue}a=_.search(t,e,v),v&&n&&(v.enrich=n)}if(c=a&&(p?a.length:a.result.length),m&&c){if(v=[],_=0,this.db&&r){if(!d)for(let t=u.length;t<r.length;t++){let e=r[t];if(e&&e.length)_++,v.push(e);else if(!h)return p?s:new ni(s,this)}}else for(let t,e,i=0;i<m.length;i+=2){if(t=this.tag.get(m[i]),!t){if(h)continue;return p?s:new ni(s,this)}if(e=(t=t&&t.get(m[i+1]))&&t.length)_++,v.push(t);else if(!h)return p?s:new ni(s,this)}if(_){if(a=ai(a,v,p),c=a.length,!c&&!h)return p?a:new ni(a,this);_--}}if(c)o[g]=l,s.push(a),g++;else if(1===u.length)return p?s:new ni(s,this)}if(b){if(this.db&&m&&m.length&&!d)for(n=0;n<m.length;n+=2){if(!(o=this.index.get(m[n]))){if(h)continue;return p?s:new ni(s,this)}b.push(o.db.tag(m[n+1],e,y,!1))}const r=this;return Promise.all(b).then((function(n){return n.length?r.search(t,e,i,n):n}))}if(!g)return p?s:new ni(s,this);if(a&&(!n||!this.store))return s=s[0],p||(s.index=this),s;for(b=[],y=0;y<o.length;y++){if(m=s[y],n&&m.length&&void 0===m[0].doc&&(this.db?b.push(m=this.index.get(this.field[0]).db.enrich(m)):m=ui.call(this,m)),a)return p?f?ri(t,m,this.index,a,f):m:new ni(m,this);s[y]={field:o[y],result:m}}if(n&&this.db&&b.length){const e=this;return Promise.all(b).then((function(i){for(let t=0;t<i.length;t++)s[t].result=i[t];return l?hi(s):f?ri(t,s,e.index,a,f):s}))}return l?hi(s):f?ri(t,s,this.index,a,f):s};const fi={normalize:!1,numeric:!1,dedupe:!1},di={},gi=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"]]),pi=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),mi=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],yi={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,"ß":2,d:3,t:3,l:4,m:5,n:5,r:6};var bi={Exact:fi,Default:di,Normalize:di,LatinBalance:{mapper:gi},LatinAdvanced:{mapper:gi,matcher:pi,replacer:mi},LatinExtra:{mapper:gi,replacer:mi.concat([/(?!^)[aeo]/g,""]),matcher:pi},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let i=0;i<t.length;i++){var e=t[i];let r=e.charAt(0),n=yi[r];for(let t,i=1;i<e.length&&(t=e.charAt(i),"h"===t||"w"===t||!(t=yi[t])||t===n||(r+=t,n=t,4!==r.length));i++);t[i]=r}}},CJK:{split:""},LatinExact:fi,LatinDefault:di,LatinSimple:di};function vi(t){if(!this||this.constructor!==vi)return new vi(t);const e=t.document||t.doc||t;let i,r;if(this.F=[],this.field=[],this.J=[],this.key=(i=e.key||e.id)&&wi(i,this.J)||"id",(r=t.keystore||0)&&(this.keystore=r),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?r?new He(r):new Set:r?new qe(r):new Map,this.C=(i=e.store||null)&&i&&!0!==i&&[],this.store=i&&(r?new qe(r):new Map),this.cache=(i=t.cache||null)&&new ki(i),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=_i.call(this,t,e),this.tag=null,(i=e.tag)&&("string"==typeof i&&(i=[i]),i.length)){this.tag=new Map,this.D=[],this.R=[];for(let t,e,r=0;r<i.length;r++){if(t=i[r],e=t.field||t,!e)throw Error("The tag field from the document descriptor is undefined.");t.custom?this.D[r]=t.custom:(this.D[r]=wi(e,this.J),t.filter&&("string"==typeof this.D[r]&&(this.D[r]=new String(this.D[r])),this.D[r].I=t.filter)),this.R[r]=e,this.tag.set(e,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const e of this.index.values())e.then&&t.push(e);if(t.length){const e=this;return Promise.all(t).then((function(t){let i=0;for(const r of e.index.entries()){const n=r[0];let s=r[1];s.then&&(s=t[i],e.index.set(n,s),i++)}return e}))}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}function _i(t,e){const i=new Map;let r=e.index||e.field||e;ue(r)&&(r=[r]);for(let e,s,o=0;o<r.length;o++){if(e=r[o],ue(e)||(s=e,e=e.field),s=fe(s)?Object.assign({},t,s):t,this.worker){var n=void 0;n=new Ee(s,n=(n=s.encoder)&&n.encode?n:new ve("string"==typeof n?bi[n]:n)),i.set(e,n)}this.worker||i.set(e,new Ci(s,this.reg)),s.custom?this.F[o]=s.custom:(this.F[o]=wi(e,this.J),s.filter&&("string"==typeof this.F[o]&&(this.F[o]=new String(this.F[o])),this.F[o].I=s.filter)),this.field[o]=e}if(this.C){ue(t=e.store)&&(t=[t]);for(let e,i,r=0;r<t.length;r++)e=t[r],i=e.field||e,e.custom?(this.C[r]=e.custom,e.custom.V=i):(this.C[r]=wi(i,this.J),e.filter&&("string"==typeof this.C[r]&&(this.C[r]=new String(this.C[r])),this.C[r].I=e.filter))}return i}function wi(t,e){const i=t.split(":");let r=0;for(let n=0;n<i.length;n++)"]"===(t=i[n])[t.length-1]&&(t=t.substring(0,t.length-2))&&(e[r]=!0),t&&(i[r++]=t);return r<i.length&&(i.length=r),1<r?i:i[0]}function xi(t,e,i){const r=(e?""+t:"object"==typeof t?""+t.query:t).toLowerCase();this.cache||(this.cache=new ki);let n=this.cache.get(r);if(!n){if(n=this.search(t,e,i),n.then){const t=this;n.then((function(e){return t.cache.set(r,e),e}))}this.cache.set(r,n)}return n}function ki(t){this.limit=t&&!0!==t?t:1e3,this.cache=new Map,this.h=""}function Si(t,e){let i=0;var r=void 0===e;if(t.constructor===Array){for(let n,s,o=0;o<t.length;o++)if((n=t[o])&&n.length)if(r)i++;else{if(s=n.indexOf(e),0<=s){1<n.length?(n.splice(s,1),i++):delete t[o];break}i++}}else for(let n of t.entries()){r=n[0];const s=Si(n[1],e);s?i+=s:t.delete(r)}return i}(le=vi.prototype).mount=function(t){let e=this.field;if(this.tag)for(let t,r=0;r<this.R.length;r++){t=this.R[r];var i=void 0;this.index.set(t,i=new Ci({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(t),i.tag=this.tag.get(t)}i=[];const r={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let n,s,o=0;o<e.length;o++){r.field=s=e[o],n=this.index.get(s);const a=new t.constructor(t.id,r);a.id=t.id,i[o]=a.mount(n),n.document=!0,o?n.bypass=!0:n.store=this.store}const n=this;return this.db=Promise.all(i).then((function(){n.db=!0}))},le.commit=async function(t,e){const i=[];for(const r of this.index.values())i.push(r.commit(t,e));await Promise.all(i),this.reg.clear()},le.destroy=function(){const t=[];for(const e of this.index.values())t.push(e.destroy());return Promise.all(t)},le.append=function(t,e){return this.add(t,e,!0)},le.update=function(t,e){return this.remove(t).add(t,e)},le.remove=function(t){for(var e of(fe(t)&&(t=de(t,this.key)),this.index.values()))e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let i of this.tag.values())for(let r of i){e=r[0];const n=r[1],s=n.indexOf(t);-1<s&&(1<n.length?n.splice(s,1):i.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},le.clear=function(){const t=[];for(const e of this.index.values()){const i=e.clear();i.then&&t.push(i)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},le.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},le.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},le.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then((function(t){return t[0]&&t[0].doc||null})):this.store.get(t)||null},le.set=function(t,e){return"object"==typeof t&&(t=de(e=t,this.key)),this.store.set(t,e),this},le.searchCache=xi,le.export=function(t,e,i=0,r=0){if(i<this.field.length){const n=this.field[i];if((e=this.index.get(n).export(t,n,i,r=1))&&e.then){const r=this;return e.then((function(){return r.export(t,n,i+1)}))}return this.export(t,n,i+1)}let n,s;switch(r){case 0:n="reg",s=ze(this.reg),e=null;break;case 1:n="tag",s=this.tag&&Ie(this.tag,this.reg.size),e=null;break;case 2:n="doc",s=this.store&&Me(this.store),e=null;break;default:return}return Fe.call(this,t,e,n,s,i,r)},le.import=function(t,e){var i=t.split(".");"json"===i[i.length-1]&&i.pop();const r=2<i.length?i[0]:"";if(i=2<i.length?i[2]:i[1],this.worker&&r)return this.index.get(r).import(t);if(e){if("string"==typeof e&&(e=JSON.parse(e)),r)return this.index.get(r).import(i,e);switch(i){case"reg":this.fastupdate=!1,this.reg=Re(e,this.reg);for(let t,e=0;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){e=[];for(const i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=De(e,this.tag);break;case"doc":this.store=Ne(e,this.store)}}},Pe(vi.prototype),ki.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)},ki.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e},ki.prototype.remove=function(t){for(const e of this.cache){const i=e[0];e[1].includes(t)&&this.cache.delete(i)}},ki.prototype.clear=function(){this.cache.clear(),this.h=""},Ci.prototype.remove=function(t,e){const i=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(i){if(this.fastupdate){for(let e,r=0;r<i.length;r++)if(e=i[r])if(2>e.length)e.pop();else{const r=e.indexOf(t);r===i.length-1?e.pop():e.splice(r,1)}}else Si(this.map,t),this.depth&&Si(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.T&&Mi(this)),this.cache&&this.cache.remove(t),this};const $i={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};function Ai(t,e,i,r,n,s,o){let a,l=o?t.ctx:t.map;if((!e[i]||o&&!(a=e[i])[o])&&(o?((e=a||(e[i]=ce()))[o]=1,(a=l.get(o))?l=a:l.set(o,l=new Map)):e[i]=1,(a=l.get(i))?l=a:l.set(i,l=a=[]),l=l[r]||(l[r]=[]),!s||!l.includes(n))){if(l.length===2**31-1){if(e=new Be(l),t.fastupdate)for(let i of t.reg.values())i.includes(l)&&(i[i.indexOf(l)]=e);a[r]=l=e}l.push(n),t.fastupdate&&((r=t.reg.get(n))?r.push(l):t.reg.set(n,[l]))}}function Pi(t,e,i,r,n){return i&&1<t?e+(r||0)<=t?i+(n||0):(t-1)/(e+(r||0))*(i+(n||0))+1|0:0}function ji(t,e,i,r,n,s,o){let a=t.length,l=t;if(1<a)l=si(t,e,i,r,n,s,o);else if(1===a)return o?Ke.call(null,t[0],i,r):new ni(t[0],this);return o?l:new ni(l,this)}function Ti(t,e,i,r,n,s,o){return t=Ei(this,t,e,i,r,n,s,o),this.db?t.then((function(t){return n?t||[]:new ni(t,this)})):t&&t.length?n?Ke.call(this,t,i,r):new ni(t,this):n?[]:new ni([],this)}function Oi(t,e,i,r){let n=[];if(t&&t.length){if(t.length<=r)return void e.push(t);for(let e,i=0;i<r;i++)(e=t[i])&&(n[i]=e);if(n.length)return void e.push(n)}if(!i)return n}function Ei(t,e,i,r,n,s,o,a){let l;return i&&(l=t.bidirectional&&e>i)&&(l=i,i=e,e=l),t.db?t.db.get(e,i,r,n,s,o,a):t=i?(t=t.ctx.get(i))&&t.get(e):t.map.get(e)}function Ci(t,e){if(!this||this.constructor!==Ci)return new Ci(t);if(t){var i=ue(t)?t:t.preset;i&&(t=Object.assign({},$i[i],t))}else t={};const r=!0===(i=t.context)?{depth:1}:i||{},n=ue(t.encoder)?bi[t.encoder]:t.encode||t.encoder||{};this.encoder=n.encode?n:"object"==typeof n?new ve(n):{encode:n},this.resolution=t.resolution||9,this.tokenize=i=(i=t.tokenize)&&"default"!==i&&"exact"!==i&&i||"strict",this.depth="strict"===i&&r.depth||0,this.bidirectional=!1!==r.bidirectional,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(i=t.keystore||0)&&(this.keystore=i),this.map=i?new qe(i):new Map,this.ctx=i?new qe(i):new Map,this.reg=e||(this.fastupdate?i?new qe(i):new Map:i?new He(i):new Set),this.U=r.resolution||3,this.rtl=n.rtl||t.rtl||!1,this.cache=(i=t.cache||null)&&new ki(i),this.resolve=!1!==t.resolve,(i=t.db)&&(this.db=this.mount(i)),this.T=!1!==t.commit,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}function Mi(t){t.commit_timer||(t.commit_timer=setTimeout((function(){t.commit_timer=null,t.db.commit(t,void 0,void 0)}),1))}Ci.prototype.add=function(t,e,i,r){if(e&&(t||0===t)){if(!r&&!i&&this.reg.has(t))return this.update(t,e);r=this.depth;const h=(e=this.encoder.encode(e,!r)).length;if(h){const c=ce(),u=ce(),f=this.resolution;for(let d=0;d<h;d++){let g=e[this.rtl?h-1-d:d];var n=g.length;if(n&&(r||!u[g])){var s=this.score?this.score(e,g,d,null,0):Pi(f,h,d),o="";switch(this.tokenize){case"full":if(2<n){for(let r,l=0;l<n;l++)for(s=n;s>l;s--){o=g.substring(l,s),r=this.rtl?n-1-l:l;var a=this.score?this.score(e,g,d,o,r):Pi(f,h,d,n,r);Ai(this,u,o,a,t,i)}break}case"bidirectional":case"reverse":if(1<n){for(a=n-1;0<a;a--){o=g[this.rtl?n-1-a:a]+o;var l=this.score?this.score(e,g,d,o,a):Pi(f,h,d,n,a);Ai(this,u,o,l,t,i)}o=""}case"forward":if(1<n){for(a=0;a<n;a++)Ai(this,u,o+=g[this.rtl?n-1-a:a],s,t,i);break}default:if(Ai(this,u,g,s,t,i),r&&1<h&&d<h-1)for(n=ce(),o=this.U,s=g,a=Math.min(r+1,this.rtl?d+1:h-d),n[s]=1,l=1;l<a;l++)if((g=e[this.rtl?h-1-d-l:d+l])&&!n[g]){n[g]=1;const r=this.score?this.score(e,s,d,g,l-1):Pi(o+(h/2>o?0:1),h,d,a-1,l-1),u=this.bidirectional&&g>s;Ai(this,c,u?s:g,r,t,i,u?g:s)}}}}this.fastupdate||this.reg.add(t)}else e=""}return this.db&&(e||this.commit_task.push({del:t}),this.T&&Mi(this)),this},Ci.prototype.search=function(t,e,i){if(i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):(i=t,t="")),i&&i.cache)return i.cache=!1,t=this.searchCache(t,e,i),i.cache=!0,t;let r,n,s,o,a,l,h,c,u=[],f=0;i&&(t=i.query||t,e=i.limit||e,f=i.offset||0,n=i.context,s=i.suggest,c=(o=i.resolve)&&i.enrich,l=i.boost,h=i.resolution,a=this.db&&i.tag),void 0===o&&(o=this.resolve),n=this.depth&&!1!==n;let d=this.encoder.encode(t,!n);if(r=d.length,e=e||(o?100:0),1===r)return Ti.call(this,d[0],"",e,f,o,c,a);if(2===r&&n&&!s)return Ti.call(this,d[1],d[0],e,f,o,c,a);let g,p=ce(),m=0;if(n&&(g=d[0],m=1),h||0===h||(h=g?this.U:this.resolution),this.db){if(this.db.search&&!1!==(i=this.db.search(this,d,e,f,s,o,c,a)))return i;const t=this;return async function(){for(let e,i;m<r;m++){if((i=d[m])&&!p[i]){if(p[i]=1,e=await Ei(t,i,g,0,0,!1,!1),e=Oi(e,u,s,h)){u=e;break}g&&(s&&e&&u.length||(g=i))}s&&g&&m===r-1&&!u.length&&(h=t.resolution,g="",m=-1,p=ce())}return ji(u,h,e,f,s,l,o)}()}for(let t,e;m<r;m++){if((e=d[m])&&!p[e]){if(p[e]=1,t=Ei(this,e,g,0,0,!1,!1),t=Oi(t,u,s,h)){u=t;break}g&&(s&&t&&u.length||(g=e))}s&&g&&m===r-1&&!u.length&&(h=this.resolution,g="",m=-1,p=ce())}return ji(u,h,e,f,s,l,o)},(le=Ci.prototype).mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},le.commit=function(t,e){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this,t,e)},le.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},le.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=[{clear:!0}]),this},le.append=function(t,e){return this.add(t,e,!0)},le.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},le.update=function(t,e){const i=this,r=this.remove(t);return r&&r.then?r.then((()=>i.add(t,e))):this.add(t,e)},le.cleanup=function(){return this.fastupdate?(Si(this.map),this.depth&&Si(this.ctx),this):this},le.searchCache=xi,le.export=function(t,e,i=0,r=0){let n,s;switch(r){case 0:n="reg",s=ze(this.reg);break;case 1:n="cfg",s=null;break;case 2:n="map",s=Me(this.map,this.reg.size);break;case 3:n="ctx",s=Ie(this.ctx,this.reg.size);break;default:return}return Fe.call(this,t,e,n,s,i,r)},le.import=function(t,e){if(e)switch("string"==typeof e&&(e=JSON.parse(e)),t=t.split("."),"json"===t[t.length-1]&&t.pop(),3===t.length&&t.shift(),t=1<t.length?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=Re(e,this.reg);break;case"map":this.map=Ne(e,this.map);break;case"ctx":this.ctx=De(e,this.ctx)}},le.serialize=function(t=!0){let e="",i="",r="";if(this.reg.size){let t;for(var n of this.reg.keys())t||(t=typeof n),e+=(e?",":"")+("string"===t?'"'+n+'"':n);e="index.reg=new Set(["+e+"]);",i=Le(this.map,t),i="index.map=new Map(["+i+"]);";for(const e of this.ctx.entries()){n=e[0];let i=Le(e[1],t);i="new Map(["+i+"])",i='["'+n+'",'+i+"]",r+=(r?",":"")+i}r="index.ctx=new Map(["+r+"]);"}return t?"function inject(index){"+e+i+r+"}":e+i+r},Pe(Ci.prototype);const Ni="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Ii=["map","ctx","tag","reg","cfg"],Di=ce();function zi(t,e,i){const r=t.value;let n,s=0;for(let t,o=0;o<r.length;o++){if(t=i?r:r[o]){for(let i,s,a=0;a<e.length;a++)if(s=e[a],i=t.indexOf(s),0<=i){if(n=1,!(1<t.length)){r[o]=[];break}t.splice(i,1)}s+=t.length}if(i)break}s?n&&t.update(r):t.delete(),t.continue()}function Ri(t,e){return new Promise(((i,r)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,i(this.result)},t.onerror=t.onblocked=r,t=null}))}le=function t(e,i={}){if(!this||this.constructor!==t)return new t(e,i);"object"==typeof e&&(i=e,e=e.name),e||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(e?":"+e.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=i.field?i.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=i.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}.prototype,le.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},le.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist(),Di[t.id]||(Di[t.id]=[]),Di[t.id].push(t.field);const e=Ni.open(t.id,1);return e.onupgradeneeded=function(){const e=t.db=this.result;for(let i,r=0;r<Ii.length;r++){i=Ii[r];for(let r,n=0;n<Di[t.id].length;n++)r=Di[t.id][n],e.objectStoreNames.contains(i+("reg"!==i&&r?":"+r:""))||e.createObjectStore(i+("reg"!==i&&r?":"+r:""))}},t.db=Ri(e,(function(e){t.db=e,t.db.onversionchange=function(){t.close()}}))},le.close=function(){this.db&&this.db.close(),this.db=null},le.destroy=function(){return Ri(Ni.deleteDatabase(this.id))},le.clear=function(){const t=[];for(let e,i=0;i<Ii.length;i++){e=Ii[i];for(let i,r=0;r<Di[this.id].length;r++)i=Di[this.id][r],t.push(e+("reg"!==e&&i?":"+i:""))}const e=this.db.transaction(t,"readwrite");for(let i=0;i<t.length;i++)e.objectStore(t[i]).clear();return Ri(e)},le.get=function(t,e,i=0,r=0,n=!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);const o=this;return Ri(t).then((function(t){let e=[];if(!t||!t.length)return e;if(n){if(!i&&!r&&1===t.length)return t[0];for(let n,s=0;s<t.length;s++)if((n=t[s])&&n.length){if(r>=n.length){r-=n.length;continue}const t=i?r+Math.min(n.length-r,i):n.length;for(let i=r;i<t;i++)e.push(n[i]);if(r=0,e.length===i)break}return s?o.enrich(e):e}return t}))},le.tag=function(t,e=0,i=0,r=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const n=this;return Ri(t).then((function(t){return!t||!t.length||i>=t.length?[]:e||i?(t=t.slice(i,i+e),r?n.enrich(t):t):t}))},le.enrich=function(t){"object"!=typeof t&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),i=[];for(let r=0;r<t.length;r++)i[r]=Ri(e.get(t[r]));return Promise.all(i).then((function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e}))},le.has=function(t){return Ri(t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t)).then((function(t){return!!t}))},le.search=null,le.info=function(){},le.transaction=function(t,e,i){t+="reg"!==t&&this.field?":"+this.field:"";let r=this.h[t+":"+e];if(r)return i.call(this,r);let n=this.db.transaction(t,e);this.h[t+":"+e]=r=n.objectStore(t);const s=i.call(this,r);return this.h[t+":"+e]=null,Ri(n).finally((function(){return n=r=null,s}))},le.commit=async function(t,e,i){if(e)await this.clear(),t.commit_task=[];else{let r=t.commit_task;t.commit_task=[];for(let t,i=0;i<r.length;i++){if(t=r[i],t.clear){await this.clear(),e=!0;break}r[i]=t.del}e||(i||(r=r.concat(function(t){const e=[];for(const i of t.keys())e.push(i);return e}(t.reg))),r.length&&await this.remove(r))}t.reg.size&&(await this.transaction("map","readwrite",(function(i){for(const r of t.map){const t=r[0],n=r[1];n.length&&(e?i.put(n,t):i.get(t).onsuccess=function(){let e=this.result;var r;if(e&&e.length){const t=Math.max(e.length,n.length);for(let i,s,o=0;o<t;o++)if((s=n[o])&&s.length){if((i=e[o])&&i.length)for(r=0;r<s.length;r++)i.push(s[r]);else e[o]=s;r=1}}else e=n,r=1;r&&i.put(e,t)})}})),await this.transaction("ctx","readwrite",(function(i){for(const r of t.ctx){const t=r[0],n=r[1];for(const r of n){const n=r[0],s=r[1];s.length&&(e?i.put(s,t+":"+n):i.get(t+":"+n).onsuccess=function(){let e=this.result;var r;if(e&&e.length){const t=Math.max(e.length,s.length);for(let i,n,o=0;o<t;o++)if((n=s[o])&&n.length){if((i=e[o])&&i.length)for(r=0;r<n.length;r++)i.push(n[r]);else e[o]=n;r=1}}else e=s,r=1;r&&i.put(e,t+":"+n)})}}})),t.store?await this.transaction("reg","readwrite",(function(e){for(const i of t.store){const t=i[0],r=i[1];e.put("object"==typeof r?JSON.stringify(r):1,t)}})):t.bypass||await this.transaction("reg","readwrite",(function(e){for(const i of t.reg.keys())e.put(1,i)})),t.tag&&await this.transaction("tag","readwrite",(function(e){for(const i of t.tag){const t=i[0],r=i[1];r.length&&(e.get(t).onsuccess=function(){let i=this.result;i=i&&i.length?i.concat(r):r,e.put(i,t)})}})),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())},le.remove=function(t){return"object"!=typeof t&&(t=[t]),Promise.all([this.transaction("map","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&zi(e,t)}})),this.transaction("ctx","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&zi(e,t)}})),this.transaction("tag","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&zi(e,t,!0)}})),this.transaction("reg","readwrite",(function(e){for(let i=0;i<t.length;i++)e.delete(t[i])}))])};const Fi=bi,Li=ve,Ui=vi;async function Bi(){const t=new Ui({document:{id:"id",store:!0,index:[{field:"name",tokenize:"bidirectional",priority:9,encoder:new Li(Fi.LatinBalance).assign({normalize(t){let e=t.replace(/\d+/g," ").split(/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/);return e.length>1&&e.push(t),e.join(" ").toLowerCase()}})},{field:"comment",tokenize:"default",encoder:Fi.LatinSoundex}],tag:[]}}),e=`${document.documentElement.dataset.base}assets/oxide`,i=await async function(t){const e=await fetch(t),i=(await e.blob()).stream().pipeThrough(new DecompressionStream("deflate"));return await new Response(i).json()}(`${e}/search-index.deflate`);for(const[e,r]of Object.entries(i))t.import(e,r);return t}document.addEventListener("DOMContentLoaded",(async()=>{const t=document.querySelector("rustdoc-search .search-form"),e=document.querySelector("rustdoc-search .search-input"),i=document.getElementById("main-content"),r=document.getElementById("alternative-display");let n,s;t.addEventListener("submit",(t=>{t.preventDefault(),t.stopPropagation()})),e.addEventListener("input",function(t,e,i){var r=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return Pt(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),Dt(t,e,{leading:r,maxWait:e,trailing:n})}((async t=>{n||(n=Bi());const e=t.target.value?.trim(),[o,a]=e?[i,r]:[r,i];o.classList.add("hidden"),a.classList.remove("hidden"),s?.abort(),s=new AbortController;const l=s.signal;await async function(t,e,i){if(console.log("Performing search:",{query:t,signal:e,index:i}),e.aborted||!t.length)return;const r=await i.search({query:t,enrich:!0,merge:!0});if(e.aborted)return;const n=document.querySelector('meta[name="rustdoc-vars"]'),s=document.querySelector("oxide-search-results#search");s.loading=!1,s.project=n.dataset.currentCrate,s.query=t,s.items=r.map((t=>t.doc)).filter((t=>null!=t))}(e,l,await n)}),300)),e.addEventListener("focus",(t=>{t.stopImmediatePropagation(),t.stopPropagation()}),!0)})),(()=>{let t,r,n,s,o,a,l=[ht("oxide-search-results")],h=[],c=at,u=[],f=[],d=[],g=[],p=[],m=[],y=[],b=[];var v=class extends c{static{r=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[ft({attribute:!1})],s=[ft({attribute:!1})],o=[ft({attribute:!1})],a=[ft({attribute:!1})],e(this,null,n,{kind:"accessor",name:"loading",static:!1,private:!1,access:{has:t=>"loading"in t,get:t=>t.loading,set:(t,e)=>{t.loading=e}},metadata:i},u,f),e(this,null,s,{kind:"accessor",name:"project",static:!1,private:!1,access:{has:t=>"project"in t,get:t=>t.project,set:(t,e)=>{t.project=e}},metadata:i},d,g),e(this,null,o,{kind:"accessor",name:"query",static:!1,private:!1,access:{has:t=>"query"in t,get:t=>t.query,set:(t,e)=>{t.query=e}},metadata:i},p,m),e(this,null,a,{kind:"accessor",name:"items",static:!1,private:!1,access:{has:t=>"items"in t,get:t=>t.items,set:(t,e)=>{t.items=e}},metadata:i},y,b),e(null,t={value:r},l,{kind:"class",name:r.name,metadata:i},null,h),v=r=t.value,i&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}static base=document.documentElement.dataset.base;static classes={[Zt.ClassMember]:"fn",[Zt.Function]:"fn",[Zt.Property]:"fn",[Zt.Method]:"fn",[Zt.CallSignature]:"fn",[Zt.IndexSignature]:"fn",[Zt.GetSignature]:"fn",[Zt.SetSignature]:"fn",[Zt.Accessor]:"fn",[Zt.ConstructorSignature]:"primitive",[Zt.Constructor]:"primitive",[Zt.EnumMember]:"macro",[Zt.Variable]:"macro"};#t=i(this,u,!0);get loading(){return this.#t}set loading(t){this.#t=t}#e=(i(this,f),i(this,d,""));get project(){return this.#e}set project(t){this.#e=t}#i=(i(this,g),i(this,p,""));get query(){return this.#i}set query(t){this.#i=t}#r=(i(this,m),i(this,y,[]));get items(){return this.#r}set items(t){this.#r=t}createRenderRoot(){return this}render(){if(this.loading)return q`
48
+ <h3 class="search-loading">Loading search results...</h3>
57
49
  `;const t=this.items.map((t=>{const e=v.classes[t.kind]??"mod",i=function*(t,e){if(void 0!==t){let i=0;for(const r of t)yield e(r,i++)}}(t.parent?.split(".").filter((t=>t))??[],(t=>q`<span class="parent">${t}.</span>`));return q`
58
50
  <a class="result-item" href="${v.base}${t.url}">
59
51
  <span class="result-name">