1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5721,3189],{33189:function(e,t,l){l.r(t);var s=l(52322),a=l(8048),r=l(47086),n=l(12524),c=l.n(n),i=l(2784);let d=e=>{let{handleClick:t,searchItemName:l,active:a}=e;return(0,s.jsx)("div",{children:(0,s.jsxs)("div",{onClick:()=>t(l),className:"px-2 cursor-pointer flex justify-between py-1",children:[(0,s.jsx)("div",{className:"flex w-7 pb-1",children:(0,s.jsx)("div",{className:c()("w-5 h-5 md:w-6 md:h-6 rounded-full border-2 border-black",{"bg-black":a})})}),(0,s.jsxs)("span",{className:"text-left w-full pl-2",children:[" ",l," "]})]})})},u=e=>{let{emptyText:t}=e;return(0,s.jsx)("div",{className:"empty-state",children:(0,s.jsx)("div",{children:(0,s.jsx)("div",{className:"px-2 cursor-pointer flex justify-left pb-2",children:(0,s.jsxs)("span",{className:"text-center text-xs text-gray w-full",children:[" ",t," "]})})})})};t.default=e=>{let{handleSearchOptionClick:t,searchInput:l,setSearchInput:n,searchItems:o,activeSearchItems:x,fallbackText:h,emptyText:m,displayFallback:b,inputOverride:f,closeOnClick:p,placeholder:v,size:j="sm",icon:g=(0,s.jsx)(a.Z,{style:{color:"grey"},height:"18",width:"18"})}=e,k=(0,i.useRef)(null),y=(0,i.useRef)(null),[w,N]=(0,i.useState)(!1),[C,E]=(0,i.useState)(!1),I=(0,i.useCallback)(e=>{n(e.target.value),w||N(!0)},[]),L=(0,i.useCallback)(e=>{t(e),p&&N(!1)},[x]);(0,i.useEffect)(()=>{let e=e=>{w&&y.current&&!y.current.contains(e.target)&&k.current&&!k.current.contains(e.target)&&N(!1)};return document.addEventListener("click",e),()=>{document.removeEventListener("click",e)}},[w]),(0,i.useEffect)(()=>{if(w&&y.current){let e=y.current.children;0===e.length||1===e.length&&e[0].classList.contains("empty-state")?E(!0):E(!1)}},[l]);let _=(0,r.q_)({maxHeight:w?150:0,duration:250,config:{easing:r.Z5.easeInOutBack}});return(0,s.jsxs)("div",{className:"",ref:k,children:[(0,s.jsxs)("div",{className:c()("flex absolute justify-between align-center text-black pr-2 bg-white border-2 border-black rounded-full w-full","h-".concat("sm"===j?"auto":"10"),"pl-".concat("sm"===j?"2":"4"),{"text-gray-400":!l}),onClick:w?()=>{}:()=>N(e=>!e),style:{zIndex:20},children:[(0,s.jsx)("input",{type:"text",id:"brandInput",className:"z-10 py-1 w-full outline-none text-black",name:"brand",placeholder:v,onChange:e=>I(e),value:w?l:f||l,autoComplete:"off",required:!0}),(0,s.jsxs)("div",{className:c()("py-2 pr-2 absolute right-0 -top-1 text-black "),children:[g," "]})]}),(0,s.jsx)(r.q.div,{style:{..._,overflow:"hidden",zIndex:30},className:c()("absolute border-black border-l-2 border-r-2 top-6 border-b-2 rounded-b-xl bg-transparent w-full align-center text-black transition-opacity delay-100 duration-150",{"pt-3":C},{"opacity-100":w},{"opacity-0":!w}),children:(0,s.jsx)("div",{className:c()("relative mt-2",{"mt-4":!C}),children:(0,s.jsx)("div",{style:{overflow:"auto",height:"100%"},className:c()("max-h-36",{}),children:(0,s.jsxs)("div",{className:"bg-white",ref:y,children:[[...o,...h?[h]:[]].map((e,t)=>{let a=e.toLowerCase(),r=null==l?void 0:l.toLowerCase();return r&&a.startsWith(r)||a===(null==h?void 0:h.toLowerCase())?(0,s.jsx)(d,{searchItemName:e,handleClick:L,active:x.includes(e)},t):r?null:(0,s.jsx)(d,{searchItemName:e,handleClick:L,active:x.includes(e)},t)}),C?(0,s.jsx)(u,{emptyText:m}):null]})})})})]})}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.