@remloyal/docsify-plugins 1.0.0

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.
@@ -0,0 +1,2 @@
1
+ :root{--plugin-flexsearch-input-bg:var(--form-element-bg);--plugin-flexsearch-input-border-color:var(--sidebar-border-color);--plugin-flexsearch-input-border-radius:var(--form-element-border-radius);--plugin-flexsearch-input-color:var(--form-element-color);--plugin-flexsearch-kbd-bg:var(--color-bg);--plugin-flexsearch-kbd-border:1px solid var(--color-mono-3);--plugin-flexsearch-kbd-border-radius:4px;--plugin-flexsearch-kbd-color:var(--color-mono-5);--plugin-flexsearch-margin:10px;--plugin-flexsearch-reset-bg:var(--theme-color);--plugin-flexsearch-reset-border:transparent;--plugin-flexsearch-reset-border-radius:var(--border-radius);--plugin-flexsearch-reset-color:#fff}.flexsearch-search{margin:var(--plugin-flexsearch-margin)}.flexsearch-search .input-wrap{position:relative}.flexsearch-search input{background:var(--plugin-flexsearch-input-bg);border:1px solid var(--plugin-flexsearch-input-border-color);border-radius:var(--plugin-flexsearch-input-border-radius);color:var(--plugin-flexsearch-input-color);padding-inline-end:36px;width:100%}.flexsearch-search input::-webkit-search-cancel-button,.flexsearch-search input::-webkit-search-decoration{-webkit-appearance:none;appearance:none}.flexsearch-search .clear-button,.flexsearch-search .kbd-group{display:flex;gap:.15em;opacity:0;position:absolute;right:7px;top:50%;transition-duration:var(--duration-medium);transition-property:opacity,visibility;translate:0 -50%;visibility:hidden}.flexsearch-search .kbd-group:hover,.flexsearch-search input:invalid:where(:focus,:hover)~.kbd-group,.flexsearch-search input:valid~.clear-button{opacity:1;visibility:visible}.flexsearch-search .clear-button{--_button-size:20px;--_content-size:12px;align-items:center;background:var(--plugin-flexsearch-reset-bg);border:var(--plugin-flexsearch-reset-border);border-radius:var(--plugin-flexsearch-reset-border-radius);cursor:pointer;display:flex;height:var(--_button-size);justify-content:center;width:var(--_button-size)}.flexsearch-search .clear-button:after,.flexsearch-search .clear-button:before{background:var(--plugin-flexsearch-reset-color);color:var(--plugin-flexsearch-reset-color);content:"";height:2px;position:absolute;width:var(--_content-size)}.flexsearch-search .clear-button:before{rotate:45deg}.flexsearch-search .clear-button:after{rotate:-45deg}.flexsearch-search kbd{background:var(--plugin-flexsearch-kbd-bg);border:var(--plugin-flexsearch-kbd-border);border-radius:var(--plugin-flexsearch-kbd-border-radius);color:var(--plugin-flexsearch-kbd-color);font-size:var(--font-size-s)}.flexsearch-search a:hover{color:var(--theme-color)}.flexsearch-search .results-panel:empty{display:none}.flexsearch-search:has(.results-panel:not(:empty))~*{display:none}.flexsearch-search:where(:has(input:valid:focus),:has(.results-panel::empty))~*{opacity:.2}.flexsearch-search .matching-post{border-bottom:1px solid var(--color-mono-2);overflow:hidden;padding:1em 0 1.2em}.flexsearch-search .matching-post:hover a{text-decoration-color:transparent}.flexsearch-search .matching-post:hover .title{text-decoration:inherit;text-decoration-color:var(--link-underline-color-hover)}.flexsearch-search .matching-post .title{line-height:1.4;margin:0 0 .5em}.flexsearch-search .matching-post .content{color:var(--color-mono-6);font-size:var(--font-size-s);margin:0}.flexsearch-search .results-status{color:var(--color-mono-6);font-size:var(--font-size-s);margin-bottom:0}.flexsearch-search .results-status:empty{display:none}.flexsearch-modal{display:none;inset:0;position:fixed;z-index:9999}.flexsearch-modal.is-open{display:block}.flexsearch-modal__backdrop{background:rgba(0,0,0,.35);inset:0;position:absolute}.flexsearch-modal__dialog{background:var(--sidebar-background,var(--color-bg));border:1px solid var(--sidebar-border-color,var(--color-mono-2));border-radius:10px;box-shadow:0 18px 40px rgba(0,0,0,.25);display:flex;flex-direction:column;margin:8vh auto 0;max-height:80vh;max-width:min(720px,calc(100vw - 24px));overflow:hidden;position:relative}.flexsearch-modal__dialog .flexsearch-search{display:flex;flex:1 1 auto;flex-direction:column;margin:12px;min-height:0}.flexsearch-modal__dialog .flexsearch-search .results-panel{flex:1 1 auto;min-height:0;overflow:auto}.flexsearch-trigger{margin:var(--plugin-flexsearch-margin)}.flexsearch-trigger .input-wrap{position:relative}.flexsearch-trigger input{background:var(--plugin-flexsearch-input-bg);border:1px solid var(--plugin-flexsearch-input-border-color);border-radius:var(--plugin-flexsearch-input-border-radius);color:var(--plugin-flexsearch-input-color);cursor:pointer;padding-inline-end:36px;width:100%}.flexsearch-trigger .kbd-group{display:flex;gap:.15em;opacity:0;position:absolute;right:7px;top:50%;transition-duration:var(--duration-medium);transition-property:opacity,visibility;translate:0 -50%;visibility:hidden}.flexsearch-trigger .kbd-group:hover,.flexsearch-trigger input:where(:focus,:hover)~.kbd-group{opacity:1;visibility:visible}.flexsearch-trigger kbd{background:var(--plugin-flexsearch-kbd-bg);border:var(--plugin-flexsearch-kbd-border);border-radius:var(--plugin-flexsearch-kbd-border-radius);color:var(--plugin-flexsearch-kbd-color);font-size:var(--font-size-s)}
2
+ /*# sourceMappingURL=docsify-flexsearch.min.css.map */
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["style.css"],"names":[],"mappings":"AACA,MACC,mDAA+D,CAC/D,kEAAoE,CACpE,yEAA0E,CAC1E,yDAAkE,CAClE,0CAAwD,CACxD,4DAAsE,CACtE,yCAA4C,CAC5C,iDAA4D,CAC5D,+BAA6C,CAC7C,+CAA2D,CAC3D,4CAAoD,CACpD,4DAA6D,CAC7D,oCACD,CAEA,mBACE,sCACF,CAEA,+BACE,iBACF,CAEA,yBAKE,4CAA6C,CAF7C,4DAA6D,CAC7D,0DAA2D,CAE3D,0CAA2C,CAJ3C,uBAAwB,CADxB,UAMF,CAEA,2GAEE,uBAAgB,CAAhB,eACF,CAEA,+DAGE,YAAa,CACb,SAAW,CAIX,SAAU,CAHV,iBAAkB,CAClB,SAAU,CACV,OAAQ,CAIR,0CAA2C,CAD3C,sCAAwC,CADxC,gBAAiB,CAPjB,iBAUF,CAEA,kJAIE,SAAU,CADV,kBAEF,CAEA,iCACE,mBAAoB,CACpB,oBAAqB,CAGrB,kBAAmB,CAMnB,4CAA6C,CAF7C,4CAA6C,CAC7C,0DAA2D,CAE3D,cAAe,CARf,YAAa,CAGb,0BAA2B,CAD3B,sBAAuB,CAEvB,yBAKF,CAEA,+EAOE,+CAAgD,CADhD,0CAA2C,CAJ3C,UAAW,CAEX,UAAW,CADX,iBAAkB,CAElB,0BAGF,CAEA,wCACE,YACF,CAEA,uCACE,aACF,CAEA,uBAGE,0CAA2C,CAF3C,0CAA2C,CAC3C,wDAAyD,CAEzD,wCAAyC,CACzC,4BACF,CAEA,2BACE,wBACF,CAEA,wCACE,YACF,CAEA,qDACE,YACF,CAEA,gFAEE,UACF,CAEA,kCAGE,2CAA4C,CAF5C,eAAgB,CAChB,mBAEF,CAEA,0CACE,iCACF,CAEA,+CACE,uBAAwB,CACxB,uDACF,CAEA,yCAEE,eAAgB,CADhB,eAEF,CAEA,2CAEE,yBAA0B,CAC1B,4BAA6B,CAF7B,QAGF,CAEA,mCAEE,yBAA0B,CAC1B,4BAA6B,CAF7B,eAGF,CAEA,yCACE,YACF,CAIA,kBAGE,YAAa,CADb,OAAQ,CADR,cAAe,CAGf,YACF,CAEA,0BACE,aACF,CAEA,4BAGE,0BAA+B,CAD/B,OAAQ,CADR,iBAGF,CAEA,0BAQE,oDAAsD,CACtD,gEAAkE,CAClE,kBAAmB,CACnB,sCAA2C,CAL3C,YAAa,CACb,qBAAsB,CALtB,iBAAuB,CAEvB,eAAgB,CADhB,uCAAyC,CAEzC,eAAgB,CAJhB,iBAWF,CAEA,6CAEE,YAAa,CAGb,aAAc,CAFd,qBAAsB,CAFtB,WAAY,CAGZ,YAEF,CAEA,4DAGE,aAAc,CADd,YAAa,CADb,aAGF,CAIA,oBACE,sCACF,CAEA,gCACE,iBACF,CAEA,0BAKE,4CAA6C,CAF7C,4DAA6D,CAC7D,0DAA2D,CAE3D,0CAA2C,CAC3C,cAAe,CALf,uBAAwB,CADxB,UAOF,CAEA,+BAEE,YAAa,CACb,SAAW,CAIX,SAAU,CAHV,iBAAkB,CAClB,SAAU,CACV,OAAQ,CAIR,0CAA2C,CAD3C,sCAAwC,CADxC,gBAAiB,CAPjB,iBAUF,CAEA,+FAGE,SAAU,CADV,kBAEF,CAEA,wBAGE,0CAA2C,CAF3C,0CAA2C,CAC3C,wDAAyD,CAEzD,wCAAyC,CACzC,4BACF","file":"docsify-flexsearch.min.css","sourcesContent":["/* prettier-ignore */\n:root {\n\t--plugin-flexsearch-input-bg : var(--form-element-bg);\n\t--plugin-flexsearch-input-border-color : var(--sidebar-border-color);\n\t--plugin-flexsearch-input-border-radius: var(--form-element-border-radius);\n\t--plugin-flexsearch-input-color : var(--form-element-color);\n\t--plugin-flexsearch-kbd-bg : var(--color-bg);\n\t--plugin-flexsearch-kbd-border : 1px solid var(--color-mono-3);\n\t--plugin-flexsearch-kbd-border-radius : 4px;\n\t--plugin-flexsearch-kbd-color : var(--color-mono-5);\n\t--plugin-flexsearch-margin : 10px;\n\t--plugin-flexsearch-reset-bg : var(--theme-color);\n\t--plugin-flexsearch-reset-border : transparent;\n\t--plugin-flexsearch-reset-border-radius: var(--border-radius);\n\t--plugin-flexsearch-reset-color : #fff;\n}\n\n.flexsearch-search {\n margin: var(--plugin-flexsearch-margin);\n}\n\n.flexsearch-search .input-wrap {\n position: relative;\n}\n\n.flexsearch-search input {\n width: 100%;\n padding-inline-end: 36px;\n border: 1px solid var(--plugin-flexsearch-input-border-color);\n border-radius: var(--plugin-flexsearch-input-border-radius);\n background: var(--plugin-flexsearch-input-bg);\n color: var(--plugin-flexsearch-input-color);\n}\n\n.flexsearch-search input::-webkit-search-decoration,\n.flexsearch-search input::-webkit-search-cancel-button {\n appearance: none;\n}\n\n.flexsearch-search .clear-button,\n.flexsearch-search .kbd-group {\n visibility: hidden;\n display: flex;\n gap: 0.15em;\n position: absolute;\n right: 7px;\n top: 50%;\n opacity: 0;\n translate: 0 -50%;\n transition-property: opacity, visibility;\n transition-duration: var(--duration-medium);\n}\n\n.flexsearch-search input:valid ~ .clear-button,\n.flexsearch-search input:invalid:where(:focus, :hover) ~ .kbd-group,\n.flexsearch-search .kbd-group:hover {\n visibility: visible;\n opacity: 1;\n}\n\n.flexsearch-search .clear-button {\n --_button-size: 20px;\n --_content-size: 12px;\n\n display: flex;\n align-items: center;\n justify-content: center;\n height: var(--_button-size);\n width: var(--_button-size);\n border: var(--plugin-flexsearch-reset-border);\n border-radius: var(--plugin-flexsearch-reset-border-radius);\n background: var(--plugin-flexsearch-reset-bg);\n cursor: pointer;\n}\n\n.flexsearch-search .clear-button::before,\n.flexsearch-search .clear-button::after {\n content: \"\";\n position: absolute;\n height: 2px;\n width: var(--_content-size);\n color: var(--plugin-flexsearch-reset-color);\n background: var(--plugin-flexsearch-reset-color);\n}\n\n.flexsearch-search .clear-button::before {\n rotate: 45deg;\n}\n\n.flexsearch-search .clear-button::after {\n rotate: -45deg;\n}\n\n.flexsearch-search kbd {\n border: var(--plugin-flexsearch-kbd-border);\n border-radius: var(--plugin-flexsearch-kbd-border-radius);\n background: var(--plugin-flexsearch-kbd-bg);\n color: var(--plugin-flexsearch-kbd-color);\n font-size: var(--font-size-s);\n}\n\n.flexsearch-search a:hover {\n color: var(--theme-color);\n}\n\n.flexsearch-search .results-panel:empty {\n display: none;\n}\n\n.flexsearch-search:has(.results-panel:not(:empty)) ~ * {\n display: none;\n}\n\n.flexsearch-search:where(:has(input:valid:focus), :has(.results-panel::empty))\n ~ * {\n opacity: 0.2;\n}\n\n.flexsearch-search .matching-post {\n overflow: hidden;\n padding: 1em 0 1.2em 0;\n border-bottom: 1px solid var(--color-mono-2);\n}\n\n.flexsearch-search .matching-post:hover a {\n text-decoration-color: transparent;\n}\n\n.flexsearch-search .matching-post:hover .title {\n text-decoration: inherit;\n text-decoration-color: var(--link-underline-color-hover);\n}\n\n.flexsearch-search .matching-post .title {\n margin: 0 0 0.5em 0;\n line-height: 1.4;\n}\n\n.flexsearch-search .matching-post .content {\n margin: 0;\n color: var(--color-mono-6);\n font-size: var(--font-size-s);\n}\n\n.flexsearch-search .results-status {\n margin-bottom: 0;\n color: var(--color-mono-6);\n font-size: var(--font-size-s);\n}\n\n.flexsearch-search .results-status:empty {\n display: none;\n}\n\n/* Modal */\n/* ================================== */\n.flexsearch-modal {\n position: fixed;\n inset: 0;\n display: none;\n z-index: 9999;\n}\n\n.flexsearch-modal.is-open {\n display: block;\n}\n\n.flexsearch-modal__backdrop {\n position: absolute;\n inset: 0;\n background: rgba(0, 0, 0, 0.35);\n}\n\n.flexsearch-modal__dialog {\n position: relative;\n margin: 8vh auto 0 auto;\n max-width: min(720px, calc(100vw - 24px));\n max-height: 80vh;\n overflow: hidden;\n display: flex;\n flex-direction: column;\n background: var(--sidebar-background, var(--color-bg));\n border: 1px solid var(--sidebar-border-color, var(--color-mono-2));\n border-radius: 10px;\n box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);\n}\n\n.flexsearch-modal__dialog .flexsearch-search {\n margin: 12px;\n display: flex;\n flex-direction: column;\n min-height: 0;\n flex: 1 1 auto;\n}\n\n.flexsearch-modal__dialog .flexsearch-search .results-panel {\n overflow: auto;\n min-height: 0;\n flex: 1 1 auto;\n}\n\n/* Modal trigger (sidebar) */\n/* ================================== */\n.flexsearch-trigger {\n margin: var(--plugin-flexsearch-margin);\n}\n\n.flexsearch-trigger .input-wrap {\n position: relative;\n}\n\n.flexsearch-trigger input {\n width: 100%;\n padding-inline-end: 36px;\n border: 1px solid var(--plugin-flexsearch-input-border-color);\n border-radius: var(--plugin-flexsearch-input-border-radius);\n background: var(--plugin-flexsearch-input-bg);\n color: var(--plugin-flexsearch-input-color);\n cursor: pointer;\n}\n\n.flexsearch-trigger .kbd-group {\n visibility: hidden;\n display: flex;\n gap: 0.15em;\n position: absolute;\n right: 7px;\n top: 50%;\n opacity: 0;\n translate: 0 -50%;\n transition-property: opacity, visibility;\n transition-duration: var(--duration-medium);\n}\n\n.flexsearch-trigger input:where(:focus, :hover) ~ .kbd-group,\n.flexsearch-trigger .kbd-group:hover {\n visibility: visible;\n opacity: 1;\n}\n\n.flexsearch-trigger kbd {\n border: var(--plugin-flexsearch-kbd-border);\n border-radius: var(--plugin-flexsearch-kbd-border-radius);\n background: var(--plugin-flexsearch-kbd-bg);\n color: var(--plugin-flexsearch-kbd-color);\n font-size: var(--font-size-s);\n}\n"]}
@@ -0,0 +1,8 @@
1
+ /*!
2
+ * Docsify Plugin: flexsearch v1.0.0
3
+ * https://github.com/remloyal/docsify-plugins#readme
4
+ * (c) 2017-2026
5
+ * MIT license
6
+ */
7
+ !function(){"use strict";var e,t="undefined"!=typeof document?document.currentScript:null;function n(e,t,n){const i=typeof n,s=typeof e;if("undefined"!==i){if("undefined"!==s){if(n){if("function"===s&&i===s)return function(t){return e(n(t))};if((t=e.constructor)===n.constructor){if(t===Array)return n.concat(e);if(t===Map){var r=new Map(n);for(var l of e)r.set(l[0],l[1]);return r}if(t===Set){for(r of(l=new Set(n),e.values()))l.add(r);return l}}}return e}return n}return"undefined"===s?t:e}function i(e,t){return void 0===e?t:e}function s(){return Object.create(null)}function r(e){return"string"==typeof e}function l(e){return"object"==typeof e}function o(e,t){if(r(t))e=e[t];else for(let n=0;e&&n<t.length;n++)e=e[t[n]];return e}const a=/[^\p{L}\p{N}]+/u,h=/(\d{3})/g,c=/(\D)(\d{3})/g,u=/(\d{3})(\D)/g,f=/[\u0300-\u036f]/g;function p(e={}){if(!this||this.constructor!==p)return new p(...arguments);if(arguments.length)for(e=0;e<arguments.length;e++)this.assign(arguments[e]);else this.assign(e)}function g(e){e.F=null,e.B.clear(),e.D.clear()}function d(e,t,n){n||(t||"object"!=typeof e?"object"==typeof t&&(n=t,t=0):n=e),n&&(e=n.query||e,t=n.limit||t);let i=""+(t||0);n&&(i+=(n.offset||0)+!!n.context+!!n.suggest+(!1!==n.resolve)+(n.resolution||this.resolution)+(n.boost||0)),e=(""+e).toLowerCase(),this.cache||(this.cache=new k);let s=this.cache.get(e+i);if(!s){const r=n&&n.cache;r&&(n.cache=!1),s=this.search(e,t,n),r&&(n.cache=r),this.cache.set(e+i,s)}return s}function k(e){this.limit=e&&!0!==e?e:1e3,this.cache=new Map,this.h=""}(e=p.prototype).assign=function(e){this.normalize=n(e.normalize,!0,this.normalize);let t,i=e.include,s=i||e.exclude||e.split;if(s||""===s){if("object"==typeof s&&s.constructor!==RegExp){let e="";t=!i,i||(e+="\\p{Z}"),s.letter&&(e+="\\p{L}"),s.number&&(e+="\\p{N}",t=!!i),s.symbol&&(e+="\\p{S}"),s.punctuation&&(e+="\\p{P}"),s.control&&(e+="\\p{C}"),(s=s.char)&&(e+="object"==typeof s?s.join(""):s);try{this.split=new RegExp("["+(i?"^":"")+e+"]+","u")}catch(e){this.split=/\s+/}}else this.split=s,t=!1===s||"a1a".split(s).length<2;this.numeric=n(e.numeric,t)}else{try{this.split=n(this.split,a)}catch(e){this.split=/\s+/}this.numeric=n(e.numeric,n(this.numeric,!0))}if(this.prepare=n(e.prepare,null,this.prepare),this.finalize=n(e.finalize,null,this.finalize),s=e.filter,this.filter="function"==typeof s?s:n(s&&new Set(s),null,this.filter),this.dedupe=n(e.dedupe,!0,this.dedupe),this.matcher=n((s=e.matcher)&&new Map(s),null,this.matcher),this.mapper=n((s=e.mapper)&&new Map(s),null,this.mapper),this.stemmer=n((s=e.stemmer)&&new Map(s),null,this.stemmer),this.replacer=n(e.replacer,null,this.replacer),this.minlength=n(e.minlength,1,this.minlength),this.maxlength=n(e.maxlength,1024,this.maxlength),this.rtl=n(e.rtl,!1,this.rtl),(this.cache=s=n(e.cache,!0,this.cache))&&(this.F=null,this.L="number"==typeof s?s:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const e of this.matcher.keys())this.h+=(this.h?"|":"")+e;if(this.stemmer)for(const e of this.stemmer.keys())this.A+=(this.A?"|":"")+e;return this},e.addStemmer=function(e,t){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(e,t),this.A+=(this.A?"|":"")+e,this.K=null,this.cache&&g(this),this},e.addFilter=function(e){return"function"==typeof e?this.filter=e:(this.filter||(this.filter=new Set),this.filter.add(e)),this.cache&&g(this),this},e.addMapper=function(e,t){return"object"==typeof e?this.addReplacer(e,t):e.length>1?this.addMatcher(e,t):(this.mapper||(this.mapper=new Map),this.mapper.set(e,t),this.cache&&g(this),this)},e.addMatcher=function(e,t){return"object"==typeof e?this.addReplacer(e,t):e.length<2&&(this.dedupe||this.mapper)?this.addMapper(e,t):(this.matcher||(this.matcher=new Map),this.matcher.set(e,t),this.h+=(this.h?"|":"")+e,this.J=null,this.cache&&g(this),this)},e.addReplacer=function(e,t){return"string"==typeof e?this.addMatcher(e,t):(this.replacer||(this.replacer=[]),this.replacer.push(e,t),this.cache&&g(this),this)},e.encode=function(e,t){if(this.cache&&e.length<=this.H)if(this.F){if(this.B.has(e))return this.B.get(e)}else this.F=setTimeout(g,50,this);this.normalize&&(e="function"==typeof this.normalize?this.normalize(e):f?e.normalize("NFKD").replace(f,"").toLowerCase():e.toLowerCase()),this.prepare&&(e=this.prepare(e)),this.numeric&&e.length>3&&(e=e.replace(c,"$1 $2").replace(u,"$1 $2").replace(h,"$1 "));const n=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let i,r,l=[],o=s(),a=this.split||""===this.split?e.split(this.split):[e];for(let e,s,h=0;h<a.length;h++)if((e=s=a[h])&&!(e.length<this.minlength||e.length>this.maxlength)){if(t){if(o[e])continue;o[e]=1}else{if(i===e)continue;i=e}if(n)l.push(e);else if(!this.filter||("function"==typeof this.filter?this.filter(e):!this.filter.has(e))){if(this.cache&&e.length<=this.I)if(this.F){var p=this.D.get(e);if(p||""===p){p&&l.push(p);continue}}else this.F=setTimeout(g,50,this);if(this.stemmer){let t;for(this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));t!==e&&e.length>2;)t=e,e=e.replace(this.K,e=>this.stemmer.get(e))}if(e&&(this.mapper||this.dedupe&&e.length>1)){p="";for(let t,n,i=0,s="";i<e.length;i++)t=e.charAt(i),t===s&&this.dedupe||((n=this.mapper&&this.mapper.get(t))||""===n?n===s&&this.dedupe||!(s=n)||(p+=n):p+=s=t);e=p}if(this.matcher&&e.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),e=e.replace(this.J,e=>this.matcher.get(e))),e&&this.replacer)for(p=0;e&&p<this.replacer.length;p+=2)e=e.replace(this.replacer[p],this.replacer[p+1]);if(this.cache&&s.length<=this.I&&(this.D.set(s,e),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),e){if(e!==s)if(t){if(o[e])continue;o[e]=1}else{if(r===e)continue;r=e}l.push(e)}}}return this.finalize&&(l=this.finalize(l)||l),this.cache&&e.length<=this.H&&(this.B.set(e,l),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),l},k.prototype.set=function(e,t){this.cache.set(this.h=e,t),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},k.prototype.get=function(e){const t=this.cache.get(e);return t&&this.h!==e&&(this.cache.delete(e),this.cache.set(this.h=e,t)),t},k.prototype.remove=function(e){for(const t of this.cache){const n=t[0];t[1].includes(e)&&this.cache.delete(n)}},k.prototype.clear=function(){this.cache.clear(),this.h=""};const m={normalize:!1,numeric:!1,dedupe:!1},x={},b=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"]]),w=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),y=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],v={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 S={Exact:m,Default:x,Normalize:x,LatinBalance:{mapper:b},LatinAdvanced:{mapper:b,matcher:w,replacer:y},LatinExtra:{mapper:b,replacer:y.concat([/(?!^)[aeo]/g,""]),matcher:w},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(e){for(let n=0;n<e.length;n++){var t=e[n];let i=t.charAt(0),s=v[i];for(let e,n=1;n<t.length&&(e=t.charAt(n),"h"===e||"w"===e||!(e=v[e])||e===s||(i+=e,s=e,4!==i.length));n++);e[n]=i}}},CJK:{split:""},LatinExact:m,LatinDefault:x,LatinSimple:x};function $(e,t,n,i){let s=[];for(let r,l=0;l<e.index.length;l++)if(r=e.index[l],t>=r.length)t-=r.length;else{const l=(t=r[i?"splice":"slice"](t,n)).length;if(l&&(s=s.length?s.concat(t):t,n-=l,i&&(e.length-=l),!n))break;t=0}return s}function A(e){if(!this||this.constructor!==A)return new A(e);this.index=e?[e]:[],this.length=e?e.length:0;const t=this;return new Proxy([],{get:(e,n)=>"length"===n?t.length:"push"===n?function(e){t.index[t.index.length-1].push(e),t.length++}:"pop"===n?function(){if(t.length)return t.length--,t.index[t.index.length-1].pop()}:"indexOf"===n?function(e){let n=0;for(let i,s,r=0;r<t.index.length;r++){if(i=t.index[r],s=i.indexOf(e),s>=0)return n+s;n+=i.length}return-1}:"includes"===n?function(e){for(let n=0;n<t.index.length;n++)if(t.index[n].includes(e))return!0;return!1}:"slice"===n?function(e,n){return $(t,e||0,n||t.length,!1)}:"splice"===n?function(e,n){return $(t,e||0,n||t.length,!0)}:"constructor"===n?Array:"symbol"!=typeof n?(e=t.index[n/2**31|0])&&e[n]:void 0,set:(e,n,i)=>(e=n/2**31|0,(t.index[e]||(t.index[e]=[]))[n]=i,t.length++,!0)})}function z(e=8){if(!this||this.constructor!==z)return new z(e);this.index=s(),this.h=[],this.size=0,e>32?(this.B=_,this.A=BigInt(e)):(this.B=T,this.A=e)}function R(e=8){if(!this||this.constructor!==R)return new R(e);this.index=s(),this.h=[],this.size=0,e>32?(this.B=_,this.A=BigInt(e)):(this.B=T,this.A=e)}function T(e){let t=2**this.A-1;if("number"==typeof e)return e&t;let n=0,i=this.A+1;for(let s=0;s<e.length;s++)n=(n*i^e.charCodeAt(s))&t;return 32===this.A?n+2**31:n}function _(e){let t=BigInt(2)**this.A-BigInt(1);var n=typeof e;if("bigint"===n)return e&t;if("number"===n)return BigInt(e)&t;n=BigInt(0);let i=this.A+BigInt(1);for(let s=0;s<e.length;s++)n=(n*i^BigInt(e.charCodeAt(s)))&t;return n}let B,D,C,P,I;async function q(e){var t=(e=e.data).task;const n=e.id;let i=e.args;if("init"===t)D=e.options||{},(t=e.factory)?(Function("return "+t)()(self),B=new self.FlexSearch.Index(D),delete self.FlexSearch):B=new Ae(D),postMessage({id:n});else{let s;"export"===t&&(i[1]?(i[0]=D.export,i[2]=0,i[3]=1):i=null),"import"===t?i[0]&&(e=await D.import.call(B,i[0]),B.import(i[0],e)):((s=i&&B[t].apply(B,i))&&s.then&&(s=await s),s&&s.await&&(s=await s.await),"search"===t&&s.result&&(s=s.result)),postMessage("search"===t?{id:n,msg:s}:{id:n})}}function L(e){M.call(e,"add"),M.call(e,"append"),M.call(e,"search"),M.call(e,"update"),M.call(e,"remove"),M.call(e,"searchCache")}function j(){C=I=0}function M(e){this[e+"Async"]=function(){const t=arguments;var n=t[t.length-1];let i;if("function"==typeof n&&(i=n,delete t[t.length-1]),C?I||(I=Date.now()-P>=this.priority*this.priority*3):(C=setTimeout(j,0),P=Date.now()),I){const n=this;return new Promise(i=>{setTimeout(function(){i(n[e+"Async"].apply(n,t))},0)})}const s=this[e].apply(this,t);return n=s.then?s:new Promise(e=>e(s)),i&&n.then(i),n}}A.prototype.clear=function(){this.index.length=0},A.prototype.push=function(){},z.prototype.get=function(e){const t=this.index[this.B(e)];return t&&t.get(e)},z.prototype.set=function(e,t){var n=this.B(e);let i=this.index[n];i?(n=i.size,i.set(e,t),(n-=i.size)&&this.size++):(this.index[n]=i=new Map([[e,t]]),this.h.push(i),this.size++)},R.prototype.add=function(e){var t=this.B(e);let n=this.index[t];n?(t=n.size,n.add(e),(t-=n.size)&&this.size++):(this.index[t]=n=new Set([e]),this.h.push(n),this.size++)},(e=z.prototype).has=R.prototype.has=function(e){const t=this.index[this.B(e)];return t&&t.has(e)},e.delete=R.prototype.delete=function(e){const t=this.index[this.B(e)];t&&t.delete(e)&&this.size--},e.clear=R.prototype.clear=function(){this.index=s(),this.h=[],this.size=0},e.values=R.prototype.values=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].values())yield t},e.keys=R.prototype.keys=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].keys())yield t},e.entries=R.prototype.entries=function*(){for(let e=0;e<this.h.length;e++)for(let t of this.h[e].entries())yield t};let E=0;function O(e={},n){function i(t){function i(e){const t=(e=e.data||e).id,n=t&&o.h[t];n&&(n(e.msg),delete o.h[t])}if(this.worker=t,this.h=s(),this.worker)return l?this.worker.on("message",i):this.worker.onmessage=i,e.config?new Promise(function(t){E>1e9&&(E=0),o.h[++E]=function(){t(o)},o.worker.postMessage({id:E,task:"init",factory:r,options:e})}):(this.priority=e.priority||4,this.encoder=n||null,this.worker.postMessage({task:"init",factory:r,options:e}),this)}if(!this||this.constructor!==O)return new O(e);let r="undefined"!=typeof self?self._factory:"undefined"!=typeof window?window._factory:null;r&&(r=r.toString());const l="undefined"==typeof window,o=this,a=function(e,n,i){return n?"undefined"!=typeof module?new(require("worker_threads").Worker)(__dirname+"/worker/node.js"):import("worker_threads").then(function(e){return new e.Worker(void 0+"/node/node.mjs")}):e?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+q.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof i?i:(t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("docsify-flexsearch.min.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}(r,l,e.worker);return a.then?a.then(function(e){return i.call(o,e)}):i.call(this,a)}function N(e){O.prototype[e]=function(){const t=this,n=[].slice.call(arguments);var i=n[n.length-1];let s;return"function"==typeof i&&(s=i,n.pop()),i=new Promise(function(i){"export"===e&&"function"==typeof n[0]&&(n[0]=null),E>1e9&&(E=0),t.h[++E]=i,t.worker.postMessage({task:e,id:E,args:n})}),s?(i.then(s),this):i}}function Z(e,t,n,i,r,l){if(e=e[r],i===n.length-1)t[r]=l||e;else if(e)if(e.constructor===Array)for(t=t[r]=Array(e.length),r=0;r<e.length;r++)Z(e,t,n,i,r);else t=t[r]||(t[r]=s()),r=n[++i],Z(e,t,n,i,r)}function F(e,t,n,i,s,r,l,o){if(e=e[l])if(i===t.length-1){if(e.constructor===Array){if(n[i]){for(t=0;t<e.length;t++)s.add(r,e[t],!0,!0);return}e=e.join(" ")}s.add(r,e,o,!0)}else if(e.constructor===Array)for(l=0;l<e.length;l++)F(e,t,n,i,s,r,l,o);else l=t[++i],F(e,t,n,i,s,r,l,o)}function H(e,t,n,i){if(!e.length)return e;if(1===e.length)return e=e[0],e=n||e.length>t?e.slice(n,n+t):e,i?re.call(this,e):e;let s=[];for(let r,l,o=0;o<e.length;o++)if((r=e[o])&&(l=r.length)){if(n){if(n>=l){n-=l;continue}r=r.slice(n,n+t),l=r.length,n=0}if(l>t&&(r=r.slice(0,t),l=t),!s.length&&l>=t)return i?re.call(this,r):r;if(s.push(r),!(t-=l))break}return s=s.length>1?[].concat.apply([],s):s[0],i?re.call(this,s):s}function Q(e,t,n,i){var s=i[0];if(s[0]&&s[0].query)return e[t].apply(e,s);if(!("and"!==t&&"not"!==t||e.result.length||e.await||s.suggest))return i.length>1&&(s=i[i.length-1]),(i=s.resolve)?e.await||e.result:e;let r,l,o,a,h,c=[],u=0,f=0;for(t=0;t<i.length;t++)if(s=i[t]){var p=void 0;if(s.constructor===V)p=s.await||s.result;else if(s.then||s.constructor===Array)p=s;else{u=s.limit||0,f=s.offset||0,o=s.suggest,l=s.resolve,r=((a=s.highlight||e.highlight)||s.enrich)&&l,p=s.queue;let n=s.async||p,i=s.index,g=s.query;if(i?e.index||(e.index=i):i=e.index,g||s.tag){const r=s.field||s.pluck;if(r&&(!g||e.query&&!a||(e.query=g,e.field=r,e.highlight=a),i=i.index.get(r)),p&&(h||e.await)){let r;h=1;const l=e.C.length,o=new Promise(function(e){r=e});(function(t,i){o.h=function(){i.index=null,i.resolve=!1;let s=n?t.searchAsync(i):t.search(i);return s.then?s.then(function(t){return e.C[l]=t=t.result||t,r(t),t}):(s=s.result||s,r(s),s)}})(i,Object.assign({},s)),e.C.push(o),c[t]=o;continue}s.resolve=!1,s.index=null,p=n?i.searchAsync(s):i.search(s),s.resolve=l,s.index=i}else if(s.and)p=G(s,"and",i);else if(s.or)p=G(s,"or",i);else if(s.not)p=G(s,"not",i);else{if(!s.xor)continue;p=G(s,"xor",i)}}p.await?(h=1,p=p.await):p.then?(h=1,p=p.then(function(e){return e.result||e})):p=p.result||p,c[t]=p}if(h&&!e.await&&(e.await=new Promise(function(t){e.return=t})),h){const t=Promise.all(c).then(function(i){for(let s=0;s<e.C.length;s++)if(e.C[s]===t){e.C[s]=function(){return n.call(e,i,u,f,r,l,o,a)};break}Y(e)});e.C.push(t)}else{if(!e.await)return n.call(e,c,u,f,r,l,o,a);e.C.push(function(){return n.call(e,c,u,f,r,l,o,a)})}return l?e.await||e.result:e}function G(e,t,n){const i=(e=e[t])[0]||e;return i.index||(i.index=n),n=new V(i),e.length>1&&(n=n[t].apply(n,e.slice(1))),n}function J(e,t,n,i,s,r,l){return e.length&&(this.result.length&&e.push(this.result),e.length<2?this.result=e[0]:(this.result=te(e,t,n,!1,this.h),n=0)),s&&(this.await=null),s?this.resolve(t,n,i,l):this}function K(e,t,n,i,s,r,l){if(!r&&!this.result.length)return s?this.result:this;let o;if(e.length)if(this.result.length&&e.unshift(this.result),e.length<2)this.result=e[0];else{let i=0;for(let t,n,s=0;s<e.length;s++)if((t=e[s])&&(n=t.length))i<n&&(i=n);else if(!r){i=0;break}i?(this.result=ee(e,i,t,n,r,this.h,s),o=!0):this.result=[]}else r||(this.result=e);return s&&(this.await=null),s?this.resolve(t,n,i,l,o):this}function U(e,t,n,i,r,l,o){if(e.length)if(this.result.length&&e.unshift(this.result),e.length<2)this.result=e[0];else{e:{l=n;var a=this.h;const i=[],o=s();let h=0;for(let t,n=0;n<e.length;n++)if(t=e[n]){h<t.length&&(h=t.length);for(let e,n=0;n<t.length;n++)if(e=t[n])for(let t,n=0;n<e.length;n++)t=e[n],o[t]=o[t]?2:1}for(let n,s=0,c=0;s<h;s++)for(let h,u=0;u<e.length;u++)if((h=e[u])&&(n=h[s]))for(let h,f=0;f<n.length;f++)if(h=n[f],1===o[h])if(l)l--;else if(r){if(i.push(h),i.length===t){e=i;break e}}else{const n=s+(u?a:0);if(i[n]||(i[n]=[]),i[n].push(h),++c===t){e=i;break e}}e=i}this.result=e,a=!0}else l||(this.result=e);return r&&(this.await=null),r?this.resolve(t,n,i,o,a):this}function W(e,t,n,i,s,r,l){if(!r&&!this.result.length)return s?this.result:this;if(e.length&&this.result.length){e:{r=n;var o=[];e=new Set(e.flat().flat());for(let n,i=0,l=0;i<this.result.length;i++)if(n=this.result[i])for(let a,h=0;h<n.length;h++)if(a=n[h],!e.has(a))if(r)r--;else if(s){if(o.push(a),o.length===t){e=o;break e}}else if(o[i]||(o[i]=[]),o[i].push(a),++l===t){e=o;break e}e=o}this.result=e,o=!0}return s&&(this.await=null),s?this.resolve(t,n,i,l,o):this}function X(e,t,n,i,s){let r,l,a;"string"==typeof s?(r=s,s=""):r=s.template,l=r.indexOf("$1"),a=r.substring(l+2),l=r.substring(0,l);let h=s&&s.boundary,c=!s||!1!==s.clip,u=s&&s.merge&&a&&l&&new RegExp(a+" "+l,"g");var f=0;if("object"==typeof(s=s&&s.ellipsis)){var p=s.template;f=p.length-2,s=s.pattern}let g,d;"string"!=typeof s&&(s=!1===s?"":"..."),f&&(s=p.replace("$1",s)),p=s.length-f,"object"==typeof h&&(g=h.before,0===g&&(g=-1),d=h.after,0===d&&(d=-1),h=h.total||9e5),f=new Map;for(let I,q,L,j=0;j<t.length;j++){let M;if(i)M=t,L=i;else{var k=t[j];if(L=k.field,!L)continue;M=k.result}q=n.get(L),I=q.encoder,"string"!=typeof(k=f.get(I))&&(k=I.encode(e),f.set(I,k));for(let e=0;e<M.length;e++){var m=M[e].doc;if(!m)continue;if(!(m=o(m,L)))continue;var x=m.trim().split(/\s+/);if(!x.length)continue;m="";var b=[];let t=[];for(var w=-1,y=-1,v=0,S=0;S<x.length;S++){var $=x[S],A=I.encode($);let e;if((A=A.length>1?A.join(" "):A[0])&&$){for(var z=$.length,R=(I.split?$.replace(I.split,""):$).length-A.length,T="",_=0,B=0;B<k.length;B++){var D=k[B];if(D){var C=D.length;C+=R<0?0:R,_&&C<=_||(D=A.indexOf(D))>-1&&(T=(D?$.substring(0,D):"")+l+$.substring(D,D+C)+a+(D+C<z?$.substring(D+C):""),_=C,e=!0)}}T&&(h&&(w<0&&(w=m.length+(m?1:0)),y=m.length+(m?1:0)+T.length,v+=z,t.push(b.length),b.push({match:T})),m+=(m?" ":"")+T)}if(e){if(h&&v>=h)break}else m+=(m?" ":"")+($=x[S]),h&&b.push({text:$})}if(v=t.length*(r.length-2),g||d||h&&m.length-v>h)if(S=y-w,g>0&&(S+=g),d>0&&(S+=d),S<=(v=h+v-2*p))x=g?w-(g>0?g:0):w-((v-S)/2|0),b=d?y+(d>0?d:0):x+v,c||(x>0&&" "!==m.charAt(x)&&" "!==m.charAt(x-1)&&((x=m.indexOf(" ",x))<0&&(x=0)),b<m.length&&" "!==m.charAt(b-1)&&" "!==m.charAt(b)&&((b=m.lastIndexOf(" ",b))<y?b=y:++b)),m=(x?s:"")+m.substring(x,b)+(b<m.length?s:"");else{for(y=[],w={},v={},S={},$={},A={},T=R=z=0,B=_=1;;){var P=void 0;for(let e,n=0;n<t.length;n++){if(e=t[n],T)if(R!==T){if(S[n+1])continue;if(e+=T,w[e]){z-=p,v[n+1]=1,S[n+1]=1;continue}if(e>=b.length-1){if(e>=b.length){S[n+1]=1,e>=x.length&&(v[n+1]=1);continue}z-=p}if(m=b[e].text,C=d&&A[n]){if(!(C>0)){S[n+1]=1;continue}if(m.length>C){if(S[n+1]=1,!c)continue;m=m.substring(0,C)}(C-=m.length)||(C=-1),A[n]=C}if(z+m.length+1<=h)m=" "+m,y[n]+=m;else{if(!c){S[n+1]=1;continue}(P=h-z-1)>0&&(m=" "+m.substring(0,P),y[n]+=m),S[n+1]=1}}else{if(S[n])continue;if(e-=R,w[e]){z-=p,S[n]=1,v[n]=1;continue}if(e<=0){if(e<0){S[n]=1,v[n]=1;continue}z-=p}if(m=b[e].text,C=g&&$[n]){if(!(C>0)){S[n]=1;continue}if(m.length>C){if(S[n]=1,!c)continue;m=m.substring(m.length-C)}(C-=m.length)||(C=-1),$[n]=C}if(z+m.length+1<=h)m+=" ",y[n]=m+y[n];else{if(!c){S[n]=1;continue}(P=m.length+1-(h-z))>=0&&P<m.length&&(m=m.substring(P)+" ",y[n]=m+y[n]),S[n]=1}}else{let t;if(m=b[e].match,g&&($[n]=g),d&&(A[n]=d),n&&z++,e?!n&&p&&(z+=p):(v[n]=1,S[n]=1),e>=x.length-1||e<b.length-1&&b[e+1].match?t=1:p&&(z+=p),z-=r.length-2,n&&!(z+m.length<=h)){P=_=B=v[n]=0;break}y[n]=m,t&&(v[n+1]=1,S[n+1]=1)}z+=m.length,P=w[e]=1}if(P)R===T?T++:R++;else{if(R===T?_=0:B=0,!_&&!B)break;_?T=++R:T++}}m="";for(let e,t=0;t<y.length;t++)e=(v[t]?t?" ":"":(t&&!s?" ":"")+s)+y[t],m+=e;s&&!v[y.length]&&(m+=s)}u&&(m=m.replace(u," ")),M[e].highlight=m}if(i)break}return t}function V(e,t){if(!this||this.constructor!==V)return new V(e,t);let n,i,s,r,l,o,a=0;if(e&&e.index){const n=e;if(t=n.index,a=n.boost||0,i=n.query){s=n.field||n.pluck,r=n.highlight;const i=n.resolve;e=n.async||n.queue,n.resolve=!1,n.index=null,e=e?t.searchAsync(n):t.search(n),n.resolve=i,n.index=t,e=e.result||e}else e=[]}if(e&&e.then){const t=this;e=e.then(function(e){t.C[0]=t.result=e.result||e,Y(t)}),n=[e],e=[],l=new Promise(function(e){o=e})}this.index=t||null,this.result=e||[],this.h=a,this.C=n||[],this.await=l||null,this.return=o||null,this.highlight=r||null,this.query=i||"",this.field=s||""}function Y(e,t){let n=e.result;var i=e.await;e.await=null;for(let t,s=0;s<e.C.length;s++)if(t=e.C[s])if("function"==typeof t)n=t(),e.C[s]=n=n.result||n,s--;else if(t.h)n=t.h(),e.C[s]=n=n.result||n,s--;else if(t.then)return e.await=i;return i=e.return,e.C=[],e.return=null,t||i(n),n}function ee(e,t,n,i,r,l,o){const a=e.length;let h,c,u=[];h=s();for(let s,f,p,g,d=0;d<t;d++)for(let t=0;t<a;t++)if(p=e[t],d<p.length&&(s=p[d]))for(let e=0;e<s.length;e++){if(f=s[e],(c=h[f])?h[f]++:(c=0,h[f]=1),g=u[c]||(u[c]=[]),!o){let e=d+(t||!r?0:l||0);g=g[e]||(g[e]=[])}if(g.push(f),o&&n&&c===a-1&&g.length-i===n)return i?g.slice(i):g}if(e=u.length)if(r)u=u.length>1?te(u,n,i,o,l):(u=u[0])&&n&&u.length>n||i?u.slice(i,n+i):u;else{if(e<a)return[];if(u=u[e-1],n||i)if(o)(u.length>n||i)&&(u=u.slice(i,n+i));else{r=[];for(let e,t=0;t<u.length;t++)if(e=u[t])if(i&&e.length>i)i-=e.length;else if((n&&e.length>n||i)&&(e=e.slice(i,n+i),n-=e.length,i&&(i-=e.length)),r.push(e),!n)break;u=r}}return u}function te(e,t,n,i,r){const l=[],o=s();let a;var h=e.length;let c;if(i){for(r=h-1;r>=0;r--)if(c=(i=e[r])&&i.length)for(h=0;h<c;h++)if(a=i[h],!o[a])if(o[a]=1,n)n--;else if(l.push(a),l.length===t)return l}else for(let s,u=h-1,f=0;u>=0;u--){s=e[u];for(let e=0;e<s.length;e++)if(c=(i=s[e])&&i.length)for(let s=0;s<c;s++)if(a=i[s],!o[a])if(o[a]=1,n)n--;else{let n=(e+(u<h-1&&r||0))/(u+1)|0;if((l[n]||(l[n]=[])).push(a),++f===t)return l}}return l}function ne(e,t,n,i,r){const l=s(),o=[];for(let e,n=0;n<t.length;n++){e=t[n];for(let t=0;t<e.length;t++)l[e[t]]=1}if(r){for(let t,s=0;s<e.length;s++)if(t=e[s],l[t])if(i)i--;else if(o.push(t),l[t]=0,n&&0===--n)break}else for(let n,i,s=0;s<e.result.length;s++)for(n=e.result[s],t=0;t<n.length;t++)i=n[t],l[i]&&((o[s]||(o[s]=[])).push(i),l[i]=0);return o}function ie(e){const t=[],n=s(),i=s();for(let s,r,l,o,a,h,c,u=0;u<e.length;u++){s=e[u],r=s.field,l=s.result;for(let e=0;e<l.length;e++)a=l[e],"object"!=typeof a?a={id:o=a}:o=a.id,(h=n[o])?h.push(r):(a.field=n[o]=[r],t.push(a)),(c=a.highlight)&&(h=i[o],h||(i[o]=h={},a.highlight=h),h[r]=c)}return t}function se(e,t,n,i,s){return(e=this.tag.get(e))&&(e=e.get(t))?((t=e.length-i)>0&&((n&&t>n||i)&&(e=e.slice(i,i+n)),s&&(e=re.call(this,e))),e):[]}function re(e){if(!this||!this.store)return e;if(this.db)return this.index.get(this.field[0]).db.enrich(e);const t=Array(e.length);for(let n,i=0;i<e.length;i++)n=e[i],t[i]={id:n,doc:this.store.get(n)};return t}function le(e){if(!this||this.constructor!==le)return new le(e);const t=e.document||e.doc||e;let n,i;if(this.B=[],this.field=[],this.D=[],this.key=(n=t.key||t.id)&&ae(n,this.D)||"id",(i=e.keystore||0)&&(this.keystore=i),this.fastupdate=!!e.fastupdate,this.reg=!this.fastupdate||e.worker||e.db?i?new R(i):new Set:i?new z(i):new Map,this.h=(n=t.store||null)&&n&&!0!==n&&[],this.store=n?i?new z(i):new Map:null,this.cache=(n=e.cache||null)&&new k(n),e.cache=!1,this.worker=e.worker||!1,this.priority=e.priority||4,this.index=oe.call(this,e,t),this.tag=null,(n=t.tag)&&("string"==typeof n&&(n=[n]),n.length)){this.tag=new Map,this.A=[],this.F=[];for(let e,t,i=0;i<n.length;i++){if(e=n[i],t=e.field||e,!t)throw Error("The tag field from the document descriptor is undefined.");e.custom?this.A[i]=e.custom:(this.A[i]=ae(t,this.D),e.filter&&("string"==typeof this.A[i]&&(this.A[i]=new String(this.A[i])),this.A[i].G=e.filter)),this.F[i]=t,this.tag.set(t,new Map)}}if(this.worker){this.fastupdate=!1,e=[];for(const t of this.index.values())t.then&&e.push(t);if(e.length){const t=this;return Promise.all(e).then(function(e){let n=0;for(const i of t.index.entries()){const s=i[0];let r=i[1];r.then&&(r=e[n],t.index.set(s,r),n++)}return t})}}else e.db&&(this.fastupdate=!1,this.mount(e.db))}function oe(e,t){const n=new Map;let i=t.index||t.field||t;r(i)&&(i=[i]);for(let t,o,a=0;a<i.length;a++){if(t=i[a],r(t)||(o=t,t=t.field),o=l(o)?Object.assign({},e,o):e,this.worker){var s=void 0;s=new O(o,s=(s=o.encoder)&&s.encode?s:new p("string"==typeof s?S[s]:s||{})),n.set(t,s)}this.worker||n.set(t,new Ae(o,this.reg)),o.custom?this.B[a]=o.custom:(this.B[a]=ae(t,this.D),o.filter&&("string"==typeof this.B[a]&&(this.B[a]=new String(this.B[a])),this.B[a].G=o.filter)),this.field[a]=t}if(this.h){r(e=t.store)&&(e=[e]);for(let t,n,i=0;i<e.length;i++)t=e[i],n=t.field||t,t.custom?(this.h[i]=t.custom,t.custom.O=n):(this.h[i]=ae(n,this.D),t.filter&&("string"==typeof this.h[i]&&(this.h[i]=new String(this.h[i])),this.h[i].G=t.filter))}return n}function ae(e,t){const n=e.split(":");let i=0;for(let s=0;s<n.length;s++)"]"===(e=n[s])[e.length-1]&&(e=e.substring(0,e.length-2))&&(t[i]=!0),e&&(n[i++]=e);return i<n.length&&(n.length=i),i>1?n:n[0]}function he(e,t=0){let n=[],i=[];t&&(t=25e4/t*5e3|0);for(const s of e.entries())i.push(s),i.length===t&&(n.push(i),i=[]);return i.length&&n.push(i),n}function ce(e,t){t||(t=new Map);for(let n,i=0;i<e.length;i++)n=e[i],t.set(n[0],n[1]);return t}function ue(e,t=0){let n=[],i=[];t&&(t=25e4/t*1e3|0);for(const s of e.entries())i.push([s[0],he(s[1])[0]||[]]),i.length===t&&(n.push(i),i=[]);return i.length&&n.push(i),n}function fe(e,t){t||(t=new Map);for(let n,i,s=0;s<e.length;s++)n=e[s],i=t.get(n[0]),t.set(n[0],ce(n[1],i));return t}function pe(e){let t=[],n=[];for(const i of e.keys())n.push(i),25e4===n.length&&(t.push(n),n=[]);return n.length&&t.push(n),t}function ge(e,t){t||(t=new Set);for(let n=0;n<e.length;n++)t.add(e[n]);return t}function de(e,t,n,i,s,r,l=0){const o=i&&i.constructor===Array;var a=o?i.shift():i;if(!a)return this.export(e,t,s,r+1);if((a=e((t?t+".":"")+(l+1)+"."+n,JSON.stringify(a)))&&a.then){const h=this;return a.then(function(){return de.call(h,e,t,n,o?i:null,s,r,l+1)})}return de.call(this,e,t,n,o?i:null,s,r,l+1)}function ke(e,t){let n="";for(const i of e.entries()){e=i[0];const s=i[1];let r="";for(let e,n=0;n<s.length;n++){e=s[n]||[""];let i="";for(let n=0;n<e.length;n++)i+=(i?",":"")+("string"===t?'"'+e[n]+'"':e[n]);i="["+i+"]",r+=(r?",":"")+i}r='["'+e+'",['+r+"]]",n+=(n?",":"")+r}return n}function me(e,t){let n=0;var i=void 0===t;if(e.constructor===Array){for(let s,r,l,o=0;o<e.length;o++)if((s=e[o])&&s.length){if(i)return 1;if(r=s.indexOf(t),r>=0){if(s.length>1)return s.splice(r,1),1;if(delete e[o],n)return 1;l=1}else{if(l)return 1;n++}}}else for(let s of e.entries())i=s[0],me(s[1],t)?n++:e.delete(i);return n}N("add"),N("append"),N("search"),N("update"),N("remove"),N("clear"),N("export"),N("import"),O.prototype.searchCache=d,L(O.prototype),le.prototype.add=function(e,t,n){if(l(e)&&(e=o(t=e,this.key)),t&&(e||0===e)){if(!n&&this.reg.has(e))return this.update(e,t);for(let s,l=0;l<this.field.length;l++){s=this.B[l];var i=this.index.get(this.field[l]);if("function"==typeof s){var a=s(t);a&&i.add(e,a,n,!0)}else(!(a=s.G)||a(t))&&(s.constructor===String?s=[""+s]:r(s)&&(s=[s]),F(t,s,this.D,0,i,e,s[0],n))}if(this.tag)for(i=0;i<this.A.length;i++){var h=this.A[i];a=this.tag.get(this.F[i]);let l=s();if("function"==typeof h){if(!(h=h(t)))continue}else{var c=h.G;if(c&&!c(t))continue;h.constructor===String&&(h=""+h),h=o(t,h)}if(a&&h){r(h)&&(h=[h]);for(let t,i,s=0;s<h.length;s++)if(t=h[s],!l[t]&&(l[t]=1,(c=a.get(t))?i=c:a.set(t,i=[]),!n||!i.includes(e))){if(i.length===2**31-1){if(c=new A(i),this.fastupdate)for(let e of this.reg.values())e.includes(i)&&(e[e.indexOf(i)]=c);a.set(t,i=c)}i.push(e),this.fastupdate&&((c=this.reg.get(e))?c.push(i):this.reg.set(e,[i]))}}}if(this.store&&(!n||!this.store.has(e))){let i;if(this.h){i=s();for(let e,s=0;s<this.h.length;s++){if(e=this.h[s],(n=e.G)&&!n(t))continue;let l;if("function"==typeof e){if(l=e(t),!l)continue;e=[e.O]}else if(r(e)||e.constructor===String){i[e]=t[e];continue}Z(t,i,e,0,e[0],l)}}this.store.set(e,i||t)}this.worker&&(this.fastupdate||this.reg.add(e))}return this},V.prototype.or=function(){return Q(this,"or",J,arguments)},V.prototype.and=function(){return Q(this,"and",K,arguments)},V.prototype.xor=function(){return Q(this,"xor",U,arguments)},V.prototype.not=function(){return Q(this,"not",W,arguments)},(e=V.prototype).limit=function(e){if(this.await){const t=this;this.C.push(function(){return t.limit(e).result})}else if(this.result.length){const t=[];for(let n,i=0;i<this.result.length;i++)if(n=this.result[i]){if(!(n.length<=e)){t[i]=n.slice(0,e);break}if(t[i]=n,!(e-=n.length))break}this.result=t}return this},e.offset=function(e){if(this.await){const t=this;this.C.push(function(){return t.offset(e).result})}else if(this.result.length){const t=[];for(let n,i=0;i<this.result.length;i++)(n=this.result[i])&&(n.length<=e?e-=n.length:(t[i]=n.slice(e),e=0));this.result=t}return this},e.boost=function(e){if(this.await){const t=this;this.C.push(function(){return t.boost(e).result})}else this.h+=e;return this},e.resolve=function(e,t,n,i,s){let r=this.await?Y(this,!0):this.result;if(r.then){const l=this;return r.then(function(){return l.resolve(e,t,n,i,s)})}return r.length&&("object"==typeof e?(i=e.highlight||this.highlight,n=!!i||e.enrich,t=e.offset,e=e.limit):(i=i||this.highlight,n=!!i||n),r=s?n?re.call(this.index,r):r:H.call(this.index,r,e||100,t,n)),this.finalize(r,i)},e.finalize=function(e,t){if(e.then){const n=this;return e.then(function(e){return n.finalize(e,t)})}t&&e.length&&this.query&&(e=X(this.query,e,this.index.index,this.field,t));const n=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",n&&n(e),e},le.prototype.search=function(e,t,n,s){n||(!t&&l(e)?(n=e,e=""):l(t)&&(n=t,t=0));let o=[];var a=[];let h,c,u,f,p,g,d,k,m=0,x=!0;if(n){n.constructor===Array&&(n={index:n}),e=n.query||e,h=n.pluck,c=n.merge,f=n.boost,g=h||n.field||(g=n.index)&&(g.index?null:g);var b=this.tag&&n.tag;u=n.suggest,x=!1!==n.resolve,p=n.cache,d=x&&this.store&&n.highlight;var w=!!d||x&&this.store&&n.enrich;t=n.limit||t;var y=n.offset||0;if(t||(t=x?100:0),b&&(!this.db||!s)){b.constructor!==Array&&(b=[b]);var v=[];for(let e,t=0;t<b.length;t++)if(e=b[t],e.field&&e.tag){var S=e.tag;if(S.constructor===Array)for(var $=0;$<S.length;$++)v.push(e.field,S[$]);else v.push(e.field,S)}else{S=Object.keys(e);for(let t,n,i=0;i<S.length;i++)if(t=S[i],n=e[t],n.constructor===Array)for($=0;$<n.length;$++)v.push(t,n[$]);else v.push(t,n)}if(b=v,!e){if(a=[],v.length)for(b=0;b<v.length;b+=2){if(this.db){if(!(s=this.index.get(v[b])))continue;a.push(s=s.db.tag(v[b+1],t,y,w))}else s=se.call(this,v[b],v[b+1],t,y,w);o.push(x?{field:v[b],tag:v[b+1],result:s}:[s])}if(a.length){const e=this;return Promise.all(a).then(function(t){for(let e=0;e<t.length;e++)x?o[e].result=t[e]:o[e]=t[e];return x?o:new V(o.length>1?ee(o,1,0,0,u,f):o[0],e)})}return x?o:new V(o.length>1?ee(o,1,0,0,u,f):o[0],this)}}x||h||!(g=g||this.field)||(r(g)?h=g:(g.constructor===Array&&1===g.length&&(g=g[0]),h=g.field||g.index)),g&&g.constructor!==Array&&(g=[g])}g||(g=this.field),v=(this.worker||this.db)&&!s&&[];for(let l,h,c,f=0;f<g.length;f++){if(h=g[f],this.db&&this.tag&&!this.B[f])continue;let z;if(r(h)||(z=h,h=z.field,e=z.query||e,t=i(z.limit,t),y=i(z.offset,y),u=i(z.suggest,u),d=x&&this.store&&i(z.highlight,d),w=!!d||x&&this.store&&i(z.enrich,w),p=i(z.cache,p)),s)l=s[f];else{$=(S=z||n||{}).enrich;var A=this.index.get(h);if(b&&(this.db&&(S.tag=b,S.field=g,k=A.db.support_tag_search),!k&&$&&(S.enrich=!1),k||(S.limit=0,S.offset=0)),l=p?A.searchCache(e,b&&!k?0:t,S):A.search(e,b&&!k?0:t,S),b&&!k&&(S.limit=t,S.offset=y),$&&(S.enrich=$),v){v[f]=l;continue}}if(c=(l=l.result||l)&&l.length,b&&c){if(S=[],$=0,this.db&&s){if(!k)for(A=g.length;A<s.length;A++){let e=s[A];if(e&&e.length)$++,S.push(e);else if(!u)return x?o:new V(o,this)}}else for(let e,t,n=0;n<b.length;n+=2){if(e=this.tag.get(b[n]),!e){if(u)continue;return x?o:new V(o,this)}if(t=(e=e&&e.get(b[n+1]))&&e.length)$++,S.push(e);else if(!u)return x?o:new V(o,this)}if($){if(l=ne(l,S,t,y,x),c=l.length,!c&&!u)return x?l:new V(l,this);$--}}if(c)a[m]=h,o.push(l),m++;else if(1===g.length)return x?o:new V(o,this)}if(v){if(this.db&&b&&b.length&&!k)for(w=0;w<b.length;w+=2){if(!(a=this.index.get(b[w]))){if(u)continue;return x?o:new V(o,this)}v.push(a.db.tag(b[w+1],t,y,!1))}const i=this;return Promise.all(v).then(function(s){return n&&(n.resolve=x),s.length&&(s=i.search(e,t,n,s)),s})}if(!m)return x?o:new V(o,this);if(h&&(!w||!this.store))return o=o[0],x?o:new V(o,this);for(v=[],y=0;y<a.length;y++){if(b=o[y],w&&b.length&&void 0===b[0].doc&&(this.db?v.push(b=this.index.get(this.field[0]).db.enrich(b)):b=re.call(this,b)),h)return x?d?X(e,b,this.index,h,d):b:new V(b,this);o[y]={field:a[y],result:b}}if(w&&this.db&&v.length){const t=this;return Promise.all(v).then(function(n){for(let e=0;e<n.length;e++)o[e].result=n[e];return d&&(o=X(e,o,t.index,h,d)),c?ie(o):o})}return d&&(o=X(e,o,this.index,h,d)),c?ie(o):o},(e=le.prototype).mount=function(e){let t=this.field;if(this.tag)for(let e,i=0;i<this.F.length;i++){e=this.F[i];var n=void 0;this.index.set(e,n=new Ae({},this.reg)),t===this.field&&(t=t.slice(0)),t.push(e),n.tag=this.tag.get(e)}n=[];const i={db:e.db,type:e.type,fastupdate:e.fastupdate};for(let s,r,l=0;l<t.length;l++){i.field=r=t[l],s=this.index.get(r);const o=new e.constructor(e.id,i);o.id=e.id,n[l]=o.mount(s),s.document=!0,l?s.bypass=!0:s.store=this.store}const s=this;return this.db=Promise.all(n).then(function(){s.db=!0})},e.commit=async function(){const e=[];for(const t of this.index.values())e.push(t.commit());await Promise.all(e),this.reg.clear()},e.destroy=function(){const e=[];for(const t of this.index.values())e.push(t.destroy());return Promise.all(e)},e.append=function(e,t){return this.add(e,t,!0)},e.update=function(e,t){return this.remove(e).add(e,t)},e.remove=function(e){for(var t of(l(e)&&(e=o(e,this.key)),this.index.values()))t.remove(e,!0);if(this.reg.has(e)){if(this.tag&&!this.fastupdate)for(let n of this.tag.values())for(let i of n){t=i[0];const s=i[1],r=s.indexOf(e);r>-1&&(s.length>1?s.splice(r,1):n.delete(t))}this.store&&this.store.delete(e),this.reg.delete(e)}return this.cache&&this.cache.remove(e),this},e.clear=function(){const e=[];for(const t of this.index.values()){const n=t.clear();n.then&&e.push(n)}if(this.tag)for(const e of this.tag.values())e.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),e.length?Promise.all(e):this},e.contain=function(e){return this.db?this.index.get(this.field[0]).db.has(e):this.reg.has(e)},e.cleanup=function(){for(const e of this.index.values())e.cleanup();return this},e.get=function(e){return this.db?this.index.get(this.field[0]).db.enrich(e).then(function(e){return e[0]&&e[0].doc||null}):this.store.get(e)||null},e.set=function(e,t){return"object"==typeof e&&(e=o(t=e,this.key)),this.store.set(e,t),this},e.searchCache=d,e.export=function(e,t,n=0,i=0){if(n<this.field.length){const s=this.field[n];if((t=this.index.get(s).export(e,s,n,i=1))&&t.then){const i=this;return t.then(function(){return i.export(e,s,n+1)})}return this.export(e,s,n+1)}let s,r;switch(i){case 0:s="reg",r=pe(this.reg),t=null;break;case 1:s="tag",r=this.tag&&ue(this.tag,this.reg.size),t=null;break;case 2:s="doc",r=this.store&&he(this.store),t=null;break;default:return}return de.call(this,e,t,s,r||null,n,i)},e.import=function(e,t){var n=e.split(".");"json"===n[n.length-1]&&n.pop();const i=n.length>2?n[0]:"";if(n=n.length>2?n[2]:n[1],this.worker&&i)return this.index.get(i).import(e);if(t){if("string"==typeof t&&(t=JSON.parse(t)),i)return this.index.get(i).import(n,t);switch(n){case"reg":this.fastupdate=!1,this.reg=ge(t,this.reg);for(let e,t=0;t<this.field.length;t++)e=this.index.get(this.field[t]),e.fastupdate=!1,e.reg=this.reg;if(this.worker){t=[];for(const n of this.index.values())t.push(n.import(e));return Promise.all(t)}break;case"tag":this.tag=fe(t,this.tag);break;case"doc":this.store=ce(t,this.store)}}},L(le.prototype),Ae.prototype.remove=function(e,t){const n=this.reg.size&&(this.fastupdate?this.reg.get(e):this.reg.has(e));if(n){if(this.fastupdate){for(let t,i,s=0;s<n.length;s++)if((t=n[s])&&(i=t.length))if(t[i-1]===e)t.pop();else{const n=t.indexOf(e);n>=0&&t.splice(n,1)}}else me(this.map,e),this.depth&&me(this.ctx,e);t||this.reg.delete(e)}return this.db&&(this.commit_task.push({del:e}),this.M&&ze(this)),this.cache&&this.cache.remove(e),this};const xe={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 be(e,t,n,i,r,l,o){let a,h;if(!(a=t[n])||o&&!a[o]){if(o?((t=a||(t[n]=s()))[o]=1,h=e.ctx,(a=h.get(o))?h=a:h.set(o,h=e.keystore?new z(e.keystore):new Map)):(h=e.map,t[n]=1),(a=h.get(n))?h=a:h.set(n,h=a=[]),l)for(let n,s=0;s<a.length;s++)if((n=a[s])&&n.includes(r)){if(s<=i)return;n.splice(n.indexOf(r),1),e.fastupdate&&(t=e.reg.get(r))&&t.splice(t.indexOf(n),1);break}if(h=h[i]||(h[i]=[]),h.push(r),h.length===2**31-1){if(t=new A(h),e.fastupdate)for(let n of e.reg.values())n.includes(h)&&(n[n.indexOf(h)]=t);a[i]=h=t}e.fastupdate&&((i=e.reg.get(r))?i.push(h):e.reg.set(r,[h]))}}function we(e,t,n,i,s){return n&&e>1?t+(i||0)<=e?n+(s||0):(e-1)/(t+(i||0))*(n+(s||0))+1|0:0}function ye(e,t,n,i,s,r,l){let o=e.length,a=e;if(o>1)a=ee(e,t,n,i,s,r,l);else if(1===o)return l?H.call(null,e[0],n,i):new V(e[0],this);return l?a:new V(a,this)}function ve(e,t,n,i,s,r,l){return e=$e(this,e,t,n,i,s,r,l),this.db?e.then(function(e){return s?e||[]:new V(e,this)}):e&&e.length?s?H.call(this,e,n,i):new V(e,this):s?[]:new V([],this)}function Se(e,t,n,i){let s=[];if(e&&e.length){if(e.length<=i)return void t.push(e);for(let t,n=0;n<i;n++)(t=e[n])&&(s[n]=t);if(s.length)return void t.push(s)}if(!n)return s}function $e(e,t,n,i,s,r,l,o){let a;return n&&(a=e.bidirectional&&t>n)&&(a=n,n=t,t=a),e.db?e.db.get(t,n,i,s,r,l,o):e=n?(e=e.ctx.get(n))&&e.get(t):e.map.get(t)}function Ae(e,t){if(!this||this.constructor!==Ae)return new Ae(e);if(e){var n=r(e)?e:e.preset;n&&(e=Object.assign({},xe[n],e))}else e={};const i=!0===(n=e.context)?{depth:1}:n||{},s=r(e.encoder)?S[e.encoder]:e.encode||e.encoder||{};this.encoder=s.encode?s:"object"==typeof s?new p(s):{encode:s},this.resolution=e.resolution||9,this.tokenize=n=(n=e.tokenize)&&"default"!==n&&"exact"!==n&&n||"strict",this.depth="strict"===n&&i.depth||0,this.bidirectional=!1!==i.bidirectional,this.fastupdate=!!e.fastupdate,this.score=e.score||null,(n=e.keystore||0)&&(this.keystore=n),this.map=n?new z(n):new Map,this.ctx=n?new z(n):new Map,this.reg=t||(this.fastupdate?n?new z(n):new Map:n?new R(n):new Set),this.N=i.resolution||3,this.rtl=s.rtl||e.rtl||!1,this.cache=(n=e.cache||null)&&new k(n),this.resolve=!1!==e.resolve,(n=e.db)&&(this.db=this.mount(n)),this.M=!1!==e.commit,this.commit_task=[],this.commit_timer=null,this.priority=e.priority||4}function ze(e){e.commit_timer||(e.commit_timer=setTimeout(function(){e.commit_timer=null,e.db.commit(e)},1))}Ae.prototype.add=function(e,t,n,i){if(t&&(e||0===e)){if(!i&&!n&&this.reg.has(e))return this.update(e,t);i=this.depth;const c=(t=this.encoder.encode(t,!i)).length;if(c){const u=s(),f=s(),p=this.resolution;for(let s=0;s<c;s++){let g=t[this.rtl?c-1-s:s];var r=g.length;if(r&&(i||!f[g])){var l=this.score?this.score(t,g,s,null,0):we(p,c,s),o="";switch(this.tokenize){case"tolerant":if(be(this,f,g,l,e,n),r>2){for(let t,i,s,a,h=1;h<r-1;h++)t=g.charAt(h),i=g.charAt(h+1),s=g.substring(0,h)+i,a=g.substring(h+2),be(this,f,o=s+t+a,l,e,n),be(this,f,o=s+a,l,e,n);be(this,f,g.substring(0,g.length-1),l,e,n)}break;case"full":if(r>2){for(let i,h=0;h<r;h++)for(l=r;l>h;l--){o=g.substring(h,l),i=this.rtl?r-1-h:h;var a=this.score?this.score(t,g,s,o,i):we(p,c,s,r,i);be(this,f,o,a,e,n)}break}case"bidirectional":case"reverse":if(r>1){for(a=r-1;a>0;a--){o=g[this.rtl?r-1-a:a]+o;var h=this.score?this.score(t,g,s,o,a):we(p,c,s,r,a);be(this,f,o,h,e,n)}o=""}case"forward":if(r>1){for(a=0;a<r;a++)be(this,f,o+=g[this.rtl?r-1-a:a],l,e,n);break}default:if(be(this,f,g,l,e,n),i&&c>1&&s<c-1)for(r=this.N,o=g,l=Math.min(i+1,this.rtl?s+1:c-s),a=1;a<l;a++){g=t[this.rtl?c-1-s-a:s+a];be(this,u,(h=this.bidirectional&&g>o)?o:g,this.score?this.score(t,o,s,g,a-1):we(r+(c/2>r?0:1),c,s,l-1,a-1),e,n,h?g:o)}}}}this.fastupdate||this.reg.add(e)}}return this.db&&(this.commit_task.push(n?{ins:e}:{del:e}),this.M&&ze(this)),this},Ae.prototype.search=function(e,t,n){if(n||(t||"object"!=typeof e?"object"==typeof t&&(n=t,t=0):(n=e,e="")),n&&n.cache)return n.cache=!1,e=this.searchCache(e,t,n),n.cache=!0,e;let i,r,l,o,a,h,c,u,f=[],p=0;n&&(e=n.query||e,t=n.limit||t,p=n.offset||0,r=n.context,l=n.suggest,u=(o=n.resolve)&&n.enrich,h=n.boost,c=n.resolution,a=this.db&&n.tag),void 0===o&&(o=this.resolve),r=this.depth&&!1!==r;let g=this.encoder.encode(e,!r);if(i=g.length,t=t||(o?100:0),1===i)return ve.call(this,g[0],"",t,p,o,u,a);if(2===i&&r&&!l)return ve.call(this,g[1],g[0],t,p,o,u,a);let d,k=s(),m=0;if(r&&(d=g[0],m=1),c||0===c||(c=d?this.N:this.resolution),this.db){if(this.db.search&&!1!==(n=this.db.search(this,g,t,p,l,o,u,a)))return n;const e=this;return async function(){for(let t,n;m<i;m++){if((n=g[m])&&!k[n]){if(k[n]=1,t=await $e(e,n,d,0,0,!1,!1),t=Se(t,f,l,c)){f=t;break}d&&(l&&t&&f.length||(d=n))}l&&d&&m===i-1&&!f.length&&(c=e.resolution,d="",m=-1,k=s())}return ye(f,c,t,p,l,h,o)}()}for(let e,t;m<i;m++){if((t=g[m])&&!k[t]){if(k[t]=1,e=$e(this,t,d,0,0,!1,!1),e=Se(e,f,l,c)){f=e;break}d&&(l&&e&&f.length||(d=t))}l&&d&&m===i-1&&!f.length&&(c=this.resolution,d="",m=-1,k=s())}return ye(f,c,t,p,l,h,o)},(e=Ae.prototype).mount=function(e){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),e.mount(this)},e.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},e.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},e.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},e.append=function(e,t){return this.add(e,t,!0)},e.contain=function(e){return this.db?this.db.has(e):this.reg.has(e)},e.update=function(e,t){const n=this,i=this.remove(e);return i&&i.then?i.then(()=>n.add(e,t)):this.add(e,t)},e.cleanup=function(){return this.fastupdate?(me(this.map),this.depth&&me(this.ctx),this):this},e.searchCache=d,e.export=function(e,t,n=0,i=0){let s,r;switch(i){case 0:s="reg",r=pe(this.reg);break;case 1:s="cfg",r=null;break;case 2:s="map",r=he(this.map,this.reg.size);break;case 3:s="ctx",r=ue(this.ctx,this.reg.size);break;default:return}return de.call(this,e,t,s,r,n,i)},e.import=function(e,t){if(t)switch("string"==typeof t&&(t=JSON.parse(t)),e=e.split("."),"json"===e[e.length-1]&&e.pop(),3===e.length&&e.shift(),e=e.length>1?e[1]:e[0],e){case"reg":this.fastupdate=!1,this.reg=ge(t,this.reg);break;case"map":this.map=ce(t,this.map);break;case"ctx":this.ctx=fe(t,this.ctx)}},e.serialize=function(e=!0){let t="",n="",i="";if(this.reg.size){let e;for(var s of this.reg.keys())e||(e=typeof s),t+=(t?",":"")+("string"===e?'"'+s+'"':s);t="index.reg=new Set(["+t+"]);",n=ke(this.map,e),n="index.map=new Map(["+n+"]);";for(const t of this.ctx.entries()){s=t[0];let n=ke(t[1],e);n="new Map(["+n+"])",n='["'+s+'",'+n+"]",i+=(i?",":"")+n}i="index.ctx=new Map(["+i+"]);"}return e?"function inject(index){"+t+n+i+"}":t+n+i},L(Ae.prototype);const Re="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Te=["map","ctx","tag","reg","cfg"],_e=s();function Be(e,t={}){if(!this||this.constructor!==Be)return new Be(e,t);"object"==typeof e&&(t=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=t.field?t.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=t.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}function De(e,t,n){const i=e.value;let s,r=0;for(let e,l=0;l<i.length;l++){if(e=n?i:i[l]){for(let n,r,o=0;o<t.length;o++)if(r=t[o],n=e.indexOf(r),n>=0){if(s=1,!(e.length>1)){i[l]=[];break}e.splice(n,1)}r+=e.length}if(n)break}r?s&&e.update(i):e.delete(),e.continue()}function Ce(e,t){return new Promise((n,i)=>{e.onsuccess=e.oncomplete=function(){t&&t(this.result),t=null,n(this.result)},e.onerror=e.onblocked=i,e=null})}(e=Be.prototype).mount=function(e){return e.index?e.mount(this):(e.db=this,this.open())},e.open=function(){if(this.db)return this.db;let e=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),_e[e.id]||(_e[e.id]=[]),_e[e.id].push(e.field);const t=Re.open(e.id,1);return t.onupgradeneeded=function(){const t=e.db=this.result;for(let n,i=0;i<Te.length;i++){n=Te[i];for(let i,s=0;s<_e[e.id].length;s++)i=_e[e.id][s],t.objectStoreNames.contains(n+("reg"!==n&&i?":"+i:""))||t.createObjectStore(n+("reg"!==n&&i?":"+i:""))}},e.db=Ce(t,function(t){e.db=t,e.db.onversionchange=function(){e.close()}})},e.close=function(){this.db&&this.db.close(),this.db=null},e.destroy=function(){return Ce(Re.deleteDatabase(this.id))},e.clear=function(){const e=[];for(let t,n=0;n<Te.length;n++){t=Te[n];for(let n,i=0;i<_e[this.id].length;i++)n=_e[this.id][i],e.push(t+("reg"!==t&&n?":"+n:""))}const t=this.db.transaction(e,"readwrite");for(let n=0;n<e.length;n++)t.objectStore(e[n]).clear();return Ce(t)},e.get=function(e,t,n=0,i=0,s=!0,r=!1){e=this.db.transaction((t?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((t?"ctx":"map")+(this.field?":"+this.field:"")).get(t?t+":"+e:e);const l=this;return Ce(e).then(function(e){let t=[];if(!e||!e.length)return t;if(s){if(!n&&!i&&1===e.length)return e[0];for(let s,r=0;r<e.length;r++)if((s=e[r])&&s.length){if(i>=s.length){i-=s.length;continue}const e=n?i+Math.min(s.length-i,n):s.length;for(let n=i;n<e;n++)t.push(s[n]);if(i=0,t.length===n)break}return r?l.enrich(t):t}return e})},e.tag=function(e,t=0,n=0,i=!1){e=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(e);const s=this;return Ce(e).then(function(e){return!e||!e.length||n>=e.length?[]:t||n?(e=e.slice(n,n+t),i?s.enrich(e):e):e})},e.enrich=function(e){"object"!=typeof e&&(e=[e]);const t=this.db.transaction("reg","readonly").objectStore("reg"),n=[];for(let i=0;i<e.length;i++)n[i]=Ce(t.get(e[i]));return Promise.all(n).then(function(t){for(let n=0;n<t.length;n++)t[n]={id:e[n],doc:t[n]?JSON.parse(t[n]):null};return t})},e.has=function(e){return Ce(e=this.db.transaction("reg","readonly").objectStore("reg").getKey(e)).then(function(e){return!!e})},e.search=null,e.info=function(){},e.transaction=function(e,t,n){e+="reg"!==e&&this.field?":"+this.field:"";let i=this.h[e+":"+t];if(i)return n.call(this,i);let s=this.db.transaction(e,t);this.h[e+":"+t]=i=s.objectStore(e);const r=n.call(this,i);return this.h[e+":"+t]=null,Ce(s).finally(function(){return r})},e.commit=async function(e){let t=e.commit_task,n=[];e.commit_task=[];for(let e,i=0;i<t.length;i++)e=t[i],e.del&&n.push(e.del);n.length&&await this.remove(n),e.reg.size&&(await this.transaction("map","readwrite",function(t){for(const n of e.map){const e=n[0],i=n[1];i.length&&(t.get(e).onsuccess=function(){let n=this.result;var s;if(n&&n.length){const e=Math.max(n.length,i.length);for(let t,r,l=0;l<e;l++)if((r=i[l])&&r.length){if((t=n[l])&&t.length)for(s=0;s<r.length;s++)t.push(r[s]);else n[l]=r;s=1}}else n=i,s=1;s&&t.put(n,e)})}}),await this.transaction("ctx","readwrite",function(t){for(const n of e.ctx){const e=n[0],i=n[1];for(const n of i){const i=n[0],s=n[1];s.length&&(t.get(e+":"+i).onsuccess=function(){let n=this.result;var r;if(n&&n.length){const e=Math.max(n.length,s.length);for(let t,i,l=0;l<e;l++)if((i=s[l])&&i.length){if((t=n[l])&&t.length)for(r=0;r<i.length;r++)t.push(i[r]);else n[l]=i;r=1}}else n=s,r=1;r&&t.put(n,e+":"+i)})}}}),e.store?await this.transaction("reg","readwrite",function(t){for(const n of e.store){const e=n[0],i=n[1];t.put("object"==typeof i?JSON.stringify(i):1,e)}}):e.bypass||await this.transaction("reg","readwrite",function(t){for(const n of e.reg.keys())t.put(1,n)}),e.tag&&await this.transaction("tag","readwrite",function(t){for(const n of e.tag){const e=n[0],i=n[1];i.length&&(t.get(e).onsuccess=function(){let n=this.result;n=n&&n.length?n.concat(i):i,t.put(n,e)})}}),e.map.clear(),e.ctx.clear(),e.tag&&e.tag.clear(),e.store&&e.store.clear(),e.document||e.reg.clear())},e.remove=function(e){return"object"!=typeof e&&(e=[e]),Promise.all([this.transaction("map","readwrite",function(t){t.openCursor().onsuccess=function(){const t=this.result;t&&De(t,e)}}),this.transaction("ctx","readwrite",function(t){t.openCursor().onsuccess=function(){const t=this.result;t&&De(t,e)}}),this.transaction("tag","readwrite",function(t){t.openCursor().onsuccess=function(){const t=this.result;t&&De(t,e,!0)}}),this.transaction("reg","readwrite",function(t){for(let n=0;n<e.length;n++)t.delete(e[n])})])};var Pe={Document:le,IndexedDB:Be};function Ie(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var qe={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};function Le(e){qe=e}var je={exec:()=>null};function Me(e,t=""){let n="string"==typeof e?e:e.source,i={replace:(e,t)=>{let s="string"==typeof t?t:t.source;return s=s.replace(Oe.caret,"$1"),n=n.replace(e,s),i},getRegex:()=>new RegExp(n,t)};return i}var Ee=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),Oe={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/gi,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[\t ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ \t][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},Ne=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Ze=/(?:[*+-]|\d{1,9}[.)])/,Fe=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,He=Me(Fe).replace(/bull/g,Ze).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Qe=Me(Fe).replace(/bull/g,Ze).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ge=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Je=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,Ke=Me(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Je).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Ue=Me(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Ze).getRegex(),We="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Xe=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Ve=Me("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ \t]*)+\\n|$))","i").replace("comment",Xe).replace("tag",We).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ye=Me(Ge).replace("hr",Ne).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex(),et={blockquote:Me(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ye).getRegex(),code:/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,def:Ke,fences:/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,heading:/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hr:Ne,html:Ve,lheading:He,list:Ue,newline:/^(?:[ \t]*(?:\n|$))+/,paragraph:Ye,table:je,text:/^[^\n]+/},tt=Me("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Ne).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3}\t)[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex(),nt={...et,lheading:Qe,table:tt,paragraph:Me(Ge).replace("hr",Ne).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",tt).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",We).getRegex()},it={...et,html:Me("^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:\"[^\"]*\"|'[^']*'|\\s[^'\"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))").replace("comment",Xe).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:je,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:Me(Ge).replace("hr",Ne).replace("heading"," *#{1,6} *[^\n]").replace("lheading",He).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},st=/^( {2,}|\\)\n(?!\s*$)/,rt=/[\p{P}\p{S}]/u,lt=/[\s\p{P}\p{S}]/u,ot=/[^\s\p{P}\p{S}]/u,at=Me(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,lt).getRegex(),ht=/(?!~)[\p{P}\p{S}]/u,ct=Me(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Ee?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),ut=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ft=Me(ut,"u").replace(/punct/g,rt).getRegex(),pt=Me(ut,"u").replace(/punct/g,ht).getRegex(),gt="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dt=Me(gt,"gu").replace(/notPunctSpace/g,ot).replace(/punctSpace/g,lt).replace(/punct/g,rt).getRegex(),kt=Me(gt,"gu").replace(/notPunctSpace/g,/(?:[^\s\p{P}\p{S}]|~)/u).replace(/punctSpace/g,/(?!~)[\s\p{P}\p{S}]/u).replace(/punct/g,ht).getRegex(),mt=Me("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ot).replace(/punctSpace/g,lt).replace(/punct/g,rt).getRegex(),xt=Me(/\\(punct)/,"gu").replace(/punct/g,rt).getRegex(),bt=Me(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),wt=Me(Xe).replace("(?:--\x3e|$)","--\x3e").getRegex(),yt=Me("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",wt).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),vt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,St=Me(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",vt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),$t=Me(/^!?\[(label)\]\[(ref)\]/).replace("label",vt).replace("ref",Je).getRegex(),At=Me(/^!?\[(ref)\](?:\[\])?/).replace("ref",Je).getRegex(),zt=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Rt={_backpedal:je,anyPunctuation:xt,autolink:bt,blockSkip:ct,br:st,code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,del:je,emStrongLDelim:ft,emStrongRDelimAst:dt,emStrongRDelimUnd:mt,escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,link:St,nolink:At,punctuation:at,reflink:$t,reflinkSearch:Me("reflink|nolink(?!\\()","g").replace("reflink",$t).replace("nolink",At).getRegex(),tag:yt,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,url:je},Tt={...Rt,link:Me(/^!?\[(label)\]\((.*?)\)/).replace("label",vt).getRegex(),reflink:Me(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",vt).getRegex()},_t={...Rt,emStrongRDelimAst:kt,emStrongLDelim:pt,url:Me(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",zt).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:Me(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",zt).getRegex()},Bt={..._t,br:Me(st).replace("{2,}","*").getRegex(),text:Me(_t.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Dt={normal:et,gfm:nt,pedantic:it},Ct={normal:Rt,gfm:_t,breaks:Bt,pedantic:Tt},Pt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},It=e=>Pt[e];function qt(e,t){if(t){if(Oe.escapeTest.test(e))return e.replace(Oe.escapeReplace,It)}else if(Oe.escapeTestNoEncode.test(e))return e.replace(Oe.escapeReplaceNoEncode,It);return e}function Lt(e){try{e=encodeURI(e).replace(Oe.percentDecode,"%")}catch{return null}return e}function jt(e,t){let n=e.replace(Oe.findPipe,(e,t,n)=>{let i=!1,s=t;for(;--s>=0&&"\\"===n[s];)i=!i;return i?"|":" |"}).split(Oe.splitPipe),i=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),t)if(n.length>t)n.splice(t);else for(;n.length<t;)n.push("");for(;i<n.length;i++)n[i]=n[i].trim().replace(Oe.slashPipe,"|");return n}function Mt(e,t,n){let i=e.length;if(0===i)return"";let s=0;for(;s<i;){if(e.charAt(i-s-1)!==t)break;s++}return e.slice(0,i-s)}function Et(e,t,n,i,s){let r=t.href,l=t.title||null,o=e[1].replace(s.other.outputLinkReplace,"$1");i.state.inLink=!0;let a={type:"!"===e[0].charAt(0)?"image":"link",raw:n,href:r,title:l,text:o,tokens:i.inlineTokens(o)};return i.state.inLink=!1,a}var Ot=class{options;rules;lexer;constructor(e){this.options=e||qe}space(e){let t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){let t=this.rules.block.code.exec(e);if(t){let e=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?e:Mt(e,"\n")}}}fences(e){let t=this.rules.block.fences.exec(e);if(t){let e=t[0],n=function(e,t,n){let i=e.match(n.other.indentCodeCompensation);if(null===i)return t;let s=i[1];return t.split("\n").map(e=>{let t=e.match(n.other.beginningSpace);if(null===t)return e;let[i]=t;return i.length>=s.length?e.slice(s.length):e}).join("\n")}(e,t[3]||"",this.rules);return{type:"code",raw:e,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:n}}}heading(e){let t=this.rules.block.heading.exec(e);if(t){let e=t[2].trim();if(this.rules.other.endingHash.test(e)){let t=Mt(e,"#");(this.options.pedantic||!t||this.rules.other.endingSpaceChar.test(t))&&(e=t.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:e,tokens:this.lexer.inline(e)}}}hr(e){let t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:Mt(t[0],"\n")}}blockquote(e){let t=this.rules.block.blockquote.exec(e);if(t){let e=Mt(t[0],"\n").split("\n"),n="",i="",s=[];for(;e.length>0;){let t,r=!1,l=[];for(t=0;t<e.length;t++)if(this.rules.other.blockquoteStart.test(e[t]))l.push(e[t]),r=!0;else{if(r)break;l.push(e[t])}e=e.slice(t);let o=l.join("\n"),a=o.replace(this.rules.other.blockquoteSetextReplace,"\n $1").replace(this.rules.other.blockquoteSetextReplace2,"");n=n?`${n}\n${o}`:o,i=i?`${i}\n${a}`:a;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(a,s,!0),this.lexer.state.top=h,0===e.length)break;let c=s.at(-1);if("code"===c?.type)break;if("blockquote"===c?.type){let t=c,r=t.raw+"\n"+e.join("\n"),l=this.blockquote(r);s[s.length-1]=l,n=n.substring(0,n.length-t.raw.length)+l.raw,i=i.substring(0,i.length-t.text.length)+l.text;break}if("list"===c?.type){let t=c,r=t.raw+"\n"+e.join("\n"),l=this.list(r);s[s.length-1]=l,n=n.substring(0,n.length-c.raw.length)+l.raw,i=i.substring(0,i.length-t.raw.length)+l.raw,e=r.substring(s.at(-1).raw.length).split("\n");continue}}return{type:"blockquote",raw:n,tokens:s,text:i}}}list(e){let t=this.rules.block.list.exec(e);if(t){let n=t[1].trim(),i=n.length>1,s={type:"list",raw:"",ordered:i,start:i?+n.slice(0,-1):"",loose:!1,items:[]};n=i?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=i?n:"[*+-]");let r=this.rules.other.listItemRegex(n),l=!1;for(;e;){let n=!1,i="",o="";if(!(t=r.exec(e))||this.rules.block.hr.test(e))break;i=t[0],e=e.substring(i.length);let a=t[2].split("\n",1)[0].replace(this.rules.other.listReplaceTabs,e=>" ".repeat(3*e.length)),h=e.split("\n",1)[0],c=!a.trim(),u=0;if(this.options.pedantic?(u=2,o=a.trimStart()):c?u=t[1].length+1:(u=t[2].search(this.rules.other.nonSpaceChar),u=u>4?1:u,o=a.slice(u),u+=t[1].length),c&&this.rules.other.blankLine.test(h)&&(i+=h+"\n",e=e.substring(h.length+1),n=!0),!n){let t=this.rules.other.nextBulletRegex(u),n=this.rules.other.hrRegex(u),s=this.rules.other.fencesBeginRegex(u),r=this.rules.other.headingBeginRegex(u),l=this.rules.other.htmlBeginRegex(u);for(;e;){let f,p=e.split("\n",1)[0];if(h=p,this.options.pedantic?(h=h.replace(this.rules.other.listReplaceNesting," "),f=h):f=h.replace(this.rules.other.tabCharGlobal," "),s.test(h)||r.test(h)||l.test(h)||t.test(h)||n.test(h))break;if(f.search(this.rules.other.nonSpaceChar)>=u||!h.trim())o+="\n"+f.slice(u);else{if(c||a.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||s.test(a)||r.test(a)||n.test(a))break;o+="\n"+h}!c&&!h.trim()&&(c=!0),i+=p+"\n",e=e.substring(p.length+1),a=f.slice(u)}}s.loose||(l?s.loose=!0:this.rules.other.doubleBlankLine.test(i)&&(l=!0)),s.items.push({type:"list_item",raw:i,task:!!this.options.gfm&&this.rules.other.listIsTask.test(o),loose:!1,text:o,tokens:[]}),s.raw+=i}let o=s.items.at(-1);if(!o)return;o.raw=o.raw.trimEnd(),o.text=o.text.trimEnd(),s.raw=s.raw.trimEnd();for(let e of s.items){if(this.lexer.state.top=!1,e.tokens=this.lexer.blockTokens(e.text,[]),e.task){if(e.text=e.text.replace(this.rules.other.listReplaceTask,""),"text"===e.tokens[0]?.type||"paragraph"===e.tokens[0]?.type){e.tokens[0].raw=e.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),e.tokens[0].text=e.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let e=this.lexer.inlineQueue.length-1;e>=0;e--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[e].src)){this.lexer.inlineQueue[e].src=this.lexer.inlineQueue[e].src.replace(this.rules.other.listReplaceTask,"");break}}let t=this.rules.other.listTaskCheckbox.exec(e.raw);if(t){let n={type:"checkbox",raw:t[0]+" ",checked:"[ ]"!==t[0]};e.checked=n.checked,s.loose?e.tokens[0]&&["paragraph","text"].includes(e.tokens[0].type)&&"tokens"in e.tokens[0]&&e.tokens[0].tokens?(e.tokens[0].raw=n.raw+e.tokens[0].raw,e.tokens[0].text=n.raw+e.tokens[0].text,e.tokens[0].tokens.unshift(n)):e.tokens.unshift({type:"paragraph",raw:n.raw,text:n.raw,tokens:[n]}):e.tokens.unshift(n)}}if(!s.loose){let t=e.tokens.filter(e=>"space"===e.type),n=t.length>0&&t.some(e=>this.rules.other.anyLine.test(e.raw));s.loose=n}}if(s.loose)for(let e of s.items){e.loose=!0;for(let t of e.tokens)"text"===t.type&&(t.type="paragraph")}return s}}html(e){let t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:"pre"===t[1]||"script"===t[1]||"style"===t[1],text:t[0]}}def(e){let t=this.rules.block.def.exec(e);if(t){let e=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),n=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:e,raw:t[0],href:n,title:i}}}table(e){let t=this.rules.block.table.exec(e);if(!t||!this.rules.other.tableDelimiter.test(t[2]))return;let n=jt(t[1]),i=t[2].replace(this.rules.other.tableAlignChars,"").split("|"),s=t[3]?.trim()?t[3].replace(this.rules.other.tableRowBlankLine,"").split("\n"):[],r={type:"table",raw:t[0],header:[],align:[],rows:[]};if(n.length===i.length){for(let e of i)this.rules.other.tableAlignRight.test(e)?r.align.push("right"):this.rules.other.tableAlignCenter.test(e)?r.align.push("center"):this.rules.other.tableAlignLeft.test(e)?r.align.push("left"):r.align.push(null);for(let e=0;e<n.length;e++)r.header.push({text:n[e],tokens:this.lexer.inline(n[e]),header:!0,align:r.align[e]});for(let e of s)r.rows.push(jt(e,r.header.length).map((e,t)=>({text:e,tokens:this.lexer.inline(e),header:!1,align:r.align[t]})));return r}}lheading(e){let t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:"="===t[2].charAt(0)?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){let t=this.rules.block.paragraph.exec(e);if(t){let e="\n"===t[1].charAt(t[1].length-1)?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:e,tokens:this.lexer.inline(e)}}}text(e){let t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){let t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){let t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){let t=this.rules.inline.link.exec(e);if(t){let e=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(e)){if(!this.rules.other.endAngleBracket.test(e))return;let t=Mt(e.slice(0,-1),"\\");if((e.length-t.length)%2==0)return}else{let e=function(e,t){if(-1===e.indexOf(t[1]))return-1;let n=0;for(let i=0;i<e.length;i++)if("\\"===e[i])i++;else if(e[i]===t[0])n++;else if(e[i]===t[1]&&(n--,n<0))return i;return n>0?-2:-1}(t[2],"()");if(-2===e)return;if(e>-1){let n=(0===t[0].indexOf("!")?5:4)+t[1].length+e;t[2]=t[2].substring(0,e),t[0]=t[0].substring(0,n).trim(),t[3]=""}}let n=t[2],i="";if(this.options.pedantic){let e=this.rules.other.pedanticHrefTitle.exec(n);e&&(n=e[1],i=e[3])}else i=t[3]?t[3].slice(1,-1):"";return n=n.trim(),this.rules.other.startAngleBracket.test(n)&&(n=this.options.pedantic&&!this.rules.other.endAngleBracket.test(e)?n.slice(1):n.slice(1,-1)),Et(t,{href:n&&n.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let n;if((n=this.rules.inline.reflink.exec(e))||(n=this.rules.inline.nolink.exec(e))){let e=t[(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," ").toLowerCase()];if(!e){let e=n[0].charAt(0);return{type:"text",raw:e,text:e}}return Et(n,e,n[0],this.lexer,this.rules)}}emStrong(e,t,n=""){let i=this.rules.inline.emStrongLDelim.exec(e);if(!(!i||i[3]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!i[1]&&!i[2]||!n||this.rules.inline.punctuation.exec(n))){let n,s,r=[...i[0]].length-1,l=r,o=0,a="*"===i[0][0]?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(a.lastIndex=0,t=t.slice(-1*e.length+r);null!=(i=a.exec(t));){if(n=i[1]||i[2]||i[3]||i[4]||i[5]||i[6],!n)continue;if(s=[...n].length,i[3]||i[4]){l+=s;continue}if((i[5]||i[6])&&r%3&&!((r+s)%3)){o+=s;continue}if(l-=s,l>0)continue;s=Math.min(s,s+l+o);let t=[...i[0]][0].length,a=e.slice(0,r+i.index+t+s);if(Math.min(r,s)%2){let e=a.slice(1,-1);return{type:"em",raw:a,text:e,tokens:this.lexer.inlineTokens(e)}}let h=a.slice(2,-2);return{type:"strong",raw:a,text:h,tokens:this.lexer.inlineTokens(h)}}}}codespan(e){let t=this.rules.inline.code.exec(e);if(t){let e=t[2].replace(this.rules.other.newLineCharGlobal," "),n=this.rules.other.nonSpaceChar.test(e),i=this.rules.other.startingSpaceChar.test(e)&&this.rules.other.endingSpaceChar.test(e);return n&&i&&(e=e.substring(1,e.length-1)),{type:"codespan",raw:t[0],text:e}}}br(e){let t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){let t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){let t=this.rules.inline.autolink.exec(e);if(t){let e,n;return"@"===t[2]?(e=t[1],n="mailto:"+e):(e=t[1],n=e),{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}url(e){let t;if(t=this.rules.inline.url.exec(e)){let e,n;if("@"===t[2])e=t[0],n="mailto:"+e;else{let i;do{i=t[0],t[0]=this.rules.inline._backpedal.exec(t[0])?.[0]??""}while(i!==t[0]);e=t[0],n="www."===t[1]?"http://"+t[0]:t[0]}return{type:"link",raw:t[0],text:e,href:n,tokens:[{type:"text",raw:e,text:e}]}}}inlineText(e){let t=this.rules.inline.text.exec(e);if(t){let e=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:e}}}},Nt=class e{tokens;options;state;inlineQueue;tokenizer;constructor(e){this.tokens=[],this.tokens.links=Object.create(null),this.options=e||qe,this.options.tokenizer=this.options.tokenizer||new Ot,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let t={other:Oe,block:Dt.normal,inline:Ct.normal};this.options.pedantic?(t.block=Dt.pedantic,t.inline=Ct.pedantic):this.options.gfm&&(t.block=Dt.gfm,this.options.breaks?t.inline=Ct.breaks:t.inline=Ct.gfm),this.tokenizer.rules=t}static get rules(){return{block:Dt,inline:Ct}}static lex(t,n){return new e(n).lex(t)}static lexInline(t,n){return new e(n).inlineTokens(t)}lex(e){e=e.replace(Oe.carriageReturn,"\n"),this.blockTokens(e,this.tokens);for(let e=0;e<this.inlineQueue.length;e++){let t=this.inlineQueue[e];this.inlineTokens(t.src,t.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],n=!1){for(this.options.pedantic&&(e=e.replace(Oe.tabCharGlobal," ").replace(Oe.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(n=>!!(i=n.call({lexer:this},e,t))&&(e=e.substring(i.raw.length),t.push(i),!0)))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let n=t.at(-1);1===i.raw.length&&void 0!==n?n.raw+="\n":t.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.text,this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let n=t.at(-1);"paragraph"===n?.type||"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.raw,this.inlineQueue.at(-1).src=n.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},t.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),t.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),t.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let t,n=1/0,i=e.slice(1);this.options.extensions.startBlock.forEach(e=>{t=e.call({lexer:this},i),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let r=t.at(-1);n&&"paragraph"===r?.type?(r.raw+=(r.raw.endsWith("\n")?"":"\n")+i.raw,r.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=r.text):t.push(i),n=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let n=t.at(-1);"text"===n?.type?(n.raw+=(n.raw.endsWith("\n")?"":"\n")+i.raw,n.text+="\n"+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=n.text):t.push(i);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){let n,i=e,s=null;if(this.tokens.links){let e=Object.keys(this.tokens.links);if(e.length>0)for(;null!=(s=this.tokenizer.rules.inline.reflinkSearch.exec(i));)e.includes(s[0].slice(s[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,s.index)+"["+"a".repeat(s[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;null!=(s=this.tokenizer.rules.inline.anyPunctuation.exec(i));)i=i.slice(0,s.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);for(;null!=(s=this.tokenizer.rules.inline.blockSkip.exec(i));)n=s[2]?s[2].length:0,i=i.slice(0,s.index+n)+"["+"a".repeat(s[0].length-n-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);i=this.options.hooks?.emStrongMask?.call({lexer:this},i)??i;let r=!1,l="";for(;e;){let n;if(r||(l=""),r=!1,this.options.extensions?.inline?.some(i=>!!(n=i.call({lexer:this},e,t))&&(e=e.substring(n.raw.length),t.push(n),!0)))continue;if(n=this.tokenizer.escape(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.tag(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.link(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(n.raw.length);let i=t.at(-1);"text"===n.type&&"text"===i?.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(n=this.tokenizer.emStrong(e,i,l)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.codespan(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.br(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.del(e)){e=e.substring(n.raw.length),t.push(n);continue}if(n=this.tokenizer.autolink(e)){e=e.substring(n.raw.length),t.push(n);continue}if(!this.state.inLink&&(n=this.tokenizer.url(e))){e=e.substring(n.raw.length),t.push(n);continue}let s=e;if(this.options.extensions?.startInline){let t,n=1/0,i=e.slice(1);this.options.extensions.startInline.forEach(e=>{t=e.call({lexer:this},i),"number"==typeof t&&t>=0&&(n=Math.min(n,t))}),n<1/0&&n>=0&&(s=e.substring(0,n+1))}if(n=this.tokenizer.inlineText(s)){e=e.substring(n.raw.length),"_"!==n.raw.slice(-1)&&(l=n.raw.slice(-1)),r=!0;let i=t.at(-1);"text"===i?.type?(i.raw+=n.raw,i.text+=n.text):t.push(n);continue}if(e){let t="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(t);break}throw new Error(t)}}return t}},Zt=class{options;parser;constructor(e){this.options=e||qe}space(e){return""}code({text:e,lang:t,escaped:n}){let i=(t||"").match(Oe.notSpaceStart)?.[0],s=e.replace(Oe.endingNewline,"")+"\n";return i?'<pre><code class="language-'+qt(i)+'">'+(n?s:qt(s,!0))+"</code></pre>\n":"<pre><code>"+(n?s:qt(s,!0))+"</code></pre>\n"}blockquote({tokens:e}){return`<blockquote>\n${this.parser.parse(e)}</blockquote>\n`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>\n`}hr(e){return"<hr>\n"}list(e){let t=e.ordered,n=e.start,i="";for(let t=0;t<e.items.length;t++){let n=e.items[t];i+=this.listitem(n)}let s=t?"ol":"ul";return"<"+s+(t&&1!==n?' start="'+n+'"':"")+">\n"+i+"</"+s+">\n"}listitem(e){return`<li>${this.parser.parse(e.tokens)}</li>\n`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>\n`}table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell(e.header[t]);t+=this.tablerow({text:n});let i="";for(let t=0;t<e.rows.length;t++){let s=e.rows[t];n="";for(let e=0;e<s.length;e++)n+=this.tablecell(s[e]);i+=this.tablerow({text:n})}return i&&(i=`<tbody>${i}</tbody>`),"<table>\n<thead>\n"+t+"</thead>\n"+i+"</table>\n"}tablerow({text:e}){return`<tr>\n${e}</tr>\n`}tablecell(e){let t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>\n`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${qt(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let i=this.parser.parseInline(n),s=Lt(e);if(null===s)return i;let r='<a href="'+(e=s)+'"';return t&&(r+=' title="'+qt(t)+'"'),r+=">"+i+"</a>",r}image({href:e,title:t,text:n,tokens:i}){i&&(n=this.parser.parseInline(i,this.parser.textRenderer));let s=Lt(e);if(null===s)return qt(n);let r=`<img src="${e=s}" alt="${n}"`;return t&&(r+=` title="${qt(t)}"`),r+=">",r}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:qt(e.text)}},Ft=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}checkbox({raw:e}){return e}},Ht=class e{options;renderer;textRenderer;constructor(e){this.options=e||qe,this.options.renderer=this.options.renderer||new Zt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Ft}static parse(t,n){return new e(n).parse(t)}static parseInline(t,n){return new e(n).parseInline(t)}parse(e){let t="";for(let n=0;n<e.length;n++){let i=e[n];if(this.options.extensions?.renderers?.[i.type]){let e=i,n=this.options.extensions.renderers[e.type].call({parser:this},e);if(!1!==n||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(e.type)){t+=n||"";continue}}let s=i;switch(s.type){case"space":t+=this.renderer.space(s);break;case"hr":t+=this.renderer.hr(s);break;case"heading":t+=this.renderer.heading(s);break;case"code":t+=this.renderer.code(s);break;case"table":t+=this.renderer.table(s);break;case"blockquote":t+=this.renderer.blockquote(s);break;case"list":t+=this.renderer.list(s);break;case"checkbox":t+=this.renderer.checkbox(s);break;case"html":t+=this.renderer.html(s);break;case"def":t+=this.renderer.def(s);break;case"paragraph":t+=this.renderer.paragraph(s);break;case"text":t+=this.renderer.text(s);break;default:{let e='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return t}parseInline(e,t=this.renderer){let n="";for(let i=0;i<e.length;i++){let s=e[i];if(this.options.extensions?.renderers?.[s.type]){let e=this.options.extensions.renderers[s.type].call({parser:this},s);if(!1!==e||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){n+=e||"";continue}}let r=s;switch(r.type){case"escape":case"text":n+=t.text(r);break;case"html":n+=t.html(r);break;case"link":n+=t.link(r);break;case"image":n+=t.image(r);break;case"checkbox":n+=t.checkbox(r);break;case"strong":n+=t.strong(r);break;case"em":n+=t.em(r);break;case"codespan":n+=t.codespan(r);break;case"br":n+=t.br(r);break;case"del":n+=t.del(r);break;default:{let e='Token with "'+r.type+'" type was not found.';if(this.options.silent)return console.error(e),"";throw new Error(e)}}}return n}},Qt=class{options;block;constructor(e){this.options=e||qe}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Nt.lex:Nt.lexInline}provideParser(){return this.block?Ht.parse:Ht.parseInline}},Gt=new class{defaults={async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null};options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Ht;Renderer=Zt;TextRenderer=Ft;Lexer=Nt;Tokenizer=Ot;Hooks=Qt;constructor(...e){this.use(...e)}walkTokens(e,t){let n=[];for(let i of e)switch(n=n.concat(t.call(this,i)),i.type){case"table":{let e=i;for(let i of e.header)n=n.concat(this.walkTokens(i.tokens,t));for(let i of e.rows)for(let e of i)n=n.concat(this.walkTokens(e.tokens,t));break}case"list":{let e=i;n=n.concat(this.walkTokens(e.items,t));break}default:{let e=i;this.defaults.extensions?.childTokens?.[e.type]?this.defaults.extensions.childTokens[e.type].forEach(i=>{let s=e[i].flat(1/0);n=n.concat(this.walkTokens(s,t))}):e.tokens&&(n=n.concat(this.walkTokens(e.tokens,t)))}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(e=>{let n={...e};if(n.async=this.defaults.async||n.async||!1,e.extensions&&(e.extensions.forEach(e=>{if(!e.name)throw new Error("extension name required");if("renderer"in e){let n=t.renderers[e.name];t.renderers[e.name]=n?function(...t){let i=e.renderer.apply(this,t);return!1===i&&(i=n.apply(this,t)),i}:e.renderer}if("tokenizer"in e){if(!e.level||"block"!==e.level&&"inline"!==e.level)throw new Error("extension level must be 'block' or 'inline'");let n=t[e.level];n?n.unshift(e.tokenizer):t[e.level]=[e.tokenizer],e.start&&("block"===e.level?t.startBlock?t.startBlock.push(e.start):t.startBlock=[e.start]:"inline"===e.level&&(t.startInline?t.startInline.push(e.start):t.startInline=[e.start]))}"childTokens"in e&&e.childTokens&&(t.childTokens[e.name]=e.childTokens)}),n.extensions=t),e.renderer){let t=this.defaults.renderer||new Zt(this.defaults);for(let n in e.renderer){if(!(n in t))throw new Error(`renderer '${n}' does not exist`);if(["options","parser"].includes(n))continue;let i=n,s=e.renderer[i],r=t[i];t[i]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=r.apply(t,e)),n||""}}n.renderer=t}if(e.tokenizer){let t=this.defaults.tokenizer||new Ot(this.defaults);for(let n in e.tokenizer){if(!(n in t))throw new Error(`tokenizer '${n}' does not exist`);if(["options","rules","lexer"].includes(n))continue;let i=n,s=e.tokenizer[i],r=t[i];t[i]=(...e)=>{let n=s.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.tokenizer=t}if(e.hooks){let t=this.defaults.hooks||new Qt;for(let n in e.hooks){if(!(n in t))throw new Error(`hook '${n}' does not exist`);if(["options","block"].includes(n))continue;let i=n,s=e.hooks[i],r=t[i];Qt.passThroughHooks.has(n)?t[i]=e=>{if(this.defaults.async&&Qt.passThroughHooksRespectAsync.has(n))return(async()=>{let n=await s.call(t,e);return r.call(t,n)})();let i=s.call(t,e);return r.call(t,i)}:t[i]=(...e)=>{if(this.defaults.async)return(async()=>{let n=await s.apply(t,e);return!1===n&&(n=await r.apply(t,e)),n})();let n=s.apply(t,e);return!1===n&&(n=r.apply(t,e)),n}}n.hooks=t}if(e.walkTokens){let t=this.defaults.walkTokens,i=e.walkTokens;n.walkTokens=function(e){let n=[];return n.push(i.call(this,e)),t&&(n=n.concat(t.call(this,e))),n}}this.defaults={...this.defaults,...n}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return Nt.lex(e,t??this.defaults)}parser(e,t){return Ht.parse(e,t??this.defaults)}parseMarkdown(e){return(t,n)=>{let i={...n},s={...this.defaults,...i},r=this.onError(!!s.silent,!!s.async);if(!0===this.defaults.async&&!1===i.async)return r(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||null===t)return r(new Error("marked(): input parameter is undefined or null"));if("string"!=typeof t)return r(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return(async()=>{let n=s.hooks?await s.hooks.preprocess(t):t,i=await(s.hooks?await s.hooks.provideLexer():e?Nt.lex:Nt.lexInline)(n,s),r=s.hooks?await s.hooks.processAllTokens(i):i;s.walkTokens&&await Promise.all(this.walkTokens(r,s.walkTokens));let l=await(s.hooks?await s.hooks.provideParser():e?Ht.parse:Ht.parseInline)(r,s);return s.hooks?await s.hooks.postprocess(l):l})().catch(r);try{s.hooks&&(t=s.hooks.preprocess(t));let n=(s.hooks?s.hooks.provideLexer():e?Nt.lex:Nt.lexInline)(t,s);s.hooks&&(n=s.hooks.processAllTokens(n)),s.walkTokens&&this.walkTokens(n,s.walkTokens);let i=(s.hooks?s.hooks.provideParser():e?Ht.parse:Ht.parseInline)(n,s);return s.hooks&&(i=s.hooks.postprocess(i)),i}catch(e){return r(e)}}}onError(e,t){return n=>{if(n.message+="\nPlease report this to https://github.com/markedjs/marked.",e){let e="<p>An error occurred:</p><pre>"+qt(n.message+"",!0)+"</pre>";return t?Promise.resolve(e):e}if(t)return Promise.reject(n);throw n}}};function Jt(e,t){return Gt.parse(e,t)}Jt.options=Jt.setOptions=function(e){return Gt.setOptions(e),Jt.defaults=Gt.defaults,Le(Jt.defaults),Jt},Jt.getDefaults=Ie,Jt.defaults=qe,Jt.use=function(...e){return Gt.use(...e),Jt.defaults=Gt.defaults,Le(Jt.defaults),Jt},Jt.walkTokens=function(e,t){return Gt.walkTokens(e,t)},Jt.parseInline=Gt.parseInline,Jt.Parser=Ht,Jt.parser=Ht.parse,Jt.Renderer=Zt,Jt.TextRenderer=Ft,Jt.Lexer=Nt,Jt.lexer=Nt.lex,Jt.Tokenizer=Ot,Jt.Hooks=Qt,Jt.parse=Jt,Jt.options,Jt.setOptions,Jt.use,Jt.walkTokens,Jt.parseInline,Ht.parse,Nt.lex;const Kt=/&(?:amp|lt|gt|quot|#(0+)?39);/g,Ut=RegExp(Kt.source),Wt={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"};const Xt=/[&<>"']/g,Vt=RegExp(Xt.source),Yt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};const en={space:()=>"",code({text:e}){const t=e.replace(/\n$/,"");return(n=t)&&Vt.test(n)?n.replace(Xt,e=>Yt[e]):n||"";var n},blockquote({tokens:e}){return this.parser?.parse(e)||""},html:()=>"",heading({tokens:e}){return this.parser?.parseInline(e)||""},hr:()=>"",list(e){let t="";for(let n=0;n<e.items.length;n++){const i=e.items[n];t+=this.listitem?.(i)}return t},listitem(e){let t="";if(e.task){const n=this.checkbox?.({checked:!!e.checked});e.loose?e.tokens.length>0&&"paragraph"===e.tokens[0].type?(e.tokens[0].text=n+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&"text"===e.tokens[0].tokens[0].type&&(e.tokens[0].tokens[0].text=n+" "+e.tokens[0].tokens[0].text)):e.tokens.unshift({type:"text",raw:n+" ",text:n+" "}):t+=n+" "}return t+=this.parser?.parse(e.tokens,!!e.loose),`${t||""}`},checkbox:e=>"",paragraph({tokens:e}){return this.parser?.parseInline(e)||""},table(e){let t="",n="";for(let t=0;t<e.header.length;t++)n+=this.tablecell?.(e.header[t]);t+=this.tablerow?.({text:n});let i="";for(let t=0;t<e.rows.length;t++){const s=e.rows[t];n="";for(let e=0;e<s.length;e++)n+=this.tablecell?.(s[e]);i+=this.tablerow?.({text:n})}return t+" "+i},tablerow:({text:e})=>e,tablecell(e){return this.parser?.parseInline(e.tokens)||""},strong:({text:e})=>e,em({tokens:e}){return this.parser?.parseInline(e)||""},codespan:({text:e})=>e,br:()=>" ",del({tokens:e}){return this.parser?.parseInline(e)},link({tokens:e,href:t,title:n}){return`${this.parser?.parseInline(e)||""} ${t||""} ${n||""}`},image:({title:e,text:t,href:n})=>`${t||""} ${n||""} ${e||""}`,text(e){return e.tokens?this.parser?.parseInline(e.tokens)||"":e.text||""}},tn=Jt.setOptions({renderer:en});function nn(e){const t=tn.parse(e);var n;return function(e){return e&&e.replace("!>","").replace("?>","")}((n=t)&&Ut.test(n)?n.replace(Kt,e=>Wt[e]||"'"):n||"").trim()}let sn={key:null,index:null,mounted:null,building:null,uiReady:!1,noDataText:""};const rn={placeholder:"Type to search",noData:"No Results!",paths:"auto",depth:2,maxAge:864e5,namespace:void 0,pathNamespaces:void 0,keyBindings:["/","meta+k","ctrl+k"],insertAfter:void 0,insertBefore:void 0,limit:30,mode:"sidebar"};function ln(e){const t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};return String(e).replace(/[&<>"']/g,e=>t[e])}function on(e){return e&&e.normalize?e.normalize("NFD").replace(/[\u0300-\u036f]/g,""):e||""}function an(e,t,n=120){const i=on(e||""),s=function(e){const t=(e||"").trim();if(!t)return[];let n=t.split(/[\s\-,\\/]+/).filter(Boolean);return 1!==n.length&&(n=[t,...n]),n}(t).map(e=>on(e)),r=s.find(e=>e&&i.toLowerCase().includes(e.toLowerCase()));if(!r){return ln(i.slice(0,n))}const l=i.toLowerCase().indexOf(r.toLowerCase()),o=Math.max(0,l-30),a=Math.min(i.length,l+r.length+80),h=ln(i.slice(o,a)),c=ln(r),u=new RegExp(String(c).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&"),"ig");return(o>0?"…":"")+h.replace(u,e=>`<mark>${e}</mark>`)+(a<i.length?"…":"")}function hn(e,t="",n,i){const s=window.marked.lexer(t),r=window.Docsify.slugify,l={};let o,a="";return s.forEach((t,s)=>{if("heading"===t.type&&t.depth<=i){const{str:i,config:s}=function(e=""){const t={};return e&&(e=e.replace(/^('|")/,"").replace(/('|")$/,"").replace(/(?:^|\s):([\w-]+:?)=?([\w-%]+)?/g,(e,n,i)=>-1!==n.indexOf(":")?e:(!0!==(i=i&&i.replace(/&quot;/g,"")||!0)&&void 0!==t[n]?(Array.isArray(t[n])||i===t[n]||(t[n]=[t[n]]),t[n].includes(i)||t[n].push(i)):t[n]=i,"")).trim()),{str:e,config:t}}(t.text);o=n.toURL(e,{id:r(s.id||t.text)}),i&&(a=function(e=""){let t,n;return/<!-- {docsify-ignore} -->/g.test(e)&&(e=e.replace("\x3c!-- {docsify-ignore} --\x3e",""),n=!0),/{docsify-ignore}/g.test(e)&&(e=e.replace("{docsify-ignore}",""),n=!0),/<!-- {docsify-ignore-all} -->/g.test(e)&&(e=e.replace("\x3c!-- {docsify-ignore-all} --\x3e",""),t=!0),/{docsify-ignore-all}/g.test(e)&&(e=e.replace("{docsify-ignore-all}",""),t=!0),{content:e,ignoreAllSubs:t,ignoreSubHeading:n}}(i).content,a=function(e=""){return e.replace(/(<\/?a.*?>)/gi,"")}(a.trim())),l[o]={id:o,slug:o,title:a,body:"",path:e}}else{if(0===s&&(o=n.toURL(e),l[o]={id:o,slug:o,title:"/"!==e?e.slice(1):"Home Page",body:nn(t.text||""),path:e}),!o)return;l[o]||(l[o]={id:o,slug:o,title:"",body:"",path:e}),t.text=function(e){return e.text||"table"!==e.type||(e.rows.unshift(e.header),e.text=e.rows.map(e=>e.map(e=>e.text).join(" | ")).join(" |\n ")),e.text}(t),t.text=function(e){return e.text||"list"!==e.type||(e.text=e.raw),e.text}(t);const i=nn(t.text||"");if(!i)return;l[o].body?l[o].body+="\n"+i:l[o].body=i}}),r.clear(),l}function cn(e){return e.replace(/[^a-zA-Z0-9._-]+/g,"_")}function un(e,t=""){const n=`\n\t\t<div class="input-wrap">\n\t\t\t<input type="search" value="${t}" required aria-keyshortcuts="/ control+k meta+k" />\n\t\t\t<button class="clear-button" title="Clear search">\n\t\t\t\t<span class="visually-hidden">Clear search</span>\n\t\t\t</button>\n\t\t\t<div class="kbd-group">\n\t\t\t\t<kbd title="Press / to search">/</kbd>\n\t\t\t\t<kbd title="Press Control+K to search">⌃K</kbd>\n\t\t\t</div>\n\t\t</div>\n\t\t<p class="results-status" aria-live="polite"></p>\n\t\t<div class="results-panel"></div>\n\t`,i=Docsify.dom.create("section",n);return i.classList.add("flexsearch-search"),i.setAttribute("role","search"),i}function fn(){const e=Docsify.dom.getNode(".flexsearch-modal");if(!e)return;e.classList.add("is-open");const t=e.querySelector('.flexsearch-search input[type="search"]');setTimeout(()=>t?.focus(),0)}function pn(){const e=Docsify.dom.getNode(".flexsearch-modal");e&&e.classList.remove("is-open")}function gn(e,t){const n="string"==typeof e?e:e[Object.keys(e).filter(e=>t.indexOf(e)>-1)[0]],i=Docsify.dom.getNode('.flexsearch-search input[type="search"]');i&&(i.placeholder=n);const s=Docsify.dom.getNode('.flexsearch-trigger input[type="search"]');s&&(s.placeholder=n)}function dn(e,t){if("string"==typeof e)sn.noDataText=e;else{const n=Object.keys(e).filter(e=>t.indexOf(e)>-1)[0];sn.noDataText=e[n]}}function kn(e){if(sn.uiReady)return;if(Docsify.dom.getNode(".flexsearch-search"))return void(sn.uiReady=!0);const t=e.router.parse().query.s||"";"modal"===rn.mode?(function(e,t){if(Docsify.dom.getNode(".flexsearch-modal"))return;const n=document.createElement("div");n.className="flexsearch-modal",n.innerHTML='\n\t\t<div class="flexsearch-modal__backdrop" aria-hidden="true"></div>\n\t\t<div class="flexsearch-modal__dialog" role="dialog" aria-modal="true"></div>\n\t',n.querySelector(".flexsearch-modal__dialog").appendChild(un(0,t)),document.body.appendChild(n),Docsify.dom.on(n.querySelector(".flexsearch-modal__backdrop"),"click",()=>pn()),Docsify.dom.on(n,"keydown",e=>{"Escape"===e.key&&(e.preventDefault(),pn())}),mn(e)}(e,ln(t)),function(e,t){const n=Docsify.dom.find(".sidebar");if(!n)return;if(Docsify.dom.getNode(".flexsearch-trigger"))return;const{insertAfter:i,insertBefore:s}=e.config?.search||{},r=`\n\t\t<div class="input-wrap">\n\t\t\t<input type="search" value="${t}" readonly aria-haspopup="dialog" aria-keyshortcuts="/ control+k meta+k" />\n\t\t\t<div class="kbd-group">\n\t\t\t\t<kbd title="Press / to search">/</kbd>\n\t\t\t\t<kbd title="Press Control+K to search">⌃K</kbd>\n\t\t\t</div>\n\t\t</div>\n\t`,l=Docsify.dom.create("section",r);l.classList.add("flexsearch-trigger");const o=n.querySelector(`:scope ${i||s||"> :first-child"}`);n.insertBefore(l,i?o.nextSibling:o);const a=l.querySelector('input[type="search"]');Docsify.dom.on(l,"click",e=>e.stopPropagation());const h=()=>{kn(e),fn()};Docsify.dom.on(a,"focus",h),Docsify.dom.on(a,"click",h)}(e,"")):function(e,t){const n=Docsify.dom.find(".sidebar");if(!n)return;const{insertAfter:i,insertBefore:s}=e.config?.search||{},r=un(0,t),l=n.querySelector(`:scope ${i||s||"> :first-child"}`);n.insertBefore(r,i?l.nextSibling:l),mn(e)}(e,ln(t)),sn.uiReady=!0,t&&setTimeout(()=>{"modal"===rn.mode&&fn(),vn(e,t)},500)}function mn(e){const t=Docsify.dom.find(".flexsearch-search"),n=Docsify.dom.find(t,"input"),i=Docsify.dom.find(t,".clear-button");let s;Docsify.dom.on(t,"click",e=>-1===["A","H2","P","EM"].indexOf(e.target.tagName)&&e.stopPropagation()),Docsify.dom.on(n,"input",t=>{clearTimeout(s),s=setTimeout(()=>{const n=t.target.value.trim();vn(e,n)},120)}),Docsify.dom.on(i,"click",()=>{n.value="",vn(e,"")}),Docsify.dom.on(t,"click",e=>{const t=e.target,n=t?.closest?.("a");n&&"modal"===rn.mode&&pn()})}function xn(e){const t=Docsify.dom.find(".flexsearch-search .results-status");t&&(t.textContent=e||"")}function bn(e){const t=Docsify.dom.find(".flexsearch-search");Docsify.dom.find(t,".results-panel").innerHTML=e||""}async function wn(e,t){const n="auto"===e.paths,i=n?function(e){const t=[];return Docsify.dom.findAll(".sidebar-nav a:not(.section-link):not([data-nosearch])").forEach(n=>{const i=n.href,s=n.getAttribute("href"),r=e.parse(i).path;r&&-1===t.indexOf(r)&&!Docsify.util.isAbsolutePath(s)&&t.push(r)}),t}(t.router):[...e.paths],s=function(e,t){let n="";if(e.length&&"auto"===t.paths&&t.pathNamespaces){const i=e[0];if(Array.isArray(t.pathNamespaces))n=t.pathNamespaces.filter(e=>i.slice(0,e.length)===e)[0]||n;else if(t.pathNamespaces instanceof RegExp){const e=i.match(t.pathNamespaces);e&&(n=e[0])}const s=-1===e.indexOf(n+"/"),r=-1===e.indexOf(n+"/README");s&&r&&e.unshift(n+"/")}else-1===e.indexOf("/")&&-1===e.indexOf("/README")&&e.unshift("/");return n}(i,e);return{paths:i,suffix:s,isAuto:n}}async function yn(e,t){const{paths:n,suffix:i}=await wn(e,t),s=function(e,t){return`docsify.flexsearch/${e?String(e):""}/${t?String(t):""}`.replace(/\/+$/,"")}(e.namespace,i),r=`${s}/expires`,l=`${s}/hash`,o=Date.now(),a=Number(localStorage.getItem(r)||0),h=function(e,t,n){return JSON.stringify({paths:t,depth:e.depth,suffix:n})}(e,n,i),c=localStorage.getItem(l)||"",u=a<o,f=c!==h;sn.key!==s&&(sn={key:null,index:null,mounted:null,building:null,uiReady:!1,noDataText:""},sn.key=s),sn.index||(sn.index=new Pe.Document({tokenize:"forward",cache:100,document:{id:"id",index:["title","body"],store:["id","slug","title","body","path"]}})),sn.mounted||(sn.mounted=(async()=>{const e=sn.index,t=new Pe.IndexedDB({name:cn(s),type:"varchar"});await e.mount(t)})()),await sn.mounted,sn.building||!u&&!f||(sn.building=(async()=>{xn("Building search index…");const i=sn.index;try{await i.destroy()}catch(e){console.log(e)}sn.index=new Pe.Document({tokenize:"forward",cache:100,document:{id:"id",index:["title","body"],store:["id","slug","title","body","path"]}});const a=new Pe.IndexedDB({name:cn(s),type:"varchar"}),c=sn.index;await c.mount(a);let u=0;const f=n.length;await Promise.all(n.map(async n=>{const i=t.router.getFile(n),s=hn(n,await Docsify.get(i,!1,t.config.requestHeaders),t.router,e.depth);Object.values(s).forEach(e=>{c.add(e)}),u++,1!==u&&u!==f&&u%10!=0||xn(`Building search index… (${u}/${f})`)})),await c.commit(),localStorage.setItem(r,String(o+e.maxAge)),localStorage.setItem(l,h),xn("")})().finally(()=>{sn.building=null})),sn.building&&await sn.building}async function vn(e,t){const n=(t||"").trim();if(!n)return bn(""),void xn("");await yn(rn,e);const i=sn.index;let s;try{s=await i.search(n,{limit:rn.limit,enrich:!0,merge:!0})}catch(e){console.log(e),s=await i.search(n,{limit:rn.limit,enrich:!0,merge:!0})}const r=(Array.isArray(s)?s:[]).map(e=>e&&e.doc).filter(Boolean).slice(0,rn.limit);let l="";r.forEach((e,t)=>{const i=(e.title||"").replace(/<[^>]+>/g,""),s=on(e.title||""),r=e.body?an(e.body,n):"";l+=`\n\t\t\t<div class="matching-post" aria-label="search result ${t+1}">\n\t\t\t\t<a href="${e.slug}" title="${ln(i)}">\n <p class="title clamp-1">${an(s,n,80)}</p>\n\t\t\t\t\t<p class="content clamp-2">${r?`...${r}...`:""}</p>\n\t\t\t\t</a>\n\t\t\t</div>\n\t\t`}),bn(l),xn(r.length?`Found ${r.length} results`:sn.noDataText)}window.$docsify=window.$docsify||{},window.$docsify.plugins=[function(e,t){!function(e){const{util:t}=Docsify,n=e.config.search||rn;Array.isArray(n)?rn.paths=n:"object"==typeof n&&(rn.paths=Array.isArray(n.paths)?n.paths:"auto",rn.maxAge=t.isPrimitive(n.maxAge)?n.maxAge:rn.maxAge,rn.placeholder=n.placeholder||rn.placeholder,rn.noData=n.noData||rn.noData,rn.depth=n.depth||rn.depth,rn.namespace=n.namespace||rn.namespace,rn.pathNamespaces=n.pathNamespaces||rn.pathNamespaces,rn.keyBindings=n.keyBindings||rn.keyBindings,rn.insertAfter=n.insertAfter||rn.insertAfter,rn.insertBefore=n.insertBefore||rn.insertBefore,rn.limit=n.limit||rn.limit,rn.mode=n.mode||rn.mode)}(t),e.init(()=>{const{keyBindings:e}=t.config;e&&e.constructor===Object&&(e.focusFlexSearch={bindings:rn.keyBindings,callback(){if(kn(t),"modal"===rn.mode)return void fn();const e=document.querySelector(".sidebar"),n=document.querySelector(".sidebar-toggle"),i=e?.querySelector('.flexsearch-search input[type="search"]'),s=(e?.getBoundingClientRect().x??0)<0;s&&n?.click(),setTimeout(()=>i?.focus(),s?250:0)}})}),e.mounted(()=>{kn(t),gn(rn.placeholder,t.route.path),dn(rn.noData,t.route.path),yn(rn,t)}),e.doneEach(()=>{kn(t),gn(rn.placeholder,t.route.path),dn(rn.noData,t.route.path),"auto"===rn.paths&&yn(rn,t)})},...window.$docsify.plugins||[]]}();
8
+ //# sourceMappingURL=docsify-flexsearch.min.js.map