import{r as s,ak as i,o as _,g as m,a as g,j as x}from"./app-BYcXwl4U.js";const y=["innerHTML"],v={__name:"Keyword",props:["v-word"],setup(u){const f=u,n=s(),a=s("");i(()=>{let e=f.vWord;e==null?e="":(e=e.replace(/\)/g,"\\)"),e=e.replace(/\(/g,"\\("),e=e.replace(/\+/g,"\\+"),e=e.replace(/\^/g,"\\^"),e=e.replace(/\$/g,"\\$"),e=e.replace(/\?/g,"\\?"),e=e.replace(/\*/g,"\\*"),e=e.replace(/\[/g,"\\["),e=e.replace(/{/g,"\\{"),e=e.replace(/\./g,"\\."));let t=n.value.textContent;if(typeof t=="string"){if(e.length>0){let c=[],o=0;t=t.replaceAll(new RegExp("("+e+")","ig"),function(r){o++;let d='<span style="border: 1px #ccc dashed; color: #ef4d58">'+l(r)+"</span>",p="$TMP__KEY__"+o.toString()+"$";return c.push([p,d]),p}),t=l(t),c.forEach(function(r){t=t.replace(r[0],r[1])})}else t=l(t);a.value=t}});const l=function(e){return e=e.replace(/&/g,"&amp;"),e=e.replace(/</g,"&lt;"),e=e.replace(/>/g,"&gt;"),e=e.replace(/"/g,"&quot;"),e};return(e,t)=>(_(),m("span",null,[g("span",{style:{display:"none"},ref_key:"textRef",ref:n},[x(e.$slots,"default")],512),g("span",{innerHTML:a.value},null,8,y)]))}};export{v as _};
