1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6274],{13579:(e,t,s)=>{"use strict";s.d(t,{I:()=>i});var a=s(95155);s(12115);var r=s(90781),n=s(34614);function i(e){let{value:t,onChange:s,placeholder:i="Search..."}=e;return(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)("div",{className:"absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none",children:(0,a.jsx)(r.n,{icon:n.A,className:"h-5 w-5 text-gray-400"})}),(0,a.jsx)("input",{type:"text",value:t,onChange:e=>s(e.target.value),placeholder:i,className:"w-full pl-12 pr-4 py-3 glass border border-white/30 rounded-2xl text-base text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-4 focus:ring-purple-400/20 focus:border-purple-400 selection:bg-purple-200 selection:text-purple-900 transition-all duration-300 shadow-lg font-sans"})]})}},20291:(e,t,s)=>{"use strict";s.d(t,{R:()=>c,SystemLimitsProvider:()=>o});var a=s(95155),r=s(12115);let n=(0,s(71919).h)("SystemLimitsContext"),i={guest_tag_limit:3,free_user_tag_limit:25,pro_user_tag_limit:-1,free_user_digest_limit:3},l=(0,r.createContext)({limits:i,isLoading:!0,formatLimit:e=>-1===e?"Unlimited":String(e)});function o(e){let{children:t,initialLimits:s}=e,[o,c]=(0,r.useState)(s||i),[d,u]=(0,r.useState)(!s);return(0,r.useEffect)(()=>{if(s){c(s),u(!1);return}!async function(){try{let e=await fetch("/api/public/limits");if(e.ok){let t=await e.json();t.success&&t.limits&&c(t.limits)}}catch(e){n.warn("[SystemLimits] Failed to fetch, using defaults:",e)}finally{u(!1)}}()},[s]),(0,a.jsx)(l.Provider,{value:{limits:o,isLoading:d,formatLimit:e=>-1===e?"Unlimited":String(e)},children:t})}function c(){let e=(0,r.useContext)(l);return e||(n.warn("[useSystemLimits] Used outside of SystemLimitsProvider, returning defaults"),{limits:i,isLoading:!1,formatLimit:e=>-1===e?"Unlimited":String(e)})}},29338:(e,t,s)=>{"use strict";s.d(t,{VN:()=>r,kL:()=>i,w5:()=>l});var a=s(95155);s(12115);let r=e=>{let{className:t=""}=e;return(0,a.jsx)("div",{className:"glass animate-pulse rounded-2xl ".concat(t),children:(0,a.jsx)("div",{className:"skeleton h-full w-full rounded-2xl"})})},n=()=>(0,a.jsx)("div",{className:"glass rounded-3xl p-6 animate-pulse",children:(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,a.jsx)(r,{className:"h-12 w-12 rounded-2xl"}),(0,a.jsxs)("div",{className:"space-y-2 flex-1",children:[(0,a.jsx)(r,{className:"h-4 w-3/4"}),(0,a.jsx)(r,{className:"h-3 w-1/2"})]}),(0,a.jsx)(r,{className:"h-8 w-20 rounded-xl"})]}),(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(r,{className:"h-3 w-full"}),(0,a.jsx)(r,{className:"h-3 w-4/5"}),(0,a.jsx)(r,{className:"h-3 w-2/3"})]})]})}),i=()=>(0,a.jsx)("div",{className:"space-y-4",children:[void 0,void 0,void 0].map((e,t)=>(0,a.jsx)(n,{},t))}),l=()=>(0,a.jsx)("div",{className:"glass rounded-3xl p-8 animate-pulse",children:(0,a.jsxs)("div",{className:"text-center space-y-6",children:[(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)(r,{className:"h-6 w-32 mx-auto"}),(0,a.jsx)(r,{className:"h-4 w-16 mx-auto"})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(r,{className:"h-32 w-full rounded-2xl"}),(0,a.jsxs)("div",{className:"flex justify-center space-x-3",children:[(0,a.jsx)(r,{className:"h-10 w-24 rounded-xl"}),(0,a.jsx)(r,{className:"h-10 w-24 rounded-xl"}),(0,a.jsx)(r,{className:"h-10 w-24 rounded-xl"})]})]})]})})},31969:(e,t,s)=>{"use strict";s.d(t,{R:()=>u});var a=s(1686),r=s(46676),n=s(20291),i=s(58998);let l=(0,s(71919).h)("useSubscription"),o=e=>["subscription",e];async function c(){let e=await fetch("/api/subscription/status");if(!e.ok)throw Error("Failed to fetch subscription status");return e.json()}function d(e){return{subscription_status:"free",plan_id:"free",tags_used_this_month:0,monthly_tag_limit:e,has_pro_access:!1,trial_end:null,trial_eligible:!0,has_used_trial:!1,trial_started_at:null,stripe_status:null,cancel_at_period_end:!1,digests_used:0,digest_limit:0}}function u(){var e;let{user:t,isGuest:u}=(0,r.A)(),{limits:m}=(0,n.R)(),x=(0,a.jE)(),h=m.guest_tag_limit,g=m.free_user_tag_limit,{data:p,isLoading:f,error:v,refetch:b}=(0,a.pw)({queryKey:o(null==t?void 0:t.id),queryFn:c,enabled:!u&&!!t,placeholderData:u||!t?d(h):void 0,staleTime:12e4,retry:1,meta:{errorHandler:e=>{l.error("Error fetching subscription:",e)}}}),y=v&&!p?{subscription_status:"free",plan_id:"free",tags_used_this_month:0,monthly_tag_limit:g,has_pro_access:!1,trial_end:null,trial_eligible:!0,has_used_trial:!1,trial_started_at:null,stripe_status:null,cancel_at_period_end:!1,digests_used:0,digest_limit:i.S$}:null!=p?p:u||!t?d(h):null,w=null!=(e=null==v?void 0:v.message)?e:null,j=(0,a.n_)({mutationFn:async e=>{let{priceId:s,withTrial:a=!1,customTrialDays:r,promoCode:n}=e;
1if(u||!t)throw Error("Must be logged in to subscribe");let i=await fetch("/api/stripe/create-checkout-session",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({priceId:s,userId:t.id,email:t.email,withTrial:a,customTrialDays:r,promoCode:n})});if(!i.ok)throw Error("Failed to create checkout session");return i.json()},onSuccess:async e=>{let t=(await s.e(38).then(s.bind(s,80038))).loadStripe("pk_live_51RtS9rAIS3XnhIBiw08gRSjwmS3nXowK4d9apXfnZebbmoIKkNTcvSktWih3jpCYLOqjgqTUxxL02CPnFPPZAEZJ00t0b4xmKV"),a=await t;a&&await a.redirectToCheckout({sessionId:e.sessionId})},onError:e=>{l.error("Error creating checkout session:",e)}}),N=(0,a.n_)({mutationFn:async()=>{if(u||!t)throw Error("Must be logged in to access customer portal");let e=await fetch("/api/stripe/customer-portal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t.id})});if(!e.ok)throw Error("Failed to create customer portal session");return e.json()},onError:e=>{l.error("Error creating customer portal session:",e)}}),S=()=>y&&-1!==y.monthly_tag_limit?Math.min(y.tags_used_this_month/y.monthly_tag_limit*100,100):0,k=()=>!!y&&!!("trialing"===y.subscription_status||"trialing"===y.stripe_status||y.trial_end&&new Date(y.trial_end)>new Date);return{subscription:y,loading:f,error:w,fetchSubscriptionStatus:()=>{!u&&t&&b()},invalidateSubscription:()=>{x.invalidateQueries({queryKey:o(null==t?void 0:t.id)})},createCheckoutSession:async function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2?arguments[2]:void 0,a=arguments.length>3?arguments[3]:void 0;await j.mutateAsync({priceId:e,withTrial:t,customTrialDays:s,promoCode:a})},createCustomerPortalSession:async()=>(await N.mutateAsync()).url,getUsagePercentage:S,getUsageColor:()=>{let e=S();return e>=90?"red":e>=70?"orange":"green"},canCreateTag:()=>!!y&&(!!y.has_pro_access||y.tags_used_this_month<y.monthly_tag_limit),isInTrial:k,getTrialDaysRemaining:()=>{if(!(null==y?void 0:y.trial_end))return 0;let e=new Date(y.trial_end),t=new Date;return Math.max(0,Math.ceil(Math.abs(e.getTime()-t.getTime())/864e5))},hasExportAccess:()=>!u&&!!y&&(y.has_pro_access||k())}}},32407:(e,t,s)=>{"use strict";s.d(t,{b:()=>o});var a=s(95155),r=s(12115),n=s(90781),i=s(79803),l=s(92804);function o(e){var t,s;let{value:o,options:c,onChange:d,placeholder:u,disabled:m=!1,onOpenChange:x,clearable:h=!1,clearValue:g}=e,[p,f]=(0,r.useState)(!1),v=(0,r.useRef)(null),b=c.find(e=>e.value===o),y=null!=(s=null!=g?g:null==(t=c[0])?void 0:t.value)?s:"",w=h&&o!==y;(0,r.useEffect)(()=>{null==x||x(p)},[p,x]),(0,r.useEffect)(()=>{let e=e=>{v.current&&!v.current.contains(e.target)&&f(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let j=e=>{e.stopPropagation(),d(y)};return(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{type:"button",onClick:()=>!m&&f(!p),disabled:m,className:"w-full p-2 glass border border-white/30 rounded-xl text-sm focus:outline-none focus:ring-2 focus:ring-purple-400 flex items-center justify-between transition-colors ".concat(m?"opacity-50 cursor-not-allowed":"hover:bg-white/50"),children:[(0,a.jsx)("span",{className:"flex-1 text-left",children:b?b.render():u}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[w&&(0,a.jsx)("span",{role:"button",tabIndex:0,onClick:j,onKeyDown:e=>"Enter"===e.key&&j(e),className:"p-0.5 hover:bg-gray-200 rounded-full transition-colors cursor-pointer","aria-label":"Clear filter",children:(0,a.jsx)(n.n,{icon:l.A,size:14,className:"text-gray-500 hover:text-gray-700"})}),(0,a.jsx)(n.n,{icon:i.A,size:16,className:"text-gray-500 transition-transform ".concat(p?"rotate-180":"")})]})]}),p&&(0,a.jsx)("div",{className:"absolute top-full left-0 right-0 mt-1 bg-white border border-gray-200 rounded-xl shadow-lg max-h-64 overflow-y-auto z-50",children:c.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>{d(e.value),f(!1)},className:"w-full p-2.5 text-left text-sm hover:bg-purple-50 transition-colors flex items-center ".concat(e.value===o?"bg-purple-50":"bg-white"),children:e.render()},e.value))})]})}},42109:(e,t,s)=>{Promise.resolve().then(s.bind(s,87092))},76753:(e,t,s)=>{"use strict";s.d(t,{L:()=>d});var a=s(95155),r=s(12115),n=s(67909),i=s(15239),l=s(90781),o=s(48510);let c=(0,n.default)(()=>s.e(9885).then(s.bind(s,29885)).then(e=>({default:e.ShareModal})),{loadableGenerated:{webpack:()=>[29885]},ssr:!1,loading:()=>null}),d=e=>{let{tagId:t,videoId:s,className:n="",size:d="md",variant:u="icon"}=e,[m,x]=(0,r.useState)(!1),[h,g]=(0,r.useState)(!1),p={sm:{container:"w-10 h-10",logo:20,padding:"px-4 py-2",text:"text-xs"},md:{container:"w-12 h-12",logo:24,padding:"px-5 py-2.5",text:"text-sm"},lg:{container:"w-14 h-14",logo:28,padding:"px-6 py-3",text:"text-base"}}[d];return"button"===u?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"relative inline-block group",children:[(0,a.jsx)("div",{className:" absolute -inset-[2px] bg-gradient-to-r from-purple-600 via-pink-500 to-purple-600 rounded-2xl opacity-60 group-hover:opacity-90 blur-sm bg-size-200 animate-gradient-x transition-opacity duration-300 "}),(0,a.jsxs)("button",{onClick:()=>x(!0),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:"\n relative\n ".concat(p.padding,"\n rounded-2xl\n bg-white\n flex items-center gap-2\n font-semibold\n ").concat(p.text,"\n shadow-sm\n overflow-hidden\n transition-all duration-300\n hover:shadow-md\n active:scale-95\n ").concat(n,"\n "),children:[(0,a.jsx)("div",{className:"\n absolute inset-0\n bg-gradient-to-r from-purple-500 via-pink-500 to-purple-500\n bg-size-200\n transition-all duration-500\n ".concat(h?"o
1pacity-100":"opacity-0","\n "),style:{backgroundPosition:h?"right center":"left center"}}),(0,a.jsxs)("div",{className:"relative z-10 flex items-center gap-2",children:[(0,a.jsx)(i.default,{src:"/favicons/default/favicon-192x192.png",alt:"TAGiT",width:18,height:18,className:"transition-transform duration-300"}),(0,a.jsx)("span",{className:"transition-colors duration-300 ".concat(h?"text-white":"bg-gradient-to-r from-purple-600 to-pink-600 bg-clip-text text-transparent"),children:"Share"}),h&&(0,a.jsx)(l.n,{icon:o.A,size:14,className:"text-yellow-300 animate-pulse"})]})]})]}),(0,a.jsx)(c,{isOpen:m,onClose:()=>x(!1),tagId:t,videoId:s})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"relative inline-block group",children:[(0,a.jsx)("div",{className:"\n absolute -inset-0.5 ".concat(p.container,"\n rounded-full\n bg-gradient-to-r from-purple-600 via-pink-500 to-purple-600\n opacity-75 group-hover:opacity-100\n blur-md\n bg-size-200\n animate-gradient-x\n transition-opacity duration-300\n ")}),(0,a.jsxs)("button",{onClick:()=>x(!0),onMouseEnter:()=>g(!0),onMouseLeave:()=>g(!1),className:"\n relative ".concat(p.container,"\n rounded-full\n bg-white\n flex items-center justify-center\n shadow-lg\n overflow-hidden\n transition-all duration-300\n hover:shadow-xl hover:scale-110\n active:scale-95\n ").concat(n,"\n "),title:"Share this moment","aria-label":"Share this tag",children:[(0,a.jsx)("div",{className:"\n absolute inset-0\n bg-gradient-to-r from-purple-500 via-pink-500 to-purple-500\n bg-size-200\n rounded-full\n transition-all duration-500\n ".concat(h?"opacity-100":"opacity-0","\n "),style:{backgroundPosition:h?"right center":"left center"}}),(0,a.jsx)("div",{className:"relative z-10",children:(0,a.jsx)(i.default,{src:"/favicons/default/favicon-192x192.png",alt:"TAGiT",width:p.logo,height:p.logo,className:"transition-transform duration-300 ".concat(h?"scale-110 rotate-12":"")})}),h&&(0,a.jsx)(l.n,{icon:o.A,size:12,className:"absolute -top-1 -right-1 text-yellow-300 animate-pulse z-20"})]}),h&&(0,a.jsxs)("div",{className:" absolute -bottom-9 left-1/2 -translate-x-1/2 px-3 py-1.5 rounded-xl bg-gray-900 text-white text-xs font-semibold whitespace-nowrap animate-in fade-in-0 slide-in-from-top-2 duration-200 shadow-lg z-50 ",children:["Share",(0,a.jsx)("div",{className:"absolute -top-1 left-1/2 -translate-x-1/2 w-2 h-2 bg-gray-900 rotate-45"})]})]}),(0,a.jsx)(c,{isOpen:m,onClose:()=>x(!1),tagId:t,videoId:s})]})}},87092:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>q});var a=s(95155),r=s(12115),n=s(20063),i=s(11218),l=s(67909),o=s(34256),c=s(46367),d=s(15239),u=s(90781),m=s(84383);function x(e){let{src:t,alt:s,fill:n=!1,width:i,height:l,className:o="",sizes:c,priority:x=!1,fallbackType:h="gradient"}=e,[g,p]=(0,r.useState)(!1),[f,v]=(0,r.useState)(0),[b,y]=(0,r.useState)(t);(0,r.useEffect)(()=>{p(!1),v(0),y(t)},[t]);let w=(0,r.useCallback)(()=>{if(f<2){let e="?t=".concat(Date.now());y(t.includes("?")?"".concat(t,"&_cb=").concat(Date.now()):"".concat(t).concat(e)),v(e=>e+1)}else p(!0)},[t,f]);return g?(0,a.jsx)("div",{className:"flex items-center justify-center bg-gradient-to-br from-purple-500 to-pink-500 ".concat(o),children:(0,a.jsx)(u.n,{icon:m.A,className:"text-white opacity-70",size:n?48:Math.min(i||48,l||48)/2})}):(0,a.jsx)(d.default,{src:b,alt:s,...n?{fill:!0,sizes:c||"100vw"}:{width:i||160,height:l||90},className:o,priority:x,onError:w,unoptimized:!0})}var h=s(10190),g=s(31969),p=s(6040),f=s(18606),v=s(79803),b=s(2662),y=s(18194),w=s(66573),j=s(66160),N=s(60832),S=s(76753),k=s(71919);let _=(0,k.h)("SessionList"),T=(0,l.default)(()=>s.e(7146).then(s.bind(s,47146)).then(e=>({default:e.EditSummaryModal})),{loadableGenerated:{webpack:()=>[47146]},ssr:!1,loading:()=>null}),C=(0,r.memo)(function(e){let{tag:t,session:s,tagDisplayMode:r,isFirstTag:n,isTranscriptExpanded:i,onPlayAtTimestamp:l,onEditSummary:d,onToggleTranscript:x,onDeleteTag:g}=e;return(0,a.jsxs)("div",{id:"tag-".concat(t.id),className:"bg-white/70 backdrop-blur-sm border border-gray-200/50 rounded-xl p-4 shadow-sm w-full max-w-full overflow-hidden transition-all duration-300 ".concat("grid"===r?"break-inside-avoid":""),children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between mb-3 gap-2",children:[(0,a.jsxs)(c.Cs,{variant:"primary",size:"sm",onClick:()=>l(s,t.timestamp),className:"bg-gradient-to-r from-purple-500 to-pink-500 hover:from-purple-600 hover:to-pink-600 text-white shadow-lg hover:shadow-xl transition-all duration-200 rounded-lg px-3 py-2 font-medium text-xs flex items-center gap-2",...n&&{"data-onboarding":"sessions-play-button"},children:[(0,a.jsx)(u.n,{icon:m.A,size:12}),(0,o.Ey)(t.timestamp)]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-1 flex-shrink-0 max-w-full",children:[(0,a.jsxs)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>d(t.id,t.summary,s.videoTitle,t.timestamp),className:"text-gray-500 hover:text-purple-600 hover:bg-purple-50 rounded-lg px-2 py-1 transition-colors duration-200 text-xs font-medium flex items-center gap-1",title:"Edit this tag's summary",...n&&{"data-onboarding":"sessions-edit-button"},children:[(0,a.jsx)(u.n,{icon:y.A,size:14}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Edit"})]}),(0,a.jsxs)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>x(t.id),className:"text-gray-500 hover:text-purple-600 hover:bg-purple-50 rounded-lg px-2 py-1 transition-colors duration-200 text-xs font-medium flex items-center gap-1",title:"View the raw transcript for this moment",children:[(0,a.jsx)(u.n,{icon:N.A,size:14}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Transcript"})]}),(0,a.jsxs)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>g(t.id),className:"text-gray-500 hover:text-red-600 hover:bg-red-50 rounded-lg px-2 py-1 transition-colors duration-200 text-xs font-medium flex items-center gap-1",title:"Delete this tag permanently",children:[(0,a.jsx)(u.n,{icon:p.A,size:14}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Delete"})]}),(0,a.jsx)(S.L,{tagId:t.id,videoId:s.videoId,variant:"button",size:"sm"})]})]}),(0,a.jsx)(h.qY,{contentType:"tag",contentId:t.id,fieldName:"summary",text:t.summary,className:"text-sm text-gray-700 leading-relaxed break-words markdown-summary ".concat("grid"===r?"line-clamp-4":"")}),i&&t.rawText&&(0,a.jsxs)("div",{className:"mt-3 p-3 bg-purple-50/50 rounded-lg border-l-4 border-purple-400 backdrop-blur-sm overflow-hidden",children:[(0,a.jsx)("div",{className:"flex items-center gap-2 mb-2",children:(0,a.jsxs)("span",{className:"text-xs font-medium text-purple-700",children:["Raw Transcript (",t.rawText.length," chars)"]})}),(0,a.jsx)("p",{className:"text-xs text-gray-600 font-mono leading-relaxed max-h-32 overflow-y-auto bg-white/80 rounded p-2 border border-purple-100 break-words overflow-x-auto",children:t.rawText})]})]},t.id)}),E=(0,r.memo)(function(e){let{session:t,sessionIndex:s,tagDisplayMode:r,isExpanded:n,exp
1andedTranscripts:i,hasExportAccess:l,onToggleExpansion:d,onPlayAtTimestamp:m,onEditSummary:h,onToggleTranscript:g,onDeleteTag:y,onDeleteSession:w,onExportSession:j}=e,N=n?t.tags:t.tags.slice(0,3);return(0,a.jsx)(c.KR,{id:"session-".concat(t.id),className:"p-4 sm:p-6 overflow-hidden w-full max-w-full",children:(0,a.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between w-full",children:(0,a.jsxs)("div",{className:"flex-1 min-w-0 mb-4 sm:mb-0",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center space-y-3 sm:space-y-0 sm:space-x-3 mb-3",children:[t.thumbnailUrl&&(0,a.jsx)("div",{className:"relative w-full sm:w-40 aspect-video rounded-lg overflow-hidden bg-gray-100 flex-shrink-0",children:(0,a.jsx)(x,{src:t.thumbnailUrl,alt:t.videoTitle,fill:!0,className:"object-cover",sizes:"(max-width: 640px) 100vw, 160px",priority:0===s})}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 flex items-start justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("h3",{className:"text-lg font-medium text-gray-800 break-words line-clamp-2",children:t.videoTitle}),(0,a.jsxs)("p",{className:"text-sm text-gray-600 break-words",children:[t.channelName," ⢠",t.tags.length," tag",1!==t.tags.length?"s":""]}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:(0,o.Dq)(t.createdAt)})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 flex-shrink-0",children:[(0,a.jsx)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>j(t),className:"rounded-lg p-2.5 transition-all duration-200 border shadow-sm hover:shadow-md ".concat(l?"text-gray-400 hover:text-blue-600 hover:bg-blue-50 border-gray-200 hover:border-blue-300":"text-gray-300 cursor-not-allowed opacity-50 border-gray-100"),title:l?"Export entire session":"Export available for Pro subscribers and trial users",children:(0,a.jsx)(u.n,{icon:f.A,size:16})}),(0,a.jsx)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>w(t.id),className:"text-gray-400 hover:text-purple-600 hover:bg-purple-50 rounded-lg p-2.5 transition-all duration-200 border border-gray-200 hover:border-purple-300 shadow-sm hover:shadow-md",title:"Delete entire session and all tags",children:(0,a.jsx)(u.n,{icon:p.A,size:16})})]})]})]}),(0,a.jsxs)("div",{className:"space-y-3 w-full",children:[(0,a.jsx)("div",{className:"grid"===r?"grid gap-4 md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-3":"space-y-3",children:N.map((e,n)=>(0,a.jsx)(C,{tag:e,session:t,tagDisplayMode:r,isFirstTag:0===s&&0===n,isTranscriptExpanded:i.has(e.id),onPlayAtTimestamp:m,onEditSummary:h,onToggleTranscript:g,onDeleteTag:y},e.id))}),t.tags.length>3&&(0,a.jsx)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>d(t.id),className:"w-full text-gray-500 hover:text-gray-700 hover:bg-gray-50 rounded-lg py-3 justify-center transition-colors duration-200",children:n?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.n,{icon:b.A,size:16,className:"mr-2"}),"Show less"]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.n,{icon:v.A,size:16,className:"mr-2"}),"Show ",t.tags.length-3," more tag",t.tags.length-3!=1?"s":""]})})]})]})})})});function z(e){let{sessions:t,onSessionUpdate:n,filterSessionId:i,highlightTagId:l}=e,{confirm:d,ConfirmationModal:x}=(0,c.ZK)(),{showUpgrade:p,UpgradeModal:f}=(0,c.vf)(),{hasExportAccess:v}=(0,g.R)(),[b,y]=(0,r.useState)(new Set),[N,S]=(0,r.useState)(new Set),[k,C]=(0,r.useState)("centered"),[z,A]=(0,r.useState)(!1),[I,L]=(0,r.useState)(!1),[F,P]=(0,r.useState)(null),R=(0,r.useMemo)(()=>t.flatMap(e=>e.tags.map(e=>e.id)),[t]);(0,h.in)({contentType:"tag",contentIds:R,enabled:R.length>0}),(0,r.useEffect)(()=>{D();let e=()=>{let e=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),t=window.innerWidth<768;L(e||t)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]),(0,r.useEffect)(()=>{if(i&&t.length>0){let e=t.find(e=>e.id===i||e.videoId===i);if(e){y(new Set([e.id]));let t=0,s=()=>{if(t++,!(()=>{if(l){let e=document.getElementById("tag-".concat(l));if(e)return e.scrollIntoView({behavior:"smooth",block:"center"}),e.classList.add("ring-2","ring-purple-500","ring-offset-2"),setTimeout(()=>{e.classList.remove("ring-2","ring-purple-500","ring-offset-2")},3e3),!0}return!1})())if(t<10)setTimeout(s,100);else{let t=document.getElementById("session-".concat(e.id));t&&t.scrollIntoView({behavior:"smooth",block:"start"})}};setTimeout(s,100)}}},[i,l,t]);let D=()=>{try{let e="true"===localStorage.getItem("ivct-extension-active"),t=localStorage.getItem("ivct-last-activity");if(e&&t){let e=new Date(t),s=new Date(Date.now()-3e5);if(e>s)return void A(!0)}A(!1);let s=!1,a=e=>{var t;(null==(t=e.data)?void 0:t.type)==="IVCT_EXTENSION_PONG"&&"ivct-extension"===e.data.source&&(s=!0,A(!0),window.removeEventListener("message",a))};window.addEventListener("message",a),window.postMessage({type:"IVCT_DASHBOARD_PING",source:"ivct-dashboard"},"*"),setTimeout(()=>{window.removeEventListener("message",a),s||A(!1)},1500)}catch(e){_.debug("Extension detection failed:",e),A(!1)}},M=(0,r.useCallback)(e=>{y(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]),O=(0,r.useCallback)(e=>{S(t=>{let s=new Set(t);return s.has(e)?s.delete(e):s.add(e),s})},[]);(0,r.useCallback)(e=>{let t=(0,o.D3)(e.videoId);if(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){let e=document.createElement("a");e.href=t,e.target="_blank",e.click()}else window.open(t,"_blank")},[]);let U=(0,r.useCallback)((e,t)=>{let s=(0,o.D3)(e.videoId,t);if(/iPhone|iPad|iPod|Android/i.test(navigator.userAgent)){let e=document.createElement("a");e.href=s,e.target="_blank",e.click()}else window.open(s,"_blank")},[]),B=(0,r.useCallback)(e=>{d({title:"Delete Session",message:"Are you sure you want to delete this session and all its tags? This action cannot be undone.",confirmText:"Delete Session",variant:"danger",onConfirm:async()=>{try{let{ApiClient:t}=await s.e(344).then(s.bind(s,80344));await t.deleteSession(e),n()}catch(e){_.error("Failed to delete session:",e),alert("Failed to delete session")}}})},[d,n]),K=(0,r.useCallback)(e=>{d({title:"Delete Tag",message:"Are you sure you want to delete this tag? This action cannot be undone.",confirmText:"Delete Tag",variant:"danger",onConfirm:async()=>{try{let{ApiClient:t}=await s.e(344).then(s.bind(s,80344));await t.deleteTag(e),n()}catch(e){_.error("Failed to delete tag:",e),alert("Failed to delete tag")}}})},[d,n]),Q=(0,r.useCallback)(async e=>{if(!v())return void p({title:"Unlock Export Feature",message:"Export feature is available for Pro subscribers only.",feature:"Pro Feature",upgradeText:"Upgrade Plan",cancelText:"OK",onUpgrade:()=>{window.location.href="/subscription"}});try{let{ExportService:t}=await s.e(158).then(s.bind(s,80158));await t.exportSession(e,{format:"pdf",includeFlashcards:!0,includeTimestamps:!0,includeTranscripts:!0})}catch(e){_.error("Failed to export session:",e),alert("Failed to export session")}},[v,p]);(0,r.useCallback)(async(e,t,a)=>{if(!v())return void p({title:"Unlock Export Feature",message:"Export feature is available for Pro subscribers only.",feature:"Pro Feature",upgradeText:"Upgrade Plan",cancelText:"OK",onUpgrade:()=>{window.location.href="/subscription"}});try{let{ExportService:r}=await s.e(158).then(s.bind(s,80158));await r.exportTag(e,t,a,{format:"pdf",includeFlashcards:!0,includeTimestamps:!0,includeTranscripts:!1})}catch(e){_.error("Failed to export tag:",e),alert("Failed to export tag")}},[v,p]);let V=(0,r.useCallback)((e,t,s,a)=>{P({isOpen:!0,tagId:e,summary:t,videoTitle:s,timestamp:(0,o.Ey)(a)})},[]),G=async e=>{if(F)try{let{ApiClient:t}=await s.e(344).then(s.bind(s,80344));await t.updateTag(F.tagId,{summary:e}),n()}catch(e){throw _.error("Failed to update summary:",e),e}};return 0===t.length?(0,a.jsx)(c.KR,{className:"p-12 text-center",children:(0,a.jsxs)("div",{className:"text-gray-500",children:[(0,a.jsx)(u.n,{icon:m.A,size:48,className:"mx-auto mb-4 opacity-50"}),(0,a.jsx)("h3",{className:"text-lg font-medium mb-2",children:"Your video sessions will appear here"}
1),(0,a.jsx)("p",{className:"text-sm mb-6",children:z?"Start tagging moments on YouTube to create your first session":I?"Open TAGiT on desktop to install the extension and start tagging YouTube videos":"Install the TAGiT extension and start tagging moments on YouTube to create your first session"}),(0,a.jsxs)("div",{className:"flex gap-3 justify-center",children:[!z&&!I&&(0,a.jsx)(c.Cs,{variant:"primary",size:"sm",onClick:()=>window.open("https://chromewebstore.google.com/detail/tagit-video-bookmarking-a/bdicikdkiobadnneahpfpgmbgchppnfn","_blank"),children:"Install Extension"}),(0,a.jsx)(c.Cs,{variant:z?"primary":"secondary",size:"sm",onClick:()=>window.open("https://youtube.com","_blank"),children:"Open YouTube"})]})]})}):(0,a.jsxs)("div",{className:"space-y-6 overflow-x-hidden",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between ".concat("centered"===k?"max-w-4xl mx-auto":""),children:[(0,a.jsx)("h3",{className:"text-lg font-semibold text-gray-800",children:"Tag Display"}),(0,a.jsx)("div",{className:"flex items-center space-x-1 bg-white rounded-lg border border-gray-200 p-1 shadow-sm",children:["centered","grid"].map(e=>(0,a.jsxs)(c.Cs,{variant:k===e?"primary":"ghost",size:"sm",onClick:()=>C(e),className:"px-3 py-2 rounded-md transition-all duration-200 ".concat(k===e?"bg-gradient-to-r from-purple-500 to-pink-500 text-white shadow-md":"text-gray-600 hover:text-gray-800 hover:bg-gray-100"),children:["centered"===e?(0,a.jsx)(u.n,{icon:j.A,size:16,className:"mr-1"}):(0,a.jsx)(u.n,{icon:w.A,size:16,className:"mr-1"}),(0,a.jsx)("span",{className:"text-xs font-medium capitalize",children:e})]},e))})]}),(0,a.jsx)("div",{className:"centered"===k?"max-w-4xl mx-auto space-y-4":"space-y-4",children:t.map((e,t)=>(0,a.jsx)(E,{session:e,sessionIndex:t,tagDisplayMode:k,isExpanded:b.has(e.id),expandedTranscripts:N,hasExportAccess:v(),onToggleExpansion:M,onPlayAtTimestamp:U,onEditSummary:V,onToggleTranscript:O,onDeleteTag:K,onDeleteSession:B,onExportSession:Q},e.id))}),(0,a.jsx)(x,{}),(0,a.jsx)(f,{}),F&&(0,a.jsx)(T,{isOpen:F.isOpen,onClose:()=>{P(null)},onSave:G,initialSummary:F.summary,videoTitle:F.videoTitle,timestamp:F.timestamp})]})}var A=s(13579),I=s(32407),L=s(58991),F=s(92804),P=s(5088),R=s(14129),D=s(93928);function M(e,t){let s={};for(let a in t){let r=t[a],n=e.get(r.paramName);s[a]=r.deserialize(n)}return s}function O(e,t){let s=new URLSearchParams;for(let a in t){let r=t[a],n=r.serialize(e[a]);null!==n&&""!==n&&s.set(r.paramName,n)}return s}var U=s(70883);let B=(0,k.h)("SearchFilters"),K={fields:{searchQuery:{paramName:"q",defaultValue:"",serialize:e=>e||null,deserialize:e=>e||""},dateRange:{paramName:"date",defaultValue:"all",serialize:e=>"all"===e?null:e,deserialize:e=>e||"all"},sortBy:{paramName:"sort",defaultValue:"newest",serialize:e=>"newest"===e?null:e,deserialize:e=>e||"newest"},videoSource:{paramName:"channel",defaultValue:"all",serialize:e=>"all"===e?null:e,deserialize:e=>e||"all"}},debounceMs:400};function Q(e){let{displayedCount:t,totalCount:s,onFiltersChange:i}=e,[l,o]=(0,r.useState)(!1),{filtersFromUrl:d,updateUrl:m,clearUrl:x,hasActiveFilters:h}=function(e){let t=(0,n.useRouter)(),s=(0,n.usePathname)(),a=(0,n.useSearchParams)(),{fields:i,debounceMs:l=300}=e,o=(0,r.useRef)(null),c=(0,r.useRef)(function(e){let t={};for(let s in e)t[s]=e[s].defaultValue;return t}(i)),d=M(a,i),u=Object.keys(i).some(e=>{var t,s;return t=d[e],s=c.current[e],"object"==typeof t&&null!==t?JSON.stringify(t)!==JSON.stringify(s):t!==s}),m=(0,r.useCallback)(e=>{o.current&&clearTimeout(o.current),o.current=setTimeout(()=>{let r=O({...M(a,i),...e},i).toString(),n=r?"".concat(s,"?").concat(r):s;t.replace(n,{scroll:!1})},l)},[a,i,s,t,l]),x=(0,r.useCallback)(e=>{o.current&&clearTimeout(o.current);let a=O(e,i).toString(),r=a?"".concat(s,"?").concat(a):s;t.replace(r,{scroll:!1})},[i,s,t]),h=(0,r.useCallback)(()=>{o.current&&clearTimeout(o.current),t.replace(s,{scroll:!1})},[s,t]);return(0,r.useEffect)(()=>()=>{o.current&&clearTimeout(o.current)},[]),{filtersFromUrl:d,updateUrl:m,replaceUrl:x,clearUrl:h,hasActiveFilters:u}}(K),[g,p]=(0,r.useState)(()=>d),f=(0,r.useRef)(!1),v=e=>{p(e),i(e),m(e)};(0,r.useEffect)(()=>{!f.current&&(f.current=!0,h&&i(d))},[]),(0,r.useEffect)(()=>{h&&!l&&o(!0)}
1,[h]);let[b,y]=(0,r.useState)([]),[w,j]=(0,r.useState)([]),[N,S]=(0,r.useState)(!1),[k,_]=(0,r.useState)("");(0,r.useEffect)(()=>{(async()=>{try{var e,t;let s=localStorage.getItem(U.Xn.GUEST_USER_ID),a=s?"/api/sessions/channels?guestUserId=".concat(encodeURIComponent(s)):"/api/sessions/channels",r=await fetch(a),n=await r.json();(null==(e=n.data)?void 0:e.allChannels)&&(null==(t=n.data)?void 0:t.topChannels)&&(y(n.data.allChannels),j(n.data.topChannels))}catch(e){B.error("Failed to fetch channels:",e)}})()},[]);let T=(0,r.useMemo)(()=>{if(!k)return b;let e=k.toLowerCase();return b.filter(t=>t.toLowerCase().includes(e))},[b,k]),C=(0,r.useMemo)(()=>N?k?T:b:w,[N,k,T,b,w]),E=g.searchQuery||"all"!==g.dateRange||"newest"!==g.sortBy||"all"!==g.videoSource;return(0,a.jsxs)(c.KR,{className:"p-4 mb-6","data-onboarding":"sessions-search",children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3 mb-4",children:[(0,a.jsx)("div",{className:"flex-1",children:(0,a.jsx)(A.I,{value:g.searchQuery,onChange:e=>v({...g,searchQuery:e}),placeholder:"Search sessions, summaries, or transcripts..."})}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsxs)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>o(!l),className:"flex items-center gap-2",children:[(0,a.jsx)(u.n,{icon:L.A,size:16}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Filters"}),E&&(0,a.jsx)("span",{className:"w-2 h-2 bg-purple-500 rounded-full"})]}),E&&(0,a.jsxs)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>{let e={searchQuery:"",dateRange:"all",sortBy:"newest",videoSource:"all"};p(e),i(e),x()},className:"text-gray-500 hover:text-gray-700",children:[(0,a.jsx)(u.n,{icon:F.A,size:16}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Clear"})]})]})]}),l&&(0,a.jsx)("div",{className:"border-t border-gray-200 pt-4 space-y-4",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 mb-2",children:[(0,a.jsx)(u.n,{icon:P.A,size:14}),"Date Range"]}),(0,a.jsx)(I.b,{value:g.dateRange,onChange:e=>v({...g,dateRange:e}),options:[{value:"all",label:"All Time",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"All Time"})},{value:"today",label:"Today",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"Today"})},{value:"week",label:"Last Week",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"Last Week"})},{value:"month",label:"Last Month",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"Last Month"})}]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 mb-2",children:[(0,a.jsx)(u.n,{icon:D.A,size:14}),"Sort By"]}),(0,a.jsx)(I.b,{value:g.sortBy,onChange:e=>v({...g,sortBy:e}),options:[{value:"newest",label:"Newest First",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"Newest First"})},{value:"oldest",label:"Oldest First",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"Oldest First"})},{value:"mostTags",label:"Most Tags",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"Most Tags"})},{value:"alphabetical",label:"A-Z",render:()=>(0,a.jsx)("span",{className:"text-gray-900 font-sans",children:"A-Z"})}]})]}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm font-medium text-gray-700 mb-2",children:[(0,a.jsx)(u.n,{icon:R.A,size:14}),"Channel"]}),"all"!==g.videoSource?(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("div",{className:"flex-1 p-2 glass border border-white/30 rounded-xl text-sm text-gray-900 font-sans bg-purple-50",children:g.videoSource}),(0,a.jsx)(c.Cs,{variant:"ghost",size:"sm",onClick:()=>v({...g,videoSource:"all"}),className:"flex-shrink-0",children:(0,a.jsx)(u.n,{icon:F.A,size:16})})]}):(0,a.jsxs)("div",{className:"space-y-2",children:[(N||b.length>10)&&(0,a.jsx)("input",{type:"text",value:k,onChange:e=>{_(e.target.value),e.target.value&&!N&&S(!0)},placeholder:"Search channels...",className:"w-full p-2 glass border border-white/30 rounded-xl text-sm text-gray-900 font-sans focus:outline-none focus:ring-2 focus:ring-purple-400"}),(0,a.jsx)("div",{className:"max-h-48 overflow-y-auto border border-white/30 rounded-xl glass",children:C.length>0?C.map(e=>(0,a.jsx)("button",{onClick:()=>{v({...g,videoSource:e}),_(""),S(!1)},className:"w-full text-left p-2 text-sm text-gray-900 font-sans hover:bg-purple-50 transition-colors",children:e},e)):(0,a.jsx)("div",{className:"p-4 text-center text-sm text-gray-500",children:"No channels found"})}),!N&&b.length>10&&(0,a.jsxs)("button",{onClick:()=>S(!0),className:"w-full text-center p-2 text-sm text-purple-600 font-medium hover:text-purple-700 transition-colors",children:["Show all ",b.length," channels"]})]})]})]})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between text-sm text-gray-600 mt-4 space-y-2 sm:space-y-0",children:[(0,a.jsxs)("span",{children:["Showing ",t," of ",s," video sessions"]}),E&&(0,a.jsx)("div",{className:"flex items-center gap-2",children:(0,a.jsxs)("span",{className:"text-purple-600",children:[Object.entries(g).filter(e=>{let[t,s]=e;return"searchQuery"!==t&&"all"!==s&&"newest"!==s}).length+ +!!g.searchQuery," filters active"]})})]})]})}var V=s(29338);let G=(0,k.h)("page");
1function Y(){let e=(0,n.useSearchParams)(),[t,s]=(0,r.useState)([]),[l,o]=(0,r.useState)(0),[c,d]=(0,r.useState)(!1),[u,m]=(0,r.useState)(!0),[x,h]=(0,r.useState)(0),[g,p]=(0,r.useState)(!0),[f,v]=(0,r.useState)({searchQuery:"",dateRange:"all",sortBy:"newest",videoSource:"all"}),[b,y]=(0,r.useState)(null),[w,j]=(0,r.useState)(null),N=(0,r.useRef)(!1),S=(0,r.useRef)(!1),k=(0,r.useRef)(f),_=(0,r.useRef)(0),T=(0,r.useRef)(!0);(0,r.useEffect)(()=>{let t=e.get("filterSessionId"),s=e.get("tagId");y(t),j(s),s&&!t&&fetch("/api/tags/".concat(s)).then(e=>e.json()).then(e=>{var t,s;(null==(s=e.data)||null==(t=s.tag)?void 0:t.videoId)&&y(e.data.tag.videoId)}).catch(e=>G.error("Failed to fetch tag for navigation:",e))},[e]),(0,r.useEffect)(()=>{k.current=f},[f]),(0,r.useEffect)(()=>{_.current=x},[x]),(0,r.useEffect)(()=>{T.current=u},[u]);let C=(0,r.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;if(N.current||!e&&!T.current)return;let a=t||k.current;N.current=!0,d(!0);try{var r,n,i,l,c;let t=e?0:_.current,d=localStorage.getItem(U.Xn.GUEST_USER_ID),u=new URLSearchParams;u.set("limit","10"),u.set("offset",t.toString()),d&&u.set("guestUserId",d),a.searchQuery&&u.set("searchQuery",a.searchQuery),a.dateRange&&"all"!==a.dateRange&&u.set("dateRange",a.dateRange),a.videoSource&&"all"!==a.videoSource&&u.set("channel",a.videoSource),a.sortBy&&u.set("sortBy",a.sortBy);let x="/api/sessions?".concat(u.toString()),g=await fetch(x),p=await g.json(),f=(null==(r=p.data)?void 0:r.sessions)||[],v=null!=(l=null==(n=p.data)?void 0:n.hasMore)&&l,b=null!=(c=null==(i=p.data)?void 0:i.totalCount)?c:0;e?(s(f),h(10),_.current=10):(s(e=>[...e,...f]),h(e=>e+10),_.current=_.current+10),o(b),m(v),T.current=v}catch(e){G.error("Failed to load sessions:",e),m(!1)}finally{d(!1),N.current=!1,p(!1)}},[]);(0,r.useEffect)(()=>{S.current||(S.current=!0,C(!0))},[]);let E=(0,r.useCallback)(e=>{v(e),m(!0),h(0),k.current=e,T.current=!0,_.current=0,C(!0,e)},[C]);(0,r.useEffect)(()=>{let e=()=>{window.innerHeight+window.scrollY>=document.documentElement.scrollHeight-500&&T.current&&!N.current&&C(!1)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[C]);let A=(0,r.useCallback)(async()=>{m(!0),h(0),C(!0)},[C]);return(0,a.jsx)(i.A,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold bg-gradient-to-r from-purple-600 to-pink-600 bg-clip-text text-transparent mb-2",children:"Tags"}),(0,a.jsx)("p",{className:"text-gray-700",children:"Manage your tagged video sessions"})]}),g&&c?(0,a.jsx)(V.kL,{}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(Q,{displayedCount:t.length,totalCount:l,onFiltersChange:E}),(0,a.jsx)(z,{sessions:b?t.filter(e=>e.id===b||e.videoId===b):t,onSessionUpdate:A,filterSessionId:b,highlightTagId:w}),c&&!g&&(0,a.jsxs)("div",{className:"py-8 text-center",children:[(0,a.jsx)("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-purple-600 border-r-transparent"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:"Loading more sessions..."})]}),!u&&t.length>0&&(0,a.jsx)("div",{className:"py-8 text-center text-sm text-gray-500",children:"You've reached the end of your sessions"})]})]})})}function q(){return(0,a.jsx)(r.Suspense,{fallback:(0,a.jsx)(i.A,{children:(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-3xl font-bold bg-gradient-to-r from-purple-600 to-pink-600 bg-clip-text text-transparent mb-2",children:"Tags"}),(0,a.jsx)("p",{className:"text-gray-700",children:"Loading sessions..."})]}),(0,a.jsx)(V.kL,{})]})}),children:(0,a.jsx)(Y,{})})}}},e=>{e.O(0,[1356,2687,8284,3759,4351,8345,7623,5415,6676,4256,9296,1218,8441,6624,7358],()=>e(e.s=42109)),_N_E=e.O()}]);
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.