1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[72163,89750],{18130:(e,r,t)=>{t.d(r,{S:()=>a});function a(e){if(!e)return null;try{let r=e;e.startsWith("http://")||e.startsWith("https://")||(r="https://"+e);let t=new URL(r).hostname;return t.startsWith("www.")&&(t=t.substring(4)),t}catch(r){try{let r=e.match(/(?:https?:\/\/)?(?:www\.)?([^\/\s]+)/i);if(r&&r[1])return r[1]}catch(e){}return null}}},36951:(e,r,t)=>{t.d(r,{A:()=>l});var a=t(95155),s=t(12115);let l=e=>{let{src:r,alt:t="",className:l="",color:n,width:i,height:c}=e,[o,d]=s.useState(""),u=e=>{n&&e.setAttribute("fill",n),Array.from(e.children).forEach(e=>{u(e)})};return s.useEffect(()=>{(async()=>{try{let e=await fetch(r),t=await e.text(),a=new DOMParser().parseFromString(t,"image/svg+xml").documentElement;u(a),i&&a.setAttribute("width",i.toString()),c&&a.setAttribute("height",c.toString());let s=new XMLSerializer().serializeToString(a);d(s)}catch(e){console.error("Error loading SVG:",e)}})()},[r,n,i,c]),(0,a.jsx)("span",{className:l,dangerouslySetInnerHTML:{__html:o},role:"img","aria-label":t})}},72163:(e,r,t)=>{t.r(r),t.d(r,{searchApi:()=>l,useDeleteRecentSearchMutation:()=>d,useGetRecentSearchesQuery:()=>c,useLazyGetRecentSearchesQuery:()=>o,useLazySearchQuery:()=>i,useSearchQuery:()=>n});var a=t(61321),s=t(49973);let l=(0,a.xP)({reducerPath:"searchApi",baseQuery:s.W,tagTypes:["Search","RecentSearches"],endpoints:e=>({search:e.query({query:e=>{let{q:r,offset:t=0,limit:a=20,intuitiveSearch:s=!1}=e,l={q:r,offset:t.toString(),limit:a.toString(),intuitive_search:s.toString()};return{url:"search?".concat(new URLSearchParams(l).toString())}},providesTags:["Search"]}),getRecentSearches:e.query({query:()=>({url:"search/recent"}),providesTags:["RecentSearches"]}),deleteRecentSearch:e.mutation({query:e=>({url:"search/recent/".concat(e),method:"DELETE"}),invalidatesTags:["RecentSearches"]})})}),{useSearchQuery:n,useLazySearchQuery:i,useGetRecentSearchesQuery:c,useLazyGetRecentSearchesQuery:o,useDeleteRecentSearchMutation:d}=l},89750:(e,r,t)=>{t.r(r),t.d(r,{SearchScreen:()=>A});var a=t(95155),s=t(12115),l=t(86651),n=t(65229),i=t(20063),c=t(72163);let o="shelfy_recent_searches",d="shelfy_recent_searches_timestamp";var u=t(82931);let g="bg-[#7AC7FF] text-gray-900 font-semibold rounded-md py-0.5";function h(e,r){if(!r||!e)return e;let t=e.toLowerCase(),s=r.toLowerCase(),l=t.indexOf(s);if(-1===l)return e;let n=e.slice(0,l),i=e.slice(l,l+r.length),c=e.slice(l+r.length);return(0,a.jsxs)(a.Fragment,{children:[n,(0,a.jsx)("mark",{className:g,children:i}),c]})}var m=t(18130),x=t(71847);let y=(0,x.A)("link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]),f=(0,x.A)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),p=(0,x.A)("file-text",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]),v=(0,x.A)("mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);var b=t(93499),k=t(83804);function j(e){var r;let{result:t,viewType:s,query:l,onClick:n}=e,i=()=>{n&&n(t)},c=e=>{e.stopPropagation(),t.url&&window.open(t.url,"_blank","noopener,noreferrer")},o=()=>{switch(t.kind){case"url":return(0,a.jsx)(y,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"});case"image":return(0,a.jsx)(f,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"});case"note":default:return(0,a.jsx)(p,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"});case"voice_note":return(0,a.jsx)(v,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}},d=null==(r=t.match_info)?void 0:r.headline,x=!!d,j=()=>!x&&l?h(t.title,l):t.title,N=()=>{let e=[];
1if(t.url){let r=(0,m.S)(t.url);r&&e.push((0,a.jsx)("span",{className:"text-gray-500 dark:text-gray-400 font-medium",children:r},"domain"))}else if(t.file_size){let r=(e=>{if(!e)return null;let r=["B","KB","MB","GB"],t=e,a=0;for(;t>=1024&&a<r.length-1;)t/=1024,a++;return"".concat(t.toFixed(1)," ").concat(r[a])})(t.file_size);r&&e.push((0,a.jsx)("span",{className:"text-gray-500 dark:text-gray-400 font-medium",children:r},"size"))}return t.description&&(e.length>0&&e.push((0,a.jsx)("span",{className:"text-gray-400 dark:text-gray-500 mx-1",children:"â¢"},"dot")),e.push((0,a.jsx)("span",{className:"text-gray-600 dark:text-gray-400",children:!x&&l?h(t.description,l):t.description},"desc"))),e.length>0?(0,a.jsx)(a.Fragment,{children:e}):null},w=()=>{if(x)return(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsx)("p",{className:"text-xs text-gray-700 dark:text-gray-300 line-clamp-2",children:function(e){let r=u.A.sanitize(e,{ALLOWED_TAGS:["mark","b","em"]});return(0,a.jsx)("span",{dangerouslySetInnerHTML:{__html:r},className:"[&_mark]:bg-[#7AC7FF] [&_mark]:text-gray-900 [&_mark]:font-semibold [&_mark]:rounded-md [&_mark]:py-0.5"})}(d)})});
1if(l)for(let e of[t.summary,t.readable_content].filter(Boolean)){let r=function(e,r){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:50;if(!e||!r)return e;let s=e.toLowerCase(),l=r.toLowerCase(),n=s.indexOf(l);if(-1===n)return null;let i=n+r.length,c=Math.max(0,n-t),o=Math.min(e.length,i+t);if(c>0&&" "!==e[c-1]){let r=e.lastIndexOf(" ",c);r>c-20&&(c=r+1)}if(o<e.length&&" "!==e[o]){let r=e.indexOf(" ",o);-1!==r&&r<o+20&&(o=r)}let d=e.slice(c,o),u=n-c,h=d.slice(0,u),m=d.slice(u,u+r.length),x=d.slice(u+r.length),y=c>0?"...":"",f=o<e.length?"...":"";return(0,a.jsxs)(a.Fragment,{children:[y,h,(0,a.jsx)("mark",{className:g,children:m}),x,f]})}(e,l,50);if(r)return(0,a.jsx)("div",{className:"mt-1.5",children:(0,a.jsx)("p",{className:"text-xs text-gray-700 dark:text-gray-300 line-clamp-2",children:r})})}return null};return"list"===s?(0,a.jsxs)("div",{className:"group flex items-start gap-4 p-2 bg-white dark:bg-gray-800 hover:bg-gray-50/80 dark:hover:bg-gray-600/80 rounded-xl cursor-pointer min-h-[100px] relative overflow-hidden",onClick:i,children:[(0,a.jsx)("div",{className:"flex-shrink-0 w-20 h-20 rounded-lg overflow-hidden border border-gray-100 dark:border-gray-700 bg-gray-50 dark:bg-gray-900",children:t.thumbnail_url?(0,a.jsx)("img",{src:(0,k.HQ)(t.thumbnail_url,t.url),alt:t.title,className:"w-full h-full object-cover",onError:k.Us}):t.favicon_url&&"url"===t.kind?(0,a.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,a.jsx)("img",{src:(0,k.NF)(t.favicon_url),alt:"",className:"w-8 h-8",onError:k.fT})}):(0,a.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:o()})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 py-0.5",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 line-clamp-1 mb-1 transition-colors",children:j()}),(0,a.jsx)("div",{className:"text-xs line-clamp-1 leading-relaxed mb-1",children:N()}),w()]}),t.url&&(0,a.jsx)("button",{onClick:c,className:"flex-shrink-0 self-center p-2 text-gray-400 dark:text-gray-500 hover:text-gray-700 dark:hover:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-600 rounded-lg transition-all duration-200 opacity-0 group-hover:opacity-100 cursor-pointer",title:"Open in new tab","aria-label":"Open in new tab",children:(0,a.jsx)(b.A,{className:"w-5 h-5"})})]}):(0,a.jsxs)("div",{className:"group bg-white dark:bg-gray-800 hover:bg-gray-50/50 dark:hover:bg-gray-600/50 rounded-xl overflow-hidden border border-gray-200 dark:border-gray-700 cursor-pointer transition-all duration-200 hover:shadow-lg hover:border-gray-300 dark:hover:border-gray-600 hover:-translate-y-1",onClick:i,children:[(0,a.jsxs)("div",{className:"aspect-video w-full bg-gradient-to-br from-gray-100 to-gray-50 dark:from-gray-800 dark:to-gray-900 relative",children:[t.image_url?(0,a.jsx)("img",{src:(0,k.HQ)(t.image_url,t.url),alt:t.title,className:"w-full h-full object-cover",onError:k.Us}):(0,a.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:t.favicon&&"url"===t.kind?(0,a.jsx)("img",{src:(0,k.NF)(t.favicon),alt:"",className:"w-16 h-16 opacity-80",onError:k.fT}):(0,a.jsx)("div",{className:"text-gray-400 dark:text-gray-500 scale-150",children:o()})}),(0,a.jsx)("div",{className:"absolute top-3 right-3 bg-black/60 dark:bg-gray-900/80 backdrop-blur-sm text-white px-2.5 py-1 rounded-md text-xs font-medium capitalize",children:t.kind.replace("_"," ")}),t.url&&(0,a.jsx)("button",{onClick:c,className:"absolute bottom-3 right-3 p-2 text-white bg-black/60 dark:bg-gray-900/80 backdrop-blur-sm hover:bg-gray-700 dark:hover:bg-gray-600 rounded-lg transition-all duration-200 opacity-0 group-hover:opacity-100 cursor-pointer",title:"Open in new tab","aria-label":"Open in new tab",children:(0,a.jsx)(b.A,{className:"w-4 h-4"})})]}),(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 line-clamp-2 mb-2 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:j()}),(0,a.jsx)("div",{className:"text-xs line-clamp-2 mb-2",children:N()}),w(),t.match_info&&(0,a.jsx)("div",{className:"mt-3 pt-3 border-t border-gray-100 dark:border-gray-700",children:(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,a.jsxs)("span",{className:"text-gray-500 dark:text-gray-400 font-medium capitalize",children:[t.match_info.strategy," match"]}),(0,a.jsxs)("span",{className:"text-gray-500 dark:text-gray-400",children:[(0,a.jsx)("span",{className:"font-medium",children:"Score:"})," ",Number(t.match_info.score).toFixed(1)]})]})})]})]})}var N=t(94161);function w(e){let{results:r,isLoading:t,isLoadingMore:n,error:c,query:o,totalCount:d,hasSearched:u=!1,hasMore:g=!1,onLoadMore:h}
1=e,[m,x]=(0,s.useState)("list"),y=(0,i.useRouter)(),{buildResourceUrl:f}=(0,N.j)(),p=e=>{let r=f(e.id.toString());y.push(r)};return((0,s.useEffect)(()=>{r&&r.length>0&&y.prefetch(f(r[0].id.toString()))},[r,y,f]),t)?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center py-10",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600 dark:border-blue-400"}),(0,a.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-gray-300 dark:border-gray-600 absolute inset-0 animate-reverse-spin"})]}),(0,a.jsx)("span",{className:"mt-4 text-sm text-gray-600 dark:text-gray-400 font-medium",children:"Searching..."})]}):c?(0,a.jsx)("div",{className:"flex flex-col items-center justify-center py-12",children:(0,a.jsxs)("div",{className:"bg-red-50 dark:bg-red-900/20 rounded-lg p-6 max-w-md",children:[(0,a.jsx)("p",{className:"text-red-700 dark:text-red-400 font-medium text-center",children:"Error occurred while searching"}),(0,a.jsx)("p",{className:"text-red-600 dark:text-red-400 text-sm text-center mt-1",children:"Please try again or refine your search terms."})]})}):u&&(!r||0===r.length)?(0,a.jsx)("div",{className:"flex flex-col items-center justify-center py-12",children:(0,a.jsxs)("div",{className:"bg-gray-50 dark:bg-gray-800 rounded-lg p-8 max-w-md text-center",children:[(0,a.jsx)("div",{className:"text-gray-400 dark:text-gray-500 mb-4",children:(0,a.jsx)(l.A,{className:"w-12 h-12 mx-auto"})}),(0,a.jsx)("p",{className:"text-gray-700 dark:text-gray-100 font-medium",children:o?'No results found for "'.concat(o,'"'):"No results found"}),(0,a.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mt-2",children:"Try different keywords or check your spelling"})]})}):(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("div",{className:"flex items-center justify-between px-1 mb-3",children:(0,a.jsx)("div",{className:"flex items-center gap-3",children:(0,a.jsxs)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:["Search Results (",d||r.length," ",1===(d||r.length)?"item":"items",")"]})})}),"list"===m?(0,a.jsx)("div",{className:"space-y-1",children:r.map((e,r)=>(0,a.jsx)("div",{className:"animate-fadeIn border-b border-gray-50 dark:border-gray-800 rounded-md",style:{animationDelay:"".concat(50*r,"ms")},children:(0,a.jsx)(j,{result:e,viewType:"list",query:o,onClick:p})},e.id))}):(0,a.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:r.map((e,r)=>(0,a.jsx)("div",{className:"animate-fadeIn",style:{animationDelay:"".concat(50*r,"ms")},children:(0,a.jsx)(j,{result:e,viewType:"card",query:o,onClick:p})},e.id))}),g&&h&&(0,a.jsx)("div",{className:"flex justify-center items-center py-6",children:(0,a.jsx)("button",{onClick:h,disabled:n,className:"bg-gray-900 dark:bg-gray-700 hover:bg-gray-800 dark:hover:bg-gray-600 text-white font-medium px-6 py-3 rounded-lg transition-colors duration-200 disabled:opacity-50 disabled:cursor-not-allowed min-w-[140px]",children:n?(0,a.jsxs)("span",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("div",{className:"animate-spin rounded-full h-4 w-4 border-2 border-white border-t-transparent"}),"Loading..."]}):"Load More"})}),!g&&r.length>0&&(0,a.jsx)("div",{className:"flex justify-center items-center py-6",children:(0,a.jsx)("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:"No more results"})})]})}var S=t(36951),_=t(77317),E=t(23083),C=t(86389);function A(e){var r,t,u;let{fullScreen:g=!1}
1=e,h=(0,i.useRouter)(),[m,x]=(0,s.useState)(""),[y,f]=(0,s.useState)(!1),[p,v]=(0,s.useState)(""),[b,k]=(0,s.useState)([]),[j,N]=(0,s.useState)(0),[A,M]=(0,s.useState)(!1),[L,F]=(0,s.useState)(!1),[z,I]=(0,s.useState)(!1),[q,{data:R,isLoading:T,isError:O}]=(0,c.useLazySearchQuery)(),{recentSearches:D,removeSearch:H}=function(){let[e,r]=(0,s.useState)([]),[t,a]=(0,s.useState)(!1),{data:l,isLoading:n,refetch:i}=(0,c.useGetRecentSearchesQuery)(),[u]=(0,c.useDeleteRecentSearchMutation)();(0,s.useEffect)(()=>{(()=>{try{let e=localStorage.getItem(o),t=localStorage.getItem(d);if(e&&t){let s=parseInt(t,10);if(Date.now()-s<3e5){let t=JSON.parse(e);return r(t),a(!0),!0}}}catch(e){console.error("Error loading recent searches from local storage:",e)}return!1})()||a(!0)},[]),(0,s.useEffect)(()=>{if((null==l?void 0:l.data)&&l.data.length>0){let e=l.data;r(e);try{localStorage.setItem(o,JSON.stringify(e)),localStorage.setItem(d,Date.now().toString())}catch(e){console.error("Error saving recent searches to local storage:",e)}}},[l]);let g=(0,s.useCallback)(async t=>{try{r(e=>e.filter(e=>e.id!==t));let a=e.filter(e=>e.id!==t);localStorage.setItem(o,JSON.stringify(a)),localStorage.setItem(d,Date.now().toString()),await u(t).unwrap(),i()}catch(e){console.error("Error removing recent search:",e),i()}},[e,u,i]),h=(0,s.useCallback)(async()=>{try{var e;let t=await i();if(null==(e=t.data)?void 0:e.data){let e=t.data.data;r(e),localStorage.setItem(o,JSON.stringify(e)),localStorage.setItem(d,Date.now().toString())}}catch(e){console.error("Error refreshing recent searches:",e)}},[i]),m=(0,s.useCallback)(()=>{localStorage.removeItem(o),localStorage.removeItem(d),r([])},[]);return{recentSearches:e.length>0?e:(null==l?void 0:l.data)||[],isLoading:!t&&n,removeSearch:g,refreshFromServer:h,clearLocalCache:m}}(),P=(0,s.useRef)(null),Q=(0,s.useRef)(""),B=(0,_.d4)(E.NE);B&&B.toLowerCase();let G="Search as you think of it - close context, meaning, etc...";(0,s.useEffect)(()=>{if(y){v("");let e=0,r=setInterval(()=>{e<=G.length?(v(G.slice(0,e)),e++):clearInterval(r)},5);return()=>clearInterval(r)}v("")},[y]),(0,s.useEffect)(()=>{P.current&&P.current.focus()},[y]),(0,s.useEffect)(()=>{P.current&&P.current.focus()},[]),(0,s.useEffect)(()=>{if(g){let e=e=>{("Escape"===e.key||"Esc"===e.key)&&h.push("/")};return document.addEventListener("keydown",e),()=>{document.removeEventListener("keydown",e)}}},[g,h]),(0,s.useEffect)(()=>{if(m.trim().length>2){let e=setTimeout(()=>{k([]),N(0),M(!1),Q.current=m.trim(),q({q:m.trim(),offset:0,limit:20,intuitiveSearch:y})},500);return()=>clearTimeout(e)}k([]),N(0),M(!1)},[m,q,y]),(0,s.useEffect)(()=>{if(null==R?void 0:R.data){let e=R.data.resources.map(e=>{var r;return{...e,id:e.id.toString(),collection_id:null==(r=e.collection_id)?void 0:r.toString(),match_info:e.match_info}});0===R.data.pagination.offset?k(e):k(r=>[...r,...e]),M(R.data.pagination.has_more),N(R.data.pagination.offset),F(!1)}},[R]);let U=(0,s.useCallback)(()=>{!T&&!L&&A&&m.trim().length>2&&(F(!0),q({q:Q.current,offset:j+20,limit:20,intuitiveSearch:y}))},[T,L,A,j,m,q,y]),W=async(e,r)=>{e.stopPropagation(),await H(r)},J=g?"fixed inset-0 z-50 bg-white dark:bg-gray-700 overflow-y-auto":"h-full w-full bg-white dark:bg-gray-700 overflow-y-auto";return(0,a.jsxs)("div",{className:J,children:[(0,a.jsxs)("div",{className:"py-3 px-4 flex flex-wrap items-center gap-3 relative border-b border-gray-100 dark:border-gray-600",children:[(0,a.jsxs)("div",{className:"flex-grow relative",children:[y&&(0,a.jsx)("div",{className:"absolute inset-0 rounded-[10px] bg-gradient-to-r from-[#7C91FD] via-[#A87BFB] to-[#DF7EF2] pointer-events-none z-0",children:(0,a.jsx)("div",{className:"absolute inset-[2px] rounded-[8px] bg-[#F9F9F9] dark:bg-gray-800"})}),(0,a.jsx)("div",{className:"absolute left-3 top-1/2 -translate-y-1/2 z-10",children:y?(0,a.jsx)(S.A,{src:"/images/sparkgradient.svg",alt:"Intuitive Search",width:20,height:20}):(0,a.jsx)(l.A,{className:"text-black dark:text-gray-400 text-lg"})}),(0,a.jsx)("input",{ref:P,type:"text",placeholder:y?p:"Search title, description, content ...",className:"relative bg-[#F9F9F9] dark:bg-gray-800 flex-grow outline-none h-[48px] w-full text-gray-700 dark:text-gray-100 text-sm font-normal pl-12 pr-10 rounded-[10px] placeholder:text-gray-400 dark:placeholder:text-gray-500",style:y?{background:"transparent"}:{},value:m,onChange:e=>x(e.target.value)}),(0,a.jsx)("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 flex items-center gap-2 z-10",children:m&&(0,a.jsx)("button",{onClick:()=>{x(""),k([]),N(0),M(!1),P.current&&P.current.focus()},className:"p-1 hover:bg-gray-100 dark:hover:bg-gray-600 rounded-md transition-colors cursor-pointer","aria-label":"Clear search",children:(0,a.jsx)(n.A,{className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",size:16})})})]}),g&&(0,a.jsx)("button",{onClick:()=>h.back(),className:"p-1 sm:p-3.5 hover:bg-gray-50 dark:hover:bg-gray-600 rounded-md transition-colors cursor-pointer focus:outline-none focus-visible:ring-0","aria-label":"Close search",children:(0,a.jsx)(n.A,{className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300 sm:w-5 sm:h-5 w-4 h-4",size:20})}),!1]}),(0,a.jsx)("div",{className:"px-4 py-4",children:m.trim().length>2?(0,a.jsx)(w,{results:b,isLoading:T&&0===j,isLoadingMore:L,error:O,query:null==R||null==(r=R.data)?void 0:r.query,totalCount:null==R||null==(u=R.data)||null==(t=u.counts)?void 0:t.resources,hasSearched:!!R,hasMore:A,onLoadMore:U}):(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 mb-3",children:"Recent Searches"}),(0,a.jsx)("div",{className:"space-y-1",children:D.length>0?D.map(e=>(0,a.jsxs)("div",{className:"group flex items-center gap-3 px-2 py-2 hover:bg-gray-50 dark:hover:bg-gray-600 rounded-md cursor-pointer",onClick:()=>{var r;
1return r=e.query,e.intuitive_search,void(x(r),f(!1))},children:[(0,a.jsx)(l.A,{className:"text-[#5d5d5d] dark:text-gray-400 flex-shrink-0",size:16}),(0,a.jsx)("span",{className:"text-sm font-normal text-gray-900 dark:text-gray-100 flex-1 truncate",children:e.query}),(0,a.jsx)("button",{onClick:r=>W(r,e.id),className:"opacity-0 group-hover:opacity-100 transition-opacity duration-200 p-1 hover:bg-gray-200 dark:hover:bg-gray-600 rounded cursor-pointer","aria-label":"Remove search",children:(0,a.jsx)(n.A,{className:"text-gray-500 dark:text-gray-400 hover:text-gray-700 dark:hover:text-gray-300",size:14})})]},e.id)):(0,a.jsx)("div",{className:"text-sm text-gray-500 dark:text-gray-400 py-2",children:"No recent searches"})})]})}),(0,a.jsx)(C.UpgradeModal,{isOpen:z,onClose:()=>I(!1),featureName:"Intuitive Search",featureDescription:"Available in Pro. Please upgrade to access intuitive search."})]})}},93499:(e,r,t)=>{t.d(r,{A:()=>a});let a=(0,t(71847).A)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])}}]);
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.