PageSourceSearch

https://www.clips4sale.com/assets/PerformerSearch-XJaHTzHl.js

js clips4sale.com collected 2026-10-09 21:30:26 UTC 5,131 bytes, 1 lines download raw bytes

1import{r as i,j as e}from"./jsx-runtime-kF-aRxYe.js";import{d as w}from"./index-BAvGt11w.js";import{S as R}from"./SearchableLinkDropdown-DZl-UxO8.js";import{C as T}from"./ClickAwayListener-B_5MVSPe.js";import{c as q}from"./classArr-BJpvUMjH.js";import{u as $}from"./useTranslation-vq6sm7dQ.js";import{e as B,f as K}from"./components-B0up9rt8.js";import{s as E}from"./sanitizeString-BqG6zJxT.js";const V=({testId:u="performer",selectedCategoryId:c,categories:r,onCategoryChange:a,className:y})=>{const{t:s,i18n:d}=$(),j=i.useRef(null),b=B(),[g,t]=i.useState(c),[l,f]=i.useState(!1),[p,N]=i.useState(r||[]),[h,x]=i.useState(r||[]),[k,S]=i.useState(""),v=K();i.useEffect(()=>{var n;if(c){const m=(n=h.find(o=>o.id===Number(c)))==null?void 0:n.name;S(m||"")}},[c]),i.useEffect(()=>{r&&(N(r),x(r))},[r]);const C=()=>{f(!1),p.length&&x([...p])},L=()=>{w.trackEvent({action:l?"close":"open",category:"performer-select-category",element:"dropdown",custom:{categoryid:Number(g)||void 0}}),f(!l)},D=()=>{a==null||a(null),S("")},F=async n=>{const{value:m}=n.currentTarget;let o;m?o=p.filter(A=>A.name.toLowerCase().includes(m.toLowerCase())):o=p,x(o),w.trackEventDelayedLimited({category:"performer-select-category-enter",action:"type",element:"text-field",custom:{name:m,categoryid:Number(g)||void 0}})},z=(n,m,o)=>{n.preventDefault(),o&&S(o),w.trackEvent({action:"click",category:"performer-store",element:"dropdown",custom:{name:o,categoryid:Number(m)||void 0}}),a==null||a(m),C()};return e.jsxs(T,{className:q("relative flex w-auto md:min-w-48 h-full rounded-lg bg-transparent cursor-pointer data-performer-categories",y),"data-testid":`${u}Categories`,onClickAway:C,children:[e.jsx(e.Fragment,{children:e.jsxs("span",{className:"flex items-center w-full pl-3 bg-white/20 rounded-lg text-sm text-white overflow-hidden whitespace-nowrap leading-5 select-none",onClick:L,children:[e.jsx("span",{className:"flex-1 whitespace-nowrap line-clamp-1 capitalize","data-testid":`${u}BrowseCategories`,children:k||s("Categories")}),k&&e.jsx("span",{className:"flex items-center h-full py-2 text-white",onClick:n=>{n.stopPropagation(),D()},children:e.jsx("i",{className:"icon-x text-xl"})}),e.jsx("span",{className:`flex items-center h-full p-2 ${l?"rotate-180":"rotate-0"} origin-center transform-gpu transition-all`,children:e.jsx("i",{className:"icon-arrow-down text-xl"})})]})}),l&&e.jsx(R,{className:"fixed right-0 w-screen h-full lg:absolute lg:top-full lg:h-auto lg:max-h-[65vh] lg:w-full lg:mt-2 lg:mb-auto pb-2 select-none z-[21]",theme:"light",listPadding:"px-9 py-2 lg:px-7",hasSearchField:!0,hasSelectedLink:!1,searchFieldPlaceholder:s("Search Category"),isDropdownShow:l,categoryId:g,links:h,selectedLink:k,isLoading:v.state==="loading",listTitle:e.jsxs("div",{className:"lg:hidden flex justify-between items-center mt-5 px-5 text-black",children:[e.jsx("div",{className:"flex-1 font-medium text-base text-center",children:s("Browse Categories")}),e.jsx("i",{className:"icon-x text-xl",onClick:C})]}),sectionName:e.jsx("div",{className:"mt-2 px-5 py-2 text-xs text-black/50 uppercase lg:px-3",children:s("All categories")}),dropdownRef:j,"data-testid":`${u}Categories`,onSearchInput:F,onClearSelectedLink:()=>b(d.language!=="en"?`/${d.language}`:"/"),onClickDropdownItem:z})]})},W=({initialSearchKeyword:u,onSearch:c,onSearchChange:r,testId:a="performerSearch",searchPlaceholder:y="Search this performer"})=>{const[s,d]=i.useState(u||""),{t:j}=$();i.useEffect(()=>{d(u||"")},[u]);const b=t=>{var f,p,N,h,x;const l={category:"search-performer",action:"type",...((p=(f=t==null?void 0:t.target)==null?void 0:f.value)==null?void 0:p.trim().length)>0&&{custom:{"search-query":(N=t==null?void 0:t.target)==null?void 0:N.value}}};w.trackEventDelayedLimited(l),d((h=t==null?void 0:t.target)==null?void 0:h.value),r==null||r((x=t==null?void 0:t.target)==null?void 0:x.value)},g=t=>{var l;if(t.key==="Enter"){d(E(s)),c(E(s)),((l=t.target)==null?void 0:l.tagName)==="INPUT"&&t.target.blur();const f={action:"submit",category:"search-performer",custom:{"search-query":s}};w.trackEvent(f)}};return e.jsx("div",{className:"flex items-center w-full lg:w-auto lg:min-w-80 h-10",children:e.jsxs("div",{className:"flex flex-1 relative w-full h-full min-w-max lg:max-w-80 bg-white/10 rounded-lg z-20",children:[e.jsx("span",{"data-testid":`${a}DoSearch`,className:"flex items-center pl-2",children:e.jsx("i",{className:`icon-magnifying-glass font-bold text-white/50 text-xl ${s?"cursor-pointer":""}`,onClick:s?()=>c(s):void 0})}),e.jsxs("label",{htmlFor:`${a}-search-input`,className:"relative w-full rounded-lg",id:`${a}-search-bar-label`,children:[e.jsx("input",{"data-testid":`${a}SearchInput`,id:`${a}-search-input`,role:"search-input",type:"text",placeholder:j(y),className:`w-full h-full p-2 ${s?"pr-8":"pr-2"} bg-transparent text-sm text-white/50 leading-5 rounded-lg focus:outline-none`,autoComplete:"off",value:s,onChange:b,onKeyDown:g}),s&&e.jsx("span",{className:"cursor-pointer text-white/50",onClick:()=>{d(""),c("")},children:e.jsx("i",{className:"icon-x absolute right-2 top-1/2 -translate-y-1/2 text-xl"})})]})]})})};export{W as P,V as a};

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.