import{ab as v,_,R as f,ac as h,S as y,ad as b,o as x,c as E,a as m,d as k,N as S,O as T,k as d,ae as g,f as R}from"./BDipKYNj.js";const w='button, [href], input, select, search, textarea, [tabindex]:not([tabindex="-1"])',B=()=>{const s=v((t,i)=>{let a=null;return{get(){return t(),a},set(u){a=u,u?r():l(),i()}}});let c=[],e,o;function n(t){t.key==="Tab"&&(t.shiftKey?document.activeElement===e&&(o==null||o.focus(),t.preventDefault()):document.activeElement===o&&(e==null||e.focus(),t.preventDefault()))}function r(){s.value&&(c=s.value.querySelectorAll(w),e=c[0],o=c[c.length-1],document.addEventListener("keydown",n),e==null||e.focus())}function l(){document.removeEventListener("keydown",n)}return{trapRef:s,initTrapFocus:r,clearTrapFocus:l}},I={class:"input"},M=["placeholder"],N={__name:"WebSearchField",props:{placeholder:{type:String,default:"Search here..."},value:{type:String},fromModal:{type:Boolean,default:!1},debounceAmount:{type:Number,default:500}},emits:["update"],setup(s,{emit:c}){const e=s,o=c,n=f(e.value),r=f(),{trapRef:l}=B(),t=h(()=>o("update",n.value),e.debounceAmount);return y(()=>{e.fromModal&&(r.value=l)}),b(()=>{n.value.length>0&&(r.value="")}),(i,a)=>{const u=R;return x(),E("div",{ref:d(r),class:"search-field"},[m("div",I,[k(u,{icon:"mdi:magnify",class:"icon",width:24,"icon-color":"#666666"}),S(m("input",{"onUpdate:modelValue":a[0]||(a[0]=p=>g(n)?n.value=p:null),type:"search",placeholder:s.placeholder,onInput:a[1]||(a[1]=(...p)=>d(t)&&d(t)(...p))},null,40,M),[[T,d(n)]])])],512)}}},D=_(N,[["__scopeId","data-v-2d585203"]]);export{D as _};