(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]||(globalThis["TURBOPACK_remote_chunk_loading_global_wx-next-web"]=[])).push(["object"==typeof document?document.currentScript:void 0,33078,e=>{"use strict";var t=e.i(247865),a=e.i(792461),r=e.i(546446),i=e.i(737801),o=e.i(725287),l=e.i(959194),s=e.i(630986),n=e.i(64412),c=e.i(608201),d=e.i(236593);e.s(["useTrackVideoEvent",0,()=>{let e=(0,i.useEventAttributes)(),u=(0,s.useCMSAttributes)(),m=(0,o.usePathname)(),{location:p}=(0,n.useLocation)(),v=p?.ianaTimeZone||"Etc/UTC",y=(0,r.useAtomValue)(c.sourcePageAtom),g=(0,r.useAtomValue)(d.sourceModuleAtom),f=(0,a.useRefMemo)(e),b=(0,a.useRefMemo)(u),w=(0,a.useRefMemo)(m),h=(0,a.useRefMemo)(v),x=(0,t.useRef)(y),k=(0,t.useRef)(g);return(0,t.useCallback)(({eventName:e,eventAttributes:t={}})=>{if(!window.mParticle?.isInitialized?.())return void console.warn("MParticle is not initialized");let a=f.current,r=b.current,i=w.current,o=h.current,s=x.current,n=k.current,c={...t,author:r?.author||"",contentId:r?.contentId||t.contentId,...a,url:i?(0,l.stripLastPartOfSlug)(i):"",sourcePage:s??"",sourceModule:n?.id??null,sourceModuleName:n?.name??null,...n?.modulePosition!=null&&{sourcePosition:n.modulePosition},sourceElement:n?.element??null,siteMode:"normal"};["video-ended","video-begin","video-attempted","ad-started","ad-skipped","ad-complete"].includes(e)&&(void 0!==c.providerName&&(c.provider=c.providerName),delete c.providerName,c.deviceTimeZone=(0,l.getTimezoneOffsetInHours)(o)),["video-ended","video-begin","video-attempted"].includes(e)&&(delete c.duration,delete c.muted,delete c.id,delete c.aspectRatio,delete c.pageCount);try{window.mParticle?.logEvent?.(e,window.mParticle?.EventType?.Other,c),console.debug(`MParticle: Video Event tracked - "${e}"`,c)}catch(t){console.error(`MParticle: Failed to track Video Event - "${e}"`,t)}},[])}])},506371,e=>{e.v({jwplayerContainer:"JWPlayer-module-scss-module__bzwBeG__jwplayerContainer"})},777430,e=>{"use strict";var t=e.i(902875),a=e.i(247865),r=e.i(632137),i=e.i(533760);let o={autoplayadsmuted:!1,client:"googima",vpaidcontrols:!0},l=new Map;var s=e.i(695881),n=e.i(506371),c=e.i(37429);let d=(0,s.createLogger)("JWPlayer"),u=(0,a.memo)(function({status:e,hasFile:a,playerDomId:i,aspectRatioClass:o}){return"loading"===e&&a?(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:(0,r.cn)("flex w-full items-center justify-center bg-black",o),children:(0,t.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-t-2 border-b-2 border-white"})})}):"error"===e?(0,t.jsx)("div",{children:(0,t.jsx)("div",{className:(0,r.cn)("flex w-full items-center justify-center bg-black text-white",o),children:"Failed to initialize video player"})}):(0,t.jsx)("div",{children:(0,t.jsx)("div",{id:i,className:(0,r.cn)("w-full bg-black",o)})})});e.s(["JWPlayer",0,({playlist:e,options:s={},setupParams:m={},events:p=[],className:v="",placeHolder:y,placeHolderImage:g})=>{let f=`player-${(0,a.useId)()}`,{playerId:b="IdNDrRWQ"}=m,w=(0,a.useMemo)(()=>({playlist:e,...(e=>{let{ads:t=!0,showDescriptions:a=!0}=e;return{aspectratio:"16:9",autostart:!0,backgroundLoading:!0,width:"100%",mute:!1,autoPause:{pauseAds:!0,viewability:!0},captions:{backgroundOpacity:50,fontSize:14},...t?{advertising:o}:{},...a?{displaytitle:!0,displaydescription:!0}:{displaytitle:!1,displaydescription:!1}}})({...m}),...s,floating:{dismissible:!0,...s.floating}}),[e,m,s]),h="9:16"===w.aspectratio?"aspect-[9/16]":"aspect-video",x=(0,a.useRef)(null),k=(0,a.useRef)(!1),A=e?.[0]?.file,[N,P]=(0,a.useState)(A?"loading":"error");(0,a.useEffect)(()=>{if(k.current||!("jwplayer"in window)||"ready"!==N||!A)return;let e=window.jwplayer(f);x.current=e,k.current=!0,l.set(f,e),d.info("initialized player"),e.setup(w),p.forEach(({eventName:t,callback:a})=>{e.on(t,t=>{a({event:t,player:e})}),d.lifecycle(`Registered event handler for ${t}`)});let t=(()=>{let e=new URLSearchParams(window.location.search).get("t");if(!e)return null;let t=Number(e);return isNaN(t)||t{try{e.seek(t),d.info(`Successfully seeked to ${t} seconds`)}catch(e){d.error("Error seeking to position",e)}}))},[w,p,A,f,N]),(0,a.useEffect)(()=>{k.current&&((e,t)=>{if(!e||!t)return;e.style.backgroundImage=`url("${t}")`;let a=e.querySelector(".jw-preview");a&&(a.style.backgroundImage=`url("${t}")`);let r=e.querySelector("video");r&&(r.poster=t)})(document.getElementById(f),g)},[g,f]),(0,a.useEffect)(()=>()=>{if(x.current)try{x.current.remove(),l.delete(f),x.current=null,k.current=!1}catch(e){d.error("Error removing JW Player",e)}},[f]);let I=y?g||e?.[0]?.image:"";return(0,t.jsxs)("div",{children:[A&&(0,t.jsx)(i.default,{src:`https://cdn.jwplayer.com/libraries/${b}.js`,onLoad:()=>P("ready"),onReady:()=>P("ready"),onError:()=>P("error")}),(0,t.jsxs)("div",{className:(0,r.cn)("relative overflow-hidden",n.default.jwplayerContainer,v),children:[I&&(0,t.jsx)(c.default,{fetchPriority:"high",className:(0,r.cn)("absolute w-full",h),src:I,alt:""}),(0,t.jsx)(u,{status:N,hasFile:!!A,playerDomId:f,aspectRatioClass:h})]})]})}],777430)},849715,e=>{"use strict";var t=e.i(902875),a=e.i(247865),r=e.i(777430);let i="/placeholder-video-thumbnail.jpg";var o=e.i(484758),l=e.i(617843),s=e.i(33078),n=e.i(16838),c=e.i(436028),d=e.i(632137),u=e.i(528600),m=e.i(909232),p=e.i(546446),v=e.i(849177),y=e.i(5397);let g=(0,e.i(695881).createLogger)("video:events"),f=({file:e,image:f,title:b,description:w,tracks:h=[],playlist:x,custom:k={},playerSettings:A,descriptionAttributes:N,playerAttributes:P,resolvedVideo:I=null,resolvedVideoCtx:S=null,resolvedPlaylistItems:_=[],flatPlanMarker:j=null})=>{let R=`video-player-${(0,a.useId)()}`,E=(0,a.useRef)(!0),C=(0,a.useRef)(null),M=(0,u.useUser)()?.user||{},T=(0,p.useAtomValue)(v.adsDisabledAtom),$=(0,p.useAtomValue)(y.showAdminHeaderAtom),U=M.isUserPremium||T,F=(0,m.useClientMobileMedia)(),V=(0,s.useTrackVideoEvent)(),W=(0,a.useMemo)(()=>{let e=[];return!Array.isArray(h)&&h?.file?e.push(h):Array.isArray(h)&&e.push(...h),e},[h]),L=!!I,z=(0,a.useMemo)(()=>L&&I?.content?.videoFormatUrls?.length?I.content.videoFormatUrls[0]?.url:e,[L,I,e]),O=(0,a.useMemo)(()=>{if(L){let e=I?.seo?.image,t=e&&"object"==typeof e?e.url:void 0;return I?.content?.keyFrameImage||t||f}return f},[L,I,f]),D=(0,a.useMemo)(()=>L&&I?.title||b,[L,I,b]),B=(0,a.useMemo)(()=>{if(L&&I?.description){let e=I.description.root,t=e?.children?.[0];return t?.children?.[0]?.text||w}return w},[L,I,w]),H=(0,a.useMemo)(()=>{let e=k&&"object"==typeof k&&!Array.isArray(k)?k:{};if(!S)return e;let t=e.ctx&&"object"==typeof e.ctx?e.ctx:{};return{...e,ctx:{...S,...t}}},[k,S]),J=(0,a.useMemo)(()=>{if(C.current&&JSON.stringify({file:z,image:O,title:D,description:B,tracks:W,playlist:x,custom:H})===JSON.stringify(C.current))return C.current;let e=O||(z?(e=>{if(!e)return i;for(let t of[/(?:cdn\.jwplayer\.com\/(?:videos|manifests|previews)\/)([a-zA-Z0-9]+)(?:-[a-zA-Z0-9]+)?/,/(?:content\.jwplatform\.com\/(?:videos|manifests)\/)([a-zA-Z0-9]+)(?:-[a-zA-Z0-9]+)?/,/(?:players\.jwplayer\.com\/preview\/)([a-zA-Z0-9]+)(?:-[a-zA-Z0-9]+)?/]){let a=e.match(t);if(a&&a[1])return`https://cdn.jwplayer.com/v2/media/${a[1]}/poster.jpg`}return i})(z):null)||"https://s.w-x.co/wxnext/video-placeholder.jpg",t={file:z,image:e,title:D,description:B,tracks:W,custom:H};return C.current=t,t},[z,O,D,B,W,x,H]),Z=(0,a.useMemo)(()=>{let e=[];if(x&&(e=((e,t)=>{if(!t?.file)return[];if("string"==typeof e)return t?.file?[t]:[];let a=Array.isArray(e)?e:[];return!t?.file||a.length>0&&a[0]?.file===t?.file?a:[t,...a.filter(e=>e.file!==t.file)]})(x,J)||[]),0===e.length&&J?.file&&(e=[J]),_.length>0){let t=new Set(e.map(e=>e.file));for(let a of _)t.has(a.file)||(e.push(a),t.add(a.file))}return e},[x,J,_]);if((0,a.useEffect)(()=>{E.current=!0},[Z]),!z&&0===Z.length)return null;let q=[...o.adEvents,...l.metricEvents].map(({eventName:e,callback:t})=>({eventName:e,callback:({event:a,player:r})=>{"time"!==e&&g.info(`[${e}]:`,a),t({event:a,player:r,isFirstPlayRef:E,user:M,trackVideoEvent:V,isMobile:F})}}));return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.DebugCollector,{componentName:"VideoBlock",data:{props:{file:e,image:f,title:b,description:w,tracksCount:(0,c.hasLength)(W),hasPlaylist:!!x&&x.length>0,custom:k},state:{videoObject:J,playlistItems:Z.length,isFirstPlay:E.current,events:q.map(e=>e.eventName)},performance:{}},enabled:$}),(0,t.jsxs)("div",{...P,className:(0,d.cn)("overflow-hidden rounded-lg",P?.className),children:[j&&(0,t.jsx)("div",{"data-fp-video":!0,"data-fp-video-src":j.src,"data-fp-video-poster":j.poster,"aria-hidden":"true",hidden:!0}),(0,t.jsx)(r.JWPlayer,{playlist:Z,events:q,setupParams:{ads:!U}},R)]}),A?.showDescriptions&&(0,t.jsx)("p",{...N,className:(0,d.cn)("my-2 text-sm",N?.className),children:J.title})]})};e.s(["VideoBlockClient",0,f,"default",0,f],849715)},974802,function(e){e.n(e.i(849715))},484758,e=>{"use strict";var t=e.i(695881);let a={mobile:"mobile_smart",desktop:"web_weather"},r={"en-US":"us"},i=[...new Set(Object.values(a))].join("|"),o=RegExp(`^(?:test_)?(?:${i})(?:_[a-z]+)*\\/`),l=RegExp(`^(?:test_)?(?:${i})(?:_[a-z]+)*$`),s=e=>{if("string"!=typeof e)return"";let t=e.trim().replace(/\s+/g,"").replace(/\/{2,}/g,"/").replace(/^\/+|\/+$/g,"");if(!t)return"";let a=t.replace(o,"");return l.test(a)?"":a};var n=e.i(965586);let c=(0,t.createLogger)("AdUtils"),d=async({player:e,user:t,ctx:a={},isMobile:r=!1})=>{if(!e)return;if(t?.isUserPremium)return void e.play();let i=await u(a,r);i?e.playAd(i):e.play()},u=async(e,t=!1)=>{let a;if(!y())return null;let r=p(e,t),i=e.iab,o=m(structuredClone(window?.__HeliosConfig?.generalConfig?.cModules?.iabc?.page??{}),i);window.__Helios.emit("UPDATE_AD_UNIT_PATH",r);try{window.__Helios.modules?.iabc?.update?.({page:o,site:{v1:["IAB15-10_Weather"],v3:["390_Weather"]}})}catch(e){c.error("Error updating IABC parameters",e)}try{a=await v()}catch(e){a=null,c.error("Error getting ad tag",e)}return window.__Helios.emit("UPDATE_AD_UNIT_PATH",r),a},m=(e,t)=>{let a={...e};for(let e in t)Array.isArray(t[e])?(a[e]=[...a[e]||[],...t[e]],a[e]=[...new Set(a[e])]):"object"==typeof t[e]&&null!==t[e]?a[e]=m(a[e]||{},t[e]):a[e]=t[e];return a},p=(e,t)=>{let i=window?.__HeliosConfig?.generalConfig,o=`/${(i?.targeting?.networkCode??"").trim().replace(/^\/+|\/+$/g,"")||"7646"}`,l=i?.targeting?.adUnits||(({deviceClass:e,locale:t="en-US"})=>{let i=r[t]??"intl",o=a[e]??"web_weather";return`${o}_${i}`})({deviceClass:t?"mobile":"desktop"}),c=(0,n.getCookie)("adstest");void 0===c||""===c||l.startsWith("test_")||(l=`test_${l}`);let d=s(e.collectionAdZone)||s(e.adzone)||s(i?.targeting?.adZone)||"video";return`${o}/${l}/${d}`},v=async()=>{let e=[];try{e=await window?.__Helios.video.requestVideoBids()}catch(e){c.error("Error getting video bids",e)}return await window.__Helios.modules.videoTag.createAdTag(e)},y=()=>{try{return"function"==typeof window.__Helios?.video?.requestVideoBids&&"function"==typeof window.__Helios?.modules?.videoTag?.createAdTag}catch{return!1}},g=e=>{let{collectionId:t,videoIndex:a,videoId:r}=e||{};return{videoCount:a,videoId:r,collectionId:t}},f=e=>"GDFP"===e||"AdSense/AdX"===e;e.i(902875),e.i(533760);let b=(0,t.createLogger)("NewRelic");function w(e,t={}){try{window?.NREUM?.addPageAction?.(e,{...h(t,"meta.")})}catch(e){b.error("New Relic: sendReumEvent error",e instanceof Error?e.message:String(e))}}let h=(e,t="")=>Object.fromEntries(Object.entries(e).map(([e,a])=>[`${t}${e}`,a])),x=(0,t.createLogger)("AdEvents"),k=new Set(["amznbid","crt_pb","hb_pb"]),A=[{eventName:"ready",callback:({event:e})=>{w("videoReady",{isViewable:!!e.viewable,setupTime:e.setupTime})}},{eventName:"beforePlay",callback:async({event:e,player:t,isFirstPlayRef:a,user:r,isMobile:i})=>{if(!a?.current)return;let o=t.getPlaylistItem(),l=o?.custom?.ctx;l&&(l.videoIndex=t.getPlaylistIndex()),w("videoBeforePlay",{...g(l),isViewable:!!e.viewable,playReason:e.playReason}),t.stop(),await d({player:t,user:r,ctx:l,isMobile:i}),a.current=!1}},{eventName:"adRequest",callback:({event:e,player:t})=>{let a=t.getPlaylistItem(),r=a?.custom?.ctx,i={},o=g(r);try{var l;let t=((e,t="https")=>e.replace(/^\/\//,`${t}://`))(e.tag||""),a=(l=new URL(t).searchParams.get("cust_params"))?l.split("&").reduce((e,t)=>{let[a,r]=t.split("=");return a&&r&&(e[a]||(e[a]=[]),e[a].push(r)),e},{}):{};for(let e of Object.keys(a))k.has(e)&&(i[`kv_${e}`]=`${a[e]}`)}catch(e){x.error("Error parsing cust_params",e)}w("videoAdRequest",{...o,isViewable:!!e.viewable,roll:e.adposition,...i})}},{eventName:"adStarted",callback:({event:e,player:t})=>{let a=t.getPlaylistItem(),r=a?.custom?.ctx,{duration:i,adposition:o}=e,l=g(r),s="";try{let t=e.ima?.ad?.data;t&&(s=(e=>{let{adSystem:t,adId:a,adWrapperSystems:r,adWrapperIds:i}={adSystem:"",adId:"",adWrapperSystems:[],adWrapperIds:[],...e};if(f(t))return a;let o=r.findIndex(f);return o>=0&&o{let a=t.getPlaylistItem();w("videoStart",{...g(a?.custom?.ctx),isViewable:!!e.viewable,loadTime:e.loadTime})}},{eventName:"complete",callback:({player:e})=>{let t=e.getPlaylistItem();w("videoComplete",{...g(t?.custom?.ctx)})}},{eventName:"adSkipped",callback:({player:e})=>{let t=e.getPlaylistItem();w("videoAdSkip",{...g(t?.custom?.ctx)})}},{eventName:"playlistItem",callback:async({event:e,player:t,isFirstPlayRef:a,user:r,isMobile:i})=>{if(a?.current)return;let{item:o}=e,l=o?.custom?.ctx;l.videoIndex=t.getPlaylistIndex(),t.stop(),await d({player:t,user:r,ctx:l,isMobile:i})}},{eventName:"adComplete",callback:async({player:e})=>{e.play()}},{eventName:"adError",callback:async({event:e,player:t})=>{let a=t.getPlaylistItem();w("videoAdError",{...g(a?.custom?.ctx),message:e.message,code:e.code,vastCode:e.vastCode,roll:e.adposition}),x.error("Ad error occurred",e),t.play()}},{eventName:"error",callback:async({event:e,player:t})=>{let a=t.getPlaylistItem();w("videoError",{...g(a?.custom?.ctx),message:e.message,code:e.code}),x.error("Video Player error",e)}},{eventName:"setupError",callback:({event:e})=>{w("videoSetupError",{message:e.message,code:e.code})}}];e.s(["adEvents",0,A],484758)},617843,e=>{"use strict";var t=e.i(959194),a=e.i(896363);let r="",i=!1,o="",l=1,s=0,n=0,c=0,d=0,u=!1,m=0,p={adImpression:!1,videoAttempt:!1,videoStarted:!1,videoCompleted:!1},v={autostart:"auto",interaction:"click",external:"externalLink",playlist:"playlistClick","related-interaction":"nextClick","related-auto":"auto"};function y(e){return v[e]??"click"}function g(e){if(!e)return 0;let t=e.split(":").map(Number);if(2===t.length){let[e=0,a=0]=t,r=Math.floor(60*e+a);return isNaN(r)?0:r}if(3===t.length){let[e=0,a=0,r=0]=t,i=Math.floor(3600*e+60*a+r);return isNaN(i)?0:i}return 0}function f(){Object.keys(p).map(e=>{p[e]=!1}),s=0,n=0,o=""}function b(e,r){let i=r||e.getPlaylistItem();return{adBlock:e.getAdBlock(),adsMetricsUnitAndZone:i?.custom?.ctx?.adzone,aspectRatio:i?.custom?.ctx?.aspectRatio,assetName:(0,t.stripLastPartOfSlug)(i?.custom?.ctx?.assetName??""),cmsUrl:i?.custom?.ctx?.cmsUrl??i?.custom?.ctx?.assetName??"",collection:i?.custom?.ctx?.pcollid,collectionId:i?.custom?.ctx?.pcollid,contentId:i?.custom?.ctx?.id,createdDate:i?.custom?.ctx?.createddate,duration:i?.custom?.duration,entitlements:(0,a.parseArrayToString)(i?.custom?.ctx?.entitlements??[]),iabContent:(0,t.mapIabTagsToIabContent)(i?.custom?.ctx?.iab||{}),id:i?.custom?.ctx?.id,lastModifiedDate:i?.custom?.ctx?.lastmodifieddate?.toString(),liveStream:i?.custom?.ctx?.liveStream??!1,muted:e.getMute(),playLists:(0,a.parseArrayToString)((i?.custom?.ctx?.playlists??[]).map(e=>e.id||Object.keys(e)[0]).filter(e=>!!e)),premiumContent:i?.custom?.ctx?.premium,publishDate:i?.custom?.ctx?.publishdate?.toString().slice(0,10),providerName:i?.custom?.ctx?.providername,tagsGeo:(0,a.parseArrayToString)(i?.custom?.ctx?.tagsGeo),tagsKeyword:(0,a.parseArrayToString)(i?.custom?.ctx?.tagsKeyword),tagsStorm:(0,a.parseArrayToString)(i?.custom?.ctx?.tagsStorm)}}let w=[{eventName:"ready",callback:({player:e,trackVideoEvent:t})=>{window.addEventListener("beforeunload",()=>{if(p.videoStarted&&!p.videoCompleted){let a=e.getPlaylistItem(),i=g(a?.custom?.ctx?.duration),n=a?.custom?.ctx?.aspectRatio;a&&!p.videoAttempt&&t&&t({eventName:"video-ended",eventAttributes:{errorMessage:o,videoWatchedLength:s,playMethod:r,videoView:l,...b(e),videoLength:i,adLength:c,adWatchedLength:d,adSkipped:u,exitReason:"pageExit",orientation:n}}),p.videoCompleted=!0}})}},{eventName:"adImpression",callback:async({player:e,trackVideoEvent:t})=>{let a=e.getPlaylistItem();if(o="",f(),console.debug("JW Player callback - adImpression eventSentFlags:",p),p.adImpression=!0,a&&!p.videoAttempt&&t){let i=g(a?.custom?.ctx?.duration),s=a?.custom?.ctx?.aspectRatio;t({eventName:"video-played",eventAttributes:{errorMessage:o,playReason:r,videoView:l,...b(e)}}),t({eventName:"video-attempted",eventAttributes:{errorMessage:o,playMethod:r,videoLength:i,videoView:l,orientation:s,...b(e)}}),p.videoAttempt=!0}}},{eventName:"viewable",callback:async({event:e})=>{l=e?.viewable}},{eventName:"playlistItem",callback:async({player:e,trackVideoEvent:t})=>{if(p.videoStarted&&!p.videoCompleted){let a=e.getPlaylistIndex(),i=e.getPlaylistItem(a-1),n=g(i?.custom?.ctx?.duration),m=i?.custom?.ctx?.aspectRatio;t({eventName:"video-ended",eventAttributes:{errorMessage:o,videoWatchedLength:s,playMethod:r,videoView:l,...b(e),videoLength:n,adLength:c,adWatchedLength:d,adSkipped:u,exitReason:"nextVideo",orientation:m}}),p.videoCompleted=!0}r=y("playlist"),i=!1}},{eventName:"playAttempt",callback:async({player:e,trackVideoEvent:t})=>{let a=e.getPlaylistItem();if(p.adImpression||(o="",f()),console.debug("JW Player callback - playAttempt eventSentFlags:",p),a&&!p.videoAttempt&&t){let i=g(a?.custom?.ctx?.duration),s=a?.custom?.ctx?.aspectRatio;p.videoAttempt=!0,t({eventName:"video-played",eventAttributes:{errorMessage:o,playReason:r,videoView:l,...b(e)}}),t({eventName:"video-attempted",eventAttributes:{errorMessage:o,videoLength:i,playMethod:r,videoView:l,orientation:s,...b(e)}})}}},{eventName:"firstFrame",callback:async({player:e,trackVideoEvent:t})=>{console.debug("JW Player callback - firstFrame eventSentFlags:",p);let a=e.getPlaylistItem();if(a&&!p.videoStarted&&t){let i=g(a?.custom?.ctx?.duration),s=a?.custom?.ctx?.aspectRatio;t({eventName:"video-begin",eventAttributes:{errorMessage:o,playMethod:r,videoView:l,...b(e),videoLength:i,adLength:c,adWatchedLength:d,adSkipped:u,orientation:s}}),t({eventName:"video-started",eventAttributes:{errorMessage:o,playReason:r,videoView:l,...b(e)}}),p.videoStarted=!0}}},{eventName:"complete",callback:async({player:e,trackVideoEvent:t})=>{let a=e.getPlaylistItem(),i=g(a?.custom?.ctx?.duration),n=a?.custom?.ctx?.aspectRatio;console.debug("JW Player callback - complete eventSentFlags:",p),a&&!p.videoCompleted&&t&&(t({eventName:"video-completed",eventAttributes:{errorMessage:o,playReason:r,videoView:l,...b(e)}}),t({eventName:"video-ended",eventAttributes:{errorMessage:o,videoWatchedLength:s,playMethod:r,videoView:l,...b(e),videoLength:i,adLength:c,adWatchedLength:d,adSkipped:u,exitReason:"complete",orientation:n}}),p.videoCompleted=!0)}},{eventName:"adStarted",callback:async({event:e,player:t,trackVideoEvent:a})=>{let i=t.getPlaylistItem();if(c=e.duration,console.debug("JW Player callback - adStarted eventSentFlags:",p),i&&a){let e=g(i?.custom?.ctx?.duration),s=i?.custom?.ctx?.aspectRatio;a({eventName:"ad-started",eventAttributes:{errorMessage:o,playMethod:r,videoLength:e,orientation:s,videoView:l,...b(t)}})}}},{eventName:"adSkipped",callback:async({player:e,trackVideoEvent:t})=>{let a=e.getPlaylistItem();if(u=!0,a&&t){let i=g(a?.custom?.ctx?.duration),s=a?.custom?.ctx?.aspectRatio;t({eventName:"ad-skipped",eventAttributes:{errorMessage:o,playMethod:r,videoLength:i,orientation:s,videoView:l,...b(e)}})}}},{eventName:"adComplete",callback:async({event:e,player:t,trackVideoEvent:a})=>{let i=t.getPlaylistItem();if(d=e.duration,console.debug("JW Player callback - adComplete eventSentFlags:",p),i&&a){let e=g(i?.custom?.ctx?.duration),s=i?.custom?.ctx?.aspectRatio;a({eventName:"ad-complete",eventAttributes:{errorMessage:o,playMethod:r,videoLength:e,orientation:s,videoView:l,...b(t)}})}}},{eventName:"beforePlay",callback:async({event:e})=>{i||(r=y(e?.playReason),i=!0)}},{eventName:"adError",callback:async({event:e})=>{console.error("Video ad error:",e)}},{eventName:"error",callback:async({event:e})=>{o=e?.message,console.error("Video Player error:",e)}},{eventName:"time",callback:({event:e})=>{if("number"==typeof e?.position){let t=e.position-n;s+=t,n=e.position}}},{eventName:"seek",callback:({event:e})=>{"number"==typeof e?.offset&&(n=e.offset)}},{eventName:"adTime",callback:async({event:e})=>{let t=Date.now();t-m>=1e3&&(d=parseFloat(e.position.toFixed(2)),m=t)}}];e.s(["durationToSeconds",0,g,"metricEvents",0,w])}]);