var e,t,fuse,showButton,hideButton,wrapper,modal,input,output,first,last,searchVisible,indexed,hasResults,scriptBundle,copyText,copiedText;e=this,t=function(){"use strict";var Y,X,y,W,N,a,L,t,i,D,e,Q,R,S,T,U,V,z,x,q,v,_,aa,ab,n,r,af,H,M,s,K,ac,B,m;function ag(a,d){var b=Object.keys(a),c;return Object.getOwnPropertySymbols&&(c=Object.getOwnPropertySymbols(a),d&&(c=c.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),b.push.apply(b,c)),b}function l(c){for(var a=1,b;ac.length)&&(a=c.length);for(var b=0,d=new Array(a);b0&&void 0!==arguments[0]?arguments[0]:1,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,a=new Map,b=Math.pow(10,d);return{get:function(f){var d=f.match(L).length,g,e;return a.has(d)?a.get(d):(g=1/Math.pow(d,.5*c),e=parseFloat(Math.round(g*b)/b),a.set(d,e),e)},clear:function(){a.clear()}}}t=function(){function e(){var c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},d=c.getFn,g=void 0===d?a.getFn:d,f=c.fieldNormWeight,h=void 0===f?a.fieldNormWeight:f;b(this,e),this.norm=aj(h,3),this.getFn=g,this.isCreated=!1,this.setIndexRecords()}return c(e,[{key:"setSources",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.docs=a}},{key:"setIndexRecords",value:function(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.records=a}},{key:"setKeys",value:function(){var b=this,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.keys=a,this._keysMap={},a.forEach(function(a,c){b._keysMap[a.id]=c})}},{key:"create",value:function(){var a=this;!this.isCreated&&this.docs.length&&(this.isCreated=!0,f(this.docs[0])?this.docs.forEach(function(b,c){a._addString(b,c)}):this.docs.forEach(function(b,c){a._addObject(b,c)}),this.norm.clear())}},{key:"add",value:function(a){var b=this.size();f(a)?this._addString(a,b):this._addObject(a,b)}},{key:"removeAt",value:function(b){this.records.splice(b,1);for(var a=b,c=this.size();a2&&void 0!==arguments[2]?arguments[2]:{},d=c.getFn,g=void 0===d?a.getFn:d,e=c.fieldNormWeight,h=void 0===e?a.fieldNormWeight:e,b=new t({getFn:g,fieldNormWeight:h});return b.setKeys(f.map(O)),b.setSources(i),b.create(),b}function o(o){var b=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},e=b.errors,n=void 0===e?0:e,f=b.currentLocation,l=void 0===f?0:f,h=b.expectedLocation,k=void 0===h?0:h,j=b.distance,d=void 0===j?a.distance:j,g=b.ignoreLocation,m=void 0===g?a.ignoreLocation:g,c=n/o.length,i;return m?c:(i=Math.abs(k-l),d?c+i/d:i?1:c)}function ai(){for(var d=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:a.minMatchCharLength,e=[],b=-1,g=-1,c=0,i=d.length,h;c=f&&e.push([b,g]),b=-1);return d[c-1]&&c-b>=f&&e.push([b,c-1]),e}i=32;function ah(c){for(var b={},a=0,d=c.length,e;a1&&void 0!==arguments[1]?arguments[1]:{},k=c.location,z=void 0===k?a.location:k,j=c.threshold,y=void 0===j?a.threshold:j,l=c.distance,x=void 0===l?a.distance:l,n=c.includeMatches,v=void 0===n?a.includeMatches:n,p=c.findAllMatches,C=void 0===p?a.findAllMatches:p,r=c.minMatchCharLength,u=void 0===r?a.minMatchCharLength:r,h=c.isCaseSensitive,s=void 0===h?a.isCaseSensitive:h,o=c.ignoreLocation,w=void 0===o?a.ignoreLocation:o,g,f,e,m,B,t;if(b(this,d),this.options={location:z,threshold:y,distance:x,includeMatches:v,findAllMatches:C,minMatchCharLength:u,isCaseSensitive:s,ignoreLocation:w},this.pattern=s?q:q.toLowerCase(),this.chunks=[],this.pattern.length)if(g=function(a,b){A.chunks.push({pattern:a,alphabet:ah(a),startIndex:b})},f=this.pattern.length,f>i){for(e=0,m=f%i,B=f-m;e3&&void 0!==arguments[3]?arguments[3]:{},L=f.location,Q=void 0===L?a.location:L,K=f.distance,s=void 0===K?a.distance:K,I=f.threshold,R=void 0===I?a.threshold:I,N=f.findAllMatches,P=void 0===N?a.findAllMatches:N,G=f.minMatchCharLength,F=void 0===G?a.minMatchCharLength:G,E=f.includeMatches,D=void 0===E?a.includeMatches:E,C=f.ignoreLocation,u=void 0===C?a.ignoreLocation:C,v,l,m,b,j,h,p,B,O,x,q,w,n,T,g,t,d,M,y,k,c,r,H,A,J;if(e.length>i)throw new Error(X(i));for(v,l=e.length,m=z.length,b=Math.max(0,Math.min(Q,m)),j=R,h=b,p=F>1||D,B=p?Array(m):[];(v=z.indexOf(e,h))>-1;)if(O=o(e,{currentLocation:v,expectedLocation:b,distance:s,ignoreLocation:u}),j=Math.min(O,j),h=v+l,p)for(x=0;x=M;c-=1)if(r=c-1,H=S[z.charAt(r)],p&&(B[r]=+!!H),k[c]=(k[c+1]<<1|1)&H,g&&(k[c]|=(q[c+1]|q[c])<<1|1|q[c+1]),k[c]&T&&(w=o(e,{errors:g,currentLocation:r,expectedLocation:b,distance:s,ignoreLocation:u}))<=j){if(j=w,(h=r)<=b)break;M=Math.max(1,2*b-h)}if(o(e,{errors:g+1,currentLocation:b,expectedLocation:b,distance:s,ignoreLocation:u})>j)break;q=k}return A={isMatch:h>=0,score:Math.max(.001,w)},p&&(J=ai(B,F),J.length?D&&(A.indices=J):A.isMatch=!1),A}(c,w,s,{location:r+u,distance:q,threshold:t,findAllMatches:m,minMatchCharLength:n,includeMatches:f,ignoreLocation:p}),l=g.isMatch,v=g.score,j=g.indices;l&&(d=!0),h+=v,l&&j&&(e=[].concat(k(e),k(j)))}),l={isMatch:d,score:d?h/this.chunks.length:1},d&&f&&(l.indices=e),l)}}]),d}(),e=function(){function a(c){b(this,a),this.pattern=c}return c(a,[{key:"search",value:function(){}}],[{key:"isMultiMatch",value:function(a){return P(a,this.multiRegex)}},{key:"isSingleMatch",value:function(a){return P(a,this.singleRegex)}}]),a}();function P(b,c){var a=b.match(c);return a?a[1]:null}Q=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(b){var a=b===this.pattern;return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"exact"}},{key:"multiRegex",get:function(){return/^="(.*)"$/}},{key:"singleRegex",get:function(){return/^=(.*)$/}}]),a}(e),R=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(a){var b=-1===a.indexOf(this.pattern);return{isMatch:b,score:b?0:1,indices:[0,a.length-1]}}}],[{key:"type",get:function(){return"inverse-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"$/}},{key:"singleRegex",get:function(){return/^!(.*)$/}}]),a}(e),S=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(b){var a=b.startsWith(this.pattern);return{isMatch:a,score:a?0:1,indices:[0,this.pattern.length-1]}}}],[{key:"type",get:function(){return"prefix-exact"}},{key:"multiRegex",get:function(){return/^\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^\^(.*)$/}}]),a}(e),T=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(a){var b=!a.startsWith(this.pattern);return{isMatch:b,score:b?0:1,indices:[0,a.length-1]}}}],[{key:"type",get:function(){return"inverse-prefix-exact"}},{key:"multiRegex",get:function(){return/^!\^"(.*)"$/}},{key:"singleRegex",get:function(){return/^!\^(.*)$/}}]),a}(e),U=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(a){var b=a.endsWith(this.pattern);return{isMatch:b,score:b?0:1,indices:[a.length-this.pattern.length,a.length-1]}}}],[{key:"type",get:function(){return"suffix-exact"}},{key:"multiRegex",get:function(){return/^"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^(.*)\$$/}}]),a}(e),V=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(a){var b=!a.endsWith(this.pattern);return{isMatch:b,score:b?0:1,indices:[0,a.length-1]}}}],[{key:"type",get:function(){return"inverse-suffix-exact"}},{key:"multiRegex",get:function(){return/^!"(.*)"\$$/}},{key:"singleRegex",get:function(){return/^!(.*)\$$/}}]),a}(e),z=function(e){j(d,e);var f=h(d);function d(o){var g,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},h=c.location,v=void 0===h?a.location:h,j=c.threshold,t=void 0===j?a.threshold:j,l=c.distance,r=void 0===l?a.distance:l,n=c.includeMatches,p=void 0===n?a.includeMatches:n,e=c.findAllMatches,q=void 0===e?a.findAllMatches:e,m=c.minMatchCharLength,s=void 0===m?a.minMatchCharLength:m,k=c.isCaseSensitive,u=void 0===k?a.isCaseSensitive:k,i=c.ignoreLocation,w=void 0===i?a.ignoreLocation:i;return b(this,d),(g=f.call(this,o))._bitapSearch=new D(o,{location:v,threshold:t,distance:r,includeMatches:p,findAllMatches:q,minMatchCharLength:s,isCaseSensitive:u,ignoreLocation:w}),g}return c(d,[{key:"search",value:function(a){return this._bitapSearch.searchIn(a)}}],[{key:"type",get:function(){return"fuzzy"}},{key:"multiRegex",get:function(){return/^"(.*)"$/}},{key:"singleRegex",get:function(){return/^(.*)$/}}]),d}(e),x=function(d){j(a,d);var e=h(a);function a(c){return b(this,a),e.call(this,c)}return c(a,[{key:"search",value:function(e){for(var a,b=0,c=[],f=this.pattern.length,d;(a=e.indexOf(this.pattern,b))>-1;)b=a+f,c.push([a,b-1]);return d=!!c.length,{isMatch:d,score:d?0:1,indices:c}}}],[{key:"type",get:function(){return"include"}},{key:"multiRegex",get:function(){return/^'"(.*)"$/}},{key:"singleRegex",get:function(){return/^'(.*)$/}}]),a}(e),q=[Q,x,S,T,V,U,R,z],v=q.length,_=/ +(?=([^\"]*\"[^\"]*\")*[^\"]*$)/;function aq(b){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b.split("|").map(function(l){for(var h=l.trim().split(_).filter(function(a){return a&&!!a.trim()}),d=[],e=0,m=h.length,g,c,b,i,j,f,k;e1&&void 0!==arguments[1]?arguments[1]:{},f=c.isCaseSensitive,g=void 0===f?a.isCaseSensitive:f,h=c.includeMatches,t=void 0===h?a.includeMatches:h,j=c.minMatchCharLength,r=void 0===j?a.minMatchCharLength:j,l=c.ignoreLocation,o=void 0===l?a.ignoreLocation:l,n=c.findAllMatches,p=void 0===n?a.findAllMatches:n,e=c.location,q=void 0===e?a.location:e,k=c.threshold,s=void 0===k?a.threshold:k,i=c.distance,u=void 0===i?a.distance:i;b(this,d),this.query=null,this.options={isCaseSensitive:g,includeMatches:t,minMatchCharLength:r,findAllMatches:p,ignoreLocation:o,location:q,threshold:s,distance:u},this.pattern=g?m:m.toLowerCase(),this.query=aq(this.pattern,this.options)}return c(d,[{key:"searchIn",value:function(c){var e=this.query,i,m,b,a,d,f,r,n,g,p,j,h,q,l,s,t,o;if(!e)return{isMatch:!1,score:1};i=this.options,m=i.includeMatches,c=i.isCaseSensitive?c:c.toLowerCase();for(b=0,a=[],d=0,f=0,r=e.length;f-1&&(c.refIndex=b.idx),a.matches.push(c)}})}function ao(a,b){b.score=a.score}function ap(f,i){var c=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},d=c.includeMatches,g=void 0===d?a.includeMatches:d,e=c.includeScore,h=void 0===e?a.includeScore:e,b=[];return g&&b.push(an),h&&b.push(ao),f.map(function(a){var c=a.idx,d={item:i[c],refIndex:c};return b.length&&b.forEach(function(b){b(a,d)}),d})}return m=function(){function e(c){var d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},f=arguments.length>2?arguments[2]:void 0;b(this,e),this.options=l(l({},a),d),this.options.useExtendedSearch,this._keyStore=new W(this.options.keys),this.setCollection(c,f)}return c(e,[{key:"setCollection",value:function(b,a){if(this._docs=b,a&&!(a instanceof t))throw new Error("Incorrect 'index' type");this._myIndex=a||J(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}},{key:"add",value:function(a){d(a)&&(this._docs.push(a),this._myIndex.add(a))}},{key:"remove",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){return!1},b=[],a=0,c=this._docs.length,d;a1&&void 0!==arguments[1]?arguments[1]:{},e=g.limit,d=void 0===e?-1:e,a=this.options,h=a.includeMatches,i=a.includeScore,j=a.shouldSort,k=a.sortFn,l=a.ignoreFieldNorm,b=f(c)?f(this._docs[0])?this._searchStringList(c):this._searchObjectList(c):this._searchLogical(c);return am(b,{ignoreFieldNorm:l}),j&&b.sort(k),ad(d)&&d>-1&&(b=b.slice(0,d)),ap(b,this._docs,{includeMatches:h,includeScore:i})}},{key:"_searchStringList",value:function(b){var c=w(b,this.options),e=this._myIndex.records,a=[];return e.forEach(function(e){var b=e.v,g=e.i,h=e.n,f,i,j,k;d(b)&&(f=c.searchIn(b),i=f.isMatch,j=f.score,k=f.indices,i&&a.push({item:b,idx:g,matches:[{score:j,value:b,norm:h,indices:k}]}))}),a}},{key:"_searchLogical",value:function(j){var b=this,e=function(a,c){var b=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).auto,d=void 0===b||b,e=function j(a){var b=Object.keys(a),e=K(a),h,i,k,l;if(!e&&b.length>1&&!s(a))return j(B(a));if(ac(a)){if(h=e?a[H]:b[0],i=e?a[M]:a[h],!f(i))throw new Error(Y(h));return k={keyId:C(h),pattern:i},d&&(k.searcher=w(i,c)),k}return l={children:[],operator:b[0]},b.forEach(function(c){var b=a[c];g(b)&&b.forEach(function(a){l.children.push(j(a))})}),l};return s(a)||(a=B(a)),e(a)}(j,this.options),h=function m(a,g,i){var f,j,c,e,d,l,h;if(!a.children)return f=a.keyId,j=a.searcher,c=b._findMatches({key:b._keyStore.get(f),value:b._myIndex.getValueForItemAtKeyId(g,f),searcher:j}),c&&c.length?[{idx:i,item:g,matches:c}]:[];for(e=[],d=0,l=a.children.length;d1&&void 0!==arguments[1]?arguments[1]:{},f=d.getFn,g=void 0===f?a.getFn:f,e=d.fieldNormWeight,h=void 0===e?a.fieldNormWeight:e,i=c.keys,j=c.records,b=new t({getFn:g,fieldNormWeight:h});return b.setKeys(i),b.setIndexRecords(j),b},m.config=a,function(){n.push.apply(n,arguments)}(ab),m},"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).Fuse=t(),showButton=document.getElementById("search-button"),hideButton=document.getElementById("close-search-button"),wrapper=document.getElementById("search-wrapper"),modal=document.getElementById("search-modal"),input=document.getElementById("search-query"),output=document.getElementById("search-results"),first=output.firstChild,last=output.lastChild,searchVisible=!1,indexed=!1,hasResults=!1,showButton.addEventListener("click",displaySearch),hideButton.addEventListener("click",hideSearch),wrapper.addEventListener("click",hideSearch),modal.addEventListener("click",function(a){return a.stopPropagation(),a.stopImmediatePropagation(),!1}),document.addEventListener("keydown",function(a){a.key=="/"&&(searchVisible||(a.preventDefault(),displaySearch())),a.key=="Escape"&&hideSearch(),a.key=="ArrowDown"&&searchVisible&&hasResults&&(a.preventDefault(),document.activeElement==input?first.focus():document.activeElement==last?last.focus():document.activeElement.parentElement.nextSibling.firstElementChild.focus()),a.key=="ArrowUp"&&searchVisible&&hasResults&&(a.preventDefault(),document.activeElement==input?input.focus():document.activeElement==first?input.focus():document.activeElement.parentElement.previousSibling.firstElementChild.focus())}),input.onkeyup=function(a){executeQuery(this.value)};function displaySearch(){indexed||buildIndex(),searchVisible||(document.body.style.overflow="hidden",wrapper.style.visibility="visible",input.focus(),searchVisible=!0)}function hideSearch(){searchVisible&&(document.body.style.overflow="visible",wrapper.style.visibility="hidden",input.value="",output.innerHTML="",document.activeElement.blur(),searchVisible=!1)}function fetchJSON(c,b){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(a.readyState===4)if(a.status===200){var c=JSON.parse(a.responseText);b&&b(c)}},a.open("GET",c),a.send()}function buildIndex(){var a=wrapper.getAttribute("data-url");fetchJSON(a+"index.json",function(a){var b={shouldSort:!0,ignoreLocation:!0,threshold:0,includeMatches:!0,keys:[{name:"title",weight:.8},{name:"section",weight:.2},{name:"summary",weight:.6},{name:"content",weight:.4}]};fuse=new Fuse(a,b),indexed=!0})}function executeQuery(c){let b=fuse.search(c),a="";b.length>0?(b.forEach(function(b,c){a=a+`
  • ${b.item.title}
    ${b.item.section}·${b.item.date}
    ${b.item.summary}
  • `}),hasResults=!0):(a="",hasResults=!1),output.innerHTML=a,b.length>0&&(first=output.firstChild.firstElementChild,last=output.lastChild.firstElementChild)}scriptBundle=document.getElementById("script-bundle"),copyText=scriptBundle?scriptBundle.getAttribute("data-copy"):"Copy",copiedText=scriptBundle?scriptBundle.getAttribute("data-copied"):"Copied";function createCopyButton(b){const a=document.createElement("button");a.className="copy-button",a.type="button",a.ariaLabel=copyText,a.innerText=copyText,a.addEventListener("click",()=>copyCodeToClipboard(a,b)),addCopyButtonToDom(a,b)}async function copyCodeToClipboard(c,a){const b=a.querySelector(":last-child > .chroma > code").innerText;try{result=await navigator.permissions.query({name:"clipboard-write"}),result.state=="granted"||result.state=="prompt"?await navigator.clipboard.writeText(b):copyCodeBlockExecCommand(b,a)}catch(c){copyCodeBlockExecCommand(b,a)}finally{codeWasCopied(c)}}function copyCodeBlockExecCommand(e,b){const a=document.createElement("textArea");a.contentEditable="true",a.readOnly="false",a.className="copy-textarea",a.value=e,b.insertBefore(a,b.firstChild);const c=document.createRange();c.selectNodeContents(a);const d=window.getSelection();d.removeAllRanges(),d.addRange(c),a.setSelectionRange(0,999999),document.execCommand("copy"),b.removeChild(a)}function codeWasCopied(a){a.blur(),a.innerText=copiedText,setTimeout(function(){a.innerText=copyText},2e3)}function addCopyButtonToDom(c,a){a.insertBefore(c,a.firstChild);const b=document.createElement("div");b.className="highlight-wrapper",a.parentNode.insertBefore(b,a),b.appendChild(a)}window.addEventListener("DOMContentLoaded",a=>{document.querySelectorAll(".highlight").forEach(a=>createCopyButton(a))})