1import{j as e}from"./http-vendor-CaM1--0x.js";import{a as d,h as B,L as F,k as Y,R as P}from"./react-vendor-DdQ9Xf68.js";import{a as ee,C as se,c as y,B as c,x as ae,u as te,l as re,g as le,y as ie,z as ne,F as oe}from"./index-DdUwhG0e.js";import{u as ce}from"./useToolActions-DIfdInzc.js";import{B as I}from"./badge-DdBRuneQ.js";import{f as $}from"./formatters-LRX5MwA4.js";import{g as de}from"./avatarHelpers-Bn3Z4W6y.js";import{aL as me,ac as U,a7 as xe,i as M,C as he,ag as ge,T as R,u as V,aM as ue,z as _,aN as O,aI as q,a1 as p,aa as fe,_ as pe,b as je,a4 as we,aO as Ne,G as be,aP as ve,q as ye,at as Ce,aq as ke,aQ as Se,k as Te}from"./icons-vendor-BRqxeNaq.js";import{g as Ae}from"./toolHelpers-CfGwRV4H.js";import"./ui-forms-BiB2iH3C.js";import"./ui-core-B9W4qkKj.js";import"./utils-vendor-BahXF38p.js";import"./auth-vendor-DI1Pu9f8.js";import"./ui-navigation-CwSq-WDp.js";const Le=({id:t,slug:r,name:i,description:n,category:j,votes:C,imageUrl:k,websiteUrl:u,onVote:A,isFavorite:w,onFavorite:x,isNew:a=!1,isVerified:L=!1,isEssential:N=!1,index:b=0})=>{const v=B(),h=ee(),D=d.useCallback(g=>{g.target.closest("button")||v(`/ai-tools/${r}`)},[v,r]),E=d.useCallback(g=>{g.stopPropagation(),u?window.open(u,"_blank","noopener,noreferrer"):window.open(`/ai-tools/${r}`,"_blank")},[u,r]),S=d.useCallback(g=>{const T=g.target;T.onerror=null,T.src=de(i,{background:h.avatarBg.replace("#",""),color:"fff",size:128,bold:!0})},[i,h.avatarBg]);return e.jsx(se,{className:"group h-full overflow-hidden bg-white border border-gray-200 shadow-sm hover:shadow-md transition-all duration-200 rounded-lg cursor-pointer",onClick:D,children:e.jsx("div",{className:"p-5",children:e.jsxs("div",{className:"flex items-start space-x-4",children:[e.jsxs("div",{className:"relative flex-shrink-0",children:[e.jsx("div",{className:"w-12 h-12 rounded-md overflow-hidden bg-gray-100 border border-gray-200",children:e.jsx("img",{src:k,alt:i,width:48,height:48,className:"w-full h-full object-cover",onError:S,loading:"lazy",decoding:"async"})}),a&&e.jsx("div",{className:"absolute -top-1 -right-1",children:e.jsx(I,{className:y("text-white border-0 text-[10px] px-1.5 py-0.5",h.badgeNew),children:"New"})}),L&&!a&&e.jsx("div",{className:"absolute -top-1 -right-1",children:e.jsxs(I,{className:"bg-blue-500 text-white border-0 text-[10px] px-1.5 py-0.5",children:[e.jsx(me,{className:"h-2.5 w-2.5 mr-0.5"}),"èªè¨¼"]})})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("h3",{className:y("font-medium text-gray-900 truncate mb-1",h.titleSize),children:i}),e.jsx("div",{className:"flex flex-wrap gap-1.5 mb-3",children:e.jsx(I,{variant:"outline",className:"bg-gray-50 text-gray-700 text-xs font-normal",children:j})}),e.jsx("p",{className:y("text-gray-600 line-clamp-2 mb-4",h.descriptionSize),children:n}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(c,{size:"sm",variant:"outline",className:"flex-1 h-10 sm:h-9 border-gray-200 hover:bg-gray-50 text-gray-700",onClick:A,"aria-label":`Vote for ${i}, currently ${$(C)} votes`,children:[e.jsx(U,{className:"w-4 h-4 mr-1.5"}),$(C)]}),e.jsxs(c,{size:"sm",variant:"outline",className:"flex items-center h-10 sm:h-9 border-gray-200 hover:bg-gray-50 text-gray-700",onClick:E,"aria-label":u?`Visit ${i} website`:`View ${i} details`,children:[e.jsx(xe,{className:"w-4 h-4 mr-1.5"}),"詳細"]}),x&&e.jsx(c,{size:"sm",variant:"ghost",onClick:x,"aria-label":w?`Remove ${i} from favorites`:`Add ${i} to favorites`,className:y("p-2 h-10 w-10 sm:h-9 sm:w-9",w?"text-pink-500":"text-gray-400 hover:text-pink-500"),children:e.jsx(M,{className:y("w-5 h-5",w&&"fill-pink-500")})})]})]})]})})})},H=d.memo(Le,(t,r)=>t.id===r.id&&t.votes===r.votes&&t.isFavorite===r.isFavorite&&t.name===r.name&&t.slug===r.slug&&t.description===r.description&&t.category===r.category&&t.imageUrl===r.imageUrl&&t.websiteUrl===r.websiteUrl&&t.isNew===r.isNew&&t.isVerified===r.isVerified&&t.isEssential===r.isEssential&&t.index===r.index);H.displayName="ProductCard";const z=()=>{const[t,r]=d.useState(!0),i=[{title:"Project Management Tools",slug:"/best-project-management-tools",icon:e.jsx(R,{className:"h-4 w-4 text-gray-500"})}
1,{title:"AI Note-Taking Software",slug:"/best-ai-note-taking-software",icon:e.jsx(V,{className:"h-4 w-4 text-gray-500"})},{title:"AI Daily Planning Software",slug:"/best-ai-daily-planning-software",icon:e.jsx(ue,{className:"h-4 w-4 text-gray-500"})},{title:"AI Meeting Tools",slug:"/best-ai-meeting-tools",icon:e.jsx(_,{className:"h-4 w-4 text-gray-500"})},{title:"CRM Software for Teams",slug:"/best-crm-software-for-teams",icon:e.jsx(O,{className:"h-4 w-4 text-gray-500"})},{title:"AI Email Management Tools",slug:"/best-ai-email-management-tools",icon:e.jsx(q,{className:"h-4 w-4 text-gray-500"})},{title:"Productivity Tools for ADHD",slug:"/best-productivity-tools-for-adhd",icon:e.jsx(p,{className:"h-4 w-4 text-gray-500"})}];return e.jsxs("div",{className:"bg-white rounded-lg shadow-sm border border-gray-100 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between p-4 cursor-pointer",onClick:()=>r(!t),children:[e.jsx("h3",{className:"font-medium text-gray-900 text-sm",children:"BEST SOFTWARE"}),t?e.jsx(he,{className:"h-4 w-4 text-gray-500"}):e.jsx(ge,{className:"h-4 w-4 text-gray-500"})]}),e.jsx("div",{className:`transition-all duration-300 ${t?"hidden md:block":"block"}`,children:e.jsx("div",{className:"px-2 pb-3",children:i.map((n,j)=>e.jsxs(F,{to:n.slug,className:"flex items-center gap-3 px-3 py-2 rounded-md text-gray-700 hover:bg-gray-50 text-sm",children:[n.icon,e.jsx("span",{children:n.title})]},j))})})]})},De={Zap:p,PenTool:Te,Users:_,Mail:q,CalendarClock:Se,Briefcase:O,Target:R,Brain:ke,MessageSquare:Ce,BarChart3:ye,FileText:V,Folder:ve,Github:be,Headphones:Ne,Image:we,ArrowUpCircle:U,Check:je,Star:M},Ee=t=>t?De[t]||p:p;function Ge({staticSlug:t}){const{slug:r}=Y(),i=B(),{pages:n}=ae(),{data:j,isLoading:C}=te({limit:1e3,status:"published"}),k=j?.data||[],{toggleUpvote:u,toggleSave:A,isSaved:w}=ce(),x=t||r,[a,L]=d.useState(null),[N,b]=d.useState("popular"),[v,h]=d.useState(!1);d.useEffect(()=>{if(!x||!n.length)return;const s=n.find(l=>l.slug===x);s?(L(s),document.title=`${s.title} - ã¯ã¤ãã¯AI`):(re.warn(`Software page with slug "${x}" not found`),t||(le.error("Software page not found"),i("/")))},[x,n,i,t]);const D=()=>{if(!a||!k.length)return[];const s=a.title.toLowerCase().split(/\s+/),l=a.description.toLowerCase().split(/\s+/),o=[...new Set([...s,...l])].filter(m=>m.length>3&&!["and","the","for","with","your"].includes(m)),G=k.filter(m=>{if(m.status!=="published")return!1;const J=m.name.toLowerCase(),Q=m.description.toLowerCase(),Z=m.category.toLowerCase(),K=m.tags.map(f=>f.toLowerCase());return o.some(f=>J.includes(f)||Q.includes(f)||Z.includes(f)||K.some(X=>X.includes(f)))});return E(G)},E=s=>{switch(N){case"popular":return[...s].sort((l,o)=>o.votes-l.votes);case"newest":return[...s].sort((l,o)=>new Date(o.createdAt).getTime()-new Date(l.createdAt).getTime());case"rating":return[...s].sort((l,o)=>o.rating-l.rating);default:return s}},S=D(),g=(s,l,o=0)=>{s&&(s.preventDefault(),s.stopPropagation()),u(l,o)},T=(s,l)=>{s.preventDefault(),s.stopPropagation(),A(l)};if(!a)return e.jsx("div",{className:"flex items-center justify-center min-h-screen",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-purple-500"})});const W=a.content?.lastUpdated||new Date(a.updatedAt).toLocaleDateString("ja-JP",{year:"numeric",month:"long"});return e.jsxs("div",{className:"min-h-screen bg-white pb-16",children:[e.jsx("div",{className:`pt-32 pb-16 px-4 ${a.bgColor||"bg-purple-50"}`,children:e.jsxs("div",{className:"container mx-auto max-w-5xl",children:[e.jsxs(F,{to:"/",className:"inline-flex items-center text-gray-600 hover:text-gray-900 mb-8",children:[e.jsx(fe,{className:"w-4 h-4 mr-2"}),"ãã¼ã ã«æ»ã"]}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center gap-6",children:[e.jsx("div",{className:`w-16 h-16 rounded-2xl ${a.bgColor||"bg-purple-100"} flex items-center justify-center flex-shrink-0`,children:a.icon?e.jsx("span",{className:`${a.iconColor||"text-purple-600"}`,children:P.createElement(Ee(a.icon),{className:"w-8 h-8"})}):e.jsx(p,{className:`w-8 h-8 ${a.iconColor||"text-purple-600"}`})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-3",children:a.title}),e.jsx("p",{className:"text-lg text-gray-600 max-w-3xl",children:a.description}),a.content?.author&&e.jsxs("div",{className:"flex items-center mt-6",children:[e.jsxs(ie,{className:"w-8 h-8 mr-2 border border-gray-200",children:[e.jsx(ne,{src:a.c
1ontent.authorImage||"",alt:a.content.author}),e.jsx(oe,{children:a.content.author.charAt(0)})]}),e.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[e.jsx("span",{className:"font-medium text-gray-900 mr-1",children:a.content.author}),"· Last updated: ",W]})]})]})]})]})}),a.content?.introduction&&e.jsx("div",{className:"py-12 px-4 bg-white",children:e.jsx("div",{className:"container mx-auto max-w-3xl",children:e.jsx("div",{className:"prose prose-lg max-w-none",children:e.jsx("p",{children:a.content.introduction})})})}),e.jsx("div",{className:"px-4 bg-gray-50",children:e.jsxs("div",{className:"container mx-auto max-w-5xl",children:[e.jsx("div",{className:"block md:hidden mb-8 pt-8",children:e.jsx(z,{})}),e.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[e.jsx("div",{className:"hidden md:block w-64 shrink-0",children:e.jsx("div",{className:"sticky top-32",children:e.jsx(z,{})})}),e.jsxs("div",{className:"flex-1 py-12",children:[e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between mb-8 gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-2",children:a.content?.toolsHeading||"Top Tools"}),a.content?.toolsDescription&&e.jsx("p",{className:"text-gray-600 max-w-2xl",children:a.content.toolsDescription})]}),e.jsxs(c,{variant:"outline",className:"flex items-center gap-2 h-10 sm:h-9",onClick:()=>h(!v),children:[e.jsx(pe,{className:"w-4 h-4"}),"ãã£ã«ã¿ã¼"]})]}),v&&e.jsx("div",{className:"bg-white p-4 rounded-xl shadow-sm mb-8 border border-gray-100",children:e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium text-gray-700 mb-3",children:"ä¸¦ã³æ¿ã"}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(c,{variant:N==="popular"?"default":"outline",size:"sm",className:"h-10 sm:h-9 rounded-full",onClick:()=>b("popular"),children:"人æ°é "}),e.jsx(c,{variant:N==="newest"?"default":"outline",size:"sm",className:"h-10 sm:h-9 rounded-full",onClick:()=>b("newest"),children:"æ°çé "}),e.jsx(c,{variant:N==="rating"?"default":"outline",size:"sm",className:"h-10 sm:h-9 rounded-full",onClick:()=>b("rating"),children:"é«è©ä¾¡é "})]})]})})}),C?e.jsx("div",{className:"flex items-center justify-center py-12",children:e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-purple-500"})}):S.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:S.map(s=>e.jsx(H,{id:s.id,slug:s.slug,name:s.name,description:s.description,category:s.category,votes:s.votes,imageUrl:Ae(s),onVote:l=>g(l,s.id,s.votes),isFavorite:w(s.id),onFavorite:l=>T(l,s.id),isNew:s.isNew},s.id))}):e.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center bg-white rounded-xl shadow-sm border border-gray-100",children:[e.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mb-4",children:e.jsx(p,{className:"w-8 h-8 text-gray-400"})}),e.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"No tools found"}),e.jsx("p",{className:"text-gray-600 max-w-md mb-6",children:"æ¡ä»¶ã«ä¸è´ãããã¼ã«ãè¦ã¤ããã¾ããã§ããããã£ã«ã¿ã¼ã調æ´ããããå¾ã§ããä¸åº¦ã試ããã ããï¼"}),e.jsxs("div",{className:"flex gap-3",children:[e.jsx(c,{variant:"outline",className:"rounded-xl",onClick:()=>{b("popular")},children:"ãã£ã«ã¿ã¼ããªã»ãã"}),e.jsx(c,{className:"rounded-xl",onClick:()=>i("/add-product"),children:"Submit a Tool"})]})]})]})]})]})})]})}export{Ge as default};
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.