1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DigestTextSection-Dux3Booc.js","assets/index-cIixWAV5.js","assets/vendor-ui-I_-nePhb.js","assets/vendor-icons-oO1eLahr.js","assets/vendor-supabase-DctwCD-J.js","assets/vendor-router-Cpdxi8Yl.js","assets/vendor-query-C1DCN9dZ.js","assets/vendor-framer-CE5kk4AX.js","assets/index-C9lQaC9V.css","assets/sanitizeHtml-8qAlktzg.js","assets/purify.es-BPuvlvQ_.js","assets/select-B6h4u48O.js","assets/jspdf.es.min-1xzJyG_T.js","assets/DateField-Czcf75O3.js","assets/AIScoreAnalysis-DW-kIdJS.js","assets/agentColor-BXnWZvMN.js","assets/content-hub-D07a1DoP.js","assets/Cpu.es-DJSbTih9.js","assets/Minus.es-iEmSfHai.js","assets/badge-CRvEs9vt.js","assets/CaretLeft.es-DYLFn9g6.js","assets/GenerateFormatDialog-BkEmEw2R.js","assets/useTextReports-Dm9K1WZS.js","assets/digestScope-DZSIqlcA.js","assets/digestLanguages-GzICGYwT.js","assets/textReportContentCache-Cgwj1FEJ.js","assets/NewsletterSection-CVvQhXwj.js","assets/sortable.esm-CHVy64jZ.js","assets/useNewsletters-CI2E1kR2.js","assets/useProject-CJJlNJnW.js","assets/useProjectSenderDomain-BqTGJjLb.js","assets/index-DLxV0xKN.js","assets/index-BJZYdydr.js","assets/newsletter-CwUXgMHL.js","assets/ProjectDataContext-9eliko28.js","assets/firstPaintCache-C1WIzI8_.js","assets/checkbox-oxnb1i8W.js","assets/useNewsletterCustomization-BPzsbtcV.js","assets/useNewsletterAnalytics-BJUS5eLT.js","assets/slider-DHfzbNSo.js","assets/html2canvas.esm-DXEQVQnt.js","assets/PresentationSection-B23HoOLY.js","assets/usePowerPoints-ZBkOv2zM.js","assets/PodcastSection-DSndHn70.js","assets/usePodcasts-Bx_SFx2E.js","assets/PodcastTranscript-CZoByt9o.js"])))=>i.map(i=>d[i]); 2import{u as Y,v as B,f as H,aa as W,cu as J,a3 as x,dp as X,dq as Z,dr as $,aM as p,fh as C}from"./index-cIixWAV5.js";import{j as n}from"./vendor-ui-I_-nePhb.js";import{a as l,F as ee,W as te,m as ae,bA as se}from"./vendor-icons-oO1eLahr.js";import{b as ne,d as re}from"./vendor-router-Cpdxi8Yl.js";import{w as oe,L as M,g as ie}from"./digestTabLanguagePreferences-KQFsbFxG.js";import{u as ce}from"./useProject-CJJlNJnW.js";import{a as de}from"./vendor-query-C1DCN9dZ.js";import{D as T}from"./digestLanguages-GzICGYwT.js";import{f as le,a as ue}from"./useTextReports-Dm9K1WZS.js";import{f as ge,g as pe}from"./useNewsletters-CI2E1kR2.js";import{f as fe,g as me}from"./usePowerPoints-ZBkOv2zM.js";import{f as xe,g as be}from"./usePodcasts-Bx_SFx2E.js";import{u as he}from"./ProjectDataContext-9eliko28.js";import{A as we,m as _e}from"./vendor-framer-CE5kk4AX.js";import"./vendor-supabase-DctwCD-J.js";import"./digestScope-DZSIqlcA.js";import"./firstPaintCache-C1WIzI8_.js";const ye=new Set(["consumer","viewer"]),Te=a=>(a??"").trim().toLowerCase(),Le=a=>ye.has(Te(a)),ve=a=>!Le(a),Ee=C(()=>p(()=>import("./DigestTextSection-Dux3Booc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25])).then(a=>({default:a.DigestTextSection}))),Pe=C(()=>p(()=>import("./NewsletterSection-CVvQhXwj.js"),__vite__mapDeps([26,2,3,1,4,5,6,7,8,27,28,23,21,11,29,30,31,32,33,34,35,36,37,38,9,10,39,16,12,40])).then(a=>({default:a.NewsletterSection}))),je=C(()=>p(()=>import("./PresentationSection-B23HoOLY.js"),__vite__mapDeps([41,2,3,1,4,5,6,7,8,11,42,23,21,24])).then(a=>({default:a.PresentationSection}))),Se=C(()=>p(()=>import("./PodcastSection-DSndHn70.js"),__vite__mapDeps([43,2,3,1,4,5,6,7,8,19,11,44,23,21,24,39,45])).then(a=>({default:a.PodcastSection}))),S=300*1e3,Ae=2500,Ce=()=>{if(typeof navigator>"u")return!1;const a=navigator.connection;if(!a)return!1;if(a.saveData)return!0;const b=a.effectiveType;return b==="slow-2g"||b==="2g"},A=["text","newsletter","presentation","podcast"],N={text:"textLang",newsletter:"newsletterLang",presentation:"presentationLang",podcast:"podcastLang"};function He(){const{t:a}=Y(),{language:b}=B(),{projectId:s}=ne(),[u,I]=re(),{data:Q}=ce(s),V=he(),L=ve(V?.projectRole),{user:d}=H(),h=de(),K=W(),[r,m]=l.useState("text"),U=()=>{const e=new URLSearchParams(window.location.search).get("lang");if(e&&T.includes(e))return e;try{const t=localStorage.getItem("dotikawatch_language_preference");if(t){const o=t.split("-")[0].toLowerCase();if(T.includes(o))return o}}catch{}return T.includes(b)?b:"en"},v=e=>ie(e)??U(),[i,O]=l.useState(()=>({text:v("text"),newsletter:v("newsletter"),presentation:v("presentation"),podcast:v("podcast")})),E=l.useCallback((e,t)=>{O(o=>o[e]===t?o:(oe(e,t),{...o,[e]:t}))},[]),{digestNotifications:z,markDigestTabAsSeen:F}=J(),g=s?z.get(s):void 0,P=l.useMemo(()=>({text:g?.tabs.text??0,newsletter:g?.tabs.newsletter??0,presentation:g?.tabs.presentation??0,podcast:g?.tabs.podcast??0}),[g?.tabs.text,g?.tabs.newsletter,g?.tabs.presentation,g?.tabs.podcast]);l.useEffect(()=>{const e=u.get("tab"),t=e&&A.includes(e)?e:null;t&&m(c=>c===t?c:t);const o=u.get("lang"),f=o&&T.includes(o)?o:null,R=A.some(c=>
2u.has(N[c]));O(c=>{let _=!1;const y={...c};A.forEach(D=>{const k=u.get(N[D]);if(!k||!T.includes(k))return;const G=k;y[D]!==G&&(y[D]=G,_=!0)});const q=t??"text";return!R&&f&&y[q]!==f&&(y[q]=f,_=!0),_?y:c})},[u]),l.useEffect(()=>{const e=new URLSearchParams(u);e.set("tab",r),e.set("lang",i[r]),A.forEach(t=>{e.set(N[t],i[t])}),e.toString()!==u.toString()&&I(e,{replace:!0})},[r,u,I,i]),l.useEffect(()=>{s&&F(s,r)},[s,r,F]);const j=l.useCallback(e=>{if(!s||!d?.id)return;const t=o=>{o().catch(()=>{})};switch(e){case"text":t(()=>p(()=>import("./DigestTextSection-Dux3Booc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]))),h.prefetchQuery({queryKey:ue(s,i.text,d.id),queryFn:()=>le(s,i.text,d.id),staleTime:S});break;case"newsletter":t(()=>p(()=>import("./NewsletterSection-CVvQhXwj.js"),__vite__mapDeps([26,2,3,1,4,5,6,7,8,27,28,23,21,11,29,30,31,32,33,34,35,36,37,38,9,10,39,16,12,40]))),h.prefetchQuery({queryKey:pe(s,d.id),queryFn:()=>ge(s,d.id),staleTime:S});break;case"presentation":t(()=>p(()=>import("./PresentationSection-B23HoOLY.js"),__vite__mapDeps([41,2,3,1,4,5,6,7,8,11,42,23,21,24]))),h.prefetchQuery({queryKey:me(s,d.id),queryFn:()=>fe(s,d.id),staleTime:S});break;case"podcast":t(()=>p(()=>import("./PodcastSection-DSndHn70.js"),__vite__mapDeps([43,2,3,1,4,5,6,7,8,19,11,44,23,21,24,39,45]))),h.prefetchQuery({queryKey:be(s,i.podcast,d.id),queryFn:()=>xe(s,i.podcast,d.id),staleTime:S});break}},[s,h,i,d?.id]);l.useEffect(()=>{if(!s||!d?.id)return;let e=!1;const t=()=>{e||document.visibilityState==="visible"&&(Ce()||["text","newsletter","presentation","podcast"].filter(c=>c!==r).forEach(c=>j(c)))};if(typeof window>"u")return t(),()=>{e=!0};const o=window.requestIdleCallback;let f=null;const R=window.setTimeout(()=>{if(e)return;if(typeof o=="function"){const _=o(t,{timeout:1500});f=()=>{window.cancelIdleCallback?.(_)};return}const c=window.setTimeout(t,200);f=()=>{window.clearTimeout(c)}},Ae);return()=>{e=!0,window.clearTimeout(R),f?.()}},[j,s,i,d?.id,r]);const w=[{id:"text",label:a("digest.tabs.text",x.tabs.text),icon:ee,badge:P.text},{id:"newsletter",label:a("digest.tabs.newsletter",x.tabs.newsletter),icon:te,badge:P.newsletter},{id:"presentation",label:a("digest.tabs.presentation",x.tabs.presentation),icon:ae,badge:P.presentation},{id:"podcast",label:a("digest.tabs.podcast",x.tabs.podcast),icon:se,badge:P.podcast}];return!Q||!s?n.jsx(M,{message:a("digest.loading",x.loading)}):n.jsxs("div",{className:"bg-background",children:[!K&&n.jsx("div",{className:"pt-2",children:n.jsx("div",{className:"relative z-50 bg-card/80 backdrop-blur-xl py-2 sm:py-2.5 md:py-3 px-3 sm:px-4 md:px-6 rounded-xl border border-border shadow-sm",children:n.jsxs("div",{className:"flex items-center w-full gap-3",children:[n.jsx("div",{id:"digest-header-left",className:"flex items-center gap-2 flex-shrink-0 min-w-0 max-w-[250px]"}),n.jsx("div",{className:"flex-1 flex justify-center",children:n.jsx(X,{value:r,onValueChange:e=>m(e),className:"w-auto",children:n.jsx(Z,{className:"w-auto h-9 p-1 bg-slate-100/60 backdrop-blur-md rounded-full mx-auto justify-center",children:w.map(e=>{const t=e.icon;return n.jsxs($,{value:e.id,onMouseEnter:()=>j(e.id),onFocus:()=>j(e.id),className:"relative z-10 flex items-center justify-center gap-1.5 px-3 h-7 rounded-full text-xs font-medium data-[state=active]:bg-card data-[state=active]:text-foreground data-[state=active]:shadow-sm text-muted-foreground hover:text-foreground transition-colors duration-200",children:[n.jsx(t,{className:"h-3.5 w-3.5"}),n.jsx("span",{children:e.label}),e.badge!==void 0&&e.badge>0&&n.jsx("span",{className:"ml-1 inline-flex items-center justify-center rounded-full bg-bryf-red px-1.5 py-0.5 text-[10px] font-semibold text-primary-foreground",children:e.badge})]},e.id)})})})}),n.jsx("div",{id:"digest-header-right",className:"flex items-center gap-2 flex-shrink-0 max-w-[300px]"})]})})}),n.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-3",children:n.jsx(we,{mode:"wait",children:n.jsx(_e.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},transition:{duration:.2,ease:"easeInOut"},className:"",children:n.jsxs(l.Suspense,{fallback:n.jsx(M,{message:a("digest.loading",x.loading)}),children:[r==="text"&&n.jsx(Ee,{projectId:s,selectedLanguage:i.text,onLanguageChange:e=>E("text",e),canGenerateContent:L,tabs:w,activeTab:r,onTabChange:m}),r==="newsletter"&&n.jsx(Pe,{projectId:s,selectedLanguage:i.newsletter,onLanguageChange:e=>E("newsletter",e),canGenerateContent:L,tabs:w,activeTab:r,onTabChange:m}),r==="presentation"&&n.jsx(je,{projectId:s,selectedLanguage:i.presentation,onLanguageChange:e=>E("presentation",e),canGenerateContent:L,tabs:w,activeTab:r,onTabChange:m}),r==="podcast"&&n.jsx(Se,{projectId:s,selectedLanguage:i.podcast,onLanguageChange:e=>E("podcast",e),canGenerateContent:L,tabs:w,activeTab:r,onTabChange:m})]})},r)})})]})}export{He 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.