/*! * Handles finding a text string anywhere in the slides and showing the next occurrence to the user * by navigatating to that slide and highlighting it. * * @author Jon Snyder , February 2013 */const B=()=>{let c,t,n,i,r,y,a;function g(){t=document.createElement("div"),t.classList.add("searchbox"),t.style.position="absolute",t.style.top="10px",t.style.right="10px",t.style.zIndex=10,t.innerHTML=` `,n=t.querySelector(".searchinput"),n.style.width="240px",n.style.fontSize="14px",n.style.padding="4px 6px",n.style.color="#000",n.style.background="#fff",n.style.borderRadius="2px",n.style.border="0",n.style.outline="0",n.style.boxShadow="0 2px 18px rgba(0, 0, 0, 0.2)",n.style["-webkit-appearance"]="none",c.getRevealElement().appendChild(t),n.addEventListener("keyup",function(d){switch(d.keyCode){case 13:d.preventDefault(),function(){if(y){var o=n.value;o===""?(a&&a.remove(),i=null):(a=new R("slidecontent"),i=a.apply(o),r=0)}i&&(i.length&&i.length<=r&&(r=0),i.length>r&&(c.slide(i[r].h,i[r].v),r++))}(),y=!1;break;default:y=!0}},!1),C()}function w(){t||g(),t.style.display="inline",n.focus(),n.select()}function C(){t||g(),t.style.display="none",a&&a.remove()}function R(d,o){var k=document.getElementById(d)||document.body,v=o||"EM",L=new RegExp("^(?:"+v+"|SCRIPT|FORM)$"),E=["#ff6","#a0ffff","#9f9","#f99","#f6f"],x=[],T=0,u="",h=[];this.setRegex=function(e){e=e.replace(/^[^\w]+|[^\w]+$/g,"").replace(/[^\w'-]+/g,"|"),u=new RegExp("("+e+")","i")},this.getRegex=function(){return u.toString().replace(/^\/\\b\(|\)\\b\/i$/g,"").replace(/\|/g," ")},this.hiliteWords=function(e){if(e!=null&&e&&u&&!L.test(e.nodeName)){if(e.hasChildNodes())for(var l=0;l{c=d,c.registerKeyboardShortcut("CTRL + Shift + F","Search"),document.addEventListener("keydown",function(o){o.key=="F"&&(o.ctrlKey||o.metaKey)&&(o.preventDefault(),t||g(),t.style.display!=="inline"?w():C())},!1)},open:w}};export{B as default};