tmagic-editor/docs/assets/chunks/VPLocalSearchBox.OiK2mQ_f.js
2026-11-13 04:26:01 +00:00

3 lines
60 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{A as e,An as t,C as n,Dn as r,Gt as i,I as a,It as o,Jt as s,M as c,N as l,O as u,Ot as d,Pt as f,Q as p,S as m,T as h,Tt as g,Zt as _,_ as v,an as y,cn as b,ct as x,d as ee,dt as S,en as te,fn as C,g as w,it as ne,j as T,jt as re,lt as ie,m as ae,mn as E,mt as D,n as oe,q as se,qt as ce,rt as le,st as O,t as k,tn as ue,tt as de,ut as fe,w as pe,x as me}from"./framework.xVFRZL1t.js";import{n as he,r as ge}from"./theme.Cnor0NYZ.js";var _e={root:()=>k(()=>import(`./@localSearchIndexroot.Bp5Qw9NO.js`),[])},ve=[`input:not([inert]):not([inert] *)`,`select:not([inert]):not([inert] *)`,`textarea:not([inert]):not([inert] *)`,`a[href]:not([inert]):not([inert] *)`,`area[href]:not([inert]):not([inert] *)`,`button:not([inert]):not([inert] *)`,`[tabindex]:not(slot):not([inert]):not([inert] *)`,`audio[controls]:not([inert]):not([inert] *)`,`video[controls]:not([inert]):not([inert] *)`,`[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)`,`details>summary:first-of-type:not([inert]):not([inert] *)`,`details:not([inert]):not([inert] *)`],A=ve.join(`,`),j=typeof Element>`u`,M=j?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,N=!j&&Element.prototype.getRootNode?function(e){return e?.getRootNode?.call(e)}:function(e){return e?.ownerDocument},P=function(e,t){t===void 0&&(t=!0);var n=e?.getAttribute?.call(e,`inert`);return n===``||n===`true`||t&&e&&(typeof e.closest==`function`?e.closest(`[inert]`):P(e.parentNode))},ye=function(e){var t=e?.getAttribute?.call(e,`contenteditable`);return t===``||t===`true`},F=function(e,t,n){if(P(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(A));return t&&M.call(e,A)&&r.unshift(e),r=r.filter(n),r},I=function(e,t,n){for(var r=[],i=Array.from(e);i.length;){var a=i.shift();if(!P(a,!1)){if(a.tagName===`SLOT`){var o=a.assignedElements(),s=I(o.length?o:a.children,!0,n);n.flatten?r.push.apply(r,s):r.push({scopeParent:a,candidates:s})}else{M.call(a,A)&&n.filter(a)&&(t||!e.includes(a))&&r.push(a);var c=a.shadowRoot||typeof n.getShadowRoot==`function`&&n.getShadowRoot(a),l=!P(c,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(a));if(c&&l){var u=I(c===!0?a.children:c.children,!0,n);n.flatten?r.push.apply(r,u):r.push({scopeParent:a,candidates:u})}else i.unshift.apply(i,a.children)}}}return r},L=function(e){return!isNaN(parseInt(e.getAttribute(`tabindex`),10))},R=function(e){if(!e)throw Error(`No node provided`);return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||ye(e))&&!L(e)?0:e.tabIndex},be=function(e,t){var n=R(e);return n<0&&t&&!L(e)?0:n},xe=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},z=function(e){return e.tagName===`INPUT`},Se=function(e){return z(e)&&e.type===`hidden`},B=function(e){return e.tagName===`DETAILS`&&Array.prototype.slice.apply(e.children).some(function(e){return e.tagName===`SUMMARY`})},Ce=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},we=function(e){if(!e.name)return!0;var t=e.form||N(e),n=function(e){return t.querySelectorAll(`input[type="radio"][name="`+e+`"]`)},r;if(typeof window<`u`&&window.CSS!==void 0&&typeof window.CSS.escape==`function`)r=n(window.CSS.escape(e.name));else try{r=n(e.name)}catch(e){return console.error(`Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s`,e.message),!1}var i=Ce(r,e.form);return!i||i===e},Te=function(e){return z(e)&&e.type===`radio`},V=function(e){return Te(e)&&!we(e)},H=function(e){var t=e&&N(e),n=t?.host,r=!1;if(t&&t!==e){var i,a,o;for(r=!!((i=n)!=null&&(a=i.ownerDocument)!=null&&a.contains(n)||e!=null&&(o=e.ownerDocument)!=null&&o.contains(e));!r&&n;){var s,c;t=N(n),n=t?.host,r=!!((s=n)!=null&&(c=s.ownerDocument)!=null&&c.contains(n))}}return r},U=function(e){var t=e.getBoundingClientRect(),n=t.width,r=t.height;return n===0&&r===0},Ee=function(e,t){var n=t.displayCheck,r=t.getShadowRoot;if(n===`full-native`&&`checkVisibility`in e)return!e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});var i=getComputedStyle(e).visibility;if(i===`hidden`||i===`collapse`)return!0;var a=M.call(e,`details>summary:first-of-type`)?e.parentElement:e;if(M.call(a,`details:not([open]) *`))return!0;if(!n||n===`full`||n===`full-native`||n===`legacy-full`){if(typeof r==`function`){for(var o=e;e;){var s=e.parentElement,c=N(e);if(s&&!s.shadowRoot&&r(s)===!0)return U(e);e=e.assignedSlot?e.assignedSlot:!s&&c!==e.ownerDocument?c.host:s}e=o}if(H(e))return!e.getClientRects().length;if(n!==`legacy-full`)return!0}else if(n===`non-zero-area`)return U(e);return!1},De=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName===`FIELDSET`&&t.disabled){for(var n=0;n<t.children.length;n++){var r=t.children.item(n);if(r.tagName===`LEGEND`)return M.call(t,`fieldset[disabled] *`)?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},W=function(e,t){return!(t.disabled||Se(t)||Ee(t,e)||B(t)||De(t))},G=function(e,t){return!(V(t)||R(t)<0||!W(e,t))},K=function(e){var t=parseInt(e.getAttribute(`tabindex`),10);return!!(isNaN(t)||t>=0)},q=function(e){var t=[],n=[];return e.forEach(function(e,r){var i=!!e.scopeParent,a=i?e.scopeParent:e,o=be(a,i),s=i?q(e.candidates):a;o===0?i?t.push.apply(t,s):t.push(a):n.push({documentOrder:r,tabIndex:o,item:e,isScope:i,content:s})}),n.sort(xe).reduce(function(e,t){return t.isScope?e.push.apply(e,t.content):e.push(t.content),e},[]).concat(t)},Oe=function(e,t){return t||={},q(t.getShadowRoot?I([e],t.includeContainer,{filter:G.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:K}):F(e,t.includeContainer,G.bind(null,t)))},ke=function(e,t){return t||={},t.getShadowRoot?I([e],t.includeContainer,{filter:W.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):F(e,t.includeContainer,W.bind(null,t))},J=function(e,t){if(t||={},!e)throw Error(`No node provided`);return M.call(e,A)!==!1&&G(t,e)},Ae=ve.concat(`iframe:not([inert]):not([inert] *)`).join(`,`),je=function(e,t){if(t||={},!e)throw Error(`No node provided`);return M.call(e,Ae)!==!1&&W(t,e)};function Me(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function Ne(e){if(Array.isArray(e))return Me(e)}function Pe(e,t){var n=typeof Symbol<`u`&&e[Symbol.iterator]||e[`@@iterator`];if(!n){if(Array.isArray(e)||(n=Ue(e))||t){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||n.return==null||n.return()}finally{if(s)throw a}}}}function Fe(e,t,n){return(t=He(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ie(e){if(typeof Symbol<`u`&&e[Symbol.iterator]!=null||e[`@@iterator`]!=null)return Array.from(e)}function Le(){throw TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Re(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?Re(Object(n),!0).forEach(function(t){Fe(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Re(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function Be(e){return Ne(e)||Ie(e)||Ue(e)||Le()}function Ve(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function He(e){var t=Ve(e,`string`);return typeof t==`symbol`?t:t+``}function Ue(e,t){if(e){if(typeof e==`string`)return Me(e,t);var n={}.toString.call(e).slice(8,-1);return n===`Object`&&e.constructor&&(n=e.constructor.name),n===`Map`||n===`Set`?Array.from(e):n===`Arguments`||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Me(e,t):void 0}}var Y={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){t!==Y.getActiveTrap(e)&&Y.pauseTrap(e);var n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),Y.unpauseTrap(e)},pauseTrap:function(e){Y.getActiveTrap(e)?._setPausedState(!0)},unpauseTrap:function(e){var t=Y.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},We=function(e){return e.tagName&&e.tagName.toLowerCase()===`input`&&typeof e.select==`function`},Ge=function(e){return e?.key===`Escape`||e?.key===`Esc`||e?.keyCode===27},X=function(e){return e?.key===`Tab`||e?.keyCode===9},Ke=function(e){return X(e)&&!e.shiftKey},qe=function(e){return X(e)&&e.shiftKey},Je=function(e){return setTimeout(e,0)},Z=function(e){var t=[...arguments].slice(1);return typeof e==`function`?e.apply(void 0,t):e},Ye=function(e){return e.target.shadowRoot&&typeof e.composedPath==`function`?e.composedPath()[0]:e.target},Xe=[],Ze=function(e,t){var n=t?.document||document,r=t?.trapStack||Xe,i=ze({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,delayReturnFocus:!0,isolateSubtrees:!1,isKeyForward:Ke,isKeyBackward:qe},t),a={containers:[],containerGroups:[],tabbableGroups:[],adjacentElements:new Set,alreadySilent:new Set,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,manuallyPaused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o,s=function(e,t,n){return e&&e[t]!==void 0?e[t]:i[n||t]},c=function(e,t){var n=typeof t?.composedPath==`function`?t.composedPath():void 0;return a.containerGroups.findIndex(function(t){var r=t.container,i=t.tabbableNodes;return r.contains(e)||n?.includes(r)||i.find(function(t){return t===e})})},l=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=t.hasFallback,a=r!==void 0&&r,o=t.params,s=o===void 0?[]:o,c=i[e];if(typeof c==`function`&&(c=c.apply(void 0,Be(s))),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw Error(`\`${e}\` was specified but was not a node, or did not return a node`)}var l=c;if(typeof c==`string`){try{l=n.querySelector(c)}catch(t){throw Error(`\`${e}\` appears to be an invalid selector; error="${t.message}"`)}if(!l&&!a)throw Error(`\`${e}\` as selector refers to no known node`)}return l},u=function(e){var t=e.activeElement;return t?t.shadowRoot&&t.shadowRoot.activeElement!==null?u(t.shadowRoot):t:null},d=function(){var e=l(`initialFocus`,{hasFallback:!0});if(e===!1)return!1;if(e===void 0||e&&!je(e,i.tabbableOptions)){var t=u(n);if(c(t)>=0)e=t;else{var r=a.tabbableGroups[0];e=r&&r.firstTabbableNode||l(`fallbackFocus`)}}else e===null&&(e=l(`fallbackFocus`));if(!e)throw Error(`Your focus-trap needs to have at least one focusable element`);return e},f=function(){if(a.containerGroups=a.containers.map(function(e){var t=Oe(e,i.tabbableOptions),n=ke(e,i.tabbableOptions),r=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,o=n.find(function(e){return J(e)}),s=n.slice().reverse().find(function(e){return J(e)});return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:!!t.find(function(e){return R(e)>0}),firstTabbableNode:r,lastTabbableNode:a,firstDomTabbableNode:o,lastDomTabbableNode:s,nextTabbableNode:function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,i=t.indexOf(e);return i<0?r?n.slice(n.indexOf(e)+1).find(function(e){return J(e)}):n.slice(0,n.indexOf(e)).reverse().find(function(e){return J(e)}):t[i+(r?1:-1)]}}}),a.tabbableGroups=a.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),a.tabbableGroups.length<=0&&!l(`fallbackFocus`))throw Error(`Your focus-trap must have at least one container with at least one tabbable node in it at all times`);if(a.containerGroups.find(function(e){return e.posTabIndexesFound})&&a.containerGroups.length>1)throw Error(`At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.`)},p=function(e){e!==!1&&e!==u(document)&&(!e||!e.focus?p(d()):(e.focus({preventScroll:!!i.preventScroll}),a.mostRecentlyFocusedNode=e,We(e)&&e.select()))},m=function(e){var t=l(`setReturnFocus`,{params:[e]});return t||t!==!1&&e},h=function(e){var t=e.target,n=e.event,r=e.isBackward,o=r!==void 0&&r;t||=Ye(n),f();var s=null;if(a.tabbableGroups.length>0){var u=c(t,n),d=u>=0?a.containerGroups[u]:void 0;if(u<0)s=o?a.tabbableGroups[a.tabbableGroups.length-1].lastTabbableNode:a.tabbableGroups[0].firstTabbableNode;else if(o){var p=a.tabbableGroups.findIndex(function(e){var n=e.firstTabbableNode;return t===n});if(p<0&&(d.container===t||je(t,i.tabbableOptions)&&!J(t,i.tabbableOptions)&&!d.nextTabbableNode(t,!1))&&(p=u),p>=0){var m=p===0?a.tabbableGroups.length-1:p-1,h=a.tabbableGroups[m];s=R(t)>=0?h.lastTabbableNode:h.lastDomTabbableNode}else X(n)||(s=d.nextTabbableNode(t,!1))}else{var g=a.tabbableGroups.findIndex(function(e){var n=e.lastTabbableNode;return t===n});if(g<0&&(d.container===t||je(t,i.tabbableOptions)&&!J(t,i.tabbableOptions)&&!d.nextTabbableNode(t))&&(g=u),g>=0){var _=g===a.tabbableGroups.length-1?0:g+1,v=a.tabbableGroups[_];s=R(t)>=0?v.firstTabbableNode:v.firstDomTabbableNode}else X(n)||(s=d.nextTabbableNode(t))}}else s=l(`fallbackFocus`);return s},g=function(e){c(Ye(e),e)>=0||(Z(i.clickOutsideDeactivates,e)?o.deactivate({returnFocus:i.returnFocusOnDeactivate}):Z(i.allowOutsideClick,e)||e.preventDefault())},_=function(e){var t=Ye(e),n=c(t,e)>=0;if(n||t instanceof Document)n&&(a.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var r,o=!0;if(a.mostRecentlyFocusedNode){if(R(a.mostRecentlyFocusedNode)>0){var s=c(a.mostRecentlyFocusedNode),l=a.containerGroups[s].tabbableNodes;if(l.length>0){var u=l.findIndex(function(e){return e===a.mostRecentlyFocusedNode});u>=0&&(i.isKeyForward(a.recentNavEvent)?u+1<l.length&&(r=l[u+1],o=!1):u-1>=0&&(r=l[u-1],o=!1))}}else a.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return R(e)>0})})||(o=!1)}else o=!1;o&&(r=h({target:a.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(a.recentNavEvent)})),p(r||a.mostRecentlyFocusedNode||d())}a.recentNavEvent=void 0},v=function(e){var t=arguments.length>1&&arguments[1]!==void 0&&arguments[1];a.recentNavEvent=e;var n=h({event:e,isBackward:t});n&&(X(e)&&e.preventDefault(),p(n))},y=function(e){(i.isKeyForward(e)||i.isKeyBackward(e))&&v(e,i.isKeyBackward(e))},b=function(e){Ge(e)&&Z(i.escapeDeactivates,e)!==!1&&(e.preventDefault(),o.deactivate())},x=function(e){c(Ye(e),e)>=0||Z(i.clickOutsideDeactivates,e)||Z(i.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},ee=function(){if(a.active){Y.activateTrap(r,o);var e;return i.delayInitialFocus?e=new Promise(function(e){a.delayInitialFocusTimer=Je(function(){p(d()),e()})}):p(d()),n.addEventListener(`focusin`,_,!0),n.addEventListener(`mousedown`,g,{capture:!0,passive:!1}),n.addEventListener(`touchstart`,g,{capture:!0,passive:!1}),n.addEventListener(`click`,x,{capture:!0,passive:!1}),n.addEventListener(`keydown`,y,{capture:!0,passive:!1}),n.addEventListener(`keydown`,b),e}},S=function(e){a.active&&!a.paused&&o._setSubtreeIsolation(!1),a.adjacentElements.clear(),a.alreadySilent.clear();var t=new Set,n=new Set,r=Pe(e),i;try{for(r.s();!(i=r.n()).done;){var s=i.value;t.add(s);for(var c=typeof ShadowRoot<`u`&&s.getRootNode()instanceof ShadowRoot,l=s;l;){t.add(l);var u=l.parentElement,d=[];u?d=u.children:!u&&c&&(d=l.getRootNode().children,u=l.getRootNode().host,c=typeof ShadowRoot<`u`&&u.getRootNode()instanceof ShadowRoot);var f=Pe(d),p;try{for(f.s();!(p=f.n()).done;){var m=p.value;n.add(m)}}catch(e){f.e(e)}finally{f.f()}l=u}}}catch(e){r.e(e)}finally{r.f()}t.forEach(function(e){n.delete(e)}),a.adjacentElements=n},te=function(){if(a.active)return n.removeEventListener(`focusin`,_,!0),n.removeEventListener(`mousedown`,g,!0),n.removeEventListener(`touchstart`,g,!0),n.removeEventListener(`click`,x,!0),n.removeEventListener(`keydown`,y,!0),n.removeEventListener(`keydown`,b),o},C=typeof window<`u`&&`MutationObserver`in window?new MutationObserver(function(e){var t=a.mostRecentlyFocusedNode;t&&e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===t||typeof e.contains==`function`&&e.contains(t)})})&&a.containers.some(function(e){return e?.isConnected})&&(f(),p(d()))}):void 0,w=function(){C&&(C.disconnect(),a.active&&!a.paused&&a.containers.map(function(e){C.observe(e,{subtree:!0,childList:!0})}))};return o={get active(){return a.active},get paused(){return a.paused},activate:function(e){if(a.active)return this;var t=s(e,`onActivate`),i=s(e,`onPostActivate`),c=s(e,`checkCanFocusTrap`),l=Y.getActiveTrap(r),d=!1;if(l&&!l.paused){var p;(p=l._setSubtreeIsolation)==null||p.call(l,!1),d=!0}try{c||f(),a.active=!0,a.paused=!1,a.nodeFocusedBeforeActivation=u(n),t?.({trap:o});var m=function(){c&&f();var e=function(){o._setSubtreeIsolation(!0),w(),i?.({trap:o})},t=ee();t?t.then(e):e()};if(c)return c(a.containers.concat()).then(m,m),this;m()}catch(e){if(l===Y.getActiveTrap(r)&&d){var h;(h=l._setSubtreeIsolation)==null||h.call(l,!0)}throw e}return this},deactivate:function(e){if(!a.active)return this;var t=ze({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},e);clearTimeout(a.delayInitialFocusTimer),a.delayInitialFocusTimer=void 0,a.paused||o._setSubtreeIsolation(!1),a.alreadySilent.clear(),te(),a.active=!1,a.paused=!1,w(),Y.deactivateTrap(r,o);var n=s(t,`onDeactivate`),c=s(t,`onPostDeactivate`),l=s(t,`checkCanReturnFocus`),u=s(t,`delayReturnFocus`),d=s(t,`returnFocus`,`returnFocusOnDeactivate`);n?.({trap:o});var f=function(){d&&p(m(a.nodeFocusedBeforeActivation)),c?.({trap:o})},h=function(){u&&d?Je(f):f()};return d&&l?(l(m(a.nodeFocusedBeforeActivation)).then(h,h),this):(h(),this)},pause:function(e){return a.active?(a.manuallyPaused=!0,this._setPausedState(!0,e)):this},unpause:function(e){return!a.active||(a.manuallyPaused=!1,r[r.length-1]!==this)?this:this._setPausedState(!1,e)},updateContainerElements:function(e){return a.containers=[].concat(e).filter(Boolean).map(function(e){return typeof e==`string`?n.querySelector(e):e}),i.isolateSubtrees&&S(a.containers),a.active&&(f(),a.paused||o._setSubtreeIsolation(!0)),w(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return a.manuallyPaused}},_setPausedState:{value:function(e,t){if(a.paused===e)return this;if(a.paused=e,e){var n=s(t,`onPause`),r=s(t,`onPostPause`);n?.({trap:o}),te(),o._setSubtreeIsolation(!1),w(),r?.({trap:o})}else{var i=s(t,`onUnpause`),c=s(t,`onPostUnpause`);i?.({trap:o}),(function(){f();var e=function(){o._setSubtreeIsolation(!0),w(),c?.({trap:o})},t=ee();t?t.then(e):e()})()}return this}},_setSubtreeIsolation:{value:function(e){i.isolateSubtrees&&a.adjacentElements.forEach(function(t){if(e)switch(i.isolateSubtrees){case`aria-hidden`:(t.ariaHidden===`true`||t.getAttribute(`aria-hidden`)?.toLowerCase()===`true`)&&a.alreadySilent.add(t),t.setAttribute(`aria-hidden`,`true`);break;default:(t.inert||t.hasAttribute(`inert`))&&a.alreadySilent.add(t),t.setAttribute(`inert`,!0)}else if(!a.alreadySilent.has(t))switch(i.isolateSubtrees){case`aria-hidden`:t.removeAttribute(`aria-hidden`);break;default:t.removeAttribute(`inert`)}})}}}),o.updateContainerElements(e),o};function Qe(t,r={}){let i,{immediate:a,...o}=r,s=b(!1),l=b(!1),u=e=>i&&i.activate(e),d=e=>i&&i.deactivate(e);return ce(O(()=>T(C(t)).map(e=>{let t=C(e);return typeof t==`string`?t:n(t)}).filter(e)),e=>{if(e.length){if(!i)i=Ze(e,{...o,onActivate(e){s.value=!0,r.onActivate&&r.onActivate(e)},onDeactivate(e){s.value=!1,r.onDeactivate&&r.onDeactivate(e)}}),a&&u();else{let t=i?.active;i?.updateContainerElements(e),!t&&a&&u()}}},{flush:`post`}),c(()=>d()),{hasFocus:s,isPaused:l,activate:u,deactivate:d,pause:()=>{i&&(i.pause(),l.value=!0)},unpause:()=>{i&&(i.unpause(),l.value=!1)}}}var $e=class e{constructor(e,t=!0,n=[],r=5e3){this.ctx=e,this.iframes=t,this.exclude=n,this.iframesTimeout=r}static matches(e,t){let n=typeof t==`string`?[t]:t,r=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(r){let t=!1;return n.every(n=>!r.call(e,n)||(t=!0,!1)),t}return!1}getContexts(){let e,t=[];return e=this.ctx===void 0||!this.ctx?[]:NodeList.prototype.isPrototypeOf(this.ctx)?Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?this.ctx:typeof this.ctx==`string`?Array.prototype.slice.call(document.querySelectorAll(this.ctx)):[this.ctx],e.forEach(e=>{let n=t.filter(t=>t.contains(e)).length>0;t.indexOf(e)===-1&&!n&&t.push(e)}),t}getIframeContents(e,t,n=()=>{}){let r;try{let t=e.contentWindow;if(r=t.document,!t||!r)throw Error(`iframe inaccessible`)}catch{n()}r&&t(r)}isIframeBlank(e){let t=`about:blank`,n=e.getAttribute(`src`).trim();return e.contentWindow.location.href===t&&n!==t&&n}observeIframeLoad(e,t,n){let r=!1,i=null,a=()=>{if(!r){r=!0,clearTimeout(i);try{this.isIframeBlank(e)||(e.removeEventListener(`load`,a),this.getIframeContents(e,t,n))}catch{n()}}};e.addEventListener(`load`,a),i=setTimeout(a,this.iframesTimeout)}onIframeReady(e,t,n){try{e.contentWindow.document.readyState===`complete`?this.isIframeBlank(e)?this.observeIframeLoad(e,t,n):this.getIframeContents(e,t,n):this.observeIframeLoad(e,t,n)}catch{n()}}waitForIframes(e,t){let n=0;this.forEachIframe(e,()=>!0,e=>{n++,this.waitForIframes(e.querySelector(`html`),()=>{--n||t()})},e=>{e||t()})}forEachIframe(t,n,r,i=()=>{}){let a=t.querySelectorAll(`iframe`),o=a.length,s=0;a=Array.prototype.slice.call(a);let c=()=>{--o<=0&&i(s)};o||c(),a.forEach(t=>{e.matches(t,this.exclude)?c():this.onIframeReady(t,e=>{n(t)&&(s++,r(e)),c()},c)})}createIterator(e,t,n){return document.createNodeIterator(e,t,n,!1)}createInstanceOnIframe(t){return new e(t.querySelector(`html`),this.iframes)}compareNodeIframe(e,t,n){if(e.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_PRECEDING){if(t!==null){if(t.compareDocumentPosition(n)&Node.DOCUMENT_POSITION_FOLLOWING)return!0}else return!0}return!1}getIteratorNode(e){let t=e.previousNode(),n;return n=(t===null||e.nextNode())&&e.nextNode(),{prevNode:t,node:n}}checkIframeFilter(e,t,n,r){let i=!1,a=!1;return r.forEach((e,t)=>{e.val===n&&(i=t,a=e.handled)}),this.compareNodeIframe(e,t,n)?(i===!1&&!a?r.push({val:n,handled:!0}):i!==!1&&!a&&(r[i].handled=!0),!0):(i===!1&&r.push({val:n,handled:!1}),!1)}handleOpenIframes(e,t,n,r){e.forEach(e=>{e.handled||this.getIframeContents(e.val,e=>{this.createInstanceOnIframe(e).forEachNode(t,n,r)})})}iterateThroughNodes(e,t,n,r,i){let a=this.createIterator(t,e,r),o=[],s=[],c,l,u=()=>({prevNode:l,node:c}=this.getIteratorNode(a),c);for(;u();)this.iframes&&this.forEachIframe(t,e=>this.checkIframeFilter(c,l,e,o),t=>{this.createInstanceOnIframe(t).forEachNode(e,e=>s.push(e),r)}),s.push(c);s.forEach(e=>{n(e)}),this.iframes&&this.handleOpenIframes(o,e,n,r),i()}forEachNode(e,t,n,r=()=>{}){let i=this.getContexts(),a=i.length;a||r(),i.forEach(i=>{let o=()=>{this.iterateThroughNodes(e,i,t,n,()=>{--a<=0&&r()})};this.iframes?this.waitForIframes(i,o):o()})}},et=class{constructor(e){this.ctx=e,this.ie=!1;let t=window.navigator.userAgent;(t.indexOf(`MSIE`)>-1||t.indexOf(`Trident`)>-1)&&(this.ie=!0)}set opt(e){this._opt=Object.assign({},{element:``,className:``,exclude:[],iframes:!1,iframesTimeout:5e3,separateWordSearch:!0,diacritics:!0,synonyms:{},accuracy:`partially`,acrossElements:!1,caseSensitive:!1,ignoreJoiners:!1,ignoreGroups:0,ignorePunctuation:[],wildcards:`disabled`,each:()=>{},noMatch:()=>{},filter:()=>!0,done:()=>{},debug:!1,log:window.console},e)}get opt(){return this._opt}get iterator(){return new $e(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t=`debug`){let n=this.opt.log;this.opt.debug&&typeof n==`object`&&typeof n[t]==`function`&&n[t](`mark.js: ${e}`)}escapeStr(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,`\\$&`)}createRegExp(e){return this.opt.wildcards!==`disabled`&&(e=this.setupWildcardsRegExp(e)),e=this.escapeStr(e),Object.keys(this.opt.synonyms).length&&(e=this.createSynonymsRegExp(e)),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),this.opt.diacritics&&(e=this.createDiacriticsRegExp(e)),e=this.createMergedBlanksRegExp(e),(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.createJoinersRegExp(e)),this.opt.wildcards!==`disabled`&&(e=this.createWildcardsRegExp(e)),e=this.createAccuracyRegExp(e),e}createSynonymsRegExp(e){let t=this.opt.synonyms,n=this.opt.caseSensitive?``:`i`,r=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?`\0`:``;for(let i in t)if(t.hasOwnProperty(i)){let a=t[i],o=this.opt.wildcards===`disabled`?this.escapeStr(i):this.setupWildcardsRegExp(i),s=this.opt.wildcards===`disabled`?this.escapeStr(a):this.setupWildcardsRegExp(a);o!==``&&s!==``&&(e=e.replace(RegExp(`(${this.escapeStr(o)}|${this.escapeStr(s)})`,`gm${n}`),r+`(${this.processSynomyms(o)}|${this.processSynomyms(s)})`+r))}return e}processSynomyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return e=e.replace(/(?:\\)*\?/g,e=>e.charAt(0)===`\\`?`?`:``),e.replace(/(?:\\)*\*/g,e=>e.charAt(0)===`\\`?`*`:``)}createWildcardsRegExp(e){let t=this.opt.wildcards===`withSpaces`;return e.replace(/\u0001/g,t?`[\\S\\s]?`:`\\S?`).replace(/\u0002/g,t?`[\\S\\s]*?`:`\\S*`)}setupIgnoreJoinersRegExp(e){return e.replace(/[^(|)\\]/g,(e,t,n)=>{let r=n.charAt(t+1);return/[(|)\\]/.test(r)||r===``?e:e+`\0`})}createJoinersRegExp(e){let t=[],n=this.opt.ignorePunctuation;return Array.isArray(n)&&n.length&&t.push(this.escapeStr(n.join(``))),this.opt.ignoreJoiners&&t.push(`\\u00ad\\u200b\\u200c\\u200d`),t.length?e.split(/\u0000+/).join(`[${t.join(``)}]*`):e}createDiacriticsRegExp(e){let t=this.opt.caseSensitive?``:`i`,n=this.opt.caseSensitive?`aàáảãạăằắẳẵặâầấẩẫậäåāą.AÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ.cçćč.CÇĆČ.dđď.DĐĎ.eèéẻẽẹêềếểễệëěēę.EÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ.iìíỉĩịîïī.IÌÍỈĨỊÎÏĪ.lł.LŁ.nñňń.NÑŇŃ.oòóỏõọôồốổỗộơởỡớờợöøō.OÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ.rř.RŘ.sšśșş.SŠŚȘŞ.tťțţ.TŤȚŢ.uùúủũụưừứửữựûüůū.UÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ.yýỳỷỹỵÿ.YÝỲỶỸỴŸ.zžżź.ZŽŻŹ`.split(`.`):[`aàáảãạăằắẳẵặâầấẩẫậäåāąAÀÁẢÃẠĂẰẮẲẴẶÂẦẤẨẪẬÄÅĀĄ`,`cçćčCÇĆČ`,`dđďDĐĎ`,`eèéẻẽẹêềếểễệëěēęEÈÉẺẼẸÊỀẾỂỄỆËĚĒĘ`,`iìíỉĩịîïīIÌÍỈĨỊÎÏĪ`,`lłLŁ`,`nñňńNÑŇŃ`,`oòóỏõọôồốổỗộơởỡớờợöøōOÒÓỎÕỌÔỒỐỔỖỘƠỞỠỚỜỢÖØŌ`,`rřRŘ`,`sšśșşSŠŚȘŞ`,`tťțţTŤȚŢ`,`uùúủũụưừứửữựûüůūUÙÚỦŨỤƯỪỨỬỮỰÛÜŮŪ`,`yýỳỷỹỵÿYÝỲỶỸỴŸ`,`zžżźZŽŻŹ`],r=[];return e.split(``).forEach(i=>{n.every(n=>{if(n.indexOf(i)!==-1){if(r.indexOf(n)>-1)return!1;e=e.replace(RegExp(`[${n}]`,`gm${t}`),`[${n}]`),r.push(n)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gim,`[\\s]+`)}createAccuracyRegExp(e){let t=this.opt.accuracy,n=typeof t==`string`?t:t.value,r=typeof t==`string`?[]:t.limiters,i=``;switch(r.forEach(e=>{i+=`|${this.escapeStr(e)}`}),n){case`partially`:default:return`()(${e})`;case`complementary`:return i=`\\s`+(i||this.escapeStr(`!"#$%&'()*+,-./:;<=>?@[\\]^_\`{|}~¡¿`)),`()([^${i}]*${e}[^${i}]*)`;case`exactly`:return`(^|\\s${i})(${e})(?=$|\\s${i})`}}getSeparatedKeywords(e){let t=[];return e.forEach(e=>{this.opt.separateWordSearch?e.split(` `).forEach(e=>{e.trim()&&t.indexOf(e)===-1&&t.push(e)}):e.trim()&&t.indexOf(e)===-1&&t.push(e)}),{keywords:t.sort((e,t)=>t.length-e.length),length:t.length}}isNumeric(e){return Number(parseFloat(e))==e}checkRanges(e){if(!Array.isArray(e)||Object.prototype.toString.call(e[0])!==`[object Object]`)return this.log(`markRanges() will only accept an array of objects`),this.opt.noMatch(e),[];let t=[],n=0;return e.sort((e,t)=>e.start-t.start).forEach(e=>{let{start:r,end:i,valid:a}=this.callNoMatchOnInvalidRanges(e,n);a&&(e.start=r,e.length=i-r,t.push(e),n=i)}),t}callNoMatchOnInvalidRanges(e,t){let n,r,i=!1;return e&&e.start!==void 0?(n=parseInt(e.start,10),r=n+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&r-t>0&&r-n>0?i=!0:(this.log(`Ignoring invalid or overlapping range: ${JSON.stringify(e)}`),this.opt.noMatch(e))):(this.log(`Ignoring invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)),{start:n,end:r,valid:i}}checkWhitespaceRanges(e,t,n){let r,i=!0,a=n.length,o=t-a,s=parseInt(e.start,10)-o;return s=s>a?a:s,r=s+parseInt(e.length,10),r>a&&(r=a,this.log(`End range automatically set to the max value of ${a}`)),s<0||r-s<0||s>a||r>a?(i=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):n.substring(s,r).replace(/\s+/g,``)===``&&(i=!1,this.log(`Skipping whitespace only range: `+JSON.stringify(e)),this.opt.noMatch(e)),{start:s,end:r,valid:i}}getTextNodes(e){let t=``,n=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,e=>{n.push({start:t.length,end:(t+=e.textContent).length,node:e})},e=>this.matchesExclude(e.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:n})})}matchesExclude(e){return $e.matches(e,this.opt.exclude.concat([`script`,`style`,`title`,`head`,`html`]))}wrapRangeInTextNode(e,t,n){let r=this.opt.element?this.opt.element:`mark`,i=e.splitText(t),a=i.splitText(n-t),o=document.createElement(r);return o.setAttribute(`data-markjs`,`true`),this.opt.className&&o.setAttribute(`class`,this.opt.className),o.textContent=i.textContent,i.parentNode.replaceChild(o,i),a}wrapRangeInMappedTextNode(e,t,n,r,i){e.nodes.every((a,o)=>{let s=e.nodes[o+1];if(s===void 0||s.start>t){if(!r(a.node))return!1;let s=t-a.start,c=(n>a.end?a.end:n)-a.start,l=e.value.substr(0,a.start),u=e.value.substr(c+a.start);if(a.node=this.wrapRangeInTextNode(a.node,s,c),e.value=l+u,e.nodes.forEach((t,n)=>{n>=o&&(e.nodes[n].start>0&&n!==o&&(e.nodes[n].start-=c),e.nodes[n].end-=c)}),n-=c,i(a.node.previousSibling,a.start),n>a.end)t=a.end;else return!1}return!0})}wrapMatches(e,t,n,r,i){let a=t===0?0:t+1;this.getTextNodes(t=>{t.nodes.forEach(t=>{t=t.node;let i;for(;(i=e.exec(t.textContent))!==null&&i[a]!==``;){if(!n(i[a],t))continue;let o=i.index;if(a!==0)for(let e=1;e<a;e++)o+=i[e].length;t=this.wrapRangeInTextNode(t,o,o+i[a].length),r(t.previousSibling),e.lastIndex=0}}),i()})}wrapMatchesAcrossElements(e,t,n,r,i){let a=t===0?0:t+1;this.getTextNodes(t=>{let o;for(;(o=e.exec(t.value))!==null&&o[a]!==``;){let i=o.index;if(a!==0)for(let e=1;e<a;e++)i+=o[e].length;let s=i+o[a].length;this.wrapRangeInMappedTextNode(t,i,s,e=>n(o[a],e),(t,n)=>{e.lastIndex=n,r(t)})}i()})}wrapRangeFromIndex(e,t,n,r){this.getTextNodes(i=>{let a=i.value.length;e.forEach((e,r)=>{let{start:o,end:s,valid:c}=this.checkWhitespaceRanges(e,a,i.value);c&&this.wrapRangeInMappedTextNode(i,o,s,n=>t(n,e,i.value.substring(o,s),r),t=>{n(t,e)})}),r()})}unwrapMatches(e){let t=e.parentNode,n=document.createDocumentFragment();for(;e.firstChild;)n.appendChild(e.removeChild(e.firstChild));t.replaceChild(n,e),this.ie?this.normalizeTextNode(t):t.normalize()}normalizeTextNode(e){if(e){if(e.nodeType===3)for(;e.nextSibling&&e.nextSibling.nodeType===3;)e.nodeValue+=e.nextSibling.nodeValue,e.parentNode.removeChild(e.nextSibling);else this.normalizeTextNode(e.firstChild);this.normalizeTextNode(e.nextSibling)}}markRegExp(e,t){this.opt=t,this.log(`Searching with expression "${e}"`);let n=0,r=`wrapMatches`;this.opt.acrossElements&&(r=`wrapMatchesAcrossElements`),this[r](e,this.opt.ignoreGroups,(e,t)=>this.opt.filter(t,e,n),e=>{n++,this.opt.each(e)},()=>{n===0&&this.opt.noMatch(e),this.opt.done(n)})}mark(e,t){this.opt=t;let n=0,r=`wrapMatches`,{keywords:i,length:a}=this.getSeparatedKeywords(typeof e==`string`?[e]:e),o=this.opt.caseSensitive?``:`i`,s=e=>{let t=new RegExp(this.createRegExp(e),`gm${o}`),c=0;this.log(`Searching with expression "${t}"`),this[r](t,1,(t,r)=>this.opt.filter(r,e,n,c),e=>{c++,n++,this.opt.each(e)},()=>{c===0&&this.opt.noMatch(e),i[a-1]===e?this.opt.done(n):s(i[i.indexOf(e)+1])})};this.opt.acrossElements&&(r=`wrapMatchesAcrossElements`),a===0?this.opt.done(n):s(i[0])}markRanges(e,t){this.opt=t;let n=0,r=this.checkRanges(e);r&&r.length?(this.log(`Starting to mark with the following ranges: `+JSON.stringify(r)),this.wrapRangeFromIndex(r,(e,t,n,r)=>this.opt.filter(e,t,n,r),(e,t)=>{n++,this.opt.each(e,t)},()=>{this.opt.done(n)})):this.opt.done(n)}unmark(e){this.opt=e;let t=this.opt.element?this.opt.element:`*`;t+=`[data-markjs]`,this.opt.className&&(t+=`.${this.opt.className}`),this.log(`Removal selector "${t}"`),this.iterator.forEachNode(NodeFilter.SHOW_ELEMENT,e=>{this.unwrapMatches(e)},e=>{let n=$e.matches(e,t),r=this.matchesExclude(e);return!n||r?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function tt(e){let t=new et(e);return this.mark=(e,n)=>(t.mark(e,n),this),this.markRegExp=(e,n)=>(t.markRegExp(e,n),this),this.markRanges=(e,n)=>(t.markRanges(e,n),this),this.unmark=e=>(t.unmark(e),this),this}var nt=`ENTRIES`,rt=`KEYS`,it=`VALUES`,Q=``,at=class{constructor(e,t){let n=e._tree,r=Array.from(n.keys());this.set=e,this._type=t,this._path=r.length>0?[{node:n,keys:r}]:[]}next(){let e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};let{node:e,keys:t}=$(this._path);if($(t)===Q)return{done:!1,value:this.result()};let n=e.get($(t));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;let e=$(this._path).keys;e.pop(),e.length>0||(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>$(e)).filter(e=>e!==Q).join(``)}value(){return $(this._path).node.get(Q)}result(){switch(this._type){case it:return this.value();case rt:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}},$=e=>e[e.length-1],ot=(e,t,n)=>{let r=new Map;if(t===void 0)return r;let i=t.length+1,a=i+n,o=new Uint8Array(a*i).fill(n+1);for(let e=0;e<i;++e)o[e]=e;for(let e=1;e<a;++e)o[e*i]=e;return st(e,t,n,r,o,1,i,``),r},st=(e,t,n,r,i,a,o,s)=>{let c=a*o;key:for(let l of e.keys())if(l===Q){let t=i[c-1];t<=n&&r.set(s,[e.get(l),t])}else{let c=a;for(let e=0;e<l.length;++e,++c){let r=l[e],a=o*c,s=a-o,u=i[a],d=Math.max(0,c-n-1),f=Math.min(o-1,c+n);for(let e=d;e<f;++e){let n=r!==t[e],o=i[s+e]+ +n,c=i[s+e+1]+1,l=i[a+e]+1,d=i[a+e+1]=Math.min(o,c,l);d<u&&(u=d)}if(u>n)continue key}st(e.get(l),t,n,r,i,c,o,s+l)}},ct=class e{constructor(e=new Map,t=``){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(t){if(!t.startsWith(this._prefix))throw Error(`Mismatched prefix`);let[n,r]=lt(this._tree,t.slice(this._prefix.length));if(n===void 0){let[n,i]=ht(r);for(let r of n.keys())if(r!==Q&&r.startsWith(i)){let a=new Map;return a.set(r.slice(i.length),n.get(r)),new e(a,t)}}return new e(n,t)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,ft(this._tree,e)}entries(){return new at(this,nt)}forEach(e){for(let[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return ot(this._tree,e,t)}get(e){let t=ut(this._tree,e);return t===void 0?void 0:t.get(Q)}has(e){let t=ut(this._tree,e);return t!==void 0&&t.has(Q)}keys(){return new at(this,rt)}set(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);return this._size=void 0,dt(this._tree,e).set(Q,t),this}get size(){if(this._size)return this._size;this._size=0;let e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=dt(this._tree,e);return n.set(Q,t(n.get(Q))),this}fetch(e,t){if(typeof e!=`string`)throw Error(`key must be a string`);this._size=void 0;let n=dt(this._tree,e),r=n.get(Q);return r===void 0&&n.set(Q,r=t()),r}values(){return new at(this,it)}[Symbol.iterator](){return this.entries()}static from(t){let n=new e;for(let[e,r]of t)n.set(e,r);return n}static fromObject(t){return e.from(Object.entries(t))}},lt=(e,t,n=[])=>{if(t.length===0||e==null)return[e,n];for(let r of e.keys())if(r!==Q&&t.startsWith(r))return n.push([e,r]),lt(e.get(r),t.slice(r.length),n);return n.push([e,t]),lt(void 0,``,n)},ut=(e,t)=>{if(t.length===0||e==null)return e;for(let n of e.keys())if(n!==Q&&t.startsWith(n))return ut(e.get(n),t.slice(n.length))},dt=(e,t)=>{let n=t.length;outer:for(let r=0;e&&r<n;){for(let i of e.keys())if(i!==Q&&t[r]===i[0]){let a=Math.min(n-r,i.length),o=1;for(;o<a&&t[r+o]===i[o];)++o;let s=e.get(i);if(o===i.length)e=s;else{let n=new Map;n.set(i.slice(o),s),e.set(t.slice(r,r+o),n),e.delete(i),e=n}r+=o;continue outer}let i=new Map;return e.set(t.slice(r),i),i}return e},ft=(e,t)=>{let[n,r]=lt(e,t);if(n!==void 0){if(n.delete(Q),n.size===0)pt(r);else if(n.size===1){let[e,t]=n.entries().next().value;mt(r,e,t)}}},pt=e=>{if(e.length===0)return;let[t,n]=ht(e);if(t.delete(n),t.size===0)pt(e.slice(0,-1));else if(t.size===1){let[n,r]=t.entries().next().value;n!==Q&&mt(e.slice(0,-1),n,r)}},mt=(e,t,n)=>{if(e.length===0)return;let[r,i]=ht(e);r.set(i+t,n),r.delete(i)},ht=e=>e[e.length-1],gt=`or`,_t=`and`,vt=`and_not`,yt=class e{constructor(e){if(e?.fields==null)throw Error(`MiniSearch: option "fields" must be provided`);let t=e.autoVacuum==null||e.autoVacuum===!0?At:e.autoVacuum;this._options={...Tt,...e,autoVacuum:t,searchOptions:{...Et,...e.searchOptions||{}},autoSuggestOptions:{...Dt,...e.autoSuggestOptions||{}}},this._index=new ct,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldIds={},this._fieldLength=new Map,this._avgFieldLength=[],this._nextId=0,this._storedFields=new Map,this._dirtCount=0,this._currentVacuum=null,this._enqueuedVacuum=null,this._enqueuedVacuumConditions=kt,this.addFields(this._options.fields)}add(e){let{extractField:t,stringifyField:n,tokenize:r,processTerm:i,fields:a,idField:o}=this._options,s=t(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(s))throw Error(`MiniSearch: duplicate ID ${s}`);let c=this.addDocumentId(s);this.saveStoredFields(c,e);for(let o of a){let a=t(e,o);if(a==null)continue;let s=r(n(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.addFieldLength(c,l,this._documentCount-1,u);for(let e of s){let t=i(e,o);if(Array.isArray(t))for(let e of t)this.addTerm(l,c,e);else t&&this.addTerm(l,c,t)}}}addAll(e){for(let t of e)this.add(t)}addAllAsync(e,t={}){let{chunkSize:n=10}=t,r={chunk:[],promise:Promise.resolve()},{chunk:i,promise:a}=e.reduce(({chunk:e,promise:t},r,i)=>(e.push(r),(i+1)%n===0?{chunk:[],promise:t.then(()=>new Promise(e=>setTimeout(e,0))).then(()=>this.addAll(e))}:{chunk:e,promise:t}),r);return a.then(()=>this.addAll(i))}remove(e){let{tokenize:t,processTerm:n,extractField:r,stringifyField:i,fields:a,idField:o}=this._options,s=r(e,o);if(s==null)throw Error(`MiniSearch: document does not have ID field "${o}"`);let c=this._idToShortId.get(s);if(c==null)throw Error(`MiniSearch: cannot remove document with ID ${s}: it is not in the index`);for(let o of a){let a=r(e,o);if(a==null)continue;let s=t(i(a,o),o),l=this._fieldIds[o],u=new Set(s).size;this.removeFieldLength(c,l,this._documentCount,u);for(let e of s){let t=n(e,o);if(Array.isArray(t))for(let e of t)this.removeTerm(l,c,e);else t&&this.removeTerm(l,c,t)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(s),this._fieldLength.delete(c),--this._documentCount}removeAll(e){if(e)for(let t of e)this.remove(t);else if(arguments.length>0)throw Error(`Expected documents to be present. Omit the argument to remove all documents.`);else this._index=new ct,this._documentCount=0,this._documentIds=new Map,this._idToShortId=new Map,this._fieldLength=new Map,this._avgFieldLength=[],this._storedFields=new Map,this._nextId=0}discard(e){let t=this._idToShortId.get(e);if(t==null)throw Error(`MiniSearch: cannot discard document with ID ${e}: it is not in the index`);this._idToShortId.delete(e),this._documentIds.delete(t),this._storedFields.delete(t),(this._fieldLength.get(t)||[]).forEach((e,n)=>{this.removeFieldLength(t,n,this._documentCount,e)}),this._fieldLength.delete(t),--this._documentCount,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;let{minDirtFactor:e,minDirtCount:t,batchSize:n,batchWait:r}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:r},{minDirtCount:t,minDirtFactor:e})}discardAll(e){let t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(let t of e)this.discard(t)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){let{idField:t,extractField:n}=this._options,r=n(e,t);this.discard(r),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum??=this._currentVacuum.then(()=>{let t=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=kt,this.performVacuuming(e,t)}),this._enqueuedVacuum):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){let n=this._dirtCount;if(this.vacuumConditionsMet(t)){let t=e.batchSize||Ot.batchSize,r=e.batchWait||Ot.batchWait,i=1;for(let[e,n]of this._index){for(let[e,t]of n)for(let[r]of t)this._documentIds.has(r)||(t.size<=1?n.delete(e):t.delete(r));this._index.get(e).size===0&&this._index.delete(e),i%t===0&&await new Promise(e=>setTimeout(e,r)),i+=1}this._dirtCount-=n}await null,this._currentVacuum=this._enqueuedVacuum,this._enqueuedVacuum=null}vacuumConditionsMet(e){if(e==null)return!0;let{minDirtCount:t,minDirtFactor:n}=e;return t||=At.minDirtCount,n||=At.minDirtFactor,this.dirtCount>=t&&this.dirtFactor>=n}get isVacuuming(){return this._currentVacuum!=null}get dirtCount(){return this._dirtCount}get dirtFactor(){return this._dirtCount/(1+this._documentCount+this._dirtCount)}has(e){return this._idToShortId.has(e)}getStoredFields(e){let t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(t,n={}){let{searchOptions:r}=this._options,i={...r,...n},a=this.executeQuery(t,n),o=[];for(let[e,{score:t,terms:n,match:r}]of a){let a=n.length||1,s={id:this._documentIds.get(e),score:t*a,terms:Object.keys(r),queryTerms:n,match:r};Object.assign(s,this._storedFields.get(e)),(i.filter==null||i.filter(s))&&o.push(s)}return t===e.wildcard&&i.boostDocument==null||o.sort(Nt),o}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};let n=new Map;for(let{score:r,terms:i}of this.search(e,t)){let e=i.join(` `),t=n.get(e);t==null?n.set(e,{score:r,terms:i,count:1}):(t.score+=r,t.count+=1)}let r=[];for(let[e,{score:t,terms:i,count:a}]of n)r.push({suggestion:e,terms:i,score:t/a});return r.sort(Nt),r}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJS(JSON.parse(e),t)}static async loadJSONAsync(e,t){if(t==null)throw Error(`MiniSearch: loadJSON should be given the same options used when serializing the index`);return this.loadJSAsync(JSON.parse(e),t)}static getDefault(e){if(Tt.hasOwnProperty(e))return bt(Tt,e);throw Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=Ft(r),s._fieldLength=Ft(i),s._storedFields=Ft(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);for(let[e,t]of n){let n=new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),Ft(r))}s._index.set(e,n)}return s}static async loadJSAsync(e,t){let{index:n,documentIds:r,fieldLength:i,storedFields:a,serializationVersion:o}=e,s=this.instantiateMiniSearch(e,t);s._documentIds=await It(r),s._fieldLength=await It(i),s._storedFields=await It(a);for(let[e,t]of s._documentIds)s._idToShortId.set(t,e);let c=0;for(let[e,t]of n){let n=new Map;for(let e of Object.keys(t)){let r=t[e];o===1&&(r=r.ds),n.set(parseInt(e,10),await It(r))}++c%1e3==0&&await Lt(0),s._index.set(e,n)}return s}static instantiateMiniSearch(t,n){let{documentCount:r,nextId:i,fieldIds:a,averageFieldLength:o,dirtCount:s,serializationVersion:c}=t;if(c!==1&&c!==2)throw Error(`MiniSearch: cannot deserialize an index created with an incompatible version`);let l=new e(n);return l._documentCount=r,l._nextId=i,l._idToShortId=new Map,l._fieldIds=a,l._avgFieldLength=o,l._dirtCount=s||0,l._index=new ct,l}executeQuery(t,n={}){if(t===e.wildcard)return this.executeWildcardQuery(n);if(typeof t!=`string`){let e={...n,...t,queries:void 0},r=t.queries.map(t=>this.executeQuery(t,e));return this.combineResults(r,e.combineWith)}let{tokenize:r,processTerm:i,searchOptions:a}=this._options,o={tokenize:r,processTerm:i,...a,...n},{tokenize:s,processTerm:c}=o,l=s(t).flatMap(e=>c(e)).filter(e=>!!e).map(wt(o)).map(e=>this.executeQuerySpec(e,o));return this.combineResults(l,o.combineWith)}executeQuerySpec(e,t){let n={...this._options.searchOptions,...t},r=(n.fields||this._options.fields).reduce((e,t)=>({...e,[t]:bt(n.boost,t)||1}),{}),{boostDocument:i,weights:a,maxFuzzy:o,bm25:s}=n,{fuzzy:c,prefix:l}={...Et.weights,...a},u=this._index.get(e.term),d=this.termResults(e.term,e.term,1,e.termBoost,u,r,i,s),f,p;if(e.prefix&&(f=this._index.atPrefix(e.term)),e.fuzzy){let t=e.fuzzy===!0?.2:e.fuzzy,n=t<1?Math.min(o,Math.round(e.term.length*t)):t;n&&(p=this._index.fuzzyGet(e.term,n))}if(f)for(let[t,n]of f){let a=t.length-e.term.length;if(!a)continue;p?.delete(t);let o=l*t.length/(t.length+.3*a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}if(p)for(let t of p.keys()){let[n,a]=p.get(t);if(!a)continue;let o=c*t.length/(t.length+a);this.termResults(e.term,t,o,e.termBoost,n,r,i,s,d)}return d}executeWildcardQuery(e){let t=new Map,n={...this._options.searchOptions,...e};for(let[e,r]of this._documentIds){let i=n.boostDocument?n.boostDocument(r,``,this._storedFields.get(e)):1;t.set(e,{score:i,terms:[],match:{}})}return t}combineResults(e,t=gt){if(e.length===0)return new Map;let n=xt[t.toLowerCase()];if(!n)throw Error(`Invalid combination operator: ${t}`);return e.reduce(n)||new Map}toJSON(){let e=[];for(let[t,n]of this._index){let r={};for(let[e,t]of n)r[e]=Object.fromEntries(t);e.push([t,r])}return{documentCount:this._documentCount,nextId:this._nextId,documentIds:Object.fromEntries(this._documentIds),fieldIds:this._fieldIds,fieldLength:Object.fromEntries(this._fieldLength),averageFieldLength:this._avgFieldLength,storedFields:Object.fromEntries(this._storedFields),dirtCount:this._dirtCount,index:e,serializationVersion:2}}termResults(e,t,n,r,i,a,o,s,c=new Map){if(i==null)return c;for(let l of Object.keys(a)){let u=a[l],d=this._fieldIds[l],f=i.get(d);if(f==null)continue;let p=f.size,m=this._avgFieldLength[d];for(let i of f.keys()){if(!this._documentIds.has(i)){this.removeTerm(d,i,t),--p;continue}let a=o?o(this._documentIds.get(i),t,this._storedFields.get(i)):1;if(!a)continue;let h=f.get(i),g=this._fieldLength.get(i)[d],_=Ct(h,p,this._documentCount,g,m,s),v=n*r*u*a*_,y=c.get(i);if(y){y.score+=v,jt(y.terms,e);let n=bt(y.match,t);n?n.push(l):y.match[t]=[l]}else c.set(i,{score:v,terms:[e],match:{[t]:[l]}})}}return c}addTerm(e,t,n){let r=this._index.fetch(n,Pt),i=r.get(e);if(i==null)i=new Map,i.set(t,1),r.set(e,i);else{let e=i.get(t);i.set(t,(e||0)+1)}}removeTerm(e,t,n){if(!this._index.has(n)){this.warnDocumentChanged(t,e,n);return}let r=this._index.fetch(n,Pt),i=r.get(e);i==null||i.get(t)==null?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?r.delete(e):i.delete(t):i.set(t,i.get(t)-1),this._index.get(n).size===0&&this._index.delete(n)}warnDocumentChanged(e,t,n){for(let r of Object.keys(this._fieldIds))if(this._fieldIds[r]===t){this._options.logger(`warn`,`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${n}" was not present in field "${r}". Removing a document after it has changed can corrupt the index!`,`version_conflict`);return}}addDocumentId(e){let t=this._nextId;return this._idToShortId.set(e,t),this._documentIds.set(t,e),this._documentCount+=1,this._nextId+=1,t}addFields(e){for(let t=0;t<e.length;t++)this._fieldIds[e[t]]=t}addFieldLength(e,t,n,r){let i=this._fieldLength.get(e);i??this._fieldLength.set(e,i=[]),i[t]=r;let a=(this._avgFieldLength[t]||0)*n+r;this._avgFieldLength[t]=a/(n+1)}removeFieldLength(e,t,n,r){if(n===1){this._avgFieldLength[t]=0;return}let i=this._avgFieldLength[t]*n-r;this._avgFieldLength[t]=i/(n-1)}saveStoredFields(e,t){let{storeFields:n,extractField:r}=this._options;if(n==null||n.length===0)return;let i=this._storedFields.get(e);i??this._storedFields.set(e,i={});for(let e of n){let n=r(t,e);n!==void 0&&(i[e]=n)}}};yt.wildcard=Symbol(`*`);var bt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0,xt={[gt]:(e,t)=>{for(let n of t.keys()){let r=e.get(n);if(r==null)e.set(n,t.get(n));else{let{score:e,terms:i,match:a}=t.get(n);r.score+=e,r.match=Object.assign(r.match,a),Mt(r.terms,i)}}return e},[_t]:(e,t)=>{let n=new Map;for(let r of t.keys()){let i=e.get(r);if(i==null)continue;let{score:a,terms:o,match:s}=t.get(r);Mt(i.terms,o),n.set(r,{score:i.score+a,terms:i.terms,match:Object.assign(i.match,s)})}return n},[vt]:(e,t)=>{for(let n of t.keys())e.delete(n);return e}},St={k:1.2,b:.7,d:.5},Ct=(e,t,n,r,i,a)=>{let{k:o,b:s,d:c}=a;return Math.log(1+(n-t+.5)/(t+.5))*(c+e*(o+1)/(e+o*(1-s+s*r/i)))},wt=e=>(t,n,r)=>({term:t,fuzzy:typeof e.fuzzy==`function`?e.fuzzy(t,n,r):e.fuzzy||!1,prefix:typeof e.prefix==`function`?e.prefix(t,n,r):e.prefix===!0,termBoost:typeof e.boostTerm==`function`?e.boostTerm(t,n,r):1}),Tt={idField:`id`,extractField:(e,t)=>e[t],stringifyField:(e,t)=>e.toString(),tokenize:e=>e.split(Rt),processTerm:e=>e.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(e,t)=>{typeof(console==null?void 0:console[e])==`function`&&console[e](t)},autoVacuum:!0},Et={combineWith:gt,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:St},Dt={combineWith:_t,prefix:(e,t,n)=>t===n.length-1},Ot={batchSize:1e3,batchWait:10},kt={minDirtFactor:.1,minDirtCount:20},At={...Ot,...kt},jt=(e,t)=>{e.includes(t)||e.push(t)},Mt=(e,t)=>{for(let n of t)e.includes(n)||e.push(n)},Nt=({score:e},{score:t})=>t-e,Pt=()=>new Map,Ft=e=>{let t=new Map;for(let n of Object.keys(e))t.set(parseInt(n,10),e[n]);return t},It=async e=>{let t=new Map,n=0;for(let r of Object.keys(e))t.set(parseInt(r,10),e[r]),++n%1e3==0&&await Lt(0);return t},Lt=e=>new Promise(t=>setTimeout(t,e)),Rt=/[\n\r\p{Z}\p{P}]+/u,zt=class{max;cache;constructor(e=10){this.max=e,this.cache=new Map}get(e){let t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){this.cache.has(e)?this.cache.delete(e):this.cache.size===this.max&&this.cache.delete(this.first()),this.cache.set(e,t)}first(){return this.cache.keys().next().value}clear(){this.cache.clear()}};function Bt(e){let{localeIndex:t,theme:n}=ge();function r(r){let i=r.split(`.`),a=n.value.search?.options,o=a&&typeof a==`object`,s=o&&a.locales?.[t.value]?.translations||null,c=o&&a.translations||null,l=s,u=c,d=e,f=i.pop();for(let e of i){let t=null,n=d?.[e];n&&(t=d=n);let r=u?.[e];r&&(t=u=r);let i=l?.[e];i&&(t=l=i),n||(d=t),r||(u=t),i||(l=t)}return l?.[f]??u?.[f]??d?.[f]??``}return r}var Vt=[`aria-owns`],Ht={class:`shell`},Ut=[`title`],Wt={class:`search-actions before`},Gt=[`title`],Kt=[`aria-activedescendant`,`aria-controls`,`placeholder`],qt={class:`search-actions`},Jt=[`role`,`aria-label`],Yt=[`title`],Xt=[`disabled`,`title`],Zt=[`id`,`role`,`aria-busy`,`aria-labelledby`],Qt=[`id`,`aria-selected`],$t=[`href`,`aria-label`,`onMouseenter`,`onFocusin`,`data-index`],en={class:`titles`},tn=[`innerHTML`],nn={class:`title main`},rn=[`innerHTML`],an={key:0,class:`excerpt-wrapper`},on={key:0,class:`excerpt`,inert:``},sn=[`innerHTML`],cn={key:0,class:`no-results`},ln={class:`search-keyboard-shortcuts`},un=[`aria-label`],dn=[`aria-label`],fn=[`aria-label`],pn=[`aria-label`],mn=oe({__name:`VPLocalSearchBox`,emits:[`close`],setup(e,{emit:n}){let c=n,C=i(`el`),T=i(`resultsEl`),oe=b(_e),k=ge(),{activate:ve}=Qe(C,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:A,theme:j}=k,M=y(!1),N=y(!1),P=O(()=>M.value||N.value),ye=me(async()=>{let e=(await oe.value[A.value]?.())?.default;return e?ue(yt.loadJSON(e,{fields:[`title`,`titles`,`text`],storeFields:[`title`,`titles`],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...j.value.search?.provider===`local`&&j.value.search.options?.miniSearch?.searchOptions},...j.value.search?.provider===`local`&&j.value.search.options?.miniSearch?.options})):null},void 0,M),F=O(()=>j.value.search?.provider===`local`&&j.value.search.options?.disableQueryPersistence===!0).value?y(``):u(`vitepress:local-search-filter`,``),I=h(`vitepress:local-search-detailed-list`,j.value.search?.provider===`local`&&j.value.search.options?.detailedView===!0),L=O(()=>j.value.search?.provider===`local`&&j.value.search.options?.detailedView===!1);s(()=>{L.value&&(I.value=!1)});let R=b([]),be=y(!1);ce(F,()=>{be.value=!1});let xe=me(async()=>{if(T.value)return ue(new tt(T.value))},null),z=new zt(16);l(()=>[ye.value,F.value,I.value],async([e,t,n],r,i)=>{r?.[0]!==e&&z.clear();let a=!1;if(i(()=>{a=!0,N.value=!1}),!e){R.value=[];return}N.value=!0,R.value=e.search(t).slice(0,16),be.value=!0;let o=n?await Promise.all(R.value.map(e=>Se(e.id))):[];if(a)return;for(let{id:e,mod:t}of o){let n=e.replace(/#.*$/,``),r=z.get(n);if(r)continue;r=new Map,z.set(n,r);let i=t.default??t;if(i?.render||i?.setup){let e=se(i);e.config.warnHandler=()=>{},e.provide(v,k),Object.defineProperties(e.config.globalProperties,{$frontmatter:{get(){return k.frontmatter.value}},$params:{get(){return k.page.value.params}}});let t=document.createElement(`div`);e.mount(t),t.querySelectorAll(`h1, h2, h3, h4, h5, h6`).forEach(e=>{let t=e.querySelector(`a`)?.getAttribute(`href`),n=t?.startsWith(`#`)&&t.slice(1);if(!n)return;let i=``;for(;(e=e.nextElementSibling)&&!/^h[1-6]$/i.test(e.tagName);)i+=e.outerHTML;r.set(n,i)}),e.unmount()}if(a)return}let s=new Set;if(R.value=R.value.map(e=>{let[t,n]=e.id.split(`#`),r=z.get(t)?.get(n)??``;for(let t in e.match)s.add(t);return{...e,text:r}}),await g(),a)return;await new Promise(e=>{xe.value?.unmark({done:()=>{xe.value?.markRegExp(ke(s),{done:e})}})});let c=C.value?.querySelectorAll(`.result .excerpt`)??[];for(let e of c)e.querySelector(`mark[data-markjs="true"]`)?.scrollIntoView({block:`center`});T.value?.firstElementChild?.scrollIntoView({block:`start`}),N.value=!1},{debounce:200,immediate:!0});async function Se(e){let t=ae(w(e.replace(/#.*$/,``)));try{if(!t)throw Error(`Cannot find file for id: ${e}`);return{id:e,mod:await import(t)}}catch(t){return console.error(t),{id:e,mod:{}}}}let B=i(`searchInput`),Ce=O(()=>F.value?.length<=0);function we(e=!0){B.value?.focus(),e&&B.value?.select()}re(()=>{we()});function Te(e){e.pointerType===`mouse`&&we()}let V=y(-1),H=y(!0);ce(R,e=>{V.value=e.length?0:-1,U()});function U(){g(()=>{document.querySelector(`.result.selected`)?.scrollIntoView({block:`nearest`})})}function Ee(e){e.preventDefault(),V.value--,V.value<0&&(V.value=R.value.length-1),H.value=!0,U()}function De(e){e.preventDefault(),V.value++,V.value>=R.value.length&&(V.value=0),H.value=!0,U()}function W(e){return e.ctrlKey&&!e.altKey&&!e.metaKey&&!e.shiftKey&&document.documentElement.classList.contains(`mac`)}m(`ArrowUp`,Ee),m(`ArrowDown`,De),m([`p`,`P`],e=>{W(e)&&Ee(e)}),m([`n`,`N`],e=>{W(e)&&De(e)});let G=ee();m(`Enter`,e=>{if(e.isComposing||e.target instanceof HTMLButtonElement&&e.target.type!==`submit`)return;let t=R.value[V.value];e.target instanceof HTMLInputElement&&!t?e.preventDefault():t&&(G.go(w(t.id)),c(`close`))}),m(`Escape`,()=>{c(`close`)});let K=Bt({button:{buttonText:`Search`},modal:{displayDetails:`Display detailed list`,resetButtonTitle:`Reset search`,backButtonTitle:`Close search`,noResultsText:`No results for`,footer:{selectText:`to select`,selectKeyAriaLabel:`enter`,navigateText:`to navigate`,navigateUpKeyAriaLabel:`up arrow`,navigateDownKeyAriaLabel:`down arrow`,closeText:`to close`,closeKeyAriaLabel:`escape`}}});re(()=>{window.history.pushState(null,``,null)}),pe(`popstate`,e=>{e.preventDefault(),c(`close`)});let q=he();re(()=>{g(()=>{q.value=!0,g().then(()=>ve())})}),d(()=>{q.value=!1});function Oe(){F.value=``,g().then(()=>we(!1))}function ke(e){return new RegExp([...e].sort((e,t)=>t.length-e.length).map(e=>`(${a(e)})`).join(`|`),`gi`)}function J(e){if(!H.value)return;let t=e.target?.closest(`.result`),n=Number.parseInt(t?.dataset.index);n>=0&&n!==V.value&&(V.value=n),H.value=!1}return(e,n)=>(f(),ie(ne,{to:`body`},[x(`div`,{ref_key:`el`,ref:C,role:`button`,"aria-owns":R.value?.length?`localsearch-list`:void 0,"aria-expanded":`true`,"aria-haspopup":`listbox`,"aria-labelledby":`localsearch-label`,class:`VPLocalSearchBox`},[x(`div`,{class:`backdrop`,onClick:n[0]||=t=>e.$emit(`close`)}),x(`div`,Ht,[x(`form`,{class:`search-bar`,onPointerup:n[4]||=e=>Te(e),onSubmit:n[5]||=de(()=>{},[`prevent`])},[x(`label`,{title:E(K)(`button.buttonText`),id:`localsearch-label`,for:`localsearch-input`},[...n[7]||=[x(`span`,{"aria-hidden":`true`,class:`vpi-search search-icon local-search-icon`},null,-1)]],8,Ut),x(`div`,Wt,[x(`button`,{class:`back-button`,title:E(K)(`modal.backButtonTitle`),onClick:n[1]||=t=>e.$emit(`close`)},[...n[8]||=[x(`span`,{class:`vpi-arrow-left local-search-icon`},null,-1)]],8,Gt)]),_(x(`input`,{ref_key:`searchInput`,ref:B,"onUpdate:modelValue":n[2]||=e=>te(F)?F.value=e:null,"aria-activedescendant":V.value>-1?`localsearch-item-`+V.value:void 0,"aria-autocomplete":`both`,"aria-controls":R.value?.length?`localsearch-list`:void 0,"aria-labelledby":`localsearch-label`,autocapitalize:`off`,autocomplete:`off`,autocorrect:`off`,class:`search-input`,id:`localsearch-input`,enterkeyhint:`go`,maxlength:`64`,placeholder:E(K)(`button.buttonText`),spellcheck:`false`,type:`search`},null,8,Kt),[[p,E(F)]]),x(`div`,qt,[x(`span`,{class:r([`search-loading`,{active:P.value}]),role:P.value?`status`:void 0,"aria-live":`polite`,"aria-label":P.value?`Loading search results`:void 0},null,10,Jt),L.value?fe(``,!0):(f(),S(`button`,{key:0,class:r([`toggle-layout-button`,{"detailed-list":E(I)}]),type:`button`,title:E(K)(`modal.displayDetails`),onClick:n[3]||=e=>V.value>-1&&(I.value=!E(I))},[...n[9]||=[x(`span`,{class:`vpi-layout-list local-search-icon`},null,-1)]],10,Yt)),x(`button`,{class:`clear-button`,type:`reset`,disabled:Ce.value,title:E(K)(`modal.resetButtonTitle`),onClick:Oe},[...n[10]||=[x(`span`,{class:`vpi-delete local-search-icon`},null,-1)]],8,Xt)])],32),x(`ul`,{ref_key:`resultsEl`,ref:T,id:R.value?.length?`localsearch-list`:void 0,role:R.value?.length?`listbox`:void 0,"aria-busy":P.value?`true`:`false`,"aria-labelledby":R.value?.length?`localsearch-label`:void 0,class:`results`,onMousemove:J},[(f(!0),S(le,null,o(R.value,(t,i)=>(f(),S(`li`,{key:t.id,id:`localsearch-item-`+i,"aria-selected":V.value===i?`true`:`false`,role:`option`},[x(`a`,{href:E(w)(t.id),class:r([`result`,{selected:V.value===i}]),"aria-label":[...t.titles,t.title].join(` > `),onMouseenter:e=>!H.value&&(V.value=i),onFocusin:e=>V.value=i,onClick:n[6]||=t=>e.$emit(`close`),"data-index":i},[x(`div`,null,[x(`div`,en,[n[12]||=x(`span`,{class:`title-icon`},`#`,-1),(f(!0),S(le,null,o(t.titles,(e,t)=>(f(),S(`span`,{key:t,class:`title`},[x(`span`,{class:`text`,innerHTML:e},null,8,tn),n[11]||=x(`span`,{class:`vpi-chevron-right local-search-icon`},null,-1)]))),128)),x(`span`,nn,[x(`span`,{class:`text`,innerHTML:t.title},null,8,rn)])]),E(I)?(f(),S(`div`,an,[t.text?(f(),S(`div`,on,[x(`div`,{class:`vp-doc`,innerHTML:t.text},null,8,sn)])):fe(``,!0),n[13]||=x(`div`,{class:`excerpt-gradient-bottom`},null,-1),n[14]||=x(`div`,{class:`excerpt-gradient-top`},null,-1)])):fe(``,!0)])],42,$t)],8,Qt))),128)),E(F)&&!R.value.length&&be.value?(f(),S(`li`,cn,[D(t(E(K)(`modal.noResultsText`))+` "`,1),x(`strong`,null,t(E(F)),1),n[15]||=D(`" `,-1)])):fe(``,!0)],40,Zt),x(`div`,ln,[x(`span`,null,[x(`kbd`,{"aria-label":E(K)(`modal.footer.navigateUpKeyAriaLabel`)},[...n[16]||=[x(`span`,{class:`vpi-arrow-up navigate-icon`},null,-1)]],8,un),x(`kbd`,{"aria-label":E(K)(`modal.footer.navigateDownKeyAriaLabel`)},[...n[17]||=[x(`span`,{class:`vpi-arrow-down navigate-icon`},null,-1)]],8,dn),D(` `+t(E(K)(`modal.footer.navigateText`)),1)]),x(`span`,null,[x(`kbd`,{"aria-label":E(K)(`modal.footer.selectKeyAriaLabel`)},[...n[18]||=[x(`span`,{class:`vpi-corner-down-left navigate-icon`},null,-1)]],8,fn),D(` `+t(E(K)(`modal.footer.selectText`)),1)]),x(`span`,null,[x(`kbd`,{"aria-label":E(K)(`modal.footer.closeKeyAriaLabel`)},`esc`,8,pn),D(` `+t(E(K)(`modal.footer.closeText`)),1)])])])],8,Vt)]))}},[[`__scopeId`,`data-v-6f4d18b8`]]);export{mn as default};