1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8002],{58002:function(e,t,a){a.d(t,{Z:function(){return SearchOverlay}});var s=a(26705),r=a(20955),l=a(3190),n=a(33753),o=a(96689),i=a(74020),c=a(61447),d=a(14430),x=a(61396),g=a.n(x),m=a(79925),h=a(31226),p=a(10219),u=a(85812);function ResultCard(e){var t,a,r,l,n,o;let{post:i,onClose:d}=e,x="/".concat(i.id,"/").concat(null===(t=i.images)||void 0===t?void 0:t[0]),h=encodeURIComponent(x),u=i.companyNameUrl&&i.id?"/post/".concat(encodeURIComponent(i.companyNameUrl),"/").concat(encodeURIComponent(i.id)):"#",y=i.tags||[],f="";if("string"==typeof(null===(a=i.user)||void 0===a?void 0:a.profileImage)){let e=i.user.profileImage.split(".").pop(),t=i.user.profileImage.split(".".concat(e))[0],a=encodeURIComponent("/".concat(i.user.id,"/").concat(t,"_200x200.webp"));f="https://firebasestorage.googleapis.com/v0/b/we-launch-b9954.appspot.com/o/user".concat(a,"?alt=media")}return(0,s.jsxs)("div",{className:"group mb-4 break-inside-avoid rounded-xl border border-gray-100 dark:border-gray-800 bg-white dark:bg-[#1e1f21] hover:shadow-md transition-shadow duration-200",style:{isolation:"isolate"},children:[(0,s.jsx)(g(),{href:u,onClick:d,prefetch:!1,children:(0,s.jsxs)("div",{className:"relative w-full overflow-hidden rounded-t-xl min-h-[120px] bg-gray-100 dark:bg-gray-800",style:{transform:"translateZ(0)"},children:[(0,s.jsx)("img",{src:"https://firebasestorage.googleapis.com/v0/b/we-launch-b9954.appspot.com/o/post".concat(h,"?alt=media"),alt:i.title,className:"w-full transition-transform !duration-1000 !ease-in-out group-hover:scale-110 block",loading:"lazy"}),(0,s.jsx)("div",{className:"absolute inset-0 bg-gradient-to-t from-black/75 via-black/20 to-transparent flex flex-col justify-end p-3",children:(0,s.jsx)("h3",{className:"text-white font-bold text-xl sm:text-sm leading-snug line-clamp-2",children:i.title})})]})}),(0,s.jsxs)("div",{className:"px-3 py-2.5",children:[y.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1 mb-2.5",children:y.map((e,t)=>(0,s.jsx)("span",{className:"inline-flex items-center rounded-md px-1.5 py-0.5 text-xs ring-1 font-normal ".concat("bg-gray-50 text-gray-600 ring-gray-500/10"),children:e},t))}),(0,s.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,s.jsxs)(g(),{href:"/".concat(null===(r=i.user)||void 0===r?void 0:r.domain),prefetch:!1,onClick:d,className:"flex items-center gap-1.5 min-w-0 flex-1",children:[f?(0,s.jsx)("img",{src:f,alt:"",width:22,height:22,className:"w-5 h-5 rounded-full flex-shrink-0 object-cover",onError:e=>{e.currentTarget.style.display="none"}}):(0,s.jsx)("div",{className:"w-5 h-5 rounded-full bg-gray-200 dark:bg-gray-700 flex items-center justify-center text-xs flex-shrink-0 font-bold text-gray-500",children:null===(n=i.user)||void 0===n?void 0:null===(l=n.companyName)||void 0===l?void 0:l.charAt(0)}),(0,s.jsxs)("div",{className:"min-w-0",children:[(0,s.jsx)("p",{className:"text-xs font-semibold text-gray-800 dark:text-gray-200 truncate leading-none",children:null===(o=i.user)||void 0===o?void 0:o.companyName}),(0,s.jsx)("p",{className:"text-xs text-gray-400 dark:text-gray-500 leading-none mt-0.5",children:(0,s.jsx)(m.default,{time:i.regDate})})]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-xs text-gray-400 flex-shrink-0",children:[(0,s.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,s.jsx)(c.Z,{className:"w-3 h-3"}),(0,p.uf)(i.shares||0)]}),(0,s.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,s.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-3 h-3",viewBox:"0 0 512 512",fill:"none",stroke:"currentColor",strokeWidth:"32",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,s.jsx)("rect",{x:"64",y:"320",width:"48",height:"160",rx:"8"}),(0,s.jsx)("rect",{x:"288",y:"224",width:"48",height:"256",rx:"8"}),(0,s.jsx)("rect",{x:"400",y:"112",width:"48",height:"368",rx:"8"}),(0,s.jsx)("rect",{x:"176",y:"32",width:"48",height:"448",rx:"8"})]}),(0,p.uf)(Math.round(i.views||0))]})]})]})]})]})}let Footer=()=>(0,s.jsx)("p",{className:"text-center text-xs text-gray-400 dark:text-gray-600 mt-16 pb-10",children:"Copyright \xa9 Welaunch. All Rights Reserved"});function SkeletonLine(e){let{w:t="w-full"}=e;return(0,s.jsx)("div",{className:"h-4 ".concat(t," rounded bg-gray-200 dark:bg-gray-700 animate-pulse")})}function SkeletonSection(e){let{title:t=!0,rows:a=5,type:r="list"}=e;return(0,s.jsxs)("div",{children:[t&&(0,s.jsx)("div",{className:"h-7 w-40 rounded bg-gray-200 dark:bg-gray-700 animate-pulse mb-5"}),"list"===r&&(0,s.jsx)("div",{className:"space-y-3",children:Array.from({length:a}).map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"h-4 w-4 roun
1ded bg-gray-200 dark:bg-gray-700 animate-pulse flex-shrink-0"}),(0,s.jsx)(SkeletonLine,{w:"w-".concat(["2/3","1/2","3/4","1/2","2/5"][t%5])})]},t))}),"tags"===r&&(0,s.jsx)("div",{className:"flex flex-wrap gap-2.5",children:Array.from({length:12}).map((e,t)=>(0,s.jsx)("div",{className:"h-8 rounded-full bg-gray-200 dark:bg-gray-700 animate-pulse ".concat(["w-14","w-20","w-16","w-24","w-12","w-18","w-16","w-20","w-14","w-16","w-22","w-12"][t])},t))})]})}function SearchOverlay(e){let{onClose:t}=e,[a,c]=(0,r.useState)(""),[x,m]=(0,r.useState)([]),[p,y]=(0,r.useState)([]),[f,j]=(0,r.useState)([]),[b,v]=(0,r.useState)([]),[k,w]=(0,r.useState)(!0),[N,S]=(0,r.useState)(!1),[C,R]=(0,r.useState)(""),[L,U]=(0,r.useState)("keyword"),[I,F]=(0,r.useState)([]),[Z,E]=(0,r.useState)(!1),[A,D]=(0,r.useState)(!1),[_,K]=(0,r.useState)(null),[T,z]=(0,r.useState)(null),B=(0,r.useRef)(null);(0,d.kx)(e=>e.setKeywords),(0,d.kx)(e=>e.fireSearch),(0,r.useEffect)(()=>{var e;null===(e=B.current)||void 0===e||e.focus(),document.body.style.overflow="hidden";let handleKeyDown=e=>{"Escape"===e.key&&t()};return document.addEventListener("keydown",handleKeyDown),Promise.all([fetch("/api/tags/top").then(e=>e.json()).catch(()=>({tags:[]})),fetch("/api/tag/getTags").then(e=>e.json()).catch(()=>({tagList:[]})),fetch("/api/postList/popular").then(e=>e.json()).catch(()=>({posts:[]})),fetch("/api/postList/recommended").then(e=>e.json()).catch(()=>({postList:[]}))]).then(e=>{let[t,a,s,r]=e;m(t.tags||[]),y(a.tagList||[]),v((s.posts||[]).slice(0,5)),j((r.postList||[]).slice(0,5)),w(!1)}),()=>{document.body.style.overflow="",document.removeEventListener("keydown",handleKeyDown)}},[]);let fetchResults=async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"keyword";E(!0);try{var s;let r;let l="tag"===a?"tags=".concat(encodeURIComponent(e)):"keyword=".concat(encodeURIComponent(e)),n="/api/postList/?1=1&".concat(l,"&limit=").concat(24);t&&(n+="&cursor=".concat(t));let o=await fetch(n,{cache:"no-store"}),i=await o.json(),c=i.postList||[];t?F(e=>(r=e.length+c.length,[...e,...c])):(r=c.length,F(c),"number"==typeof i.total&&z(i.total)),K(c.length>0?c[c.length-1].id:null);let d=t?T:null!==(s=i.total)&&void 0!==s?s:null;null!==d?D(r>=d):D(c.length<24)}catch(e){F([])}E(!1)},openResults=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"keyword";R(e),U(t),F([]),K(null),D(!1),z(null),S(!0),fetchResults(e,null,t)},postUrl=e=>e.companyNameUrl&&e.id?"/post/".concat(encodeURIComponent(e.companyNameUrl),"/").concat(encodeURIComponent(e.id)):"#",O=(0,s.jsx)("div",{className:"fixed inset-0 z-[9999] bg-white dark:bg-[#18191B] overflow-y-auto",children:(0,s.jsxs)("div",{className:"max-w-5xl mx-auto px-6 py-8",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-7",children:[N?(0,s.jsxs)("button",{onClick:()=>{S(!1),R(""),F([])},className:"flex items-center gap-2 hover:opacity-70 transition-opacity",children:[(0,s.jsx)(n.Z,{className:"w-6 h-6 text-gray-600 dark:text-gray-300"}),(0,s.jsx)("span",{className:"text-xl font-bold text-gray-800 dark:text-gray-100",children:"ë´ì¤ ê²ì"})]}):(0,s.jsx)("span",{className:"text-xl font-bold text-gray-800 dark:text-gray-100",children:"ë´ì¤ ê²ì"}),(0,s.jsx)("button",{onClick:t,className:"p-1.5 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800",children:(0,s.jsx)(o.Z,{className:"w-7 h-7 text-gray-500 dark:text-gray-400"})})]}),(0,s.jsx)("form",{onSubmit:e=>{e.preventDefault(),a.trim()&&openResults(a.trim())},className:"mb-2",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 px-1 py-3 min-w-0",children:[(0,s.jsx)(i.Z,{className:"w-5 h-5 text-gray-400 flex-shrink-0"}),(0,s.jsx)("input",{ref:B,type:"text",value:a,onChange:e=>c(e.target.value),placeholder:"ì°¾ê³ ì¶ì ë´ì¤ë¥¼ ê²ìíì¸ì",className:"flex-1 min-w-0 bg-transparent outline-none text-gray-800 dark:text-gray-100 text-lg placeholder-gray-400"}),a&&(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,s.jsx)("button",{type:"button",onClick:()=>{var e;c(""),null===(e=B.current)||void 0===e||e.focus()},className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors","aria-label":"ê²ìì´ ì§ì°ê¸°",children:(0,s.jsx)(o.Z,{className:"w-5 h-5 text-gray-400 dark:text-gray-500"})}),(0,s.jsx)("span",{className:"w-px h-5 bg-gray-300 dark:bg-gray-600 mx-1"}),(0,s.jsx)("button",{type:"submit",className:"p-1 rounded-full hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors","aria-label":"ê²ì",children:(0,s.jsx)(i.Z,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"})})]})]})}),(0,s.jsx)("div",{className:"border-b border-gray-200 dark:border-gray-700 mb-10"}),N?(0,s.jsxs)("div",{children:[(0,s.jsxs)("p",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-8",children:[C,null!==T?(0,s.jsxs)("span",{className:"text-base font-normal text-gray-400 ml-2",children:["(",T.toLocaleStr
1ing(),")"]}):!Z&&I.length>0?(0,s.jsxs)("span",{className:"text-base font-normal text-gray-400 ml-2",children:["(",I.length,")"]}):null]}),Z&&0===I.length&&(0,s.jsx)("div",{className:"columns-1 sm:columns-2 lg:columns-3 gap-4",children:Array.from({length:6}).map((e,t)=>(0,s.jsx)("div",{className:"break-inside-avoid",children:(0,s.jsx)(h.default,{variant:t%3==2?"tall":"wide"})},"sk-".concat(t)))}),!Z&&0===I.length&&(0,s.jsx)("p",{className:"text-gray-400 text-center py-16",children:"ê²ì ê²°ê³¼ê° ììµëë¤."}),I.length>0&&(0,s.jsxs)("div",{className:"columns-1 sm:columns-2 lg:columns-3 gap-4",children:[I.map((e,a)=>(0,s.jsx)("div",{className:"break-inside-avoid",children:(0,s.jsx)(ResultCard,{post:e,onClose:t})},a)),Z&&Array.from({length:3}).map((e,t)=>(0,s.jsx)("div",{className:"break-inside-avoid",children:(0,s.jsx)(h.default,{variant:t%3==2?"tall":"wide"})},"sk-".concat(t)))]}),!A&&!Z&&I.length>0&&(0,s.jsx)("div",{className:"w-full text-center mt-8",children:(0,s.jsx)("button",{onClick:()=>fetchResults(C,_,L),className:"border border-slate-300 dark:border-gray-600 px-12 py-2.5 rounded-md text-gray-700 dark:text-slate-100 text-sm hover:border-slate-500 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors",children:"ë보기"})}),(0,s.jsx)(Footer,{})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-12",children:[(0,s.jsx)("div",{className:"space-y-20",children:k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(SkeletonSection,{title:!0,rows:5,type:"list"}),(0,s.jsx)(SkeletonSection,{title:!0,rows:0,type:"tags"})]}):(0,s.jsxs)(s.Fragment,{children:[x.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-5",children:"ì¤ìê° ê²ì ìì Top5"}),(0,s.jsx)("ol",{className:"space-y-3",children:x.map((e,t)=>(0,s.jsx)("li",{children:(0,s.jsxs)("button",{onClick:()=>openResults(e.tag,"tag"),className:"flex items-center gap-4 w-full text-left hover:opacity-70 transition-opacity",children:[(0,s.jsx)("span",{className:"text-base font-bold w-5 ".concat(t<3?"text-brand dark:text-brand-dark":"text-gray-400"),children:t+1}),(0,s.jsx)("span",{className:"text-base font-medium text-gray-800 dark:text-gray-200",children:e.tag})]})},t))})]}),p.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-5",children:"íê·¸"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-2.5",children:p.map((e,t)=>(0,s.jsx)("button",{onClick:()=>openResults(e,"tag"),className:"text-sm px-4 py-1.5 rounded-full border border-gray-200 dark:border-gray-700 text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors",children:e},t))})]})]})}),(0,s.jsx)("div",{className:"space-y-20",children:k?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(SkeletonSection,{title:!0,rows:5,type:"list"}),(0,s.jsx)(SkeletonSection,{title:!0,rows:5,type:"list"})]}):(0,s.jsxs)(s.Fragment,{children:[f.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-5",children:"ì¶ì² ë´ì¤"}),(0,s.jsx)("ul",{className:"space-y-3",children:f.map((e,a)=>(0,s.jsx)("li",{children:(0,s.jsx)(g(),{href:postUrl(e),onClick:t,className:"text-[15px] leading-snug text-gray-700 dark:text-gray-300 hover:text-brand dark:hover:text-brand-dark transition-colors line-clamp-1",children:e.title})},a))})]}),b.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-2xl font-bold text-gray-800 dark:text-gray-100 mb-5",children:"ì¸ê¸° ë´ì¤"}),(0,s.jsx)("ul",{className:"space-y-3",children:b.map((e,a)=>(0,s.jsx)("li",{children:(0,s.jsx)(g(),{href:postUrl(e),onClick:t,className:"text-[15px] leading-snug text-gray-700 dark:text-gray-300 hover:text-brand dark:hover:text-brand-dark transition-colors line-clamp-1",children:e.title})},a))})]})]})})]}),(0,s.jsx)(u.default,{onClose:t,source:"search"}),(0,s.jsx)(Footer,{})]})]})});return(0,l.createPortal)(O,document.body)}}}]);
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.