import{a as _e}from"/build/_shared/chunk-OI27GGWY.js";import"/build/_shared/chunk-NOXTKC5E.js";import"/build/_shared/chunk-5KVR2MAX.js";import{a as M,b as Ie}from"/build/_shared/chunk-JYUP6POH.js";import{a as Te}from"/build/_shared/chunk-VQA6ZHQQ.js";import{a as ge}from"/build/_shared/chunk-MYEGF5DD.js";import{a as ye,b as ke,c as be,d as H,e as ve}from"/build/_shared/chunk-735R3HXE.js";import"/build/_shared/chunk-QVNMLZBR.js";import"/build/_shared/chunk-BY73YKKJ.js";import"/build/_shared/chunk-GFTI6NQF.js";import{a as G}from"/build/_shared/chunk-MU242HSB.js";import{a as he}from"/build/_shared/chunk-WWDF3R6R.js";import{b as de}from"/build/_shared/chunk-YHCRNS7C.js";import"/build/_shared/chunk-YY42EBKM.js";import"/build/_shared/chunk-BM5RD4EA.js";import"/build/_shared/chunk-ANZO4DLL.js";import{a as Ze}from"/build/_shared/chunk-VZQVWFLO.js";import{a as we}from"/build/_shared/chunk-OHIRLOF4.js";import{a as xe}from"/build/_shared/chunk-SOZYOKDI.js";import"/build/_shared/chunk-T5JPY7UU.js";import"/build/_shared/chunk-LUCFSU5O.js";import"/build/_shared/chunk-ISEWGAER.js";import"/build/_shared/chunk-QAMMZPRY.js";import"/build/_shared/chunk-RBK2GDO7.js";import"/build/_shared/chunk-3DS7X4QC.js";import"/build/_shared/chunk-OKEET2V2.js";import"/build/_shared/chunk-VTB6GCVU.js";import"/build/_shared/chunk-YCYRQM6E.js";import"/build/_shared/chunk-M7YPMNVE.js";import"/build/_shared/chunk-4E2MYQEA.js";import"/build/_shared/chunk-LCI4QRIJ.js";import"/build/_shared/chunk-642ZSX3W.js";import{a as le}from"/build/_shared/chunk-BYYBSABM.js";import{c as se}from"/build/_shared/chunk-DMX5UYX2.js";import{c as P}from"/build/_shared/chunk-TKZNO3YR.js";import{a as qe}from"/build/_shared/chunk-4L33DU4X.js";import{a as pe,b as A}from"/build/_shared/chunk-TTH267VF.js";import{a as K}from"/build/_shared/chunk-E3632JDQ.js";import"/build/_shared/chunk-3DFJE245.js";import{a as x}from"/build/_shared/chunk-46LIEZ5K.js";import{h as re,j as W,p as oe,q as ie}from"/build/_shared/chunk-26SEE23F.js";import"/build/_shared/chunk-4OFGKEND.js";import{Aa as fe,ba as ue,p as ae,u as ce,ua as me}from"/build/_shared/chunk-COF66YMW.js";import{a as F,b as S}from"/build/_shared/chunk-NPMWMOUT.js";import{e as b}from"/build/_shared/chunk-ADMCF34Z.js";function Oe(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function Se(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Oe(Object(n),!0).forEach(function(r){Je(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Oe(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Je(e,t,n){return t=Qe(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Qe(e){var t=Xe(e,"string");return typeof t=="symbol"?t:String(t)}function Xe(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function R(e){return e._type==="span"&&"text"in e&&typeof e.text=="string"&&(typeof e.marks>"u"||Array.isArray(e.marks)&&e.marks.every(t=>typeof t=="string"))}function Z(e){return typeof e._type=="string"&&e._type[0]!=="@"&&(!("markDefs"in e)||Array.isArray(e.markDefs)&&e.markDefs.every(t=>typeof t._key=="string"))&&"children"in e&&Array.isArray(e.children)&&e.children.every(t=>typeof t=="object"&&"_type"in t)}function q(e){return Z(e)&&"listItem"in e&&typeof e.listItem=="string"&&(typeof e.level>"u"||typeof e.level=="number")}function J(e){return e._type==="@list"}function Q(e){return e._type==="@span"}function X(e){return e._type==="@text"}var Pe=["strong","em","code","underline","strike-through"];function Ye(e,t,n){if(!R(e)||!e.marks)return[];if(!e.marks.length)return[];let r=e.marks.slice(),i={};return r.forEach(o=>{i[o]=1;for(let c=t+1;c<n.length;c++){let m=n[c];if(m&&R(m)&&Array.isArray(m.marks)&&m.marks.indexOf(o)!==-1)i[o]++;else break}}),r.sort((o,c)=>et(i,o,c))}function et(e,t,n){let r=e[t],i=e[n];if(r!==i)return i-r;let o=Pe.indexOf(t),c=Pe.indexOf(n);return o!==c?o-c:t.localeCompare(n)}function Le(e){var t;let{children:n,markDefs:r=[]}=e;if(!n||!n.length)return[];let i=n.map(Ye),o={_type:"@span",children:[],markType:"<unknown>"},c=[o];for(let m=0;m<n.length;m++){let y=n[m];if(!y)continue;let k=i[m]||[],g=1;if(c.length>1)for(g;g<c.length;g++){let a=((t=c[g])==null?void 0:t.markKey)||"",u=k.indexOf(a);if(u===-1)break;k.splice(u,1)}c=c.slice(0,g);let l=c[c.length-1];if(l){for(let a of k){let u=r.find(T=>T._key===a),d=u?u._type:a,p={_type:"@span",_key:y._key,children:[],markDef:u,markType:d,markKey:a};l.children.push(p),c.push(p),l=p}if(R(y)){let a=y.text.split(`
`);for(let u=a.length;u-- >1;)a.splice(u,0,`
`);l.children=l.children.concat(a.map(u=>({_type:"@text",text:u})))}else l.children=l.children.concat(y)}}return o.children}function Ne(e,t){let n=[],r;for(let i=0;i<e.length;i++){let o=e[i];if(o){if(!q(o)){n.push(o),r=void 0;continue}if(!r){r=U(o,i,t),n.push(r);continue}if(tt(o,r)){r.children.push(o);continue}if((o.level||1)>r.level){let c=U(o,i,t);if(t==="html"){let m=r.children[r.children.length-1],y=Se(Se({},m),{},{children:[...m.children,c]});r.children[r.children.length-1]=y}else r.children.push(c);r=c;continue}if((o.level||1)<r.level){let c=n[n.length-1],m=c&&V(c,o);if(m){r=m,r.children.push(o);continue}r=U(o,i,t),n.push(r);continue}if(o.listItem!==r.listItem){let c=n[n.length-1],m=c&&V(c,{level:o.level||1});if(m&&m.listItem===o.listItem){r=m,r.children.push(o);continue}else{r=U(o,i,t),n.push(r);continue}}console.warn("Unknown state encountered for block",o),n.push(o)}}return n}function tt(e,t){return(e.level||1)===t.level&&e.listItem===t.listItem}function U(e,t,n){return{_type:"@list",_key:"".concat(e._key||"".concat(t),"-parent"),mode:n,level:e.level||1,listItem:e.listItem,children:[e]}}function V(e,t){let n=t.level||1,r=t.listItem||"normal",i=typeof t.listItem=="string";if(J(e)&&(e.level||1)===n&&i&&(e.listItem||"normal")===r)return e;if(!("children"in e))return;let o=e.children[e.children.length-1];return o&&!R(o)?V(o,t):void 0}function Y(e){let t="";return e.children.forEach(n=>{X(n)?t+=n.text:Q(n)&&(t+=Y(n))}),t}var Be="html";var f=b(S()),te=b(F()),nt=["block","list","listItem","marks","types"],rt=["listItem"],ot=["_key"];function Ce(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function I(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ce(Object(n),!0).forEach(function(r){it(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ce(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function it(e,t,n){return t=st(t),t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function st(e){var t=lt(e,"string");return typeof t=="symbol"?t:String(t)}function lt(e,t){if(typeof e!="object"||e===null)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ee(e,t){if(e==null)return{};var n=at(e,t),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(i=0;i<o.length;i++)r=o[i],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function at(e,t){if(e==null)return{};var n={},r=Object.keys(e),i,o;for(o=0;o<r.length;o++)i=r[o],!(t.indexOf(i)>=0)&&(n[i]=e[i]);return n}function ct(e,t){let{block:n,list:r,listItem:i,marks:o,types:c}=t,m=ee(t,nt);return I(I({},e),{},{block:D(e,t,"block"),list:D(e,t,"list"),listItem:D(e,t,"listItem"),marks:D(e,t,"marks"),types:D(e,t,"types")},m)}function D(e,t,n){let r=t[n],i=e[n];return typeof r=="function"||r&&typeof i=="function"?r:r?I(I({},i),r):i}var ut=e=>{let{children:t,value:n}=e;return(0,f.jsx)("a",{href:n?.href,children:t})},mt={textDecoration:"underline"},ft={em:e=>{let{children:t}=e;return(0,f.jsx)("em",{children:t})},strong:e=>{let{children:t}=e;return(0,f.jsx)("strong",{children:t})},code:e=>{let{children:t}=e;return(0,f.jsx)("code",{children:t})},underline:e=>{let{children:t}=e;return(0,f.jsx)("span",{style:mt,children:t})},"strike-through":e=>{let{children:t}=e;return(0,f.jsx)("del",{children:t})},link:ut},pt={number:e=>{let{children:t}=e;return(0,f.jsx)("ol",{children:t})},bullet:e=>{let{children:t}=e;return(0,f.jsx)("ul",{children:t})}},dt=e=>{let{children:t}=e;return(0,f.jsx)("li",{children:t})},j=(e,t)=>"[@portabletext/react] Unknown ".concat(e,", specify a component for it in the `components.").concat(t,"` prop"),Ee=e=>j('block type "'.concat(e,'"'),"types"),ht=e=>j('mark type "'.concat(e,'"'),"marks"),gt=e=>j('block style "'.concat(e,'"'),"block"),yt=e=>j('list style "'.concat(e,'"'),"list"),kt=e=>j('list item style "'.concat(e,'"'),"listItem");function bt(e){console.warn(e)}var Me={display:"none"},vt=e=>{let{value:t,isInline:n}=e,r=Ee(t._type);return n?(0,f.jsx)("span",{style:Me,children:r}):(0,f.jsx)("div",{style:Me,children:r})},xt=e=>{let{markType:t,children:n}=e;return(0,f.jsx)("span",{className:"unknown__pt__mark__".concat(t),children:n})},wt=e=>{let{children:t}=e;return(0,f.jsx)("p",{children:t})},Tt=e=>{let{children:t}=e;return(0,f.jsx)("ul",{children:t})},It=e=>{let{children:t}=e;return(0,f.jsx)("li",{children:t})},_t=()=>(0,f.jsx)("br",{}),Ot={normal:e=>{let{children:t}=e;return(0,f.jsx)("p",{children:t})},blockquote:e=>{let{children:t}=e;return(0,f.jsx)("blockquote",{children:t})},h1:e=>{let{children:t}=e;return(0,f.jsx)("h1",{children:t})},h2:e=>{let{children:t}=e;return(0,f.jsx)("h2",{children:t})},h3:e=>{let{children:t}=e;return(0,f.jsx)("h3",{children:t})},h4:e=>{let{children:t}=e;return(0,f.jsx)("h4",{children:t})},h5:e=>{let{children:t}=e;return(0,f.jsx)("h5",{children:t})},h6:e=>{let{children:t}=e;return(0,f.jsx)("h6",{children:t})}},De={types:{},block:Ot,marks:ft,list:pt,listItem:dt,hardBreak:_t,unknownType:vt,unknownMark:xt,unknownList:Tt,unknownListItem:It,unknownBlockStyle:wt};function Ae(e){let{value:t,components:n,listNestingMode:r,onMissingComponent:i=bt}=e,o=i||Pt,c=Array.isArray(t)?t:[t],m=Ne(c,r||Be),y=(0,te.useMemo)(()=>n?ct(De,n):De,[n]),k=(0,te.useMemo)(()=>St(y,o),[y,o]),g=m.map((l,a)=>k({node:l,index:a,isInline:!1,renderNode:k}));return(0,f.jsx)(f.Fragment,{children:g})}var St=(e,t)=>{function n(l){let{node:a,index:u,isInline:d}=l,p=a._key||"node-".concat(u);return J(a)?o(a,u,p):q(a)?i(a,u,p):Q(a)?c(a,u,p):r(a)?g(a,u,p,d):Z(a)?m(a,u,p,d):X(a)?y(a,p):k(a,u,p,d)}function r(l){return l._type in e.types}function i(l,a,u){let d=je({node:l,index:a,isInline:!1,renderNode:n}),p=e.listItem,w=(typeof p=="function"?p:p[l.listItem])||e.unknownListItem;if(w===e.unknownListItem){let O=l.listItem||"bullet";t(kt(O),{type:O,nodeType:"listItemStyle"})}let v=d.children;if(l.style&&l.style!=="normal"){let{listItem:O}=l,N=ee(l,rt);v=n({node:N,index:a,isInline:!1,renderNode:n})}return(0,f.jsx)(w,{value:l,index:a,isInline:!1,renderNode:n,children:v},u)}function o(l,a,u){let d=l.children.map((v,O)=>n({node:v._key?v:I(I({},v),{},{_key:"li-".concat(a,"-").concat(O)}),index:O,isInline:!1,renderNode:n})),p=e.list,w=(typeof p=="function"?p:p[l.listItem])||e.unknownList;if(w===e.unknownList){let v=l.listItem||"bullet";t(yt(v),{nodeType:"listStyle",type:v})}return(0,f.jsx)(w,{value:l,index:a,isInline:!1,renderNode:n,children:d},u)}function c(l,a,u){let{markDef:d,markType:p,markKey:T}=l,w=e.marks[p]||e.unknownMark,v=l.children.map((O,N)=>n({node:O,index:N,isInline:!0,renderNode:n}));return w===e.unknownMark&&t(ht(p),{nodeType:"mark",type:p}),(0,f.jsx)(w,{text:Y(l),value:d,markType:p,markKey:T,renderNode:n,children:v},u)}function m(l,a,u,d){let p=je({node:l,index:a,isInline:d,renderNode:n}),{_key:T}=p,w=ee(p,ot),v=w.node.style||"normal",N=(typeof e.block=="function"?e.block:e.block[v])||e.unknownBlockStyle;return N===e.unknownBlockStyle&&t(gt(v),{nodeType:"blockStyle",type:v}),(0,f.jsx)(N,I(I({},w),{},{value:w.node,renderNode:n}),u)}function y(l,a){if(l.text===`
`){let u=e.hardBreak;return u?(0,f.jsx)(u,{},a):`
`}return l.text}function k(l,a,u,d){let p={value:l,isInline:d,index:a,renderNode:n};t(Ee(l._type),{nodeType:"block",type:l._type});let T=e.unknownType;return(0,f.jsx)(T,I({},p),u)}function g(l,a,u,d){let p={value:l,isInline:d,index:a,renderNode:n},T=e.types[l._type];return T?(0,f.jsx)(T,I({},p),u):null}return n};function je(e){let{node:t,index:n,isInline:r,renderNode:i}=e,c=Le(t).map((m,y)=>i({node:m,isInline:!0,index:y,renderNode:i}));return{_key:t._key||"block-".concat(n),children:c,index:n,isInline:r,node:t}}function Pt(){}var We=b(Ze(),1);var ne=b(Ie(),1);var z=b(F(),1);var Ke=b(qe(),1);function $(e){return e.toString().normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().trim().replace(/\s+/g,"-").replace(/[^\w-]+/g,"").replace(/--+/g,"-").replace(/^-+|-+$/g,"")}function He(e){let t=e.filter(({_type:i,style:o})=>i==="block"&&/h\d/.test(o)).map(({style:i,children:o})=>[i,o[o.length-1].text]),n=[],r=[];for(let[i,o]of t){let c=Number(i[1]);for(;r.length>0&&r[r.length-1].level>=c;)r.pop();let m={text:o,level:c,children:[]};r.length>0?r[r.length-1].children.push(m):n.push(m),r.push(m)}return n}var E=b(F(),1);var L=b(S(),1);function Ue({postId:e,likes:t,userId:n}){let[r,i]=(0,E.useState)(!1),[o,c]=(0,E.useState)(t||{}),m=o[n];(0,E.useEffect)(()=>{(async()=>{try{let g=await fetch(`/feed/like?postId=${e}`,{method:"GET",headers:{"Content-Type":"application/x-www-form-urlencoded"}});if(g.ok){let l=await g.json();c(l)}}catch(g){console.error(g)}})()},[e]);let y=async()=>{try{let k=await fetch("/feed/like",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({postId:e,userId:n})});if(k.ok){let g=await k.json();c(g)}}catch(k){console.error(k)}};return(0,L.jsxs)(P,{"aria-label":"bookmark article",type:"submit",name:"shouldSave",value:m?"false":"true",variant:"ghost",className:x("flex gap-2 font-medium",{"bg-slate-100 text-slate-700":m}),onMouseEnter:()=>i(!0),onMouseLeave:()=>i(!1),onClick:()=>y(),children:[(0,L.jsx)("div",{className:x("absolute -bottom-8 rounded-sm p-2 text-slate-800",{hidden:!r,visible:r}),children:m?(0,L.jsx)("span",{children:"Unlike"}):(0,L.jsx)("span",{children:"Like"})}),(0,L.jsx)(fe,{size:20,strokeWidth:2.5}),Object.values(o).filter(k=>k).length]})}var Re=b(Ie(),1);var _=b(S(),1),B=64+32+"px",$e={types:{image:({value:e})=>{if(!e?.asset?._ref)return null;let t=Lt(e,!0);return(0,_.jsx)("div",{className:"tw-flex tw-justify-center",children:(0,_.jsx)("img",{loading:"lazy",alt:e.alt??" ",src:t??"/static/logo.svg"})})}},block:{h1:({value:e})=>(0,_.jsx)("h1",{id:C(e),style:{scrollMarginTop:B},children:e.children.map(({text:t})=>t)}),h2:({value:e})=>(0,_.jsx)("h2",{id:C(e),style:{scrollMarginTop:B},children:e.children.map(({text:t})=>t)}),h3:({value:e})=>(0,_.jsx)("h3",{id:C(e),style:{scrollMarginTop:B},children:e.children.map(({text:t})=>t)}),h4:({value:e})=>(0,_.jsx)("h4",{id:C(e),style:{scrollMarginTop:B},children:e.children.map(({text:t})=>t)}),h5:({value:e})=>(0,_.jsx)("h5",{id:C(e),style:{scrollMarginTop:B},children:e.children.map(({text:t})=>t)}),h6:({value:e})=>(0,_.jsx)("h6",{id:C(e),style:{scrollMarginTop:B},children:e.children.map(({text:t})=>t)})},marks:{html:e=>(0,_.jsx)("div",{dangerouslySetInnerHTML:{__html:e.text}})}};function C(e){return e.children.map(({text:t})=>t).map(t=>$(t)).join("")}function Lt(e,t){try{let n=(0,Re.default)(M).image(e);return t?n.fit("max").auto("format").url():n.url()}catch{return"/static/logo.svg"}}var h=b(S(),1);function ze({postTitle:e,isOutlineStyle:t=!1}){return(0,h.jsxs)(ye,{children:[(0,h.jsxs)(ke,{className:x("flex items-center gap-2",{"rounded-md border border-input bg-background hover:bg-accent hover:text-accent-foreground px-2 h-10":t}),children:[(0,h.jsx)(me,{size:15}),"Share"]}),(0,h.jsxs)(be,{children:[(0,h.jsx)(ve,{children:"Share this post"}),(0,h.jsx)(H,{children:(0,h.jsx)(Nt,{})}),(0,h.jsx)(H,{children:(0,h.jsx)(Mt,{postTitle:e})}),(0,h.jsx)(H,{children:(0,h.jsx)(Ct,{})})]})]})}function Nt(){let e=encodeURIComponent(window.location.href.split("?")[0]);return(0,h.jsx)(P,{variant:"ghost",asChild:!0,className:"p-1",children:(0,h.jsxs)("a",{href:`https://www.linkedin.com/sharing/share-offsite/?url=${e}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2",children:[(0,h.jsx)(Bt,{}),"LinkedIn"]})})}function Bt(){return(0,h.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",viewBox:"0 0 24 24",children:(0,h.jsx)("path",{d:"M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z"})})}function Ct(){return(0,h.jsxs)(P,{variant:"ghost",className:"flex items-center gap-2 p-1",onClick:()=>{navigator.clipboard.writeText(window.location.href.split("?")[0])},children:[(0,h.jsx)(ce,{size:20}),"Copy Link"]})}function Mt({postTitle:e}){let t=encodeURIComponent(window.location.href.split("?")[0]);return(0,h.jsx)(P,{asChild:!0,variant:"ghost",className:"flex items-center gap-2 p-1",children:(0,h.jsxs)("a",{href:`mailto:?subject=Holistic AI Tracker - ${e}&body=From Holistic AI Tracker:%0D%0A${e}%0D%0A${t}`,children:[(0,h.jsx)(ue,{size:20}),"Send via Email"]})})}var s=b(S(),1);function Dt({data:e}){if(!e)return le({title:"Feed"});let t=(0,ne.default)(M).image(e.post.mainImage?.asset._ref||"").fit("max").auto("format").url();return[{title:`${e.post.title} - Holistic AI Tracker`},{name:"description",content:e.post.description},{property:"og:title",content:e.post.title},{property:"og:description",content:e.post.description},{property:"og:image",content:t},{name:"google-site-verification",content:se}]}function Ge(){let{post:e,postLikes:t,userId:n,savedArticles:r,summary:i,isLoggedIn:o,guestContributors:c}=oe(),m=ie(),[y]=re(),k=y.get("ref")??pe.feed.root,[g,l]=(0,z.useState)(!1),a=e.tags.includes("Reports"),u=(0,z.useMemo)(()=>{let d={};return c.forEach(p=>{d[p.name]=p}),d},[c]);return(0,s.jsxs)("div",{className:x("container mx-auto mt-10 max-w-6xl items-start gap-4",{"grid grid-cols-1 md:grid-cols-4 lg:grid-cols-5 xl:max-w-[1400px] xl:grid-cols-6":!a}),children:[(0,s.jsxs)("aside",{className:x("grid gap-8",{"h-fit pr-8 md:sticky md:top-28 lg:col-span-2":!a,"mb-12":a}),children:[(0,s.jsx)(P,{variant:"outline",asChild:!0,className:"w-40",children:(0,s.jsxs)(W,{prefetch:"intent",to:k,children:[(0,s.jsx)(ae,{size:16,className:"mr-2"}),"Back to Feed"]})}),!a&&(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"In this article"}),(0,s.jsx)(Ve,{headers:He(e.body)})]})]}),(0,s.jsxs)("article",{className:x("col-span-3 mx-auto flex flex-1 flex-col gap-4 pb-8 xl:col-span-4",{prose:o,"max-w-prose":!o}),children:[(0,s.jsxs)("header",{className:"relative grid gap-4",children:[(0,s.jsx)("img",{alt:e.title,className:"mb-4 max-h-64 w-full rounded-lg object-cover",src:(0,ne.default)(M).image(e.mainImage?.asset._ref||"").fit("max").auto("format").url()}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h2",{className:"mb-1.5 mt-0 text-xl font-medium",children:e.title}),(0,s.jsx)("div",{className:"space-x-2",children:e.tags?.map(d=>(0,s.jsx)(he,{variant:"outline",rounding:"md",className:"mr-auto border-none bg-sky-200 text-sky-700",children:d},d))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-4 rounded-md bg-slate-100 px-4 py-2 text-slate-900",children:[(0,s.jsx)("div",{className:"flex flex-row -space-x-4",children:e.authors.map(d=>u[d]?.image?(0,s.jsx)("a",{href:`${A}/contributors/${u[d].id}`,children:(0,s.jsx)("img",{className:"my-0 h-12 w-12 overflow-hidden rounded-full border-2 border-slate-100 ",src:u[d]?.image,alt:d})},d):(0,s.jsx)(s.Fragment,{}))}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("h3",{className:"my-0 text-base font-medium leading-6",children:jt(e.authors,u)}),(0,s.jsx)("p",{className:"my-0 text-xs font-medium leading-5",children:de(e.publishedAt)})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)(K,{}),o&&(0,s.jsxs)("div",{className:"relative flex flex-row justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(ge,{checked:g,onCheckedChange:l}),(0,s.jsxs)(xe,{className:"flex items-center gap-2",children:[(0,s.jsx)(we,{className:"h-5 w-5"}),"Summarize with AI"]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(G,{slug:e.slug.current,isBookmarked:r.postIds.includes(e.slug.current),fetcher:m}),(0,s.jsx)(Ue,{postId:e._id,userId:n||"",likes:t})]})]}),(0,s.jsx)(K,{})]}),(0,s.jsx)("div",{className:x("text-normal text-justify",{"bg-gradient-to-b from-black bg-clip-text text-transparent":!o}),children:g?(0,s.jsx)("p",{children:i.summary}):(0,s.jsx)(Ae,{value:o?e.body:e.body.slice(0,2),components:$e})}),o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"text-normal text-justify",children:e.shouldShowDisclaimer&&(0,s.jsxs)("p",{className:"italic",children:[(0,s.jsx)("b",{children:"DISCLAIMER:"}),"This blog article is for informational purposes only. This blog article is not intended to, and does not, provide legal advice or a legal opinion. It is not a do-it-yourself guide to resolving legal issues or handling litigation. This blog article is not a substitute for experienced legal counsel and does not provide legal advice regarding any situation or employer."]})}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsx)(Te,{children:()=>(0,s.jsx)(ze,{postTitle:e.title,isOutlineStyle:!0})}),(0,s.jsx)(G,{slug:e.slug.current,isBookmarked:r.postIds.includes(e.slug.current),fetcher:m,buttonOptions:{variant:"outline",size:"icon"}})]})]}),!o&&(0,s.jsx)(_e,{})]})]})}function Fe(e,t,n,r){return t[e]?.id?(0,s.jsxs)("a",{className:" no-underline ",href:`${A}/contributors/${t[e]?.id}`,children:[e.slice()," ",n&&n?.length>(r??0)+2&&", ",n&&n?.length===(r??0)+2&&" & "]}):e}function jt(e,t){return e?e.length>1?e.map((n,r)=>Fe(n,t,e,r)):Fe(e[0],t):""}function Ve({headers:e,isChild:t}){return(0,s.jsx)("ul",{className:x({"my-1 space-y-2":t}),children:e.map(({text:n,children:r},i)=>(0,s.jsxs)("li",{className:x({"py-1":!t}),children:[(0,s.jsx)(W,{to:`#${$(n)}`,className:x("active text-slate-600 hover:text-slate-900  hover:underline",{"ml-4 line-clamp-1":t,"line-clamp-3":!t}),children:n}),r.length>0&&(0,s.jsx)(Ve,{headers:r,isChild:!0})]},`___-feed-toc-li_${i}_${n.replace(" ","-")}`))})}var Et=({data:e})=>e?.post?.slug?.current?[{rel:"canonical",href:`${A}/feed/${e.post.slug.current}`}]:[],At={dynamicLinks:Et};export{Ge as default,At as handle,Dt as meta};
