1import{j as e}from"./vendor-ui-CcT6p1TC.js";import{e as y,L as h}from"./vendor-react-l2v3jlXS.js";import{al as N,aa as w,S as v,H as k,m as p,am as I,F as C}from"./index-BDHAr9_M.js";import{B as O}from"./BreadcrumbNav-CA1HZEfw.js";import{S as o}from"./skeleton-DHFlCuGP.js";import{M as L}from"./MarkdownContent-BNgqzA3V.js";import{O as g}from"./OutboundCTA-BaEeSxLZ.js";import{C as A,a as f}from"./ctas-DQEOuX2d.js";import{E as _}from"./external-link-D11aVlku.js";import"./vendor-recharts-D1mehUCX.js";import"./vendor-query-0S8RWxwY.js";import"./vendor-helmet-BI-z9MaL.js";import"./vendor-supabase-D4IPYmL8.js";import"./vendor-i18n-CIM3QP6o.js";function D(s){if(!s)return{markdown:"",heroImageUrl:null,citations:[],isAutomated:!1,wordCount:null};const t=typeof s.body=="string"?s.body:"",m=t?t.trim().split(/\s+/).filter(Boolean).length:null,l=(Array.isArray(s.citations)?s.citations:[]).map(r=>{if(typeof r=="string")return{url:r,domain:b(r)};if(r&&typeof r=="object"){const i=r,n=typeof i.url=="string"?i.url:null;return n?{url:n,label:typeof i.label=="string"?i.label:void 0,domain:typeof i.domain=="string"?i.domain:b(n)}:null}return null}).filter(r=>r!==null);return{markdown:t,heroImageUrl:s.hero_image_url??null,citations:l,isAutomated:!!s.draft_id,wordCount:m}}function b(s){try{return new URL(s).hostname.replace(/^www\./,"")}catch{return}}const J=()=>{const{slug:s}=y(),{data:t,isLoading:m,error:c}=N(s),{data:l}=w(),r=D(t),i=t!=null&&t.topic_id?l==null?void 0:l.find(a=>a.id===t.topic_id):null,n=r.wordCount?Math.max(1,Math.round(r.wordCount/200)):null,u=t!=null&&t.published_at?new Date(t.published_at).toLocaleDateString("en-IN",{year:"numeric",month:"long",day:"numeric"}):"",j=t?{"@context":"https://schema.org","@type":r.isAutomated?"NewsArticle":"Article",headline:t.title,description:t.summary??"",image:r.heroImageUrl??void 0,datePublished:t.published_at,dateModified:t.updated_at,author:{"@type":"Organization",name:"DK Enterprises Global Ltd"},publisher:{"@type":"Organization",name:"DK Enterprises Global Ltd",logo:{"@type":"ImageObject",url:"https://dkegl.com/images/DKLOGO.jpg"}},mainEntityOfPage:{"@type":"WebPage","@id":`https://dkegl.com/insights/${t.slug}`}}:void 0;return e.jsxs("div",{className:"flex flex-col min-h-screen",children:[t&&e.jsx(v,{title:t.title,description:t.summary??`${t.title} â DKEGL Industry Insights`,image:r.heroImageUrl??"/images/DKLOGO.jpg",type:"article",jsonLd:j,breadcrumbs:[{label:"Home",href:"/"},{label:"Industry Insights",href:"/insights"},{label:t.title}]}),e.jsx(k,{}),e.jsx("main",{className:"flex-grow",children:e.jsxs("div",{className:"container mx-auto px-4 lg:px-8 py-8",children:[e.jsx(O,{items:[{label:"Industry Insights",href:"/insights"},{label:(t==null?void 0:t.title)??"Loadingâ¦"}]}),m?e.jsxs("div",{className:"mt-6 space-y-4 max-w-3xl mx-auto",children:[e.jsx(o,{className:"h-10 w-3/4"}),e.jsx(o,{className:"aspect-[16/9] w-full"}),e.jsx(o,{className:"h-4 w-full"}),e.jsx(o,{className:"h-4 w-full"}),e.jsx(o,{className:"h-4 w-5/6"})]}):c||!t?e.jsxs("div",{className:"mt-12 text-center max-w-2xl mx-auto",children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Insight not found"}),e.jsx("p",{className:"mt-3 text-muted-foreground",children:"This article may have been moved or unpublished."}),e.jsx(h,{to:"/insights",className:"inline-block mt-6 text-primary hover:underline",children:"â Back to Industry Insights"})]}):e.jsxs("article",{className:"max-w-3xl mx-auto mt-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-sm text-muted-foreground mb-4",children:[i&&e.jsx(p,{variant:"secondary",children:i.name}),r.isAutomated&&e.jsx(p,{variant:"outline",className:"text-[10px] uppercase tracking-wider",children:"News digest"}),u&&e.jsx("span",{children:u}),n&&e.jsxs(e.Fragment,{children:[e.jsx("span",{"aria-hidden":"true",children:"·"}),e.jsxs("span",{children:[n," min read"]})]})]}),e.jsx("h1",{className:"font-serif text-3xl md:text-5xl font-semibold text-foreground tracking-tight mb-6",children:t.title}),e.jsx("div",{className:"aspect-[16/9] w-full overflow-hidden rounded-lg bg-muted mb-8 border border-border/50 shadow-sm",children:e.jsx(I,{url:r.heroImageUrl,title:t.title,eager:!0,withOverlay:!0,className:"w-full h-full object-cover"})}),t.summary&&e.jsx("div",{className:"border-l-4 border-primary pl-4 py-1 mb-8 text-lg text-foreground
1/90 italic",children:t.summary}),r.markdown?e.jsx(L,{content:r.markdown}):e.jsx("p",{className:"text-muted-foreground italic",children:"Content not available."}),r.citations.length>0&&e.jsxs("section",{className:"mt-12 pt-8 border-t border-border/50",children:[e.jsx("h2",{className:"font-serif text-xl font-semibold text-foreground mb-4",children:"Sources"}),e.jsx("ol",{className:"list-none space-y-3 text-sm",children:r.citations.map((a,x)=>{const d=x+1;return e.jsxs("li",{id:`cite-${d}`,className:"group flex items-start gap-3 scroll-mt-24 break-words border-l-2 border-transparent hover:border-primary/40 pl-3 py-1 rounded-sm transition-colors",children:[e.jsxs("span",{className:"text-xs font-mono text-primary/70 w-7 shrink-0 pt-1 tabular-nums",children:["[",d,"]"]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("a",{href:a.url,target:"_blank",rel:"noopener noreferrer",className:"text-foreground hover:text-primary inline-flex items-baseline gap-1 break-words font-medium transition-colors",children:[e.jsx("span",{children:a.label||a.domain||a.url}),e.jsx(_,{size:11,className:"shrink-0 opacity-60 translate-y-px"})]}),a.label&&a.domain&&e.jsx("p",{className:"text-xs text-muted-foreground mt-0.5",children:a.domain})]}),e.jsx("a",{href:`#ref-${d}`,"aria-label":`Return to reference ${d} in body`,className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 text-xs text-muted-foreground hover:text-primary transition-opacity shrink-0 pt-1 px-1",children:"â©"})]},`${a.url}-${x}`)})})]}),e.jsxs("div",{className:"border-t border-border/50 mt-16 pt-12 text-center",children:[e.jsx("p",{className:"text-muted-foreground mb-5",children:"Need a packaging solution structured around a brief like this?"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 items-center justify-center",children:[e.jsx(g,{cta:A,variant:"outline",size:"lg",className:"text-sm tracking-wide",campaign:t.slug}),e.jsx(g,{cta:{...f,href:`${f.href}?from=${encodeURIComponent(t.slug)}`},variant:"default",size:"lg",className:"text-sm tracking-wide",campaign:t.slug,children:"Prototype this brief â"})]})]}),e.jsx("p",{className:"text-xs text-muted-foreground/70 italic mt-12 text-center max-w-2xl mx-auto leading-relaxed",children:"This briefing is editorial commentary and does not constitute commercial advice. Verify regulatory specifics with the cited sources before acting on them."}),e.jsx("div",{className:"mt-10 pt-6 border-t border-border/50",children:e.jsx(h,{to:"/insights",className:"text-primary hover:underline",children:"â Back to Industry Insights"})})]})]})}),e.jsx(C,{})]})};export{J 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.