1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8517],{15583:(e,t,n)=>{n.d(t,{a:()=>s});var r="4.8.37",s={PLAYER_VERSION:r,GOOGLE_IMA:"googleIMA",URLS:{BASE:"https://videoplayer.dpgmedia.net",RESOURCE:"https://videoplayer.dpgmedia.net/v".concat(r)}}},18517:(e,t,n)=>{n.r(t),n.d(t,{BackgroundVideo:()=>eI,SingleVideoControlsProvider:()=>c.J,VideoEmbed:()=>en,VideoEmbedPreview:()=>eA,VideoPlaylist:()=>e_,VideoPlaylistPreview:()=>eH,VideoTeaser:()=>e0,useSingleVideoControls:()=>eP});var r=n(79620),s=n(1833),a=n(32932),i=n(38038),o=n(86428),l=n(76737),d=n(90726),c=n(24212),u=n(13187),p=n(66715),g=n(11259),h=n(37386),y=n(5220),v=n(88491),m={INVALID_ENVIRONMENT:{code:7005,internalMessage:"Invalid environment provided",externalMessage:"De opgegeven omgeving wordt niet ondersteund."}};Object.fromEntries(Object.entries(m).map(e=>{let[t,n]=e;return[t,n.code]}));var f=class extends p.z{getAttemptedEnvironment(){return this.attemptedEnvironment}getSupportedEnvironments(){return this.supportedEnvironments}constructor(e,t,n,r){let s=m.INVALID_ENVIRONMENT;super(e,t,s,{invalidData:n,context:{domain:"environment",schemaName:"environmentSchema",metadata:{attemptedEnvironment:n,supportedEnvironments:r}}}),this.attemptedEnvironment=n,this.supportedEnvironments=r,this.internalMessage="".concat(s.internalMessage,": ").concat(JSON.stringify(n),". Supported environments: ").concat(r.join(", "))}};function b(e){let t=(0,p.w)(s.b,e);if(!t.success)throw new f(s.b,t.issues,e,s.a);return t.output}var _=e=>{let{structuredData:t}=e;return(0,g.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:t}})},E={normalizer:"e",vars:"v","vars--ad":"C","vars--bd":"F","vars--destem":"P","vars--dg":"I","vars--stentor":"U","vars--7s7":"E","vars--tub":"L","vars--ed":"Q","vars--pzc":"X","vars--hln":"q","vars--indebuurt":"ke","vars--businesswise":"_e","vars--donaldduck":"ze","vars--deondernemer":"He","vars--oudersvannu":"je","vars--story":"Ae","vars--kidsweek":"Ne","vars--flair":"Be","vars--libelle":"Se","vars--margriet":"Te","vars--veronicasuperguide":"Ge","vars--vtwonenbe":"Me","vars--vtwonennl":"Re","vars--humo":"Ye","vars--demorgen":"Ce","vars--parool":"Fe","vars--trouw":"Pe","vars--volkskrant":"Ie","vars--brandedcontentbe":"Ue","vars--nu":"Ee","vars--qmusicnl":"Le","vars--qmusicbe":"Qe","vars--sportnieuws":"Xe","vars--vtm":"qe","vars--willy":"De","vars--weerplaza":"Je",root:"Ke"};function x(e){let{brand:t,className:n,children:r,...a}=e,i=t&&(0,s.j)(t)?s.h[t].theme:void 0;return(0,g.jsx)("div",{...a,className:(0,h.$)(E.vars,E.root,E.normalizer,i&&E["vars--".concat(i)],n),children:r})}var w={aspectRatioContainer:"Oe"};function I(e){let{aspectRatio:t,children:n,className:r}=e;return(0,g.jsx)("div",{className:(0,h.$)(w.aspectRatioContainer,r),style:{aspectRatio:t.width/t.height},children:n})}function S(e){let{isDebugEnabled:t}=(0,c.p)(),{className:n,error:r,...s}=e;return(0,g.jsx)(x,{brand:e.brand,className:n,children:(0,g.jsxs)(I,{aspectRatio:l.a,children:[t&&(0,g.jsx)(y.Suspense,{fallback:null,children:(0,g.jsx)(c.o,{...s})}),(0,g.jsx)(c.n,{error:r})]})})}function k(e){let{action:t,children:n,onError:a,...i}=e,o=(0,p.w)(s.b,e.environment);return o.success?(0,g.jsx)(r.e,{environment:o.output,action:t,onError:a,tags:{videoId:e.id,brand:e.brand},fallback:e=>(0,g.jsx)(S,{...i,error:e}),children:n}):(0,g.jsx)(S,{...i,environment:e.environment,error:new f(s.b,o.issues,e.environment,s.a)})}var P=(0,p.v)((0,p.p)((0,p.v)((0,p.s)(),(0,p.f)(/^(\d+[:/x]\d+)?$/,"Invalid aspect ratio format"))),(0,p.g)(e=>{if(!e)return l.a;let[t,n]=e.replace(":","/").replace("x","/").split("/").map(Number);return{width:t,height:n}}),(0,p.b)(e=>{let{width:t,height:n}=e;return t/n>=.1&&t/n<=10},"Aspect ratio out of acceptable range"));function j(e){let t=(0,p.w)(P,e);if(!t.success)throw new c.a;return t.output}function O(e){try{return j(e)}catch(e){return l.a}}var N=(0,p.o)({auto_mute:(0,p.p)((0,p.j)()),auto_play:(0,p.p)((0,p.j)()),loop:(0,p.p)((0,p.j)()),show_controls:(0,p.p)((0,p.j)()),single_play:(0,p.p)((0,p.j)())}),C=["draft","scheduled","unpublished"];async function R(e){let{brand:t,client:n,id:r,includeNonPublished:s,isBackgroun
1dVideo:o,options:l,playbackOverrides:d}=e,g=n.getInstance(),h=["published",...s?C:[]],y={brand:t,...o&&{for_background:!0},options:l,"statuses[]":h,...d},v=(0,u.i)("".concat(n.getBaseUrl(),"/v1/embed/video/").concat(r),y);try{let e=await g.url(v,!0).get().json();return(0,p.u)(a.g,e)}catch(e){throw(0,p.a)(e)?new c.b(a.g,e.issues,{context:{videoId:r.toString(),brand:t}}):(0,i.l)(e)?new c.d({context:{videoId:r.toString(),brand:t},options:{cause:e}}):(0,i.n)(e)?new c.f({context:{videoId:r.toString(),brand:t},options:{cause:e}}):(0,i.m)(e)?new c.e({context:{videoId:r.toString(),brand:t},options:{cause:e}}):(0,i.k)(e)?new c.c({context:{videoId:r.toString(),brand:t,statusCode:e.status},options:{cause:e}}):(0,u.e)(e)?new c.j({context:{videoId:r.toString(),brand:t},options:{cause:e}}):e}}function T(e){let t=e.id?["video-embed",{id:e.id,options:e.options,includeNonPublished:e.includeNonPublished,isBackgroundVideo:e.isBackgroundVideo,playbackOverrides:e.playbackOverrides}]:null,{data:n,error:s,isLoading:a,isValidating:i,mutate:o,retry:l}=(0,r.f)(t,t=>{let[,n]=t;return R({brand:e.brand,client:e.client,options:n.options,id:n.id,includeNonPublished:n.includeNonPublished||!1,isBackgroundVideo:n.isBackgroundVideo||!1,playbackOverrides:n.playbackOverrides})},{enabled:!!e.id,revalidateOnFocus:!1,revalidateIfStale:!1});return{data:n,error:s,isLoading:a,isValidating:i,mutate:o,retry:l}}function D(e){let{brand:t,config:n,playerSessionId:s,userId:a=null}=e;return(0,y.useMemo)(()=>new r.g({baseURL:n.urls.WORLD_API,headers:{"x-mychannels-brand":t,...!a&&{"x-mychannels-device-id":s},...a&&{"x-mychannels-account-id":a,"x-mychannels-user-id":a},"x-mychannels-client-platform":"web","x-mychannels-client-name":"videosdk","x-mychannels-client-version":"2.20.0"}}),[t,n.urls.WORLD_API,s,a])}function A(e){let{callback:t,children:n,options:r}=e,{ref:s}=function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{threshold:n=0,root:r=null,rootMargin:s="0%",freezeOnceVisible:a=!1,initialIsIntersecting:i=!1,onChange:o}=t,[l,d]=(0,y.useState)(null),[c,u]=(0,y.useState)(()=>({isIntersecting:i,entry:void 0})),p=(0,y.useRef)(void 0);p.current=o;let g=(null==(e=c.entry)?void 0:e.isIntersecting)&&a;(0,y.useEffect)(()=>{if(!l||!("IntersectionObserver"in window)||g)return;let e,t=new IntersectionObserver(n=>{let r=Array.isArray(t.thresholds)?t.thresholds:[t.thresholds];for(let t of n){let n=t.isIntersecting&&r.some(e=>t.intersectionRatio>=e);u({isIntersecting:n,entry:t}),p.current&&p.current(n,t),n&&a&&e&&(e(),e=void 0)}},{threshold:n,root:r,rootMargin:s});return t.observe(l),e=()=>t.disconnect(),()=>{t.disconnect()}},[l,n,r,s,g,a]);let h=(0,y.useRef)(null);return(0,y.useEffect)(()=>{var e;l||null==(e=c.entry)||!e.target||a||g||h.current===c.entry.target||(h.current=c.entry.target,u({isIntersecting:i,entry:void 0}))},[l,c.entry,a,g,i]),{ref:d,isIntersecting:c.isIntersecting,entry:c.entry}}({...r,onChange(e){e&&t()}});return(0,g.jsx)("div",{style:{height:"100%"},ref:s,children:n})}function V(e){let{onEnterViewport:t,children:n}=e;return(0,g.jsx)(A,{callback:t,options:{rootMargin:"20px"},children:n})}function L(e){return(0,g.jsx)("svg",{...e,viewBox:"0 0 50 50",xmlns:"http://www.w3.org/2000/svg",children:(0,g.jsx)("path",{d:"M20.644 14.813a2.52 2.52 0 0 0-2.519 2.519v16.619a2.519 2.519 0 0 0 3.889 2.114l13.043-8.45a2.518 2.518 0 0 0-.032-4.249l-13.044-8.169a2.52 2.52 0 0 0-1.337-.384Z"})})}var M={playButton:"at",icon:"it"};function q(e){let{className:t}=e;return(0,g.jsx)("div",{className:(0,h.$)(M.playButton,t,"entertainment-popcorn-player-play-button"),"aria-hidden":"true",children:(0,g.jsx)(L,{className:M.icon})})}var U={title:"J"};function B(e){let{playerSessionId:t,title:n}=e;return(0,g.jsx)("p",{"aria-label":'Video titel: "'.concat(n,'"'),className:U.title,id:"video-embed-".concat(t),children:n})}var F={poster:"ct",poster__image:"mt",poster__overlay:"K",poster__backdrop:"ut","poster__title-container":"yt","poster__title-container--with-left-content":"gt","poster__right-content":"bt","poster__play-button":"ht","poster__time-indicator":"xt"};function $(e){let{authenticatedIndicator:t,authLevel:n,className:r,subscribedIndicator:s}=e,i=function(e){let{authLevel:t,authenticatedIndicator:n,subscribedIndicator:r}=e,s=(0,p.u)(a.d,t);return"subscribed"===s&&r?r:"authenticated"===s&&n?n:void 0}({authLevel:n,authenticatedIndicator:t,subscribedIndicator:s});return i?(0,g.jsx)("div",{className:(0,h.A)(r),"aria-hidden":!0,
1children:i}):null}var z={screenReader:"vt"},G=e=>{let{hours:t,minutes:n,seconds:r}=e,s=[];return t>0&&s.push("".concat(t," ").concat(1===t?"uur":"uren")),n>0&&s.push("".concat(n," ").concat(1===n?"minuut":"minuten")),r>0&&s.push("".concat(r," ").concat(1===r?"seconde":"seconden")),0===s.length?"":1===s.length?s[0]:s.slice(0,-1).join(" en ")+" en "+s[s.length-1]};function H(e){let{className:t,durationMs:n,ariaTimeIndicator:r=G}=e,{formattedTime:s,dateTime:a,accessibleText:i}=(0,y.useMemo)(()=>{var e,t;let s,a,i,o={hours:Math.floor((s=Math.round(n/1e3))%86400/3600),minutes:Math.floor(s%3600/60),seconds:s%60};return{formattedTime:(t={hideHours:!0},a=(e=o).minutes.toString().padStart(2,"0"),i=e.seconds.toString().padStart(2,"0"),(null==t?void 0:t.hideHours)&&e.hours<1?"".concat(a,":").concat(i):"".concat(e.hours.toString().padStart(2,"0"),":").concat(a,":").concat(i)),dateTime:"PT".concat(o.hours?"".concat(o.hours,"H"):"").concat(o.minutes?"".concat(o.minutes,"M"):"").concat(o.seconds?"".concat(o.seconds,"S"):""),accessibleText:r({hours:o.hours,minutes:o.minutes,seconds:o.seconds})}},[r,n]);return(0,g.jsxs)("time",{className:t,dateTime:a,children:[(0,g.jsx)("span",{className:z.screenReader,children:i}),(0,g.jsx)("span",{"aria-hidden":"true",children:s})]})}var Y={timeIndicator:"wt"};function W(e){let{durationMs:t,className:n}=e;return(0,g.jsx)(H,{className:(0,h.$)(Y.timeIndicator,n),durationMs:t})}function K(e){var t;let{aspectRatio:n=l.a,authenticatedIndicator:r,className:s,liveIndicator:i,playerSessionId:o,subscribedIndicator:d,videoEmbed:u,onClick:y}=e,v="free"!==(0,p.u)(a.d,u.authLevel),m=u.live&&i?(0,g.jsx)("div",{"aria-hidden":!0,children:i}):null,f=v?(0,g.jsx)($,{authLevel:u.authLevel,authenticatedIndicator:r,className:F["poster__right-content"],subscribedIndicator:d}):(0,g.jsx)(c.t,{className:F["poster__right-content"],image:u.playerLogo}),b=1===(t=n).width&&1===t.height?{width:J,height:J}:t.width<t.height?{width:"720",height:J}:{width:J,height:"720"};return(0,g.jsx)(c.u,{playerSkin:u.playerSkin,className:s,children:(0,g.jsxs)("div",{className:F.poster,children:[u.image&&(0,g.jsx)(c.s.InternalImage,{src:{baseUrl:u.image.baseUrl,h:b.height,w:b.width,"fp-x":u.image.params["fp-x"],"fp-y":u.image.params["fp-y"]},alt:u.image.alt||u.title,className:F.poster__image,width:b.width,height:b.height}),(0,g.jsxs)("button",{type:"button",className:F.poster__overlay,onClick:y,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),y())},"aria-label":"Play ".concat(u.title,". ").concat("authenticated"===u.authLevel?"Login required":"subscribed"===u.authLevel?"Subscription required":"Click to play"),children:[(0,g.jsx)(q,{className:F["poster__play-button"]}),(0,g.jsx)("div",{className:F.poster__backdrop}),(0,g.jsxs)("div",{className:(0,h.$)(F["poster__title-container"],m&&F["poster__title-container--with-left-content"]),children:[m,(0,g.jsx)(B,{playerSessionId:o,title:u.title}),f]}),(0,g.jsx)(W,{className:F["poster__time-indicator"],durationMs:u.durationMs})]})]})})}var J="1280",Q={video:"kt","poster-overlay":"_t"};function X(e){let{aspectRatio:t,elements:n,onPlay:r,videoEmbed:s}=e,i=(0,a.j)(e=>e.playerSessionId);return(0,g.jsx)(K,{aspectRatio:t,className:Q["poster-overlay"],liveIndicator:null==n?void 0:n.liveIndicator,onClick:r,authenticatedIndicator:null==n?void 0:n.authenticatedIndicator,playerSessionId:i,subscribedIndicator:null==n?void 0:n.subscribedIndicator,videoEmbed:s})}var Z=(0,y.lazy)(()=>Promise.all([n.e(0),n.e(8200)]).then(n.bind(n,98200)).then(e=>({default:e.PlayerSession})));function ee(e){let{aspectRatio:t,client:n,config:r,elements:s,language:i,options:o,videoEmbed:l,onRequestToPlayVideo:d,onTrackEvent:c}=e,u=(0,a.j)(e=>e.access),p=(0,a.j)(e=>e.requestAccess),h=(0,a.j)(e=>e.currentVideoId);if(!l)return(0,g.jsx)(g.Fragment,{children:null==s?void 0:s.skeletonLoader});if(l.options.autoPlay&&"idle"===u.status)return(0,g.jsx)(V,{onEnterViewport:()=>p(h,d,{isAutoPlay:!0}),children:null==s?void 0:s.skeletonLoader});if("idle"===u.status||"denied"===u.status)return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(a.k,{aspectRatio:t,environment:r.environment,id:h,language:i,options:o,playbackParams:null,videoEmbed:l}),(0,g.jsx)(X,{aspectRatio:t,elements:s,onPlay:()=>p(h,d,{isAutoPlay:!1}
1),videoEmbed:l})]});let v="granted"===u.status?u.playbackParams:void 0;return(0,g.jsx)(y.Suspense,{fallback:null==s?void 0:s.skeletonLoader,children:(0,g.jsx)(Z,{aspectRatio:t,client:n,config:r,language:i,onRequestToPlayVideo:d,onTrackEvent:c,options:o,playbackParams:v,videoEmbed:l})})}var et=(0,p.o)({id:a.b,options:(0,p.s)(),events:(0,p.o)({onError:(0,p.p)((0,p.k)()),onRequestToPlayVideo:(0,p.k)(),onTrackEvent:(0,p.k)()}),playbackOverrides:(0,p.p)(N),elements:(0,p.p)((0,p.o)({authenticatedIndicator:(0,p.p)((0,p.h)()),liveIndicator:(0,p.p)((0,p.h)()),skeletonLoader:(0,p.p)((0,p.h)()),subscribedIndicator:(0,p.p)((0,p.h)())}))});function en(e){var t;let n=(0,r.d)(),[s]=(0,y.useState)(()=>{var t;return(0,a.h)({initialVideoId:e.id,playerSessionId:n,onError:null==(t=e.events)?void 0:t.onError})}),i=O(e.aspectRatio);return(0,g.jsx)(k,{action:"video-embed",aspectRatio:i,brand:e.brand,className:Q.video,environment:e.settings.environment,id:e.id,language:e.language,options:e.options,onError:null==(t=e.events)?void 0:t.onError,children:(0,g.jsx)(a.i,{value:s,children:(0,g.jsx)(c.l,{brand:e.brand,children:(0,g.jsx)(er,{...e})})})})}function er(e){let{brand:t}=(0,c.m)(),n=j(e.aspectRatio),i=(0,r.c)(e.language),o=b(e.settings.environment),l=(0,s.c)({...e.settings,environment:o}),d=(0,p.u)(et,e),u=(0,a.j)(e=>e.currentVideoId),h=(0,a.j)(e=>e.playerSessionId);(0,c.q)();let y=D({brand:t,config:l,playerSessionId:h,userId:null}),{data:v,error:m}=T({brand:t,client:y,id:u,options:d.options,playbackOverrides:d.playbackOverrides});if(m)throw m;return(0,g.jsx)(x,{brand:t,className:Q.video,children:(0,g.jsxs)(I,{aspectRatio:n,children:[(0,g.jsx)(ee,{videoEmbed:v,aspectRatio:n,client:y,config:l,language:i,options:d.options,onRequestToPlayVideo:e.events.onRequestToPlayVideo,onTrackEvent:e.events.onTrackEvent,elements:d.elements}),(null==v?void 0:v.structuredData)&&(0,g.jsx)(_,{structuredData:v.structuredData})]})})}var es={"playlist-error":"Yt","playlist-error__content":"Ct","playlist-error__message":"Ft","playlist-error__code":"Pt"};function ea(e){let{error:t}=e,n=t instanceof p.x?t.code:void 0,r=t instanceof p.x?t.getUserMessage():t.message;return(0,g.jsx)("div",{className:es["playlist-error"],"aria-live":"assertive",role:"alert",children:(0,g.jsx)("div",{className:es["playlist-error__content"],children:(0,g.jsxs)("div",{className:es["playlist-error__message"],children:[(0,g.jsx)("p",{children:r}),n&&(0,g.jsxs)("span",{className:es["playlist-error__code"],children:["Error Code: ",n]})]})})})}var ei={bar:"y"};function eo(e){return(0,g.jsxs)("svg",{width:"32",height:"32",viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,g.jsx)("path",{className:ei.bar,d:"M22 12V20"}),(0,g.jsx)("path",{className:ei.bar,d:"M10 14V18"}),(0,g.jsx)("path",{className:ei.bar,d:"M16 10V22"})]})}var el={icon:"It","icon-play":"Ut","icon-playing":"Et"};function ed(e){let{isPlaying:t}=e;return(0,g.jsx)("div",{className:el.icon,children:t?(0,g.jsx)(eo,{className:el["icon-playing"]}):(0,g.jsx)(L,{className:el["icon-play"]})})}var ec={teaser:"S",teaser__thumbnail:"Lt","teaser__thumbnail-image":"Qt","teaser__thumbnail-overlay":"Xt","teaser__thumbnail-overlay-duration":"qt",teaser__description:"Dt","teaser__description-title":"Jt"};function eu(e){let{currentId:t,durationMs:n,id:r,image:s,index:a,isSelected:i,onClick:o,title:l}=e;return(0,g.jsxs)("div",{className:ec.teaser,"data-id":r,"data-selected":i,onClick:o,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o())},role:"button",tabIndex:0,children:[(0,g.jsxs)("div",{className:ec.teaser__thumbnail,children:[(0,g.jsx)(c.s.InternalImage,{src:{baseUrl:s.baseUrl,h:"480",w:"480","fp-x":s.params["fp-x"],"fp-y":s.params["fp-y"]},alt:s.alt,className:ec["teaser__thumbnail-image"],height:"84",loading:void 0!==a&&a<4?"eager":"lazy",width:"112"}),(0,g.jsxs)("div",{className:ec["teaser__thumbnail-overlay"],children:[(0,g.jsx)(ed,{isPlaying:r===t}),(0,g.jsx)(H,{className:ec["teaser__thumbnail-overlay-duration"],durationMs:n})]})]}),(0,g.jsx)("div",{className:ec.teaser__description,children:(0,g.jsx)("div",{className:ec["teaser__description-title"],children:l})})]})}var ep=(0,p.o)({adsEnabled:(0,p.j)(),authLevel:(0,p.s)(),description:(0,p.s)(),durationMs:(0,p.n)(),enableCimTracking:(0,p.j)(),id:a.a,image:a.e,live:(0,p.j)(),title:(0,p.s)()}),eg=(0,p.o)({id:a.c,displayTitle:(0,p.j)(),layoutStyle:(0,p.s)(),featuredProduction:a.g,name:(0,p.s)(),options:a.f,productions:(0,p.i)(ep)});async function eh(e){let{client:t,id:n}=e,r=t.getInstance(),s=(0,u.i)("".concat(t.getBaseUrl(),"/v1/embed/video/").concat(n,"/playlist_inline"),{pageSize:24});try{let e=await r.url(s,!0).get().json();return(0,p.u)(eg,e)}catch(e){throw(0,p.a)(e)?new c.b(eg,e.issues,{context:{playlistId:n.toString()}}):(0,i.l)(e)?new c.g({context:{playlistId:n.toString()},options:{cause:e}}):(0,i.m)(e)?new c.i({context:{playlistId:n.toString()},options:{cause:e}}):(0,i.n)(e)?new c.h({context:{playlistId:n.toString()},options:{cause:e}}):(0,i.k)(e)?new c.c({context:{playlistId:n.toString(),statusCode:e.status},options:{cause:e}}):(0,u.e)(e)?new c.j({context:{playlistId:n.toString()},options:{cause:e}}):e}}function ey(e){let{brand:t}=(0,c.m)(),n=D({brand:t,...e}),{fetcher:s}=e,{selectedPlaylistItemId:a,selectPlaylistItem:i}=(0,o.c)(e=>({selectedPlaylistItemId:e.selectedPlaylistItemId,selectPlaylistItem:e.selectPlaylistItem})),{data:l,isLoading:d,error:u}=function(e){let t=["video-playlist-embed",e.id],{data:n,error:s,isLoading:a,isValidating:i,mutate:o,retry:l}=(0,r.f)(t,async t=>{let[,n]=t;return await eh({client:e.client,id:n.toString()})},{revalidateOnFocus:!1,revalidateIfStale:!1});return{data:n,error:s,isLoading:a,isValidating:i,mutate:o,retry:l}}({client:n,id:e.id}),{data:p,error:g}=T({brand:t,client:n,id:null!=a?a:null==l?void 0:l.featuredProduction.id,includeNonPublished:e.includeNonPublished}),h=l?{teasers:l.productions,title:l.name}:void 0,v=p?{volume:p.options.autoMute?0:null,autoPlay:!0,loop:!1,pauseOthersOnPlay:!0}:void 0,m=(0,y.useCallback)(e=>{i(e,s)},[i,s]);return{currentVideo:p,isLoading:d,playbackOptions:v,playlistData:h,playlistError:u,structuredData:null==l?void 0:l.featuredProduction.structuredData,videoEmbedError:g,onSelectPlaylistItem:m}}
1var ev={playlist:"Kt",playlist__featured:"Ot",playlist__featured__inner:"Vt","playlist__scroll-area":"Wt",playlist__header:"Zt","playlist__header-title":"en","playlist__header-total":"tn",playlist__teasers:"nn",playlist__poster:"on"},em=(0,y.lazy)(()=>Promise.all([n.e(0),n.e(2759)]).then(n.bind(n,52759)).then(e=>({default:e.Playback})));function ef(e){let{config:t,currentVideo:n,language:r,onReplay:s,onRequestToPlayVideo:a,onTrackEvent:i,playbackOptions:l,playerSessionId:d,playlistId:c,playNextVideo:u,startingMethod:p,subsequentPlayCounter:h,skeletonLoader:v,authenticatedIndicator:m,subscribedIndicator:f}=e,b=(0,o.c)(e=>e.access),_=(0,o.c)(e=>e.requestAccess);if(!n)return(0,g.jsx)(g.Fragment,{children:v});if("idle"===b.status||"denied"===b.status)return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(o.d,{environment:t.environment,id:n.id.toString(),playlistId:c,language:r,playbackParams:null,videoEmbed:n}),(0,g.jsx)(K,{className:ev.playlist__poster,authenticatedIndicator:m,playerSessionId:d,subscribedIndicator:f,videoEmbed:n,onClick:()=>{_(n.id.toString(),a,{isAutoPlay:!1})}})]});if(!l)return(0,g.jsx)(g.Fragment,{children:v});let E="granted"===b.status&&b.videoId===String(n.id)?b.playbackParams:null;return(0,g.jsx)(y.Suspense,{fallback:v,children:(0,g.jsx)(em,{config:t,currentVideo:n,language:r,onReplay:s,onTrackEvent:i,playbackOptions:l,playbackParams:E,playerSessionId:d,playlistId:c,playNextVideo:u,startingMethod:p,subsequentPlayCounter:h})})}var eb=(0,p.o)({id:a.b,events:(0,p.o)({onError:(0,p.p)((0,p.k)()),onRequestToPlayVideo:(0,p.k)(),onTrackEvent:(0,p.k)()})});function e_(e){var t;let{isDebugEnabled:n}=(0,c.p)(),s=(0,r.d)(),[a]=(0,y.useState)(()=>{var t;return(0,o.a)({playerSessionId:s,onError:null==(t=e.events)?void 0:t.onError})});return(0,g.jsx)(o.b,{value:a,children:(0,g.jsx)(r.e,{environment:e.settings.environment,action:"video-playlist",tags:{playlistId:e.id,brand:e.brand},onError:null==(t=e.events)?void 0:t.onError,fallback:t=>(0,g.jsxs)("div",{className:ev.playlist,children:[n&&(0,g.jsx)(y.Suspense,{fallback:null,children:(0,g.jsx)(c.o,{...e,environment:e.settings.environment,id:"unknown",playlistId:e.id,language:e.language,playerSessionId:s,brand:e.brand})}),(0,g.jsx)(ea,{error:t})]}),children:(0,g.jsx)(c.l,{brand:e.brand,children:(0,g.jsx)(eE,{...e})})})})}function eE(e){var t,n,a,i;let{brand:l}=(0,c.m)(),d=b(e.settings.environment),u=(0,s.c)({...e.settings,environment:d}),h=(0,r.c)(e.language),v=(0,p.u)(eb,e);(0,c.q)();let m=(0,o.c)(e=>e.playerSessionId),{currentVideo:f,onReplay:E,onSelectPlaylistItem:w,playbackOptions:I,playlistData:S,playlistError:k,playNextVideo:P,startingMethod:j,subsequentPlayCounter:O,videoEmbedError:N,structuredData:C}=function(e){let{currentVideo:t,onSelectPlaylistItem:n,playbackOptions:r,playlistData:s,structuredData:a,playlistError:i,videoEmbedError:l}=ey(e),{subsequentPlayCounter:d,startingMethodSource:u,incrementSubsequentPlay:p,playNextVideo:g}=(0,o.c)(e=>({subsequentPlayCounter:e.subsequentPlayCounter,startingMethodSource:e.startingMethodSource,incrementSubsequentPlay:e.incrementSubsequentPlay,playNextVideo:e.playNextVideo})),h=(0,y.useMemo)(()=>"initial"===u?(null==t?void 0:t.options.autoPlay)?c.F.autoplay:c.F.clicktoplay:"manual"===u?c.F.clicktoplaynext:c.F.autoplaynext,[u,t]),v=(0,y.useCallback)(()=>{s&&g(s.teasers,e.fetcher)},[g,e.fetcher,s]);return{currentVideo:t,onReplay:p,onSelectPlaylistItem:n,playbackOptions:r,playlistData:s,playlistError:i,playNextVideo:v,startingMethod:h,structuredData:a,subsequentPlayCounter:d,videoEmbedError:l}}({config:u,id:v.id,playerSessionId:m,userId:null,fetcher:e.events.onRequestToPlayVideo});if(k)throw k;if(!S)return(0,g.jsx)("div",{className:ev.playlist,children:null==(t=e.elements)?void 0:t.skeletonLoader});let R=!N;return(0,g.jsx)(x,{brand:l,children:(0,g.jsxs)("div",{className:ev.playlist,children:[(0,g.jsx)("div",{className:ev.playlist__featured,children:(0,g.jsxs)("div",{className:ev.playlist__featured__inner,children:[N&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(o.d,{environment:u.environment,id:f?String(f.id):"unknown",playlistId:v.id,language:h}),(0,g.jsx)(c.n,{error:N})]}),R&&(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(ef,{config:u,currentVideo:f,language:h,onReplay:E,onRequestToPlayVideo:e.events.onRequestToPlayVideo,onTrackEvent:e.events.onTrackEvent,playbackOptions:I,playerSessionId:m,playlistId:v.id,playNextVideo:P,startingMethod:j,subsequentPlayCounter:O,
1skeletonLoader:null==(n=e.elements)?void 0:n.skeletonLoader,authenticatedIndicator:null==(a=e.elements)?void 0:a.authenticatedIndicator,subscribedIndicator:null==(i=e.elements)?void 0:i.subscribedIndicator}),C&&(0,g.jsx)(_,{structuredData:C})]})]})}),(0,g.jsxs)("div",{className:ev["playlist__scroll-area"],children:[(0,g.jsxs)("div",{className:ev.playlist__header,children:[(0,g.jsx)("div",{className:ev["playlist__header-title"],children:S.title}),(0,g.jsxs)("div",{className:ev["playlist__header-total"],children:[S.teasers.length," video's"]})]}),(0,g.jsx)("div",{className:ev.playlist__teasers,children:S.teasers.map((e,t)=>(0,g.jsx)(eu,{...e,currentId:null==f?void 0:f.id,index:t,isSelected:(null==f?void 0:f.id)===e.id,onClick:()=>w(e.id)},e.id))})]})]})})}var ex={"background-video":"z"},ew=(0,p.o)({aspectRatio:P,brand:c.k,id:a.a,language:r.b});function eI(e){var t;return(0,g.jsx)(r.e,{environment:e.settings.environment,action:"background-video",tags:{videoId:e.id,brand:e.brand},fallback:()=>null,onError:null==(t=e.events)?void 0:t.onError,children:(0,g.jsx)(eS,{...e})})}function eS(e){var t,n,a;let{isDebugEnabled:i}=(0,c.p)(),o=(0,r.d)(),d=(0,p.u)(ew,e),u=(0,s.c)(e.settings),h=D({brand:d.brand,config:u,playerSessionId:o,userId:null}),{data:v,error:m}=T({brand:d.brand,client:h,id:d.id,isBackgroundVideo:!0});if(m)throw m;return v?(0,g.jsx)(I,{aspectRatio:null!=(n=d.aspectRatio)?n:l.a,children:(0,g.jsx)("div",{className:ex["background-video"],children:(0,g.jsx)(c.L,{content:{playbackOptions:{autoPlay:v.options.autoPlay,loop:v.options.loop,pauseOthersOnPlay:!1,volume:0},streams:v.streams},debug:i,ui:{showErrors:!1},config:{device:{name:"browser"},controls:{keyboardNavigation:void 0,language:d.language}},children:t=>(0,g.jsx)(g.Fragment,{children:i&&(0,g.jsx)(y.Suspense,{fallback:null,children:(0,g.jsx)(c.o,{brand:d.brand,environment:e.settings.environment,id:String(d.id),language:d.language,playbackOptions:t.context.playbackOptions,playerSessionId:o,playingState:t.value,videoEmbed:v})})})})})}):(0,g.jsx)(I,{aspectRatio:null!=(a=d.aspectRatio)?a:l.a,children:null==(t=e.elements)?void 0:t.skeletonLoader})}var ek={status:"unregistered"};function eP(){let{actor:e,controls:t}=(0,c.K)(),n=(0,v.d4)(e,e=>e?{state:e.value,isMuted:e.context.muted}:void 0,(e,t)=>(null==e?void 0:e.state)===(null==t?void 0:t.state)&&(null==e?void 0:e.isMuted)===(null==t?void 0:t.isMuted)),r=(0,y.useCallback)(()=>{null==t||t.play()},[t]),s=(0,y.useCallback)(()=>{null==t||t.pause()},[t]),a=(0,y.useCallback)(()=>{null==t||t.setVolume(0)},[t]),i=(0,y.useCallback)(()=>{null==t||t.setVolume(1)},[t]);return n&&t?{status:"registered",isMuted:n.isMuted,mute:a,pause:s,play:r,state:n.state,unmute:i}:ek}var ej={previewMode:"cn"};function eO(){return(0,g.jsx)("div",{className:ej.previewMode,children:"Preview Mode Enabled"})}var eN={previewModeOverlay:"mn",video:"un",video__wrapper:"yn","video__overlay--top-left":"gn","video__overlay--top-right":"bn","video__overlay--bottom-left":"hn"};function eC(e){let{brand:t}=(0,c.m)(),{isDebugEnabled:n}=(0,c.p)(),r=(0,a.j)(e=>e.playerSessionId);return n?(0,g.jsx)(y.Suspense,{fallback:null,children:(0,g.jsx)(c.o,{...e,brand:t,playerSessionId:r})}):null}function eR(e){var t;let{aspectRatio:n,client:r,videoEmbed:s,language:i,onRequestToPlayVideo:o,skeletonLoader:l,liveIndicator:d,authenticatedIndicator:p,subscribedIndicator:h,environment:v,options:m}=e,f=(0,a.j)(e=>e.access),b=(0,a.j)(e=>e.requestAccess),_=(0,a.j)(e=>e.currentVideoId),E=(0,a.j)(e=>e.playerSessionId),x=(0,a.j)(e=>e.playRecommendedVideo),w=!!s&&(0,a.l)({video:s,aspectRatio:n}),{recommendations:I,triggerFetch:S}=(0,a.n)({videoId:s?String(s.id):"",client:r,enabled:w}),k=(0,y.useCallback)(e=>{x(String(e.id),o),w&&S(String(e.id))},[x,o,w,S]);return s?s.options.autoPlay&&"idle"===f.status?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:eN.previewModeOverlay,children:(0,g.jsx)(eO,{})}),(0,g.jsx)(V,{onEnterViewport:()=>b(_,o,{isAutoPlay:!0}),children:l})]}):"idle"===f.status||"denied"===f.status?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(eC,{aspectRatio:n,environment:v,id:String(s.id),language:i,options:m,playingState:"idle",videoEmbed:s}),(0,g.jsx)("div",{className:eN.previewModeOverlay,children:(0,g.jsx)(eO,{})}),(0,g.jsx)(K,{aspectRatio:n,authenticatedIndicator:p,onClick:()=>b(_,o,{isAutoPlay:!1}
1),playerSessionId:E,subscribedIndicator:h,videoEmbed:s})]}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("div",{className:eN.previewModeOverlay,children:(0,g.jsx)(eO,{})}),(0,g.jsx)("div",{className:eN.video,children:(0,g.jsx)(c.u,{playerSkin:s.playerSkin,children:(0,g.jsx)(c.L,{content:{streams:s.streams,playbackOptions:{autoPlay:!0,volume:+!s.options.autoMute,loop:s.options.loop,pauseOthersOnPlay:!1},subtitles:null!=(t=s.subtitles)?t:void 0},ui:{showErrors:!0},config:{device:{name:"browser"},controls:{language:i,keyboardNavigation:"focusOnly"},defaultSubtitle:{language:i,enabledInAsset:!!s.subtitles&&i in s.subtitles}},handlers:{onPlayerLoadedOnlyOnce:()=>{w&&S()}},children:(e,t)=>{var r;let o=e.matches("playing")&&"content"===e.context.contentType,l=e.matches("paused")&&"content"===e.context.contentType,p=!!(e.matches("ended")&&(null==I||null==(r=I.videos)?void 0:r.length)&&s.options.singlePlay);return(0,g.jsxs)(g.Fragment,{children:[(o||l)&&(0,g.jsxs)("div",{className:eN.video__wrapper,children:[(0,g.jsx)("div",{className:eN["video__overlay--bottom-left"],children:(0,g.jsx)(c.M,{onClickout:()=>u.g.log("Clickout clicked"),controls:t,state:e,videoEmbed:s})}),(0,g.jsx)("div",{className:eN["video__overlay--top-right"],children:(0,g.jsx)(c.t,{image:s.playerLogo})}),(0,g.jsx)("div",{className:eN["video__overlay--top-left"],children:s.live&&d?(0,g.jsx)("div",{"aria-hidden":!0,children:d}):null})]}),p&&(0,g.jsx)(a.m,{isFullscreen:e.context.isFullscreen,onSelect:k,recommendations:I.videos}),(0,g.jsx)(eC,{aspectRatio:n,environment:v,id:String(s.id),language:i,options:m,playbackOptions:e.context.playbackOptions,playingState:e.value,videoEmbed:s})]})}})})})]}):(0,g.jsx)(g.Fragment,{children:l})}var eT="video-embed-preview",eD=(0,p.o)({id:a.b,options:(0,p.s)()});function eA(e){let t=O(e.aspectRatio);return(0,g.jsx)(k,{action:"".concat(eT,"-root"),aspectRatio:t,brand:e.brand,className:eN.video,environment:e.settings.environment,id:e.id,language:e.language,options:e.options,playbackOptions:e.playbackOverrides,children:(0,g.jsx)(eV,{...e})})}function eV(e){let t=(0,r.d)(),[n]=(0,y.useState)(()=>(0,a.h)({initialVideoId:e.id,playerSessionId:t})),s=j(e.aspectRatio),i=b(e.settings.environment),o=(0,r.c)(e.language),l={...(0,p.u)(eD,e),aspectRatio:s,language:o};return(0,g.jsx)(a.i,{value:n,children:(0,g.jsx)(c.l,{brand:e.brand,children:(0,g.jsx)(k,{...l,action:"".concat(eT,"-content"),brand:e.brand,className:eN.video,environment:i,playbackOptions:e.playbackOverrides,children:(0,g.jsx)(eL,{...l,elements:e.elements,playbackOverrides:e.playbackOverrides,settings:e.settings})})})})}function eL(e){var t;let{brand:n}=(0,c.m)(),r=(0,s.c)(e.settings),i=(0,a.j)(e=>e.currentVideoId),o=D({brand:n,config:r,playerSessionId:(0,a.j)(e=>e.playerSessionId),userId:null}),{data:l,error:d}=T({brand:n,client:o,id:i,includeNonPublished:!0,options:e.options,playbackOverrides:e.playbackOverrides});if(d)throw d;return l?(0,g.jsx)(x,{brand:n,className:eN.video,children:(0,g.jsx)(I,{aspectRatio:e.aspectRatio,children:(0,g.jsx)(eR,{...e,client:o,environment:r.environment,videoEmbed:l,onRequestToPlayVideo:eM})})}):(0,g.jsx)(x,{brand:n,className:eN.video,children:(0,g.jsx)(I,{aspectRatio:e.aspectRatio,children:null==(t=e.elements)?void 0:t.skeletonLoader})})}async function eM(){return{articleId:null,customPermissions:"",dmoi:null,isMobile:null,tcString:"",url:"",userId:null}}var eq={playlist:"kn",playlist__featured:"_n",playlist__featured__inner:"zn","playlist__scroll-area":"Hn",playlist__header:"jn","playlist__header-title":"An","playlist__header-total":"Nn","playlist__poster-overlay":"Bn",playlist__teasers:"Sn","preview-overlay":"Tn"},eU={"preview-overlay":"Gn","player-overlay":"Mn","player-overlay--top-right":"Rn"};function eB(e){let{isDebugEnabled:t}=(0,c.p)(),n=(0,o.c)(e=>e.playerSessionId),{brand:r}=(0,c.m)();return t?(0,g.jsx)(y.Suspense,{fallback:null,children:(0,g.jsx)(c.o,{...e,brand:r,playerSessionId:n})}):null}function eF(e){var t;let{currentVideo:n,environment:r,language:s,playbackOptions:a}=e;return(0,g.jsxs)(c.u,{playerSkin:n.playerSkin,children:[(0,g.jsx)("div",{className:eU["preview-overlay"],children:(0,g.jsx)(eO,{})}),(0,g.jsx)(c.L,{content:{streams:n.streams,playbackOptions:a,subtitles:null!=(t=n.subtitles)?t:void 0},ui:{showErrors:!0},config:{device:{name:"browser"},controls:{language:s,keyboardNavigation:"focusOnly"},defaultSubtitle:{language:s,enabledInAsset:!!n.subtitles&&s in n.subtitles}},children:e=>{let t=e.matches("playing")&&"content"===e.context.contentType,a=e.matches("paused")&&"content"===e.context.contentType;return(0,g.jsxs)(g.Fragment,{children:[(t||a)&&(0,g.jsx)("div",{className:eU["player-overlay"],children:(0,g.jsx)("div",{className:eU["player-overlay--top-right"],children:(0,g.jsx)(c.t,{image:n.playerLogo})})}),(0,g.jsx)(eB,{environment:r,id:String(n.id),language:s,playbackOptions:e.context.playbackOptions,playingState:e.value,videoEmbed:n})]})}})]})}function e$(e){let{authenticatedIndicator:t,currentVideo:n,environment:r,fetcher:s,language:a,playbackOptions:i,playerSessionId:l,skeletonLoader:d,subscribedIndicator:c}=e,u=(0,o.c)(e=>e.access),p=(0,o.c)(e=>e.requestAccess);return n?"idle"===u.status||"denied"===u.status?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(eB,{environment:r,id:String(n.id),language:a,playingState:"idle",videoEmbed:n}),(0,g.jsx)("div",{className:eq["preview-overlay"],children:(0,g.jsx)(eO,{})}
1),(0,g.jsx)(K,{className:eq["playlist__poster-overlay"],authenticatedIndicator:t,playerSessionId:l,subscribedIndicator:c,videoEmbed:n,onClick:()=>{p(n.id.toString(),s,{isAutoPlay:!1})}})]}):i?(0,g.jsx)(eF,{currentVideo:n,environment:r,language:a,playbackOptions:i}):(0,g.jsx)(g.Fragment,{children:d}):(0,g.jsx)(g.Fragment,{children:d})}var ez=(0,p.o)({id:a.b}),eG=async()=>({articleId:null,customPermissions:"",dmoi:null,isMobile:!1,tcString:"",url:"",userId:null});function eH(e){let{isDebugEnabled:t}=(0,c.p)(),[n]=(0,y.useState)(()=>(0,o.a)({playerSessionId:"video-playlist-preview"}));return(0,g.jsx)(o.b,{value:n,children:(0,g.jsx)(r.e,{environment:e.settings.environment,action:"video-playlist-preview",tags:{playlistId:e.id,brand:e.brand},fallback:n=>(0,g.jsxs)("div",{className:eq.playlist,children:[t&&(0,g.jsx)(y.Suspense,{fallback:null,children:(0,g.jsx)(c.o,{...e,environment:e.settings.environment,id:"unknown",playlistId:e.id})}),(0,g.jsx)(ea,{error:n})]}),children:(0,g.jsx)(c.l,{brand:e.brand,children:(0,g.jsx)(eY,{...e})})})})}function eY(e){var t,n,a,i;let{brand:o}=(0,c.m)(),l=b(e.settings.environment),d=(0,s.c)({...e.settings,environment:l}),u=(0,r.c)(e.language),h=(0,p.u)(ez,e),y="video-playlist-preview",{currentVideo:v,playbackOptions:m,playlistData:f,playlistError:_,videoEmbedError:E,onSelectPlaylistItem:w}=ey({config:d,id:h.id,includeNonPublished:!0,playerSessionId:y,userId:null,fetcher:eG});if(_)throw _;if(!f)return(0,g.jsx)(x,{brand:o,children:(0,g.jsx)("div",{className:eq.playlist,children:null==(t=e.elements)?void 0:t.skeletonLoader})});let I=!E;return(0,g.jsx)(x,{brand:o,children:(0,g.jsxs)("div",{className:eq.playlist,children:[(0,g.jsx)("div",{className:eq.playlist__featured,children:(0,g.jsxs)("div",{className:eq.playlist__featured__inner,children:[E&&(0,g.jsx)(c.n,{error:E}),I&&(0,g.jsx)(e$,{authenticatedIndicator:null==(n=e.elements)?void 0:n.authenticatedIndicator,currentVideo:v,environment:l,fetcher:eG,language:u,playbackOptions:m,playerSessionId:y,skeletonLoader:null==(a=e.elements)?void 0:a.skeletonLoader,subscribedIndicator:null==(i=e.elements)?void 0:i.subscribedIndicator})]})}),(0,g.jsxs)("div",{className:eq["playlist__scroll-area"],children:[(0,g.jsxs)("div",{className:eq.playlist__header,children:[(0,g.jsx)("div",{className:eq["playlist__header-title"],children:f.title}),(0,g.jsxs)("div",{className:eq["playlist__header-total"],children:[f.teasers.length," video's"]})]}),(0,g.jsx)("div",{className:eq.playlist__teasers,children:f.teasers.map(e=>(0,g.jsx)(eu,{...e,currentId:null==v?void 0:v.id,isSelected:(null==v?void 0:v.id)===e.id,onClick:()=>w(e.id)},e.id))})]})]})})}function eW(e){let{onEnterViewport:t,children:n}=e;return(0,g.jsx)(A,{callback:t,options:{rootMargin:"20px"},children:n})}var eK={video:"Yn",videoTeaserPoster:"Cn","hide-controls":"ne","display-mode-fill":"oe"};function eJ(e){let{aspectRatio:t,elements:n,onPlay:r,videoEmbed:s}=e,a=(0,d.c)(e=>e.playerSessionId);return(0,g.jsx)(K,{aspectRatio:t,authenticatedIndicator:null==n?void 0:n.authenticatedIndicator,className:eK.videoTeaserPoster,liveIndicator:null==n?void 0:n.liveIndicator,onClick:r,playerSessionId:a,subscribedIndicator:null==n?void 0:n.subscribedIndicator,videoEmbed:s})}var eQ=(0,y.lazy)(()=>Promise.all([n.e(0),n.e(8887)]).then(n.bind(n,88887)).then(e=>({default:e.PlayerSession})));function eX(e){let{aspectRatio:t,config:n,elements:r,language:s,videoEmbed:a,onRequestToPlayVideo:i,onTrackEvent:o}=e,l=(0,d.c)(e=>e.access),c=(0,d.c)(e=>e.requestAccess),u=(0,d.c)(e=>e.currentVideoId);if(!a)return(0,g.jsx)(g.Fragment,{children:null==r?void 0:r.skeletonLoader});if(a.options.autoPlay&&"idle"===l.status)return(0,g.jsx)(eW,{onEnterViewport:()=>c(u,i,{isAutoPlay:!0}),children:null==r?void 0:r.skeletonLoader});if("idle"===l.status||"denied"===l.status)return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(d.d,{aspectRatio:t,environment:n.environment,id:u,language:s,playbackParams:null,videoEmbed:a}),(0,g.jsx)(eJ,{aspectRatio:t,elements:r,onPlay:()=>c(u,i,{isAutoPlay:!1}),videoEmbed:a})]});let p="granted"===l.status?l.playbackParams:void 0;return(0,g.jsx)(y.Suspense,{fallback:null==r?void 0:r.skeletonLoader,children:(0,g.jsx)(eQ,{aspectRatio:t,config:n,language:s,onTrackEvent:o,playbackParams:p,videoEmbed:a})})}var eZ=(0,p.o)({id:a.b,events:(0,p.o)({onError:(0,p.p)((0,p.k)()),onRequestToPlayVideo:(0,p.k)(),onTrackEvent:(0,p.k)()}),playbackOptions:(0,p.o)({isAutoPlay:(0,p.j)(),isAutoMute:(0,p.j)(),isLooped:(0,p.j)(),isShowControls:(0,p.j)(),isDisplayModeFill:(0,p.p)((0,p.j)())}),elements:(0,p.p)((0,p.o)({authenticatedIndicator:(0,p.p)((0,p.h)()),liveIndicator:(0,p.p)((0,p.h)()),skeletonLoader:(0,p.p)((0,p.h)()),subscribedIndicator:(0,p.p)((0,p.h)())}))});function e0(e){var t;let n=(0,r.d)(),[s]=(0,y.useState)(()=>{var t;return(0,d.a)({initialVideoId:e.id,playerSessionId:n,onError:null==(t=e.events)?void 0:t.onError})}),a=O(e.aspectRatio);return(0,g.jsx)(k,{action:"video-embed",aspectRatio:a,brand:e.brand,className:eK.video,environment:e.settings.environment,id:e.id,language:e.language,onError:null==(t=e.events)?void 0:t.onError,children:(0,g.jsx)(d.b,{value:s,children:(0,g.jsx)(c.l,{brand:e.brand,children:(0,g.jsx)(e1,{...e})})})})}function e1(e){let{brand:t}=(0,c.m)(),n=j(e.aspectRatio),a=(0,r.c)(e.language),i=b(e.settings.environment),o=(0,s.c)({...e.settings,environment:i}),l=(0,p.u)(eZ,e),u=(0,d.c)(e=>e.currentVideoId),y=(0,d.c)(e=>e.playerSessionId);(0,c.q)();let v=D({brand:t,config:o,playerSessionId:y,userId:null}),{data:m,error:f}=T({brand:t,client:v,id:u,playbackOverrides:{auto_mute:l.playbackOptions.isAutoMute,auto_play:l.playbackOptions.isAutoPlay,loop:l.playbackOptions.isLooped,show_controls:l.playbackOptions.isS
1howControls}});if(f)throw f;return(0,g.jsx)(x,{brand:t,className:(0,h.A)(eK.video,!l.playbackOptions.isShowControls&&eK["hide-controls"],l.playbackOptions.isDisplayModeFill&&eK["display-mode-fill"]),children:(0,g.jsxs)(I,{aspectRatio:n,children:[(0,g.jsx)(eX,{videoEmbed:m,aspectRatio:n,config:o,language:a,onRequestToPlayVideo:e.events.onRequestToPlayVideo,onTrackEvent:e.events.onTrackEvent,elements:l.elements}),(null==m?void 0:m.structuredData)&&(0,g.jsx)(_,{structuredData:m.structuredData})]})})}},24212:(e,t,n)=>{n.d(t,{A:()=>Z,B:()=>ee,C:()=>et,D:()=>B,E:()=>F,F:()=>$,G:()=>z,H:()=>G,I:()=>H,J:()=>es,K:()=>ea,L:()=>eL,M:()=>e9,a:()=>eo,b:()=>el,c:()=>ed,d:()=>ec,e:()=>eu,f:()=>ep,g:()=>eg,h:()=>eh,i:()=>ey,j:()=>em,k:()=>eB,l:()=>eH,m:()=>eY,n:()=>eC,o:()=>eW,p:()=>L,q:()=>M,r:()=>eZ,s:()=>e5,t:()=>e8,u:()=>U,v:()=>Y,w:()=>W,x:()=>J,y:()=>Q,z:()=>X});var r,s,a,i=n(13187),o=n(66715),l=n(15583),d=n(5220),c=n(37386),u=n(11259),p=n(88491);new WeakMap,r=e=>void 0,s=0;var g=n(47902);function h(e,t,n,r,{assignment:s}){if(!t.context)throw Error("Cannot assign to undefined `context`. Ensure that `context` is defined in the machine config.");let a={},i={context:t.context,event:n.event,spawn:function(e,{machine:t,context:n},r,s){return(a,i)=>{let o=((a,i)=>{if("string"!=typeof a)return(0,g.c)(a,{id:i?.id,parent:e.self,syncSnapshot:i?.syncSnapshot,input:i?.input,src:a,systemId:i?.systemId});{let o=(0,g.R)(t,a);if(!o)throw Error(`Actor logic '${a}' not implemented in machine '${t.id}'`);let l=(0,g.c)(o,{id:i?.id,parent:e.self,syncSnapshot:i?.syncSnapshot,input:"function"==typeof i?.input?i.input({context:n,event:r,self:e.self}):i?.input,src:a,systemId:i?.systemId});return s[l.id]=l,l}})(a,i);return s[o.id]=o,e.defer(()=>{o._processingStatus!==g.V.Stopped&&o.start()}),o}}(e,t,n.event,a),self:e.self,system:e.system},o={};if("function"==typeof s)o=s(i,r);else for(let e of Object.keys(s)){let t=s[e];o[e]="function"==typeof t?t(i,r):t}let l=Object.assign({},t.context,o);return[(0,g.W)(t,{context:l,children:Object.keys(a).length?{...t.children,...a}:t.children}),void 0,void 0]}function y(e){function t(e,t){}return t.type="xstate.assign",t.assignment=e,t.resolve=h,t}let v=new WeakMap;function m(e,t,n){let r=v.get(e);return r?t in r||(r[t]=n()):(r={[t]:n()},v.set(e,r)),r[t]}let f={},b=e=>"string"==typeof e?{type:e}:"function"==typeof e?"resolve"in e?{type:e.type}:{type:e.name}:e;class _{constructor(e,t){if(this.config=e,this.key=void 0,this.id=void 0,this.type=void 0,this.path=void 0,this.states=void 0,this.history=void 0,this.entry=void 0,this.exit=void 0,this.parent=void 0,this.machine=void 0,this.meta=void 0,this.output=void 0,this.order=-1,this.description=void 0,this.tags=[],this.transitions=void 0,this.always=void 0,this.parent=t._parent,this.key=t._key,this.machine=t._machine,this.path=this.parent?this.parent.path.concat(this.key):[],this.id=this.config.id||[this.machine.id,...this.path].join(g.S),this.type=this.config.type||(this.config.states&&Object.keys(this.config.states).length?"compound":this.config.history?"history":"atomic"),this.description=this.config.description,this.order=this.machine.idMap.size,this.machine.idMap.set(this.id,this),this.states=this.config.states?(0,g.l)(this.config.states,(e,t)=>new _(e,{_parent:this,_key:t,_machine:this.machine})):f,"compound"===this.type&&!this.config.initial)throw Error(`No initial state specified for compound state node "#${this.id}". Try adding { initial: "${Object.keys(this.states)[0]}" } to the state config.`);this.history=!0===this.config.history?"shallow":this.config.history||!1,this.entry=(0,g.t)(this.config.entry).slice(),this.exit=(0,g.t)(this.config.exit).slice(),this.meta=this.config.meta,this.output="final"!==this.type&&this.parent?void 0:this.config.output,this.tags=(0,g.t)(e.tags).slice()}_initialize(){this.transitions=(0,g.q)(this),this.config.always&&(this.always=(0,g.u)(this.config.always).map(e=>(0,g.v)(this,g.N,e))),Object.keys(this.states).forEach(e=>{this.states[e]._initialize()})}get definition(){return{id:this.id,key:this.key,version:this.machine.version,type:this.t
1ype,initial:this.initial?{target:this.initial.target,source:this,actions:this.initial.actions.map(b),eventType:null,reenter:!1,toJSON:()=>({target:this.initial.target.map(e=>`#${e.id}`),source:`#${this.id}`,actions:this.initial.actions.map(b),eventType:null})}:void 0,history:this.history,states:(0,g.l)(this.states,e=>e.definition),on:this.on,transitions:[...this.transitions.values()].flat().map(e=>({...e,actions:e.actions.map(b)})),entry:this.entry.map(b),exit:this.exit.map(b),meta:this.meta,order:this.order||-1,output:this.output,invoke:this.invoke,description:this.description,tags:this.tags}}toJSON(){return this.definition}get invoke(){return m(this,"invoke",()=>(0,g.t)(this.config.invoke).map((e,t)=>{let{src:n,systemId:r}=e,s=e.id??(0,g.x)(this.id,t),a="string"==typeof n?n:`xstate.invoke.${(0,g.x)(this.id,t)}`;return{...e,src:a,id:s,systemId:r,toJSON(){let{onDone:t,onError:n,...r}=e;return{...r,type:"xstate.invoke",src:a,id:s}}}}))}get on(){return m(this,"on",()=>[...this.transitions].flatMap(([e,t])=>t.map(t=>[e,t])).reduce((e,[t,n])=>(e[t]=e[t]||[],e[t].push(n),e),{}))}get after(){return m(this,"delayedTransitions",()=>(0,g.y)(this))}get initial(){return m(this,"initial",()=>(0,g.z)(this,this.config.initial))}next(e,t){let n,r=t.type,s=[];for(let a of m(this,`candidates-${r}`,()=>(0,g.B)(this,r))){let{guard:i}=a,o=e.context,l=!1;try{l=!i||(0,g.w)(i,o,t,e)}catch(t){let e="string"==typeof i?i:"object"==typeof i?i.type:void 0;throw Error(`Unable to evaluate guard ${e?`'${e}' `:""}in transition for event '${r}' in state node '${this.id}': 2${t.message}`)}if(l){s.push(...a.actions),n=a;break}}return n?[n]:void 0}get events(){return m(this,"events",()=>{let{states:e}=this,t=new Set(this.ownEvents);if(e)for(let n of Object.keys(e)){let r=e[n];if(r.states)for(let e of r.events)t.add(`${e}`)}return Array.from(t)})}get ownEvents(){return Array.from(new Set([...this.transitions.keys()].filter(e=>this.transitions.get(e).some(e=>!(!e.target&&!e.actions.length&&!e.reenter)))))}}class E{constructor(e,t){this.config=e,this.version=void 0,this.schemas=void 0,this.implementations=void 0,this.__xstatenode=!0,this.idMap=new Map,this.root=void 0,this.id=void 0,this.states=void 0,this.events=void 0,this.id=e.id||"(machine)",this.implementations={actors:t?.actors??{},actions:t?.actions??{},delays:t?.delays??{},guards:t?.guards??{}},this.version=this.config.version,this.schemas=this.config.schemas,this.transition=this.transition.bind(this),this.getInitialSnapshot=this.getInitialSnapshot.bind(this),this.getPersistedSnapshot=this.getPersistedSnapshot.bind(this),this.restoreSnapshot=this.restoreSnapshot.bind(this),this.start=this.start.bind(this),this.root=new _(e,{_key:this.id,_machine:this}),this.root._initialize(),this.states=this.root.states,this.events=this.root.events}provide(e){let{actions:t,guards:n,actors:r,delays:s}=this.implementations;return new E(this.config,{actions:{...t,...e.actions},guards:{...n,...e.guards},actors:{...r,...e.actors},delays:{...s,...e.delays}})}resolveState(e){let t=(0,g.C)(this.root,e.value),n=(0,g.D)((0,g.g)(this.root,t));return(0,g.E)({_nodes:[...n],context:e.context||{},children:{},status:(0,g.F)(n,this.root)?"done":e.status||"active",output:e.output,error:e.error,historyValue:e.historyValue},this)}transition(e,t,n){return(0,g.G)(e,t,n,[]).snapshot}microstep(e,t,n){return(0,g.G)(e,t,n,[]).microstates}getTransitionData(e,t){return(0,g.H)(this.root,e.value,e,t)||[]}getPreInitialState(e,t,n){let{context:r}=this.config,s=(0,g.E)({context:"function"!=typeof r&&r?r:{},_nodes:[this.root],children:{},status:"active"},this);return"function"==typeof r?(0,g.I)(s,t,e,[y(({spawn:e,event:t,self:n})=>r({spawn:e,input:t.input,self:n}))],n,void 0):s}getInitialSnapshot(e,t){let n=(0,g.J)(t),r=[],s=this.getPreInitialState(e,n,r),a=(0,g.K)([{target:[...(0,g.L)(this.root)],source:this.root,reenter:!0,actions:[],eventType:null,toJSON:null}],s,e,n,!0,r),{snapshot:i}=(0,g.G)(a,n,e,r);return i}start(e){Object.values(e.children).forEach(e=>{"active"===e.getSnapshot().status&&e.start()})}getStateNodeById(e){let t=(0,g.M)(e),n=t.slice(1),r=(0,g.O)(t[0])?t[0].slice(1):t[0],s=this.idMap.get(r);if(!s)throw Error(`Child state node '#${r}' does not exist on machine '${this.id}'`);return(0,g.P)(s,n)}get definition(){return this.root.definition}toJSON(){return this.definition}getPersistedSnapshot(e,t){return(0,g.Q)(e,t)}restoreSnapshot(e,t){let n={},r=e.children;
2Object.keys(r).forEach(e=>{let s=r[e],a=s.snapshot,i=s.src,o="string"==typeof i?(0,g.R)(this,i):i;if(!o)return;let l=(0,g.c)(o,{id:e,parent:t.self,syncSnapshot:s.syncSnapshot,snapshot:a,src:i,systemId:s.systemId});n[e]=l});let s=function(e,t){if(!t||"object"!=typeof t)return{};let n={};for(let r in t)for(let s of t[r]){let t=function(e,t){if(t instanceof _)return t;try{return e.machine.getStateNodeById(t.id)}catch{}}(e,s);t&&(n[r]??=[],n[r].push(t))}return n}(this.root,e.historyValue),a=(0,g.E)({...e,children:n,_nodes:Array.from((0,g.D)((0,g.g)(this.root,e.value))),historyValue:s},this),i=new Set;return!function e(t,n){if(!i.has(t))for(let r in i.add(t),t){let s=t[r];if(s&&"object"==typeof s){if("xstate$$type"in s&&s.xstate$$type===g.$){t[r]=n[s.id];continue}e(s,n)}}}(a.context,n),a}}function x(e,t,n,r,{event:s}){return[t,{event:"function"==typeof s?s(n,r):s},void 0]}function w(e,{event:t}){e.defer(()=>e.emit(t))}function I(e){function t(e,t){}return t.type="xstate.emit",t.event=e,t.resolve=x,t.execute=w,t}let S=function(e){return e.Parent="#_parent",e.Internal="#_internal",e}({});function k(e,t,n,r,{to:s,event:a,id:i,delay:o},l){let d,c,u=t.machine.implementations.delays;if("string"==typeof a)throw Error(`Only event objects may be used with sendTo; use sendTo({ type: "${a}" }) instead`);let p="function"==typeof a?a(n,r):a;if("string"==typeof o){let e=u&&u[o];d="function"==typeof e?e(n,r):e}else d="function"==typeof o?o(n,r):o;let g="function"==typeof s?s(n,r):s;if("string"==typeof g){if(!(c=g===S.Parent?e.self._parent:g===S.Internal?e.self:g.startsWith("#_")?t.children[g.slice(2)]:l.deferredActorIds?.includes(g)?g:t.children[g]))throw Error(`Unable to send event to actor '${g}' from machine '${t.machine.id}'.`)}else c=g||e.self;return[t,{to:c,targetId:"string"==typeof g?g:void 0,event:p,id:i,delay:d},void 0]}function P(e,t,n){"string"==typeof n.to&&(n.to=t.children[n.to])}function j(e,t){e.defer(()=>{let{to:n,event:r,delay:s,id:a}=t;if("number"==typeof s)return void e.system.scheduler.schedule(e.self,n,r,s,a);e.system._relay(e.self,n,r.type===g.T?(0,g.U)(e.self.id,r.data):r)})}function O(e,t,n){function r(e,t){}return r.type="xstate.sendTo",r.to=e,r.event=t,r.id=n?.id,r.delay=n?.delay,r.resolve=k,r.retryResolve=P,r.execute=j,r}function N(e,t,n,r,{collect:s}){let a=[],i=function(e){a.push(e)};return i.assign=(...e)=>{a.push(y(...e))},i.cancel=(...e)=>{a.push((0,g.a)(...e))},i.raise=(...e)=>{a.push((0,g.r)(...e))},i.sendTo=(...e)=>{a.push(O(...e))},i.sendParent=(...e)=>{a.push(function(e,t){return O(S.Parent,e,t)}(...e))},i.spawnChild=(...e)=>{a.push((0,g.b)(...e))},i.stopChild=(...e)=>{a.push((0,g.s)(...e))},i.emit=(...e)=>{a.push(I(...e))},s({context:n.context,event:n.event,enqueue:i,check:e=>(0,g.w)(e,t.context,n.event,t),self:e.self,system:e.system},r),[t,void 0,a]}function C(e){function t(e,t){}return t.type="xstate.enqueueActions",t.collect=e,t.resolve=N,t}function R(e,t,n,r,{value:s,label:a}){return[t,{value:"function"==typeof s?s(n,r):s,label:a},void 0]}function T({logger:e},{value:t,label:n}){n?e(n,t):e(t)}function D(e=({context:e,event:t})=>({context:e,event:t}),t){function n(e,t){}return n.type="xstate.log",n.value=e,n.label=t,n.resolve=R,n.execute=T,n}function A(e,t){let n=(0,d.useRef)(t),r=(0,d.useCallback)(()=>{let t=n.current instanceof Function?n.current():n.current;if(typeof window>"u")return t;try{let n=window.sessionStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}},[e]),[s,a]=(0,d.useState)(()=>r()),i=(0,d.useCallback)(t=>{if(!(typeof window>"u"))try{let n=t instanceof Function?t(r()):t;window.sessionStorage.setItem(e,JSON.stringify(n)),a(n),window.dispatchEvent(new StorageEvent("session-storage",{key:e}))}catch(e){}},[e,r]);return(0,d.useEffect)(()=>{a(r())},[r]),(0,d.useEffect)(()=>{let t=t=>{t.key&&t.key!==e||a(r())};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}},[e,r]),[s,i]}var V="publishing-services-entertainment-video-debug";function L(){let[e,t]=function(e,t){let n=(0,d.useRef)(t),r=(0,d.useCallback)(()=>
2{let t=n.current instanceof Function?n.current():n.current;if(typeof window>"u")return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch(e){return t}},[e]),[s,a]=(0,d.useState)(()=>r()),i=(0,d.useCallback)(t=>{if(!(typeof window>"u"))try{let n=t instanceof Function?t(r()):t;window.localStorage.setItem(e,JSON.stringify(n)),a(n),window.dispatchEvent(new StorageEvent("local-storage",{key:e}))}catch(e){}},[e,r]);return(0,d.useEffect)(()=>{a(r())},[r]),(0,d.useEffect)(()=>{let t=t=>{t.key&&t.key!==e||a(r())};return window.addEventListener("storage",t),()=>{window.removeEventListener("storage",t)}},[e,r]),[s,i]}(V,!1),[n,r]=A(V,!1);return{isDebugEnabled:e||n,enableDebug:()=>t(!0),disableDebug:()=>{t(!1),r(!1)}}}function M(){let[e,t]=A("publishing-services-entertainment-video-session-id","");return(0,d.useEffect)(()=>{e||t(e=>e||i.a.generateIdentifier())},[e,t]),e}var q={playerOverrides:"a",hideSeekBar:"lt","branded-content":"_",vtmgo:"p",ziggo:"r",hideBrandLogo:"pt",customPlayButtonHoverEffect:"dt",default:"st",viaplay:"ft"};function U(e){let{children:t,className:n,playerSkin:r}=e;return(0,u.jsx)("div",{className:(0,c.$)(q.playerOverrides,q[r],n),children:t})}var B={airplay:"airplay",android:"android",browser:"browser",chromecast:"chromecast",ios:"ios",tv:"tv"},F={backgroundVideo:"background-video",destinationInline:"destination-inline",destinationOverlay:"destination-overlay",embedIframe:"embed-iframe",embedInline:"embed-inline",embedPlaylist:"embed-playlist",inlineTeaser:"inline-teaser",nativeEmbed:"native-embed",nativeOverlay:"native-overlay",verticalFeed:"vertical-feed",webEmbedExternal:"web-embed-external",webOverlay:"web-overlay"},$={autoplay:"autoplay",autoplaynext:"autoplaynext",clicktoautoplaynext:"clicktoautoplaynext",clicktoplay:"clicktoplay",clicktoplaynext:"clicktoplaynext",clicktoplayrecommended:"clicktoplayrecommended"},z={Dutch:"Dutch",English:"English",off:"off"},G={fullscreen:"fullscreen",pip:"pip",standard:"default",sticky:"sticky"},H={car:"car",standard:"default"},Y=class{toDict(){let e={};return e.player_content_type="video",e.yaml_version="0.1.3",e.player_version=this.amaliaVersion,e}constructor(e){this.amaliaVersion=e}},W=((a=class e{static getInstance(){return e.instance||(e.instance=new e),e.instance}setDefaultParams(e){this.defaultvideoplayerparams=e}getDefaultParams(){return this.defaultvideoplayerparams}constructor(){this.defaultvideoplayerparams=null}}).instance=null,a),K=class{constructor(e,t){this.name=e,this.params=t}},J=class{static createPlayerAdEndedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_ad_ended",Object.assign(t,e.toDict()),new K("player_ad_ended",t)}static createPlayerAdStartedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_ad_started",Object.assign(t,e.toDict()),new K("player_ad_started",t)}},Q=class{static createPlayerBrandedContent15Event(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_branded_content_15",Object.assign(t,e.toDict()),new K("player_branded_content_15",t)}},X=class{static createPlayerCanceledNextEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_canceled_next",Object.assign(t,e.toDict()),new K("player_canceled_next",t)}static createPlayerEndedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_ended",Object.assign(t,e.toDict()),new K("player_ended",t)}static createPlayerHeartbeatEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_heartbeat",Object.assign(t,e.toDict()),new K("player_heartbeat",t)}static createPlayerLoadedFiredOnceEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_loaded",Object.assign(t,e.toDict()),new K("player_loaded",t)}static createPlayerLoopedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_looped",Object.assign(t,e.toDict()),new K("player_looped",t)}static createPlayerMuteEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_mute",Object.assign(t,e.toDict()),new K("player_mute",t)}static createPlayerNextEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_next",Object.assign(t,e.toDict()),new K("player_next",t)}static createPlayerPauseEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_pause",Object.assign(t,e.toDict()),new K("player_pause",t)}static createPlayerPlayEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_play",Object.assign(t,e.toDict()),new K("player_play",t)}static createPlayerPreviousEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_previous",Object.assign(t,e.toDict()),new K("player_previous",t)}static createPlayerResumeEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_resume",Object.assign(t,e.toDict()),new K("player_resume",t)}static createPlayerSeekedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_seeked",Object.assign(t,e.toDict()),new K("player_seeked",t)}static createPlayerStartedFiredOnceEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_started",Object.assign(t,e.toDict()),new K("player_started",t)}static createPlayerStopEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_stop",Object.assign(t,e.toDict()),new K("player_stop",t)}static createPlayerSubtitlesChangedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_subtitles_changed",Object.assign(t,e.toDict()),new K("player_subtitles_changed",t)}static createPlayerUnmuteEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_unmute",Object.assign(t,e.toDict()),new K("player_unmute",t)}},Z=class{static createPlayerErrorEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.name="player_error",n.player_error_id=e,Object.assign(n,t.toDict()),new K("player_error",n)}},ee=class{static createPlayerClickToDescriptionEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.name="player_click_to_description",n.content_id=e,Object.assign(n,t.toDict()),new K("player_click_to_description",n)}static createPlayerClickToFullscreenEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.name="player_click_to_fullscreen",n.content_type=e,Object.assign(n,t.toDict()),new K("player_click_to_fullscreen",n)}static createPlayerClickToPlayerEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.name="player_click_to_player",n.content_id=e,Object.assign(n,t.toDict()),new K("player_click_to_player",n)}static createPlayerClickoutEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.name="player_clickout",n.content_id=e,Object.assign(n,t.toDict()),new K("player_clickout",n)}static createPlayerMiniCloseEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_mini_close",Object.assign(t,e.toDict()),new K("player_mini_close",t)}static createPlayerMiniOpenFullscreenEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_mini_open_fullscreen",Object.assign(t,e.toDict()),new K("player_mini_open_fullscreen",t)}static createPlayerRotateToFullscreenEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.name="player_rotate_to_fullscreen",n.content_type=e,Object.assign(n,t.toDict()),new K("player_rotate_to_fullscreen",n)}static createPlayerVideoQualitySelectedEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_video_quality_selected",Object.assign(t,e.toDict()),new K("player_video_quality_selected",t)}static createPlayerViewShowDescriptionEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.name="player_view_show_description",Object.assign(t,e.toDict()),new K("player_view_show_description",t)}static createShareEvent(e){let t={},n=W.getInstance().getDefaultParams();return n&&Object.assign(t,n().toDict()),t.screen_name="video_player",t.type="player",t.content_id=e,new K("share",t)}static createTeaserClickVideoProductionEvent(e,t){let n={},r=W.getInstance().getDefaultParams();return r&&Object.assign(n,r().toDict()),n.list="video-list_recommendations",n.page_type="player",n.type="video-item",n.content_id=e,Object.assign(n,t.toDict()),new K("teaser_click",n)}},et=class{toDict(){let e={};return e.player_branded_content=this.playerBrandedContent,e.player_content_id=this.playerContentId,e.player_duration=this.playerDuration,e.player_livebroadcast=this.playerLiveBroadcast,e.player_playback_device=this.playerPlaybackDevice,e.player_playback_mode=this.playerPlaybackMode,e.player_playback_speed=this.playerPlaybackSpeed,e.player_position=this.playerPosition,e.player_reco_request_id=this.playerRecoRequestId,e.player_resolution=this.playerResolution,e.player_session_id=this.playerSessionId,e.player_starting_method=this.playerStartingMethod,e.player_subtitles=this.playerSubtitles,e.player_viewing_mode=this.playerViewingMode,e.player_visible=this.playerVisible,e.scene=this.scene,e}constructor(e,t,n,r,s,a,i,o,l,d,c,u,p,g,h,y){this.playerBrandedContent=e,this.playerContentId=t,this.playerDuration=n,this.playerLiveBroadcast=r,this.playerPlaybackDevice=s,this.playerPlaybackMode=a,this.playerPlaybackSpeed=i,this.playerPosition=o,this.playerRecoRequestId=l,this.playerResolution=d,this.playerSessionId=c,this.playerStartingMethod=u,this.playerSubtitles=p,this.playerViewingMode=g,this.playerVisible=h,this.scene=y}},en=()=>{},er=(0,d.createContext)({actor:void 0,controls:void 0,registerControls:en,unregisterControls:en});function es(e){let{children:t}=e,[n,r]=(0,d.useState)(),s=(0,d.useCallback)((e,t)=>{r(n=>(null==n?void 0:n.actor)===e&&n.controls.play===t.play&&n.controls.pause===t.pause&&n.controls.setVolume===t.setVolume?n:{actor:e,controls:t})},[]),a=(0,d.useCallback)(e=>{r(t=>{if((null==t?void 0:t.actor)!==e)return t})},[]),i=(0,d.useMemo)(()=>({actor:null==n?void 0:n.actor,controls:null==n?void 0:n.controls,registerControls:s,unregisterControls:a}),[n,s,a]);return(0,u.jsx)(er.Provider,{value:i,children:t})}function ea(){return(0,d.useContext)(er)}var ei={VIDEO_NOT_FOUND:{code:5002,internalMessage:"Video not found",externalMessage:"Deze video is niet (meer) beschikbaar"},VIDEO_UNAVAILABLE_LEGAL:{code:5003,internalMessage:"Unavailable for legal reasons",externalMessage:"Deze video is niet (meer) beschikbaar"},PLAYLIST_NOT_FOUND:{code:5004,internalMessage:"Playlist not found",externalMessage:"Deze afspeellijst is niet (meer) beschikbaar"},PLAYLIST_UNAVAILABLE_LEGAL:{code:5005,internalMessage:"Playlist unavailable for legal reasons",externalMessage:"Deze afspeellijst is niet (meer) beschikbaar"},ASPECT_RATIO:{code:5006,internalMessage:"Invalid aspect ratio format",externalMessage:'Aspect ratio moet in dit formaat zijn: "width:height" en moet gangbaar zijn zoals 16:9, 9:16, 1:1, etc.'}
2,PLAYLIST_EMPTY:{code:5007,internalMessage:"Playlist contains no productions",externalMessage:"Deze afspeellijst bevat geen videos"},VIDEO_UNPROCESSABLE_CONTENT:{code:5008,internalMessage:"Video API responds with a 422 error: Unprocessable content",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},VIDEO_API_VALIDATION:{code:5009,internalMessage:"Video API validation failed",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},UNKNOWN_VIDEO_API:{code:5010,internalMessage:"Unknown video API error",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},NO_VALID_STREAMS:{code:5011,internalMessage:"No valid video streams found",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},VIDEO_CONNECTION:{code:5012,internalMessage:"Network connection error while fetching video data",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld. Controleer je internetverbinding en ververs de pagina."},VIDEO_BRAND_CONFIG:{code:5013,internalMessage:"Invalid video brand config",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."}};Object.fromEntries(Object.entries(ei).map(e=>{let[t,n]=e;return[t,n.code]}));var eo=class extends o.x{constructor(e){let t=ei.ASPECT_RATIO;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},el=class extends o.z{constructor(e,t,n){super(e,t,ei.VIDEO_API_VALIDATION,n),this.domain="video"}},ed=class extends o.x{constructor(e){let t=ei.UNKNOWN_VIDEO_API;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},ec=class extends o.x{constructor(e){let t=ei.VIDEO_NOT_FOUND;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},eu=class extends o.x{constructor(e){let t=ei.VIDEO_UNPROCESSABLE_CONTENT;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},ep=class extends o.x{constructor(e){let t=ei.VIDEO_UNAVAILABLE_LEGAL;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},eg=class extends o.x{constructor(e){let t=ei.PLAYLIST_NOT_FOUND;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},eh=class extends o.x{constructor(e){let t=ei.PLAYLIST_UNAVAILABLE_LEGAL;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},ey=class extends o.x{constructor(e){let t=ei.PLAYLIST_EMPTY;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},ev=class extends o.x{constructor(e){let t=ei.NO_VALID_STREAMS;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},em=class extends o.x{constructor(e){let t=ei.VIDEO_CONNECTION;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video"}},ef=class extends o.x{constructor(e){let t=ei.VIDEO_BRAND_CONFIG;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="video-brand-config"}},eb=["1080p","720p","576p","480p","360p"],e_=["adaptive","dash","progressive"],eE={adaptive:"hls",dash:"dash",progressive:"mp4"};function ex(e){let t=e_.indexOf(e.type);return"progressive"===e.type&&e.quality?1e3*t+eb.indexOf(e.quality):1e3*t}var ew=new class{register(e,t){this.players.set(e,{actor:e,player:t})}updatePlayer(e,t){let n=this.players.get(e);n&&(n.player=t)}unregister(e){this.players.delete(e)}pauseAllExcept(e){this.players.forEach((t,n)=>{n!==e&&n.getSnapshot().context.playbackOptions.pauseOthersOnPlay&&t.player&&t.player.pause()})}size(){return this.players.size}clear(){this.players.clear()}constructor(){this.players=new Map}},eI=(function e({schemas:t,actors:n,actions:r,guards:s,delays:a}){return{assign:y,sendTo:O,raise:g.r,log:D,cancel:g.a,stopChild:g.s,enqueueActions:C,emit:I,spawnChild:g.b,createStateConfig:e=>e,createAction:e=>e,createMachine:e=>new E({...e,schemas:t},{actors:n,actions:r,guards:s,delays:a}),extend:i=>e({schemas:t,actors:n,actions:{...r,...i.actions},guards:{...s,...i.guards},delays:{...a,...i.delays}})}})({types:{context:{},events:{},input:{},emitted:{}},actions:{setDuration:y({duration:e=>{let{event:t}=e;return"LOADED"!==t.type?0:t.duration}}),setError:y({error:e=>{let{event:t}=e;if("ERROR"===t.type)return t.error}}),clearError:y({error:void 0,hasLooped:!1}),incrementRetries:y({retries:e=>{let{context:t}=e;return t.retries+1}}),resetRetries:y({retries:0}),resetAll:y({duration:0,error:void 0,retries:0,hasUserPaused:!1,isViewportPaused:!1,hasLooped:!1,hasStarted:!1,subtitle:void 0,playbackOptions:e=>{let{context:t}=e;return{...t.playbackOptions,loop:!1}}}),setVolume:y({playbackOptions:e=>{let{context:t,event:n}=e;if("VOLUME_CHANGE"!==n.type)return{...t.playbackOptions,volume:1};let r=Math.max(0,Math.min(1,n.volume));return{...t.playbackOptions,volume:r}},muted:e=>{let{event:t}=e;return"VOLUME_CHANGE"===t.type&&0===t.volume}}),setContentTypeToAd:y({contentType:"ad"}),setContentTypeToContent:y({contentType:"content"}),markAutoPlayed:y({hasAutoPlayed:!0}),markLooped:y({hasLooped:!0}),markStarted:y({hasStarted:!0}),setQuality:y({quality:e=>{let{event:t}=e;if("QUALITY_CHANGE"===t.type)return t.quality}}),setSubtitle:y({subtitle:e=>{let{event:t}=e;if("SUBTITLE_CHANGE"===t.type)return t.subtitle}}
2),setBufferingState:y({isBuffering:e=>{let{event:t}=e;return"BUFFERING_START"===t.type}}),setHasUserPaused:y({hasUserPaused:e=>{let{context:t,event:n}=e;return"PAUSED"===n.type&&!t.isViewportPaused&&!t.hasUserPaused||t.hasUserPaused}}),setSeekingState:y({isSeeking:e=>{let{event:t}=e;return"SEEKING"===t.type}}),setInViewport:y({visibleInViewport:!0}),setOutOfViewport:y({visibleInViewport:!1}),setViewportPaused:y({isViewportPaused:!0}),setViewportResumed:y({isViewportPaused:!1}),setFullscreen:y({isFullscreen:e=>{let{event:t}=e;return"FULLSCREEN_CHANGE"===t.type&&t.isFullscreen}}),setControlsVisibility:y({isControlsVisible:e=>{let{event:t}=e;return"CONTROLS_VISIBILITY_CHANGE"===t.type&&t.isControlsVisible}}),pauseOtherPlayers:e=>{let{self:t,context:n}=e;n.playbackOptions.pauseOthersOnPlay&&ew.pauseAllExcept(t)},syncPlaybackOptions:y({playbackOptions:e=>{let{context:t,event:n}=e;return"SYNC_PLAYBACK_OPTIONS"!==n.type?t.playbackOptions:{...t.playbackOptions,...n.options}}})},guards:{canRetry:e=>{let{context:t}=e;return t.retries<3},isLooped:e=>{let{context:t}=e;return t.hasLooped}}}).createMachine({context:e=>{let{input:t}=e;return{playbackOptions:{volume:t.playbackOptions.volume,autoPlay:t.playbackOptions.autoPlay,loop:t.playbackOptions.loop,pauseOthersOnPlay:t.playbackOptions.pauseOthersOnPlay},muted:0===t.playbackOptions.volume,hasUserPaused:!1,isViewportPaused:!1,retries:0,duration:0,visibleInViewport:!1,contentType:null,hasAutoPlayed:!1,hasLooped:!1,hasStarted:!1,isBuffering:!1,isControlsVisible:!1,isFullscreen:!1,isSeeking:!1}},id:"videoPlayer",initial:"idle",states:{idle:{on:{LOADING:{target:"loading",actions:["clearError","resetRetries"]},RESET:{target:"idle",actions:["resetAll"]}}},loading:{on:{LOADED:{target:"ready",actions:["setDuration"]},ERROR:{target:"error",actions:["setError"]},UNLOADING:{target:"unloading"},RESET:{target:"idle",actions:["resetAll"]}}},unloading:{on:{IDLE:{target:"idle"},RESET:{target:"idle",actions:["resetAll"]}}},ready:{on:{PLAYING:{target:"playing"},ENTER_VIEWPORT:{actions:["setInViewport"]},LEAVE_VIEWPORT:{actions:["setOutOfViewport"]},ERROR:{target:"error",actions:["setError"]},UNLOADING:{target:"unloading"},RESET:{target:"idle",actions:["resetAll"]}}},playing:{entry:["pauseOtherPlayers"],on:{PAUSED:{target:"paused"},BUFFERING_START:{actions:["setBufferingState",I({type:"handler.bufferingChange",isBuffering:!0})]},BUFFERING_END:{actions:["setBufferingState",I({type:"handler.bufferingChange",isBuffering:!1})]},SEEKING:{actions:["setSeekingState"]},SEEKED:{actions:["setSeekingState",I({type:"handler.seeked"})]},ENTER_VIEWPORT:{actions:["setInViewport"]},LEAVE_VIEWPORT:{actions:["setOutOfViewport"]},ENDED:{target:"ended"},ERROR:{target:"error",actions:["setError"]},UNLOADING:{target:"unloading"},RESET:{target:"idle",actions:["resetAll"]}}},paused:{entry:[I(()=>({type:"handler.pause"})),"setHasUserPaused"],on:{PLAYING:{target:"playing",actions:[I({type:"handler.resume"})]},ENTER_VIEWPORT:{actions:["setInViewport"]},LEAVE_VIEWPORT:{actions:["setOutOfViewport"]},ERROR:{target:"error",actions:["setError"]},UNLOADING:{target:"unloading"},RESET:{target:"idle",actions:["resetAll"]}}},ended:{entry:[I({type:"handler.ended"}),I(e=>{let{context:t}=e;return t.playbackOptions.loop?{type:"handler.loop"}:{type:"handler.noop"}})],on:{PLAYING:{target:"playing",actions:[I({type:"handler.replay"})]},SEEKING:{actions:["setSeekingState"]},SEEKED:[{guard:"isLooped",target:"playing",actions:["setSeekingState",I({type:"handler.loopSeekComplete"})]},{target:"playing",actions:["setSeekingState",I({type:"handler.seeked"}),I({type:"handler.replay"})]}],ERROR:{target:"error",actions:["setError"]},UNLOADING:{target:"unloading"},RESET:{target:"idle",actions:["resetAll"]}}},error:{entry:[I(e=>{let{context:t}=e;return{type:"handler.error",error:t.error}})],on:{LOADING:{target:"loading",actions:["clearError","resetRetries"]},RETRY:[{target:"loading",guard:"canRetry",actions:["incrementRetries","clearError"]},{target:"idle",actions:["resetAll"]}],RESET:{target:"idle",actions:["resetAll"]}}}},on:{PLAY:{actions:[I({type:"handler.play"}),"markStarted"]},VOLUME_CHANGE:{actions:[I(e=>{let{event:t}=e;return{type:"handler.volumeChange",volume:t.volume}}),I(e=>{let{context:t,event:n}=e,r=0===t.playbackOptions.volume,s=0===n.volume;return r!==s?{type:"handler.mutedChange",muted:s}:{type:"handler.noop"}}),"setVolume"]},QUALITY_CHANGE:{actions:[I(e=>{let{context:t,event:n}=e;return"QUALITY_CHANGE"!==n.type||"system"===n.origin||t.quality===n.qual
2ity?{type:"handler.noop"}:{type:"handler.qualityChange",quality:n.quality}}),"setQuality"]},SUBTITLE_CHANGE:{actions:[I(e=>{let{context:t,event:n}=e;return"SUBTITLE_CHANGE"!==n.type||"system"===n.origin||t.subtitle===n.subtitle?{type:"handler.noop"}:{type:"handler.subtitleChange",subtitle:n.subtitle}}),"setSubtitle"]},AD_STARTED:{actions:["setContentTypeToAd",I({type:"handler.adStart"})]},AD_ENDED:{actions:["setContentTypeToContent",I({type:"handler.adComplete"})]},CONTENT_STARTED:{actions:["setContentTypeToContent",I({type:"handler.contentStarted"})]},CONTENT_ENDED:{actions:[I(e=>{let{context:t}=e;return t.playbackOptions.loop?{type:"handler.noop"}:{type:"handler.contentEnded"}})]},MARK_AUTO_PLAYED:{actions:["markAutoPlayed"]},MARK_LOOPED:{actions:["markLooped"]},VIEWPORT_PAUSE:{actions:["setViewportPaused"]},VIEWPORT_RESUME:{actions:["setViewportResumed"]},FULLSCREEN_CHANGE:{actions:[I(e=>{let{event:t}=e;return{type:"handler.fullscreenChange",isFullscreen:t.isFullscreen}}),"setFullscreen"]},CONTROLS_VISIBILITY_CHANGE:{actions:["setControlsVisibility"]},SYNC_PLAYBACK_OPTIONS:{actions:["syncPlaybackOptions"]}}}),eS={GENERIC:{code:9001,internalMessage:"Player has encountered an error",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},SCRIPT_LOAD_ERROR:{code:9002,internalMessage:"Script failed to load",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},POPCORN_PLAYER_ERROR:{code:9003,internalMessage:"Popcorn player error",externalMessage:"Er ging iets mis waardoor de video helaas niet kan worden afgespeeld."},GEO_BLOCKING_ERROR:{code:9004,internalMessage:"Video is geo-blocked",externalMessage:"Deze video kan niet worden bekeken van deze locatie."}};Object.fromEntries(Object.entries(eS).map(e=>{let[t,n]=e;return[t,n.code]}));var ek=class extends o.x{constructor(e,t){let n=eS.GENERIC;super(n.code,n.internalMessage+(e?": ".concat(e):""),n.externalMessage,t),this.domain="player"}},eP=class extends o.x{constructor(e,t){let n=eS.POPCORN_PLAYER_ERROR;super(n.code,e?"Code ".concat(e.code,": ").concat(JSON.stringify(e.data)):n.internalMessage,n.externalMessage,t),this.domain="player",this.popcornError=e}},ej=class extends o.x{constructor(e){let t=eS.GEO_BLOCKING_ERROR;super(t.code,t.internalMessage,t.externalMessage,e),this.domain="player"}};function eO(){let e=new Set;return{subscribe:t=>(e.add(t),()=>{e.delete(t)}),notify(){for(let t of e)t()}}}var eN={error:"Ve",error__content:"We",error__message:"et",error__code:"tt"};function eC(e){let{error:t}=e,n=t instanceof o.x?t.code:void 0,r=t instanceof o.x?t.getUserMessage():t.message;return(0,u.jsx)("div",{className:eN.error,"aria-live":"assertive",role:"alert",children:(0,u.jsxs)("div",{className:eN.error__content,children:[(0,u.jsx)("p",{className:eN.error__message,children:r}),n&&(0,u.jsxs)("span",{className:eN.error__code,children:["Error Code: ",n]})]})})}var eR=class extends d.Component{static getDerivedStateFromError(e){return(0,o.y)(e)?{error:e}:{error:new ek}}componentDidCatch(e,t){console.error("Player error boundary caught an error:",e,t)}render(){var e;return this.state.error?null==(e=this.props.showErrors)||e?this.props.fallback?this.props.fallback(this.state.error):(0,u.jsx)(eC,{error:this.state.error}):null:this.props.children}constructor(e){super(e),this.state={error:null}}};function eT(e,t){(0,d.useEffect)(()=>{if(document.getElementById(t))return;let n=document.createElement("link");return n.id=t,n.rel="stylesheet",n.href=e,document.head.appendChild(n),()=>{var e;null==(e=document.getElementById(t))||e.remove()}},[e,t])}var eD={container:"At"},eA=(0,d.memo)(function(e){let{children:t,loadParams:n,config:r,tracking:s={},debug:a=!1}=e,i=(0,d.useRef)(r);eT("".concat(l.a.URLS.RESOURCE,"/player-styles.css"),"popcorn-player-styles"),eT("".concat(l.a.URLS.RESOURCE,"/player-ui-styles.css"),"popcorn-player-ui-styles"),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=(0,o.D)(e,{onError:()=>{throw new eP}}),r=(0,d.useMemo)(()=>{var e,r,s,a,i,o,l,d,c;if("ready"!==n)return Promise.resolve();let u=[null==(r=(s=popcornPlayer).loadScript)?void 0:r.call(s,null==(e=popcornPlayer.ScriptName)?void 0:e.GoogleIMA)].filter(
2Boolean);return t.enableCimTracking&&u.push(null==(i=(o=popcornPlayer).loadPlugin)?void 0:i.call(o,null==(a=popcornPlayer.PluginName)?void 0:a.CIM),null==(d=(c=popcornPlayer).loadScript)?void 0:d.call(c,null==(l=popcornPlayer.ScriptName)?void 0:l.GemiusPlayer)),Promise.all(u.filter(Boolean)).then(()=>{})},[n,t.enableCimTracking]);(0,d.use)(r)}("".concat(l.a.URLS.RESOURCE,"/player.js"),{enableCimTracking:!!s.cim});let c=(0,d.useRef)(null),p=function(e){let{ref:t,config:n,debug:r=!1}=e,[s,a]=(0,d.useState)(null),i=(0,d.useRef)(n);return(0,d.useEffect)(()=>{if(!t.current)return;let e=new popcornPlayer.Player(t.current,i.current);return a(e),()=>{e.destroy()}},[t]),(0,d.useEffect)(()=>{s&&popcornPlayer.enableLogs(r)},[r,s]),(0,d.useEffect)(()=>()=>{s&&s.unload()},[s]),s}({ref:c,config:i.current,debug:a});return(0,u.jsx)("div",{ref:c,className:eD.container,children:p&&t?t(p):null})}),eV={autoPlay:!1,volume:null,loop:!1,pauseOthersOnPlay:!1};function eL(e){var t,n;let r,{content:s,ui:a,tracking:o,debug:c=!1,debugStateMachine:g=!1,config:h,onLoad:y,handlers:v={},children:m}=e,[f,b]=(0,d.useState)(null),{isDebugEnabled:_}=L(),{persistedVolume:E,updateVolume:x}=function(){let[e,t]=A("publishing-services-entertainment-video-persisted-volume",()=>({volume:1,muted:!1,creation:Date.now()}));return{persistedVolume:e,updateVolume:(0,d.useCallback)((e,n)=>{t({volume:e,muted:n,creation:Date.now()})},[t])}}(),w=(0,d.useMemo)(()=>{var e;let t=null!=(e=null==s?void 0:s.playbackOptions)?e:eV;return null===t.volume?{...t,volume:E.volume}:{...t,volume:t.volume}},[null==s?void 0:s.playbackOptions]),I=(0,d.useMemo)(()=>{let e=v.onVolumeChange;return(t,n)=>{x(t,0===t),null==e||e(t,n)}},[v.onVolumeChange,x]),{defaultSubtitle:S}=h,{onContentStarted:k}=v,P=(0,d.useCallback)(e=>{var t;if(null==k||k(e),!S)return;let{language:n,enabledInAsset:r}=S,s=null==(t=e.controls.getCurrentTextTracks())?void 0:t.find(e=>e.language===n);s&&!s.isActive&&r&&e.controls.selectTextTrack(n,{origin:"system"})},[k,S]),{state:j,actorRef:O,controls:N,send:C}=function(e,t){var n;let r,{playbackOptions:s,debug:a,...o}=t,l=(0,d.useRef)(e);l.current=e;let[c,u,g]=(0,p.zl)(eI,{input:{playbackOptions:s,volume:null!=(n=null==e?void 0:e.volume)?n:void 0},inspect:a?e=>{console.log("[Player State Machine]",e)}:void 0}),{subscribe:h}=function(e){let{player:t}=e,[n]=(0,d.useState)(eO);return(0,d.useEffect)(()=>{if(t)return t.addEventListener(window.popcornPlayer.Events.TimeChange,n.notify),()=>{t.removeEventListener(window.popcornPlayer.Events.TimeChange,n.notify)}},[t,n]),n}({player:e}),y=(0,d.useMemo)(()=>({load:t=>{null==e||e.load(t)},unload:()=>{null==e||e.unload()},play:()=>{null==e||e.play()},pause:()=>{null==e||e.pause()},seek:t=>{null==e||e.seekTo(t)},setVolume:t=>{null==e||e.setVolume(t)},retry:()=>{u({type:"RETRY"})},reset:()=>{u({type:"RESET"}),null==e||e.unload()},getCurrentTime:()=>{var t;return null!=(t=null==e?void 0:e.contentTime)?t:null},subscribeToTimeChange:h,getCurrentDimensions:()=>{var t;return null!=(t=null==e?void 0:e.dimensions)?t:null},getCurrentTextTracks:()=>{var t;return null!=(t=null==e?void 0:e.textTracks)?t:null},markAutoPlayed:()=>{u({type:"MARK_AUTO_PLAYED"})},viewportPause:()=>{u({type:"VIEWPORT_PAUSE"}),y.pause()},viewportResume:()=>{u({type:"VIEWPORT_RESUME"}),y.play()},selectTextTrack:(t,n)=>{var r;let s=null==e||null==(r=e.textTracks)?void 0:r.find(e=>e.language===t);return!!s&&!!e&&((null==n?void 0:n.origin)==="system"&&u({type:"SUBTITLE_CHANGE",subtitle:t,origin:"system"}),e.selectTextTrack(s.id),!0)}}),[e,u,h]);(function(e){let{state:t,controls:n,onPlayerLoadedOnlyOnce:r}=e,s=(0,d.useRef)(!1);(0,d.useEffect)(()=>{(t.matches("ready")||t.matches("playing"))&&!s.current&&r&&(r({state:t,controls:n}),s.current=!0)},[t,n,r])})({state:c,controls:y,onPlayerLoadedOnlyOnce:o.onPlayerLoadedOnlyOnce}),(r=(0,d.useRef)(null)).current=e,(0,d.useEffect)(()=>{let e=g.on("*",e=>{var t,n,s,a,i,l,d,c,p,h,v,m,f,b,_,E,x,w,I;let S={state:g.getSnapshot(),controls:y};switch(e.type){case"handler.play":null==(t=o.onPlay)||t.call(o,S);break;case"handler.resume":null==(n=o.onResume)||n.call(o,S);break;case"handler.pause":null==(s=o.onPause)||s.call(o,S);break;case"handler.bufferingChange":null==(a=o.onBufferingChange)||a.call(o,e.isBuffering,S);break;case"handler.ended":break;case"handler.seeked":null==(i=o.onSeeked)||i.call(o,S);break;case"handler.error":null==(l=o.onError)||l.call(o,e.error,S);break;case"handler.fullscreenChange":null==(d=o.onFullscreenChange)||d.call(o,e.isFullscreen,S);break;case"handler.volumeChange":null==(c=o.onVolumeChange)||c.call(o,e.volume,S);break;case"handler.mutedChange":null==(p=o.onMutedChange)||p.call(o,e.muted,S);break;case"handler.qualityChange":null==(h=o.onQualityChange)||h.call(o,S);break;
2case"handler.subtitleChange":null==(v=o.onSubtitleChange)||v.call(o,e.subtitle,S);break;case"handler.adStart":null==(m=o.onAdStart)||m.call(o,S);break;case"handler.adComplete":null==(f=o.onAdComplete)||f.call(o,S);break;case"handler.contentStarted":null==(b=o.onContentStarted)||b.call(o,S);break;case"handler.contentEnded":null==(_=o.onContentEnded)||_.call(o,S);break;case"handler.loop":u({type:"MARK_LOOPED"}),null==(E=r.current)||E.seekTo(0),null==(x=o.onLoop)||x.call(o,S);break;case"handler.loopSeekComplete":null==(w=r.current)||w.play(!0);break;case"handler.replay":null==(I=o.onReplay)||I.call(o,S)}});return()=>e.unsubscribe()},[g,y,o,u]);let{onTimeChange:v}=o;return(0,d.useEffect)(()=>{if(v)return h(()=>{var e;let t=null==(e=l.current)?void 0:e.contentTime;null!=t&&v(t,{state:g.getSnapshot(),controls:y})})},[v,h,g,y]),function(e){let{player:t,actorRef:n,controls:r,send:s,onEnterViewport:a,onLeaveViewport:i}=e;(0,d.useEffect)(()=>{if(!t)return;let e=e=>{let t={state:n.getSnapshot(),controls:r};e.visibleInViewport?(s({type:"ENTER_VIEWPORT"}),null==a||a(t)):(s({type:"LEAVE_VIEWPORT"}),null==i||i(t))};return t.addEventListener(window.popcornPlayer.Events.VisibleInViewportChange,e),()=>{t.removeEventListener(window.popcornPlayer.Events.VisibleInViewportChange,e)}},[n,r,a,i,t,s])}({player:e,actorRef:g,controls:y,send:u,onEnterViewport:o.onEnterViewport,onLeaveViewport:o.onLeaveViewport}),function(e){let{player:t,actorRef:n,controls:r,send:s}=e;(0,d.useEffect)(()=>{var e;if(!t)return;let n=e=>{var n;e.to===window.popcornPlayer.LoadStatus.Loading?s({type:"LOADING"}):e.to===window.popcornPlayer.LoadStatus.Loaded?s({type:"LOADED",duration:null!=(n=t.contentDuration)?n:0}):e.to===window.popcornPlayer.LoadStatus.Unloading?s({type:"UNLOADING"}):e.to===window.popcornPlayer.LoadStatus.Idle&&s({type:"IDLE"})},r=e=>{e.to===window.popcornPlayer.PlayheadState.Playing?s({type:"PLAYING"}):e.to===window.popcornPlayer.PlayheadState.Paused?s({type:"PAUSED"}):e.to===window.popcornPlayer.PlayheadState.Ended&&(s({type:"ENDED"}),s({type:"CONTENT_ENDED"}))},a=e=>{e.isBuffering?s({type:"BUFFERING_START"}):s({type:"BUFFERING_END"})},o=()=>{s({type:"SEEKING"})},l=()=>{s({type:"SEEKED"})},d=e=>{var t,n;s({type:"ERROR",error:!function(e){if(null==e||e.code!==popcornPlayer.PlayerErrorCode.InvalidAsset)return!1;let{data:t}=e;return t.code===popcornPlayer.PlayerErrorInvalidAssetCode.Geoblocked}(e.error)?(null==(t=e.error)||null==(n=t.data)?void 0:n.type)==="networkError"?new em({options:{cause:new i.c({options:{cause:e.error instanceof Error?e.error:void 0}})}}):new eP(e.error):new ej})},c=e=>{s({type:"VOLUME_CHANGE",volume:e.volume})},u=()=>{s({type:"AD_STARTED"})},p=()=>{s({type:"AD_ENDED"})},g=()=>{var e,n;let r=null==(n=t.videoQualities)||null==(e=n.find(e=>{let{isActive:t}=e;return t}))?void 0:e.height;void 0!==r&&s({type:"QUALITY_CHANGE",quality:r})},h=()=>{var e,n;s({type:"SUBTITLE_CHANGE",subtitle:(null==(n=t.textTracks)||null==(e=n.find(e=>{let{isActive:t}=e;return t}))?void 0:e.language)||null})},y=()=>{if(s({type:"PLAY"}),t.adBreak){let e=()=>{s({type:"CONTENT_STARTED"}),t.removeEventListener(window.popcornPlayer.Events.AdBreakEnded,e)};t.addEventListener(window.popcornPlayer.Events.AdBreakEnded,e)}else s({type:"CONTENT_STARTED"})},v=e=>{s({type:"FULLSCREEN_CHANGE",isFullscreen:e.isFullscreen})},m=e=>{s({type:"CONTROLS_VISIBILITY_CHANGE",isControlsVisible:e.isActive})};return t.addEventListener(window.popcornPlayer.Events.LoadStatusChange,n),t.addEventListener(window.popcornPlayer.Events.PlayheadStateChange,r),t.addEventListener(window.popcornPlayer.Events.BufferingChange,a),t.addEventListener(window.popcornPlayer.Events.Seeking,o),t.addEventListener(window.popcornPlayer.Events.Seeked,l),t.addEventListener(window.popcornPlayer.Events.Error,d),t.addEventListener(window.popcornPlayer.Events.VolumeChange,c),t.addEventListener(window.popcornPlayer.Events.AdStarted,u),t.addEventListener(window.popcornPlayer.Events.AdEnded,p),t.addEventListener(window.popcornPlayer.Events.VideoQualitiesChange,g),t.addEventListener(window.popcornPlayer.Events.TextTracksChange,h),t.addEventListener(window.popcornPlayer.Events.Started,y),t.addEventListener(window.popcornPlayer.Events.FullscreenChange,v),null==(e=t.controls)||e.addEventListener(window.popcornPlayer.ControlsEvents.ActiveChange,m),()=>{var e;t.removeEventListener(window.popcornPlayer.Events.LoadStatusChange,n),t.removeEventListener(window.popcornPlayer.Events.PlayheadStateChange,r),t.removeEventListener(window.popcornPlayer.Events.BufferingChange,a),t.removeEventListener(window.popcornPlayer.Events.Seeking,o),t.removeEventListener(window.popcornPlayer.Events.Seeked,l),t.removeEventListener(window.popcornPlayer.Events.Error,d),t.removeEventListener(window.popcornPlayer.Events.VolumeChange,c),t.removeEventListener(window.popcornPlayer.Events.AdStarted,u),t.removeEventListener(window.popcornPlayer.Events.AdEnded,p),t.removeEventListener(window.popcornPlayer.Events.VideoQualitiesChange,g),t.removeEventListener(window.popcornPlayer.Events.TextTracksChange,h),t.removeEventListener(window.popcornPlayer.Events.Started,y),t.removeEventListener(window.popcornPlayer.Events.FullscreenChange,v),null==(e=t.controls)||e.removeEventListener(window.popcornPlayer.ControlsEvents.ActiveChange,m)}},[n,r,t,s])}({player:e,actorRef:g,controls:y,send:u}),{state:c,send:u,controls:y,actorRef:g}}(f,{playbackOptions:w,debug:g||_,...v,onContentStarted:P,onVolumeChange:I}),{registerControls:R,unregisterControls:T}=ea();(0,d.useEffect)(()=>(R(O,N),()=>T(O)),[O,N,R,T]),(0,d.useEffect)(()=>
2{if(null==s?void 0:s.playbackOptions){let{loop:e,autoPlay:t,pauseOthersOnPlay:n}=s.playbackOptions;C({type:"SYNC_PLAYBACK_OPTIONS",options:{autoPlay:t,pauseOthersOnPlay:n,loop:e}})}},[null==s?void 0:s.playbackOptions,C]);let D=null!=(n=null==s||null==(t=s.streams[0])?void 0:t.url)?n:null,V=(r=(0,d.useRef)(void 0),(0,d.useEffect)(()=>{r.current=D},[D]),r.current),M=(0,d.useMemo)(()=>{if(s)return function(e){var t;let n,{advertisementUrl:r,streams:s,options:{autoPlay:a,volume:o},subtitles:d,tracking:c={},startTime:u}=e,p=function(e){if(!e||0===e.length)throw new ev({context:{reason:"No streams provided",streams:[]}});let t=e.filter(e=>{var t,n;return e.url&&e.url.trim().length>0?(t=e.type,e_.includes(t))?"progressive"!==e.type||(n=e.quality,!!eb.includes(n))||(i.g.warn('[getHighestQualityStream] Progressive stream has invalid quality "'.concat(e.quality,'":'),e),!1):(i.g.warn('[getHighestQualityStream] Unsupported stream type "'.concat(e.type,'":'),e),!1):(console.warn("[getHighestQualityStream] Stream missing valid URL:",e),!1)});if(0===t.length)throw new ev({context:{reason:"No valid streams found. Provided ".concat(e.length," stream(s) but none were valid."),streams:e.map(e=>({type:e.type,quality:e.quality,url:e.url}))}});let n=t.sort((e,t)=>ex(e)-ex(t))[0];return{type:eE[n.type],url:n.url}}(s),g=c.cim?{channel:(t=c.cim).channel,contentType:t.contentType,duration:t.duration,identifier:t.identifier,materialId:t.materialId,name:t.name,section:t.section,sourceType:t.sourceType,tv:t.tv}:void 0;return{adaptToViewport:!0,allowMutedAutoplay:!0,autoPlay:a,clientAdProvider:r?{name:l.a.GOOGLE_IMA,url:r}:void 0,remoteTextTracks:d&&(n=Object.entries(d).filter(e=>{let[t]=e;return"default"!==t}).map(e=>{let[t,n]=e;return{language:t,src:n}})).length>0?n:void 0,sessionId:c.sessionId,startTime:u,tracking:g?{cim:g}:void 0,streams:[p],volume:o}}({streams:s.streams,options:w,advertisementUrl:s.advertisementUrl,subtitles:s.subtitles,tracking:o,startTime:s.startTime})},[s,w,o]);(0,d.useEffect)(()=>{f&&(D&&M&&(null==y||y(),f.load(M)),!D&&V&&f.unload())},[D,V,M,f,y]),(0,d.useEffect)(()=>(ew.register(O,f),()=>{ew.unregister(O)}),[O,f]),(0,d.useEffect)(()=>{f&&ew.updatePlayer(O,f)},[f,O]);let q={showErrors:a.showErrors};return(0,u.jsx)(eR,{showErrors:q.showErrors,children:(0,u.jsx)(d.Suspense,{fallback:(0,u.jsx)("div",{}),children:(0,u.jsx)(eA,{loadParams:M,config:h,tracking:o,debug:c,children:e=>(0,u.jsx)(eM,{player:e,state:j,controls:N,onPlayerReady:b,showErrors:q.showErrors,children:m})})})})}function eM(e){let{player:t,state:n,controls:r,onPlayerReady:s,showErrors:a,children:i}=e;return(0,d.useEffect)(()=>{s(t)},[t,s]),(0,u.jsxs)(u.Fragment,{children:[i(n,r),a&&n.matches("error")&&n.context.error&&(0,u.jsx)(eC,{error:n.context.error})]})}var eq={"net.persgroep.brand.dpgmediaweb":{advertising:null,brand:"net.persgroep.brand.dpgmediaweb",cim:null,language:"nl",telemetry:"dpgmediaweb"},"net.dpgmedia.brand.vtwonen":{advertising:"vtwonennl",brand:"net.dpgmedia.brand.vtwonen",cim:null,language:"nl",telemetry:"vtwonennl"},"net.persgroep.brand.7s7":{advertising:"7sur7",brand:"net.persgroep.brand.7s7",cim:"7sur7",language:"fr",telemetry:"7sur7"},"net.dpgmedia.brand.libelle":{advertising:"libelle",brand:"net.dpgmedia.brand.libelle",cim:null,language:"nl",telemetry:"libelle"},"net.persgroep.brand.parool":{advertising:"parool",brand:"net.persgroep.brand.parool",cim:null,language:"nl",telemetry:"parool"},"net.persgroep.brand.hln":{advertising:"hln",brand:"net.persgroep.brand.hln",cim:"hln",language:"nl",telemetry:"hln"},"net.persgroep.brand.qmusic":{advertising:"qmusicbe",brand:"net.persgroep.brand.qmusic",cim:null,language:"nl",telemetry:"qmusicbe"},"net.persgroep.brand.vk":{advertising:"volkskrant",brand:"net.persgroep.brand.vk",cim:null,language:"nl",telemetry:"volkskrant"},"net.dpgmedia.brand.donaldduck":{advertising:null,brand:"net.dpgmedia.brand.donaldduck",cim:null,language:"nl",telemetry:"donaldduck"},"net.persgroep.brand.tennisnl":{advertising:null,brand:"net.persgroep.brand.tennisnl",cim:null,language:"nl",telemetry:"tennisnl"},"net.persgroep.brand.24kitchen":{advertising:null,brand:"net.persgroep.brand.24kitchen",cim:null,language:"nl",telemetry:"24kitchen"},"net.persgroep.brand.trouw":{advertising:"trouw",brand:"net.persgroep.brand.trouw",cim:null,language:"nl",telemetry:"trouw"},"net.dpgmedia.brand.kekmama":{advertising:null,brand:"net.dpgmedia.brand.kekmama",cim:null,language:"nl",telemetry:"kekmama"},"net.persgroep.brand.default":{advertising:null,brand:"net.persgroep.brand.default",cim:null,language:"nl",telemetry:"default"},"net.persgroep.brand.tubantia":{advertising:"tubantia",brand:"net.persgroep.brand.tubantia",cim:null,language:"nl",telemetry:"tubantia"},"net.persgroep.brand.themaskedsinger":{advertising:null,brand:"net.persgroep.brand.themaskedsinger",cim:null,language:"nl",telemetry:"themaskedsinger"},"net.persgroep.brand.foxsports":{advertising:null,brand:"net.persgroep.brand.foxsports",cim:null,language:"nl",telemetry:"foxsports"},"net.persgroep.brand.sportnieuwsnl":{advertising:"sportnieuws",brand:"net.persgroep.brand.sportnieuwsnl",cim:null,language:"nl",telemetry:"sportnieuws"},"net.dpgmedia.brand.margriet":{advertising:"margriet",brand:"net.dpgmedia.brand.margriet",cim:null,language:"nl",telemetry:"margriet"},"net.persgroep.brand.omnyStudioBe":{advertising:null,brand:"net.persgroep.brand.omnyStudioBe",cim:null,language:"nl",telemetry:"omny_studio_be"},"net.persgroep.brand.destem":{advertising:"bndestem",brand:"net.persgroep.brand.destem",cim:null,language:"nl",telemetry:"bndestem"},"net.persgroep.brand.pzc":{advertising:"pzc",brand:"net.persgroep.brand.pzc",cim:null,language:"nl",telemetry:"pzc"},"net.dpgmedia.brand.joenl":{advertising:"joenl",brand:"net.dpgmedia.brand.joenl",cim:null,language:"nl",telemetry:"joenl"},"net.persgroep.brand.ad":{advertising:"ad",brand:"net.persgroep.brand.ad",cim:null,language:"nl",telemetry:"ad"},"net.persgroep.brand.nu":{advertising:"nu",brand:"net.persgroep.brand.nu",cim:null,language:"nl",telemetry:"nu"},"net.persgroep.brand.eindhovensdagblad":{advertising:"eindhovensdagblad",brand:"net.persgroep.brand.eindhovensdagblad",cim:null,language:"nl",telemetry:"eindhovensdagblad"},"net.persgroep.brand.indebuurt":{advertising:"indebuurt",brand:"net.persgroep.brand.indebuurt",cim:null,language:"nl",telemetry:"indebuurt"},"net.persgroep.brand.beentertainment":{advertising:null,brand:"net.persgroep.brand.beentertainment",cim:null,language:"nl",telemetry:"beentertainment"},"net.persgroep.brand.degelderlander":{advertising:"gelderlander",brand:"net.persgroep.brand.degelderlander",cim:null,language:"nl",telemetry:"gelderlander"},"net.persgroep.brand.teamnl":{advertising:null,brand:"net.persgroep.brand.teamnl",cim:null,language:"nl",telemetry:"teamnl"},"net.persgroep.brand.brandedcontentbe":{advertising:null,brand:"net.persgroep.brand.brandedcontentbe",cim:null,language:"nl",telemetry:"brandedcontentbe"},"net.persgroep.brand.unassigned":{advertising:null,brand:"net.persgroep.brand.unassigned",cim:null,language:"nl",telemetry:"unassigned"},"net.persgroep.brand.viva":{advertising:null,brand:"net.persgroep.brand.viva",cim:null,language:"nl",telemetry:"viva"},"net.persgroep.brand.oudersvannu":{advertising:"oudersvannu",brand:"net.persgroep.brand.oudersvannu",cim:null,language:"nl",telemetry:"oudersvannu"},"net.persgroep.brand.digitalsalesdevelopment":{advertising:null,brand:"net.persgroep.brand.digitalsalesdevelopment",cim:null,language:"nl",telemetry:"digitalsalesdevelopment"},"net.dpgmedia.brand.veronicasuperguide":{advertising:"superguide",brand:"net.dpgmedia.brand.veronicasuperguide",cim:null,language:"nl",telemetry:"veronicasuperguide"},"net.persgroep.brand.reclamefolder":{advertising:null,brand:"net.persgroep.brand.reclamefolder",cim:null,language:"nl",telemetry:"reclamefolder"},"net.persgroep.brand.willy":{advertising:"willy",brand:"net.persgroep.brand.willy",cim:null,language:"nl",telemetry:"willy"},"net.persgroep.brand.joe":{advertising:"joebe",brand:"net.persgroep.brand.joe",cim:null,language:"nl",telemetry:"joebe"},"net.persgroep.brand.knwu":{advertising:null,brand:"net.persgroep.brand.knwu",cim:null,language:"nl",telemetry:"knwu"},"net.persgroep.brand.vtm":{advertising:"vtm",brand:"net.persgroep.brand.vtm",cim:null,language:"nl",telemetry:"vtm"},"net.persgroep.brand.humo":{advertising:"humo",brand:"net.persgroep.brand.humo",cim:"humo",language:"nl",telemetry:"humo"},"net.persgroep.brand.omnyStudioNl":{advertising:null,brand:"net.persgroep.brand.omnyStudioNl",cim:null,language:"nl",telemetry:"omny_studio_nl"},"net.persgroep.brand.jez":{advertising:null,brand:"net.persgroep.brand.jez",cim:null,language:"nl",telemetry:"jez"},"net.dpgmedia.brand.storynl":{advertising:null,brand:"net.dpgmedia.brand.storynl",cim:null,language:"nl",telemetry:"story"},"net.persgroep.brand.destentor":{advertising:"destentor",brand:"net.persgroep.brand.destentor",cim:null,language:"nl",telemetry:"destentor"},"net.persgroep.brand.demorgen":{advertising:"demorgen",brand:"net.persgroep.brand.demorgen",cim:"demorgen",language:"nl",telemetry:"demorgen"},"net.dpgmedia.brand.mychannels":{advertising:null,brand:"net.dpgmedia.brand.mychannels",cim:null,language:"nl",telemetry:"mychannels"},"net.dpgmedia.brand.flair":{advertising:"flair",brand:"net.dpgmedia.brand.flair",cim:null,language:"nl",telemetry:"flair"},"net.dpgmedia.brand.kidsweek":{advertising:null,brand:"net.dpgmedia.brand.kidsweek",cim:null,language:"nl",telemetry:"kidsweek"},"net.dpgmedia.brand.businesswise":{advertising:null,brand:"net.dpgmedia.brand.businesswise",cim:null,language:"nl",telemetry:"businesswise"},"net.persgroep.brand.allaccessorg":{advertising:null,brand:"net.persgroep.brand.allaccessorg",cim:null,language:"nl",telemetry:"allaccessorg"},"net.persgroep.brand.deondernemer":{advertising:"deondernemer",brand:"net.persgroep.brand.deondernemer",cim:null,language:"nl",telemetry:"deondernemer"},"net.persgroep.brand.buzz":{advertising:"buzz",brand:"net.persgroep.brand.buzz",cim:null,language:"nl",telemetry:"buzz"},"net.persgroep.brand.streamz":{advertising:null,brand:"net.persgroep.brand.streamz",cim:null,language:"nl",telemetry:"streamz"},"net.dpgmedia.brand.autoweek":{advertising:null,brand:"net.dpgmedia.brand.autoweek",cim:null,language:"nl",telemetry:"autoweek"},"net.persgroep.brand.weerplaza":{advertising:"weerplaza",brand:"net.persgroep.brand.weerplaza",cim:null,language:"nl",telemetry:"weerplaza"},"net.persgroep.brand.brabantsdagblad":{advertising:"brabantsdagblad",brand:"net.persgroep.brand.brabantsdagblad",cim:null,language:"nl",telemetry:"brabantsdagblad"},"net.dpgmedia.brand.vtwonenbe":{advertising:"vtwonenbe",brand:"net.dpgmedia.brand.vtwonenbe",cim:null,language:"nl",telemetry:"vtwonenbe"},"net.persgroep.brand.qmusicnl":{advertising:"qmusic",brand:"net.persgroep.brand.qmusicnl",cim:null,language:"nl",telemetry:"qmusic"},"net.persgroep.brand.graphicvalley":{advertising:null,brand:"net.persgroep.brand.graphicvalley",cim:null,language:"nl",telemetry:"graphicvalley"}},eU=Object.keys(eq),eB=(0,o.q)(eU),eF=(0,o.o)({advertisingProfile:(0,o.m)((0,o.s)()),brandName:(0,o.s)(),cimTrackingId:(0,o.m)((0,o.s)()),country:(0,o.s)(),editorialBrand:(0,o.s)(),language:(0,o.s)(),snowplowBrand:(0,o.m)((0,o.s)()),theme:(0,o.s)()}),e$=(0,o.r)((0,o.s)(),eF),ez=(0,o.o)({advertising:(0,o.m)((0,o.s)()),brand:(0,o.s)(),cim:(0,o.m)((0,o.s)()),language:(0,o.s)(),telemetry:(0,o.s)()});(0,o.v)(e$,(0,o.g)(e=>{let t={};for(let[n,r]of Object.entries(e))t[n]={advertising:r.advertisingProfile,brand:n,cim:r.cimTrackingId,language:r.language,telemetry:r.brandName};return t}));var eG=(0,d.createContext)(null);function eH(e){let{brand:t,children:n}=e,r=(0,d.useMemo)(()=>(function(e){let t=eq[function(e){let t=(0,o.w)(eB,e);if(t.success)return t.output;throw new o.B(eB,t.issues,e,{supportedBrands:eU})}(e)];if(!(0,o.w)(ez,t).success)throw new ef;return t})(t),[t]);return(0,u.jsx)(eG.Provider,{value:r,children:n})}function eY(){let e=(0,d.useContext)(eG);if(!e)throw Error("useVideoBrand must be used within VideoBrandProvi
2der");return e}var eW=(0,d.lazy)(()=>n.e(6858).then(n.bind(n,66858)).then(e=>({default:e.DebugPanel}))),eK=["customPermissions","tcString","url"],eJ={articleId:null,customPermissions:"",dmoi:null,isMobile:!1,tcString:"",url:"",userId:null};function eQ(e){return{access:{status:"idle",videoId:e},currentVideoId:e,subsequentPlayCounter:0,startingMethodSource:"initial"}}async function eX(e){let{videoId:t,fetcher:n,set:r,options:s,onError:a}=e;try{let e=await n(t,s);e?(function(e,t){for(let n of eK){let r=e[n];(null==r||""===r)&&i.g.warn("Video '".concat(t.videoId,"' received missing playback parameter: '").concat(n,"'. This may lead to unexpected behavior."))}}(e,{videoId:t}),r({access:{status:"granted",videoId:t,playbackParams:e}})):r({access:{status:"denied",videoId:t}})}catch(e){i.g.error("Video sequence access error",e),null==a||a(e instanceof Error?e:Error(String(e))),r({access:{status:"granted",videoId:t,playbackParams:eJ}})}}function eZ(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{onError:t}=e;return(e,n)=>({...eQ(""),requestAccess:async(r,s,a)=>{let{access:o}=n();if("idle"!==o.status&&"denied"!==o.status)return void i.g.warn("Cannot request access - status is neither idle nor denied",{currentStatus:o.status});e({access:{status:"requesting",videoId:r},currentVideoId:r,startingMethodSource:"initial",subsequentPlayCounter:0}),await eX({videoId:r,fetcher:s,set:e,options:a,onError:t})},switchToNextVideo:async(r,s,a)=>{let{access:o,currentVideoId:l,subsequentPlayCounter:d}=n();return"granted"!==o.status?void i.g.warn("Cannot switch video - not in granted state",{currentStatus:o.status}):r===l?void i.g.warn("Cannot switch to same video",{videoId:r}):void(e({access:{status:"switching",videoId:r},currentVideoId:r,startingMethodSource:"auto",subsequentPlayCounter:d+1}),await eX({videoId:r,fetcher:s,set:e,options:a,onError:t}))},selectVideo:async(r,s,a)=>{let{access:o,currentVideoId:l,subsequentPlayCounter:d}=n();return"granted"!==o.status&&"idle"!==o.status&&"denied"!==o.status?void i.g.warn("Cannot select video - invalid state",{currentStatus:o.status}):r===l&&"granted"===o.status?void i.g.warn("Cannot select same video",{videoId:r}):void(e("idle"===o.status?{access:{status:"requesting",videoId:r},currentVideoId:r,startingMethodSource:"manual",subsequentPlayCounter:0}:{access:{status:"switching",videoId:r},currentVideoId:r,startingMethodSource:"manual",subsequentPlayCounter:d+1}),await eX({videoId:r,fetcher:s,set:e,options:a,onError:t}))},resetSequence:t=>{e(eQ(t))}})}var e0={tid:1,ver:1},e1={createUrl:function(e,t){let n={blur:t.blur,"fp-x":t["fp-x"],"fp-y":t["fp-y"],h:t.h,tid:e0.tid,ver:e0.ver,w:t.w},r=new URL(e);return r.search="",(0,i.h)(r.toString(),n)}},e2={image:"ot"};function e7(e){let{alt:t,loading:n="lazy",...r}=e,s="presentation"===r.role?"":null!=t?t:void 0;return(0,u.jsx)("img",{...r,alt:s,loading:n})}var e5={InternalImage:function(e){let{className:t,loading:n="lazy",src:r,...s}=e,{baseUrl:a,...i}=r,o=e1.createUrl(a,i);return(0,u.jsx)(e7,{...s,className:(0,c.$)(e2.image,t),loading:n,src:o})},ExternalImage:e7},e3={playerLogo:"rt"};function e8(e){let{image:t,className:n}=e;if(t)return(0,u.jsx)(e5.InternalImage,{alt:t.alt,className:(0,c.$)(e3.playerLogo,"entertainment-popcorn-player-logo",n),role:"presentation",src:{baseUrl:t.baseUrl,h:"180",w:null,"fp-x":t.params["fp-x"],"fp-y":t.params["fp-y"]},width:void 0,height:48})}function e6(e){return(0,u.jsx)("svg",{...e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 15",children:(0,u.jsx)("path",{d:"M6.048 0a.576.576 0 0 1 0 1.153H1.537a.377.377 0 0 0-.377.377v11.932c0 .208.169.377.377.377h11.926a.377.377 0 0 0 .377-.377V8.696c0-.319.258-.577.576-.577a.576.576 0 0 1 .584.577v4.766c0 .85-.688 1.538-1.537 1.538H1.537A1.537 1.537 0 0 1 0 13.462V1.538C0 .688.688 0 1.537 0zm8.307 0c.318 0 .576.258.576.577v4.197a.576.576 0 1 1-1.153 0V1.968L8.353 7.396a.576.576 0 0 1-.407.17h-.039A.576.576 0 0 1 7.5 6.58l5.464-5.428h-2.805a.576.576 0 0 1 0-1.153z"})})}var e4={clickout:"s",isControlsVisible:"Z",isSubtitlesActive:"ee"};
2function e9(e){let{controls:t,onClickout:n,state:r,videoEmbed:s}=e,{clickout:a}=s,i=(0,d.useSyncExternalStore)(t.subscribeToTimeChange,t.getCurrentTime,()=>null);return a&&a.title&&a.url&&null!==i&&i>=r.context.duration-a.timeOffsetMs/1e3?(0,u.jsx)(te,{isControlsVisible:r.context.isControlsVisible,isSubtitlesActive:!!r.context.subtitle,title:a.title,onClick:n,url:a.url}):null}function te(e){let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{var e;null==(e=t.current)||e.focus()},[]),(0,u.jsxs)("a",{"aria-label":e.title,className:(0,c.$)(e4.clickout,{[e4.isControlsVisible]:e.isControlsVisible,[e4.isSubtitlesActive]:e.isSubtitlesActive}),href:e.url,onClick:e.onClick,rel:"noopener noreferrer",ref:t,target:"_blank",children:[(0,u.jsx)(e6,{}),(0,u.jsx)("p",{children:e.title})]})}},32932:(e,t,n)=>{n.d(t,{a:()=>I,b:()=>S,c:()=>k,d:()=>w,e:()=>P,f:()=>j,g:()=>C,h:()=>g,i:()=>y,j:()=>v,k:()=>m,l:()=>f,m:()=>x,n:()=>D});var r=n(38038),s=n(76737),a=n(24212),i=n(13187),o=n(66715),l=n(5220),d=n(40267),c=n(57882),u=n(11259),p=n(37386);function g(e){let{initialVideoId:t,playerSessionId:n,onError:r}=e;return(0,d.y)((e,s,i)=>({...(0,a.r)({onError:r})(e,s,i),currentVideoId:t,access:{status:"idle",videoId:t},playerSessionId:n,recommendationId:null,setRecommendationId:t=>e({recommendationId:t}),incrementSubsequentPlay:()=>e(e=>({subsequentPlayCounter:e.subsequentPlayCounter+1})),playRecommendedVideo:(e,t)=>{s().switchToNextVideo(e,t,{isAutoPlay:!1})},reset:()=>{s().resetSequence(t),e({recommendationId:null})}}))}var h=(0,l.createContext)(null),y=h.Provider;function v(e){let t=(0,l.useContext)(h);if(!t)throw Error("useEmbedSessionStore must be used within EmbedSessionStoreProvider");return(0,c.Pj)(t,e)}function m(e){let{isDebugEnabled:t}=(0,a.p)(),n=v(e=>e.playerSessionId),{brand:r}=(0,a.m)();return t?(0,u.jsx)(l.Suspense,{fallback:null,children:(0,u.jsx)(a.o,{...e,playerSessionId:n,brand:r})}):null}function f(e){let{aspectRatio:t,video:n}=e;return!(n.options.loop||n.live||t.width!==s.a.width||t.height!==s.a.height)}var b={background:"zt",overlay:"d",fullscreen:"B"},_={tile:"O",button:"V",title:"W",image:"Ht",gradient:"jt"};function E(e){let{handleClick:t,recommendation:n}=e,{image:r,title:s}=n;return(0,u.jsx)("div",{className:_.tile,children:(0,u.jsxs)("button",{type:"button","aria-label":"Speel aanbevolen video: ".concat(s),className:_.button,onClick:()=>t(n),children:[(0,u.jsx)("p",{className:_.title,"aria-hidden":"true",children:s}),r&&(0,u.jsx)(a.s.InternalImage,{className:_.image,role:"presentation",src:{baseUrl:r.baseUrl,w:"640",h:"432","fp-x":r.params["fp-x"],"fp-y":r.params["fp-y"]},alt:"",width:"640",height:"432"}),(0,u.jsx)("div",{"aria-hidden":"true",className:_.gradient})]})})}function x(e){let{isFullscreen:t=!1,recommendations:n,onSelect:r}=e;return(0,u.jsxs)(u.Fragment,{children:[(0,u.jsx)("div",{className:b.background}),(0,u.jsx)("div",{className:(0,p.A)(b.overlay,t&&b.fullscreen),"aria-label":"Aanbevolen video's menu","aria-live":"polite",children:n.map(e=>(0,u.jsx)(E,{handleClick:r,recommendation:e},e.id))})]})}var w=(0,o.q)(["free","authenticated","subscribed"]),I=(0,o.v)((0,o.t)(),(0,o.g)(e=>Number(e)),(0,o.n)(),(0,o.c)(),(0,o.e)(1)),S=(0,o.v)((0,o.s)(),(0,o.d)(1)),k=(0,o.v)((0,o.t)(),(0,o.g)(e=>String(e)),(0,o.s)(),(0,o.d)(1,"Playlist ID must be a non-empty string")),P=(0,o.o)({alt:(0,o.m)((0,o.s)()),baseUrl:(0,o.s)(),params:(0,o.o)({"fp-x":(0,o.s)(),"fp-y":(0,o.s)()})}),j=(0,o.o)({autoMute:(0,o.j)(),autoPlay:(0,o.j)(),brand:(0,o.m)((0,o.p)((0,o.s)())),loop:(0,o.p)((0,o.j)(),!1),showControls:(0,o.j)(),pip:(0,o.j)(),singlePlay:(0,o.j)(),sticky:(0,o.p)((0,o.j)(),!1)}),O=(0,o.o)({options:j,tags:(0,o.v)((0,o.p)((0,o.i)((0,o.o)({iabId:(0,o.m)((0,o.s)())})),[]),(0,o.g)(e=>e.map(e=>({iabId:e.iabId?parseInt(e.iabId,10):null})).filter(e=>null!==e.iabId&&!isNaN(e.iabId)))),structuredData:(0,o.p)((0,o.s)(),"")}),N=(0,o.o)({adsEnabled:(0,o.j)(),authLevel:w,aspectRatio:(0,o.s)(),channel:(0,o.o)({id:I,title:(0,o.s)()}),organisation:(0,o.o)({id:I,title:(0,o.s)(),editorialBrand:(0,o.s)()}),clickout:(0,o.m)((0,o.o)({timeOffsetMs:(0,o.n)(),title:(0,o.s)(),url:(0,o.s)()})),description:(0,o.s)(),durationMs:(0,o.n)(),enableCimTracking:(0,o.j)(),genre:(0,o.o)({id:(0,o.n)(),title:(0,o.s)()}),id:I,image:(0,o.m)(P),live:(0,o.p)((0,o.j)(),!1),origin:(0,o.s)(),playerLogo:(0,o.m)(P),playerSkin:(0,o.p)((0,o.q)(["default","branded-content","viaplay","vtmgo","ziggo"]),"default"),show:(0,o.o)({id:I,title:(0,o.s)()}),streams:(0,o.i)((0,o.o)({quality:(0,o.s)(),type:(0,o.s)(),url:(0,o.s)()})),subtitles:(0,o.m)((0,o.o)({default:(0,o.s)(),nl:(0,o.s)()})),title:(0,o.s)()}),C=(0,o.l)([N,O]),R=(0,o.o)({recommendationId:(0,o.s)(),videos:(0,o.i)(N)});async function T(e){let{brand:t,client:n,id:s}=e,l=n.getInstance(),d=(0,i.i)("".concat(n.getBaseUrl(),"/v1/embed/video/").concat(s,"/recommendations"));try{let e=await l.url(d,!0).get().json();return(0,o.u)(R,e)}
2catch(e){throw(0,o.a)(e)?new a.b(R,e.issues,{context:{videoId:s.toString(),brand:t}}):(0,r.l)(e)?new a.d({context:{videoId:s.toString(),brand:t},options:{cause:e}}):(0,r.n)(e)?new a.f({context:{videoId:s.toString(),brand:t},options:{cause:e}}):(0,r.m)(e)?new a.e({context:{videoId:s.toString(),brand:t},options:{cause:e}}):(0,r.k)(e)?new a.c({context:{videoId:s.toString(),brand:t,statusCode:e.status},options:{cause:e}}):(0,i.e)(e)?new a.j({context:{videoId:s.toString(),brand:t},options:{cause:e}}):e}}function D(e){let{client:t,enabled:n,videoId:s}=e,{brand:i}=(0,a.m)(),{data:o,error:d,isMutating:c,trigger:u}=(0,r.q)("video-recommendations-".concat(s),async e=>T({brand:i,client:e.client,id:e.videoId})),p=(0,l.useCallback)(e=>{!n||c||u({videoId:null!=e?e:s,client:t})},[n,c,u,s,t]);return{recommendations:o,isMutating:c,error:d,triggerFetch:p}}},47902:(e,t,n)=>{n.d(t,{$:()=>j,B:()=>Q,C:()=>eE,D:()=>H,E:()=>eP,F:()=>K,G:()=>ef,H:()=>function e(t,n,r,s){if("string"==typeof n){let e=ei(t,n).next(r,s);return e&&e.length?e:t.next(r,s)}if(1===Object.keys(n).length){let a=Object.keys(n),i=e(ei(t,a[0]),n[a[0]],r,s);return i&&i.length?i:t.next(r,s)}let a=[];for(let i of Object.keys(n)){let o=n[i];if(!o)continue;let l=e(ei(t,i),o,r,s);l&&a.push(...l)}return a.length?a:t.next(r,s)},I:()=>em,J:()=>u,K:()=>eh,L:()=>ea,M:()=>h,N:()=>a,O:()=>J,P:()=>eo,Q:()=>eO,R:()=>I,S:()=>s,T:()=>o,U:()=>c,V:()=>O,W:()=>ej,a:()=>A,b:()=>M,c:()=>R,g:()=>el,l:()=>v,q:()=>ee,r:()=>eR,s:()=>B,t:()=>m,u:()=>_,v:()=>Z,w:()=>F,x:()=>w,y:()=>X,z:()=>et});class r{constructor(e){this._process=e,this._active=!1,this._current=null,this._last=null}start(){this._active=!0,this.flush()}clear(){this._current&&(this._current.next=null,this._last=this._current)}enqueue(e){let t={value:e,next:null};if(this._current){this._last.next=t,this._last=t;return}this._current=t,this._last=t,this._active&&this.flush()}flush(){for(;this._current;){let e=this._current;this._process(e.value),this._current=e.next}this._last=null}}let s=".",a="",i="xstate.init",o="xstate.error",l="xstate.stop";function d(e,t){return{type:`xstate.done.state.${e}`,output:t}}function c(e,t){return{type:`xstate.error.actor.${e}`,error:t,actorId:e}}function u(e){return{type:i,input:e}}function p(e){setTimeout(()=>{throw e})}let g="function"==typeof Symbol&&Symbol.observable||"@@observable";function h(e){if(b(e))return e;let t=[],n="";for(let r=0;r<e.length;r++){switch(e.charCodeAt(r)){case 92:n+=e[r+1],r++;continue;case 46:t.push(n),n="";continue}n+=e[r]}return t.push(n),t}function y(e){var t;return(t=e)&&"object"==typeof t&&"machine"in t&&"value"in t?e.value:"string"!=typeof e?e:function(e){if(1===e.length)return e[0];let t={},n=t;for(let t=0;t<e.length-1;t++)if(t===e.length-2)n[e[t]]=e[t+1];else{let r=n;n={},r[e[t]]=n}return t}(h(e))}function v(e,t){let n={},r=Object.keys(e);for(let s=0;s<r.length;s++){let a=r[s];n[a]=t(e[a],a,e,s)}return n}function m(e){var t;return void 0===e?[]:b(t=e)?t:[t]}function f(e,t,n,r){return"function"==typeof e?e({context:t,event:n,self:r}):e}function b(e){return Array.isArray(e)}function _(e){var t;return(b(t=e)?t:[t]).map(e=>void 0===e||"string"==typeof e?{target:e}:e)}function E(e){if(void 0!==e&&""!==e)return m(e)}function x(e,t,n){let r="object"==typeof e,s=r?e:void 0;return{next:(r?e.next:e)?.bind(s),error:(r?e.error:t)?.bind(s),complete:(r?e.complete:n)?.bind(s)}}function w(e,t){return`${t}.${e}`}function I(e,t){let n=t.match(/^xstate\.invoke\.(\d+)\.(.*)/);if(!n)return e.implementations.actors[t];let[,r,s]=n,a=e.getStateNodeById(s).config.invoke;return(Array.isArray(a)?a[r]:a).src}function S(e,t){return`${e.sessionId}.${t}`}let k=0,P=!1,j=1,O=function(e){return e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped",e}({}),N={clock:{setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e)},logger:console.log.bind(console),devTools:!1};class C{constructor(e,t){this.logic=e,this._snapshot=void 0,this.clock=void 0,this.options=void 0,this.id=void 0,this.mailbox=new r(this._process.bind(this)),this.observers=new Set,this.eventListeners=new Map,this.logger=void 0,this._processingStatus=O.NotStarted,this._parent=void 0,this._syncSnapshot=void 0,this.ref=void 0,this._actorScope=void 0,this.systemId=void 0,this.sessionId=void 0,this.system=void 0,this._doneEvent=void 0,this.src=void 0,this._deferred=[];let n={...N,...t},{clock:s,logger:a,parent:i,syncSnapshot:o,id:l,systemId:d,inspect:c}=n;this.system=i?i.system:function(e,t){let n=new Map,r=new Map,s=new WeakMap,a=new Set,i={},{clock:o,logger:l}=t,d={schedule:(e,t,n,r,s=Math.random().toString(36).slice(2))=>{let a={source:e,target:t,event:n,delay:r,id:s,startedAt:Date.now()},l=S(e,s);c._snapshot._scheduledEvents[l]=a;let d=o.setTimeout(()=>{delete i[l],delete c._snapshot._scheduledEvents[l],c._relay(e,t,n)},r);i[l]=d},cancel:(e,t)=>
2{let n=S(e,t),r=i[n];delete i[n],delete c._snapshot._scheduledEvents[n],void 0!==r&&o.clearTimeout(r)},cancelAll:e=>{for(let t in c._snapshot._scheduledEvents){let n=c._snapshot._scheduledEvents[t];n.source===e&&d.cancel(e,n.id)}}},c={_snapshot:{_scheduledEvents:(t?.snapshot&&t.snapshot.scheduler)??{}},_bookId:()=>`x:${k++}`,_register:(e,t)=>(n.set(e,t),e),_unregister:e=>{n.delete(e.sessionId);let t=s.get(e);void 0!==t&&(r.delete(t),s.delete(e))},get:e=>r.get(e),getAll:()=>Object.fromEntries(r.entries()),_set:(e,t)=>{let n=r.get(e);if(n&&n!==t)throw Error(`Actor with system ID '${e}' already exists.`);r.set(e,t),s.set(t,e)},inspect:e=>{let t=x(e);return a.add(t),{unsubscribe(){a.delete(t)}}},_sendInspectionEvent:t=>{if(!a.size)return;let n={...t,rootId:e.sessionId};a.forEach(e=>e.next?.(n))},_relay:(e,t,n)=>{c._sendInspectionEvent({type:"@xstate.event",sourceRef:e,actorRef:t,event:n}),t._send(n)},scheduler:d,getSnapshot:()=>({_scheduledEvents:{...c._snapshot._scheduledEvents}}),start:()=>{let e=c._snapshot._scheduledEvents;for(let t in c._snapshot._scheduledEvents={},e){let{source:n,target:r,event:s,delay:a,id:i}=e[t];d.schedule(n,r,s,a,i)}},_clock:o,_logger:l};return c}(this,{clock:s,logger:a}),c&&!i&&this.system.inspect(x(c)),this.sessionId=this.system._bookId(),this.id=l??this.sessionId,this.logger=t?.logger??this.system._logger,this.clock=t?.clock??this.system._clock,this._parent=i,this._syncSnapshot=o,this.options=n,this.src=n.src??e,this.ref=this,this._actorScope={self:this,id:this.id,sessionId:this.sessionId,logger:this.logger,defer:e=>{this._deferred.push(e)},system:this.system,stopChild:e=>{if(e._parent!==this)throw Error(`Cannot stop child actor ${e.id} of ${this.id} because it is not a child`);e._stop()},emit:e=>{let t=this.eventListeners.get(e.type),n=this.eventListeners.get("*");if(t||n)for(let r of[...t?t.values():[],...n?n.values():[]])try{r(e)}catch(e){p(e)}},actionExecutor:e=>{let t=()=>{if(this._actorScope.system._sendInspectionEvent({type:"@xstate.action",actorRef:this,action:{type:e.type,params:e.params}}),!e.exec)return;let t=P;try{P=!0,e.exec(e.info,e.params)}finally{P=t}};this._processingStatus===O.Running?t():this._deferred.push(t)}},this.send=this.send.bind(this),this.system._sendInspectionEvent({type:"@xstate.actor",actorRef:this}),d&&(this.systemId=d,this.system._set(d,this)),this._initState(t?.snapshot??t?.state),d&&"active"!==this._snapshot.status&&this.system._unregister(this)}_initState(e){try{this._snapshot=e?this.logic.restoreSnapshot?this.logic.restoreSnapshot(e,this._actorScope):e:this.logic.getInitialSnapshot(this._actorScope,this.options?.input)}catch(e){this._snapshot={status:"error",output:void 0,error:e}}}update(e,t){let n;for(this._snapshot=e;n=this._deferred.shift();)try{n()}catch(t){this._deferred.length=0,this._snapshot={...e,status:"error",error:t}}switch(this._snapshot.status){case"active":for(let t of this.observers)try{t.next?.(e)}catch(e){p(e)}break;case"done":var r;for(let t of this.observers)try{t.next?.(e)}catch(e){p(e)}this._stopProcedure(),this._complete(),this._doneEvent=(r=this.id,{type:`xstate.done.actor.${r}`,output:this._snapshot.output,actorId:r}),this._parent&&this.system._relay(this,this._parent,this._doneEvent);break;case"error":this._error(this._snapshot.error)}this.system._sendInspectionEvent({type:"@xstate.snapshot",actorRef:this,event:t,snapshot:e})}subscribe(e,t,n){let r=x(e,t,n);if(this._processingStatus!==O.Stopped)this.observers.add(r);else switch(this._snapshot.status){case"done":try{r.complete?.()}catch(e){p(e)}break;case"error":{let e=this._snapshot.error;if(r.error)try{r.error(e)}catch(e){p(e)}else p(e)}}return{unsubscribe:()=>{this.observers.delete(r)}}}on(e,t){let n=this.eventListeners.get(e);n||(n=new Set,this.eventListeners.set(e,n));let r=t.bind(void 0);return n.add(r),{unsubscribe:()=>{n.delete(r)}}}start(){if(this._processingStatus===O.Running)return this;this._syncSnapshot&&this.subscribe({next:e=>{"active"===e.status&&this.system._relay(this,this._parent,{type:`xstate.snapshot.${this.id}`,snapshot:e})},error:()=>{}}),this.system._register(this.sessionId,this),this.systemId&&this.system._set(this.systemId,this),this._processingStatus=O.Running;let e=u(this.options.input);switch(this.system._sendInspectionEvent({type:"@xstate.event",sourceRef:this._parent,actorRef:this,event:e}),this._snapshot.status){case"done":return this.update(this._snapshot,e),this;case"error":return this._error(this._snapshot.error),this}if(this._parent||this.system.start(),this.logic.start)try{this.logic.start(this._snapshot,this._actorScope)}catch(e){return this._snapshot={...this._snapshot,status:"error",error:e},this._error(e),this}return this.update(this._snapshot,e),this.options.devTools&&this.attachDevTools(),this.mailbox.start(),this}_process(e){let t,n;try{t=this.logic.transition(this._snapshot,e,this._actorScope)}catch(e){n={err:e}}if(n){let{err:e}=n;this._snapshot={...this._snapshot,status:"error",error:e},this._error(e);return}this.update(t,e),e.type===l&&(this._stopProcedure(),this._complete())}_stop(){return this._processingStatus===O.Stopped||((this.mailbox.clear(),this._processingStatus===O.NotStarted)?this._processingStatus=O.Stopped:this.mailbox.enqueue({type:l})),this}stop(){if(this._parent)throw Error("A non-root actor cannot be stopped directly.");return this._stop()}_complete(){for(let e of this.observers)try{e.complete?.()}catch(e){p(e)}this.observers.clear()}_reportError(e){if(!this.observers.size){this._parent||p(e);return}let t=!1;for(let n of this.observers){let r=n.error;t||=!r;try{r?.(e)}catch(e){p(e)}}this.observers.clear(),t&&p(e)}_error(e){this._stopProcedure(),this._reportError(e),this._parent&&this.system._relay(this,this._parent,c(this.id,e))}_stopProcedure(){return this._processingStatus!==O.Running||(this.system.scheduler.cancelAll(this),this.mailbox.clear(),this.mailbox=new r(this._process.bind(this)),this._processingStatus=O.Stopped,this.system._unregister(this)),this}_send(e){this._processingStatus!==O.Stopped&&this.mailbox.enqueue(e)}send(e){this.system._relay(void 0,this,e)}attachDevTools(){let{devTools:e}=this.options;e&&("function"==typeof e?e:e=>{if("undefined"==typeof window)return;let t=function(){let e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:void 0!==n.g?n.g:void 0;if(e.__xstate__)return e.__xstate__}();t&&t.register(e)})(this)}toJSON(){return{xstate$$type:j,id:this.id}}getPersistedSnapshot(e){return this.logic.getPersistedSnapshot(this._snapshot,e)}[g](){return this}getSnapshot(){return this._snapshot}}function R(e,...[t]){return new C(e,t)}function T(e,t,n,r,{sendId:s}){return[t,{sendId:"function"==typeof s?s(n,r):s},void 0]}function D(e,t){e.defer(()=>{e.system.scheduler.cancel(e.self,t.sendId)})}function A(e){function t(e,t){}return t.type="xstate.cancel",t.sendId=e,t.resolve=T,t.execute=D,t}function V(e,t,n,r,{id:s,systemId:a,src:i,input:o,syncSnapshot:l}){let d,c,u="string"==typeof i?I(t.machine,i):i,p="function"==typeof s?s(n):s;return u&&(c="function"==typeof o?o({context:t.context,event:n.event,self:e.self}):o,d=R(u,{id:p,src:i,parent:e.self,syncSnapshot:l,systemId:a,input:c})),[ej(t,{children:{...t.children,[p]:d}}),{id:s,systemId:a,actorRef:d,src:i,input:c},void 0]}function L(e,{actorRef:t}){t&&e.defer(()=>{t._processingStatus!==O.Stopped&&t.start()})}function M(...[e,{id:t,systemId:n,input:r,syncSnapshot:s=!1}={}]){function a(e,t){}return a.type="xstate.spawnChild",a.id=t,a.systemId=n,a.src=e,a.input=r,a.syncSnapshot=s,a.resolve=V,a.execute=L,a}function q(e,t,n,r,{actorRef:s}){let a="function"==typeof s?s(n,r):s,i="string"==typeof a?t.children[a]:a,o=t.children;return i&&(o={...o},delete o[i.id]),[ej(t,{children:o}),i,void 0]}function U(e,t){if(t){if(e.system._unregister(t),t._processingStatus!==O.Running)return void e.stopChild(t);e.defer(()=>{e.stopChild(t)})}}function B(e){function t(e,t){}return t.type="xstate.stopChild",t.actorRef=e,t.resolve=q,t.execute=U,t}function F(e,t,n,r){let{machine:s}=r,a="function"==typeof e,i=a?e:s.implementations.guards["string"==typeof e?e:e.type];if(!a&&!i)throw Error(`Guard '${"string"==typeof e?e:e.type}' is not implemented.'.`);if("function"!=typeof i)return F(i,t,n,r);let o={context:t,event:n},l=a||"string"==typeof e?void 0:"params"in e?"function"==typeof e.params?e.params({context:t,event:n}):e.params:void 0;return"check"in i?i.check(r,o,i):i(o,l)}let $=e=>"atomic"===e.type||"final"===e.type;function z(e){return Object.values(e.states).filter(e=>"history"!==e.type)}function G(e,t){let n=[];if(t===e)return n;let r=e.parent;for(;r&&r!==t;)n.push(r),r=r.parent;return n}function H(e){let t=new Set(e),n=Y(t);for(let e of t)if("compound"!==e.type||n.get(e)&&n.get(e).length){if("parallel"===e.type){for(let n of z(e))if("history"!==n.type&&!t.has(n))for(let e of es(n))t.add(e)}}
2else es(e).forEach(e=>t.add(e));for(let e of t){let n=e.parent;for(;n;)t.add(n),n=n.parent}return t}function Y(e){let t=new Map;for(let n of e)t.has(n)||t.set(n,[]),n.parent&&(t.has(n.parent)||t.set(n.parent,[]),t.get(n.parent).push(n));return t}function W(e,t){return function e(t,n){let r=n.get(t);if(!r)return{};if("compound"===t.type){let e=r[0];if(!e)return{};if($(e))return e.key}let s={};for(let t of r)s[t.key]=e(t,n);return s}(e,Y(H(t)))}function K(e,t){return"compound"===t.type?z(t).some(t=>"final"===t.type&&e.has(t)):"parallel"===t.type?z(t).every(t=>K(e,t)):"final"===t.type}let J=e=>"#"===e[0];function Q(e,t){return e.transitions.get(t)||[...e.transitions.keys()].filter(e=>{if("*"===e)return!0;if(!e.endsWith(".*"))return!1;let n=e.split("."),r=t.split(".");for(let e=0;e<n.length;e++){let t=n[e],s=r[e];if("*"===t)return e===n.length-1;if(t!==s)return!1}return!0}).sort((e,t)=>t.length-e.length).flatMap(t=>e.transitions.get(t))}function X(e){let t=e.config.after;return t?Object.keys(t).flatMap(n=>{let r=t[n],s=Number.isNaN(+n)?n:+n,a=(t=>{var n;let r=(n=e.id,{type:`xstate.after.${t}.${n}`}),s=r.type;return e.entry.push(eR(r,{id:s,delay:t})),e.exit.push(A(s)),s})(s);return m("string"==typeof r?{target:r}:r).map(e=>({...e,event:a,delay:s}))}).map(t=>{let{delay:n}=t;return{...Z(e,t.event,t),delay:n}}):[]}function Z(e,t,n){let r=E(n.target),a=n.reenter??!1,i=function(e,t){if(void 0!==t)return t.map(t=>{if("string"!=typeof t)return t;if(J(t))return e.machine.getStateNodeById(t);let n=t[0]===s;if(n&&!e.parent)return eo(e,t.slice(1));let r=n?e.key+t:t;if(e.parent)try{return eo(e.parent,r)}catch(t){throw Error(`Invalid transition definition for state node '${e.id}': 3${t.message}`)}throw Error(`Invalid target: "${t}" is not a valid target from the root node. Did you mean ".${t}"?`)})}(e,r),o={...n,actions:m(n.actions),guard:n.guard,target:i,source:e,reenter
3:a,eventType:t,toJSON:()=>({...o,source:`#${e.id}`,target:i?i.map(e=>`#${e.id}`):void 0})};return o}function ee(e){let t=new Map;if(e.config.on)for(let n of Object.keys(e.config.on)){if(n===a)throw Error('Null events ("") cannot be specified as a transition key. Use `always: { ... }` instead.');let r=e.config.on[n];t.set(n,_(r).map(t=>Z(e,n,t)))}if(e.config.onDone){let n=`xstate.done.state.${e.id}`;t.set(n,_(e.config.onDone).map(t=>Z(e,n,t)))}for(let n of e.invoke){if(n.onDone){let r=`xstate.done.actor.${n.id}`;t.set(r,_(n.onDone).map(t=>Z(e,r,t)))}if(n.onError){let r=`xstate.error.actor.${n.id}`;t.set(r,_(n.onError).map(t=>Z(e,r,t)))}if(n.onSnapshot){let r=`xstate.snapshot.${n.id}`;t.set(r,_(n.onSnapshot).map(t=>Z(e,r,t)))}}for(let n of e.after){let e=t.get(n.eventType);e||(e=[],t.set(n.eventType,e)),e.push(n)}return t}function et(e,t){let n="string"==typeof t?e.states[t]:t?e.states[t.target]:void 0;if(!n&&t)throw Error(`Initial state node "${t}" not found on parent state node #${e.id}`);let r={source:e,actions:t&&"string"!=typeof t?m(t.actions):[],eventType:null,reenter:!1,target:n?[n]:[],toJSON:()=>({...r,source:`#${e.id}`,target:n?[`#${n.id}`]:[]})};return r}function en(e){let t=E(e.config.target);return t?{target:t.map(t=>"string"==typeof t?eo(e.parent,t):t)}:e.parent.initial}function er(e){return"history"===e.type}function es(e){let t=ea(e);for(let n of t)for(let r of G(n,e))t.add(r);return t}function ea(e){let t=new Set;return!function e(n){if(!t.has(n)){if(t.add(n),"compound"===n.type)e(n.initial.target[0]);else if("parallel"===n.type)for(let t of z(n))e(t)}}(e),t}function ei(e,t){if(J(t))return e.machine.getStateNodeById(t);if(!e.states)throw Error(`Unable to retrieve child state '${t}' from '${e.id}'; no child states exist.`);let n=e.states[t];if(!n)throw Error(`Child state '${t}' does not exist on '${e.id}'`);return n}function eo(e,t){if("string"==typeof t&&J(t))try{return e.machine.getStateNodeById(t)}catch{}let n=h(t).slice(),r=e;for(;n.length;){let e=n.shift();if(!e.length)break;r=ei(r,e)}return r}function el(e,t){if("string"==typeof t){let n=e.states[t];if(!n)throw Error(`State '${t}' does not exist on '${e.id}'`);return[e,n]}let n=Object.keys(t),r=n.map(t=>ei(e,t)).filter(Boolean);return[e.machine.root,e].concat(r,n.reduce((n,r)=>{let s=ei(e,r);if(!s)return n;let a=el(s,t[r]);return n.concat(a)},[]))}function ed(e,t){let n=e;for(;n.parent&&n.parent!==t;)n=n.parent;return n.parent===t}function ec(e,t,n){let r=new Set;for(let s of e){let e=!1,a=new Set;for(let i of r)if(function(e,t){let n=new Set(e),r=new Set(t);for(let e of n)if(r.has(e))return!0;for(let e of r)if(n.has(e))return!0;return!1}(eg([s],t,n),eg([i],t,n)))if(ed(s.source,i.source))a.add(i);else{e=!0;break}if(!e){for(let e of a)r.delete(e);r.add(s)}}return Array.from(r)}function eu(e,t){if(!e.target)return[];let n=new Set;for(let r of e.target)if(er(r))if(t[r.id])for(let e of t[r.id])n.add(e);else for(let e of eu(en(r),t))n.add(e);else n.add(r);return[...n]}function ep(e,t){let n=eu(e,t);if(!n)return;if(!e.reenter&&n.every(t=>t===e.source||ed(t,e.source)))return e.source;let r=function(e){let[t,...n]=e;for(let e of G(t,void 0))if(n.every(t=>ed(t,e)))return e}(n.concat(e.source));return r||(e.reenter?void 0:e.source.machine.root)}function eg(e,t,n){let r=new Set;for(let s of e)if(s.target?.length){let e=ep(s,n);for(let n of(s.reenter&&s.source===e&&r.add(e),t))ed(n,e)&&r.add(n)}return[...r]}function eh(e,t,n,r,s,a){if(!e.length)return t;let i=new Set(t._nodes),o=t.historyValue,l=ec(e,i,o),c=t;s||([c,o]=function(e,t,n,r,s,a,i,o){let l,d=e,c=eg(r,s,a);for(let e of(c.sort((e,t)=>t.order-e.order),c))for(let t of function(e){return Object.keys(e.states).map(t=>e.states[t]).filter(e=>"history"===e.type)}(e)){let n;n="deep"===t.history?t=>$(t)&&ed(t,e):t=>t.parent===e,(l??={...a})[t.id]=Array.from(s).filter(n)}for(let e of c)d=em(d,t,n,[...e.exit,...e.invoke.map(e=>B(e.id))],i,void 0),s.delete(e);return[d,l||a]}(c,r,n,l,i,o,a,n.actionExecutor)),c=function(e,t,n,r,s,a,i,o){let l=e,c=new Set,u=new Set;(function(e,t,n,r){for(let s of e){let e=ep(s,t);for(let a of s.target||[])!er(a)&&(s.source!==a||s.source!==e||s.reenter)&&(r.add(a),n.add(a)),ey(a,t,n,r);for(let a of eu(s,t)){let i=G(a,e);e?.type==="parallel"&&i.push(e),ev(r,t,n,i,!s.source.parent&&s.reenter?void 0:e)}}})(r,i,u,c),o&&u.add(e.machine.root);let p=new Set;for(let e of[...c].sort((e,t)=>
3e.order-t.order)){s.add(e);let r=[];for(let t of(r.push(...e.entry),e.invoke))r.push(M(t.src,{...t,syncSnapshot:!!t.onSnapshot}));if(u.has(e)){let t=e.initial.actions;r.push(...t)}if(l=em(l,t,n,r,a,e.invoke.map(e=>e.id)),"final"===e.type){let r=e.parent,i=r?.type==="parallel"?r:r?.parent,o=i||e;for(r?.type==="compound"&&a.push(d(r.id,void 0!==e.output?f(e.output,l.context,t,n.self):void 0));i?.type==="parallel"&&!p.has(i)&&K(s,i);)p.add(i),a.push(d(i.id)),o=i,i=i.parent;if(i)continue;l=ej(l,{status:"done",output:function(e,t,n,r,s){if(void 0===r.output)return;let a=d(s.id,void 0!==s.output&&s.parent?f(s.output,e.context,t,n.self):void 0);return f(r.output,e.context,a,n.self)}(l,t,n,l.machine.root,o)})}}return l}(c=em(c,r,n,l.flatMap(e=>e.actions),a,void 0),r,n,l,i,a,o,s);let u=[...i];"done"===c.status&&(c=em(c,r,n,u.sort((e,t)=>t.order-e.order).flatMap(e=>e.exit),a,void 0));try{if(o===t.historyValue&&function(e,t){if(e.length!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}(t._nodes,i))return c;return ej(c,{_nodes:u,historyValue:o})}catch(e){throw e}}function ey(e,t,n,r){var s,a,i,o;if(er(e))if(t[e.id]){let i=t[e.id];for(let e of i)r.add(e),ey(e,t,n,r);for(let o of i){s=o,a=e.parent,ev(r,t,n,G(s,a))}}else{let s=en(e);for(let a of s.target)r.add(a),s===e.parent?.initial&&n.add(e.parent),ey(a,t,n,r);for(let a of s.target){i=a,o=e.parent,ev(r,t,n,G(i,o))}}else if("compound"===e.type){let[s]=e.initial.target;er(s)||(r.add(s),n.add(s)),ey(s,t,n,r),ev(r,t,n,G(s,e))}else if("parallel"===e.type)for(let s of z(e).filter(e=>!er(e)))[...r].some(e=>ed(e,s))||(er(s)||(r.add(s),n.add(s)),ey(s,t,n,r))}function ev(e,t,n,r,s){for(let a of r)if((!s||ed(a,s))&&e.add(a),"parallel"===a.type)for(let r of z(a).filter(e=>!er(e)))[...e].some(e=>ed(e,r))||(e.add(r),ey(r,t,n,e))}function em(e,t,n,r,s,a){let i=a?[]:void 0,o=function e(t,n,r,s,a,i){let{machine:o}=t,l=t;for(let t of s){var d;let s="function"==typeof t,c=s?t:(d="string"==typeof t?t:t.type,o.implementations.actions[d]),u={context:l.context,event:n,self:r.self,system:r.system},p=s||"string"==typeof t?void 0:"params"in t?"function"==typeof t.params?t.params({context:l.context,event:n}):t.params:void 0;if(!c||!("resolve"in c)){r.actionExecutor({type:"string"==typeof t?t:"object"==typeof t?t.type:t.name||"(anonymous)",info:u,params:p,exec:c}
3);continue}let[g,h,y]=c.resolve(r,l,u,p,c,a);l=g,"retryResolve"in c&&i?.push([c,h]),"execute"in c&&r.actionExecutor({type:c.type,info:u,params:h,exec:c.execute.bind(null,r,h)}),y&&(l=e(l,n,r,y,a,i))}return l}(e,t,n,r,{internalQueue:s,deferredActorIds:a},i);return i?.forEach(([e,t])=>{e.retryResolve(n,o,t)}),o}function ef(e,t,n,r){let s=e,a=[];function o(e,t,r){n.system._sendInspectionEvent({type:"@xstate.microstep",actorRef:n.self,event:t,snapshot:e,_transitions:r}),a.push(e)}if(t.type===l)return o(s=ej(eb(s,t,n),{status:"stopped"}),t,[]),{snapshot:s,microstates:a};let d=t;if(d.type!==i){let t=d,i=t.type.startsWith("xstate.error.actor"),l=e_(t,s);if(i&&!l.length)return o(s=ej(e,{status:"error",error:t.error}),t,[]),{snapshot:s,microstates:a};o(s=eh(l,e,n,d,!1,r),t,l)}let c=!0;for(;"active"===s.status;){let e=c?function(e,t){let n=new Set;for(let r of e._nodes.filter($))e:for(let s of[r].concat(G(r,void 0)))if(s.always){for(let r of s.always)if(void 0===r.guard||F(r.guard,e.context,t,e)){n.add(r);break e}}return ec(Array.from(n),new Set(e._nodes),e.historyValue)}(s,d):[],t=e.length?s:void 0;if(!e.length){if(!r.length)break;e=e_(d=r.shift(),s)}c=(s=eh(e,s,n,d,!1,r))!==t,o(s,d,e)}return"active"!==s.status&&eb(s,d,n),{snapshot:s,microstates:a}}function eb(e,t,n){return em(e,t,n,Object.values(e.children).map(e=>B(e)),[],void 0)}function e_(e,t){return t.machine.getTransitionData(t,e)}function eE(e,t){let n=H(el(e,t));return W(e,[...n])}let ex=function(e){return function e(t,n){let r=y(t),s=y(n);return"string"==typeof s?"string"==typeof r&&s===r:"string"==typeof r?r in s:Object.keys(r).every(t=>t in s&&e(r[t],s[t]))}(e,this.value)},ew=function(e){return this.tags.has(e)},eI=function(e){let t=this.machine.getTransitionData(this,e);return!!t?.length&&t.some(e=>void 0!==e.target||e.actions.length)},eS=function(){let{_nodes:e,tags:t,machine:n,getMeta:r,toJSON:s,can:a,hasTag:i,matches:o,...l}=this;return{...l,tags:Array.from(t)}},ek=function(){return this._nodes.reduce((e,t)=>(void 0!==t.meta&&(e[t.id]=t.meta),e),{})};function eP(e,t){return{status:e.status,output:e.output,error:e.error,machine:t,context:e.context,_nodes:e._nodes,value:W(t.root,e._nodes),tags:new Set(e._nodes.flatMap(e=>e.tags)),children:e.children,historyValue:e.historyValue||{},matches:ex,hasTag:ew,can:eI,getMeta:ek,toJSON:eS}}function ej(e,t={}){return eP({...e,...t},e.machine)}function eO(e,t){let{_nodes:n,tags:r,machine:s,children:a,context:i,can:o,hasTag:l,matches:d,getMeta:c,toJSON:u,...p}=e,g={};for(let e in a){let n=a[e];g[e]={snapshot:n.getPersistedSnapshot(t),src:n.src,systemId:n.systemId,syncSnapshot:n._syncSnapshot}}return{...p,context:function e(t){let n;for(let r in t){let s=t[r];if(s&&"object"==typeof s)if("sessionId"in s&&"send"in s&&"ref"in s)(n??=Array.isArray(t)?t.slice():{...t})[r]={xstate$$type:j,id:s.id};else{let a=e(s);a!==s&&((n??=Array.isArray(t)?t.slice():{...t})[r]=a)}}return n??t}(i),children:g,historyValue:function(e){if("object"!=typeof e||null===e)return{};let t={};for(let n in e){let r=e[n];Array.isArray(r)&&(t[n]=r.map(e=>({id:e.id})))}return t}(p.historyValue)}}function eN(e,t,n,r,{event:s,id:a,delay:i},{internalQueue:o}){let l,d=t.machine.implementations.delays;if("string"==typeof s)throw Error(`Only event objects may be used with raise; use raise({ type: "${s}" }) instead`);let c="function"==typeof s?s(n,r):s;if("string"==typeof i){let e=d&&d[i];l="function"==typeof e?e(n,r):e}else l="function"==typeof i?i(n,r):i;return"number"!=typeof l&&o.push(c),[t,{event:c,id:a,delay:l},void 0]}function eC(e,t){let{event:n,delay:r,id:s}=t;if("number"==typeof r)return void e.defer(()=>{let t=e.self;e.system.scheduler.schedule(t,t,n,r,s)})}function eR(e,t){function n(e,t){}return n.type="xstate.raise",n.event=e,n.id=t?.id,n.delay=t?.delay,n.resolve=eN,n.execute=eC,n}},76737:(e,t,n)=>{n.d(t,{a:()=>r});var r={width:16,height:9}},86428:(e,t,n)=>{n.d(t,{a:()=>l,b:()=>c,c:()=>u,d:()=>p});var r=n(24212),s=n(5220),a=n(40267),i=n(57882),o=n(11259);function l(e){let{playerSessionId:t,onError:n}=e;return(0,a.y)((e,s,a)=>({...(0,r.r)({onError:n})(e,s,a),playerSessionId:t,selectedPlaylistItemId:null,selectPlaylistItem:(t,
3n)=>{let{selectedPlaylistItemId:r,selectVideo:a}=s();r!==t&&(e({selectedPlaylistItemId:t}),a(String(t),n,{isAutoPlay:!1}))},playNextVideo:(t,n)=>{let r,{selectedPlaylistItemId:a,switchToNextVideo:i}=s();if(0!==t.length){if(null===a)r=t[0];else{let e=t.findIndex(e=>e.id===a)+1;if(e>=t.length)return;r=t[e]}e({selectedPlaylistItemId:r.id}),i(String(r.id),n,{isAutoPlay:!1})}},incrementSubsequentPlay:()=>e(e=>({subsequentPlayCounter:e.subsequentPlayCounter+1})),reset:()=>{s().resetSequence(""),e({selectedPlaylistItemId:null})}}))}var d=(0,s.createContext)(null),c=d.Provider;function u(e){let t=(0,s.useContext)(d);if(!t)throw Error("usePlaylistSessionStore must be used within PlaylistSessionStoreProvider");return(0,i.Pj)(t,e)}function p(e){let{isDebugEnabled:t}=(0,r.p)(),n=u(e=>e.playerSessionId),{brand:a}=(0,r.m)();return t?(0,o.jsx)(s.Suspense,{fallback:null,children:(0,o.jsx)(r.o,{...e,playerSessionId:n,brand:a})}):null}},88491:(e,t,n)=>{n.d(t,{zl:()=>u,d4:()=>c});var r=n(5220),s=r.useLayoutEffect,a=n(47902),i=n(31114),o=n(14732);let l=(e,t)=>{t(e);let n=e.getSnapshot().children;n&&Object.values(n).forEach(e=>{l(e,t)})};function d(e,t){return e===t}function c(e,t,n=d){let s=(0,r.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),a=(0,r.useCallback)(()=>e?.getSnapshot(),[e]);return(0,i.useSyncExternalStoreWithSelector)(s,a,a,t,n)}function u(e,...[t]){return function(e,...[t]){let n=function(e,...[t]){let[[n,i],o]=(0,r.useState)(()=>{let n=(0,a.c)(e,t);return[e.config,n]});if(e.config!==n){let n=(0,a.c)(e,{...t,snapshot:i.getPersistedSnapshot({__unsafeAllowInlineActors:!0})});o([e.config,n]),i=n}return s(()=>{i.logic.implementations=e.implementations}),i}(e,t),i=(0,r.useCallback)(()=>n.getSnapshot(),[n]),d=(0,r.useCallback)(e=>{let{unsubscribe:t}=n.subscribe(e);return t},[n]),c=(0,o.useSyncExternalStore)(d,i,i);return(0,r.useEffect)(()=>(n.start(),()=>{let e=[];l(n,t=>{e.push([t,t.getSnapshot()]),t.observers=new Set});let t=n.system.getSnapshot?.();n.stop(),n.system._snapshot=t,e.forEach(([e,t])=>{e._processingStatus=0,e._snapshot=t})}),[n]),[c,n.send,n]}(e,t)}},90726:(e,t,n)=>{n.d(t,{a:()=>l,b:()=>c,c:()=>u,d:()=>p});var r=n(24212),s=n(5220),a=n(40267),i=n(57882),o=n(11259);function l(e){let{initialVideoId:t,playerSessionId:n,onError:s}=e;return(0,a.y)((e,a,i)=>({...(0,r.r)({onError:s})(e,a,i),incrementSubsequentPlay:()=>e(e=>({subsequentPlayCounter:e.subsequentPlayCounter+1})),currentVideoId:t,access:{status:"idle",videoId:t},playerSessionId:n,reset:()=>{a().resetSequence(t)}}))}var d=(0,s.createContext)(null),c=d.Provider;function u(e){let t=(0,s.useContext)(d);if(!t)throw Error("useTeaserSessionStore must be used within TeaserSessionStoreProvider");return(0,i.Pj)(t,e)}function p(e){let{isDebugEnabled:t}=(0,r.p)(),n=u(e=>e.playerSessionId),{brand:a}=(0,r.m)();return t?(0,o.jsx)(s.Suspense,{fallback:null,children:(0,o.jsx)(r.o,{...e,playerSessionId:n,brand:a})}):null}}}]);
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.