@epic-web/workshop-app 6.77.0 → 6.77.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/build/client/assets/{_exerciseNumber-C1aZpAWV.js → _exerciseNumber-JuXb6JTN.js} +2 -2
  2. package/build/client/assets/{_exerciseNumber-C1aZpAWV.js.map → _exerciseNumber-JuXb6JTN.js.map} +1 -1
  3. package/build/client/assets/{_exerciseNumber_.finished-BICggZV1.js → _exerciseNumber_.finished-DD-1txyR.js} +2 -2
  4. package/build/client/assets/{_exerciseNumber_.finished-BICggZV1.js.map → _exerciseNumber_.finished-DD-1txyR.js.map} +1 -1
  5. package/build/client/assets/_extra-BfK-kKBL.js +2 -0
  6. package/build/client/assets/_extra-BfK-kKBL.js.map +1 -0
  7. package/build/client/assets/{_layout-BZI3FoQD.js → _layout-BsHVX3B_.js} +2 -2
  8. package/build/client/assets/{_layout-BZI3FoQD.js.map → _layout-BsHVX3B_.js.map} +1 -1
  9. package/build/client/assets/{_layout-CunOyAg4.js → _layout-CDyeQVKG.js} +2 -2
  10. package/build/client/assets/{_layout-CunOyAg4.js.map → _layout-CDyeQVKG.js.map} +1 -1
  11. package/build/client/assets/_layout-mVyOtxmC.js +2 -0
  12. package/build/client/assets/_layout-mVyOtxmC.js.map +1 -0
  13. package/build/client/assets/{account-C96cpeZR.js → account-BKXMYhfO.js} +2 -2
  14. package/build/client/assets/{account-C96cpeZR.js.map → account-BKXMYhfO.js.map} +1 -1
  15. package/build/client/assets/{app-CJniokic.js → app-AWsnszeo.js} +2 -2
  16. package/build/client/assets/{app-CJniokic.js.map → app-AWsnszeo.js.map} +1 -1
  17. package/build/client/assets/{cache-CAr50MIB.js → cache-CxMFS2A_.js} +2 -2
  18. package/build/client/assets/{cache-CAr50MIB.js.map → cache-CxMFS2A_.js.map} +1 -1
  19. package/build/client/assets/{db-DAnX-T3_.js → db-BZ-tFzMp.js} +2 -2
  20. package/build/client/assets/{db-DAnX-T3_.js.map → db-BZ-tFzMp.js.map} +1 -1
  21. package/build/client/assets/{diff-D8TUonC2.js → diff-0VO9C_Sf.js} +2 -2
  22. package/build/client/assets/{diff-D8TUonC2.js.map → diff-0VO9C_Sf.js.map} +1 -1
  23. package/build/client/assets/{diff-Col_iM3X.js → diff-CC_jaH50.js} +2 -2
  24. package/build/client/assets/{diff-Col_iM3X.js.map → diff-CC_jaH50.js.map} +1 -1
  25. package/build/client/assets/discord-BVfxP4Rd.js +2 -0
  26. package/build/client/assets/discord-BVfxP4Rd.js.map +1 -0
  27. package/build/client/assets/{discord-BJkw0IrB.js → discord-XhHqPI49.js} +2 -2
  28. package/build/client/assets/{discord-BJkw0IrB.js.map → discord-XhHqPI49.js.map} +1 -1
  29. package/build/client/assets/{epic-video-BJW6MU1i.js → epic-video-D4jBdSKs.js} +2 -2
  30. package/build/client/assets/{epic-video-BJW6MU1i.js.map → epic-video-D4jBdSKs.js.map} +1 -1
  31. package/build/client/assets/{epic-video-jtxu_0bl.js → epic-video-Ddc9rYLT.js} +2 -2
  32. package/build/client/assets/{epic-video-jtxu_0bl.js.map → epic-video-Ddc9rYLT.js.map} +1 -1
  33. package/build/client/assets/{finished-C2jP5uE7.js → finished-BSfM_f4M.js} +2 -2
  34. package/build/client/assets/{finished-C2jP5uE7.js.map → finished-BSfM_f4M.js.map} +1 -1
  35. package/build/client/assets/{index-CdzVFL-Z.js → index-BrVvTrwg.js} +2 -2
  36. package/build/client/assets/{index-CdzVFL-Z.js.map → index-BrVvTrwg.js.map} +1 -1
  37. package/build/client/assets/{index-Dpyv8N6m.js → index-CfPaTqRT.js} +2 -2
  38. package/build/client/assets/{index-Dpyv8N6m.js.map → index-CfPaTqRT.js.map} +1 -1
  39. package/build/client/assets/{index-X8or9u7t.js → index-CuCZuiBp.js} +2 -2
  40. package/build/client/assets/{index-X8or9u7t.js.map → index-CuCZuiBp.js.map} +1 -1
  41. package/build/client/assets/{index-KRgoKRWG.js → index-D0vH1MiQ.js} +2 -2
  42. package/build/client/assets/{index-KRgoKRWG.js.map → index-D0vH1MiQ.js.map} +1 -1
  43. package/build/client/assets/{index-BCQgVrao.js → index-DTC_5pri.js} +2 -2
  44. package/build/client/assets/{index-BCQgVrao.js.map → index-DTC_5pri.js.map} +1 -1
  45. package/build/client/assets/{launch-editor-D2exGfVu.js → launch-editor-0oPpbFQe.js} +2 -2
  46. package/build/client/assets/{launch-editor-D2exGfVu.js.map → launch-editor-0oPpbFQe.js.map} +1 -1
  47. package/build/client/assets/{loading-CDNzW5oO.js → loading-CaCCsk9k.js} +2 -2
  48. package/build/client/assets/{loading-CDNzW5oO.js.map → loading-CaCCsk9k.js.map} +1 -1
  49. package/build/client/assets/{login-mWjVXGbJ.js → login-w4y7RVYa.js} +2 -2
  50. package/build/client/assets/{login-mWjVXGbJ.js.map → login-w4y7RVYa.js.map} +1 -1
  51. package/build/client/assets/{manifest-dd28a0e5.js → manifest-a63db2d2.js} +1 -1
  52. package/build/client/assets/{mdx-DdpoOTHm.js → mdx-DwvWT4Ou.js} +2 -2
  53. package/build/client/assets/{mdx-DdpoOTHm.js.map → mdx-DwvWT4Ou.js.map} +1 -1
  54. package/build/client/assets/{onboarding-indicator-B-XR90_G.js → onboarding-indicator-BkeHYs2C.js} +2 -2
  55. package/build/client/assets/{onboarding-indicator-B-XR90_G.js.map → onboarding-indicator-BkeHYs2C.js.map} +1 -1
  56. package/build/client/assets/{online-DiNLkgTC.js → online-DVk-W8Cr.js} +2 -2
  57. package/build/client/assets/{online-DiNLkgTC.js.map → online-DVk-W8Cr.js.map} +1 -1
  58. package/build/client/assets/{playground-DmEAkxG1.js → playground-DG4B62WX.js} +2 -2
  59. package/build/client/assets/{playground-DmEAkxG1.js.map → playground-DG4B62WX.js.map} +1 -1
  60. package/build/client/assets/{playground-window-x2mQ5o1O.js → playground-window-CF8lTXXI.js} +2 -2
  61. package/build/client/assets/{playground-window-x2mQ5o1O.js.map → playground-window-CF8lTXXI.js.map} +1 -1
  62. package/build/client/assets/{preferences-B7ND1VS9.js → preferences-Czy5oqWs.js} +2 -2
  63. package/build/client/assets/{preferences-B7ND1VS9.js.map → preferences-Czy5oqWs.js.map} +1 -1
  64. package/build/client/assets/{presence-VCvV2mg7.js → presence-Brtc_BN7.js} +2 -2
  65. package/build/client/assets/{presence-VCvV2mg7.js.map → presence-Brtc_BN7.js.map} +1 -1
  66. package/build/client/assets/{preview-fhmjENlm.js → preview-Be-plbPz.js} +2 -2
  67. package/build/client/assets/{preview-fhmjENlm.js.map → preview-Be-plbPz.js.map} +1 -1
  68. package/build/client/assets/{product-CvyMpYD_.js → product-D4IgPJN5.js} +2 -2
  69. package/build/client/assets/{product-CvyMpYD_.js.map → product-D4IgPJN5.js.map} +1 -1
  70. package/build/client/assets/{progress-Bby-ybMA.js → progress-JDMkfyr3.js} +2 -2
  71. package/build/client/assets/{progress-Bby-ybMA.js.map → progress-JDMkfyr3.js.map} +1 -1
  72. package/build/client/assets/{revalidation-ws-BJWJviUX.js → revalidation-ws-iocj9Mrl.js} +2 -2
  73. package/build/client/assets/{revalidation-ws-BJWJviUX.js.map → revalidation-ws-iocj9Mrl.js.map} +1 -1
  74. package/build/client/assets/{root-B-MkiU1r.js → root-IJJBVEoj.js} +2 -2
  75. package/build/client/assets/{root-B-MkiU1r.js.map → root-IJJBVEoj.js.map} +1 -1
  76. package/build/client/assets/{root-loader-BOzEMapJ.js → root-loader-BmUqzUDN.js} +2 -2
  77. package/build/client/assets/{root-loader-BOzEMapJ.js.map → root-loader-BmUqzUDN.js.map} +1 -1
  78. package/build/client/assets/{set-playground-BSGwH9dH.js → set-playground-DO5tJu4h.js} +2 -2
  79. package/build/client/assets/{set-playground-BSGwH9dH.js.map → set-playground-DO5tJu4h.js.map} +1 -1
  80. package/build/client/assets/{test-BeEphi7e.js → test-C8NrA0Ls.js} +2 -2
  81. package/build/client/assets/{test-BeEphi7e.js.map → test-C8NrA0Ls.js.map} +1 -1
  82. package/build/client/assets/{tests-RWSslYc0.js → tests-Bko6qhsh.js} +2 -2
  83. package/build/client/assets/{tests-RWSslYc0.js.map → tests-Bko6qhsh.js.map} +1 -1
  84. package/build/client/assets/{user-BsPobzjB.js → user-CYXKquT7.js} +2 -2
  85. package/build/client/assets/{user-BsPobzjB.js.map → user-CYXKquT7.js.map} +1 -1
  86. package/build/client/assets/{version-f8qqYbyU.js → version-CwWSRwe5.js} +2 -2
  87. package/build/client/assets/{version-f8qqYbyU.js.map → version-CwWSRwe5.js.map} +1 -1
  88. package/build/client/assets/{workshop-config-Zfc8zU0x.js → workshop-config-BMWaKPZT.js} +2 -2
  89. package/build/client/assets/{workshop-config-Zfc8zU0x.js.map → workshop-config-BMWaKPZT.js.map} +1 -1
  90. package/build/server/index.js +7 -3
  91. package/build/server/index.js.map +1 -1
  92. package/package.json +3 -3
  93. package/build/client/assets/_extra-Dki7HdFp.js +0 -2
  94. package/build/client/assets/_extra-Dki7HdFp.js.map +0 -1
  95. package/build/client/assets/_layout-DTrIGRDO.js +0 -2
  96. package/build/client/assets/_layout-DTrIGRDO.js.map +0 -1
  97. package/build/client/assets/discord-r3m19sUM.js +0 -2
  98. package/build/client/assets/discord-r3m19sUM.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import{j as O}from"./jsx-runtime-C5WNSv3b.js";import{R as Ee,r as Ce}from"./index-CqIc3cxq.js";import{g as P_,f as Hv,A as O_,L as Ln,l as N_}from"./chunk-EPOLDU6W-BCLmut3y.js";import{u as U_}from"./use-event-source-BuD4_2SF.js";import{t as $p}from"./index-DzdDahau.js";import{u as Gv}from"./index-CdzVFL-Z.js";import{r as $_,c as eh,I as Zf}from"./misc-W4055b-0.js";import{u as Kv}from"./root-loader-BOzEMapJ.js";import{o as F_,s as B_,n as H_}from"./schemas-Uj5SZtvt.js";import{u as Vv}from"./online-DiNLkgTC.js";import{L as Jf}from"./loading-CDNzW5oO.js";import{S as G_}from"./tooltip-Tlsyx2YO.js";import{f as K_}from"./format-CZ5n8p10.js";import{c as V_}from"./user-BsPobzjB.js";import{u as W_}from"./workshop-config-Zfc8zU0x.js";const Fp={best:["source","highest","high","medium","low"],high:["high","medium","low","highest","source"],medium:["medium","low","high","highest","source"],low:["low","medium","high","highest","source"]};function q_(i,e){if(i.length===0)return null;const t=new Map(i.map(r=>[r.quality.toLowerCase(),r.size])),s=Fp[e]??Fp.best;for(const r of s){const n=t.get(r);if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n}return i.find(r=>typeof r.size=="number"&&Number.isFinite(r.size))?.size??null}const Y_=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),j_={className:"class",htmlFor:"for"};function z_(i){return i.toLowerCase()}function Bp(i){if(typeof i=="boolean")return i?"":void 0;if(typeof i!="function"&&!(typeof i=="object"&&i!==null))return i}function Le({react:i,tagName:e,elementClass:t,events:s,displayName:r,defaultProps:n,toAttributeName:a=z_,toAttributeValue:o=Bp}){const l=Number.parseInt(i.version)>=19,d=i.forwardRef((u,c)=>{const h=i.useRef(null),f=i.useRef(new Map),m={},p={},g={},v={};for(const[b,E]of Object.entries(u)){if(Y_.has(b)){g[b]=E;continue}const T=a(j_[b]??b);if(t.prototype&&b in t.prototype&&!(b in(globalThis.HTMLElement?.prototype??{}))&&!t.observedAttributes?.some(x=>x===T)){v[b]=E;continue}if(b.startsWith("on")){m[b]=E;continue}const A=o(E);if(T&&A!=null&&(p[T]=String(A),l||(g[T]=A)),T&&l){const x=Bp(E);A!==x?g[T]=A:g[T]=E}}if(typeof window<"u"){for(const b in m){const E=m[b],T=b.endsWith("Capture"),A=(s?.[b]??b.slice(2).toLowerCase()).slice(0,T?-7:void 0);i.useLayoutEffect(()=>{const x=h?.current;if(!(!x||typeof E!="function"))return x.addEventListener(A,E,T),()=>{x.removeEventListener(A,E,T)}},[h?.current,E])}i.useLayoutEffect(()=>{if(h.current===null)return;const b=new Map;for(const E in v)Hp(h.current,E,v[E]),f.current.delete(E),b.set(E,v[E]);for(const[E,T]of f.current)Hp(h.current,E,void 0);f.current=b})}if(typeof window>"u"&&t?.getTemplateHTML&&t?.shadowRootOptions){const{mode:b,delegatesFocus:E}=t.shadowRootOptions,T=i.createElement("template",{shadowrootmode:b,shadowrootdelegatesfocus:E,dangerouslySetInnerHTML:{__html:t.getTemplateHTML(p,u)},key:"ce-la-react-ssr-template-shadow-root"});g.children=[T,g.children]}return i.createElement(e,{...n,...g,ref:i.useCallback(b=>{h.current=b,typeof c=="function"?c(b):c!==null&&(c.current=b)},[c])},g.children)});return d.displayName=r??t.name,d}function Hp(i,e,t){i[e]=t,t==null&&e in(globalThis.HTMLElement?.prototype??{})&&i.removeAttribute(e)}const Q={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},xe={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Wv={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},qv=Object.entries(Wv),_=qv.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Q_={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ys=qv.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Q_});Object.entries(ys).reduce((i,[e,t])=>{const s=_[e];return s&&(i[t]=s),i},{userinactivechange:"userinactive"});const X_=Object.entries(_).reduce((i,[e,t])=>{const s=ys[e];return s&&(i[t]=s),i},{userinactive:"userinactivechange"}),ts={SUBTITLES:"subtitles",CAPTIONS:"captions",CHAPTERS:"chapters",METADATA:"metadata"},Pn={DISABLED:"disabled",SHOWING:"showing"},ac={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Gt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},hs={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},Z_={FULLSCREEN:"fullscreen"};function J_(i){return i?.map(tA).join(" ")}function eA(i){return i?.split(/\s+/).map(iA)}function tA(i){if(i){const{id:e,width:t,height:s}=i;return[e,t,s].filter(r=>r!=null).join(":")}}function iA(i){if(i){const[e,t,s]=i.split(":");return{id:e,width:+t,height:+s}}}function sA(i){return i?.map(nA).join(" ")}function rA(i){return i?.split(/\s+/).map(aA)}function nA(i){if(i){const{id:e,kind:t,language:s,label:r}=i;return[e,t,s,r].filter(n=>n!=null).join(":")}}function aA(i){if(i){const[e,t,s,r]=i.split(":");return{id:e,kind:t,language:s,label:r}}}function oA(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function em(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Yv(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}const jv=i=>new Promise(e=>setTimeout(e,i)),Gp=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],lA=(i,e)=>{const t=i===1?Gp[e].singular:Gp[e].plural;return`${i} ${t}`},Ka=i=>{if(!em(i))return"";const e=Math.abs(i),t=e!==i,s=new Date(0,0,0,0,0,e,0);return`${[s.getHours(),s.getMinutes(),s.getSeconds()].map((o,l)=>o&&lA(o,l)).filter(o=>o).join(", ")}${t?" remaining":""}`};function qs(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let s=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600);const a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=s="0"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",s=s<10?"0"+s:s,(t?"-":"")+n+r+s}const dA={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Kp;const oc={en:dA};let th=((Kp=globalThis.navigator)==null?void 0:Kp.language)||"en";const uA=i=>{th=i},cA=i=>{var e,t,s;const[r]=th.split("-");return((e=oc[th])==null?void 0:e[i])||((t=oc[r])==null?void 0:t[i])||((s=oc.en)==null?void 0:s[i])||i},te=(i,e={})=>cA(i).replace(/\{(\w+)\}/g,(t,s)=>s in e?String(e[s]):`{${s}}`);let zv=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}};class Qv extends zv{}let Vp=class extends Qv{constructor(){super(...arguments),this.role=null}};class hA{observe(){}unobserve(){}disconnect(){}}const Xv={createElement:function(){return new io.HTMLElement},createElementNS:function(){return new io.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},io={ResizeObserver:hA,document:Xv,Node:Qv,Element:Vp,HTMLElement:class extends Vp{constructor(){super(...arguments),this.innerHTML=""}get content(){return new io.DocumentFragment}},DocumentFragment:class extends zv{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},Zv="global"in globalThis&&globalThis?.global===globalThis||typeof window>"u"||typeof window.customElements>"u",Jv=Object.keys(io).every(i=>i in globalThis),k=Zv&&!Jv?io:globalThis,ut=Zv&&!Jv?Xv:globalThis.document,Wp=new WeakMap,tm=i=>{let e=Wp.get(i);return e||Wp.set(i,e=new Set),e},eE=new k.ResizeObserver(i=>{for(const e of i)for(const t of tm(e.target))t(e)});function Yn(i,e){tm(i).add(e),eE.observe(i)}function jn(i,e){const t=tm(i);t.delete(e),t.size||eE.unobserve(i)}function Jt(i){const e={};for(const t of i)e[t.name]=t.value;return e}function Ft(i){var e;return(e=ih(i))!=null?e:ia(i,"media-controller")}function ih(i){var e;const{MEDIA_CONTROLLER:t}=xe,s=i.getAttribute(t);if(s)return(e=yu(i))==null?void 0:e.getElementById(s)}const tE=(i,e,t=".value")=>{const s=i.querySelector(t);s&&(s.textContent=e)},fA=(i,e)=>{const t=`slot[name="${e}"]`,s=i.shadowRoot.querySelector(t);return s?s.children:[]},iE=(i,e)=>fA(i,e)[0],Ts=(i,e)=>!i||!e?!1:i?.contains(e)?!0:Ts(i,e.getRootNode().host),ia=(i,e)=>{if(!i)return null;const t=i.closest(e);return t||ia(i.getRootNode().host,e)};function im(i=document){var e;const t=i?.activeElement;return t?(e=im(t.shadowRoot))!=null?e:t:null}function yu(i){var e;const t=(e=i?.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function sE(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:s=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:s});let r=i;for(;r&&e>0;){const n=getComputedStyle(r);if(t&&n.opacity==="0"||s&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function mA(i,e,t,s){const r=s.x-t.x,n=s.y-t.y,a=r*r+n*n;if(a===0)return 0;const o=((i-t.x)*r+(e-t.y)*n)/a;return Math.max(0,Math.min(1,o))}function gt(i,e){const t=pA(i,s=>s===e);return t||sm(i,e)}function pA(i,e){var t,s;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(s=r.sheet)==null?void 0:s.cssRules}catch{continue}for(const a of n??[])if(e(a.selectorText))return a}}function sm(i,e){var t,s;const r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r?.[r.length-1];return n?.sheet?(n?.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(s=n.sheet.cssRules)==null?void 0:s[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function Ge(i,e,t=Number.NaN){const s=i.getAttribute(e);return s!=null?+s:t}function et(i,e,t){const s=+t;if(t==null||Number.isNaN(s)){i.hasAttribute(e)&&i.removeAttribute(e);return}Ge(i,e,void 0)!==s&&i.setAttribute(e,`${s}`)}function be(i,e){return i.hasAttribute(e)}function Te(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}be(i,e)!=t&&i.toggleAttribute(e,t)}function Ke(i,e,t=null){var s;return(s=i.getAttribute(e))!=null?s:t}function Ve(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}const s=`${t}`;Ke(i,e,void 0)!==s&&i.setAttribute(e,s)}var rE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Is=(i,e,t)=>(rE(i,e,"read from private field"),t?t.call(i):e.get(i)),gA=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mo=(i,e,t,s)=>(rE(i,e,"write to private field"),e.set(i,t),t),Nt;function vA(i){return`
1
+ import{j as O}from"./jsx-runtime-C5WNSv3b.js";import{R as Ee,r as Ce}from"./index-CqIc3cxq.js";import{g as P_,f as Hv,A as O_,L as Ln,l as N_}from"./chunk-EPOLDU6W-BCLmut3y.js";import{u as U_}from"./use-event-source-BuD4_2SF.js";import{t as $p}from"./index-DzdDahau.js";import{u as Gv}from"./index-BrVvTrwg.js";import{r as $_,c as eh,I as Zf}from"./misc-W4055b-0.js";import{u as Kv}from"./root-loader-BmUqzUDN.js";import{o as F_,s as B_,n as H_}from"./schemas-Uj5SZtvt.js";import{u as Vv}from"./online-DVk-W8Cr.js";import{L as Jf}from"./loading-CaCCsk9k.js";import{S as G_}from"./tooltip-Tlsyx2YO.js";import{f as K_}from"./format-CZ5n8p10.js";import{c as V_}from"./user-CYXKquT7.js";import{u as W_}from"./workshop-config-BMWaKPZT.js";const Fp={best:["source","highest","high","medium","low"],high:["high","medium","low","highest","source"],medium:["medium","low","high","highest","source"],low:["low","medium","high","highest","source"]};function q_(i,e){if(i.length===0)return null;const t=new Map(i.map(r=>[r.quality.toLowerCase(),r.size])),s=Fp[e]??Fp.best;for(const r of s){const n=t.get(r);if(typeof n=="number"&&Number.isFinite(n)&&n>0)return n}return i.find(r=>typeof r.size=="number"&&Number.isFinite(r.size))?.size??null}const Y_=new Set(["style","children","ref","key","suppressContentEditableWarning","suppressHydrationWarning","dangerouslySetInnerHTML"]),j_={className:"class",htmlFor:"for"};function z_(i){return i.toLowerCase()}function Bp(i){if(typeof i=="boolean")return i?"":void 0;if(typeof i!="function"&&!(typeof i=="object"&&i!==null))return i}function Le({react:i,tagName:e,elementClass:t,events:s,displayName:r,defaultProps:n,toAttributeName:a=z_,toAttributeValue:o=Bp}){const l=Number.parseInt(i.version)>=19,d=i.forwardRef((u,c)=>{const h=i.useRef(null),f=i.useRef(new Map),m={},p={},g={},v={};for(const[b,E]of Object.entries(u)){if(Y_.has(b)){g[b]=E;continue}const T=a(j_[b]??b);if(t.prototype&&b in t.prototype&&!(b in(globalThis.HTMLElement?.prototype??{}))&&!t.observedAttributes?.some(x=>x===T)){v[b]=E;continue}if(b.startsWith("on")){m[b]=E;continue}const A=o(E);if(T&&A!=null&&(p[T]=String(A),l||(g[T]=A)),T&&l){const x=Bp(E);A!==x?g[T]=A:g[T]=E}}if(typeof window<"u"){for(const b in m){const E=m[b],T=b.endsWith("Capture"),A=(s?.[b]??b.slice(2).toLowerCase()).slice(0,T?-7:void 0);i.useLayoutEffect(()=>{const x=h?.current;if(!(!x||typeof E!="function"))return x.addEventListener(A,E,T),()=>{x.removeEventListener(A,E,T)}},[h?.current,E])}i.useLayoutEffect(()=>{if(h.current===null)return;const b=new Map;for(const E in v)Hp(h.current,E,v[E]),f.current.delete(E),b.set(E,v[E]);for(const[E,T]of f.current)Hp(h.current,E,void 0);f.current=b})}if(typeof window>"u"&&t?.getTemplateHTML&&t?.shadowRootOptions){const{mode:b,delegatesFocus:E}=t.shadowRootOptions,T=i.createElement("template",{shadowrootmode:b,shadowrootdelegatesfocus:E,dangerouslySetInnerHTML:{__html:t.getTemplateHTML(p,u)},key:"ce-la-react-ssr-template-shadow-root"});g.children=[T,g.children]}return i.createElement(e,{...n,...g,ref:i.useCallback(b=>{h.current=b,typeof c=="function"?c(b):c!==null&&(c.current=b)},[c])},g.children)});return d.displayName=r??t.name,d}function Hp(i,e,t){i[e]=t,t==null&&e in(globalThis.HTMLElement?.prototype??{})&&i.removeAttribute(e)}const Q={MEDIA_PLAY_REQUEST:"mediaplayrequest",MEDIA_PAUSE_REQUEST:"mediapauserequest",MEDIA_MUTE_REQUEST:"mediamuterequest",MEDIA_UNMUTE_REQUEST:"mediaunmuterequest",MEDIA_LOOP_REQUEST:"medialooprequest",MEDIA_VOLUME_REQUEST:"mediavolumerequest",MEDIA_SEEK_REQUEST:"mediaseekrequest",MEDIA_AIRPLAY_REQUEST:"mediaairplayrequest",MEDIA_ENTER_FULLSCREEN_REQUEST:"mediaenterfullscreenrequest",MEDIA_EXIT_FULLSCREEN_REQUEST:"mediaexitfullscreenrequest",MEDIA_PREVIEW_REQUEST:"mediapreviewrequest",MEDIA_ENTER_PIP_REQUEST:"mediaenterpiprequest",MEDIA_EXIT_PIP_REQUEST:"mediaexitpiprequest",MEDIA_ENTER_CAST_REQUEST:"mediaentercastrequest",MEDIA_EXIT_CAST_REQUEST:"mediaexitcastrequest",MEDIA_SHOW_TEXT_TRACKS_REQUEST:"mediashowtexttracksrequest",MEDIA_HIDE_TEXT_TRACKS_REQUEST:"mediahidetexttracksrequest",MEDIA_SHOW_SUBTITLES_REQUEST:"mediashowsubtitlesrequest",MEDIA_DISABLE_SUBTITLES_REQUEST:"mediadisablesubtitlesrequest",MEDIA_TOGGLE_SUBTITLES_REQUEST:"mediatogglesubtitlesrequest",MEDIA_PLAYBACK_RATE_REQUEST:"mediaplaybackraterequest",MEDIA_RENDITION_REQUEST:"mediarenditionrequest",MEDIA_AUDIO_TRACK_REQUEST:"mediaaudiotrackrequest",MEDIA_SEEK_TO_LIVE_REQUEST:"mediaseektoliverequest",REGISTER_MEDIA_STATE_RECEIVER:"registermediastatereceiver",UNREGISTER_MEDIA_STATE_RECEIVER:"unregistermediastatereceiver"},xe={MEDIA_CHROME_ATTRIBUTES:"mediachromeattributes",MEDIA_CONTROLLER:"mediacontroller"},Wv={MEDIA_AIRPLAY_UNAVAILABLE:"mediaAirplayUnavailable",MEDIA_AUDIO_TRACK_ENABLED:"mediaAudioTrackEnabled",MEDIA_AUDIO_TRACK_LIST:"mediaAudioTrackList",MEDIA_AUDIO_TRACK_UNAVAILABLE:"mediaAudioTrackUnavailable",MEDIA_BUFFERED:"mediaBuffered",MEDIA_CAST_UNAVAILABLE:"mediaCastUnavailable",MEDIA_CHAPTERS_CUES:"mediaChaptersCues",MEDIA_CURRENT_TIME:"mediaCurrentTime",MEDIA_DURATION:"mediaDuration",MEDIA_ENDED:"mediaEnded",MEDIA_ERROR:"mediaError",MEDIA_ERROR_CODE:"mediaErrorCode",MEDIA_ERROR_MESSAGE:"mediaErrorMessage",MEDIA_FULLSCREEN_UNAVAILABLE:"mediaFullscreenUnavailable",MEDIA_HAS_PLAYED:"mediaHasPlayed",MEDIA_HEIGHT:"mediaHeight",MEDIA_IS_AIRPLAYING:"mediaIsAirplaying",MEDIA_IS_CASTING:"mediaIsCasting",MEDIA_IS_FULLSCREEN:"mediaIsFullscreen",MEDIA_IS_PIP:"mediaIsPip",MEDIA_LOADING:"mediaLoading",MEDIA_MUTED:"mediaMuted",MEDIA_LOOP:"mediaLoop",MEDIA_PAUSED:"mediaPaused",MEDIA_PIP_UNAVAILABLE:"mediaPipUnavailable",MEDIA_PLAYBACK_RATE:"mediaPlaybackRate",MEDIA_PREVIEW_CHAPTER:"mediaPreviewChapter",MEDIA_PREVIEW_COORDS:"mediaPreviewCoords",MEDIA_PREVIEW_IMAGE:"mediaPreviewImage",MEDIA_PREVIEW_TIME:"mediaPreviewTime",MEDIA_RENDITION_LIST:"mediaRenditionList",MEDIA_RENDITION_SELECTED:"mediaRenditionSelected",MEDIA_RENDITION_UNAVAILABLE:"mediaRenditionUnavailable",MEDIA_SEEKABLE:"mediaSeekable",MEDIA_STREAM_TYPE:"mediaStreamType",MEDIA_SUBTITLES_LIST:"mediaSubtitlesList",MEDIA_SUBTITLES_SHOWING:"mediaSubtitlesShowing",MEDIA_TARGET_LIVE_WINDOW:"mediaTargetLiveWindow",MEDIA_TIME_IS_LIVE:"mediaTimeIsLive",MEDIA_VOLUME:"mediaVolume",MEDIA_VOLUME_LEVEL:"mediaVolumeLevel",MEDIA_VOLUME_UNAVAILABLE:"mediaVolumeUnavailable",MEDIA_LANG:"mediaLang",MEDIA_WIDTH:"mediaWidth"},qv=Object.entries(Wv),_=qv.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{}),Q_={USER_INACTIVE_CHANGE:"userinactivechange",BREAKPOINTS_CHANGE:"breakpointchange",BREAKPOINTS_COMPUTED:"breakpointscomputed"},ys=qv.reduce((i,[e,t])=>(i[e]=t.toLowerCase(),i),{...Q_});Object.entries(ys).reduce((i,[e,t])=>{const s=_[e];return s&&(i[t]=s),i},{userinactivechange:"userinactive"});const X_=Object.entries(_).reduce((i,[e,t])=>{const s=ys[e];return s&&(i[t]=s),i},{userinactive:"userinactivechange"}),ts={SUBTITLES:"subtitles",CAPTIONS:"captions",CHAPTERS:"chapters",METADATA:"metadata"},Pn={DISABLED:"disabled",SHOWING:"showing"},ac={MOUSE:"mouse",PEN:"pen",TOUCH:"touch"},Gt={UNAVAILABLE:"unavailable",UNSUPPORTED:"unsupported"},hs={LIVE:"live",ON_DEMAND:"on-demand",UNKNOWN:"unknown"},Z_={FULLSCREEN:"fullscreen"};function J_(i){return i?.map(tA).join(" ")}function eA(i){return i?.split(/\s+/).map(iA)}function tA(i){if(i){const{id:e,width:t,height:s}=i;return[e,t,s].filter(r=>r!=null).join(":")}}function iA(i){if(i){const[e,t,s]=i.split(":");return{id:e,width:+t,height:+s}}}function sA(i){return i?.map(nA).join(" ")}function rA(i){return i?.split(/\s+/).map(aA)}function nA(i){if(i){const{id:e,kind:t,language:s,label:r}=i;return[e,t,s,r].filter(n=>n!=null).join(":")}}function aA(i){if(i){const[e,t,s,r]=i.split(":");return{id:e,kind:t,language:s,label:r}}}function oA(i){return i.replace(/[-_]([a-z])/g,(e,t)=>t.toUpperCase())}function em(i){return typeof i=="number"&&!Number.isNaN(i)&&Number.isFinite(i)}function Yv(i){return typeof i!="string"?!1:!isNaN(i)&&!isNaN(parseFloat(i))}const jv=i=>new Promise(e=>setTimeout(e,i)),Gp=[{singular:"hour",plural:"hours"},{singular:"minute",plural:"minutes"},{singular:"second",plural:"seconds"}],lA=(i,e)=>{const t=i===1?Gp[e].singular:Gp[e].plural;return`${i} ${t}`},Ka=i=>{if(!em(i))return"";const e=Math.abs(i),t=e!==i,s=new Date(0,0,0,0,0,e,0);return`${[s.getHours(),s.getMinutes(),s.getSeconds()].map((o,l)=>o&&lA(o,l)).filter(o=>o).join(", ")}${t?" remaining":""}`};function qs(i,e){let t=!1;i<0&&(t=!0,i=0-i),i=i<0?0:i;let s=Math.floor(i%60),r=Math.floor(i/60%60),n=Math.floor(i/3600);const a=Math.floor(e/60%60),o=Math.floor(e/3600);return(isNaN(i)||i===1/0)&&(n=r=s="0"),n=n>0||o>0?n+":":"",r=((n||a>=10)&&r<10?"0"+r:r)+":",s=s<10?"0"+s:s,(t?"-":"")+n+r+s}const dA={"Start airplay":"Start airplay","Stop airplay":"Stop airplay",Audio:"Audio",Captions:"Captions","Enable captions":"Enable captions","Disable captions":"Disable captions","Start casting":"Start casting","Stop casting":"Stop casting","Enter fullscreen mode":"Enter fullscreen mode","Exit fullscreen mode":"Exit fullscreen mode",Mute:"Mute",Unmute:"Unmute",Loop:"Loop","Enter picture in picture mode":"Enter picture in picture mode","Exit picture in picture mode":"Exit picture in picture mode",Play:"Play",Pause:"Pause","Playback rate":"Playback rate","Playback rate {playbackRate}":"Playback rate {playbackRate}",Quality:"Quality","Seek backward":"Seek backward","Seek forward":"Seek forward",Settings:"Settings",Auto:"Auto","audio player":"audio player","video player":"video player",volume:"volume",seek:"seek","closed captions":"closed captions","current playback rate":"current playback rate","playback time":"playback time","media loading":"media loading",settings:"settings","audio tracks":"audio tracks",quality:"quality",play:"play",pause:"pause",mute:"mute",unmute:"unmute","chapter: {chapterName}":"chapter: {chapterName}",live:"live",Off:"Off","start airplay":"start airplay","stop airplay":"stop airplay","start casting":"start casting","stop casting":"stop casting","enter fullscreen mode":"enter fullscreen mode","exit fullscreen mode":"exit fullscreen mode","enter picture in picture mode":"enter picture in picture mode","exit picture in picture mode":"exit picture in picture mode","seek to live":"seek to live","playing live":"playing live","seek back {seekOffset} seconds":"seek back {seekOffset} seconds","seek forward {seekOffset} seconds":"seek forward {seekOffset} seconds","Network Error":"Network Error","Decode Error":"Decode Error","Source Not Supported":"Source Not Supported","Encryption Error":"Encryption Error","A network error caused the media download to fail.":"A network error caused the media download to fail.","A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.":"A media error caused playback to be aborted. The media could be corrupt or your browser does not support this format.","An unsupported error occurred. The server or network failed, or your browser does not support this format.":"An unsupported error occurred. The server or network failed, or your browser does not support this format.","The media is encrypted and there are no keys to decrypt it.":"The media is encrypted and there are no keys to decrypt it."};var Kp;const oc={en:dA};let th=((Kp=globalThis.navigator)==null?void 0:Kp.language)||"en";const uA=i=>{th=i},cA=i=>{var e,t,s;const[r]=th.split("-");return((e=oc[th])==null?void 0:e[i])||((t=oc[r])==null?void 0:t[i])||((s=oc.en)==null?void 0:s[i])||i},te=(i,e={})=>cA(i).replace(/\{(\w+)\}/g,(t,s)=>s in e?String(e[s]):`{${s}}`);let zv=class{addEventListener(){}removeEventListener(){}dispatchEvent(){return!0}};class Qv extends zv{}let Vp=class extends Qv{constructor(){super(...arguments),this.role=null}};class hA{observe(){}unobserve(){}disconnect(){}}const Xv={createElement:function(){return new io.HTMLElement},createElementNS:function(){return new io.HTMLElement},addEventListener(){},removeEventListener(){},dispatchEvent(i){return!1}},io={ResizeObserver:hA,document:Xv,Node:Qv,Element:Vp,HTMLElement:class extends Vp{constructor(){super(...arguments),this.innerHTML=""}get content(){return new io.DocumentFragment}},DocumentFragment:class extends zv{},customElements:{get:function(){},define:function(){},whenDefined:function(){}},localStorage:{getItem(i){return null},setItem(i,e){},removeItem(i){}},CustomEvent:function(){},getComputedStyle:function(){},navigator:{languages:[],get userAgent(){return""}},matchMedia(i){return{matches:!1,media:i}},DOMParser:class{parseFromString(e,t){return{body:{textContent:e}}}}},Zv="global"in globalThis&&globalThis?.global===globalThis||typeof window>"u"||typeof window.customElements>"u",Jv=Object.keys(io).every(i=>i in globalThis),k=Zv&&!Jv?io:globalThis,ut=Zv&&!Jv?Xv:globalThis.document,Wp=new WeakMap,tm=i=>{let e=Wp.get(i);return e||Wp.set(i,e=new Set),e},eE=new k.ResizeObserver(i=>{for(const e of i)for(const t of tm(e.target))t(e)});function Yn(i,e){tm(i).add(e),eE.observe(i)}function jn(i,e){const t=tm(i);t.delete(e),t.size||eE.unobserve(i)}function Jt(i){const e={};for(const t of i)e[t.name]=t.value;return e}function Ft(i){var e;return(e=ih(i))!=null?e:ia(i,"media-controller")}function ih(i){var e;const{MEDIA_CONTROLLER:t}=xe,s=i.getAttribute(t);if(s)return(e=yu(i))==null?void 0:e.getElementById(s)}const tE=(i,e,t=".value")=>{const s=i.querySelector(t);s&&(s.textContent=e)},fA=(i,e)=>{const t=`slot[name="${e}"]`,s=i.shadowRoot.querySelector(t);return s?s.children:[]},iE=(i,e)=>fA(i,e)[0],Ts=(i,e)=>!i||!e?!1:i?.contains(e)?!0:Ts(i,e.getRootNode().host),ia=(i,e)=>{if(!i)return null;const t=i.closest(e);return t||ia(i.getRootNode().host,e)};function im(i=document){var e;const t=i?.activeElement;return t?(e=im(t.shadowRoot))!=null?e:t:null}function yu(i){var e;const t=(e=i?.getRootNode)==null?void 0:e.call(i);return t instanceof ShadowRoot||t instanceof Document?t:null}function sE(i,{depth:e=3,checkOpacity:t=!0,checkVisibilityCSS:s=!0}={}){if(i.checkVisibility)return i.checkVisibility({checkOpacity:t,checkVisibilityCSS:s});let r=i;for(;r&&e>0;){const n=getComputedStyle(r);if(t&&n.opacity==="0"||s&&n.visibility==="hidden"||n.display==="none")return!1;r=r.parentElement,e--}return!0}function mA(i,e,t,s){const r=s.x-t.x,n=s.y-t.y,a=r*r+n*n;if(a===0)return 0;const o=((i-t.x)*r+(e-t.y)*n)/a;return Math.max(0,Math.min(1,o))}function gt(i,e){const t=pA(i,s=>s===e);return t||sm(i,e)}function pA(i,e){var t,s;let r;for(r of(t=i.querySelectorAll("style:not([media])"))!=null?t:[]){let n;try{n=(s=r.sheet)==null?void 0:s.cssRules}catch{continue}for(const a of n??[])if(e(a.selectorText))return a}}function sm(i,e){var t,s;const r=(t=i.querySelectorAll("style:not([media])"))!=null?t:[],n=r?.[r.length-1];return n?.sheet?(n?.sheet.insertRule(`${e}{}`,n.sheet.cssRules.length),(s=n.sheet.cssRules)==null?void 0:s[n.sheet.cssRules.length-1]):(console.warn("Media Chrome: No style sheet found on style tag of",i),{style:{setProperty:()=>{},removeProperty:()=>"",getPropertyValue:()=>""}})}function Ge(i,e,t=Number.NaN){const s=i.getAttribute(e);return s!=null?+s:t}function et(i,e,t){const s=+t;if(t==null||Number.isNaN(s)){i.hasAttribute(e)&&i.removeAttribute(e);return}Ge(i,e,void 0)!==s&&i.setAttribute(e,`${s}`)}function be(i,e){return i.hasAttribute(e)}function Te(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}be(i,e)!=t&&i.toggleAttribute(e,t)}function Ke(i,e,t=null){var s;return(s=i.getAttribute(e))!=null?s:t}function Ve(i,e,t){if(t==null){i.hasAttribute(e)&&i.removeAttribute(e);return}const s=`${t}`;Ke(i,e,void 0)!==s&&i.setAttribute(e,s)}var rE=(i,e,t)=>{if(!e.has(i))throw TypeError("Cannot "+t)},Is=(i,e,t)=>(rE(i,e,"read from private field"),t?t.call(i):e.get(i)),gA=(i,e,t)=>{if(e.has(i))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(i):e.set(i,t)},Mo=(i,e,t,s)=>(rE(i,e,"write to private field"),e.set(i,t),t),Nt;function vA(i){return`
2
2
  <style>
3
3
  :host {
4
4
  display: var(--media-control-display, var(--media-gesture-receiver-display, inline-block));
@@ -3383,4 +3383,4 @@ media-poster-image:not([src]):not([placeholdersrc]) {
3383
3383
  </p>`:""}
3384
3384
  `}return R2(i)};function k2(i){var e,t;let s=i.theme;if(s){let r=(t=(e=i.getRootNode())==null?void 0:e.getElementById)==null?void 0:t.call(e,s);if(r&&r instanceof HTMLTemplateElement)return r;s.startsWith("media-theme-")||(s=`media-theme-${s}`);let n=zi.customElements.get(s);if(n!=null&&n.template)return n.template}}function D2(i){var e;let t=(e=i.mediaController)==null?void 0:e.querySelector("media-time-display");return t&&getComputedStyle(t).getPropertyValue("--media-duration-display-display").trim()==="none"}function Lv(i){let e=i.videoTitle?{video_title:i.videoTitle}:{};return i.getAttributeNames().filter(t=>t.startsWith("metadata-")).reduce((t,s)=>{let r=i.getAttribute(s);return r!==null&&(t[s.replace(/^metadata-/,"").replace(/-/g,"_")]=r),t},e)}var C2=Object.values(C),w2=Object.values(cs),M2=Object.values(U),Rv=y_(),kv="mux-player",Dv={isDialogOpen:!1},P2={redundant_streams:!0},Ld,Rd,kd,mr,Dd,qn,Je,$s,x_,Qf,pr,Cv,wv,Mv,Pv,O2=class extends Tv{constructor(){super(),Ti(this,Je),Ti(this,Ld),Ti(this,Rd,!1),Ti(this,kd,{}),Ti(this,mr,!0),Ti(this,Dd,new ZO(this,"hotkeys")),Ti(this,qn,{...Dv,onCloseErrorDialog:i=>{var e;((e=i.composedPath()[0])==null?void 0:e.localName)==="media-error-dialog"&&lt(this,Je,Qf).call(this,{isDialogOpen:!1})},onFocusInErrorDialog:i=>{var e;((e=i.composedPath()[0])==null?void 0:e.localName)==="media-error-dialog"&&(v_(this,Eu.activeElement)||i.preventDefault())}}),is(this,Ld,ap()),this.attachShadow({mode:"open"}),lt(this,Je,x_).call(this),this.isConnected&&lt(this,Je,$s).call(this)}static get NAME(){return kv}static get VERSION(){return Rv}static get observedAttributes(){var i;return[...(i=Tv.observedAttributes)!=null?i:[],...w2,...C2,...M2]}get mediaTheme(){var i;return(i=this.shadowRoot)==null?void 0:i.querySelector("media-theme")}get mediaController(){var i,e;return(e=(i=this.mediaTheme)==null?void 0:i.shadowRoot)==null?void 0:e.querySelector("media-controller")}connectedCallback(){let i=this.media;i&&(i.metadata=Lv(this))}attributeChangedCallback(i,e,t){switch(lt(this,Je,$s).call(this),super.attributeChangedCallback(i,e,t),i){case U.HOTKEYS:De(this,Dd).value=t;break;case U.THUMBNAIL_TIME:{t!=null&&this.tokens.thumbnail&&ps(re("Use of thumbnail-time with thumbnail-token is currently unsupported. Ignore thumbnail-time.").toString());break}case U.THUMBNAIL_TOKEN:{if(t){let s=Bn(t);if(s){let{aud:r}=s,n=Za.THUMBNAIL;r!==n&&ps(re("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:r,expectedAud:n,tokenNamePrefix:"thumbnail"}))}}break}case U.STORYBOARD_TOKEN:{if(t){let s=Bn(t);if(s){let{aud:r}=s,n=Za.STORYBOARD;r!==n&&ps(re("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:r,expectedAud:n,tokenNamePrefix:"storyboard"}))}}break}case U.DRM_TOKEN:{if(t){let s=Bn(t);if(s){let{aud:r}=s,n=Za.DRM;r!==n&&ps(re("The {tokenNamePrefix}-token has an incorrect aud value: {aud}. aud value should be {expectedAud}.").format({aud:r,expectedAud:n,tokenNamePrefix:"drm"}))}}break}case C.PLAYBACK_ID:{t!=null&&t.includes("?token")&&oi(re("The specificed playback ID {playbackId} contains a token which must be provided via the playback-token attribute.").format({playbackId:t}));break}case C.STREAM_TYPE:{t&&![ke.LIVE,ke.ON_DEMAND,ke.UNKNOWN].includes(t)?["ll-live","live:dvr","ll-live:dvr"].includes(this.streamType)?this.targetLiveWindow=t.includes("dvr")?Number.POSITIVE_INFINITY:0:T_({file:"invalid-stream-type.md",message:re("Invalid stream-type value supplied: `{streamType}`. Please provide stream-type as either: `on-demand` or `live`").format({streamType:this.streamType})}):t===ke.LIVE?this.getAttribute(U.TARGET_LIVE_WINDOW)==null&&(this.targetLiveWindow=0):this.targetLiveWindow=Number.NaN;break}case U.FULLSCREEN_ELEMENT:{if(t!=null||t!==e){let s=Eu.getElementById(t),r=s?.querySelector("mux-player");this.mediaController&&s&&r&&(this.mediaController.fullscreenElement=s)}break}}[C.PLAYBACK_ID,cs.SRC,U.PLAYBACK_TOKEN].includes(i)&&e!==t&&is(this,qn,{...De(this,qn),...Dv}),lt(this,Je,pr).call(this,{[XO(i)]:t})}async requestFullscreen(i){var e;if(!(!this.mediaController||this.mediaController.hasAttribute(_.MEDIA_IS_FULLSCREEN)))return(e=this.mediaController)==null||e.dispatchEvent(new zi.CustomEvent(Q.MEDIA_ENTER_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((t,s)=>{var r;(r=this.mediaController)==null||r.addEventListener(ys.MEDIA_IS_FULLSCREEN,()=>t(),{once:!0})})}async exitFullscreen(){var i;if(!(!this.mediaController||!this.mediaController.hasAttribute(_.MEDIA_IS_FULLSCREEN)))return(i=this.mediaController)==null||i.dispatchEvent(new zi.CustomEvent(Q.MEDIA_EXIT_FULLSCREEN_REQUEST,{composed:!0,bubbles:!0})),new Promise((e,t)=>{var s;(s=this.mediaController)==null||s.addEventListener(ys.MEDIA_IS_FULLSCREEN,()=>e(),{once:!0})})}get preferCmcd(){var i;return(i=this.getAttribute(C.PREFER_CMCD))!=null?i:void 0}set preferCmcd(i){i!==this.preferCmcd&&(i?nu.includes(i)?this.setAttribute(C.PREFER_CMCD,i):ps(`Invalid value for preferCmcd. Must be one of ${nu.join()}`):this.removeAttribute(C.PREFER_CMCD))}get hasPlayed(){var i,e;return(e=(i=this.mediaController)==null?void 0:i.hasAttribute(_.MEDIA_HAS_PLAYED))!=null?e:!1}get inLiveWindow(){var i;return(i=this.mediaController)==null?void 0:i.hasAttribute(_.MEDIA_TIME_IS_LIVE)}get _hls(){var i;return(i=this.media)==null?void 0:i._hls}get mux(){var i;return(i=this.media)==null?void 0:i.mux}get theme(){var i;return(i=this.getAttribute(U.THEME))!=null?i:x2}set theme(i){this.setAttribute(U.THEME,`${i}`)}get themeProps(){let i=this.mediaTheme;if(!i)return;let e={};for(let t of i.getAttributeNames()){if(zf.includes(t))continue;let s=i.getAttribute(t);e[p_(t)]=s===""?!0:s}return e}set themeProps(i){var e,t;lt(this,Je,$s).call(this);let s={...this.themeProps,...i};for(let r in s){if(zf.includes(r))continue;let n=i?.[r];typeof n=="boolean"||n==null?(e=this.mediaTheme)==null||e.toggleAttribute(Yf(r),!!n):(t=this.mediaTheme)==null||t.setAttribute(Yf(r),n)}}get playbackId(){var i;return(i=this.getAttribute(C.PLAYBACK_ID))!=null?i:void 0}set playbackId(i){i?this.setAttribute(C.PLAYBACK_ID,i):this.removeAttribute(C.PLAYBACK_ID)}get src(){var i,e;return this.playbackId?(i=nr(this,cs.SRC))!=null?i:void 0:(e=this.getAttribute(cs.SRC))!=null?e:void 0}set src(i){i?this.setAttribute(cs.SRC,i):this.removeAttribute(cs.SRC)}get poster(){var i;let e=this.getAttribute(cs.POSTER);if(e!=null)return e;let{tokens:t}=this;if(t.playback&&!t.thumbnail){ps("Missing expected thumbnail token. No poster image will be shown");return}if(this.playbackId&&!this.audio)return jO(this.playbackId,{customDomain:this.customDomain,thumbnailTime:(i=this.thumbnailTime)!=null?i:this.startTime,programTime:this.programStartTime,token:t.thumbnail})}set poster(i){i||i===""?this.setAttribute(cs.POSTER,i):this.removeAttribute(cs.POSTER)}get storyboardSrc(){var i;return(i=this.getAttribute(U.STORYBOARD_SRC))!=null?i:void 0}set storyboardSrc(i){i?this.setAttribute(U.STORYBOARD_SRC,i):this.removeAttribute(U.STORYBOARD_SRC)}get storyboard(){let{tokens:i}=this;if(this.storyboardSrc&&!i.storyboard)return this.storyboardSrc;if(!(this.audio||!this.playbackId||!this.streamType||[ke.LIVE,ke.UNKNOWN].includes(this.streamType)||i.playback&&!i.storyboard))return zO(this.playbackId,{customDomain:this.customDomain,token:i.storyboard,programStartTime:this.programStartTime,programEndTime:this.programEndTime})}get audio(){return this.hasAttribute(U.AUDIO)}set audio(i){if(!i){this.removeAttribute(U.AUDIO);return}this.setAttribute(U.AUDIO,"")}get hotkeys(){return De(this,Dd)}get nohotkeys(){return this.hasAttribute(U.NOHOTKEYS)}set nohotkeys(i){if(!i){this.removeAttribute(U.NOHOTKEYS);return}this.setAttribute(U.NOHOTKEYS,"")}get thumbnailTime(){return Yt(this.getAttribute(U.THUMBNAIL_TIME))}set thumbnailTime(i){this.setAttribute(U.THUMBNAIL_TIME,`${i}`)}get videoTitle(){var i,e;return(e=(i=this.getAttribute(U.VIDEO_TITLE))!=null?i:this.getAttribute(U.TITLE))!=null?e:""}set videoTitle(i){i!==this.videoTitle&&(i?this.setAttribute(U.VIDEO_TITLE,i):this.removeAttribute(U.VIDEO_TITLE))}get placeholder(){var i;return(i=nr(this,U.PLACEHOLDER))!=null?i:""}set placeholder(i){this.setAttribute(U.PLACEHOLDER,`${i}`)}get primaryColor(){var i,e;let t=this.getAttribute(U.PRIMARY_COLOR);if(t!=null||this.mediaTheme&&(t=(e=(i=zi.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_primary-color"))==null?void 0:e.trim(),t))return t}set primaryColor(i){this.setAttribute(U.PRIMARY_COLOR,`${i}`)}get secondaryColor(){var i,e;let t=this.getAttribute(U.SECONDARY_COLOR);if(t!=null||this.mediaTheme&&(t=(e=(i=zi.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_secondary-color"))==null?void 0:e.trim(),t))return t}set secondaryColor(i){this.setAttribute(U.SECONDARY_COLOR,`${i}`)}get accentColor(){var i,e;let t=this.getAttribute(U.ACCENT_COLOR);if(t!=null||this.mediaTheme&&(t=(e=(i=zi.getComputedStyle(this.mediaTheme))==null?void 0:i.getPropertyValue("--_accent-color"))==null?void 0:e.trim(),t))return t}set accentColor(i){this.setAttribute(U.ACCENT_COLOR,`${i}`)}get defaultShowRemainingTime(){return this.hasAttribute(U.DEFAULT_SHOW_REMAINING_TIME)}set defaultShowRemainingTime(i){i?this.setAttribute(U.DEFAULT_SHOW_REMAINING_TIME,""):this.removeAttribute(U.DEFAULT_SHOW_REMAINING_TIME)}get playbackRates(){if(this.hasAttribute(U.PLAYBACK_RATES))return this.getAttribute(U.PLAYBACK_RATES).trim().split(/\s*,?\s+/).map(i=>Number(i)).filter(i=>!Number.isNaN(i)).sort((i,e)=>i-e)}set playbackRates(i){if(!i){this.removeAttribute(U.PLAYBACK_RATES);return}this.setAttribute(U.PLAYBACK_RATES,i.join(" "))}get forwardSeekOffset(){var i;return(i=Yt(this.getAttribute(U.FORWARD_SEEK_OFFSET)))!=null?i:10}set forwardSeekOffset(i){this.setAttribute(U.FORWARD_SEEK_OFFSET,`${i}`)}get backwardSeekOffset(){var i;return(i=Yt(this.getAttribute(U.BACKWARD_SEEK_OFFSET)))!=null?i:10}set backwardSeekOffset(i){this.setAttribute(U.BACKWARD_SEEK_OFFSET,`${i}`)}get defaultHiddenCaptions(){return this.hasAttribute(U.DEFAULT_HIDDEN_CAPTIONS)}set defaultHiddenCaptions(i){i?this.setAttribute(U.DEFAULT_HIDDEN_CAPTIONS,""):this.removeAttribute(U.DEFAULT_HIDDEN_CAPTIONS)}get defaultDuration(){return Yt(this.getAttribute(U.DEFAULT_DURATION))}set defaultDuration(i){i==null?this.removeAttribute(U.DEFAULT_DURATION):this.setAttribute(U.DEFAULT_DURATION,`${i}`)}get playerInitTime(){return this.hasAttribute(C.PLAYER_INIT_TIME)?Yt(this.getAttribute(C.PLAYER_INIT_TIME)):De(this,Ld)}set playerInitTime(i){i!=this.playerInitTime&&(i==null?this.removeAttribute(C.PLAYER_INIT_TIME):this.setAttribute(C.PLAYER_INIT_TIME,`${+i}`))}get playerSoftwareName(){var i;return(i=this.getAttribute(C.PLAYER_SOFTWARE_NAME))!=null?i:kv}get playerSoftwareVersion(){var i;return(i=this.getAttribute(C.PLAYER_SOFTWARE_VERSION))!=null?i:Rv}get beaconCollectionDomain(){var i;return(i=this.getAttribute(C.BEACON_COLLECTION_DOMAIN))!=null?i:void 0}set beaconCollectionDomain(i){i!==this.beaconCollectionDomain&&(i?this.setAttribute(C.BEACON_COLLECTION_DOMAIN,i):this.removeAttribute(C.BEACON_COLLECTION_DOMAIN))}get maxResolution(){var i;return(i=this.getAttribute(C.MAX_RESOLUTION))!=null?i:void 0}set maxResolution(i){i!==this.maxResolution&&(i?this.setAttribute(C.MAX_RESOLUTION,i):this.removeAttribute(C.MAX_RESOLUTION))}get minResolution(){var i;return(i=this.getAttribute(C.MIN_RESOLUTION))!=null?i:void 0}set minResolution(i){i!==this.minResolution&&(i?this.setAttribute(C.MIN_RESOLUTION,i):this.removeAttribute(C.MIN_RESOLUTION))}get maxAutoResolution(){var i;return(i=this.getAttribute(C.MAX_AUTO_RESOLUTION))!=null?i:void 0}set maxAutoResolution(i){i==null?this.removeAttribute(C.MAX_AUTO_RESOLUTION):this.setAttribute(C.MAX_AUTO_RESOLUTION,i)}get renditionOrder(){var i;return(i=this.getAttribute(C.RENDITION_ORDER))!=null?i:void 0}set renditionOrder(i){i!==this.renditionOrder&&(i?this.setAttribute(C.RENDITION_ORDER,i):this.removeAttribute(C.RENDITION_ORDER))}get programStartTime(){return Yt(this.getAttribute(C.PROGRAM_START_TIME))}set programStartTime(i){i==null?this.removeAttribute(C.PROGRAM_START_TIME):this.setAttribute(C.PROGRAM_START_TIME,`${i}`)}get programEndTime(){return Yt(this.getAttribute(C.PROGRAM_END_TIME))}set programEndTime(i){i==null?this.removeAttribute(C.PROGRAM_END_TIME):this.setAttribute(C.PROGRAM_END_TIME,`${i}`)}get assetStartTime(){return Yt(this.getAttribute(C.ASSET_START_TIME))}set assetStartTime(i){i==null?this.removeAttribute(C.ASSET_START_TIME):this.setAttribute(C.ASSET_START_TIME,`${i}`)}get assetEndTime(){return Yt(this.getAttribute(C.ASSET_END_TIME))}set assetEndTime(i){i==null?this.removeAttribute(C.ASSET_END_TIME):this.setAttribute(C.ASSET_END_TIME,`${i}`)}get extraSourceParams(){return this.hasAttribute(U.EXTRA_SOURCE_PARAMS)?[...new URLSearchParams(this.getAttribute(U.EXTRA_SOURCE_PARAMS)).entries()].reduce((i,[e,t])=>(i[e]=t,i),{}):P2}set extraSourceParams(i){i==null?this.removeAttribute(U.EXTRA_SOURCE_PARAMS):this.setAttribute(U.EXTRA_SOURCE_PARAMS,new URLSearchParams(i).toString())}get customDomain(){var i;return(i=this.getAttribute(C.CUSTOM_DOMAIN))!=null?i:void 0}set customDomain(i){i!==this.customDomain&&(i?this.setAttribute(C.CUSTOM_DOMAIN,i):this.removeAttribute(C.CUSTOM_DOMAIN))}get envKey(){var i;return(i=nr(this,C.ENV_KEY))!=null?i:void 0}set envKey(i){this.setAttribute(C.ENV_KEY,`${i}`)}get noVolumePref(){return this.hasAttribute(U.NO_VOLUME_PREF)}set noVolumePref(i){i?this.setAttribute(U.NO_VOLUME_PREF,""):this.removeAttribute(U.NO_VOLUME_PREF)}get noMutedPref(){return this.hasAttribute(U.NO_MUTED_PREF)}set noMutedPref(i){i?this.setAttribute(U.NO_MUTED_PREF,""):this.removeAttribute(U.NO_MUTED_PREF)}get debug(){return nr(this,C.DEBUG)!=null}set debug(i){i?this.setAttribute(C.DEBUG,""):this.removeAttribute(C.DEBUG)}get disableTracking(){return nr(this,C.DISABLE_TRACKING)!=null}set disableTracking(i){this.toggleAttribute(C.DISABLE_TRACKING,!!i)}get disableCookies(){return nr(this,C.DISABLE_COOKIES)!=null}set disableCookies(i){i?this.setAttribute(C.DISABLE_COOKIES,""):this.removeAttribute(C.DISABLE_COOKIES)}get streamType(){var i,e,t;return(t=(e=this.getAttribute(C.STREAM_TYPE))!=null?e:(i=this.media)==null?void 0:i.streamType)!=null?t:ke.UNKNOWN}set streamType(i){this.setAttribute(C.STREAM_TYPE,`${i}`)}get defaultStreamType(){var i,e,t;return(t=(e=this.getAttribute(U.DEFAULT_STREAM_TYPE))!=null?e:(i=this.mediaController)==null?void 0:i.getAttribute(U.DEFAULT_STREAM_TYPE))!=null?t:ke.ON_DEMAND}set defaultStreamType(i){i?this.setAttribute(U.DEFAULT_STREAM_TYPE,i):this.removeAttribute(U.DEFAULT_STREAM_TYPE)}get targetLiveWindow(){var i,e;return this.hasAttribute(U.TARGET_LIVE_WINDOW)?+this.getAttribute(U.TARGET_LIVE_WINDOW):(e=(i=this.media)==null?void 0:i.targetLiveWindow)!=null?e:Number.NaN}set targetLiveWindow(i){i==this.targetLiveWindow||Number.isNaN(i)&&Number.isNaN(this.targetLiveWindow)||(i==null?this.removeAttribute(U.TARGET_LIVE_WINDOW):this.setAttribute(U.TARGET_LIVE_WINDOW,`${+i}`))}get liveEdgeStart(){var i;return(i=this.media)==null?void 0:i.liveEdgeStart}get startTime(){return Yt(nr(this,C.START_TIME))}set startTime(i){this.setAttribute(C.START_TIME,`${i}`)}get preferPlayback(){let i=this.getAttribute(C.PREFER_PLAYBACK);if(i===Zi.MSE||i===Zi.NATIVE)return i}set preferPlayback(i){i!==this.preferPlayback&&(i===Zi.MSE||i===Zi.NATIVE?this.setAttribute(C.PREFER_PLAYBACK,i):this.removeAttribute(C.PREFER_PLAYBACK))}get metadata(){var i;return(i=this.media)==null?void 0:i.metadata}set metadata(i){if(lt(this,Je,$s).call(this),!this.media){oi("underlying media element missing when trying to set metadata. metadata will not be set.");return}this.media.metadata={...Lv(this),...i}}get _hlsConfig(){var i;return(i=this.media)==null?void 0:i._hlsConfig}set _hlsConfig(i){if(lt(this,Je,$s).call(this),!this.media){oi("underlying media element missing when trying to set _hlsConfig. _hlsConfig will not be set.");return}this.media._hlsConfig=i}async addCuePoints(i){var e;if(lt(this,Je,$s).call(this),!this.media){oi("underlying media element missing when trying to addCuePoints. cuePoints will not be added.");return}return(e=this.media)==null?void 0:e.addCuePoints(i)}get activeCuePoint(){var i;return(i=this.media)==null?void 0:i.activeCuePoint}get cuePoints(){var i,e;return(e=(i=this.media)==null?void 0:i.cuePoints)!=null?e:[]}addChapters(i){var e;if(lt(this,Je,$s).call(this),!this.media){oi("underlying media element missing when trying to addChapters. chapters will not be added.");return}return(e=this.media)==null?void 0:e.addChapters(i)}get activeChapter(){var i;return(i=this.media)==null?void 0:i.activeChapter}get chapters(){var i,e;return(e=(i=this.media)==null?void 0:i.chapters)!=null?e:[]}getStartDate(){var i;return(i=this.media)==null?void 0:i.getStartDate()}get currentPdt(){var i;return(i=this.media)==null?void 0:i.currentPdt}get tokens(){let i=this.getAttribute(U.PLAYBACK_TOKEN),e=this.getAttribute(U.DRM_TOKEN),t=this.getAttribute(U.THUMBNAIL_TOKEN),s=this.getAttribute(U.STORYBOARD_TOKEN);return{...De(this,kd),...i!=null?{playback:i}:{},...e!=null?{drm:e}:{},...t!=null?{thumbnail:t}:{},...s!=null?{storyboard:s}:{}}}set tokens(i){is(this,kd,i??{})}get playbackToken(){var i;return(i=this.getAttribute(U.PLAYBACK_TOKEN))!=null?i:void 0}set playbackToken(i){this.setAttribute(U.PLAYBACK_TOKEN,`${i}`)}get drmToken(){var i;return(i=this.getAttribute(U.DRM_TOKEN))!=null?i:void 0}set drmToken(i){this.setAttribute(U.DRM_TOKEN,`${i}`)}get thumbnailToken(){var i;return(i=this.getAttribute(U.THUMBNAIL_TOKEN))!=null?i:void 0}set thumbnailToken(i){this.setAttribute(U.THUMBNAIL_TOKEN,`${i}`)}get storyboardToken(){var i;return(i=this.getAttribute(U.STORYBOARD_TOKEN))!=null?i:void 0}set storyboardToken(i){this.setAttribute(U.STORYBOARD_TOKEN,`${i}`)}addTextTrack(i,e,t,s){var r;let n=(r=this.media)==null?void 0:r.nativeEl;if(n)return ip(n,i,e,t,s)}removeTextTrack(i){var e;let t=(e=this.media)==null?void 0:e.nativeEl;if(t)return hM(t,i)}get textTracks(){var i;return(i=this.media)==null?void 0:i.textTracks}get castReceiver(){var i;return(i=this.getAttribute(U.CAST_RECEIVER))!=null?i:void 0}set castReceiver(i){i!==this.castReceiver&&(i?this.setAttribute(U.CAST_RECEIVER,i):this.removeAttribute(U.CAST_RECEIVER))}get castCustomData(){var i;return(i=this.media)==null?void 0:i.castCustomData}set castCustomData(i){if(!this.media){oi("underlying media element missing when trying to set castCustomData. castCustomData will not be set.");return}this.media.castCustomData=i}get noTooltips(){return this.hasAttribute(U.NO_TOOLTIPS)}set noTooltips(i){if(!i){this.removeAttribute(U.NO_TOOLTIPS);return}this.setAttribute(U.NO_TOOLTIPS,"")}get proudlyDisplayMuxBadge(){return this.hasAttribute(U.PROUDLY_DISPLAY_MUX_BADGE)}set proudlyDisplayMuxBadge(i){i?this.setAttribute(U.PROUDLY_DISPLAY_MUX_BADGE,""):this.removeAttribute(U.PROUDLY_DISPLAY_MUX_BADGE)}};Ld=new WeakMap,Rd=new WeakMap,kd=new WeakMap,mr=new WeakMap,Dd=new WeakMap,qn=new WeakMap,Je=new WeakSet,$s=function(){var i,e,t,s;if(!De(this,Rd)){is(this,Rd,!0),lt(this,Je,pr).call(this);try{if(customElements.upgrade(this.mediaTheme),!(this.mediaTheme instanceof zi.HTMLElement))throw""}catch{oi("<media-theme> failed to upgrade!")}try{customElements.upgrade(this.media)}catch{oi("underlying media element failed to upgrade!")}try{if(customElements.upgrade(this.mediaController),!(this.mediaController instanceof _E))throw""}catch{oi("<media-controller> failed to upgrade!")}lt(this,Je,Cv).call(this),lt(this,Je,wv).call(this),lt(this,Je,Mv).call(this),is(this,mr,(e=(i=this.mediaController)==null?void 0:i.hasAttribute(ae.USER_INACTIVE))!=null?e:!0),lt(this,Je,Pv).call(this),(t=this.media)==null||t.addEventListener("streamtypechange",()=>lt(this,Je,pr).call(this)),(s=this.media)==null||s.addEventListener("loadstart",()=>lt(this,Je,pr).call(this))}},x_=function(){var i,e;try{(i=window?.CSS)==null||i.registerProperty({name:"--media-primary-color",syntax:"<color>",inherits:!0}),(e=window?.CSS)==null||e.registerProperty({name:"--media-secondary-color",syntax:"<color>",inherits:!0})}catch{}},Qf=function(i){Object.assign(De(this,qn),i),lt(this,Je,pr).call(this)},pr=function(i={}){m2(g2(L2(this,{...De(this,qn),...i})),this.shadowRoot)},Cv=function(){let i=e=>{var t,s;if(!(e!=null&&e.startsWith("theme-")))return;let r=e.replace(/^theme-/,"");if(zf.includes(r))return;let n=this.getAttribute(e);n!=null?(t=this.mediaTheme)==null||t.setAttribute(r,n):(s=this.mediaTheme)==null||s.removeAttribute(r)};new MutationObserver(e=>{for(let{attributeName:t}of e)i(t)}).observe(this,{attributes:!0}),this.getAttributeNames().forEach(i)},wv=function(){let i=e=>{var t;let s=(t=this.media)==null?void 0:t.error;if(!(s instanceof Z)){let{message:n,code:a}=s??{};s=new Z(n,a)}if(!(s!=null&&s.fatal)){ps(s),s.data&&ps(`${s.name} data:`,s.data);return}let r=Sv(s);r.message&&T_(r),oi(s),s.data&&oi(`${s.name} data:`,s.data),lt(this,Je,Qf).call(this,{isDialogOpen:!0})};this.addEventListener("error",i),this.media&&(this.media.errorTranslator=(e={})=>{var t,s,r;if(!(((t=this.media)==null?void 0:t.error)instanceof Z))return e;let n=Sv((s=this.media)==null?void 0:s.error);return{player_error_code:(r=this.media)==null?void 0:r.error.code,player_error_message:n.message?String(n.message):e.player_error_message,player_error_context:n.context?String(n.context):e.player_error_context}})},Mv=function(){var i,e,t,s;let r=()=>lt(this,Je,pr).call(this);(e=(i=this.media)==null?void 0:i.textTracks)==null||e.addEventListener("addtrack",r),(s=(t=this.media)==null?void 0:t.textTracks)==null||s.addEventListener("removetrack",r)},Pv=function(){var i,e;if(!/Firefox/i.test(navigator.userAgent))return;let t,s=new WeakMap,r=()=>this.streamType===ke.LIVE&&!this.secondaryColor&&this.offsetWidth>=800,n=(l,d,u=!1)=>{r()||Array.from(l&&l.activeCues||[]).forEach(c=>{if(!(!c.snapToLines||c.line<-5||c.line>=0&&c.line<10))if(!d||this.paused){let h=c.text.split(`
3385
3385
  `).length,f=-3;this.streamType===ke.LIVE&&(f=-2);let m=f-h;if(c.line===m&&!u)return;s.has(c)||s.set(c,c.line),c.line=m}else setTimeout(()=>{c.line=s.get(c)||"auto"},500)})},a=()=>{var l,d;n(t,(d=(l=this.mediaController)==null?void 0:l.hasAttribute(ae.USER_INACTIVE))!=null?d:!1)},o=()=>{var l,d;let u=Array.from(((d=(l=this.mediaController)==null?void 0:l.media)==null?void 0:d.textTracks)||[]).filter(c=>["subtitles","captions"].includes(c.kind)&&c.mode==="showing")[0];u!==t&&t?.removeEventListener("cuechange",a),t=u,t?.addEventListener("cuechange",a),n(t,De(this,mr))};o(),(i=this.textTracks)==null||i.addEventListener("change",o),(e=this.textTracks)==null||e.addEventListener("addtrack",o),this.addEventListener("userinactivechange",()=>{var l,d;let u=(d=(l=this.mediaController)==null?void 0:l.hasAttribute(ae.USER_INACTIVE))!=null?d:!0;De(this,mr)!==u&&(is(this,mr,u),n(t,De(this,mr)))})};function nr(i,e){return i.media?i.media.getAttribute(e):i.getAttribute(e)}var Ov=O2,L_=class{addEventListener(){}removeEventListener(){}dispatchEvent(i){return!0}};if(typeof DocumentFragment>"u"){class i extends L_{}globalThis.DocumentFragment=i}var N2=class extends L_{},U2={get(i){},define(i,e,t){},getName(i){return null},upgrade(i){},whenDefined(i){return Promise.resolve(N2)}},$2={customElements:U2},F2=typeof window>"u"||typeof globalThis.customElements>"u",Jc=F2?$2:globalThis;Jc.customElements.get("mux-player")||(Jc.customElements.define("mux-player",Ov),Jc.MuxPlayerElement=Ov);var R_=parseInt(Ee.version)>=19,Nv={className:"class",classname:"class",htmlFor:"for",crossOrigin:"crossorigin",viewBox:"viewBox",playsInline:"playsinline",autoPlay:"autoplay",playbackRate:"playbackrate"},B2=i=>i==null,H2=(i,e)=>B2(e)?!1:i in e,G2=i=>i.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),K2=(i,e)=>{if(!(!R_&&typeof e=="boolean"&&!e)){if(H2(i,Nv))return Nv[i];if(typeof e<"u")return/[A-Z]/.test(i)?G2(i):i}},V2=(i,e)=>!R_&&typeof i=="boolean"?"":i,W2=(i={})=>{let{ref:e,...t}=i;return Object.entries(t).reduce((s,[r,n])=>{let a=K2(r,n);if(!a)return s;let o=V2(n);return s[a]=o,s},{})};function Uv(i,e){if(typeof i=="function")return i(e);i!=null&&(i.current=e)}function q2(...i){return e=>{let t=!1,s=i.map(r=>{let n=Uv(r,e);return!t&&typeof n=="function"&&(t=!0),n});if(t)return()=>{for(let r=0;r<s.length;r++){let n=s[r];typeof n=="function"?n():Uv(i[r],null)}}}}function Y2(...i){return Ce.useCallback(q2(...i),i)}var j2=Object.prototype.hasOwnProperty,z2=(i,e)=>{if(Object.is(i,e))return!0;if(typeof i!="object"||i===null||typeof e!="object"||e===null)return!1;if(Array.isArray(i))return!Array.isArray(e)||i.length!==e.length?!1:i.some((r,n)=>e[n]===r);let t=Object.keys(i),s=Object.keys(e);if(t.length!==s.length)return!1;for(let r=0;r<t.length;r++)if(!j2.call(e,t[r])||!Object.is(i[t[r]],e[t[r]]))return!1;return!0},k_=(i,e,t)=>!z2(e,i[t]),Q2=(i,e,t)=>{i[t]=e},X2=(i,e,t,s=Q2,r=k_)=>Ce.useEffect(()=>{let n=t?.current;n&&r(n,e,i)&&s(n,e,i)},[t?.current,e]),wi=X2,Z2=()=>{try{return"3.10.2"}catch{}return"UNKNOWN"},J2=Z2(),eN=()=>J2,We=(i,e,t)=>Ce.useEffect(()=>{let s=e?.current;if(!s||!t)return;let r=i,n=t;return s.addEventListener(r,n),()=>{s.removeEventListener(r,n)}},[e?.current,t,i]),tN=Ee.forwardRef(({children:i,...e},t)=>Ee.createElement("mux-player",{suppressHydrationWarning:!0,...W2(e),ref:t},i)),iN=(i,e)=>{let{onAbort:t,onCanPlay:s,onCanPlayThrough:r,onEmptied:n,onLoadStart:a,onLoadedData:o,onLoadedMetadata:l,onProgress:d,onDurationChange:u,onVolumeChange:c,onRateChange:h,onResize:f,onWaiting:m,onPlay:p,onPlaying:g,onTimeUpdate:v,onPause:b,onSeeking:E,onSeeked:T,onStalled:A,onSuspend:x,onEnded:S,onError:L,onCuePointChange:R,onChapterChange:I,metadata:M,tokens:F,paused:V,playbackId:q,playbackRates:H,currentTime:N,themeProps:Y,extraSourceParams:G,castCustomData:z,_hlsConfig:ie,...$}=e;return wi("tokens",F,i),wi("playbackId",q,i),wi("playbackRates",H,i),wi("metadata",M,i),wi("extraSourceParams",G,i),wi("_hlsConfig",ie,i),wi("themeProps",Y,i),wi("castCustomData",z,i),wi("paused",V,i,(B,ne)=>{ne!=null&&(ne?B.pause():B.play())},(B,ne,ge)=>B.hasAttribute("autoplay")&&!B.hasPlayed?!1:k_(B,ne,ge)),wi("currentTime",N,i,(B,ne)=>{ne!=null&&(B.currentTime=ne)}),We("abort",i,t),We("canplay",i,s),We("canplaythrough",i,r),We("emptied",i,n),We("loadstart",i,a),We("loadeddata",i,o),We("loadedmetadata",i,l),We("progress",i,d),We("durationchange",i,u),We("volumechange",i,c),We("ratechange",i,h),We("resize",i,f),We("waiting",i,m),We("play",i,p),We("playing",i,g),We("timeupdate",i,v),We("pause",i,b),We("seeking",i,E),We("seeked",i,T),We("stalled",i,A),We("suspend",i,x),We("ended",i,S),We("error",i,L),We("cuepointchange",i,R),We("chapterchange",i,I),[$]},sN=eN(),rN="mux-player-react",nN=Ee.forwardRef((i,e)=>{var t;let s=Ce.useRef(null),r=Y2(s,e),[n]=iN(s,i),[a]=Ce.useState((t=i.playerInitTime)!=null?t:ap());return Ee.createElement(tN,{ref:r,defaultHiddenCaptions:i.defaultHiddenCaptions,playerSoftwareName:rN,playerSoftwareVersion:sN,playerInitTime:a,...n})}),aN=nN;const oN=F_({time:H_(),expiresAt:B_()}).transform(i=>({time:Number(i.time),expiresAt:new Date(i.expiresAt)}));function D_(){const i=Kv(),t=P_().find(s=>s.formAction==="/video-player");if(t&&t.state!=="idle"){const s=t.json;if(s)return{...i.preferences?.player,...s}}return i.preferences?.player??null}function $v(i){const e=Ce.useRef(i);return Ce.useEffect(()=>{e.current=i},[i]),e}function lN({muxPlayerRef:i,...e}){const t=D_(),s=Hv(),[r,n]=Ce.useState(!1),a=`${e.playbackId}:currentTime`,[o,l]=Ce.useState(0),d=$v(s),u=$v(t);Ce.useEffect(()=>{if(typeof document>"u")return;const h=sessionStorage.getItem(a);if(h)try{const{time:f,expiresAt:m}=oN.parse(JSON.parse(h));if(m.getTime()<Date.now())throw new Error("Time expired");l(f)}catch{sessionStorage.removeItem(a)}},[a]);const c=$_(()=>{const h=i.current;if(!h)return;const f=Array.from(h.textTracks??[]).find(p=>p.kind==="subtitles"),m={playbackRate:h.playbackRate,volumeRate:h.volume,subtitle:f?{id:f.id,mode:f.mode}:{id:null,mode:"disabled"}};Xf(m,u.current)||d.current.submit(m,{method:"POST",action:"/video-player",encType:"application/json"})},300);return Ce.useEffect(()=>{if(!r)return;const h=i.current?.textTracks;if(!h)return;const f=setTimeout(()=>{const m=u.current?.subtitle;if(m?.id)try{const p=h.getTrackById(m.id);p&&(p.mode=m.mode??"hidden")}catch(p){console.warn("Failed to restore subtitle preferences:",p)}},100);return h.addEventListener("change",c),()=>{clearTimeout(f),h.removeEventListener("change",c)}},[r,i,u,c]),O.jsx("div",{className:"flex aspect-video flex-col",children:O.jsx(aN,{ref:i,playbackRates:[.5,.75,.8,.9,1,1.25,1.5,1.75,2,2.5,3,3.5,4],volume:t?.volumeRate??1,playbackRate:t?.playbackRate??1,thumbnailTime:o,onRateChange:c,onVolumeChange:c,streamType:"on-demand",defaultHiddenCaptions:!0,currentTime:o,onTimeUpdate:()=>sessionStorage.setItem(a,JSON.stringify({time:i.current?.currentTime,expiresAt:new Date(Date.now()+1e3*60*30).toISOString()})),accentColor:"#427cf0",targetLiveWindow:NaN,minResolution:dN(t?.minResolution),maxResolution:uN(t?.maxResolution),onLoadedMetadata:()=>n(!0),...e})})}function Xf(i,e){if(i===e)return!0;if(typeof i!=typeof e||typeof i!="object"||typeof e!="object"||i===null||e===null||Array.isArray(i)!==Array.isArray(e))return!1;if(Array.isArray(i)&&Array.isArray(e)){if(i.length!==e.length)return!1;for(let r=0;r<i.length;r++)if(!Xf(i[r],e[r]))return!1;return!0}const t=Object.keys(i),s=Object.keys(e);if(t.length!==s.length)return!1;for(const r of t)if(!Xf(i[r],e[r]))return!1;return!0}function dN(i){if(i)return i<=480?Xr.noLessThan480p:i<=540?Xr.noLessThan540p:i<=720?Xr.noLessThan720p:i<=1080?Xr.noLessThan1080p:i<=1440?Xr.noLessThan1440p:Xr.noLessThan2160p}function uN(i){if(i)return i<=720?ol.upTo720p:i<=1080?ol.upTo1080p:i<=1440?ol.upTo1440p:ol.upTo2160p}function cN({progress:i,size:e=16,strokeWidth:t=2,className:s}){const r=i===void 0,n=(e-t)/2,a=2*Math.PI*n,o=e/2,l=i!==void 0?Math.min(100,Math.max(0,i)):0,d=a-l/100*a;return O.jsxs("svg",{width:e,height:e,viewBox:`0 0 ${e} ${e}`,className:eh(r&&"animate-spin","text-current",s),role:"progressbar","aria-valuenow":r?void 0:l,"aria-valuemin":0,"aria-valuemax":100,"aria-label":r?"Downloading...":`Download progress: ${l}%`,children:[O.jsx("circle",{cx:o,cy:o,r:n,fill:"none",stroke:"currentColor",strokeWidth:t,opacity:.25}),O.jsx("circle",{cx:o,cy:o,r:n,fill:"none",stroke:"currentColor",strokeWidth:t,strokeLinecap:"round",strokeDasharray:a,strokeDashoffset:r?a*.75:d,transform:`rotate(-90 ${o} ${o})`,className:eh(!r&&"transition-[stroke-dashoffset] duration-300 ease-out")})]})}function hN(i){return O.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",...i,children:O.jsx("path",{fill:"currentColor",d:"M10 2a1 1 0 0 1 1 1v7.59l2.3-2.3a1 1 0 1 1 1.4 1.42l-4 4a1 1 0 0 1-1.4 0l-4-4a1 1 0 1 1 1.4-1.42l2.3 2.3V3a1 1 0 0 1 1-1Zm-6 12a1 1 0 0 1 1 1v1h10v-1a1 1 0 1 1 2 0v2a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1v-2a1 1 0 0 1 1-1Z"})})}function fN(i){return O.jsxs("svg",{viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",...i,children:[O.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M6.75 7.75L7.59115 17.4233C7.68102 18.4568 8.54622 19.25 9.58363 19.25H14.4164C15.4538 19.25 16.319 18.4568 16.4088 17.4233L17.25 7.75"}),O.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M9.75 7.5V6.75C9.75 5.64543 10.6454 4.75 11.75 4.75H12.25C13.3546 4.75 14.25 5.64543 14.25 6.75V7.5"}),O.jsx("path",{stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M5 7.75H19"})]})}function mN({isAvailable:i,isBusy:e=!1,downloadSizeBytes:t,downloadProgress:s,onDownload:r,onDelete:n}){const a=e&&!i,o=a,l=typeof t=="number"&&t>0?` (${K_(t)})`:"",d=i?"Delete offline video":a?s!==void 0?`Downloading: ${Math.round(s)}%`:"Downloading...":`Download offline video${l}`,u=i?n:r,c=i?"text-foreground-destructive hover:bg-foreground-destructive/10":"text-foreground hover:bg-muted";return O.jsx(G_,{content:d,children:O.jsx("button",{type:"button",onClick:u,disabled:e,className:`${c} inline-flex h-7 w-7 items-center justify-center rounded disabled:cursor-not-allowed disabled:opacity-50`,"aria-label":d,children:o?O.jsx(cN,{progress:s,size:16,strokeWidth:2,className:"h-4 w-4"}):i?O.jsx(fN,{className:"h-4 w-4"}):O.jsx(hN,{className:"h-4 w-4"})})})}const C_=Ce.createContext(null),Fv={best:"best available",high:"high",medium:"medium",low:"low"};function pN(i){return i==="high"||i==="medium"||i==="low"?Fv[i]:Fv.best}function gN(i){return i==="high"||i==="medium"||i==="low"?i:"best"}function vN(){return O.jsx("div",{className:"relative aspect-video w-full shrink-0 shadow-lg",children:O.jsx("div",{className:"text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center p-8",children:O.jsx(Zf,{name:"WifiNoConnection",size:"xl",children:O.jsxs("span",{children:["Offline video not available. Download offline videos in"," ",O.jsx(Ln,{to:"/preferences",className:"underline",children:"Preferences"}),"."]})})})})}function u3({children:i,epicVideoInfosPromise:e}){return O.jsx(C_.Provider,{value:e,children:i})}function w_(i){let e=new URL("https://epicweb.dev");try{e=new URL(i)}catch(c){return console.error(c),"Epic Video"}const t=e.pathname.split("/").filter(Boolean),s=t.includes("solution");let r=t.pop();const n=["problem","solution","embed","exercise"],a=c=>c&&!n.includes(c);for(;!a(r);)r=t.pop();if(!r)return"Epic Video";r=r.replace(/~[^ ]*$/,"");const o=r.split("-"),l=["the","a","an","and","but","or","for","nor","on","at","to","from","by","of","in","with","as","npm","git","ssh","cli"],d=["OAuth","UI","UX","API","CSS","HTML","JS","TS","SVG","AI","CSRF","CORS","HTTP","HTTPS","URL","URI","DB","SQL","JSON","YAML","YML","useActionData","useAsyncError","useAsyncValue","useBeforeUnload","useFetcher","useFetchers","useFormAction","useHref","useLoaderData","useLocation","useMatches","useNavigate","useNavigation","useNavigationType","useOutlet","useOutletContext","useParams","useResolvedPath","useRevalidator","useRouteError","useRouteLoaderData","useSearchParams","useSubmit","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useReducer","useRef","useState","useSyncExternalStore","useTransition","useForm","useFieldset","useFieldList","useEventSource","useHydrated","useAuthenticityToken","useShouldHydrate","useGlobalNavigationState","useLocales","useDelegatedAnchors","useDebounceFetcher","useFetcherType"],u=o.filter(Boolean).map((c,h)=>{const f=c.toLowerCase(),m=d.find(p=>p.toLowerCase()===f);return m||(l.includes(f)&&h>0?f:f[0]?.toUpperCase()+f.slice(1))}).join(" ");return s?`${u} (🏁 solution)`:u}function EN({url:i,title:e="Video Embed",loadingContent:t=O.jsx(Jf,{children:O.jsxs("span",{children:['Loading "',e,'"']})})}){const s=Gv(),[r,n]=Ce.useState(!1);return Vv()?O.jsxs("div",{className:"relative aspect-video w-full shrink-0 shadow-lg",children:[r?null:O.jsx("div",{className:"absolute inset-0 z-10 flex items-center justify-center p-8",children:t}),O.jsx("iframe",{onLoad:()=>n(!0),onError:()=>n(!0),src:i,className:eh("absolute inset-0 flex h-full w-full transition-opacity duration-300",r?"opacity-100":"opacity-0"),title:e,sandbox:"allow-forms allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox",allowFullScreen:!0,style:{colorScheme:s}})]}):O.jsx("div",{className:"not-prose relative aspect-video w-full shrink-0 shadow-lg",children:O.jsx("div",{className:"text-foreground-destructive absolute inset-0 z-10 flex items-center justify-center p-8",children:O.jsx(Zf,{name:"WifiNoConnection",size:"xl",children:O.jsxs("span",{children:["Unable to load the video ",O.jsx("a",{href:i,className:"underline",children:`"${e??i}"`})," when offline"]})})})})}function M_({url:i,title:e,duration:t,durationEstimate:s,actions:r}){return O.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-base",children:[r?O.jsx("span",{className:"flex items-center gap-1",children:r}):null,t?O.jsx("span",{className:"opacity-70",children:Bv(t)}):s?O.jsxs("span",{className:"opacity-70",children:["~",Bv(s)]}):null,O.jsxs("a",{href:i,target:"_blank",className:"flex items-center gap-1 no-underline opacity-70 transition hover:underline hover:opacity-100",rel:"noreferrer",children:[O.jsx(Zf,{className:"shrink-0",name:"Video",size:"lg"}),e," ",O.jsx("span",{"aria-hidden":!0,children:"↗︎"})]})]})}function c3({url:i,title:e}){const t=e??w_(i),{product:{host:s,displayName:r}}=W_(),n=V_(),a=Ce.useContext(C_),o=O.jsx(M_,{url:i,title:t});return O.jsx("div",{className:"not-prose",children:O.jsx(Ce.Suspense,{fallback:O.jsxs("div",{children:[O.jsx("div",{className:"flex aspect-video w-full items-center justify-center",children:O.jsx(Jf,{children:t})}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,O.jsx("div",{className:"h-[32px]"})]})]}),children:O.jsx(O_,{errorElement:O.jsx("div",{children:"Sorry, failed loading videos. Check the terminal output?"}),resolve:a,children:l=>{const d=l?.[i],u=ENV.EPICSHOP_DEPLOYED?O.jsxs("div",{children:[O.jsx(Ln,{to:ENV.EPICSHOP_GITHUB_REPO,className:"underline",children:"Run locally"})," for transcripts"]}):O.jsxs("div",{children:[O.jsx(Ln,{to:"/login",className:"underline",children:n?"Upgrade":"Login"})," for transcripts"]});if(!d)return O.jsxs("div",{children:[O.jsx(Ea,{url:i,title:t}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,u]})]});const c=d;return c.status==="success"?O.jsx(yN,{url:i,title:e??c.title??t,muxPlaybackId:c.muxPlaybackId,transcript:c.transcript,duration:c.duration,durationEstimate:c.durationEstimate,downloadsAvailable:c.downloadsAvailable??!1,downloadSizes:c.downloadSizes??[]}):c.type==="region-restricted"?O.jsxs("div",{children:[O.jsxs("div",{className:"flex aspect-video min-h-full min-w-full flex-col items-center justify-start gap-2 overflow-y-scroll border-2 p-4 lg:justify-center lg:gap-4 lg:text-xl",children:[O.jsx("div",{className:"text-foreground-destructive",children:"Error: Region Restricted"}),O.jsxs("div",{children:["We've detected you're connecting from"," ",c.requestCountry," but your license has restricted access to ",c.restrictedCountry]}),O.jsxs("div",{children:["To continue watching uninterrupted, please"," ",O.jsxs("a",{href:`https://${s}/products`,className:"underline",children:["upgrade your ",r," license"]})," ","to a full Pro license."]})]}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,O.jsxs("div",{children:[O.jsx(Ln,{to:`https://${s}/products`,className:"underline",children:"Upgrade"})," for transcripts"]})]})]}):c.statusCode===401?O.jsxs("div",{children:[O.jsx(Ea,{url:i,title:t}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,u]})]}):c.statusCode===403?O.jsxs("div",{children:[O.jsx(Ea,{url:i,title:t}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,O.jsxs("div",{children:[O.jsx(Ln,{to:`https://${s}/products`,className:"underline",children:"Upgrade"})," for transcripts"]})]})]}):c.statusCode===404?O.jsxs("div",{children:[O.jsx(Ea,{url:i,title:t}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,O.jsx("div",{children:"Transcripts not found"})]})]}):(console.error(c),O.jsxs("div",{children:[O.jsx(Ea,{url:i,title:t}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[o,O.jsx("div",{className:"text-foreground-destructive",children:"Unknown error (check console)"})]})]}))}})})})}function yN({url:i,title:e=w_(i),muxPlaybackId:t,transcript:s,duration:r,durationEstimate:n,downloadsAvailable:a,downloadSizes:o}){const l=Ce.useRef(null),d=Ce.useRef(null),u=Vv(),c=D_(),h=Kv(),f=pN(h.preferences?.offlineVideo?.downloadResolution),m=gN(h.preferences?.offlineVideo?.downloadResolution),g=h.offlineVideoPlaybackIds?.includes(t)??!1,v=`/resources/offline-videos/${encodeURIComponent(t)}`,b=g,E=N_(),T=Hv(),A=T.state!=="idle",[x,S]=Ce.useState(void 0),L=A&&!g,R=U_(`/resources/offline-video-progress/${encodeURIComponent(t)}`,{enabled:L});Ce.useEffect(()=>{if(R)try{const j=JSON.parse(R);if(j.status==="complete"){S(void 0),E.revalidate();return}if(j.status==="error"){S(void 0);return}if(j.totalBytes&&j.totalBytes>0){const fe=j.bytesDownloaded/j.totalBytes*100;S(fe)}else S(void 0)}catch{}},[R,E]),Ce.useEffect(()=>{L||S(void 0)},[L]);const I=`${t}:currentTime`,[M,F]=Ce.useState(null),V=/(\d+:\d+)/g,q=[];let H,N=0;for(;H=V.exec(s);){const j=H[1];if(!V.lastIndex||!j||H.index==null)break;const fe=H.index,Pe=V.lastIndex;let qe=s.slice(N,fe);qe.endsWith("[")&&(qe=qe.slice(0,-1)),qe&&q.push(O.jsx("span",{children:qe},`span-${fe}`)),q.push(O.jsx("button",{className:"underline",onClick:wt=>{const Rt=d.current??l.current;if(Rt){Rt.currentTime=bN(j);try{Rt.play().catch(()=>{})}catch{}Rt.scrollIntoView({behavior:"smooth",inline:"center",block:"start"}),wt.currentTarget.blur()}},children:j},`button-${fe}`)),N=Pe,s.charAt(N)==="]"&&(N+=1)}const Y=s.slice(N);Y&&q.push(O.jsx("span",{children:Y},s.length)),Ce.useEffect(()=>{d.current&&(typeof c?.playbackRate=="number"&&(d.current.playbackRate=c.playbackRate),typeof c?.volumeRate=="number"&&(d.current.volume=c.volumeRate))},[c?.playbackRate,c?.volumeRate,b]),Ce.useEffect(()=>{if(!b||typeof document>"u")return;const j=sessionStorage.getItem(I);if(!j){F(null);return}try{const fe=JSON.parse(j),Pe=fe.expiresAt?new Date(fe.expiresAt).getTime():0;if(typeof fe.time!="number"||Number.isNaN(fe.time)||!Pe||Pe<Date.now())throw new Error("Time expired");F(fe.time)}catch{sessionStorage.removeItem(I),F(null)}},[I,b]),Ce.useEffect(()=>{if(!b)return;const j=d.current;if(!j||M==null)return;const fe=()=>{const Pe=Number.isFinite(j.duration)?j.duration:0,qe=Pe?Math.min(M,Math.max(Pe-1,0)):M;qe>0&&(j.currentTime=qe)};if(j.readyState>=1){fe();return}return j.addEventListener("loadedmetadata",fe),()=>{j.removeEventListener("loadedmetadata",fe)}},[M,b]);const G=Ce.useCallback(()=>{if(typeof document>"u")return;const j=d.current;if(!j)return;const fe=Number.isFinite(j.duration)?j.duration:0;if(fe&&fe-j.currentTime<=1){sessionStorage.removeItem(I);return}sessionStorage.setItem(I,JSON.stringify({time:j.currentTime,expiresAt:new Date(Date.now()+1e3*60*30).toISOString()}))},[I]);Ce.useEffect(()=>{if(T.state!=="idle")return;const j=T.data;if(j){if(j.action==="delete"&&j.status==="success")E.revalidate();else if(j.action==="download"&&j.status==="error"){const fe=j.message??"Offline video download failed. Check the terminal logs.";$p.error("Offline video download failed",{description:fe})}}},[T.state,T.data,E]);const z=Ce.useCallback(()=>{$p.success(`Download of ${e} has started (${f} quality).`,{description:O.jsxs("span",{children:["Go to"," ",O.jsx(Ln,{className:"underline",to:"/preferences",children:"Preferences"})," ","to download all workshop videos at once."]})}),T.submit({intent:"download-video",playbackId:t,title:e,url:i},{method:"post",action:"/resources/offline-videos"})},[t,T,e,i,f]),ie=Ce.useCallback(()=>{T.submit({intent:"delete-video",playbackId:t},{method:"post",action:"/resources/offline-videos"})},[t,T]),$=Ce.useCallback(j=>{j&&j.setAttribute("seekoffset","10")},[]),B=!!(a||o.length>0),ne=q_(o,m),ce=g||B?O.jsx(mN,{isAvailable:g,isBusy:A,downloadProgress:x,downloadSizeBytes:ne,onDownload:z,onDelete:ie}):null;return O.jsxs("div",{children:[O.jsx("div",{className:"shadow-lg",children:b?O.jsx("div",{className:"flex aspect-video w-full items-center justify-center bg-black",children:O.jsxs(bI,{tabIndex:0,"aria-label":`${e} video player`,onPointerDown:j=>{j.currentTarget.focus()},className:"focus-visible:ring-ring flex h-full w-full flex-col justify-end outline-none focus-visible:ring-2 focus-visible:ring-offset-2",style:{"--media-primary-color":"hsl(var(--background))","--media-text-color":"hsl(var(--background))","--media-secondary-color":"transparent","--media-control-background":"transparent","--media-control-hover-background":"hsl(var(--background) / 0.18)","--media-control-height":"18px","--media-range-padding":"2px","--media-time-range-hover-height":"18px","--media-time-range-hover-bottom":"-4px","--media-range-track-height":"3px","--media-range-thumb-height":"8px","--media-range-thumb-width":"8px","--media-range-track-background":"hsl(var(--background) / 0.35)","--media-range-track-pointer-background":"hsl(var(--background) / 0.85)"},children:[O.jsx("video",{ref:d,slot:"media","aria-label":e,className:"h-full w-full",playsInline:!0,preload:"metadata",src:v,onTimeUpdate:G}),O.jsxs("div",{className:"bg-foreground/40 text-background w-full space-y-1 px-3 pt-1 pb-1.5 text-sm leading-none backdrop-blur select-none",children:[O.jsx(DI,{className:"w-full"}),O.jsxs(TI,{className:"w-full items-center gap-3",children:[O.jsxs("div",{className:"flex items-center gap-3",children:[O.jsx(xI,{}),O.jsx(LI,{ref:$,seekOffset:10}),O.jsx(RI,{ref:$,seekOffset:10}),O.jsx(kI,{showDuration:!0,className:"text-background text-xs tabular-nums"}),O.jsx(AI,{}),O.jsx(CI,{className:"w-24"})]}),O.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[O.jsx(II,{className:"text-background text-xs",rates:[.5,.75,.8,.9,1,1.25,1.5,1.75,2,2.5,3,3.5,4]}),O.jsx(SI,{}),O.jsx(_I,{})]})]})]})]})}):u?O.jsx(lN,{playbackId:t,muxPlayerRef:l,title:e}):O.jsx(vN,{})}),O.jsxs("div",{className:"mt-4 flex flex-col gap-2",children:[O.jsx(M_,{url:i,title:e,duration:r,durationEstimate:n,actions:ce}),O.jsxs("details",{children:[O.jsx("summary",{children:"Transcript"}),O.jsx("div",{className:"bg-accent text-accent-foreground rounded-md p-2 whitespace-pre-line",children:q})]})]})]})}function bN(i){const e=i.split(":");let t=0,s=1;for(;e.length>0;)t+=s*parseInt(e.pop()??"0",10),s*=60;return t}function Bv(i){const e=Math.max(0,Math.round(i)),t=Math.floor(e/3600),s=Math.floor(e%3600/60),r=e%60;return t>0?`${t}:${s.toString().padStart(2,"0")}:${r.toString().padStart(2,"0")}`:`${s}:${r.toString().padStart(2,"0")}`}function Ea({url:i,title:e}){const t=Gv();let s=new URL("https://epicweb.dev");try{s=new URL(i)}catch(r){return console.error(r),O.jsxs("div",{children:['Invalid URL: "',i,'"']})}return s.pathname=s.pathname.endsWith("/")?`${s.pathname}embed`:`${s.pathname}/embed`,s.searchParams.set("theme",t),s.host==="www.epicai.pro"&&!s.pathname.startsWith("/workshops/")&&(s.pathname=`/posts/${s.pathname}`),O.jsx(EN,{url:s.toString(),title:e,loadingContent:O.jsx(Jf,{children:O.jsxs("span",{children:['Loading "',O.jsx("a",{className:"underline",href:i,children:e}),'"']})})})}export{c3 as D,u3 as E,EN as V};
3386
- //# sourceMappingURL=epic-video-BJW6MU1i.js.map
3386
+ //# sourceMappingURL=epic-video-D4jBdSKs.js.map