PageSourceSearch

https://cdn.mindmapai.app/static/js/blog/blog-search-d64760b226d4a154b1f129c641a1989e.js

js mindmapai.app collected 2026-10-01 12:37:20 UTC 5,479 bytes, 1 lines download raw bytes

1var k=400,B=2;function l(n){return n==null?"":String(n).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function T(){return typeof crypto!="undefined"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"blog-search-"+Math.random().toString(36).slice(2)}function U(n){var a=n.map(function(r){var i=r.cardImageOptUrl?'<source type="image/webp" srcset="'+l(r.cardImageOptUrl)+'">':"";return'<article class="blog-fade-in group"><a href="'+l(r.url)+'" class="flex h-full flex-col overflow-hidden rounded-2xl bg-white ring-1 ring-inset ring-slate-200 no-underline shadow-[0_1px_2px_rgba(15,23,42,0.04),0_6px_14px_rgba(15,23,42,0.04)] cursor-pointer transition-[box-shadow,transform,--tw-ring-color] duration-200 ease-out group-hover:-translate-y-[3px] group-hover:ring-violet-300 group-hover:shadow-[0_1px_2px_rgba(15,23,42,0.04),0_12px_28px_rgba(15,23,42,0.08)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/40 focus-visible:ring-offset-2"><div class="aspect-[16/9] overflow-hidden rounded-t-2xl bg-violet-50"><picture>'+i+'<img src="'+l(r.cardImageUrl)+'" alt="'+l(r.title)+`" width="400" height="225" loading="lazy" decoding="async" class="block h-full w-full object-cover transition-transform duration-[400ms] ease-out group-hover:scale-[1.01]"></picture></div><div class="flex flex-1 flex-col gap-2.5 px-6 pb-6 pt-5"><h2 class="m-0 line-clamp-3 min-h-[4.5rem] font-[Manrope,'Inter',system-ui,sans-serif] text-lg font-bold leading-[1.35] text-slate-900 transition-colors duration-200 group-hover:text-violet-700">`+l(r.title)+'</h2><div class="mt-auto flex items-center gap-2 overflow-hidden whitespace-nowrap pt-1.5 text-xs"><span class="min-w-0 shrink truncate font-semibold text-slate-700">'+l(r.authorName)+'</span><span class="shrink-0 text-slate-300">&middot;</span><span class="shrink-0 text-slate-500">'+l(r.createdDate)+"</span></div></div></a></article>"}).join("");return'<div class="grid grid-cols-[repeat(auto-fill,minmax(min(300px,100%),1fr))] gap-7">'+a+"</div>"}function q(n){var a=n?`<h2 class="font-[Manrope,'Inter',system-ui,sans-serif] text-xl font-bold text-slate-900">No articles match &#8220;`+l(n)+"&#8221;</h2>":`<h2 class="font-[Manrope,'Inter',system-ui,sans-serif] text-xl font-bold text-slate-900">No Results Found</h2>`;return'<div class="flex flex-col items-center gap-3.5 px-6 py-[72px] text-center"><div class="flex h-14 w-14 items-center justify-center rounded-2xl bg-violet-50 text-violet-600"><svg class="h-[26px] w-[26px]" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><circle cx="11" cy="11" r="7"></circle><path d="M20 20l-3.5-3.5"></path><line x1="13.5" y1="8.5" x2="8.5" y2="13.5"></line><line x1="8.5" y1="8.5" x2="13.5" y2="13.5"></line></svg></div>'+a+'<p class="m-0 max-w-[400px] text-base text-slate-500">Try a different keyword, or browse all articles.</p><a href="/blog/" data-blog-clear class="mt-1.5 inline-flex min-h-[44px] items-center justify-center rounded-full bg-violet-600 px-6 text-sm font-semibold text-white no-underline transition-colors duration-150 hover:bg-violet-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-violet-500/40 focus-visible:ring-offset-2">Show all articles</a></div>'}function M(n,a){n=n||document,a=a||window;var r=n.getElementById("blog-search-form"),i=n.getElementById("blog-search"),c=n.getElementById("blog-listing");if(!r||!i||!c)return null;var s=n.getElementById("blog-search-clear"),f=n.getElementById("blog-result-count"),h=n.getElementById("blog-result-count-text"),v=i.value.trim()===""?c.innerHTML:null,o=null,m=0;function x(){return m}function w(e,t){if(!(!f||!h)){f.classList.remove("hidden");var u=e+(e===1?" article found":" articles found"),d=typeof requestAnimationFrame=="function"?requestAnimationFrame:function(L){L()};d(function(){h.textContent=u}),s&&s.classList.remove("hidden")}}function y(){f&&f.classList.add("hidden"),s&&s.classList.add("hidden")}function b(e){var t=c.contains(n.activeElement);c.innerHTML=e,t&&i.focus()}function g(){if(v===null){a.location.assign("/blog/");return}b(v),y()}function I(e,t){w(t.length,e),b(t.length===0?q(e):U(t))}function E(e){return fetch("/blog/search?q="+encodeURIComponent(e),{method:"GET",credentials:"same-origin",headers:{"X-Correlation-ID":T()}}).then(function(t){if(t.redirected)throw new Error("blog search request was redirected");if(!t.ok)throw new Error("blog search request failed: "+t.status);return t.json()}).then(function(t){if(!t||t.code!=="S1000")throw new Error("blog search returned a non-success envelope");return t.result||[]})}function p(e){var t=++m,u=e.trim();if(u.length<B){g();return}E(u).then(function(d){x()===t&&I(u,d)}).catch(function(d){x()===t&&console.warn("blog search failed",d)})}function _(){o!==null&&clearTimeout(o);var e=i.value;o=setTimeout(function(){o=null,p(e)},k)}return i.addEventListener("input",_),r.addEventListener("submit",function(e){e.preventDefault(),o!==null&&(clearTimeout(o),o=null),p(i.value)}),s&&s.addEventListener("click",function(e){e.preventDefault(),i.value="",g()}),c.addEventListener("click",function(e){var t=e.target.closest?e.target.closest("[data-blog-clear]"):null;t&&(e.preventDefault(),i.value="",g())}),{run:p,restore:g}}typeof document!="undefined"&&document.getElementById("blog-search-form")&&M(document);export{k as DEBOUNCE_MS,l as escapeHtml,M as initBlogSearch};

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.