"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const o=require("react/jsx-runtime"),c=require("semantic-ui-react"),l=require("react"),C=require("clsx"),s=require("../utils/semanticUtils.js"),D=e=>{const{results:r,resultRenderer:i,onSearchChange:d,value:h,showNoResults:f,onResultSelect:g,loading:u}=e,[m,K]=l.useState(""),[b,a]=l.useState(!1),[y,S]=l.useState(!1),M=(t,n)=>{a(!1),e.onBlur&&e.onBlur(t,n)},F=(t,n)=>{a(!0),e.onFocus&&e.onFocus(t,n)},R=t=>{S(!0),e.onMouseDown&&e.onMouseDown(t)},{aligned:q,category:v,className:w,fluid:x,size:O,searchTextHandler:N}=e,P=C("ui",y&&"active visible",O,m,s.useKeyOnly(v,"category"),s.useKeyOnly(x,"fluid"),s.useKeyOnly(u,"loading"),s.useValueAndKey(q,"aligned"),"search",w),j=s.getUnhandledProps(c.Search,e),[T,B]=s.partitionHTMLProps(j,{htmlProps:s.htmlInputAttrs});return o.jsx(o.Fragment,{children:o.jsx(c.Search,{...B,className:P,placeholder:e.placeholder,onBlur:M,size:"tiny",onFocus:F,onMouseDown:R,resultRenderer:i,onSearchChange:d,results:r,value:h,showNoResults:f,onResultSelect:g,loading:u})})};exports.default=D;
