PageSourceSearch

https://production.assets.hyperpad.com/assets/chunk-JPDCH4B7.js

js hyperpad.com collected 2026-09-24 19:53:07 UTC 2,468 bytes, 2 lines download raw bytes

1import{a as O}from"/assets/chunk-WG7OYX3N.js";import{r as w,t as c,u as N}from"/assets/chunk-YGNFM6WR.js";import{a as h}from"/assets/chunk-DZLEZB65.js";import{a as U}from"/assets/chunk-K7GVSPCM.js";import{b as a}from"/assets/chunk-4Z4DMVOV.js";import{a as C}from"/assets/chunk-J3IT7JTE.js";import{c as k}from"/assets/chunk-3P2IUJ3S.js";var e=k(U());var t=k(C()),B=({loading:d,options:o,onSelect:n})=>{let s=w()==="marketing";return(0,t.jsx)("div",{className:a("absolute z-20 mt-1 max-h-64 w-full overflow-auto rounded-md border shadow-lg",s?c.popover:"border-gray-200 bg-white text-gray-900"),children:d?(0,t.jsx)("div",{className:a("px-3 py-2 text-sm",s?c.mutedText:"text-gray-500"),children:"Searching..."}):o.length>0?o.map(l=>(0,t.jsx)("button",{type:"button",className:a("block w-full px-3 py-2 text-left text-sm",s?c.popoverItem:"text-gray-900 hover:bg-gray-100"),onMouseDown:m=>{m.preventDefault(),n(l)},children:l.label},l.value)):(0,t.jsx)("div",{className:a("px-3 py-2 text-sm",s?c.mutedText:"text-gray-500"),children:"No users found"})})},D=({id:d,value:o,onChange:n,initialOptions:s=[],placeholder:l="Search users...",searchPath:m="/admin/blog_posts/user_options",clearOnType:P=!0,allowClear:R=!0})=>{let T=w()==="marketing",[f,i]=(0,e.useState)(""),[g,S]=(0,e.useState)(s),[b,u]=(0,e.useState)(!1),[A,y]=(0,e.useState)(!1),p=(0,e.useRef)(!1),v=(0,e.useMemo)(()=>[...g,...s].find(r=>r.value===o),[s,g,o]);return(0,e.useEffect)(()=>{if(v){p.current=!1,i(v.label);return}if(!o){if(p.current){p.current=!1;return}i("")}},[v,o]),(0,e.useEffect)(()=>{if(!b){y(!1);return}let r=new AbortController,F=window.setTimeout(async()=>{y(!0);try{let x=await h.get(m,{params:{term:f},headers:{Accept:"application/json"},signal:r.signal,withCredentials:!0});S(x.data.users||[])}catch(x){h.isCancel(x)||S([])}finally{r.signal.aborted||y(!1)}},150);return()=>{window.clearTimeout(F),r.abort()}},[b,f,m]),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("div",{className:"flex gap-2",children:[(0,t.jsx)(O,{id:d,value:f,placeholder:l,className:a(T&&"border-marketing-border bg-marketing-card text-marketing-fg placeholder:text-marketing-fg-muted"),onFocus:()=>u(!0),onBlur:()=>u(!1),onChange:r=>{i(r.target.value),P&&o&&(p.current=!0,n(null)),u(!0)}}),o&&R&&(0,t.jsx)(N,{type:"button",variant:"outline",onClick:()=>{n(null),i(""),u(!1)},children:"Clear"})]}),b&&(0,t.jsx)(B,{loading:A,options:g,onSelect:r=>{n(r.value),i(r.label),u(!1)}})]})},L=D;export{L as a};
2

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.