PageSourceSearch

https://softera.ai/assets/Blog-B1uMkqq1.js

js softera.ai collected 2026-10-05 15:08:09 UTC 10,370 bytes, 1 lines download raw bytes

1import{c as B,r as i,j as e,a as m,u as N,L as S,k as F}from"./index-CLXOTad6.js";import{B as E,g as R,I as L,a as D}from"./posts--hcYfcMx.js";import{S as T}from"./search-LLAp-RKq.js";import{M as I,a as K}from"./mic-NWAT5BD1.js";import{C as z}from"./chevron-left-BddThCQM.js";const M=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],P=B("chevron-right",M),j=i.forwardRef(({className:t,type:u,...c},o)=>e.jsx("input",{type:u,className:m("flex h-10 w-full rounded-md bg-background px-3 py-2 text-base ring-offset-background shadow-md hover:shadow-lg focus:shadow-lg transition-shadow duration-300 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:o,...c}));j.displayName="Input";const $=R();function _({post:t,index:u}){const{t:c,i18n:o}=N("blog"),d=o.language||"en",f={magenta:"bg-[#E01E5A]/10 text-[#E01E5A] hover:text-[#E01E5A]",teal:"bg-[#2EB67D]/10 text-[#2EB67D] hover:text-[#2EB67D]",blue:"bg-[#36C5F0]/10 text-[#36C5F0] hover:text-[#36C5F0]",yellow:"bg-[#ECB22E]/10 text-[#ECB22E] hover:text-[#ECB22E]",purple:"bg-[#8B5CF6]/10 text-[#8B5CF6] hover:text-[#8B5CF6]",orange:"bg-[#F59E0B]/10 text-[#F59E0B] hover:text-[#F59E0B]",emerald:"bg-[#10B981]/10 text-[#10B981] hover:text-[#10B981]"}[t.categoryColor];return e.jsxs(S,{href:`/${d}/blog/${t.slug}`,className:"group block bg-white/80 dark:bg-white/5 rounded-xl overflow-hidden shadow-md hover:shadow-xl transition-all duration-300 hover:-translate-y-1 cursor-pointer","data-testid":`blog-card-${t.slug}`,children:[e.jsx("div",{className:"block h-48 overflow-hidden",children:e.jsx(L,{src:t.image,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700",containerClassName:"w-full h-full"})}),e.jsxs("div",{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(D,{className:m("text-xs font-medium border-0",f),children:t.category}),e.jsxs("span",{className:"text-xs text-gray-600 dark:text-gray-400",children:[t.date," · ",t.readTime]})]}),e.jsx("h3",{className:"text-xl font-bold mb-3 text-gray-900 dark:text-white group-hover:text-[#E01E5A] dark:group-hover:text-[#E01E5A] transition-colors",children:t.title}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4 line-clamp-3",children:t.excerpt}),e.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[e.jsx("img",{src:t.author.image,alt:t.author.name,className:"w-10 h-10 rounded-full object-cover",loading:"lazy"}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-gray-900 dark:text-white",children:t.author.name}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.author.role})]})]}),e.jsxs("span",{className:"inline-flex items-center gap-1 font-medium text-[#E01E5A] group-hover:text-[#E01E5A]/80 transition-colors","data-testid":`read-more-${t.slug}`,children:[c("post.readMore"),F.includes(d)?e.jsx(z,{size:16}):e.jsx(P,{size:16})]})]})]})}function W(){const{t,i18n:u}=N("blog"),c=u.language||"en",[o,d]=i.useState(""),[n,f]=i.useState(""),[b,v]=i.useState(""),[p,g]=i.useState(!1),s=i.useRef(null),x=$.map(r=>{const a=t(r.authorKey,{returnObjects:!1}),l=t(`authors.${a}`,{returnObjects:!0}),h=t(r.tagsKey);return{id:r.id,slug:r.slug,title:t(r.titleKey),excerpt:t(r.excerptKey),image:r.image,category:t(r.categoryKey),categoryColor:r.categoryColor,author:{name:l?.name||a,role:l?.role||"",image:typeof l=="object"&&l!==null&&l.image?l.image:"/app_icon-96.png"},date:t(r.dateKey),readTime:t(r.readTimeKey),tags:h.split(", ").map(y=>y.trim())}}),k=[{name:t("categories.all"),count:x.length},...Array.from(new Set(x.map(r=>r.category))).map(r=>({name:r,count:x.filter(a=>a.category===r).length}))],C=Array.from(new Set(x.flatMap(r=>r.tags))).slice(0,8);i.useEffect(()=>{if("webkitSpeechRecognition"in window||"SpeechRecognition"in window){const r=window.SpeechRecognition||window.webkitSpeechRecognition;
1s.current=new r,s.current.continuous=!1,s.current.interimResults=!1;const a={en:"en-US",ar:"ar-SA",es:"es-ES",fr:"fr-FR",de:"de-DE",zh:"zh-CN",ja:"ja-JP",hi:"hi-IN",pt:"pt-BR",ru:"ru-RU",it:"it-IT",ko:"ko-KR"};s.current.lang=a[c]||"en-US",s.current.onresult=l=>{const h=l.results[0][0].transcript;d(y=>(y?y+" "+h:h).trim()),g(!1)},s.current.onerror=()=>g(!1),s.current.onend=()=>g(!1)}return()=>{s.current&&s.current.stop()}},[c]);const A=()=>{if(s.current)if(p)s.current.stop(),g(!1);else try{s.current.start(),g(!0)}catch{g(!1)}},w=x.filter(r=>{const a=o===""||r.title.toLowerCase().includes(o.toLowerCase())||r.excerpt.toLowerCase().includes(o.toLowerCase()),l=n===""||n===t("categories.all")||r.category===n,h=b===""||r.tags.includes(b);return a&&l&&h});return i.useEffect(()=>{document.title=t("hero.title");const r=document.querySelector('meta[name="description"]');r&&r.setAttribute("content",t("hero.description"))},[t]),e.jsxs("div",{children:[e.jsx("section",{className:"pt-24 pb-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[e.jsx("span",{className:"inline-block px-3 py-1 bg-[#E01E5A]/10 text-[#E01E5A] rounded-full text-sm font-medium mb-4",children:t("hero.badge")}),e.jsxs("h1",{className:"text-4xl md:text-5xl font-bold mb-6 text-gray-900 dark:text-white",children:[t("hero.titlePart1")," ",e.jsx("span",{className:"bg-gradient-to-r from-[#E01E5A] to-[#FF6B9D] bg-clip-text text-transparent",children:t("hero.titlePart2")})]}),e.jsx("p",{className:"text-xl text-gray-700 dark:text-gray-300 mb-8",children:t("hero.description")}),e.jsxs("div",{className:"relative max-w-xl mx-auto",children:[e.jsx(T,{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-gray-500 dark:text-gray-400",size:20}),e.jsx(j,{type:"text",placeholder:t("hero.search_placeholder"),value:o,onChange:r=>d(r.target.value),className:"pl-12 pr-14 py-6 text-base rounded-full bg-white/80 dark:bg-white/5 border-gray-200 dark:border-gray-700 shadow-sm text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 focus:outline-none focus:border-[#E01E5A] focus-visible:ring-2 focus-visible:ring-[#E01E5A] focus-visible:ring-offset-0","data-testid":"blog-search-input"}),e.jsx("button",{onClick:A,className:m("absolute right-4 top-1/2 transform -translate-y-1/2 w-8 h-8 rounded-full flex items-center justify-center transition-all",p?"bg-red-500 text-white animate-pulse":"bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"),"data-testid":"blog-voice-search-button","aria-label":p?"Stop recording":"Start voice search",children:p?e.jsx(I,{size:16}):e.jsx(K,{size:16})})]})]})})}),e.jsx("section",{className:"py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-4 gap-8",children:[e.jsx("div",{className:"lg:col-span-1",children:e.jsxs("div",{className:"sticky top-24",children:[e.jsxs("div",{className:"bg-white/80 dark:bg-white/5 rounded-xl shadow-md p-6 mb-8",children:[e.jsx("h3",{className:"text-lg font-bold mb-4 text-gray-900 dark:text-white",children:t("categories.all").split(" ")[0]}),e.jsx("ul",{className:"space-y-2",children:k.map((r,a)=>e.jsx("li",{children:e.jsxs("button",{onClick:()=>f(a===0?"":r.name),className:m("flex items-center justify-between w-full px-4 py-2 rounded-full text-left transition-all",a===0&&n===""||n===r.name?"bg-gradient-to-r from-[#E01E5A] to-[#FF6B9D] text-white shadow-md":"hover:bg-[#E01E5A]/10 hover:text-[#E01E5A] text-gray-700 dark:text-gray-300"),"data-testid":`category-${a}`,children:[e.jsx("span",{children:r.name}),e.jsx("span",{className:m("text-sm px-2 py-1 rounded-full",a===0&&n===""||n===r.name?"bg-white/20":"bg-gray-100 dark:bg-gray-700"),children:r.count})]})},a))})]}),e.jsxs("div",{className:"bg-white/80 dark:bg-white/5 rounded-xl shadow-md p-6",children:[e.jsx("h3",{className:"text-lg font-bold mb-4 text-gray-900 dark:text-white",children:t("post.tags")}),e.jsx("div",{className:"flex flex-wrap gap-2",children:C.map((r,a)=>e.jsx("button",{onClick:()=>v(b===r?"":r),className:m("text-sm px-3 py-1 rounded-full transition-colors",b===r?"bg-[#E01E5A] text-white":"bg-gray-100 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-gray-600"),children:r},a))})]})]})}),e.jsxs("div",{className:"lg:col-span-3",children:[w.length>0?e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-8",children:w.map((r,a)=>e.jsx(_,{post:r,index:a},r.id))}):e.jsxs("div",{className:"bg-white/80 dark:bg-white/5 rounded-xl p-8 text-center shadow-md",children:[e.jsx("h3",{className:"text-xl font-bold mb-2 text-gray-900 dark:text-white",children:t("search.noResults")}),e.jsx("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:t("search.noResults")}),e.jsx(E,{onClick:()=>{d(""),f(""),v("")}
1,className:"bg-[#E01E5A] hover:bg-[#E01E5A]/90",children:t("categories.all")})]}),e.jsx("div",{className:"mt-12 text-center",children:e.jsxs("p",{className:"text-gray-700 dark:text-gray-300 mb-4",children:[w.length," / ",x.length]})})]})]})})}),e.jsx("section",{className:"py-16",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs("div",{className:"max-w-3xl mx-auto text-center",children:[e.jsx("h2",{className:"text-3xl font-bold mb-6 text-gray-900 dark:text-white",children:t("newsletter.title")}),e.jsx("p",{className:"text-lg text-gray-700 dark:text-gray-300 mb-8",children:t("newsletter.description")}),e.jsxs("form",{className:"flex flex-col sm:flex-row gap-4 max-w-lg mx-auto",children:[e.jsx(j,{type:"email",placeholder:t("newsletter.placeholder"),className:"flex-1 rounded-full bg-white/80 dark:bg-white/5 border-gray-200 dark:border-gray-700 text-gray-900 dark:text-white placeholder:text-gray-500 dark:placeholder:text-gray-400 px-6 py-3 focus:outline-none focus:border-[#E01E5A] focus-visible:ring-2 focus-visible:ring-[#E01E5A] focus-visible:ring-offset-0",required:!0}),e.jsx(E,{type:"submit",className:"bg-gradient-to-r from-[#E01E5A] to-[#FF6B9D] hover:from-[#E01E5A]/90 hover:to-[#FF6B9D]/90 text-white rounded-full px-8 whitespace-nowrap",children:t("newsletter.button")})]})]})})})]})}export{W 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.