import{n as e,s as t,t as n}from"./jsx-runtime-Bzw2jH9X.js";import{It as r,Lt as i,Wt as a}from"./services-Ddh4dHvP.js";import{t as o}from"./date-CTxYulDo.js";import{t as s}from"./spin-DUmNjrhn.js";import{t as c}from"./createLucideIcon-BkIMvJln.js";import{t as l}from"./arrow-right-BKCuK_oe.js";import{t as u}from"./landmark-DkMwc64y.js";import{n as d}from"./modalStore-B5-16H5z.js";import{n as f}from"./AuthContext-PSb2BBjo.js";import{G as p,H as m,P as h,Q as g,an as _,cn as v,ln as y,rn as b}from"./index-DkcBoy_T.js";import{t as x}from"./SEO-Fa6MIXX-.js";import{t as S}from"./geo-seo-wnuFu27u.js";import{n as C,t as w}from"./report_default_cover-Cx2FuOkN.js";import{t as T}from"./useCategory-DYXkQcDE.js";import{t as E}from"./seo-text-Do_deNpV.js";import{t as D}from"./lib-C2bPEITi.js";var O={name:`calendar-days`,size:24,node:[[`path`,{d:`M8 2v3`,key:`1ioesn`}],[`path`,{d:`M16 2v3`,key:`otl347`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}],[`path`,{d:`M3 9h18`,key:`1pudct`}],[`path`,{d:`M8 13h.01`,key:`1sbv64`}],[`path`,{d:`M12 13h.01`,key:`y0uutt`}],[`path`,{d:`M16 13h.01`,key:`wip0gl`}],[`path`,{d:`M8 17h.01`,key:`p3bg7i`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}],[`path`,{d:`M16 17h.01`,key:`ql8jdd`}]]};O.node;var k=c(O),A=t(e(),1),j=n();function M(){let{id:e}=y(),t=Number(e),n=v(),{isAuthenticated:c}=f(),O=d(e=>e.open),{category:M}=T(),[N,P]=(0,A.useState)(null),[F,I]=(0,A.useState)(``),[L,R]=(0,A.useState)([]),[z,B]=(0,A.useState)(!0),[V,H]=(0,A.useState)(!1);if((0,A.useEffect)(()=>{e&&(async()=>{B(!0),H(!1),P(null),I(``),R([]);try{let[e,n,o]=await Promise.all([i(t),r(t),a({userId:0,curReportId:t})]);P(e),I(n?.summary??``),R(o.map(e=>({...e,indexImageUrl:e.indexImageUrl?`${e.indexImageUrl}?x-oss-process=image/resize,w_256,h_341`:``})))}catch(e){console.error(e),H(!0)}finally{B(!1)}})()},[e,t]),c)return(0,j.jsx)(_,{to:`/report/${t}`,replace:!0});if(z)return(0,j.jsx)(`div`,{className:`flex min-h-[60vh] items-center justify-center`,children:(0,j.jsx)(s,{description:`åŠ è½½ä¸...`})});if(V||!N)return(0,j.jsxs)(`div`,{className:`flex min-h-[60vh] flex-col items-center justify-center gap-4`,children:[(0,j.jsx)(`p`,{className:`text-base font-medium text-slate-600`,children:`ç ”æŠ¥åŠ è½½å¤±è´¥ï¼Œè¯·ç¨åŽé‡è¯•`}),(0,j.jsx)(b,{to:`/search`,className:`text-sm font-medium text-blue-600 hover:underline`,children:`返回æœç´¢`})]});let U=e=>e.businessId!=null&&M?.businessMap[e.businessId]?M.businessMap[e.businessId]:M?.typeMap[e.typeId]??``,W=e=>{let t=e.businessId==null?{typeIds:String(e.typeId)}:{businessIds:String(e.businessId)};n(`/category-report?${new URLSearchParams(t).toString()}`)},G=(e,t)=>{let r=e.orgIds[t];r!=null&&n(`/category-report?orgIds=${r}`)},K=()=>{O(`login`,{onLoginSuccess:()=>n(`/report/${t}`,{replace:!0})})},q=`/report-preview/${t}`,J=E(F)||E(N.highlight?.content?.join(` `)??``)||N.title;return(0,j.jsxs)(`div`,{className:`min-h-screen bg-[#f8fafc]`,children:[(0,j.jsx)(x,{title:N.title,description:J,canonical:h(q),noTitleSuffix:!0,jsonLd:S({headline:N.title,description:J,path:q,datePublished:N.publishAt,image:N.indexImageUrl||void 0,breadcrumbs:[{name:`首页`,path:`/home`},{name:`ç ”æŠ¥é¢„è§ˆ`,path:q}]})}),(0,j.jsx)(C,{}),(0,j.jsxs)(`main`,{className:`mx-auto flex w-full max-w-7xl items-start gap-6 px-4 py-6`,children:[(0,j.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-4`,children:[(0,j.jsxs)(`section`,{className:`rounded-2xl border border-[#eceef0] bg-white p-5 shadow-[0_4px_20px_rgba(0,0,0,0.05)]`,children:[(0,j.jsx)(`h1`,{className:`mb-3 text-[24px] font-bold leading-tight text-[#191c1e]`,children:N.title}),(0,j.jsxs)(`div`,{className:`flex flex-wrap items-center gap-3 text-sm text-[#516070]`,children:[U(N)&&(0,j.jsx)(`span`,{onClick:()=>W(N),className:`cursor-pointer rounded-full bg-[#ffdad6] px-3 py-1 font-medium text-[#93000a] transition-colors hover:bg-[#ffc7c2]`,children:U(N)}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(k,{size:18}),o(N.publishAt)]}),(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(m,{size:18}),N.authors||N.uploaderName]}),N.orgName&&(0,j.jsxs)(`div`,{className:`flex items-center gap-1`,children:[(0,j.jsx)(u,{size:18}),N.orgName.split(`,`).map((e,t)=>(0,j.jsx)(`span`,{onClick:()=>G(N,t),className:`cursor-pointer transition-colors hover:text-[#004ac6]`,children:e},t))]})]})]}),F&&(0,j.jsxs)(`section`,{className:`relative overflow-hidden rounded-2xl bg-linear-to-br from-[#dbe1ff] to-[#d5e4f8] p-0.5 shadow-sm`,children:[(0,j.jsx)(`div`,{className:`animate-shimmer pointer-events-none absolute inset-0 overflow-hidden opacity-20`,children:(0,j.jsx)(`div`,{className:`absolute inset-y-0 w-1/3 bg-linear-to-r from-transparent via-white to-transparent`})}),(0,j.jsxs)(`div`,{className:`relative flex h-full flex-col rounded-[14px] bg-white p-5`,children:[(0,j.jsxs)(`div`,{className:`mb-3 flex items-center gap-2`,children:[(0,j.jsx)(p,{size:20,className:`text-[#2563eb]`}),(0,j.jsxs)(`h2`,{className:`text-lg font-semibold text-[#2563eb]`,children:[`《`,N.title,`》报告总结:`]})]}),(0,j.jsxs)(`div`,{className:`relative z-10 max-h-52 overflow-hidden text-base leading-7 text-[#434655]`,children:[(0,j.jsx)(D,{components:{p:({children:e})=>(0,j.jsx)(`p`,{className:`my-3 first:mt-0`,children:e}),h1:({children:e})=>(0,j.jsx)(`h1`,{className:`my-3 text-xl first:mt-0`,children:e}),h2:({children:e})=>(0,j.jsx)(`h2`,{className:`my-3 text-lg first:mt-0`,children:e}),h3:({children:e})=>(0,j.jsx)(`h3`,{className:`my-3 text-base first:mt-0`,children:e}),ul:({children:e})=>(0,j.jsx)(`ul`,{className:`list-disc pl-6`,children:e}),ol:({children:e})=>(0,j.jsx)(`ol`,{className:`list-decimal pl-6`,children:e}),li:({children:e})=>(0,j.jsx)(`li`,{className:`my-1`,children:e})},children:F}),(0,j.jsx)(`div`,{className:`absolute inset-x-0 bottom-0 flex justify-end bg-linear-to-t from-white via-white/85 to-transparent pt-10`,children:(0,j.jsxs)(`button`,{type:`button`,onClick:K,className:`group flex cursor-pointer items-center gap-1 text-xs font-semibold tracking-wide text-[#2563eb] transition-colors hover:text-[#004ac6]`,children:[`查看更多`,(0,j.jsx)(l,{size:16,className:`transition-transform group-hover:translate-x-1`})]})})]})]})]}),(0,j.jsxs)(`section`,{className:`relative flex min-h-105 flex-col items-center justify-center overflow-hidden rounded-2xl border border-[#eceef0] bg-white shadow-[0_4px_20px_rgba(0,0,0,0.05)]`,children:[(0,j.jsx)(`div`,{className:`mx-auto flex w-full max-w-2xl items-center justify-center p-4`,children:(0,j.jsx)(`img`,{className:`max-h-160 w-auto max-w-full rounded border border-[#c3c6d7]/30 object-contain shadow-md`,src:N.indexImageUrl||w,alt:`${N.title} å°é¢`})}),(0,j.jsx)(`div`,{className:`absolute bottom-0 left-0 right-0 flex h-48 items-end justify-center bg-linear-to-t from-white via-white/80 to-transparent pb-8`,children:(0,j.jsxs)(`button`,{type:`button`,onClick:K,className:`flex cursor-pointer items-center gap-3 rounded-xl bg-[#2563eb] px-8 py-4 text-lg font-semibold text-white shadow-lg transition-all hover:-translate-y-1 hover:bg-[#004ac6] hover:shadow-xl`,children:[(0,j.jsx)(g,{size:20}),`点击关注微信公众å·ï¼ŒæŸ¥çœ‹å®Œæ•´æŠ¥å‘Š`]})})]})]}),(0,j.jsxs)(`aside`,{className:`flex w-90 shrink-0 flex-col gap-4`,children:[(0,j.jsx)(`h3`,{className:`mb-2 border-l-4 border-[#2563eb] px-2 text-lg font-semibold text-[#191c1e]`,children:`ä½ å¯èƒ½æ„Ÿå…´è¶£`}),(0,j.jsx)(`div`,{className:`space-y-4`,children:L.map(e=>{let t=U(e);return(0,j.jsx)(b,{to:`/report-preview/${e.id}`,className:`group block rounded-lg border border-[#eceef0] bg-white p-3 shadow-sm transition-shadow hover:shadow-md`,children:(0,j.jsxs)(`div`,{className:`flex gap-3`,children:[(0,j.jsx)(`div`,{className:`relative aspect-3/4 w-28 shrink-0 overflow-hidden rounded-md bg-[#f2f4f6]`,children:(0,j.jsx)(`img`,{className:`h-full w-full object-cover`,src:e.indexImageUrl||w,alt:e.title})}),(0,j.jsxs)(`div`,{className:`py-2 flex min-w-0 flex-1 flex-col justify-between`,children:[(0,j.jsx)(`h4`,{className:`line-clamp-2 text-sm font-semibold leading-snug text-[#191c1e] transition-colors group-hover:text-[#2563eb]`,children:e.title}),t&&(0,j.jsx)(`span`,{onClick:t=>{t.preventDefault(),t.stopPropagation(),W(e)},className:`inline-block w-fit cursor-pointer rounded bg-[#196fc0]/10 px-2 py-0.5 text-[11px] font-semibold tracking-wide text-[#00569c] transition-colors hover:bg-[#196fc0]/20`,children:t}),(0,j.jsx)(`div`,{className:`truncate text-xs text-[#516070]`,children:e.authors}),(0,j.jsxs)(`div`,{className:`flex items-center justify-between gap-2 text-[11px] font-semibold tracking-wide text-[#516070]`,children:[(0,j.jsx)(`span`,{className:`truncate`,children:o(e.publishAt)}),e.orgName&&(0,j.jsx)(`button`,{type:`button`,onClick:t=>{t.preventDefault(),t.stopPropagation(),G(e,0)},className:`shrink-0 cursor-pointer truncate text-xs font-normal text-[#2563eb] transition-colors hover:text-[#004ac6]`,children:e.orgName})]})]})]})},e.id)})})]})]})]})}export{M as default};