(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,290449,e=>{"use strict";var t=e.i(751931);let a=(0,t.atom)(void 0),i=(0,t.atom)(void 0),l=(0,t.atom)(void 0);(0,t.atom)(void 0),e.s(["jwPlayerPlaylistIdAtom",0,i,"selectedPlaylistIdAtom",0,a,"selectedVideoAtom",0,l])},939899,(e,t,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.getCollectionById=s;let i=e.r(718043),l=e.r(678651),r=e.r(414655);async function s(e,t){let a=t?t.split("-").join("_"):"en_US",s=(0,l.urlFrom)((0,i.getCMSCollectionsUrlConfig)({collectionId:e,locale:a})),n=await fetch(s,{headers:{"Accept-Encoding":"gzip"},next:{revalidate:300,tags:[e]}});return(0,r.handleFetchResponse)(n)}},952234,e=>{"use strict";var t=e.i(297647),a=e.i(477716),i=e.i(514514);let l=(0,i.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),r=(0,i.default)("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);var s=e.i(475566),n=e.i(777430),o=e.i(484758),d=e.i(617843),c=e.i(33078),u=e.i(528600),m=e.i(877957),p=e.i(368847),f=e.i(290449),h=e.i(914146),v=e.i(909232),x=e.i(240058),b=e.i(155879),g=e.i(436028),y=e.i(37429),w=e.i(632137);let j={timeAgo:!0,daysFromNow:5,showFullTime:!1,locale:"en-US",timeZone:"America/New_York"},N=({authors:e,externalAuthors:i,updateDate:l,variant:r})=>{if(!(0,g.hasLength)(e)&&!i&&!l)return null;let s=((e,t=j)=>{if(!e)return null;let{timeAgo:a,daysFromNow:i,showFullTime:l,locale:r,timeZone:s}={...j,...t},n=new Date(e),o=new Date;if(a){let e=o.getTime()-n.getTime(),t=Math.ceil(e/36e5),a=Math.ceil(e/864e5);if(t{let t=e.profilePicture;if((0,b.isImageObject)(t))return t}).filter(e=>void 0!==e):[],o=32+(n.length-1)*16,d=n.length>0&&"noAuthorImages"!==r;return(0,t.jsxs)("div",{className:"flex items-center pt-2 pb-4","data-testid":"authors-container",children:[d&&(0,t.jsx)("div",{className:(0,w.cn)("mr-2 flex -space-x-4"),style:{minWidth:`${o}px`},"data-testid":"author-images-container",children:n.map((a,i)=>a?.url?(0,t.jsx)(y.default,{width:32,height:32,src:a.url,alt:`${e?.[i]?.firstName||""} ${e?.[i]?.lastName||""}`,className:"flatplan_authorImage my-0 h-8 w-8 rounded-full border-2 border-white object-cover",style:{zIndex:n.length-i},"data-flatplan-id":"flatplan_authorImage","data-testid":`author-image-${i}`,objectFit:"cover"},i):null)}),(0,t.jsxs)("div",{className:"inline","data-testid":"author-text-container",children:[((0,g.hasLength)(e)||i)&&(0,t.jsx)(p.default,{variant:"Body.S",className:"mr-1 inline leading-[1rem]","data-testid":"by-text",elementType:"span",children:"By"}),(0,g.hasLength)(e)&&e.map((i,l)=>{if("object"==typeof i&&null!==i){let r=`${i.firstName} ${i.lastName}`,s=l===e.length-1,n=l===e.length-2;return(0,t.jsxs)(a.default.Fragment,{children:[i?.bioUrl?(0,t.jsx)(x.default,{href:i.bioUrl,"data-testid":`author-link-${l}`,children:(0,t.jsx)(p.default,{className:"flatplan_authorName inline leading-[1rem] underline",variant:"Body.S",elementType:"span","data-flatplan-id":"flatplan_authorName","data-testid":`author-name-linked-${l}`,children:r})}):(0,t.jsx)(p.default,{className:"flatplan_authorName inline leading-[1rem]",variant:"Body.S",elementType:"span","data-flatplan-id":"flatplan_authorName","data-testid":`author-name-${l}`,children:r}),!s&&(0,t.jsx)(p.default,{variant:"Body.S",elementType:"span",className:`inline leading-[1rem] ${n?"mx-1":"mr-1"}`,"data-testid":`author-separator-${l}`,children:n?"and":","})]},i.id)}return null}),i&&(0,t.jsx)(p.default,{variant:"Body.S",elementType:"span",className:`inline leading-[1rem] ${(0,g.hasLength)(e)?"ml-1":""}`,"data-testid":"external-authors",children:(0,g.hasLength)(e)?`, ${i}`:i}),s&&(0,t.jsxs)("span",{className:"whitespace-nowrap",children:[((0,g.hasLength)(e)||i)&&(0,t.jsx)(p.default,{variant:"Body.S",elementType:"span",color:"secondary",className:"mx-1 inline leading-[1rem]","data-testid":"date-separator",children:"•"}),(0,t.jsx)(p.default,{variant:"Body.S",elementType:"span",color:"secondary",className:"inline leading-[1rem] whitespace-nowrap","data-testid":"update-date",children:s})]})]})]})};var A=e.i(135740),I=e.i(49893);let C=({videos:e,className:i,autoplay:x=!0,showControls:b=!0,showTitle:g=!0,showDescription:y=!0,aspectRatio:w="16:9",playerId:j="QidSYgAw",placeHolder:C})=>{let[S,k]=(0,s.useAtom)(f.selectedVideoAtom),P=(0,s.useAtomValue)(f.selectedPlaylistIdAtom),T=(0,v.useClientMobileMedia)(),_=`video-player-${(0,a.useId)()}`,F=(0,a.useRef)(!0),D=(0,u.useUser)()?.user||{},E=(0,s.useAtomValue)(I.adsKillswitchAtom),R=D.isUserPremium||E,M=(0,c.useTrackVideoEvent)(),[B,$]=(0,a.useState)(!1),L=(0,a.useRef)(S?.mediaid);(0,a.useEffect)(()=>{L.current=S?.mediaid},[S]);let V=(0,a.useCallback)(({event:e,player:t})=>{let a=e.item;L.current!==a?.mediaid&&(k(a),window.history.pushState({playlistId:P,videoId:a.mediaid},"",a.link||""))},[P,k]),H=(0,a.useCallback)(({player:e})=>{let t=window?.ns_?.StreamingAnalytics?.JWPlayer;t&&t(e,{publisherId:"9576127"})},[]);if(!S)return null;let U=[...o.adEvents,...d.metricEvents,{eventName:"playlistItem",callback:V},{eventName:"ready",callback:H}].map(({eventName:e,callback:t})=>({eventName:e,callback:({event:e,player:a})=>t({event:e,player:a,isFirstPlayRef:F,user:D,trackVideoEvent:M,isMobile:T})}));return(0,t.jsxs)("div",{className:i,children:[(0,t.jsx)("div",{className:"mb-4 overflow-hidden md:rounded-b-lg",children:(0,t.jsx)(n.JWPlayer,{playlist:e,events:U,options:{aspectratio:w,autostart:x,controls:b,displaytitle:!1,displaydescription:!1,width:"100%"},setupParams:{playerId:j,ads:!R},placeHolder:C},_)}),(0,t.jsxs)("div",{className:"@container mx-4 my-4 md:mx-0",children:[g&&S?.title&&(0,t.jsx)(p.default,{variant:"Title.XL",className:"mb-2",children:S?.title}),S?.custom?.publishDate&&(0,t.jsx)(N,{authors:S?.custom?.authors,externalAuthors:S?.custom?.externalAuthors,updateDate:S?.custom?.publishDate}),y&&S?.description&&(0,t.jsx)(p.default,{variant:"Body.M",className:"mb-4",children:(0,t.jsx)("span",{dangerouslySetInnerHTML:{__html:S?.description}})}),(0,t.jsxs)("div",{className:"flex flex-col gap-2 @md:flex-row",children:[S?.custom?.transcript&&(0,t.jsxs)(m.Button,{className:"flex items-center text-sm font-medium",variant:"outline",onClick:()=>$(!B),children:["Transcript"," ",B?(0,t.jsx)(r,{className:"ml-1 h-4 w-4"}):(0,t.jsx)(l,{className:"ml-1 h-4 w-4"})]}),(0,t.jsx)(A.ViewCommentsButton,{articleId:S?.mediaid||"",isMobile:T}),(0,t.jsx)(h.Share,{type:"video",title:S.title||"",imageUrl:S.image})]}),B&&S?.custom?.transcript&&(0,t.jsx)("div",{className:"mt-4 rounded-lg bg-[#F4F4F4] p-4",children:(0,t.jsx)("p",{className:"text-sm text-gray-700",children:S?.custom.transcript})})]})]})};var S=e.i(538107),k=e.i(381477),P=e.i(291967),T=e.i(156207),_=e.i(357784),F=e.i(144977),D=e.i(461194),E=e.i(556872),R=e.i(252960),M=e.i(534643),B=e.i(770460),$="rovingFocusGroup.onEntryFocus",L={bubbles:!1,cancelable:!0},V="RovingFocusGroup",[H,U,K]=(0,_.createCollection)(V),[z,O]=(0,T.createContextScope)(V,[K]),[W,G]=z(V),q=a.forwardRef((e,a)=>(0,t.jsx)(H.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(H.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,t.jsx)(Z,{...e,ref:a})})}));q.displayName=V;var Z=a.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:l,orientation:r,loop:s=!1,dir:n,currentTabStopId:o,defaultCurrentTabStopId:d,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:m=!1,...p}=e,f=a.useRef(null),h=(0,F.useComposedRefs)(i,f),v=(0,B.useDirection)(n),[x,b]=(0,M.useControllableState)({prop:o,defaultProp:d??null,onChange:c,caller:V}),[g,y]=a.useState(!1),w=(0,R.useCallbackRef)(u),j=U(l),N=a.useRef(!1),[A,I]=a.useState(0);return a.useEffect(()=>{let e=f.current;if(e)return e.addEventListener($,w),()=>e.removeEventListener($,w)},[w]),(0,t.jsx)(W,{scope:l,orientation:r,dir:v,loop:s,currentTabStopId:x,onItemFocus:a.useCallback(e=>b(e),[b]),onItemShiftTab:a.useCallback(()=>y(!0),[]),onFocusableItemAdd:a.useCallback(()=>I(e=>e+1),[]),onFocusableItemRemove:a.useCallback(()=>I(e=>e-1),[]),children:(0,t.jsx)(E.Primitive.div,{tabIndex:g||0===A?-1:0,"data-orientation":r,...p,ref:h,style:{outline:"none",...e.style},onMouseDown:(0,P.composeEventHandlers)(e.onMouseDown,()=>{N.current=!0}),onFocus:(0,P.composeEventHandlers)(e.onFocus,e=>{let t=!N.current;if(e.target===e.currentTarget&&t&&!g){let t=new CustomEvent($,L);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=j().filter(e=>e.focusable);Q([e.find(e=>e.active),e.find(e=>e.id===x),...e].filter(Boolean).map(e=>e.ref.current),m)}}N.current=!1}),onBlur:(0,P.composeEventHandlers)(e.onBlur,()=>y(!1))})})}),J="RovingFocusGroupItem",X=a.forwardRef((e,i)=>{let{__scopeRovingFocusGroup:l,focusable:r=!0,active:s=!1,tabStopId:n,children:o,...d}=e,c=(0,D.useId)(),u=n||c,m=G(J,l),p=m.currentTabStopId===u,f=U(l),{onFocusableItemAdd:h,onFocusableItemRemove:v,currentTabStopId:x}=m;return a.useEffect(()=>{if(r)return h(),()=>v()},[r,h,v]),(0,t.jsx)(H.ItemSlot,{scope:l,id:u,focusable:r,active:s,children:(0,t.jsx)(E.Primitive.span,{tabIndex:p?0:-1,"data-orientation":m.orientation,...d,ref:i,onMouseDown:(0,P.composeEventHandlers)(e.onMouseDown,e=>{r?m.onItemFocus(u):e.preventDefault()}),onFocus:(0,P.composeEventHandlers)(e.onFocus,()=>m.onItemFocus(u)),onKeyDown:(0,P.composeEventHandlers)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void m.onItemShiftTab();if(e.target!==e.currentTarget)return;let t=function(e,t,a){var i;let l=(i=e.key,"rtl"!==a?i:"ArrowLeft"===i?"ArrowRight":"ArrowRight"===i?"ArrowLeft":i);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(l))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(l)))return Y[l]}(e,m.orientation,m.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let l=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)l.reverse();else if("prev"===t||"next"===t){var a,i;"prev"===t&&l.reverse();let r=l.indexOf(e.currentTarget);l=m.loop?(a=l,i=r+1,a.map((e,t)=>a[(i+t)%a.length])):l.slice(r+1)}setTimeout(()=>Q(l))}}),children:"function"==typeof o?o({isCurrentTabStop:p,hasTabStop:null!=x}):o})})});X.displayName=J;var Y={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function Q(e,t=!1){let a=document.activeElement;for(let i of e)if(i===a||(i.focus({preventScroll:t}),document.activeElement!==a))return}var ee=e.i(653747),et="Tabs",[ea,ei]=(0,T.createContextScope)(et,[O]),el=O(),[er,es]=ea(et),en=a.forwardRef((e,a)=>{let{__scopeTabs:i,value:l,onValueChange:r,defaultValue:s,orientation:n="horizontal",dir:o,activationMode:d="automatic",...c}=e,u=(0,B.useDirection)(o),[m,p]=(0,M.useControllableState)({prop:l,onChange:r,defaultProp:s??"",caller:et});return(0,t.jsx)(er,{scope:i,baseId:(0,D.useId)(),value:m,onValueChange:p,orientation:n,dir:u,activationMode:d,children:(0,t.jsx)(E.Primitive.div,{dir:u,"data-orientation":n,...c,ref:a})})});en.displayName=et;var eo="TabsList",ed=a.forwardRef((e,a)=>{let{__scopeTabs:i,loop:l=!0,...r}=e,s=es(eo,i),n=el(i);return(0,t.jsx)(q,{asChild:!0,...n,orientation:s.orientation,dir:s.dir,loop:l,children:(0,t.jsx)(E.Primitive.div,{role:"tablist","aria-orientation":s.orientation,...r,ref:a})})});ed.displayName=eo;var ec="TabsTrigger",eu=a.forwardRef((e,a)=>{let{__scopeTabs:i,value:l,disabled:r=!1,...s}=e,n=es(ec,i),o=el(i),d=ef(n.baseId,l),c=eh(n.baseId,l),u=l===n.value;return(0,t.jsx)(X,{asChild:!0,...o,focusable:!r,active:u,children:(0,t.jsx)(E.Primitive.button,{type:"button",role:"tab","aria-selected":u,"aria-controls":c,"data-state":u?"active":"inactive","data-disabled":r?"":void 0,disabled:r,id:d,...s,ref:a,onMouseDown:(0,P.composeEventHandlers)(e.onMouseDown,e=>{r||0!==e.button||!1!==e.ctrlKey?e.preventDefault():n.onValueChange(l)}),onKeyDown:(0,P.composeEventHandlers)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&n.onValueChange(l)}),onFocus:(0,P.composeEventHandlers)(e.onFocus,()=>{let e="manual"!==n.activationMode;u||r||!e||n.onValueChange(l)})})})});eu.displayName=ec;var em="TabsContent",ep=a.forwardRef((e,i)=>{let{__scopeTabs:l,value:r,forceMount:s,children:n,...o}=e,d=es(em,l),c=ef(d.baseId,r),u=eh(d.baseId,r),m=r===d.value,p=a.useRef(m);return a.useEffect(()=>{let e=requestAnimationFrame(()=>p.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,t.jsx)(ee.Presence,{present:s||m,children:({present:a})=>(0,t.jsx)(E.Primitive.div,{"data-state":m?"active":"inactive","data-orientation":d.orientation,role:"tabpanel","aria-labelledby":c,hidden:!a,id:u,tabIndex:0,...o,ref:i,style:{...e.style,animationDuration:p.current?"0s":void 0},children:a&&n})})});function ef(e,t){return`${e}-trigger-${t}`}function eh(e,t){return`${e}-content-${t}`}function ev({className:e,...a}){return(0,t.jsx)(en,{"data-slot":"tabs",className:(0,w.cn)("flex flex-col gap-x-2",e),...a})}function ex({className:e,...a}){return(0,t.jsx)(ed,{"data-slot":"tabs-list",className:(0,w.cn)("bg-muted text-muted-foreground inline-flex h-9 w-fit items-center justify-center rounded-lg p-[3px]",e),...a})}function eb({className:e,...a}){return(0,t.jsx)(eu,{"data-slot":"tabs-trigger",className:(0,w.cn)("focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:shadow-sm [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...a})}function eg({className:e,...a}){return(0,t.jsx)(ep,{"data-slot":"tabs-content",className:(0,w.cn)("flex-1 outline-none",e),...a})}ep.displayName=em;var ey=e.i(747961);let ew=(0,a.forwardRef)(({title:e,titleId:a,desc:i,descId:l,...r},s)=>(0,t.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",ref:s,"aria-labelledby":a,"aria-describedby":l,...r,children:[i?(0,t.jsx)("desc",{id:l,children:i}):null,void 0===e?(0,t.jsx)("title",{id:a,children:"Settings Adjust"}):e?(0,t.jsx)("title",{id:a,children:e}):null,(0,t.jsx)("g",{fill:"currentColor",children:(0,t.jsx)("path",{d:"M15 4h-2.05c-.25-1.15-1.25-2-2.45-2s-2.2.85-2.45 2H1v1h7.05C8.3 6.15 9.3 7 10.5 7s2.2-.85 2.45-2H15zm-4.5 2C9.65 6 9 5.35 9 4.5S9.65 3 10.5 3s1.5.65 1.5 1.5S11.35 6 10.5 6M1 12h2.05c.25 1.15 1.25 2 2.45 2s2.2-.85 2.45-2H15v-1H7.95C7.7 9.85 6.7 9 5.5 9s-2.2.85-2.45 2H1zm4.5-2c.85 0 1.5.65 1.5 1.5S6.35 13 5.5 13 4 12.35 4 11.5 4.65 10 5.5 10"})})]})),ej=a.default.forwardRef((e,a)=>(0,t.jsx)(ey.BaseIcon,{ref:a,icon:ew,...e}));ej.displayName="SettingsAdjust";let eN=({tabs:e,defaultActiveTab:i,onTabChange:l,size:r="small",showFilterIcon:s,className:n,innerTabsClass:o})=>{let[d,c]=(0,a.useState)(i||e?.[0]?.id||""),u=e=>{c(e),l&&l(e)},m={"h-10":"small"===r,"h-12":"large"===r};return(0,t.jsxs)(ev,{value:d,onValueChange:u,className:(0,w.cn)("w-full",n),children:[(0,t.jsxs)("div",{className:(0,w.cn)("flex items-center gap-2","small"===r?"h-10":"h-14"),children:[s&&(0,t.jsx)("div",{className:(0,w.cn)("flex aspect-square shrink-0 items-center justify-center rounded-lg bg-gray-100",m),children:(0,t.jsx)(ej,{className:(0,w.cn)("text-gray-600",{"h-4 w-4":"small"===r,"h-5 w-5":"large"===r})})}),(0,t.jsx)("div",{className:"scrollbar-hide overflow-x-scroll",children:(0,t.jsx)(ex,{className:(0,w.cn)("flex w-fit gap-2 bg-transparent p-0",m,o),children:e.map(e=>(0,t.jsx)(eb,{value:e.id,tabIndex:0,onFocus:e=>e.preventDefault(),onKeyDown:t=>{var a;return a=e.id,void(("Enter"===t.key||" "===t.key)&&(t.preventDefault(),u(a)))},className:(0,w.cn)("flex-shrink-0 cursor-pointer rounded-lg py-3 whitespace-nowrap","data-[state=active]:bg-brand-400 data-[state=active]:text-white","data-[state=inactive]:bg-gray-100 data-[state=inactive]:text-gray-600",{"px-3 text-sm":"small"===r,"px-4 text-base":"large"===r}),children:e.label},e.id))})})]}),(0,t.jsx)("div",{children:e.map(e=>(0,t.jsx)(eg,{value:e.id,children:e.content},e.id))})]})};var eA=e.i(939899),eI=e.i(375570);let eC=({playlistIds:e,className:a,innerTabsClass:i})=>{let l=(0,eI.useParams)(),r=l?.locale,[n,o]=(0,s.useAtom)(f.selectedPlaylistIdAtom),{data:d}=(0,k.default)(["playlist-titles",r,e.join(",")],async()=>{let t=e.map(async e=>{try{let t=await (0,eA.getCollectionById)(e,r);return{id:e,label:t?.title||e}}catch(t){return console.error(`Error fetching title for playlist ${e}:`,t),{id:e,label:e}}});return await Promise.all(t)},{revalidateOnFocus:!1});return(0,t.jsx)(eN,{tabs:d||[],defaultActiveTab:n,onTabChange:o,className:a,innerTabsClass:i})};var eS=e.i(864943),ek=e.i(663333);let eP=({id:e,title:a,thumbnail:i,duration:l,onClick:r,className:n,isCurrent:o,isNext:d,isFetchPriority:c})=>{let u="mobile"===(0,s.useAtomValue)(ek.deviceClassAtom)?"column":"row";return(0,t.jsxs)(eS.MediaObject,{layout:u,onClick:()=>{r&&!o&&r(e)},className:(0,w.cn)("w-full gap-2",n),children:[(0,t.jsx)(eS.MediaObject.Image,{src:i,alt:a,aspectRatio:"3/2",layout:u,isFetchPriority:c}),(0,t.jsxs)(eS.MediaObject.Content,{className:"flex-1",children:[o&&(0,t.jsx)(p.default,{variant:"Body.S.Bold",color:"brandLight",children:"Now Playing"}),d&&(0,t.jsx)(p.default,{variant:"Body.S.Bold",color:"brandLight",children:"Next Up"}),(0,t.jsx)(eS.MediaObject.Title,{className:"mb-0",textSize:"sm",title:a,lineClamp:4,responsive:!0}),(0,t.jsx)(eS.MediaObject.Duration,{textSize:"sm",duration:l,responsive:!0})]})]})},eT=({className:e})=>(0,t.jsxs)("div",{className:(0,w.cn)("animate-pulse",e),children:[(0,t.jsx)("div",{className:"mb-2 aspect-video rounded-lg bg-gray-200"}),(0,t.jsx)("div",{className:"mb-2 h-4 w-3/4 rounded bg-gray-200"}),(0,t.jsx)("div",{className:"h-3 w-1/2 rounded bg-gray-200"})]});var e_=e.i(827049);let eF=e=>{let t=e.split(/\s+/);return t[0]?.toLowerCase()==="by"?{firstName:t[1]||"",lastName:t.slice(2).join(" ")||""}:eD(e)},eD=e=>{let t=e.split(/\s+/);return{firstName:t[0]||"",lastName:t.slice(1).join(" ")||""}};var eE=e.i(526371),eR=e.i(495406);let eM=({deviceClass:e,videos:i,initialPlaylistId:l,className:r})=>{let n=(0,s.useAtomValue)(e_.pageLocaleAtom),[o,d]=(0,s.useAtom)(f.selectedPlaylistIdAtom),c=(0,s.useAtomValue)(f.selectedVideoAtom),u=(0,s.useAtomValue)(f.jwPlayerPlaylistIdAtom),m=(()=>{let[e,t]=(0,s.useAtom)(f.jwPlayerPlaylistIdAtom),i=(0,s.useSetAtom)(f.selectedVideoAtom);return(0,a.useCallback)((a,l,r,s=!0)=>{if(e){let n=window?.jwplayer?.();l!==e&&a&&(t(l),n.load(a));let o=a.findIndex(e=>e.mediaid===r);if(o>=0){let e=a[o];s&&e?.link&&window.history.pushState({playlistId:l,videoId:r},"",e.link),i(e),n.playlistItem(o)}}},[e,t,i])})(),[p,h]=(0,a.useState)(),v=o===l,{data:x,isLoading:b}=(0,k.default)(o&&!v?["playlist-content",n,o]:null,async([t,a,i])=>{let l=await (0,eE.getVideosByCollectionName)(i,a);if(l)return l.map(t=>{let a,i,l,r,s,n,o;return r=(l=t?.variants?.[0]??"")?`${l}?crop=16:9&format=pjpg&auto=webp&quality=60&width=640`:"",s=(t?.teaserTitle||t?.title)??"",n={jwplayer:"",pcollid:t?.pcollid||"",adzone:t?.adsmetrics?.adzone||"",assetName:t?.assetName,description:t?.description??"",title:s,teaserTitle:s,playlists:t?.playlists??[],entitlements:t?.tags?.entitlements??[],premium:t?.premium??!1,iab:t?.tags?.iab||{},tagsGeo:t?.tags?.geo||[],tagsKeyword:t?.tags?.keyword,tagsStorm:t?.tags?.storm,providername:t?.providername||"no-provider-data",publishdate:t?.publishdate??"",lastmodifieddate:t?.lastmodifieddate??"",duration:t?.duration||"",id:t?.id||"",videoIndex:-1,collectionId:t?.pcollid||"",videoId:t?.id||"",collectionAdZone:t?.adsmetrics?.adzone||"",aspectRatio:t?.aspect_ratio},t.author_data?.length?a=t.author_data.map(e=>{var t;let a,i,l,r=e?.authorImage?.[0],{firstName:s,lastName:n}=(t=e,a=t.name?.trim(),i=t.byline?.trim(),l=t.fullName?.trim(),a?eD(a):i?eF(i):l?eD(l):{firstName:"",lastName:""}),o=[s,n].filter(Boolean).join(" ");return{id:`__dsx_author_${e.email||o}`,firstName:s,lastName:n,displayName:o,slug:o.toLowerCase().replace(/\s+/g,"-"),authorType:"staff",bio:function(e,t={}){let{preserveLineBreaks:a=!0}=t;if(!e||""===e.trim())return{root:{type:"root",children:[{type:"paragraph",children:[{type:"text",text:"",version:1}],direction:"ltr",format:"",indent:0,version:1}],direction:"ltr",format:"",indent:0,version:1}};let i=a?e.split(/\r?\n/).filter(e=>""!==e.trim()):[e];return 0===i.length&&i.push(""),{root:{type:"root",children:i.map(e=>({type:"paragraph",children:[{type:"text",text:e.trim(),version:1}],direction:"ltr",format:"",indent:0,version:1})),direction:"ltr",format:"",indent:0,version:1}}}(e.byline||"",{preserveLineBreaks:!1}),bioUrl:e.bioUrl||"",isActive:!0,updatedAt:"",createdAt:"",coreMetadata:{providerData:{provider:"default-provider"}},profilePicture:r?{id:`__dsx_author_image_${e.fullName}`,createdAt:"",updatedAt:"",url:r?.variants?.[0]||"",caption:"",seo:{altText:r?.alt_text??""},coreMetadata:{providerData:{provider:"default-provider"}}}:void 0}}):t.author&&(a=[],i=t.author.join(", ")),o={mweb:t?.variants?.mweb,mwebFallback:t?.variants?.fallback_mweb,web:t?.variants?.web,webFallback:t?.variants?.fallback_web},{file:"desktop"===e?o.web:o.mweb,sources:[{file:"desktop"===e?o.web:o.mweb},{file:"desktop"===e?o.webFallback:o.mwebFallback}],image:r,title:t.title,description:t.description,mediaid:t.id,link:t.assetName,tracks:t?.cc_url?[{file:t.cc_url,label:"On",kind:"captions",default:!1}]:void 0,custom:{url:t.url,transcript:t.transcript,duration:function(e){if(!e)return"00:00";let t=e.split(":");if(t&&3===t.length){let[a,i,l]=t;return a&&+a?e:`${i}:${l}`}return"00:00"}(t.duration),authors:a,externalAuthors:i||"",publishDate:t.lastmodifieddate,ctx:n}}});return null},{revalidateOnFocus:!1,dedupingInterval:6e4}),g=v?i:x;(0,a.useEffect)(()=>{if(null!=g){p&&o&&(m(g,o,p,!1),h(null));let e=e=>{let{playlistId:t,videoId:a}=e.state;o!==t?(d(t),h(a)):m(g,t,a,!1)};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}}},[g,m,p,o,d]);let[y,j]=(0,a.useState)(i?.[0]?.mediaid||null),[N,A]=(0,a.useState)(i?.[1]?.mediaid||null);(0,a.useEffect)(()=>{if(!g||!c){j(null),A(null);return}let e=c.mediaid||"";if(j(e),u===o){let t=g.findIndex(t=>(t.mediaid||t.file||"")===e);if(-1!==t&&t+1{g&&o&&m(g,o,e)},C=(0,w.cn)("grid gap-2 w-full","grid-cols-1","max-sm:pb-6 max-h-full",r);return b?(0,t.jsx)("div",{className:C,children:[,,,,].fill(0).map((e,a)=>(0,t.jsx)(eT,{},a))}):g?(0,t.jsx)("div",{className:C,children:g.map((e,a)=>{let i=e.mediaid||e.file||"",l=i===y,r=i===N,s=(e=>{switch(e){case 1:return"MW_Position_ContentFeedAd1";case 2:return"WX_ContentFeed1";case 3:return"MW_Position_ContentFeedAd11";default:return}})(a);return(0,t.jsxs)("div",{className:"flex flex-col",children:[(0,t.jsx)(eP,{id:i,title:e.title||"",thumbnail:e.image||"",duration:e.custom?.duration||"",onClick:I,isCurrent:l,isNext:r,isFetchPriority:0===a}),s&&(0,t.jsx)(eR.AdBlock,{adId:s})]},i)})}):(0,t.jsx)("div",{className:"flex items-center justify-center p-8 text-gray-500",children:"No videos available"})};e.s(["VideosWithPlaylistsClient",0,({videos:e,playlistIds:a,className:i,playerId:l,deviceClass:r,showOpenWebComments:s=!1})=>((0,S.useHydrateAtoms)([[f.selectedVideoAtom,e[0]],[f.selectedPlaylistIdAtom,a[0]],[f.jwPlayerPlaylistIdAtom,a[0]]]),(0,t.jsxs)("div",{className:(0,w.cn)("bg-white md:p-4",s?"md:rounded-t-xl":"md:rounded-xl",i),children:[(0,t.jsx)("div",{className:"hidden md:block",children:(0,t.jsx)(eC,{playlistIds:a,className:"mb-4"})}),(0,t.jsxs)("div",{className:"flex flex-col md:grid md:grid-cols-[1fr_300px] md:gap-4 md:divide-x md:divide-gray-200",children:[(0,t.jsx)("div",{className:"border-b border-gray-200 md:border-b-0",children:(0,t.jsx)(C,{videos:e,className:"md:pr-4",showTitle:!0,showDescription:!0,playerId:l,placeHolder:!0})}),(0,t.jsx)("div",{className:"md:hidden",children:(0,t.jsx)(eC,{playlistIds:a,className:"my-4",innerTabsClass:"mx-4"})}),(0,t.jsx)("div",{className:"w-full md:relative md:overflow-hidden",children:(0,t.jsx)(eM,{deviceClass:r,videos:e,initialPlaylistId:a[0]||"",className:"px-4 md:absolute md:overflow-auto md:px-0"})})]})]}))],952234)}]);