tmagic-editor/docs/assets/chunks/VPLocalSearchBox.CZfGeIA2.js
2026-06-02 11:11:57 +00:00

4 lines
61 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{aS as _t,f as Le,c as Se,bg as Tt,bh as qe,bi as Et,bj as It,bk as kt,s as ne,y as Nt,bl as He,r as ue,bm as Ft,bn as Rt,w as Ot,bo as At,o as Ne,n as de,aO as me,bp as Ct,bq as Mt,aT as Lt,aG as Dt,X as Pt,I as zt,A as B,B as k,W as Vt,K as jt,u as C,ai as $t,h as Bt,z as q,L as ge,E as Ge,a5 as Qe,Q as Ye,O as fe,P as he,a1 as Wt,an as Ze,au as Kt,aX as Jt,b0 as Ut,br as qt,ax as Ht}from"./framework.V2ssSR2R.js";import{u as lt}from"./theme.osynohDU.js";const Gt={root:()=>_t(()=>import("./@localSearchIndexroot.8Wutp_db.js"),[])};var ct=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[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] *)"],xe=ct.join(","),ut=typeof Element>"u",Z=ut?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,_e=!ut&&Element.prototype.getRootNode?function(a){var e;return a==null||(e=a.getRootNode)===null||e===void 0?void 0:e.call(a)}:function(a){return a?.ownerDocument},Te=function(e,t){var n;t===void 0&&(t=!0);var s=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"inert"),i=s===""||s==="true",r=i||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Te(e.parentNode));return r},Qt=function(e){var t,n=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return n===""||n==="true"},dt=function(e,t,n){if(Te(e))return[];var s=Array.prototype.slice.apply(e.querySelectorAll(xe));return t&&Z.call(e,xe)&&s.unshift(e),s=s.filter(n),s},Ee=function(e,t,n){for(var s=[],i=Array.from(e);i.length;){var r=i.shift();if(!Te(r,!1))if(r.tagName==="SLOT"){var o=r.assignedElements(),l=o.length?o:r.children,c=Ee(l,!0,n);n.flatten?s.push.apply(s,c):s.push({scopeParent:r,candidates:c})}else{var f=Z.call(r,xe);f&&n.filter(r)&&(t||!e.includes(r))&&s.push(r);var p=r.shadowRoot||typeof n.getShadowRoot=="function"&&n.getShadowRoot(r),h=!Te(p,!1)&&(!n.shadowRootFilter||n.shadowRootFilter(r));if(p&&h){var y=Ee(p===!0?r.children:p.children,!0,n);n.flatten?s.push.apply(s,y):s.push({scopeParent:r,candidates:y})}else i.unshift.apply(i,r.children)}}return s},ft=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},Y=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||Qt(e))&&!ft(e)?0:e.tabIndex},Yt=function(e,t){var n=Y(e);return n<0&&t&&!ft(e)?0:n},Zt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},ht=function(e){return e.tagName==="INPUT"},Xt=function(e){return ht(e)&&e.type==="hidden"},en=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(n){return n.tagName==="SUMMARY"});return t},tn=function(e,t){for(var n=0;n<e.length;n++)if(e[n].checked&&e[n].form===t)return e[n]},nn=function(e){if(!e.name)return!0;var t=e.form||_e(e),n=function(o){return t.querySelectorAll('input[type="radio"][name="'+o+'"]')},s;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")s=n(window.CSS.escape(e.name));else try{s=n(e.name)}catch(r){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",r.message),!1}var i=tn(s,e.form);return!i||i===e},rn=function(e){return ht(e)&&e.type==="radio"},sn=function(e){return rn(e)&&!nn(e)},an=function(e){var t,n=e&&_e(e),s=(t=n)===null||t===void 0?void 0:t.host,i=!1;if(n&&n!==e){var r,o,l;for(i=!!((r=s)!==null&&r!==void 0&&(o=r.ownerDocument)!==null&&o!==void 0&&o.contains(s)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!i&&s;){var c,f,p;n=_e(s),s=(c=n)===null||c===void 0?void 0:c.host,i=!!((f=s)!==null&&f!==void 0&&(p=f.ownerDocument)!==null&&p!==void 0&&p.contains(s))}}return i},Xe=function(e){var t=e.getBoundingClientRect(),n=t.width,s=t.height;return n===0&&s===0},on=function(e,t){var n=t.displayCheck,s=t.getShadowRoot;if(n==="full-native"&&"checkVisibility"in e){var i=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!i}if(getComputedStyle(e).visibility==="hidden")return!0;var r=Z.call(e,"details>summary:first-of-type"),o=r?e.parentElement:e;if(Z.call(o,"details:not([open]) *"))return!0;if(!n||n==="full"||n==="full-native"||n==="legacy-full"){if(typeof s=="function"){for(var l=e;e;){var c=e.parentElement,f=_e(e);if(c&&!c.shadowRoot&&s(c)===!0)return Xe(e);e.assignedSlot?e=e.assignedSlot:!c&&f!==e.ownerDocument?e=f.host:e=c}e=l}if(an(e))return!e.getClientRects().length;if(n!=="legacy-full")return!0}else if(n==="non-zero-area")return Xe(e);return!1},ln=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 s=t.children.item(n);if(s.tagName==="LEGEND")return Z.call(t,"fieldset[disabled] *")?!0:!s.contains(e)}return!0}t=t.parentElement}return!1},Ie=function(e,t){return!(t.disabled||Xt(t)||on(t,e)||en(t)||ln(t))},De=function(e,t){return!(sn(t)||Y(t)<0||!Ie(e,t))},cn=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},vt=function(e){var t=[],n=[];return e.forEach(function(s,i){var r=!!s.scopeParent,o=r?s.scopeParent:s,l=Yt(o,r),c=r?vt(s.candidates):o;l===0?r?t.push.apply(t,c):t.push(o):n.push({documentOrder:i,tabIndex:l,item:s,isScope:r,content:c})}),n.sort(Zt).reduce(function(s,i){return i.isScope?s.push.apply(s,i.content):s.push(i.content),s},[]).concat(t)},un=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Ee([e],t.includeContainer,{filter:De.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:cn}):n=dt(e,t.includeContainer,De.bind(null,t)),vt(n)},dn=function(e,t){t=t||{};var n;return t.getShadowRoot?n=Ee([e],t.includeContainer,{filter:Ie.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):n=dt(e,t.includeContainer,Ie.bind(null,t)),n},ee=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Z.call(e,xe)===!1?!1:De(t,e)},fn=ct.concat("iframe:not([inert]):not([inert] *)").join(","),Fe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return Z.call(e,fn)===!1?!1:Ie(t,e)};function Pe(a,e){(e==null||e>a.length)&&(e=a.length);for(var t=0,n=Array(e);t<e;t++)n[t]=a[t];return n}function hn(a){if(Array.isArray(a))return Pe(a)}function et(a,e){var t=typeof Symbol<"u"&&a[Symbol.iterator]||a["@@iterator"];if(!t){if(Array.isArray(a)||(t=pt(a))||e){t&&(a=t);var n=0,s=function(){};return{s,n:function(){return n>=a.length?{done:!0}:{done:!1,value:a[n++]}},e:function(l){throw l},f:s}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var i,r=!0,o=!1;return{s:function(){t=t.call(a)},n:function(){var l=t.next();return r=l.done,l},e:function(l){o=!0,i=l},f:function(){try{r||t.return==null||t.return()}finally{if(o)throw i}}}}function vn(a,e,t){return(e=yn(e))in a?Object.defineProperty(a,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):a[e]=t,a}function pn(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function mn(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tt(a,e){var t=Object.keys(a);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(a);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(a,s).enumerable})),t.push.apply(t,n)}return t}function nt(a){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?tt(Object(t),!0).forEach(function(n){vn(a,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(t)):tt(Object(t)).forEach(function(n){Object.defineProperty(a,n,Object.getOwnPropertyDescriptor(t,n))})}return a}function gn(a){return hn(a)||pn(a)||pt(a)||mn()}function bn(a,e){if(typeof a!="object"||!a)return a;var t=a[Symbol.toPrimitive];if(t!==void 0){var n=t.call(a,e);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(a)}function yn(a){var e=bn(a,"string");return typeof e=="symbol"?e:e+""}function pt(a,e){if(a){if(typeof a=="string")return Pe(a,e);var t={}.toString.call(a).slice(8,-1);return t==="Object"&&a.constructor&&(t=a.constructor.name),t==="Map"||t==="Set"?Array.from(a):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Pe(a,e):void 0}}var W={getActiveTrap:function(e){return e?.length>0?e[e.length-1]:null},activateTrap:function(e,t){var n=W.getActiveTrap(e);t!==n&&W.pauseTrap(e);var s=e.indexOf(t);s===-1||e.splice(s,1),e.push(t)},deactivateTrap:function(e,t){var n=e.indexOf(t);n!==-1&&e.splice(n,1),W.unpauseTrap(e)},pauseTrap:function(e){var t=W.getActiveTrap(e);t?._setPausedState(!0)},unpauseTrap:function(e){var t=W.getActiveTrap(e);t&&!t._isManuallyPaused()&&t._setPausedState(!1)}},wn=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},Sn=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},pe=function(e){return e?.key==="Tab"||e?.keyCode===9},xn=function(e){return pe(e)&&!e.shiftKey},_n=function(e){return pe(e)&&e.shiftKey},rt=function(e){return setTimeout(e,0)},ve=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),s=1;s<t;s++)n[s-1]=arguments[s];return typeof e=="function"?e.apply(void 0,n):e},be=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},Tn=[],En=function(e,t){var n=t?.document||document,s=t?.trapStack||Tn,i=nt({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,delayReturnFocus:!0,isolateSubtrees:!1,isKeyForward:xn,isKeyBackward:_n},t),r={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,l=function(u,d,b){return u&&u[d]!==void 0?u[d]:i[b||d]},c=function(u,d){var b=typeof d?.composedPath=="function"?d.composedPath():void 0;return r.containerGroups.findIndex(function(I){var m=I.container,v=I.tabbableNodes;return m.contains(u)||b?.includes(m)||v.find(function(g){return g===u})})},f=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},b=d.hasFallback,I=b===void 0?!1:b,m=d.params,v=m===void 0?[]:m,g=i[u];if(typeof g=="function"&&(g=g.apply(void 0,gn(v))),g===!0&&(g=void 0),!g){if(g===void 0||g===!1)return g;throw new Error("`".concat(u,"` was specified but was not a node, or did not return a node"))}var _=g;if(typeof g=="string"){try{_=n.querySelector(g)}catch(x){throw new Error("`".concat(u,'` appears to be an invalid selector; error="').concat(x.message,'"'))}if(!_&&!I)throw new Error("`".concat(u,"` as selector refers to no known node"))}return _},p=function(u){var d=u.activeElement;return d?d.shadowRoot&&d.shadowRoot.activeElement!==null?p(d.shadowRoot):d:null},h=function(){var u=f("initialFocus",{hasFallback:!0});if(u===!1)return!1;if(u===void 0||u&&!Fe(u,i.tabbableOptions)){var d=p(n);if(c(d)>=0)u=d;else{var b=r.tabbableGroups[0],I=b&&b.firstTabbableNode;u=I||f("fallbackFocus")}}else u===null&&(u=f("fallbackFocus"));if(!u)throw new Error("Your focus-trap needs to have at least one focusable element");return u},y=function(){if(r.containerGroups=r.containers.map(function(u){var d=un(u,i.tabbableOptions),b=dn(u,i.tabbableOptions),I=d.length>0?d[0]:void 0,m=d.length>0?d[d.length-1]:void 0,v=b.find(function(x){return ee(x)}),g=b.slice().reverse().find(function(x){return ee(x)}),_=!!d.find(function(x){return Y(x)>0});return{container:u,tabbableNodes:d,focusableNodes:b,posTabIndexesFound:_,firstTabbableNode:I,lastTabbableNode:m,firstDomTabbableNode:v,lastDomTabbableNode:g,nextTabbableNode:function(F){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,M=d.indexOf(F);return M<0?D?b.slice(b.indexOf(F)+1).find(function(j){return ee(j)}):b.slice(0,b.indexOf(F)).reverse().find(function(j){return ee(j)}):d[M+(D?1:-1)]}}}),r.tabbableGroups=r.containerGroups.filter(function(u){return u.tabbableNodes.length>0}),r.tabbableGroups.length<=0&&!f("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(r.containerGroups.find(function(u){return u.posTabIndexesFound})&&r.containerGroups.length>1)throw new 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.")},S=function(u){if(u!==!1&&u!==p(document)){if(!u||!u.focus){S(h());return}u.focus({preventScroll:!!i.preventScroll}),r.mostRecentlyFocusedNode=u,wn(u)&&u.select()}},w=function(u){var d=f("setReturnFocus",{params:[u]});return d||(d===!1?!1:u)},T=function(u){var d=u.target,b=u.event,I=u.isBackward,m=I===void 0?!1:I;d=d||be(b),y();var v=null;if(r.tabbableGroups.length>0){var g=c(d,b),_=g>=0?r.containerGroups[g]:void 0;if(g<0)m?v=r.tabbableGroups[r.tabbableGroups.length-1].lastTabbableNode:v=r.tabbableGroups[0].firstTabbableNode;else if(m){var x=r.tabbableGroups.findIndex(function(J){var U=J.firstTabbableNode;return d===U});if(x<0&&(_.container===d||Fe(d,i.tabbableOptions)&&!ee(d,i.tabbableOptions)&&!_.nextTabbableNode(d,!1))&&(x=g),x>=0){var F=x===0?r.tabbableGroups.length-1:x-1,D=r.tabbableGroups[F];v=Y(d)>=0?D.lastTabbableNode:D.lastDomTabbableNode}else pe(b)||(v=_.nextTabbableNode(d,!1))}else{var M=r.tabbableGroups.findIndex(function(J){var U=J.lastTabbableNode;return d===U});if(M<0&&(_.container===d||Fe(d,i.tabbableOptions)&&!ee(d,i.tabbableOptions)&&!_.nextTabbableNode(d))&&(M=g),M>=0){var j=M===r.tabbableGroups.length-1?0:M+1,O=r.tabbableGroups[j];v=Y(d)>=0?O.firstTabbableNode:O.firstDomTabbableNode}else pe(b)||(v=_.nextTabbableNode(d))}}else v=f("fallbackFocus");return v},N=function(u){var d=be(u);if(!(c(d,u)>=0)){if(ve(i.clickOutsideDeactivates,u)){o.deactivate({returnFocus:i.returnFocusOnDeactivate});return}ve(i.allowOutsideClick,u)||u.preventDefault()}},R=function(u){var d=be(u),b=c(d,u)>=0;if(b||d instanceof Document)b&&(r.mostRecentlyFocusedNode=d);else{u.stopImmediatePropagation();var I,m=!0;if(r.mostRecentlyFocusedNode)if(Y(r.mostRecentlyFocusedNode)>0){var v=c(r.mostRecentlyFocusedNode),g=r.containerGroups[v].tabbableNodes;if(g.length>0){var _=g.findIndex(function(x){return x===r.mostRecentlyFocusedNode});_>=0&&(i.isKeyForward(r.recentNavEvent)?_+1<g.length&&(I=g[_+1],m=!1):_-1>=0&&(I=g[_-1],m=!1))}}else r.containerGroups.some(function(x){return x.tabbableNodes.some(function(F){return Y(F)>0})})||(m=!1);else m=!1;m&&(I=T({target:r.mostRecentlyFocusedNode,isBackward:i.isKeyBackward(r.recentNavEvent)})),S(I||r.mostRecentlyFocusedNode||h())}r.recentNavEvent=void 0},G=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;r.recentNavEvent=u;var b=T({event:u,isBackward:d});b&&(pe(u)&&u.preventDefault(),S(b))},z=function(u){(i.isKeyForward(u)||i.isKeyBackward(u))&&G(u,i.isKeyBackward(u))},$=function(u){Sn(u)&&ve(i.escapeDeactivates,u)!==!1&&(u.preventDefault(),o.deactivate())},P=function(u){var d=be(u);c(d,u)>=0||ve(i.clickOutsideDeactivates,u)||ve(i.allowOutsideClick,u)||(u.preventDefault(),u.stopImmediatePropagation())},V=function(){if(r.active){W.activateTrap(s,o);var u;return i.delayInitialFocus?u=new Promise(function(d){r.delayInitialFocusTimer=rt(function(){S(h()),d()})}):S(h()),n.addEventListener("focusin",R,!0),n.addEventListener("mousedown",N,{capture:!0,passive:!1}),n.addEventListener("touchstart",N,{capture:!0,passive:!1}),n.addEventListener("click",P,{capture:!0,passive:!1}),n.addEventListener("keydown",z,{capture:!0,passive:!1}),n.addEventListener("keydown",$),u}},A=function(u){r.active&&!r.paused&&o._setSubtreeIsolation(!1),r.adjacentElements.clear(),r.alreadySilent.clear();var d=new Set,b=new Set,I=et(u),m;try{for(I.s();!(m=I.n()).done;){var v=m.value;d.add(v);for(var g=typeof ShadowRoot<"u"&&v.getRootNode()instanceof ShadowRoot,_=v;_;){d.add(_);var x=_.parentElement,F=[];x?F=x.children:!x&&g&&(F=_.getRootNode().children,x=_.getRootNode().host,g=typeof ShadowRoot<"u"&&x.getRootNode()instanceof ShadowRoot);var D=et(F),M;try{for(D.s();!(M=D.n()).done;){var j=M.value;b.add(j)}}catch(O){D.e(O)}finally{D.f()}_=x}}}catch(O){I.e(O)}finally{I.f()}d.forEach(function(O){b.delete(O)}),r.adjacentElements=b},K=function(){if(r.active)return n.removeEventListener("focusin",R,!0),n.removeEventListener("mousedown",N,!0),n.removeEventListener("touchstart",N,!0),n.removeEventListener("click",P,!0),n.removeEventListener("keydown",z,!0),n.removeEventListener("keydown",$),o},ie=function(u){var d=r.mostRecentlyFocusedNode;if(d){var b=u.some(function(m){var v=Array.from(m.removedNodes);return v.some(function(g){return g===d||typeof g.contains=="function"&&g.contains(d)})});if(b&&r.containers.some(function(m){return m?.isConnected})){y();var I=h();S(I)}}},ae=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(ie):void 0,X=function(){ae&&(ae.disconnect(),r.active&&!r.paused&&r.containers.map(function(u){ae.observe(u,{subtree:!0,childList:!0})}))};return o={get active(){return r.active},get paused(){return r.paused},activate:function(u){if(r.active)return this;var d=l(u,"onActivate"),b=l(u,"onPostActivate"),I=l(u,"checkCanFocusTrap"),m=W.getActiveTrap(s),v=!1;if(m&&!m.paused){var g;(g=m._setSubtreeIsolation)===null||g===void 0||g.call(m,!1),v=!0}try{I||y(),r.active=!0,r.paused=!1,r.nodeFocusedBeforeActivation=p(n),d?.({trap:o});var _=function(){I&&y();var D=function(){o._setSubtreeIsolation(!0),X(),b?.({trap:o})},M=V();M?M.then(D):D()};if(I)return I(r.containers.concat()).then(_,_),this;_()}catch(F){if(m===W.getActiveTrap(s)&&v){var x;(x=m._setSubtreeIsolation)===null||x===void 0||x.call(m,!0)}throw F}return this},deactivate:function(u){if(!r.active)return this;var d=nt({onDeactivate:i.onDeactivate,onPostDeactivate:i.onPostDeactivate,checkCanReturnFocus:i.checkCanReturnFocus},u);clearTimeout(r.delayInitialFocusTimer),r.delayInitialFocusTimer=void 0,r.paused||o._setSubtreeIsolation(!1),r.alreadySilent.clear(),K(),r.active=!1,r.paused=!1,X(),W.deactivateTrap(s,o);var b=l(d,"onDeactivate"),I=l(d,"onPostDeactivate"),m=l(d,"checkCanReturnFocus"),v=l(d,"delayReturnFocus"),g=l(d,"returnFocus","returnFocusOnDeactivate");b?.({trap:o});var _=function(){g&&S(w(r.nodeFocusedBeforeActivation)),I?.({trap:o})},x=function(){v&&g?rt(_):_()};return g&&m?(m(w(r.nodeFocusedBeforeActivation)).then(x,x),this):(x(),this)},pause:function(u){return r.active?(r.manuallyPaused=!0,this._setPausedState(!0,u)):this},unpause:function(u){return r.active?(r.manuallyPaused=!1,s[s.length-1]!==this?this:this._setPausedState(!1,u)):this},updateContainerElements:function(u){var d=[].concat(u).filter(Boolean);return r.containers=d.map(function(b){return typeof b=="string"?n.querySelector(b):b}),i.isolateSubtrees&&A(r.containers),r.active&&(y(),r.paused||o._setSubtreeIsolation(!0)),X(),this}},Object.defineProperties(o,{_isManuallyPaused:{value:function(){return r.manuallyPaused}},_setPausedState:{value:function(u,d){if(r.paused===u)return this;if(r.paused=u,u){var b=l(d,"onPause"),I=l(d,"onPostPause");b?.({trap:o}),K(),o._setSubtreeIsolation(!1),X(),I?.({trap:o})}else{var m=l(d,"onUnpause"),v=l(d,"onPostUnpause");m?.({trap:o});var g=function(){y();var x=function(){o._setSubtreeIsolation(!0),X(),v?.({trap:o})},F=V();F?F.then(x):x()};g()}return this}},_setSubtreeIsolation:{value:function(u){i.isolateSubtrees&&r.adjacentElements.forEach(function(d){var b;u?i.isolateSubtrees==="aria-hidden"?((d.ariaHidden==="true"||((b=d.getAttribute("aria-hidden"))===null||b===void 0?void 0:b.toLowerCase())==="true")&&r.alreadySilent.add(d),d.setAttribute("aria-hidden","true")):((d.inert||d.hasAttribute("inert"))&&r.alreadySilent.add(d),d.setAttribute("inert",!0)):r.alreadySilent.has(d)||(i.isolateSubtrees==="aria-hidden"?d.removeAttribute("aria-hidden"):d.removeAttribute("inert"))})}}}),o.updateContainerElements(e),o};function In(a,e={}){let t;const{immediate:n,...s}=e,i=ne(!1),r=ne(!1),o=p=>t&&t.activate(p),l=p=>t&&t.deactivate(p),c=()=>{t&&(t.pause(),r.value=!0)},f=()=>{t&&(t.unpause(),r.value=!1)};return Le(Se(()=>Tt(qe(a)).map(p=>{const h=qe(p);return typeof h=="string"?h:Et(h)}).filter(It)),p=>{if(p.length)if(!t)t=En(p,{...s,onActivate(h){i.value=!0,e.onActivate&&e.onActivate(h)},onDeactivate(h){i.value=!1,e.onDeactivate&&e.onDeactivate(h)}}),n&&o();else{const h=t?.active;t?.updateContainerElements(p),!h&&n&&o()}},{flush:"post"}),kt(()=>l()),{hasFocus:i,isPaused:r,activate:o,deactivate:l,pause:c,unpause:f}}class re{constructor(e,t=!0,n=[],s=5e3){this.ctx=e,this.iframes=t,this.exclude=n,this.iframesTimeout=s}static matches(e,t){const n=typeof t=="string"?[t]:t,s=e.matches||e.matchesSelector||e.msMatchesSelector||e.mozMatchesSelector||e.oMatchesSelector||e.webkitMatchesSelector;if(s){let i=!1;return n.every(r=>s.call(e,r)?(i=!0,!1):!0),i}else return!1}getContexts(){let e,t=[];return typeof this.ctx>"u"||!this.ctx?e=[]:NodeList.prototype.isPrototypeOf(this.ctx)?e=Array.prototype.slice.call(this.ctx):Array.isArray(this.ctx)?e=this.ctx:typeof this.ctx=="string"?e=Array.prototype.slice.call(document.querySelectorAll(this.ctx)):e=[this.ctx],e.forEach(n=>{const s=t.filter(i=>i.contains(n)).length>0;t.indexOf(n)===-1&&!s&&t.push(n)}),t}getIframeContents(e,t,n=()=>{}){let s;try{const i=e.contentWindow;if(s=i.document,!i||!s)throw new Error("iframe inaccessible")}catch{n()}s&&t(s)}isIframeBlank(e){const t="about:blank",n=e.getAttribute("src").trim();return e.contentWindow.location.href===t&&n!==t&&n}observeIframeLoad(e,t,n){let s=!1,i=null;const r=()=>{if(!s){s=!0,clearTimeout(i);try{this.isIframeBlank(e)||(e.removeEventListener("load",r),this.getIframeContents(e,t,n))}catch{n()}}};e.addEventListener("load",r),i=setTimeout(r,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,s=>{n++,this.waitForIframes(s.querySelector("html"),()=>{--n||t()})},s=>{s||t()})}forEachIframe(e,t,n,s=()=>{}){let i=e.querySelectorAll("iframe"),r=i.length,o=0;i=Array.prototype.slice.call(i);const l=()=>{--r<=0&&s(o)};r||l(),i.forEach(c=>{re.matches(c,this.exclude)?l():this.onIframeReady(c,f=>{t(c)&&(o++,n(f)),l()},l)})}createIterator(e,t,n){return document.createNodeIterator(e,t,n,!1)}createInstanceOnIframe(e){return new re(e.querySelector("html"),this.iframes)}compareNodeIframe(e,t,n){const s=e.compareDocumentPosition(n),i=Node.DOCUMENT_POSITION_PRECEDING;if(s&i)if(t!==null){const r=t.compareDocumentPosition(n),o=Node.DOCUMENT_POSITION_FOLLOWING;if(r&o)return!0}else return!0;return!1}getIteratorNode(e){const t=e.previousNode();let n;return t===null?n=e.nextNode():n=e.nextNode()&&e.nextNode(),{prevNode:t,node:n}}checkIframeFilter(e,t,n,s){let i=!1,r=!1;return s.forEach((o,l)=>{o.val===n&&(i=l,r=o.handled)}),this.compareNodeIframe(e,t,n)?(i===!1&&!r?s.push({val:n,handled:!0}):i!==!1&&!r&&(s[i].handled=!0),!0):(i===!1&&s.push({val:n,handled:!1}),!1)}handleOpenIframes(e,t,n,s){e.forEach(i=>{i.handled||this.getIframeContents(i.val,r=>{this.createInstanceOnIframe(r).forEachNode(t,n,s)})})}iterateThroughNodes(e,t,n,s,i){const r=this.createIterator(t,e,s);let o=[],l=[],c,f,p=()=>({prevNode:f,node:c}=this.getIteratorNode(r),c);for(;p();)this.iframes&&this.forEachIframe(t,h=>this.checkIframeFilter(c,f,h,o),h=>{this.createInstanceOnIframe(h).forEachNode(e,y=>l.push(y),s)}),l.push(c);l.forEach(h=>{n(h)}),this.iframes&&this.handleOpenIframes(o,e,n,s),i()}forEachNode(e,t,n,s=()=>{}){const i=this.getContexts();let r=i.length;r||s(),i.forEach(o=>{const l=()=>{this.iterateThroughNodes(e,o,t,n,()=>{--r<=0&&s()})};this.iframes?this.waitForIframes(o,l):l()})}}let kn=class{constructor(e){this.ctx=e,this.ie=!1;const 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 re(this.ctx,this.opt.iframes,this.opt.exclude,this.opt.iframesTimeout)}log(e,t="debug"){const 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){const t=this.opt.synonyms,n=this.opt.caseSensitive?"":"i",s=this.opt.ignoreJoiners||this.opt.ignorePunctuation.length?"\0":"";for(let i in t)if(t.hasOwnProperty(i)){const r=t[i],o=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(i):this.escapeStr(i),l=this.opt.wildcards!=="disabled"?this.setupWildcardsRegExp(r):this.escapeStr(r);o!==""&&l!==""&&(e=e.replace(new RegExp(`(${this.escapeStr(o)}|${this.escapeStr(l)})`,`gm${n}`),s+`(${this.processSynomyms(o)}|${this.processSynomyms(l)})`+s))}return e}processSynomyms(e){return(this.opt.ignoreJoiners||this.opt.ignorePunctuation.length)&&(e=this.setupIgnoreJoinersRegExp(e)),e}setupWildcardsRegExp(e){return e=e.replace(/(?:\\)*\?/g,t=>t.charAt(0)==="\\"?"?":""),e.replace(/(?:\\)*\*/g,t=>t.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,(t,n,s)=>{let i=s.charAt(n+1);return/[(|)\\]/.test(i)||i===""?t:t+"\0"})}createJoinersRegExp(e){let t=[];const 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){const 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ŽŻŹ"]:["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ŽŻŹ"];let s=[];return e.split("").forEach(i=>{n.every(r=>{if(r.indexOf(i)!==-1){if(s.indexOf(r)>-1)return!1;e=e.replace(new RegExp(`[${r}]`,`gm${t}`),`[${r}]`),s.push(r)}return!0})}),e}createMergedBlanksRegExp(e){return e.replace(/[\s]+/gmi,"[\\s]+")}createAccuracyRegExp(e){const t="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~¡¿";let n=this.opt.accuracy,s=typeof n=="string"?n:n.value,i=typeof n=="string"?[]:n.limiters,r="";switch(i.forEach(o=>{r+=`|${this.escapeStr(o)}`}),s){case"partially":default:return`()(${e})`;case"complementary":return r="\\s"+(r||this.escapeStr(t)),`()([^${r}]*${e}[^${r}]*)`;case"exactly":return`(^|\\s${r})(${e})(?=$|\\s${r})`}}getSeparatedKeywords(e){let t=[];return e.forEach(n=>{this.opt.separateWordSearch?n.split(" ").forEach(s=>{s.trim()&&t.indexOf(s)===-1&&t.push(s)}):n.trim()&&t.indexOf(n)===-1&&t.push(n)}),{keywords:t.sort((n,s)=>s.length-n.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),[];const t=[];let n=0;return e.sort((s,i)=>s.start-i.start).forEach(s=>{let{start:i,end:r,valid:o}=this.callNoMatchOnInvalidRanges(s,n);o&&(s.start=i,s.length=r-i,t.push(s),n=r)}),t}callNoMatchOnInvalidRanges(e,t){let n,s,i=!1;return e&&typeof e.start<"u"?(n=parseInt(e.start,10),s=n+parseInt(e.length,10),this.isNumeric(e.start)&&this.isNumeric(e.length)&&s-t>0&&s-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:s,valid:i}}checkWhitespaceRanges(e,t,n){let s,i=!0,r=n.length,o=t-r,l=parseInt(e.start,10)-o;return l=l>r?r:l,s=l+parseInt(e.length,10),s>r&&(s=r,this.log(`End range automatically set to the max value of ${r}`)),l<0||s-l<0||l>r||s>r?(i=!1,this.log(`Invalid range: ${JSON.stringify(e)}`),this.opt.noMatch(e)):n.substring(l,s).replace(/\s+/g,"")===""&&(i=!1,this.log("Skipping whitespace only range: "+JSON.stringify(e)),this.opt.noMatch(e)),{start:l,end:s,valid:i}}getTextNodes(e){let t="",n=[];this.iterator.forEachNode(NodeFilter.SHOW_TEXT,s=>{n.push({start:t.length,end:(t+=s.textContent).length,node:s})},s=>this.matchesExclude(s.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT,()=>{e({value:t,nodes:n})})}matchesExclude(e){return re.matches(e,this.opt.exclude.concat(["script","style","title","head","html"]))}wrapRangeInTextNode(e,t,n){const s=this.opt.element?this.opt.element:"mark",i=e.splitText(t),r=i.splitText(n-t);let o=document.createElement(s);return o.setAttribute("data-markjs","true"),this.opt.className&&o.setAttribute("class",this.opt.className),o.textContent=i.textContent,i.parentNode.replaceChild(o,i),r}wrapRangeInMappedTextNode(e,t,n,s,i){e.nodes.every((r,o)=>{const l=e.nodes[o+1];if(typeof l>"u"||l.start>t){if(!s(r.node))return!1;const c=t-r.start,f=(n>r.end?r.end:n)-r.start,p=e.value.substr(0,r.start),h=e.value.substr(f+r.start);if(r.node=this.wrapRangeInTextNode(r.node,c,f),e.value=p+h,e.nodes.forEach((y,S)=>{S>=o&&(e.nodes[S].start>0&&S!==o&&(e.nodes[S].start-=f),e.nodes[S].end-=f)}),n-=f,i(r.node.previousSibling,r.start),n>r.end)t=r.end;else return!1}return!0})}wrapMatches(e,t,n,s,i){const r=t===0?0:t+1;this.getTextNodes(o=>{o.nodes.forEach(l=>{l=l.node;let c;for(;(c=e.exec(l.textContent))!==null&&c[r]!=="";){if(!n(c[r],l))continue;let f=c.index;if(r!==0)for(let p=1;p<r;p++)f+=c[p].length;l=this.wrapRangeInTextNode(l,f,f+c[r].length),s(l.previousSibling),e.lastIndex=0}}),i()})}wrapMatchesAcrossElements(e,t,n,s,i){const r=t===0?0:t+1;this.getTextNodes(o=>{let l;for(;(l=e.exec(o.value))!==null&&l[r]!=="";){let c=l.index;if(r!==0)for(let p=1;p<r;p++)c+=l[p].length;const f=c+l[r].length;this.wrapRangeInMappedTextNode(o,c,f,p=>n(l[r],p),(p,h)=>{e.lastIndex=h,s(p)})}i()})}wrapRangeFromIndex(e,t,n,s){this.getTextNodes(i=>{const r=i.value.length;e.forEach((o,l)=>{let{start:c,end:f,valid:p}=this.checkWhitespaceRanges(o,r,i.value);p&&this.wrapRangeInMappedTextNode(i,c,f,h=>t(h,o,i.value.substring(c,f),l),h=>{n(h,o)})}),s()})}unwrapMatches(e){const t=e.parentNode;let 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,s="wrapMatches";const i=r=>{n++,this.opt.each(r)};this.opt.acrossElements&&(s="wrapMatchesAcrossElements"),this[s](e,this.opt.ignoreGroups,(r,o)=>this.opt.filter(o,r,n),i,()=>{n===0&&this.opt.noMatch(e),this.opt.done(n)})}mark(e,t){this.opt=t;let n=0,s="wrapMatches";const{keywords:i,length:r}=this.getSeparatedKeywords(typeof e=="string"?[e]:e),o=this.opt.caseSensitive?"":"i",l=c=>{let f=new RegExp(this.createRegExp(c),`gm${o}`),p=0;this.log(`Searching with expression "${f}"`),this[s](f,1,(h,y)=>this.opt.filter(y,c,n,p),h=>{p++,n++,this.opt.each(h)},()=>{p===0&&this.opt.noMatch(c),i[r-1]===c?this.opt.done(n):l(i[i.indexOf(c)+1])})};this.opt.acrossElements&&(s="wrapMatchesAcrossElements"),r===0?this.opt.done(n):l(i[0])}markRanges(e,t){this.opt=t;let n=0,s=this.checkRanges(e);s&&s.length?(this.log("Starting to mark with the following ranges: "+JSON.stringify(s)),this.wrapRangeFromIndex(s,(i,r,o,l)=>this.opt.filter(i,r,o,l),(i,r)=>{n++,this.opt.each(i,r)},()=>{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,n=>{this.unwrapMatches(n)},n=>{const s=re.matches(n,t),i=this.matchesExclude(n);return!s||i?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},this.opt.done)}};function Nn(a){const e=new kn(a);return this.mark=(t,n)=>(e.mark(t,n),this),this.markRegExp=(t,n)=>(e.markRegExp(t,n),this),this.markRanges=(t,n)=>(e.markRanges(t,n),this),this.unmark=t=>(e.unmark(t),this),this}const Fn="ENTRIES",mt="KEYS",gt="VALUES",L="";class Re{constructor(e,t){const n=e._tree,s=Array.from(n.keys());this.set=e,this._type=t,this._path=s.length>0?[{node:n,keys:s}]:[]}next(){const e=this.dive();return this.backtrack(),e}dive(){if(this._path.length===0)return{done:!0,value:void 0};const{node:e,keys:t}=te(this._path);if(te(t)===L)return{done:!1,value:this.result()};const n=e.get(te(t));return this._path.push({node:n,keys:Array.from(n.keys())}),this.dive()}backtrack(){if(this._path.length===0)return;const e=te(this._path).keys;e.pop(),!(e.length>0)&&(this._path.pop(),this.backtrack())}key(){return this.set._prefix+this._path.map(({keys:e})=>te(e)).filter(e=>e!==L).join("")}value(){return te(this._path).node.get(L)}result(){switch(this._type){case gt:return this.value();case mt:return this.key();default:return[this.key(),this.value()]}}[Symbol.iterator](){return this}}const te=a=>a[a.length-1],Rn=(a,e,t)=>{const n=new Map;if(e===void 0)return n;const s=e.length+1,i=s+t,r=new Uint8Array(i*s).fill(t+1);for(let o=0;o<s;++o)r[o]=o;for(let o=1;o<i;++o)r[o*s]=o;return bt(a,e,t,n,r,1,s,""),n},bt=(a,e,t,n,s,i,r,o)=>{const l=i*r;e:for(const c of a.keys())if(c===L){const f=s[l-1];f<=t&&n.set(o,[a.get(c),f])}else{let f=i;for(let p=0;p<c.length;++p,++f){const h=c[p],y=r*f,S=y-r;let w=s[y];const T=Math.max(0,f-t-1),N=Math.min(r-1,f+t);for(let R=T;R<N;++R){const G=h!==e[R],z=s[S+R]+ +G,$=s[S+R+1]+1,P=s[y+R]+1,V=s[y+R+1]=Math.min(z,$,P);V<w&&(w=V)}if(w>t)continue e}bt(a.get(c),e,t,n,s,f,r,o+c)}};class H{constructor(e=new Map,t=""){this._size=void 0,this._tree=e,this._prefix=t}atPrefix(e){if(!e.startsWith(this._prefix))throw new Error("Mismatched prefix");const[t,n]=ke(this._tree,e.slice(this._prefix.length));if(t===void 0){const[s,i]=$e(n);for(const r of s.keys())if(r!==L&&r.startsWith(i)){const o=new Map;return o.set(r.slice(i.length),s.get(r)),new H(o,e)}}return new H(t,e)}clear(){this._size=void 0,this._tree.clear()}delete(e){return this._size=void 0,On(this._tree,e)}entries(){return new Re(this,Fn)}forEach(e){for(const[t,n]of this)e(t,n,this)}fuzzyGet(e,t){return Rn(this._tree,e,t)}get(e){const t=ze(this._tree,e);return t!==void 0?t.get(L):void 0}has(e){const t=ze(this._tree,e);return t!==void 0&&t.has(L)}keys(){return new Re(this,mt)}set(e,t){if(typeof e!="string")throw new Error("key must be a string");return this._size=void 0,Oe(this._tree,e).set(L,t),this}get size(){if(this._size)return this._size;this._size=0;const e=this.entries();for(;!e.next().done;)this._size+=1;return this._size}update(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const n=Oe(this._tree,e);return n.set(L,t(n.get(L))),this}fetch(e,t){if(typeof e!="string")throw new Error("key must be a string");this._size=void 0;const n=Oe(this._tree,e);let s=n.get(L);return s===void 0&&n.set(L,s=t()),s}values(){return new Re(this,gt)}[Symbol.iterator](){return this.entries()}static from(e){const t=new H;for(const[n,s]of e)t.set(n,s);return t}static fromObject(e){return H.from(Object.entries(e))}}const ke=(a,e,t=[])=>{if(e.length===0||a==null)return[a,t];for(const n of a.keys())if(n!==L&&e.startsWith(n))return t.push([a,n]),ke(a.get(n),e.slice(n.length),t);return t.push([a,e]),ke(void 0,"",t)},ze=(a,e)=>{if(e.length===0||a==null)return a;for(const t of a.keys())if(t!==L&&e.startsWith(t))return ze(a.get(t),e.slice(t.length))},Oe=(a,e)=>{const t=e.length;e:for(let n=0;a&&n<t;){for(const i of a.keys())if(i!==L&&e[n]===i[0]){const r=Math.min(t-n,i.length);let o=1;for(;o<r&&e[n+o]===i[o];)++o;const l=a.get(i);if(o===i.length)a=l;else{const c=new Map;c.set(i.slice(o),l),a.set(e.slice(n,n+o),c),a.delete(i),a=c}n+=o;continue e}const s=new Map;return a.set(e.slice(n),s),s}return a},On=(a,e)=>{const[t,n]=ke(a,e);if(t!==void 0){if(t.delete(L),t.size===0)yt(n);else if(t.size===1){const[s,i]=t.entries().next().value;wt(n,s,i)}}},yt=a=>{if(a.length===0)return;const[e,t]=$e(a);if(e.delete(t),e.size===0)yt(a.slice(0,-1));else if(e.size===1){const[n,s]=e.entries().next().value;n!==L&&wt(a.slice(0,-1),n,s)}},wt=(a,e,t)=>{if(a.length===0)return;const[n,s]=$e(a);n.set(s+e,t),n.delete(s)},$e=a=>a[a.length-1],Be="or",St="and",An="and_not";class se{constructor(e){if(e?.fields==null)throw new Error('MiniSearch: option "fields" must be provided');const t=e.autoVacuum==null||e.autoVacuum===!0?Me:e.autoVacuum;this._options={...Ce,...e,autoVacuum:t,searchOptions:{...st,...e.searchOptions||{}},autoSuggestOptions:{...Pn,...e.autoSuggestOptions||{}}},this._index=new H,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=je,this.addFields(this._options.fields)}add(e){const{extractField:t,stringifyField:n,tokenize:s,processTerm:i,fields:r,idField:o}=this._options,l=t(e,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);if(this._idToShortId.has(l))throw new Error(`MiniSearch: duplicate ID ${l}`);const c=this.addDocumentId(l);this.saveStoredFields(c,e);for(const f of r){const p=t(e,f);if(p==null)continue;const h=s(n(p,f),f),y=this._fieldIds[f],S=new Set(h).size;this.addFieldLength(c,y,this._documentCount-1,S);for(const w of h){const T=i(w,f);if(Array.isArray(T))for(const N of T)this.addTerm(y,c,N);else T&&this.addTerm(y,c,T)}}}addAll(e){for(const t of e)this.add(t)}addAllAsync(e,t={}){const{chunkSize:n=10}=t,s={chunk:[],promise:Promise.resolve()},{chunk:i,promise:r}=e.reduce(({chunk:o,promise:l},c,f)=>(o.push(c),(f+1)%n===0?{chunk:[],promise:l.then(()=>new Promise(p=>setTimeout(p,0))).then(()=>this.addAll(o))}:{chunk:o,promise:l}),s);return r.then(()=>this.addAll(i))}remove(e){const{tokenize:t,processTerm:n,extractField:s,stringifyField:i,fields:r,idField:o}=this._options,l=s(e,o);if(l==null)throw new Error(`MiniSearch: document does not have ID field "${o}"`);const c=this._idToShortId.get(l);if(c==null)throw new Error(`MiniSearch: cannot remove document with ID ${l}: it is not in the index`);for(const f of r){const p=s(e,f);if(p==null)continue;const h=t(i(p,f),f),y=this._fieldIds[f],S=new Set(h).size;this.removeFieldLength(c,y,this._documentCount,S);for(const w of h){const T=n(w,f);if(Array.isArray(T))for(const N of T)this.removeTerm(y,c,N);else T&&this.removeTerm(y,c,T)}}this._storedFields.delete(c),this._documentIds.delete(c),this._idToShortId.delete(l),this._fieldLength.delete(c),this._documentCount-=1}removeAll(e){if(e)for(const t of e)this.remove(t);else{if(arguments.length>0)throw new Error("Expected documents to be present. Omit the argument to remove all documents.");this._index=new H,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){const t=this._idToShortId.get(e);if(t==null)throw new 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((n,s)=>{this.removeFieldLength(t,s,this._documentCount,n)}),this._fieldLength.delete(t),this._documentCount-=1,this._dirtCount+=1,this.maybeAutoVacuum()}maybeAutoVacuum(){if(this._options.autoVacuum===!1)return;const{minDirtFactor:e,minDirtCount:t,batchSize:n,batchWait:s}=this._options.autoVacuum;this.conditionalVacuum({batchSize:n,batchWait:s},{minDirtCount:t,minDirtFactor:e})}discardAll(e){const t=this._options.autoVacuum;try{this._options.autoVacuum=!1;for(const n of e)this.discard(n)}finally{this._options.autoVacuum=t}this.maybeAutoVacuum()}replace(e){const{idField:t,extractField:n}=this._options,s=n(e,t);this.discard(s),this.add(e)}vacuum(e={}){return this.conditionalVacuum(e)}conditionalVacuum(e,t){return this._currentVacuum?(this._enqueuedVacuumConditions=this._enqueuedVacuumConditions&&t,this._enqueuedVacuum!=null?this._enqueuedVacuum:(this._enqueuedVacuum=this._currentVacuum.then(()=>{const n=this._enqueuedVacuumConditions;return this._enqueuedVacuumConditions=je,this.performVacuuming(e,n)}),this._enqueuedVacuum)):this.vacuumConditionsMet(t)===!1?Promise.resolve():(this._currentVacuum=this.performVacuuming(e),this._currentVacuum)}async performVacuuming(e,t){const n=this._dirtCount;if(this.vacuumConditionsMet(t)){const s=e.batchSize||Ve.batchSize,i=e.batchWait||Ve.batchWait;let r=1;for(const[o,l]of this._index){for(const[c,f]of l)for(const[p]of f)this._documentIds.has(p)||(f.size<=1?l.delete(c):f.delete(p));this._index.get(o).size===0&&this._index.delete(o),r%s===0&&await new Promise(c=>setTimeout(c,i)),r+=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=t||Me.minDirtCount,n=n||Me.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){const t=this._idToShortId.get(e);if(t!=null)return this._storedFields.get(t)}search(e,t={}){const{searchOptions:n}=this._options,s={...n,...t},i=this.executeQuery(e,t),r=[];for(const[o,{score:l,terms:c,match:f}]of i){const p=c.length||1,h={id:this._documentIds.get(o),score:l*p,terms:Object.keys(f),queryTerms:c,match:f};Object.assign(h,this._storedFields.get(o)),(s.filter==null||s.filter(h))&&r.push(h)}return e===se.wildcard&&s.boostDocument==null||r.sort(at),r}autoSuggest(e,t={}){t={...this._options.autoSuggestOptions,...t};const n=new Map;for(const{score:i,terms:r}of this.search(e,t)){const o=r.join(" "),l=n.get(o);l!=null?(l.score+=i,l.count+=1):n.set(o,{score:i,terms:r,count:1})}const s=[];for(const[i,{score:r,terms:o,count:l}]of n)s.push({suggestion:i,terms:o,score:r/l});return s.sort(at),s}get documentCount(){return this._documentCount}get termCount(){return this._index.size}static loadJSON(e,t){if(t==null)throw new 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 new 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(Ce.hasOwnProperty(e))return Ae(Ce,e);throw new Error(`MiniSearch: unknown option "${e}"`)}static loadJS(e,t){const{index:n,documentIds:s,fieldLength:i,storedFields:r,serializationVersion:o}=e,l=this.instantiateMiniSearch(e,t);l._documentIds=ye(s),l._fieldLength=ye(i),l._storedFields=ye(r);for(const[c,f]of l._documentIds)l._idToShortId.set(f,c);for(const[c,f]of n){const p=new Map;for(const h of Object.keys(f)){let y=f[h];o===1&&(y=y.ds),p.set(parseInt(h,10),ye(y))}l._index.set(c,p)}return l}static async loadJSAsync(e,t){const{index:n,documentIds:s,fieldLength:i,storedFields:r,serializationVersion:o}=e,l=this.instantiateMiniSearch(e,t);l._documentIds=await we(s),l._fieldLength=await we(i),l._storedFields=await we(r);for(const[f,p]of l._documentIds)l._idToShortId.set(p,f);let c=0;for(const[f,p]of n){const h=new Map;for(const y of Object.keys(p)){let S=p[y];o===1&&(S=S.ds),h.set(parseInt(y,10),await we(S))}++c%1e3===0&&await xt(0),l._index.set(f,h)}return l}static instantiateMiniSearch(e,t){const{documentCount:n,nextId:s,fieldIds:i,averageFieldLength:r,dirtCount:o,serializationVersion:l}=e;if(l!==1&&l!==2)throw new Error("MiniSearch: cannot deserialize an index created with an incompatible version");const c=new se(t);return c._documentCount=n,c._nextId=s,c._idToShortId=new Map,c._fieldIds=i,c._avgFieldLength=r,c._dirtCount=o||0,c._index=new H,c}executeQuery(e,t={}){if(e===se.wildcard)return this.executeWildcardQuery(t);if(typeof e!="string"){const h={...t,...e,queries:void 0},y=e.queries.map(S=>this.executeQuery(S,h));return this.combineResults(y,h.combineWith)}const{tokenize:n,processTerm:s,searchOptions:i}=this._options,r={tokenize:n,processTerm:s,...i,...t},{tokenize:o,processTerm:l}=r,p=o(e).flatMap(h=>l(h)).filter(h=>!!h).map(Dn(r)).map(h=>this.executeQuerySpec(h,r));return this.combineResults(p,r.combineWith)}executeQuerySpec(e,t){const n={...this._options.searchOptions,...t},s=(n.fields||this._options.fields).reduce((w,T)=>({...w,[T]:Ae(n.boost,T)||1}),{}),{boostDocument:i,weights:r,maxFuzzy:o,bm25:l}=n,{fuzzy:c,prefix:f}={...st.weights,...r},p=this._index.get(e.term),h=this.termResults(e.term,e.term,1,e.termBoost,p,s,i,l);let y,S;if(e.prefix&&(y=this._index.atPrefix(e.term)),e.fuzzy){const w=e.fuzzy===!0?.2:e.fuzzy,T=w<1?Math.min(o,Math.round(e.term.length*w)):w;T&&(S=this._index.fuzzyGet(e.term,T))}if(y)for(const[w,T]of y){const N=w.length-e.term.length;if(!N)continue;S?.delete(w);const R=f*w.length/(w.length+.3*N);this.termResults(e.term,w,R,e.termBoost,T,s,i,l,h)}if(S)for(const w of S.keys()){const[T,N]=S.get(w);if(!N)continue;const R=c*w.length/(w.length+N);this.termResults(e.term,w,R,e.termBoost,T,s,i,l,h)}return h}executeWildcardQuery(e){const t=new Map,n={...this._options.searchOptions,...e};for(const[s,i]of this._documentIds){const r=n.boostDocument?n.boostDocument(i,"",this._storedFields.get(s)):1;t.set(s,{score:r,terms:[],match:{}})}return t}combineResults(e,t=Be){if(e.length===0)return new Map;const n=t.toLowerCase(),s=Cn[n];if(!s)throw new Error(`Invalid combination operator: ${t}`);return e.reduce(s)||new Map}toJSON(){const e=[];for(const[t,n]of this._index){const s={};for(const[i,r]of n)s[i]=Object.fromEntries(r);e.push([t,s])}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,s,i,r,o,l,c=new Map){if(i==null)return c;for(const f of Object.keys(r)){const p=r[f],h=this._fieldIds[f],y=i.get(h);if(y==null)continue;let S=y.size;const w=this._avgFieldLength[h];for(const T of y.keys()){if(!this._documentIds.has(T)){this.removeTerm(h,T,t),S-=1;continue}const N=o?o(this._documentIds.get(T),t,this._storedFields.get(T)):1;if(!N)continue;const R=y.get(T),G=this._fieldLength.get(T)[h],z=Ln(R,S,this._documentCount,G,w,l),$=n*s*p*N*z,P=c.get(T);if(P){P.score+=$,zn(P.terms,e);const V=Ae(P.match,t);V?V.push(f):P.match[t]=[f]}else c.set(T,{score:$,terms:[e],match:{[t]:[f]}})}}return c}addTerm(e,t,n){const s=this._index.fetch(n,ot);let i=s.get(e);if(i==null)i=new Map,i.set(t,1),s.set(e,i);else{const r=i.get(t);i.set(t,(r||0)+1)}}removeTerm(e,t,n){if(!this._index.has(n)){this.warnDocumentChanged(t,e,n);return}const s=this._index.fetch(n,ot),i=s.get(e);i==null||i.get(t)==null?this.warnDocumentChanged(t,e,n):i.get(t)<=1?i.size<=1?s.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(const s of Object.keys(this._fieldIds))if(this._fieldIds[s]===t){this._options.logger("warn",`MiniSearch: document with ID ${this._documentIds.get(e)} has changed before removal: term "${n}" was not present in field "${s}". Removing a document after it has changed can corrupt the index!`,"version_conflict");return}}addDocumentId(e){const 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,s){let i=this._fieldLength.get(e);i==null&&this._fieldLength.set(e,i=[]),i[t]=s;const o=(this._avgFieldLength[t]||0)*n+s;this._avgFieldLength[t]=o/(n+1)}removeFieldLength(e,t,n,s){if(n===1){this._avgFieldLength[t]=0;return}const i=this._avgFieldLength[t]*n-s;this._avgFieldLength[t]=i/(n-1)}saveStoredFields(e,t){const{storeFields:n,extractField:s}=this._options;if(n==null||n.length===0)return;let i=this._storedFields.get(e);i==null&&this._storedFields.set(e,i={});for(const r of n){const o=s(t,r);o!==void 0&&(i[r]=o)}}}se.wildcard=Symbol("*");const Ae=(a,e)=>Object.prototype.hasOwnProperty.call(a,e)?a[e]:void 0,Cn={[Be]:(a,e)=>{for(const t of e.keys()){const n=a.get(t);if(n==null)a.set(t,e.get(t));else{const{score:s,terms:i,match:r}=e.get(t);n.score=n.score+s,n.match=Object.assign(n.match,r),it(n.terms,i)}}return a},[St]:(a,e)=>{const t=new Map;for(const n of e.keys()){const s=a.get(n);if(s==null)continue;const{score:i,terms:r,match:o}=e.get(n);it(s.terms,r),t.set(n,{score:s.score+i,terms:s.terms,match:Object.assign(s.match,o)})}return t},[An]:(a,e)=>{for(const t of e.keys())a.delete(t);return a}},Mn={k:1.2,b:.7,d:.5},Ln=(a,e,t,n,s,i)=>{const{k:r,b:o,d:l}=i;return Math.log(1+(t-e+.5)/(e+.5))*(l+a*(r+1)/(a+r*(1-o+o*n/s)))},Dn=a=>(e,t,n)=>{const s=typeof a.fuzzy=="function"?a.fuzzy(e,t,n):a.fuzzy||!1,i=typeof a.prefix=="function"?a.prefix(e,t,n):a.prefix===!0,r=typeof a.boostTerm=="function"?a.boostTerm(e,t,n):1;return{term:e,fuzzy:s,prefix:i,termBoost:r}},Ce={idField:"id",extractField:(a,e)=>a[e],stringifyField:(a,e)=>a.toString(),tokenize:a=>a.split(Vn),processTerm:a=>a.toLowerCase(),fields:void 0,searchOptions:void 0,storeFields:[],logger:(a,e)=>{typeof console?.[a]=="function"&&console[a](e)},autoVacuum:!0},st={combineWith:Be,prefix:!1,fuzzy:!1,maxFuzzy:6,boost:{},weights:{fuzzy:.45,prefix:.375},bm25:Mn},Pn={combineWith:St,prefix:(a,e,t)=>e===t.length-1},Ve={batchSize:1e3,batchWait:10},je={minDirtFactor:.1,minDirtCount:20},Me={...Ve,...je},zn=(a,e)=>{a.includes(e)||a.push(e)},it=(a,e)=>{for(const t of e)a.includes(t)||a.push(t)},at=({score:a},{score:e})=>e-a,ot=()=>new Map,ye=a=>{const e=new Map;for(const t of Object.keys(a))e.set(parseInt(t,10),a[t]);return e},we=async a=>{const e=new Map;let t=0;for(const n of Object.keys(a))e.set(parseInt(n,10),a[n]),++t%1e3===0&&await xt(0);return e},xt=a=>new Promise(e=>setTimeout(e,a)),Vn=/[\n\r\p{Z}\p{P}]+/u;class jn{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 $n(a){const{localeIndex:e,theme:t}=lt();function n(s){const i=s.split("."),r=t.value.search?.options,o=r&&typeof r=="object",l=o&&r.locales?.[e.value]?.translations||null,c=o&&r.translations||null;let f=l,p=c,h=a;const y=i.pop();for(const S of i){let w=null;const T=h?.[S];T&&(w=h=T);const N=p?.[S];N&&(w=p=N);const R=f?.[S];R&&(w=f=R),T||(h=w),N||(p=w),R||(f=w)}return f?.[y]??p?.[y]??h?.[y]??""}return n}const Bn=["aria-owns"],Wn={class:"shell"},Kn=["title"],Jn={class:"search-actions before"},Un=["title"],qn=["aria-activedescendant","aria-controls","placeholder"],Hn={class:"search-actions"},Gn=["title"],Qn=["disabled","title"],Yn=["id","role","aria-labelledby"],Zn=["id","aria-selected"],Xn=["href","aria-label","onMouseenter","onFocusin","data-index"],er={class:"titles"},tr=["innerHTML"],nr={class:"title main"},rr=["innerHTML"],sr={key:0,class:"excerpt-wrapper"},ir={key:0,class:"excerpt",inert:""},ar=["innerHTML"],or={key:0,class:"no-results"},lr={class:"search-keyboard-shortcuts"},cr=["aria-label"],ur=["aria-label"],dr=["aria-label"],fr=["aria-label"],hr=Nt({__name:"VPLocalSearchBox",emits:["close"],setup(a,{emit:e}){const t=e,n=ne(),s=ne(),i=ne(Gt),r=lt(),{activate:o}=In(n,{immediate:!0,allowOutsideClick:!0,clickOutsideDeactivates:!0,escapeDeactivates:!0}),{localeIndex:l,theme:c}=r,f=He(async()=>Ze(se.loadJSON((await i.value[l.value]?.())?.default,{fields:["title","titles","text"],storeFields:["title","titles"],searchOptions:{fuzzy:.2,prefix:!0,boost:{title:4,text:2,titles:1},...c.value.search?.provider==="local"&&c.value.search.options?.miniSearch?.searchOptions},...c.value.search?.provider==="local"&&c.value.search.options?.miniSearch?.options}))),h=Se(()=>c.value.search?.provider==="local"&&c.value.search.options?.disableQueryPersistence===!0).value?ue(""):Ft("vitepress:local-search-filter",""),y=Rt("vitepress:local-search-detailed-list",c.value.search?.provider==="local"&&c.value.search.options?.detailedView===!0),S=Se(()=>c.value.search?.provider==="local"&&(c.value.search.options?.disableDetailedView===!0||c.value.search.options?.detailedView===!1));Ot(()=>{S.value&&(y.value=!1)});const w=ne([]),T=ue(!1);Le(h,()=>{T.value=!1});const N=He(async()=>{if(s.value)return Ze(new Nn(s.value))},null),R=new jn(16);At(()=>[f.value,h.value,y.value],async([m,v,g],_,x)=>{_?.[0]!==m&&R.clear();let F=!1;if(x(()=>{F=!0}),!m)return;w.value=m.search(v).slice(0,16),T.value=!0;const D=g?await Promise.all(w.value.map(O=>G(O.id))):[];if(F)return;for(const{id:O,mod:J}of D){const U=O.slice(0,O.indexOf("#"));let oe=R.get(U);if(oe)continue;oe=new Map,R.set(U,oe);const le=J.default??J;if(le?.render||le?.setup){const Q=Kt(le);Q.config.warnHandler=()=>{},Q.provide(Jt,r),Object.defineProperties(Q.config.globalProperties,{$frontmatter:{get(){return r.frontmatter.value}},$params:{get(){return r.page.value.params}}});const We=document.createElement("div");Q.mount(We),We.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach(ce=>{const Ke=ce.querySelector("a")?.getAttribute("href"),Je=Ke?.startsWith("#")&&Ke.slice(1);if(!Je)return;let Ue="";for(;(ce=ce.nextElementSibling)&&!/^h[1-6]$/i.test(ce.tagName);)Ue+=ce.outerHTML;oe.set(Je,Ue)}),Q.unmount()}if(F)return}const M=new Set;if(w.value=w.value.map(O=>{const[J,U]=O.id.split("#"),le=R.get(J)?.get(U)??"";for(const Q in O.match)M.add(Q);return{...O,text:le}}),await de(),F)return;await new Promise(O=>{N.value?.unmark({done:()=>{N.value?.markRegExp(b(M),{done:O})}})});const j=n.value?.querySelectorAll(".result .excerpt")??[];for(const O of j)O.querySelector('mark[data-markjs="true"]')?.scrollIntoView({block:"center"});s.value?.firstElementChild?.scrollIntoView({block:"start"})},{debounce:200,immediate:!0});async function G(m){const v=Ut(m.slice(0,m.indexOf("#")));try{if(!v)throw new Error(`Cannot find file for id: ${m}`);return{id:m,mod:await import(v)}}catch(g){return console.error(g),{id:m,mod:{}}}}const z=ue(),$=Se(()=>h.value?.length<=0);function P(m=!0){z.value?.focus(),m&&z.value?.select()}Ne(()=>{P()});function V(m){m.pointerType==="mouse"&&P()}const A=ue(-1),K=ue(!0);Le(w,m=>{A.value=m.length?0:-1,ie()});function ie(){de(()=>{document.querySelector(".result.selected")?.scrollIntoView({block:"nearest"})})}me("ArrowUp",m=>{m.preventDefault(),A.value--,A.value<0&&(A.value=w.value.length-1),K.value=!0,ie()}),me("ArrowDown",m=>{m.preventDefault(),A.value++,A.value>=w.value.length&&(A.value=0),K.value=!0,ie()});const ae=Ct();me("Enter",m=>{if(m.isComposing||m.target instanceof HTMLButtonElement&&m.target.type!=="submit")return;const v=w.value[A.value];if(m.target instanceof HTMLInputElement&&!v){m.preventDefault();return}v&&(ae.go(v.id),t("close"))}),me("Escape",()=>{t("close")});const E=$n({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"}}});Ne(()=>{window.history.pushState(null,"",null)}),Mt("popstate",m=>{m.preventDefault(),t("close")});const u=Lt(Dt?document.body:null);Ne(()=>{de(()=>{u.value=!0,de().then(()=>o())})}),Pt(()=>{u.value=!1});function d(){h.value="",de().then(()=>P(!1))}function b(m){return new RegExp([...m].sort((v,g)=>g.length-v.length).map(v=>`(${qt(v)})`).join("|"),"gi")}function I(m){if(!K.value)return;const v=m.target?.closest(".result"),g=Number.parseInt(v?.dataset.index);g>=0&&g!==A.value&&(A.value=g),K.value=!1}return(m,v)=>(B(),zt(Wt,{to:"body"},[k("div",{ref_key:"el",ref:n,role:"button","aria-owns":w.value?.length?"localsearch-list":void 0,"aria-expanded":"true","aria-haspopup":"listbox","aria-labelledby":"localsearch-label",class:"VPLocalSearchBox"},[k("div",{class:"backdrop",onClick:v[0]||(v[0]=g=>m.$emit("close"))}),k("div",Wn,[k("form",{class:"search-bar",onPointerup:v[4]||(v[4]=g=>V(g)),onSubmit:v[5]||(v[5]=Vt(()=>{},["prevent"]))},[k("label",{title:C(E)("button.buttonText"),id:"localsearch-label",for:"localsearch-input"},[...v[7]||(v[7]=[k("span",{"aria-hidden":"true",class:"vpi-search search-icon local-search-icon"},null,-1)])],8,Kn),k("div",Jn,[k("button",{class:"back-button",title:C(E)("modal.backButtonTitle"),onClick:v[1]||(v[1]=g=>m.$emit("close"))},[...v[8]||(v[8]=[k("span",{class:"vpi-arrow-left local-search-icon"},null,-1)])],8,Un)]),jt(k("input",{ref_key:"searchInput",ref:z,"onUpdate:modelValue":v[2]||(v[2]=g=>Bt(h)?h.value=g:null),"aria-activedescendant":A.value>-1?"localsearch-item-"+A.value:void 0,"aria-autocomplete":"both","aria-controls":w.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:C(E)("button.buttonText"),spellcheck:"false",type:"search"},null,8,qn),[[$t,C(h)]]),k("div",Hn,[S.value?ge("",!0):(B(),q("button",{key:0,class:Ge(["toggle-layout-button",{"detailed-list":C(y)}]),type:"button",title:C(E)("modal.displayDetails"),onClick:v[3]||(v[3]=g=>A.value>-1&&(y.value=!C(y)))},[...v[9]||(v[9]=[k("span",{class:"vpi-layout-list local-search-icon"},null,-1)])],10,Gn)),k("button",{class:"clear-button",type:"reset",disabled:$.value,title:C(E)("modal.resetButtonTitle"),onClick:d},[...v[10]||(v[10]=[k("span",{class:"vpi-delete local-search-icon"},null,-1)])],8,Qn)])],32),k("ul",{ref_key:"resultsEl",ref:s,id:w.value?.length?"localsearch-list":void 0,role:w.value?.length?"listbox":void 0,"aria-labelledby":w.value?.length?"localsearch-label":void 0,class:"results",onMousemove:I},[(B(!0),q(Ye,null,Qe(w.value,(g,_)=>(B(),q("li",{key:g.id,id:"localsearch-item-"+_,"aria-selected":A.value===_?"true":"false",role:"option"},[k("a",{href:g.id,class:Ge(["result",{selected:A.value===_}]),"aria-label":[...g.titles,g.title].join(" > "),onMouseenter:x=>!K.value&&(A.value=_),onFocusin:x=>A.value=_,onClick:v[6]||(v[6]=x=>m.$emit("close")),"data-index":_},[k("div",null,[k("div",er,[v[12]||(v[12]=k("span",{class:"title-icon"},"#",-1)),(B(!0),q(Ye,null,Qe(g.titles,(x,F)=>(B(),q("span",{key:F,class:"title"},[k("span",{class:"text",innerHTML:x},null,8,tr),v[11]||(v[11]=k("span",{class:"vpi-chevron-right local-search-icon"},null,-1))]))),128)),k("span",nr,[k("span",{class:"text",innerHTML:g.title},null,8,rr)])]),C(y)?(B(),q("div",sr,[g.text?(B(),q("div",ir,[k("div",{class:"vp-doc",innerHTML:g.text},null,8,ar)])):ge("",!0),v[13]||(v[13]=k("div",{class:"excerpt-gradient-bottom"},null,-1)),v[14]||(v[14]=k("div",{class:"excerpt-gradient-top"},null,-1))])):ge("",!0)])],42,Xn)],8,Zn))),128)),C(h)&&!w.value.length&&T.value?(B(),q("li",or,[fe(he(C(E)("modal.noResultsText"))+' "',1),k("strong",null,he(C(h)),1),v[15]||(v[15]=fe('" ',-1))])):ge("",!0)],40,Yn),k("div",lr,[k("span",null,[k("kbd",{"aria-label":C(E)("modal.footer.navigateUpKeyAriaLabel")},[...v[16]||(v[16]=[k("span",{class:"vpi-arrow-up navigate-icon"},null,-1)])],8,cr),k("kbd",{"aria-label":C(E)("modal.footer.navigateDownKeyAriaLabel")},[...v[17]||(v[17]=[k("span",{class:"vpi-arrow-down navigate-icon"},null,-1)])],8,ur),fe(" "+he(C(E)("modal.footer.navigateText")),1)]),k("span",null,[k("kbd",{"aria-label":C(E)("modal.footer.selectKeyAriaLabel")},[...v[18]||(v[18]=[k("span",{class:"vpi-corner-down-left navigate-icon"},null,-1)])],8,dr),fe(" "+he(C(E)("modal.footer.selectText")),1)]),k("span",null,[k("kbd",{"aria-label":C(E)("modal.footer.closeKeyAriaLabel")},"esc",8,fr),fe(" "+he(C(E)("modal.footer.closeText")),1)])])])],8,Bn)]))}}),br=Ht(hr,[["__scopeId","data-v-93eb4a12"]]);export{br as default};