1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8523],{927:(e,t,a)=>{a.d(t,{Accordion:()=>o,AccordionContent:()=>m,AccordionItem:()=>d,AccordionTrigger:()=>c});var s=a(95155),r=a(12115),l=a(89372),i=a(66088),n=a(40980);let o=l.bL,d=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.q7,{ref:a,className:(0,n.cn)("border-b",e),...t}));d.displayName="AccordionItem";let c=r.forwardRef(({className:e,children:t,...a},r)=>(0,s.jsx)(l.Y9,{className:"flex",children:(0,s.jsxs)(l.l9,{ref:r,className:(0,n.cn)("flex flex-1 items-center justify-between py-4 font-medium transition-all hover:underline [&[data-state=open]>svg]:rotate-180",e),...a,children:[t,(0,s.jsx)(i.A,{className:"h-4 w-4 shrink-0 transition-transform duration-200"})]})}));c.displayName=l.l9.displayName;let m=r.forwardRef(({className:e,children:t,...a},r)=>(0,s.jsx)(l.UC,{ref:r,className:"overflow-hidden text-sm transition-all data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...a,children:(0,s.jsx)("div",{className:(0,n.cn)("pb-4 pt-0",e),children:t})}));m.displayName=l.UC.displayName},6695:(e,t,a)=>{a.d(t,{dj:()=>m});var s=a(12115);let r=0,l=new Map,i=e=>{if(l.has(e))return;let t=setTimeout(()=>{l.delete(e),d({type:"REMOVE_TOAST",toastId:e})},1e6);l.set(e,t)},n=[],o={toasts:[]};function d(e){o=((e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,1)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case"DISMISS_TOAST":{let{toastId:a}=t;return a?i(a):e.toasts.forEach(e=>{i(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===a||void 0===a?{...e,open:!1}:e)}}case"REMOVE_TOAST":if(void 0===t.toastId)return{...e,toasts:[]};return{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}})(o,e),n.forEach(e=>{e(o)})}function c({...e}){let t=(r=(r+1)%Number.MAX_SAFE_INTEGER).toString(),a=()=>d({type:"DISMISS_TOAST",toastId:t});return d({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:e=>{e||a()}}}),{id:t,dismiss:a,update:e=>d({type:"UPDATE_TOAST",toast:{...e,id:t}})}}function m(){let[e,t]=s.useState(o);return s.useEffect(()=>(n.push(t),()=>{let e=n.indexOf(t);e>-1&&n.splice(e,1)}),[e]),{...e,toast:c,dismiss:e=>d({type:"DISMISS_TOAST",toastId:e})}}},12279:(e,t,a)=>{a.d(t,{G:()=>c});var s=a(95155),r=a(5772),l=a(81477),i=a(45160),n=a(40980),o=a(48884);function d(e){if(!e)return null;try{let t="string"==typeof e?new Date(e):e?.toDate?.()??new Date(e);if(isNaN(t.getTime()))return null;return new Intl.DateTimeFormat("pt-BR",{month:"short",year:"numeric"}).format(t)}catch{return null}}function c({magazineId:e,editionNumber:t,articleTitle:a,pageNumber:m,articleStartPage:u,articleEndPage:x,articleImageUrl:h,magazineCoverUrl:p,textPreview:f,rank:g,publishedAt:y,slug:w,category:b,className:v,onViewPage:j}){let N=`https://www.brasilmineral.com.br/revista/${e}/?p=${m}`,k=w&&t?`/revistas/${t}/${w}`:void 0,A=h||p||o.tL;return(0,s.jsx)(l.Zp,{className:(0,n.cn)("overflow-hidden transition-shadow hover:shadow-lg cursor-pointer",v),onClick:()=>{k?window.open(k,"_self"):j&&j(N)},children:(0,s.jsxs)("div",{className:"group flex items-stretch min-h-[100px]",children:[(0,s.jsxs)("div",{className:"relative w-1/3 flex-shrink-0 overflow-hidden min-h-[100px]",children:[(0,s.jsx)("span",{className:"absolute left-0 top-0 z-10 flex h-6 w-6 sm:h-7 sm:w-7 items-center justify-center rounded-br bg-black/50 text-sm font-bold text-white drop-shadow-sm",children:g}),(0,s.jsx)(r.default,{src:A,alt:a,fill:!0,className:"object-cover",loading:"lazy",unoptimized:!0}),(0,s.jsxs)("div",{className:"absolute right-1 bottom-1 z-10 flex flex-col items-center drop-shadow-md",style:{maxHeight:"50%"},children:[(0,s.jsxs)("span",{className:"w-full bg-amber-600 text-white text-[9px] font-bold leading-none py-[2px] rounded-t-sm whitespace-nowrap shadow-sm text-center",children:["Ed. ",t]}),p&&(0,s.jsx)("div",{className:"relative w-10 aspect-[3/4] rounded-b-[3px] overflow-hidden ring-1 ring-white/60 shadow-sm",children:(0,s.jsx)(r.default,{src:p,alt:`Edi\xe7\xe3o ${t}`,fill:!0,className:"object-cover",loading:"lazy",unoptimized:!0})})]})]}),(0,s.jsxs)("div",{className:"flex-grow min-w-0 space-y-1 flex flex-col justify-center p-4",children:[b&&(0,s.jsx)(i.E,{variant:"secondary",className:"w-fit text-xs",children:b}),(0,s.jsx)("h3",{className:"font-semibold text-sm leading-snug line-clamp-2 group-hover:text-primary transition-colors",style:{textWrap:"balance"},children:a}),f&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2 italic [&_mark]:bg-yellow-200 [&_mark]:font-semibold [&_mark]:px-0.5",dangerouslySetInnerHTML:{__html:f.substring(0,200)}}),d(y)&&(0,s.jsx)("p",{className:"mt-1.5 pt-1.5 border-t border-gray-200 text-[11px] text-gray-500",children:d(y)})]})]})})}},15283:(e,t,a)=>{a.d(t,{Fc:()=>o,TN:()=>c,XL:()=>d});var s=a(95155),r=a(12115),l=a(18460),i=a(40980);let n=(0,l.F)("relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive"}},defaultVariants:{variant:"default"}}),o=r.forwardRef(({className:e,variant:t,...a},r)=>(0,s.jsx)("div",{ref:r,role:"alert",className:(0,i.cn)(n({variant:t}),e),...a}));o.displayName="Alert";let d=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)("h5",{ref:a,className:(0,i.cn)("mb-1 font-medium leading-none tracking-tight",e),...t}));d.displayName="AlertTitle";let c=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)("div",{ref:a,className:(0,i.cn)("text-sm [&_p]:leading-relaxed",e),...t}));c.displayName="AlertDescription"},19865:(e,t,a)=>{a.d(t,{IG:()=>c,db:()=>m,j2:()=>d,yA:()=>o});var s=a(97873),r=a(65140),l=a(30928),i=a(4927);let n={apiKey:"AIzaSyAO_sbTBemKD068NVqv3RYb15ckEthjtrQ",authDomain:"login.brasilmineral.com.br",projectId:"brasil-mineral-newsletter",storageBucket:"brasil-mineral-newsletter.firebasestorage.app",messagingSenderId:"145521886346",a
1ppId:"1:145521886346:web:bb9afd106c161d05031973",measurementId:"G-QCKC22MY1G"},o=0===(0,s.Dk)().length?(0,s.Wp)(n):(0,s.Sx)(),d=(0,r.xI)(o),c=(0,l.c7)(o),m=(0,i.aU)(o,"premium-us".trim()||"(default)");n.projectId||console.error("Firebase Initialization Error: Firebase config is not fully set. Check your NEXT_PUBLIC_FIREBASE_ environment variables. Firebase features may not work correctly.")},35942:(e,t,a)=>{a.d(t,{F:()=>n});var s=a(95155),r=a(12115),l=a(89349),i=a(40980);let n=r.forwardRef(({className:e,children:t,...a},r)=>(0,s.jsxs)(l.bL,{ref:r,className:(0,i.cn)("relative overflow-hidden",e),...a,children:[(0,s.jsx)(l.LM,{className:"h-full w-full rounded-[inherit]",children:t}),(0,s.jsx)(o,{}),(0,s.jsx)(l.OK,{})]}));n.displayName=l.bL.displayName;let o=r.forwardRef(({className:e,orientation:t="vertical",...a},r)=>(0,s.jsx)(l.VM,{ref:r,orientation:t,className:(0,i.cn)("flex touch-none select-none transition-colors","vertical"===t&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:(0,s.jsx)(l.lr,{className:"relative flex-1 rounded-full bg-border"})}));o.displayName=l.VM.displayName},42763:(e,t,a)=>{a.d(t,{Cf:()=>x,Es:()=>p,HM:()=>m,L3:()=>f,c7:()=>h,lG:()=>o,rr:()=>g,zM:()=>d});var s=a(95155),r=a(12115),l=a(43146),i=a(33210),n=a(40980);let o=l.bL,d=l.l9,c=l.ZL,m=l.bm,u=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.hJ,{ref:a,className:(0,n.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));u.displayName=l.hJ.displayName;let x=r.forwardRef(({className:e,children:t,hideCloseButton:a,...r},o)=>(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsxs)(l.UC,{ref:o,className:(0,n.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r,children:[t,!a&&(0,s.jsxs)(l.bm,{className:"absolute right-4 top-4 z-10 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[(0,s.jsx)(i.A,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Fechar"})]})]})]}));x.displayName=l.UC.displayName;let h=({className:e,...t})=>(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});h.displayName="DialogHeader";let p=({className:e,...t})=>(0,s.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});p.displayName="DialogFooter";let f=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.hE,{ref:a,className:(0,n.cn)("text-lg font-semibold leading-none tracking-tight",e),...t}));f.displayName=l.hE.displayName;let g=r.forwardRef(({className:e,...t},a)=>(0,s.jsx)(l.VY,{ref:a,className:(0,n.cn)("text-sm text-muted-foreground",e),...t}));g.displayName=l.VY.displayName},48375:(e,t,a)=>{a.d(t,{A:()=>d,O:()=>o});var s=a(95155),r=a(12115),l=a(65140),i=a(19865);let n=(0,r.createContext)(void 0);function o({children:e}){let[t,a]=(0,r.useState)(null),[d,c]=(0,r.useState)(null),[m,u]=(0,r.useState)(null),[x,h]=(0,r.useState)(null),[p,f]=(0,r.useState)(!0),[g,y]=(0,r.useState)(!1);(0,r.useEffect)(()=>{let e,t=!1,s=()=>{t||(e=(0,l.hg)(i.j2,async e=>{if(a(e),y(!!e?.emailVerified),e)try{let t=await e.getIdToken(),a=await fetch("/api/auth/me",{headers:{Authorization:`Bearer ${t}`}}),s=a.ok?await a.json():null;c(s?.user??null),u(s?.profile??null),h(s?.access??null)}catch(e){console.error("[AuthContext] Failed to fetch user data:",e),c(null),u(null),h(null)}else c(null),u(null),h(null);f(!1)}))},r="function"==typeof window.requestIdleCallback?window.requestIdleCallback(s,{timeout:2e3}):window.setTimeout(s,0);return()=>{t=!0,"function"==typeof window.cancelIdleCallback?window.cancelIdleCallback(r):window.clearTimeout(r),e?.()}},[]);let w=(0,r.useMemo)(()=>x?.isAdmin??d?.role==="admin",[x,d]),b=(0,r.useMemo)(()=>x?.isEditor??(d?.role==="admin"||d?.role==="editor"),[x,d]),v=(0,r.useMemo)(()=>x?.dashboardPermissions??d?.dashboardPermissions??[],[x,d]),j=(0,r.useMemo)(()=>e=>w||v.includes(e),[w,v]),N=(0,r.useMemo)(()=>!!t,[t]),k=(0,r.useMemo)(()=>m?.accountType==="premium",[m]),A=(0,r.useMemo)(()=>!!m?.isAdvertiser,[m]),S=async()=>{await i.j2.currentUser?.reload(),y(!!i.j2.currentUser?.emailVerified)},T=(0,r.useMemo)(()=>({user:t,appUser:d,userProfile:m,isLoading:p,isAdmin:w,isEditor:b,dashboardPermissions:v,hasFeature:j,isAuthenticated:N,isPremium:k,isAdvertiser:A,emailVerified:g,refreshEmailVerified:S}),[t,d,m,p,w,b,v,j,N,k,A,g]);return(0,s.jsx)(n.Provider,{value:T,children:e})}function d(){let e=(0,r.useContext)(n);if(void 0===e)throw Error("useAuth must be used within an AuthProvider");return e}},49625:(e,t,a)=>{a.d(t,{k:()=>h});var s=a(95155),r=a(12115),l=a(89239),i=a(81477),n=a(42763),o=a(80723),d=a(21628),c=a(22164),m=a(33210),u=a(6296),x=a(40980);function h({isOpen:e,url:t,onClose:a}){let[p,f]=(0,r.useState)(null),[g,y]=(0,r.useState)(!0);(0,r.useEffect)(()=>
1{if(t)try{let e=new URL(t).searchParams.get("p");f(e?parseInt(e,10):1),y(!0)}catch(e){console.error("Invalid URL for magazine viewer:",t),f(1),y(!0)}else f(null)},[t]);let w=e=>{if(!t||!p)return;let a="next"===e?p+1:Math.max(1,p-1);new URL(t).searchParams.set("p",a.toString()),f(a),y(!0)},b=e=>{if(!t||null===e)return"#";let a=new URL(t);return a.searchParams.set("p",e.toString()),a.toString()};return(0,s.jsx)(n.lG,{open:e,onOpenChange:a,children:(0,s.jsxs)(n.Cf,{hideCloseButton:!0,className:"max-w-4xl h-[90vh] p-0 flex flex-col !gap-0",children:[(0,s.jsx)(n.L3,{className:"sr-only",children:"Leitor de Revista"}),(0,s.jsxs)(i.aR,{className:"flex flex-row items-center justify-between p-3 border-b bg-muted/50 rounded-t-lg",children:[(0,s.jsx)(i.ZB,{className:"text-base font-medium",children:"Leitor de Revista"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(l.$,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>w("prev"),disabled:1===p,children:(0,s.jsx)(o.A,{size:16})}),(0,s.jsx)("span",{className:"text-sm font-mono w-10 text-center",children:p??"..."}),(0,s.jsx)(l.$,{variant:"outline",size:"icon",className:"h-8 w-8",onClick:()=>w("next"),children:(0,s.jsx)(d.A,{size:16})}),(0,s.jsx)(l.$,{variant:"outline",size:"icon",className:"h-8 w-8",asChild:!0,children:(0,s.jsx)("a",{href:b(p),target:"_blank",rel:"noopener noreferrer",title:"Abrir em nova aba",children:(0,s.jsx)(c.A,{size:16})})}),(0,s.jsx)(l.$,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:a,children:(0,s.jsx)(m.A,{size:18})})]})]}),(0,s.jsxs)(i.Wu,{className:"flex-1 p-0 relative",children:[g&&(0,s.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-background z-10",children:(0,s.jsx)(u.A,{className:"h-8 w-8 animate-spin text-primary"})}),t&&p&&(0,s.jsx)("iframe",{src:b(p),title:`Revista - P\xe1gina ${p}`,className:(0,x.cn)("w-full h-full border-0",g?"opacity-0":"opacity-100 transition-opacity duration-300"),onLoad:()=>y(!1)},b(p))]})]})})}},63432:(e,t,a)=>{a.d(t,{d:()=>o});var s=a(95155),r=a(81477),l=a(45160),i=a(20232),n=a(84980);function o({title:e,summary:t,imageUrl:a,youtubeVideoId:d,duration:c,matchedSegment:m,segmentTimestamp:u,publishedAt:x,rank:h,onClick:p}){return(0,s.jsx)(r.Zp,{className:"overflow-hidden hover:shadow-lg transition-shadow cursor-pointer group h-full",onClick:p,children:(0,s.jsxs)("div",{className:"flex gap-4 p-4",children:[h&&(0,s.jsx)("div",{className:"text-2xl font-bold text-muted-foreground w-8 text-center flex-shrink-0",children:h}),(0,s.jsxs)("div",{className:"relative w-32 h-20 flex-shrink-0 bg-muted rounded-md overflow-hidden",children:[a?(0,s.jsx)("img",{src:a,alt:e,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}):(0,s.jsx)("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-gray-700 to-gray-900",children:(0,s.jsx)(i.A,{className:"h-16 w-16 text-white/50"})}),(0,s.jsx)("div",{className:"absolute inset-0 bg-black/20 group-hover:bg-black/30 transition-colors flex items-center justify-center",children:(0,s.jsx)("div",{className:"bg-red-600 rounded-full p-2 group-hover:scale-110 transition-transform",children:(0,s.jsx)(i.A,{className:"h-4 w-4 text-white fill-white"})})}),c&&(0,s.jsx)("div",{className:"absolute bottom-1 right-1 bg-black/80 text-white text-xs px-1.5 py-0.5 rounded text-[10px]",children:(e=>{if(!e)return"";let t=Math.floor(e/60);return`${t}:${(e%60).toString().padStart(2,"0")}`})(c)}),void 0!==u&&(0,s.jsxs)("div",{className:"absolute top-1 right-1 bg-red-600 text-white text-xs px-1.5 py-0.5 rounded flex items-center gap-1 text-[10px]",children:[(0,s.jsx)(n.A,{className:"h-2.5 w-2.5"}),(e=>{if(!e)return"";let t=Math.floor(e/3600),a=Math.floor(e%3600/60),s=Math.floor(e%60);return t>0?`${t}:${a.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${a}:${s.toString().padStart(2,"0")}`})(u)]})]}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 space-y-1.5",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsx)("h3",{className:"font-semibold text-sm line-clamp-2 group-hover:text-primary transition-colors",children:e}),(0,s.jsx)(l.E,{variant:"outline",className:"text-xs shrink-0",children:"V\xcdDEO"})]}),m&&(0,s.jsxs)("p",{className:"text-sm text-muted-foreground line-clamp-2 italic",children:['"',m,'"']}),t&&!m&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t}),x&&(0,s.jsx)("p",{className:"mt-1.5 pt-1.5 border-t border-gray-200 text-[11px] text-gray-500",children:(e=>{if(!e)return"";let t="string"==typeof e?new Date(e):e.toDate?e.toDate():new Date;return new Intl.DateTimeFormat("pt-BR",{year:"numeric",month:"short",day:"numeric"}).format(t)})(x)})]})]})})}},73645:(e,t,a)=>{a.d(t,{MostReadCard:()=>g});var s=a(95155),r=a(98500),l=a.n(r),i=a(73321),n=a(5772),o=a(81477),d=a(40980),c=a(45160),m=a(36131),u=a(48884),x=a(85526),h=a(7203),p=a(79768);function f(e,t){if(!e)return null;try{let a="string"==typeof e?new Date(e):e?.toDate?.()??new Date(e);if(isNaN(a.getTime()))return null;if("maioresCompanies"===t)return a.getFullYear().toString();return new Intl.DateTimeFormat("pt-BR",{day:"2-digit",month:"2-digit",year:"numeric"}).format(a)}catch{return null}}function g({article:e,className:t,rank:a,showSummary:r=!1,compact:y=!1,editMode:w,onSummaryChange:b,styleOverride:v}){let j=(0,i.useRouter)(),N=e.title,k=e.link||e.path,A=v?.imageAspect||v?.imageHeightPx?{...v.imageAspect?{aspectRatio:v.imageAspect}:{},...v.imageHeightPx?{minHeight:`${v.imageHeightPx}px`}:{}}:void 0,S=e.imageUrl&&e.focalPoint?`${e.focalPoint.x}% ${e.focalPoint.y}%`:v?.imageObjectPosition??"center",T=v?.titleFontSizePx?{fontSize:`${v.titleFontSizePx}px`}:void 0,P=v?.summaryFontSizePx||v?.summaryLineClamp?{...v.summaryFontSizePx?{fontSize:`${v.summaryFontSizePx}px`}:{},...v.summaryLineClamp?{WebkitLineClamp:v.summaryLineClamp}:{}}:void 0,I=(0,p.S)("most-read"),C=(0,h.NF)(v,I),z=e.category?(0,x.TK)(e.category,v):{hidden:!0},E=(0,x.bq)(v);return(0,s.jsx)(o.Zp,{onClick:()=>{w||(e.link||k.startsWith("http")?window.open(k,e.link?"_self":"_blank","noopener,noreferrer"):j.push(k))},className:(0,d.cn)("overflow-hidden transition-shadow hover:shadow-lg cursor-pointer",t),children:(0,s.jsxs)("div",{className:(0,d.cn)("group flex items-stretch",y?"min-h-[80px]":"min-h-[100px]"),children:[(0,s.jsxs)("div",{className:(0,d.cn)("relative w-1/3 flex-shrink-0 overflow-hidden",y?"min-h-[80px]":"min-h-[100px]"),style:A,children:[(0,s.jsx)("span",{className:"absolute left-0 top-0 z-10 flex h-6 w-6 sm:h-7 sm:w-7 items-center justify-center rounded-br bg-black/50 text-sm font-bold text-white drop-shadow-sm",children:a}),(0,s.jsx)(n.default,{src:e.imageUrl||u.tL,alt:N,fill:!0,className:"object-cover",style:{objectPosition:S},loading:"lazy","data-ai-hint":"news article"})]}),(0,s.jsxs)("div",{className:(0,d.cn)("flex-grow min-w-0 space-y-1 flex flex-col justify-center",y?"p-3":"p-4"),children:[e.category&&!z.hidden&&(0,s.jsx)(l(),{href:`/${(0,d.Y)(e.category)}`,onClick:e=>e.stopPropagation(),className:y?"block truncate text-[10px] uppercase text-amber-600 font-medium":"self-start",style:y&&E?{color:E}:void 0,children:y?(0,s.jsx)("span",{className:"truncate",children:e.category}):(0,s.jsx)(c.E,{variant:"secondary",className:(0,d.cn)("cursor-pointer hover:opacity-80 transition-opacity text-xs",z.className),style:z.style,children:e.category})}),(0,s.jsx)("h3",{className:(0,d.cn)("font-semibold leading-snug line-clamp-2 group-hover:text-primary transition-colors",y?"text-xs":"text-sm"),style:{textWrap:"balance",...T},children:N}),r&&(w&&b?(0,s.jsx)(m.p,{value:e.summary??"",onChange:b,className:"text-sm text-muted-foreground line-clamp-2 italic",style:P,placeholder:"Edite o resumoâ¦"}):!y&&(e.matchedSnippet||e.summary)?(0,s.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-2 italic [&_mark]:bg-yellow-200 [&_mark]:font-semibold [&_mark]:px-0.5",style:P,dangerouslySetInnerHTML:{__html:e.matchedSnippet||e.summary||""}}):null),C&&f(e.publishedAt,e.collection)&&(0,s.jsx)("p",{className:"mt-1.5 pt-1.5 border-t border-gray-200 text-[11px] text-gray-500",children:f(e.publishedAt,e.collection)})]})]})})}},98096:(e,t,a)=>{a.d(t,{VideoPlayerWithNavigation:()=>b});var s=a(95155),r=a(12115),l=a(42763),i=a(89239),n=a(35942),o=a(45160),d=a(927),c=a(41641),m=a(21362),u=a(57420),x=a(7915),h=a(84980),p=a(20232),f=a(33210),g=a(35871),y=a(4729
16),w=a(88428);function b({video:e,allVideos:t=[],onClose:a,onVideoChange:v,startSeconds:j}){let N=(0,r.useRef)(null),k=(0,r.useRef)(null),[A,S]=(0,r.useState)(!1),[T,P]=(0,r.useState)(0),I=(0,r.useRef)(!1),C=(0,r.useRef)(!0),z=t.findIndex(t=>t.id===e.id),E=z>0,V=z<t.length-1;(0,r.useEffect)(()=>{console.log("[VideoPlayer] Component mounted, video:",e.youtubeVideoId);let t=setTimeout(()=>{if(window.YT&&window.YT.Player){console.log("[VideoPlayer] YT API already loaded"),_();return}if(document.querySelector('script[src="https://www.youtube.com/iframe_api"]')){console.log("[VideoPlayer] YT API script already in DOM, waiting for load..."),window.onYouTubeIframeAPIReady=()=>{console.log("[VideoPlayer] YT API ready callback"),setTimeout(()=>_(),100)};return}console.log("[VideoPlayer] Loading YT API script");let e=document.createElement("script");e.src="https://www.youtube.com/iframe_api";let t=document.getElementsByTagName("script")[0];t.parentNode?.insertBefore(e,t),window.onYouTubeIframeAPIReady=()=>{console.log("[VideoPlayer] YT API ready callback"),setTimeout(()=>_(),100)}},100);return()=>{if(clearTimeout(t),console.log("[VideoPlayer] Component unmounting, destroying player"),N.current){try{N.current.destroy()}catch(e){console.error("[VideoPlayer] Error destroying player:",e)}N.current=null}S(!1),I.current=!1}},[]),(0,r.useEffect)(()=>{if(N.current&&A){if(C.current){C.current=!1;return}console.log("[VideoPlayer] Video changed:",e.youtubeVideoId,"startSeconds:",j),N.current.loadVideoById({videoId:e.youtubeVideoId,startSeconds:j||0}),j&&j>0&&setTimeout(()=>{N.current&&N.current.seekTo(j,!0)},500),P(0)}},[e.youtubeVideoId,j,A]);let _=()=>{if(I.current)return void console.log("[VideoPlayer] Already initializing, skipping");if(!k.current)return void console.log("[VideoPlayer] No container ref, skipping");if(N.current)return void console.log("[VideoPlayer] Player already exists, skipping");console.log("[VideoPlayer] Creating new YT.Player for video:",e.youtubeVideoId,"with startSeconds:",j),I.current=!0;try{N.current=new window.YT.Player(k.current,{height:"100%",width:"100%",videoId:e.youtubeVideoId,playerVars:{autoplay:1,modestbranding:1,rel:0,start:j||0,origin:window.location.origin},events:{onReady:e=>{console.log("[VideoPlayer] Player ready, starting playback at startSeconds:",j),I.current=!1,S(!0),j&&j>0?setTimeout(()=>{e.target.seekTo(j,!0),e.target.playVideo()},500):e.target.playVideo()},onError:e=>{console.error("[VideoPlayer] Player error:",e.data),I.current=!1}}})}catch(e){console.error("[VideoPlayer] Error creating player:",e),I.current=!1}},R=e.chapters&&e.chapters.length>0?"chapters":"description";return(0,s.jsx)(l.lG,{open:!0,onOpenChange:a,children:(0,s.jsxs)(l.Cf,{hideCloseButton:!0,className:"max-w-7xl h-[95vh] md:h-[90vh] p-0 gap-0 overflow-hidden",children:[(0,s.jsxs)(w.s6,{children:[(0,s.jsx)(l.L3,{children:e.title}),(0,s.jsx)(l.rr,{children:"Player de v\xeddeo com navega\xe7\xe3o entre v\xeddeos relacionados"})]}),(0,s.jsxs)("div",{className:"flex h-full min-h-0 flex-col md:flex-row",children:[(0,s.jsxs)("div",{className:"relative w-full aspect-video md:aspect-auto md:w-[70%] bg-black md:min-h-0 flex-shrink-0",children:[(0,s.jsx)("div",{ref:k,className:"absolute inset-0 [&_iframe]:!absolute [&_iframe]:!inset-0 [&_iframe]:!w-full [&_iframe]:!h-full"}),(0,s.jsxs)("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex gap-2 z-10",children:[(0,s.jsxs)(i.$,{variant:"secondary",size:"sm",onClick:()=>{E&&v(t[z-1])},disabled:!E,className:"bg-black/70 hover:bg-black/90 text-white",children:[(0,s.jsx)(c.A,{className:"h-4 w-4 mr-1"}),"Anterior"]}),(0,s.jsxs)(i.$,{variant:"secondary",size:"sm",onClick:()=>{V&&v(t[z+1])},disabled:!V,className:"bg-black/70 hover:bg-black/90 text-white",children:["Pr\xf3ximo",(0,s.jsx)(m.A,{className:"h-4 w-4 ml-1"})]})]})]}),(0,s.jsxs)("div",{className:"flex flex-1 min-h-0 flex-col overflow-hidden md:flex-none md:w-[30%] md:border-l",children:[(0,s.jsxs)("div",{className:"border-b p-4 space-y-3 flex-shrink-0",children:[(0,s.jsx)("h2",{className:"text-base font-semibold leading-tight pr-6",children:e.title}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-muted-foreground",children:[e.publishedAt&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(u.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:(e=>{try{let t=new Date(e);return(0,g.GP)(t,"dd 'de' MMMM 'de' yyyy",{locale:y.F})}catch{return e}})(e.publishedAt)})]}),void 0!==e.viewCount&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(x.A,{className:"h-3 w-3"}
1),(0,s.jsxs)("span",{children:[e.viewCount.toLocaleString("pt-BR")," visualiza\xe7\xf5es"]})]}),e.durationFormatted&&(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(h.A,{className:"h-3 w-3"}),(0,s.jsx)("span",{children:e.durationFormatted})]})]}),e.tags&&e.tags.length>0&&(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:e.tags.slice(0,5).map((e,t)=>(0,s.jsx)(o.E,{variant:"secondary",className:"text-xs",children:e},t))})]}),(0,s.jsx)(n.F,{className:"flex-1 min-h-0",children:(0,s.jsxs)(d.Accordion,{type:"single",collapsible:!0,defaultValue:R,className:"px-4",children:[(0,s.jsxs)(d.AccordionItem,{value:"description",children:[(0,s.jsx)(d.AccordionTrigger,{className:"text-sm font-medium",children:"Descri\xe7\xe3o"}),(0,s.jsx)(d.AccordionContent,{children:(0,s.jsx)("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:e.description||"Sem descri\xe7\xe3o dispon\xedvel."})})]}),e.chapters&&e.chapters.length>0&&(0,s.jsxs)(d.AccordionItem,{value:"chapters",children:[(0,s.jsxs)(d.AccordionTrigger,{className:"text-sm font-medium",children:["Cap\xedtulos (",e.chapters.length,")"]}),(0,s.jsx)(d.AccordionContent,{children:(0,s.jsx)("div",{className:"space-y-1",children:e.chapters.map((e,t)=>(0,s.jsx)("button",{onClick:()=>{var t;return t=e.timestamp,void(N.current&&A&&(N.current.seekTo(t,!0),N.current.playVideo()))},className:"w-full text-left p-2 rounded hover:bg-accent transition-colors group",children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)(p.A,{className:"h-3 w-3 mt-0.5 flex-shrink-0 text-muted-foreground group-hover:text-primary"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("div",{className:"text-xs font-medium group-hover:text-primary",children:e.timeFormatted}),(0,s.jsx)("div",{className:"text-xs text-muted-foreground line-clamp-2",children:e.title})]})]})},t))})})]})]})})]})]}),(0,s.jsx)(i.$,{variant:"ghost",size:"icon",className:"absolute top-2 right-2 z-50 bg-black/50 hover:bg-black/70 text-white",onClick:a,children:(0,s.jsx)(f.A,{className:"h-4 w-4"})})]})})}}}]);
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.