PageSourceSearch

https://medicodio.ai/_next/static/chunks/9103-c2af195eaa35dae3.js?dpl=dpl_DKoAaZUZpJaD2kUadkDWWSfsDTaz

js medicodio.ai collected 2026-10-05 16:09:03 UTC 14,818 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9103],{9103:(e,t,a)=>{a.d(t,{BlogList:()=>x});var r=a(95155),l=a(12115),n=a(6874),s=a.n(n),i=a(66766),o=a(94870),c=a(23562),d=a(42355),m=a(13052);function p(e){let{page:t,totalPages:a,onChange:l,className:n="",label:s="Pagination"}=e;if(a<=1)return null;let i=[];for(let e=1;e<=a;e++)1===e||e===a||1>=Math.abs(e-t)?i.push(e):"gap"!==i[i.length-1]&&i.push("gap");return(0,r.jsx)("nav",{className:"flex justify-center ".concat(n),"aria-label":s,children:(0,r.jsxs)("div",{className:"cir-page",children:[(0,r.jsx)("button",{type:"button",className:"cir-page__nav",onClick:()=>l(Math.max(1,t-1)),disabled:1===t,"aria-label":"Previous page",children:(0,r.jsx)(d.A,{"aria-hidden":"true"})}),i.map((e,a)=>"gap"===e?(0,r.jsx)("span",{className:"cir-page__gap","aria-hidden":"true",children:"…"},"gap-".concat(a)):(0,r.jsx)("button",{type:"button",className:"cir-page__num".concat(e===t?" cir-page__num--active":""),onClick:()=>l(e),"aria-label":"Page ".concat(e),"aria-current":e===t?"page":void 0,children:e},e)),(0,r.jsx)("button",{type:"button",className:"cir-page__nav",onClick:()=>l(Math.min(a,t+1)),disabled:t===a,"aria-label":"Next page",children:(0,r.jsx)(m.A,{"aria-hidden":"true"})})]})})}var u=a(25128),g=a(64567);async function h(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0,a=new URLSearchParams;t?a.set("category",t):e&&a.set("recent","true");let r=await fetch("/api/blog?".concat(a),{headers:{"Content-Type":"application/json"},next:{revalidate:60}});if(!r.ok)throw Error("Failed to fetch blog posts");return r.json()}function x(e){let{postsPerPage:t=3,showPagination:a=!1,category:n,posts:d}=e,[m,x]=(0,l.useState)([]),[f,b]=(0,l.useState)(1),[y,v]=(0,l.useState)(!d),[w,j]=(0,l.useState)(null),N=Math.ceil(m.length/t);return((0,l.useEffect)(()=>{if(d){x(d),v(!1);return}(async()=>{try{v(!0);let e=await h(!a&&!n,n);x(e)}catch(e){j(e instanceof Error?e.message:"An error occurred")}finally{v(!1)}})()},[a,n,d]),y)?(0,r.jsx)("main",{className:"relative overflow-hidden bg-white",children:(0,r.jsx)("div",{className:"max-w-7xl mx-auto px-6 py-16 lg:py-24 min-h-[80vh] flex items-center justify-center",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"animate-spin motion-reduce:animate-none rounded-full h-10 w-10 border-2 border-[#DCE5F8] border-t-[#0050E6] mx-auto","aria-hidden":"true"}),(0,r.jsx)("p",{className:"mt-4 text-sm text-[#5C6A89]",children:"Loading posts..."})]})})}):w?(0,r.jsxs)("div",{className:"text-center text-red-600 py-10",children:["Error: ",w]}):y||0!==m.length?(0,r.jsx)("section",{className:"w-full py-20 md:py-28 bg-[#F6F9FF]",children:(0,r.jsxs)("div",{className:"mx-auto max-w-6xl px-4 md:px-6",children:[(0,r.jsxs)("div",{className:"mb-10 md:mb-14 flex flex-wrap items-end justify-between gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"block mb-4 text-[11px] font-bold uppercase tracking-[0.3em] text-[#0050E6]",children:"From the blog"}),(0,r.jsx)("h2",{className:"font-display font-bold text-[#141834] text-[28px] leading-[34px] md:text-[34px] md:leading-[42px] tracking-[-0.01em]",children:"Latest Blog Posts"})]}),!a&&(0,r.jsxs)(s(),{href:"/resources/blog",className:"group inline-flex items-center gap-2 rounded-full border border-[#DCE5F8] bg-white px-5 py-2.5 text-sm font-semibold text-[#141834] transition-colors duration-300 motion-reduce:transition-none hover:border-[#0050E6]/40 hover:text-[#00309F]",children:["View all articles",(0,r.jsx)(o.A,{className:"h-4 w-4 text-[#0050E6] transition-transform duration-300 motion-reduce:transition-none group-hover:translate-x-px group-hover:-translate-y-px","aria-hidden":"true"})]})]}),(0,r.jsx)("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6 md:gap-8 overflow-x-auto md:overflow-x-visible pb-4 md:pb-0 grid-flow-col md:grid-flow-row auto-cols-[calc(100%-1.5rem)] md:auto-cols-auto",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(()=>{let e=(f-1)*t;return m.slice(e,e+t)})().map(e=>{var t,a,l,d,m,p,h;return(0,r.jsx)("article",{className:"group flex flex-col overflow-hidden rounded-2xl border border-[#DCE5F8] bg-white transition-all duration-300 motion-reduce:transition-none motion-reduce:transform-none hover:-translate-y-1 hover:border-[#0050E6]/30 depth-1 hover:shadow-[0_2px_4px_rgba(11,15,31,0.05),0_12px_32px_rgba(0,48,159,0.1)]",children:(0,r.jsxs)(s(),{href:"/resources/blog/".concat(e.slug.current),className:"flex flex-col flex-grow",children:[(0,r.jsx)("div",{className:"relative h-48 md:h-52 flex-shrink-0 overflow-hidden bg-[#F6F9FF]",children:(0,r.jsx)(i.default,{src:(null==(a=e.mainImage)||null==(t=a.asset)?void 0:t.url)||u.A,alt:(null==(l=e.mainImage)?void 0:l.alt)||e.title,fill:!0,sizes:"(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw",className:"object-cover transition-transform duration-700 motion-reduce:transition-none motion-reduce:transform-none group-hover:scale-105"})}),(0,r.jsxs)("div",{className:"flex flex-col flex-grow p-5 md:p-6",children:[(0,r.jsxs)("div",{className:"mb-3 flex flex-wrap items-center gap-x-3 gap-y-1.5",children:[(null==(d=e.categories)?void 0:d[0])&&(0,r.jsx)("span",{className:"inline-flex items-center rounded-full bg-[#EDF3FF] px-2.5 py-1 text-[11px] font-bold uppercase tracking-[0.08em] text-[#0050E6]",children:n||(null==(p=e.categories)||null==(m
1=p[0])?void 0:m.title)}),(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 text-[11px] font-medium uppercase tracking-[0.08em] text-[#5C6A89]",children:[(0,r.jsx)(c.A,{className:"h-3.5 w-3.5","aria-hidden":"true"}),new Date(e.date).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})]})]}),(0,r.jsx)("h3",{className:"mb-2 line-clamp-2 text-[17px] font-semibold leading-[24px] text-[#141834] transition-colors duration-300 motion-reduce:transition-none group-hover:text-[#00309F]",children:e.title.slice(0,60)+(e.title.length>60?"...":"")}),(0,r.jsx)("p",{className:"mb-5 line-clamp-2 text-sm leading-[22px] text-[#5C6A89]",children:(0,g.Ht)(e.blogcontent,120)}),(0,r.jsxs)("div",{className:"mt-auto flex items-center justify-between border-t border-[#DCE5F8] pt-4",children:[(0,r.jsx)("span",{className:"text-xs font-medium text-[#5C6A89] truncate pr-3",children:null==(h=e.author)?void 0:h.name}),(0,r.jsxs)("span",{className:"inline-flex shrink-0 items-center gap-1.5 text-sm font-semibold text-[#0050E6]",children:["Read article",(0,r.jsx)(o.A,{className:"h-4 w-4 transition-transform duration-300 motion-reduce:transition-none motion-reduce:transform-none group-hover:translate-x-px group-hover:-translate-y-px","aria-hidden":"true"})]})]})]})]})},e._id)})}),a&&m.length>0&&(0,r.jsx)(p,{page:f,totalPages:N,onChange:e=>{b(e),window.scrollTo({top:0,behavior:"smooth"})},className:"mt-12",label:"Blog pagination"})]})}):(0,r.jsx)("div",{className:"w-full py-16 bg-white",children:(0,r.jsx)("div",{className:"container mx-auto px-6",children:(0,r.jsxs)("div",{className:"text-center py-20",children:[(0,r.jsx)("span",{className:"block mb-5 text-[11px] font-bold uppercase tracking-[0.3em] text-[#0050E6]",children:"Blog"}),(0,r.jsxs)("h2",{className:"font-display font-bold text-[28px] leading-[36px] md:text-[32px] md:leading-[40px] text-[#141834] mb-4",children:['No blogs found for "',n,'"']}),(0,r.jsx)("p",{className:"text-[#5C6A89] mb-8 text-base max-w-md mx-auto",children:"We couldn't find any blog posts in this category/page. Check out all our latest posts here."}),(0,r.jsxs)(s(),{href:"/resources/blog",className:"group inline-flex items-center gap-2 rounded-full bg-[#0050E6] px-7 py-3 text-sm font-semibold text-white transition-colors duration-300 motion-reduce:transition-none hover:bg-[#00309F]",children:["Explore all blogs",(0,r.jsx)(o.A,{className:"h-4 w-4 transition-transform duration-300 motion-reduce:transition-none group-hover:translate-x-px group-hover:-translate-y-px","aria-hidden":"true"})]})]})})})}},25128:(e,t,a)=>{a.d(t,{A:()=>r});let r={src:"/_next/static/media/defaultBlogImage.26e13288.svg",height:211,width:313,blurWidth:0,blurHeight:0}},64567:(e,t,a)=>{function r(e){return e&&Array.isArray(e)?e.map(e=>"block"===e._type&&e.children?e.children.map(e=>{let t=e.text||"";return t.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/<[^>]*>/g," ").replace(/\s+/g," ").trim()}).filter(e=>e.length>0).join(""):"image"===e._type?e.alt||e.caption||"[Image]":"").filter(e=>e.length>0).join(" ").replace(/\s+/g," ").trim():""}function l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:150;if(!e||!Array.isArray(e))return"";let a=r(e).replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/<[^>]*>/g," ").replace(/\s+/g," ").replace(/\n+/g," ").trim();return a.length>t?a.slice(0,t).trim()+"...":a}a.d(t,{Ht:()=>l,Xi:()=>o});let n=new Set(["h1","h2","h3","h4","h5","h6"]),s={h1:"text-4xl font-bold text-gray-900 mb-6 mt-8 leading-tight",h2:"text-3xl font-bold text-gray-900 mb-5 mt-7 leading-tight",h3:"text-2xl font-bold text-gray-900 mb-4 mt-6 leading-tight",h4:"text-xl font-bold text-gray-900 mb-3 mt-5 leading-tight",h5:"text-lg font-bold text-gray-900 mb-3 mt-4 leading-tight",h6:"text-base font-bold text-gray-900 mb-2 mt-3 leading-tight"};function i(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:2,t=[];return function(a){for(;t.length&&t[t.length-1]>=a;)t.pop();let r=Math.min(e+t.length,6);return t.push(a),r}}function o(e){if(!e||!Array.isArray(e))return"";let t=function(e){let t=[],a=[],r=null;return e.forEach((e,l)=>{e.listItem?null===r||r===e.listItem?(r=e.listItem,a.push(e)):(a.length>
10&&t.push({_type:"list",listType:r,items:a}),a=[e],r=e.listItem):(a.length>0&&(t.push({_type:"list",listType:r,items:a}),a=[],r=null),t.push(e))}),a.length>0&&t.push({_type:"list",listType:r,items:a}),t}(e),a=function(e){let t=new Map,a=i();return e.forEach((e,l)=>{if((null==e?void 0:e._type)!=="block"||!n.has(e.style)||!r([e]))return;let s="h1"===e.style?2:Number(e.style[1]);t.set(l,a(s))}),t}(t);return t.map((e,t)=>{var r,l,o;if("block"===e._type&&e.children){let l=e.markDefs||[],i=e.children.map(t=>{let a=t.text||"";if(!(a=a.replace(/<!--[\s\S]*?-->/g,"").replace(/&nbsp;/g," ").replace(/&amp;/g,"&").replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&apos;/g,"'").replace(/\s+/g," ").trim()))return"";if(t.marks&&t.marks.length>0){let e=t.marks.find(e=>l.some(t=>t._key===e&&"link"===t._type));if(e){let t=l.find(t=>t._key===e);if(t&&t.href){let{href:e,isExternal:r}=function(e){let t=(e||"").trim();if(!t)return{href:"",isExternal:!1};if(/^(mailto:|tel:|sms:|#)/i.test(t))return{href:t,isExternal:!1};let a=t.replace(/^https?:\/\/(www\.)?medicodio\.ai(?=$|[/?#])/i,"");return(a===t&&/^(www\.)?medicodio\.ai(?=$|[/?#])/i.test(a)&&(a=a.replace(/^(www\.)?medicodio\.ai/i,"")),/^([a-z][a-z0-9+.-]*:)?\/\//i.test(a))?{href:t,isExternal:!0}:!a.startsWith("/")&&/^[^/\s]+\.[a-z]{2,}(?=$|[/?#])/i.test(a)?{href:"https://".concat(a),isExternal:!0}:a?(a.startsWith("/")||(a="/"+a),{href:a=(a=a.replace(/^\/blog(?=$|[/?#])/,"/resources/blog")).replace(/^(.+?)\/(?=$|[?#])/,"$1"),isExternal:!1}):{href:"/",isExternal:!1}}(t.href);a='<a href="'.concat(e,'" class="text-blue-600 hover:text-blue-800 underline hover:no-underline transition-colors"').concat(r?' target="_blank" rel="noopener noreferrer"':"",">").concat(a,"</a>")}}t.marks.forEach(e=>{if(!l.some(t=>t._key===e))switch(e){case"strong":a='<strong class="font-bold">'.concat(a,"</strong>");break;case"em":a='<em class="italic">'.concat(a,"</em>");break;case"code":a='<code class="bg-gray-100 px-2 py-1 rounded text-sm font-mono">'.concat(a,"</code>");break;case"underline":a='<u class="underline">'.concat(a,"</u>");break;case"strike-through":a='<s class="line-through">'.concat(a,"</s>")}})}return e.children.indexOf(t)!==e.children.length-1&&a.trim()&&(a+=" "),a}).filter(e=>e.length>0).join("");if(n.has(e.style)){if(!i.trim())return"";let l=null!=(r=a.get(t))?r:2;return"<h".concat(l,' class="').concat(s[e.style],'">').concat(i,"</h").concat(l,">")}return"blockquote"===e.style?'<blockquote class="border-l-4 border-blue-600 pl-4 py-2 my-6 italic text-gray-700 bg-gray-50 rounded-r">'.concat(i,"</blockquote>"):i?'<p class="text-gray-800 mb-4 leading-relaxed">'.concat(i,"</p>"):""}if("image"===e._type){let t="";if(null==(l=e.asset)?void 0:l._ref){let a="g5m1o77v";if(!a)return console.warn("NEXT_PUBLIC_SANITY_PROJECT_ID not found, image may not load correctly"),"";let r=e.asset._ref.match(/^image-([a-f0-9]+)-(\d+x\d+)-(\w+)$/);if(r){let[,e,l,n]=r;t="https://cdn.sanity.io/images/".concat(a,"/").concat("medicodio_dataset","/").concat(e,"-").concat(l,".").concat(n)}}else(null==(o=e.asset)?void 0:o.url)&&(t=e.asset.url);let a=e.alt||"",r=e.caption||"";if(!t)return"";let n='<div class="my-6"><img src="'.concat(t,'" alt="').concat(a,'" class="w-full h-auto rounded-lg shadow-md" /></div>');return r&&(n='<div class="my-6"><img src="'.concat(t,'" alt="').concat(a,'" class="w-full h-auto rounded-lg shadow-md" /><p class="text-sm text-gray-600 text-center mt-3 italic">').concat(r,"</p></div>")),n}if("htmlBlock"===e._type){if(!e.html)return"";let t=function(e){let t=i(),a=[];return e.replace(/<(\/?)h([1-6])(\s|>|\/)/gi,(e,r,l,n)=>{var s;if(r)return"</h".concat(null!=(s=a.pop())?s:2).concat(n);let i=t(Number(l));return a.push(i),"<h".concat(i).concat(n)})}(e.html);return'<div class="html-embed">'.concat(t,"</div>")}if("table"===e._type){if(!e.rows||!Array.isArray(e.rows))return"";let t=e.rows.map((e,t)=>{let a=(e.cells||[]).map(e=>0===t?'<th class="border border-gray-300 px-3 py-2 bg-gray-50 font-semibold text-left">'.concat(e||"","</th>"):'<td class="border border-gray-300 px-3 py-2 text-gray-800">'.concat(e||"","</td>")).join("");return"<tr>".concat(a,"</tr>")}).join("");return'<div class="overflow-x-auto my-6"><table class="w-full border-collapse border border-gray-300 text-sm">'.concat(t,"</table></div>")}if("codeBlock"===e._type){let t=e.language||"",a=e.code||"";return'<pre class="bg-gray-900 text-gray-100 p-6 rounded-lg my-6 overflow-x-auto"><code class="language-'.concat(t,' text-sm">').concat(a,"</code></pre>")}else if("list"===e._type){let t=e.items.map(e=>{let t=e.children.map(e=>e.text||"").join("");
1return'<li class="text-gray-800 mb-2 leading-relaxed">'.concat(t,"</li>")}).join("");if("bullet"===e.listType)return'<ul class="list-disc ml-6 my-4">'.concat(t,"</ul>");if("number"===e.listType)return'<ol class="list-decimal ml-6 my-4">'.concat(t,"</ol>")}return""}).join("")}}}]);

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.