PageSourceSearch

https://python-podcast.de/static/cast/vite/customPlayer-DbnfRrCD.bceec42baa93.js

js python-podcast.de collected 2026-10-03 22:41:16 UTC 33,357 bytes, 1 lines download raw bytes

1import{t as e}from"./defineProperty-BbfpZ9Tg.js";function t(e){return!!e&&Array.isArray(e.cues)}function n(e){return!!e&&typeof e.url==`string`}function r(e,t,n,r,i,a,o){try{var s=e[a](o),c=s.value}catch(e){n(e);return}s.done?t(c):Promise.resolve(c).then(r,i)}function i(e){return function(){var t=this,n=arguments;return new Promise(function(i,a){var o=e.apply(t,n);function s(e){r(o,i,a,s,c,`next`,e)}function c(e){r(o,i,a,s,c,`throw`,e)}s(void 0)})}}var a=.01;function o(e){return typeof e==`number`&&Number.isFinite(e)}var s=class extends EventTarget{constructor(r,i){super(),e(this,`audio`,void 0),e(this,`payload`,void 0),e(this,`cues`,void 0),e(this,`chapters`,void 0),e(this,`cueIndex`,-1),e(this,`chapterIndex`,-1),e(this,`frameScheduled`,!1),e(this,`destroyed`,!1),e(this,`transcriptUrl`,void 0),e(this,`loading`,!1),e(this,`loaded`,void 0),e(this,`boundListeners`,void 0),this.audio=r,this.payload=i,this.cues=t(i.transcript)?i.transcript.cues.slice():[],this.chapters=i.chapters.slice(),this.transcriptUrl=n(i.transcript)?i.transcript.url:void 0,this.loaded=t(i.transcript),this.boundListeners=[[`play`,()=>this.dispatch(`play`)],[`pause`,()=>this.dispatch(`pause`)],[`timeupdate`,()=>this.scheduleFrame()],[`durationchange`,()=>this.onDurationChange()],[`seeking`,()=>this.dispatch(`seeking`,{currentTime:this.currentTime})],[`seeked`,()=>this.onSeeked()],[`ended`,()=>this.onEnded()],[`error`,()=>this.onError()]];for(let[e,t]of this.boundListeners)this.audio.addEventListener(e,t);this.refreshIndices(!1)}get currentTime(){return this.audio.currentTime||0}get duration(){return o(this.payload.duration)?this.payload.duration:o(this.audio.duration)?this.audio.duration:null}get paused(){return this.audio.paused}get currentChapterIndex(){return this.chapterIndex}get currentCueIndex(){return this.cueIndex}getCues(){return this.cues}getChapters(){return this.chapters}get hasTranscript(){return this.payload.transcript!=null}get transcriptLoading(){return this.loading}get transcriptLoaded(){return this.loaded}play(){var e=this;return i(function*(){try{yield e.audio.play()}catch(t){(t==null?void 0:t.name)!==`AbortError`&&e.dispatch(`error`,{error:t})}})()}pause(){this.audio.pause()}toggle(){this.audio.paused?this.play():this.pause()}seek(e){let t=Math.max(0,e),n=this.duration,r=o(n)?Math.min(t,n):t;this.audio.currentTime=r,this.dispatch(`seeking`,{currentTime:r}),this.refreshIndices(!0),this.emitTimeUpdate(),this.dispatch(`seeked`,{currentTime:r})}seekToCue(e){let t=this.cues[e];t&&(this.seek(t.start+a),this.dispatch(`navseek`,{currentTime:this.currentTime}))}seekToChapter(e){let t=this.chapters[e];t&&(this.seek(t.start),this.dispatch(`navseek`,{currentTime:this.currentTime}))}requestTranscript(){this.loaded||this.loading||!this.transcriptUrl||(this.loading=!0,this.dispatch(`transcriptrequested`,{url:this.transcriptUrl}))}transcriptFailed(){this.loading&&(this.loading=!1,this.dispatch(`transcripterror`,{}))}setCues(e){this.cues=e.slice(),this.loaded=!0,this.loading=!1;let t=this.cueIndex;this.cueIndex=this.computeCueIndex(this.currentTime),this.dispatch(`cueschange`,{count:this.cues.length}),this.cueIndex!==t&&this.dispatch(`cuechange`,{index:this.cueIndex})}destroy(){if(!this.destroyed){this.destroyed=!0;for(let[e,t]of this.boundListeners)this.audio.removeEventListener(e,t);try{this.audio.pause()}catch(e){}this.cues=[],this.cueIndex=-1,this.chapterIndex=-1}}scheduleFrame(){this.frameScheduled||this.destroyed||(this.frameScheduled=!0,(typeof requestAnimationFrame==`function`?requestAnimationFrame:e=>setTimeout(()=>e(0),16))(()=>{this.frameScheduled=!1,!this.destroyed&&(this.emitTimeUpdate(),this.refreshIndices(!0))}))}emitTimeUpdate(){this.dispatch(`timeupdate`,{currentTime:this.currentTime,duration:this.duration})}onDurationChange(){this.dispatch(`durationchange`,{duration:this.duration}),this.refreshIndices(!0)}onSeeked(){this.refreshIndices(!0),this.dispatch(`seeked`,{currentTime:this.currentTime})}onEnded(){let e=this.cues.length?this.cues.length-1:-1,t=this.chapters.length?this.chapters.length-1:-1;this.applyIndices(e,t,!0),this.dispatch(`pause`)}onError(){this.dispatch(`error`,{error:this.audio.error})}refreshIndices(e){let t=this.currentTime;this.applyIndices(this.computeCueIndex(t),this.computeChapterIndex(t),e)}applyIndices(e,t,n){e!==this.cueIndex&&(this.cueIndex=e,n&&this.dispatch(`cuechange`,{index:this.cueIndex})),t!==this.chapterIndex&&(this.chapterIndex=t,n&&this.dispatch(`chapterchange`,{index:this.chapterIndex}))}computeCueIndex(e){if(this.cues.length===0)return-1;let t=this.duration;if(o(t)&&e>=t)return this.cues.length-1;let n=-1;for(let t=0;t<this.cues.length;t++){let r=this.cues[t];r.start<=e&&e<r.end&&(n=t)}return n}computeChapterIndex(e){if(this.chapters.length===0)return-1;let t=this.duration;if(o(t)&&e>=t)return this.chapters.length-1;if(e<this.chapters[0].start)return-1;let n=-1;for(let t=0;t<this.chapters.length&&this.chapters[t].start<=e;t++)n=t;return n}dispatch(e,t={}){this.dispatchEvent(new CustomEvent(e,{detail:t}))}};function c(e){let t=e;(!Number.isFinite(t)||t<0)&&(t=0);let n=Math.floor(t),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=String(a).padStart(2,`0`);return r>0?`${r}:${String(i).padStart(2,`0`)}:${o}`:`${i}:${o}`}function l(e){let t=e;(!Number.isFinite(t)||t<0)&&(t=0);let n=Math.floor(t),r=Math.floor(n/3600),i=Math.floor(n%3600/60),a=n%60,o=[];return r>0&&o.push(`${r} hour${r===1?``:`s`}`),i>0&&o.push(`${i} minute${i===1?``:`s`}`),o.push(`${a} second${a===1?``:`s`}`),o.join(` `)}
1var u=`cast:player-ready`,d=new Map;function f(e,t){let n=d.get(e);n&&n!==t&&(console.warn(`cast-audio-player: duplicate id "${e}" — replacing previous controller`),n.destroy()),d.set(e,t),document.dispatchEvent(new CustomEvent(u,{detail:{playerId:e}}))}function p(e,t){d.get(e)===t&&d.delete(e)}function m(e,t){let n=d.get(e);if(n)return t(n),()=>{};let r=n=>{let i=n.detail;if((i==null?void 0:i.playerId)===e){document.removeEventListener(u,r);let n=d.get(e);n&&t(n)}};return document.addEventListener(u,r),()=>document.removeEventListener(u,r)}var h=250,g=5,_=`<svg viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true"><path d="M8 5v14l11-7z"/></svg>`,v=`<svg viewBox="0 0 24 24" width="22" height="22" fill="currentColor" aria-hidden="true"><path d="M6 5h4v14H6zM14 5h4v14h-4z"/></svg>`,y=`<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="18" cy="5" r="3"/><circle cx="6" cy="12" r="3"/><circle cx="18" cy="19" r="3"/><path d="M8.6 13.5l6.8 4M15.4 6.5l-6.8 4"/></svg>`,b=`<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10"/></svg>`,x=[[`Space / K`,`play / pause`],[`← / →`,`skip 5 seconds`],[`Home / End`,`start / end`]];function S(e){let t=Math.max(0,Math.floor(e)),n=Math.floor(t/60),r=t%60;return`${n}:${String(r).padStart(2,`0`)}`}function C(e){let t=/^(\d{1,3}):([0-5]\d)$/.exec(e.trim());return t?Number(t[1])*60+Number(t[2]):null}function w(e,t,n){let r=document.createElement(e);if(t&&(r.className=t),n)for(let[e,t]of Object.entries(n))r.setAttribute(e,t);return r}var T=new Set,E=null,D=!1;function O(e){var t;if(e instanceof Element){let t=e.closest(`cast-audio-player`);if(t instanceof j&&T.has(t))return t}return E&&T.has(E)?E:T.size===1?(t=T.values().next().value)==null?null:t:null}function k(e){var t;if(e.altKey||e.ctrlKey||e.metaKey||e.shiftKey)return;let n=e.target;n&&n.closest(`input, button, select, textarea, a[href], [contenteditable]`)||(t=O(n))==null||t.handleShortcut(e)}function A(){D||(document.addEventListener(`keydown`,k),D=!0)}var j=class extends HTMLElement{constructor(...t){super(...t),e(this,`controller`,void 0),e(this,`playerId`,``),e(this,`disabled`,!1),e(this,`audioEl`,void 0),e(this,`playButton`,void 0),e(this,`range`,void 0),e(this,`output`,void 0),e(this,`remaining`,void 0),e(this,`statusRegion`,void 0),e(this,`controllerListeners`,[]),e(this,`audioListeners`,[]),e(this,`lastPublicEmit`,-1/0),e(this,`publicTimer`,null),e(this,`shareDialog`,void 0),e(this,`shareTimeInput`,void 0),e(this,`shareBuildUrl`,void 0),e(this,`fetchingTranscript`,!1)}connectedCallback(){if(this.controller)return;let e=this.readPayload();if(!e)return;this.playerId=this.id,this.disabled=e.sources.length===0;let t=w(`audio`);t.preload=`none`;for(let n of e.sources){let e=w(`source`);e.type=n.type,e.src=n.src,t.appendChild(e)}this.audioEl=t,this.appendChild(t),this.controller=new s(t,e);let n=(e=>{var t;let n=(t=e.detail)==null?void 0:t.url;n&&this.hydrateFromUrl(n)});this.controller.addEventListener(`transcriptrequested`,n),this.controllerListeners.push([`transcriptrequested`,n]),f(this.playerId,this.controller),this.renderTransport(e),this.subscribe(),this.disabled||(this.tabIndex=0,this.setAttribute(`role`,`group`),this.setAttribute(`aria-label`,`Audio player`),this.setAttribute(`aria-keyshortcuts`,`Space K ArrowLeft ArrowRight Home End`),T.add(this),A(),this.applyStartAt())}disconnectedCallback(){for(let[t,n]of this.controllerListeners){var e;(e=this.controller)==null||e.removeEventListener(t,n)}this.controllerListeners=[];for(let[e,n]of this.audioListeners){var t;(t=this.audioEl)==null||t.removeEventListener(e,n)}this.audioListeners=[],T.delete(this),E===this&&(E=null),this.publicTimer!==null&&(clearTimeout(this.publicTimer),this.publicTimer=null),this.controller&&(p(this.playerId,this.controller),this.controller.destroy(),this.controller=void 0)}get currentTime(){var e,t;return(e=(t=this.controller)==null?void 0:t.currentTime)==null?0:e}get duration(){var e,t;return(e=(t=this.controller)==null?void 0:t.duration)==null?null:e}shareEnabled(){return this.getAttribute(`data-share`)!==`none`}getShareState(){var e,t;return{currentTime:this.currentTime,duration:this.duration,audioId:(e=(t=this.controller)==null?void 0:t.payload.audioId)==null?0:e}}readPayload(){let e=this.getAttribute(`data-payload`);
1if(!e)return null;let t=document.getElementById(e);if(!t||!t.textContent)return null;try{return JSON.parse(t.textContent)}catch(e){return null}}renderTransport(e){let t=w(`div`,`cast-player__transport`),n=w(`button`,`cast-player__play`,{type:`button`});n.setAttribute(`aria-label`,`Play`),n.innerHTML=_,n.disabled=this.disabled,n.addEventListener(`click`,()=>{var e;E=this,(e=this.controller)==null||e.toggle(),this.disabled||this.focus()}),this.playButton=n;let r=w(`input`,`cast-player__seek`,{type:`range`});r.min=`0`,r.step=`1`,r.value=`0`,r.setAttribute(`aria-label`,`Seek`);let i=typeof e.duration==`number`;r.max=i?String(e.duration):`0`,r.disabled=this.disabled||!i,r.setAttribute(`aria-valuetext`,i?this.valueText(0,e.duration):`duration unknown`),r.addEventListener(`input`,()=>{this.controller&&(E=this,this.controller.seek(r.valueAsNumber))}),this.range=r;let a=w(`output`,`cast-player__time`);a.textContent=c(0),this.output=a;let o=w(`output`,`cast-player__remaining`);o.textContent=i?`-${c(e.duration)}`:`--:--`,this.remaining=o;let s=w(`div`,`cast-player__status`,{role:`status`,"aria-live":`polite`});if(this.statusRegion=s,t.append(n,a,r,o),!this.disabled){let e=this.shareEnabled();if(e){let e=w(`button`,`cast-player__share`,{type:`button`});e.setAttribute(`aria-label`,`Share with current time`),e.innerHTML=y,e.addEventListener(`click`,()=>this.openShare()),t.appendChild(e)}let{button:n,popover:r}=this.buildShortcuts();t.appendChild(n),this.appendChild(t),this.appendChild(s),this.appendChild(r),e&&this.appendChild(this.buildShareDialog());return}this.appendChild(t),this.appendChild(s);let l=w(`p`,`cast-player__unavailable`);l.textContent=`Audio unavailable.`,this.appendChild(l)}remainingText(e,t){return typeof t==`number`?`-${c(Math.max(0,t-e))}`:`--:--`}buildShareDialog(){let e=w(`dialog`,`cast-share`),t=`cast-share-title-${this.playerId||`player`}`,n=w(`h2`,`cast-share__title`,{id:t});n.textContent=`Share`,e.setAttribute(`aria-labelledby`,t);let r=w(`div`,`cast-share__row`),i=w(`label`,`cast-share__startat`),a=w(`input`,void 0,{type:`checkbox`});a.checked=!0;let o=w(`span`);o.textContent=` Start at `;let s=w(`input`,`cast-share__time`,{type:`text`,inputmode:`numeric`,pattern:`[0-9]{1,3}:[0-5][0-9]`});s.setAttribute(`aria-label`,`Start time (minutes:seconds)`),i.append(a,o,s),r.appendChild(i);let c=w(`div`,`cast-share__row`),l=w(`input`,`cast-share__url`,{type:`text`,readonly:``});l.setAttribute(`aria-label`,`Share URL`);let u=w(`button`,`cast-share__copy`,{type:`button`});u.textContent=`Copy`,c.append(l,u);let d=w(`div`,`cast-share__row`),f=w(`button`,`cast-share__close`,{type:`button`});f.textContent=`Close`,d.appendChild(f);let p=()=>{let e=new URL(window.location.href);if(e.searchParams.delete(`t`),a.checked){let t=C(s.value);t!=null&&e.searchParams.set(`t`,String(t))}l.value=e.toString()};return a.addEventListener(`change`,()=>{s.disabled=!a.checked,p()}),s.addEventListener(`input`,p),u.addEventListener(`click`,()=>{var e;(e=navigator.clipboard)==null||e.writeText(l.value).then(()=>{u.textContent=`Copied!`,window.setTimeout(()=>u.textContent=`Copy`,1500)},()=>{l.select()})}),f.addEventListener(`click`,()=>this.closeShare()),e.append(n,r,c,d),this.shareDialog=e,this.shareTimeInput=s,this.shareBuildUrl=p,e}openShare(){this.shareDialog&&this.shareTimeInput&&this.shareBuildUrl&&(this.shareTimeInput.value=S(this.currentTime),this.shareBuildUrl(),typeof this.shareDialog.showModal==`function`?this.shareDialog.showModal():this.shareDialog.setAttribute(`open`,``))}closeShare(){this.shareDialog&&(this.shareDialog.hasAttribute(`open`)&&typeof this.shareDialog.close!=`function`?this.shareDialog.removeAttribute(`open`):typeof this.shareDialog.close==`function`&&this.shareDialog.close())}applyStartAt(){var e;let t=new URL(window.location.href).searchParams.get(`t`);if(t===null)return;let n=Number(t);if(!Number.isFinite(n)||n<=0)return;let r=()=>{var e;return(e=this.controller)==null?void 0:e.seek(n)};if(typeof((e=this.controller)==null?void 0:e.duration)==`number`)r();else{var i;let e=()=>{var t;(t=this.controller)==null||t.removeEventListener(`durationchange`,e),r()};(i=this.controller)==null||i.addEventListener(`durationchange`,e),this.controllerListeners.push([`durationchange`,e])}}buildShortcuts(){let e=`cast-shortcuts-${this.playerId||`player`}`,t=w(`div`,`cast-player__shortcuts-popover`,{id:e,popover:``}),n=w(`h2`);n.textContent=`Keyboard shortcuts`;let r=w(`ul`);for(let[e,t]of x){let n=w(`li`),i=w(`kbd`);i.textContent=e,n.append(i,document.createTextNode(` — ${t}`)),r.appendChild(n)}t.append(n,r);let i=w(`button`,`cast-player__shortcuts-btn`,{type:`button`});return i.setAttribute(`aria-label`,`Keyboard shortcuts`),i.setAttribute(`popovertarget`,e),i.innerHTML=b,i.addEventListener(`click`,()=>{typeof t.togglePopover!=`function`&&t.toggleAttribute(`data-open`)}),{button:i,popover:t}}subscribe(){this.controller&&(this.on(`play`,()=>{E=this,this.onPlayState(!0)}),this.on(`navseek`,()=>{E=this}),this.on(`pause`,()=>this.onPlayState(!1)),this.on(`timeupdate`,()=>this.onTimeUpdate()),this.on(`durationchange`,()=>this.onDurationChange()),this.onAudio(`waiting`,()=>this.setStatus(`Loading…`)),this.onAudio(`playing`,()=>this.setStatus(`Playing`)))}on(e,t){var n;(n=this.controller)==null||n.addEventListener(e,t),this.controllerListeners.push([e,t])}onAudio(e,t){var n;(n=this.audioEl)==null||n.addEventListener(e,t),this.audioListeners.push([e,t])}onPlayState(e){this.playButton&&(this.playButton.setAttribute(`aria-label`,e?`Pause`:`Play`),this.playButton.innerHTML=e?v:_),this.setStatus(e?`Playing`:`Paused`)}onTimeUpdate(){let e=this.controller;if(!e)return;let t=e.currentTime,n=e.duration;this.range&&!this.range.matches(`:active`)&&(this.range.value=String(Math.floor(t))),this.range&&(this.range.setAttribute(`aria-valuetext`,typeof n==`
1number`?this.valueText(t,n):l(t)),this.updateProgressFill(t,n)),this.output&&(this.output.textContent=c(t)),this.remaining&&(this.remaining.textContent=this.remainingText(t,n)),this.emitPublicTimeUpdate(t,n)}updateProgressFill(e,t){if(!this.range)return;let n=typeof t==`number`&&t>0?Math.min(100,e/t*100):0;this.range.style.setProperty(`--cast-progress`,`${n}%`)}onDurationChange(){let e=this.controller;if(!e||!this.range)return;let t=e.duration;typeof t==`number`&&(this.range.max=String(t),this.range.disabled=this.disabled,this.range.setAttribute(`aria-valuetext`,this.valueText(e.currentTime,t)),this.updateProgressFill(e.currentTime,t),this.output&&(this.output.textContent=c(e.currentTime)),this.remaining&&(this.remaining.textContent=this.remainingText(e.currentTime,t)))}valueText(e,t){return typeof t==`number`?`${l(e)} of ${l(t)}`:l(e)}setStatus(e){this.statusRegion&&(this.statusRegion.textContent=e)}emitPublicTimeUpdate(e,t){let n=Date.now()-this.lastPublicEmit,r=()=>{this.lastPublicEmit=Date.now(),this.publicTimer=null,this.dispatchEvent(new CustomEvent(`cast:timeupdate`,{bubbles:!0,composed:!0,detail:{currentTime:this.currentTime,duration:this.duration}}))};n>=h?r():this.publicTimer===null&&(this.publicTimer=setTimeout(r,h-n))}handleShortcut(e){let t=this.controller;if(t&&!this.disabled&&(e.key===` `||e.key===`k`||e.key===`K`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`Home`||e.key===`End`))switch(E=this,e.key){case` `:case`k`:case`K`:e.preventDefault(),t.toggle();break;case`ArrowLeft`:e.preventDefault(),t.seek(t.currentTime-g);break;case`ArrowRight`:e.preventDefault(),t.seek(t.currentTime+g);break;case`Home`:e.preventDefault(),t.seek(0);break;case`End`:{let n=t.duration;
1typeof n==`number`&&(e.preventDefault(),t.seek(n));break}}}hydrateFromUrl(e){var t=this;return i(function*(){if(!t.fetchingTranscript){t.fetchingTranscript=!0;try{let i=yield fetch(e);if(!i.ok){var n;(n=t.controller)==null||n.transcriptFailed();return}let a=yield i.json();if(t.controller&&Array.isArray(a.cues))t.controller.setCues(a.cues);else{var r;(r=t.controller)==null||r.transcriptFailed()}}catch(e){var i;(i=t.controller)==null||i.transcriptFailed()}finally{t.fetchingTranscript=!1}}})()}},M=`cast-audio-player`;function N(){customElements.get(`cast-audio-player`)||customElements.define(M,j)}var P=class extends HTMLElement{constructor(...t){super(...t),e(this,`controller`,void 0),e(this,`cancelPending`,void 0),e(this,`listeners`,[])}connectedCallback(){let e=this.getAttribute(`for`);e&&(this.renderInitial(),this.cancelPending=m(e,e=>{this.cancelPending=void 0,this.controller=e,this.onController(e)}))}disconnectedCallback(){this.cancelPending&&(this.cancelPending(),this.cancelPending=void 0);for(let[t,n]of this.listeners){var e;(e=this.controller)==null||e.removeEventListener(t,n)}this.listeners=[],this.controller=void 0}listen(e,t){var n;(n=this.controller)==null||n.addEventListener(e,t),this.listeners.push([e,t])}renderInitial(){}},F=`<svg class="cast-panel__chevron" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M8 5l8 7-8 7z"/></svg>`,I=class extends P{constructor(...t){super(...t),e(this,`buttons`,[]),e(this,`currentLabel`,void 0),e(this,`section`,void 0),e(this,`body`,void 0),e(this,`toggleBtn`,void 0)}onController(e){e.getChapters().length!==0&&((this.getAttribute(`data-mode`)===`current`?`current`:`list`)==`current`?this.renderCurrent():this.renderList(e),this.listen(`chapterchange`,()=>this.updateActive(e.currentChapterIndex)),this.listen(`castpanelopen`,e=>{var t;let n=e.detail;n&&n.kind!==`chapters`&&(t=this.section)!=null&&t.classList.contains(`is-open`)&&this.setOpen(!1)}),this.updateActive(e.currentChapterIndex))}setOpen(e){if(this.section&&this.toggleBtn&&this.body){if(this.section.classList.toggle(`is-open`,e),this.toggleBtn.setAttribute(`aria-expanded`,e?`true`:`false`),e){var t;this.body.removeAttribute(`inert`),(t=this.controller)==null||t.dispatchEvent(new CustomEvent(`castpanelopen`,{detail:{kind:`chapters`}}))}else this.body.setAttribute(`inert`,``)}}renderList(e){let t=document.createElement(`section`);t.className=`cast-chapters cast-panel`,t.setAttribute(`aria-label`,`Chapters`);let n=document.createElement(`div`);n.className=`cast-panel__header`;let r=document.createElement(`button`);r.type=`button`,r.className=`cast-panel__toggle`,r.setAttribute(`aria-expanded`,`false`),r.innerHTML=F;let i=document.createElement(`span`);i.textContent=`Chapters`,r.append(i),n.appendChild(r);let a=document.createElement(`div`);a.className=`cast-panel__body`;let o=document.createElement(`p`);o.className=`cast-panel__count cast-chapters__count`,o.textContent=`${e.getChapters().length} chapters`;let s=document.createElement(`div`);s.className=`cast-panel__scroll`;let l=document.createElement(`ol`);l.className=`cast-chapters__list`,this.buttons=[],e.getChapters().forEach((t,n)=>{let r=document.createElement(`li`),i=document.createElement(`button`);i.type=`button`,i.className=`cast-chapters__button`;let a=document.createElement(`span`);a.className=`cast-chapters__time`,a.textContent=c(t.start);let o=document.createElement(`span`);o.className=`cast-chapters__title`,o.textContent=t.title,i.append(a,o),i.addEventListener(`click`,()=>e.seekToChapter(n)),r.appendChild(i),l.appendChild(r),this.buttons.push(i)}),s.appendChild(l),a.append(o,s),a.setAttribute(`inert`,``),this.section=t,this.body=a,this.toggleBtn=r,r.addEventListener(`click`,()=>this.setOpen(!t.classList.contains(`is-open`))),t.append(n,a),this.appendChild(t)}renderCurrent(){let e=document.createElement(`p`);e.className=`cast-chapters__current`,this.currentLabel=e,this.appendChild(e)}updateActive(e){if(this.currentLabel){var t;let n=(t=this.controller)==null?void 0:t.getChapters()[e];this.currentLabel.textContent=n?n.title:``;return}this.buttons.forEach((t,n)=>{n===e?(t.setAttribute(`aria-current`,`true`),t.classList.add(`is-current`)):(t.removeAttribute(`aria-current`),t.classList.remove(`is-current`))})}}
1,L=`cast-chapters`;function R(){customElements.get(`cast-chapters`)||customElements.define(L,I)}var z=`cast-transcript-follow`,B=`cast-transcript-tabbable`;function V(e,t){try{let n=window.localStorage.getItem(e);return n===null?t:n===`true`}catch(e){return t}}function H(e,t){try{window.localStorage.setItem(e,t?`true`:`false`)}catch(e){}}var U=`<svg class="cast-panel__chevron" width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="M8 5l8 7-8 7z"/></svg>`,W=`<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect x="2" y="6" width="20" height="12" rx="2"/><path d="M6 10h.01M10 10h.01M14 10h.01M18 10h.01M7 14h10"/></svg>`,G=class extends P{constructor(...t){super(...t),e(this,`section`,void 0),e(this,`panelBody`,void 0),e(this,`scroll`,void 0),e(this,`list`,void 0),e(this,`toggleButton`,void 0),e(this,`toolsEl`,void 0),e(this,`countLabel`,void 0),e(this,`searchInput`,void 0),e(this,`searchStatus`,void 0),e(this,`followButton`,void 0),e(this,`tabbableButton`,void 0),e(this,`loadingEl`,void 0),e(this,`cueButtons`,[]),e(this,`cues`,[]),e(this,`activeIndex`,-1),e(this,`open`,!1),e(this,`follow`,!0),e(this,`tabbable`,!1),e(this,`matchIndices`,[]),e(this,`matchCursor`,-1),e(this,`searchSuspended`,!1)}onController(e){e.hasTranscript&&(e.transcriptLoaded&&e.getCues().length===0||(this.open=!1,this.follow=V(z,!0),this.tabbable=V(B,!1),this.build(),e.transcriptLoaded&&this.renderCues(e.getCues()),this.listen(`cueschange`,()=>this.renderCues(e.getCues())),this.listen(`cuechange`,()=>this.setActive(e.currentCueIndex)),this.listen(`transcripterror`,()=>this.onTranscriptError()),this.listen(`castpanelopen`,e=>{let t=e.detail;t&&t.kind!==`transcript`&&this.open&&this.toggleOpen()})))}build(){let e=document.createElement(`section`);e.className=`cast-transcript cast-panel`,e.setAttribute(`aria-label`,`Transcript`),this.open&&e.classList.add(`is-open`);let t=document.createElement(`div`);t.className=`cast-panel__header`;let n=document.createElement(`button`);n.type=`button`,n.className=`cast-panel__toggle`,n.setAttribute(`aria-expanded`,this.open?`true`:`false`),n.innerHTML=U;let r=document.createElement(`span`);r.textContent=`Transcript`,n.append(r),n.addEventListener(`click`,()=>this.toggleOpen()),this.toggleButton=n,t.append(n);let i=document.createElement(`div`);i.className=`cast-panel__body`;let a=document.createElement(`div`);a.className=`cast-panel__reveal`;let o=document.createElement(`div`);o.className=`cast-panel__clip`;let s=document.createElement(`div`);s.className=`cast-panel__scroll`;let c=document.createElement(`div`);c.className=`cast-transcript__cues`,s.appendChild(c),o.append(this.buildTools(),s),a.appendChild(o),i.appendChild(a),this.panelBody=i,this.scroll=s,this.list=c,this.applyInert(),e.append(t,i),this.section=e,this.appendChild(e)}buildTools(){let e=document.createElement(`div`);e.className=`cast-panel__tools`;let t=document.createElement(`span`);t.className=`cast-panel__count`,this.countLabel=t;let n=document.createElement(`input`);n.type=`search`,n.className=`cast-transcript__search-input`,n.setAttribute(`aria-label`,`Search transcript`),n.placeholder=`Search…`,n.addEventListener(`input`,()=>this.runSearch(n.value)),n.addEventListener(`keydown`,e=>{e.key===`Escape`&&n.value&&(e.preventDefault(),e.stopPropagation(),n.value=``,this.runSearch(``))}),this.searchInput=n;let r=document.createElement(`button`);r.type=`button`,r.className=`cast-transcript__nav`,r.textContent=`‹`,r.setAttribute(`aria-label`,`Previous match`),r.addEventListener(`click`,()=>this.gotoMatch(-1));let i=document.createElement(`button`);i.type=`button`,i.className=`cast-transcript__nav`,i.textContent=`›`,i.setAttribute(`aria-label`,`Next match`),i.addEventListener(`click`,()=>this.gotoMatch(1));let a=document.createElement(`span`);a.className=`cast-transcript__search-status`,a.setAttribute(`role`,`status`),a.setAttribute(`aria-live`,`polite`),this.searchStatus=a;let o=document.createElement(`button`);o.type=`button`,o.className=`cast-transcript__follow`,o.textContent=`Follow`,o.setAttribute(`aria-pressed`,this.follow?`true`:`false`),o.addEventListener(`click`,()=>this.toggleFollow()),this.followButton=o;let s=document.createElement(`button`);return s.type=`button`,s.className=`cast-transcript__iconpref cast-transcript__tabpref`,s.innerHTML=W,s.title=`Make transcript lines keyboard-focusable with Tab`,s.setAttribute(`aria-label`,`Keyboard-navigable cues`),s.setAttribute(`aria-pressed`,this.tabbable?`true`:`false`),s.addEventListener(`click`,()=>{this.tabbable=!this.tabbable,s.setAttribute(`aria-pressed`,this.tabbable?`true`:`false`),H(B,this.tabbable),this.applyTabbable()}),this.tabbableButton=s,e.append(t,n,r,i,a,o,s),this.toolsEl=e,e}showLoading(){var e;if(!this.list||this.loadingEl)return;this.list.textContent=``,(e=this.scroll)==null||e.setAttribute(`aria-busy`,`true`);let t=document.createElement(`p`);t.className=`cast-transcript__loading`,t.setAttribute(`role`,`status`);let n=document.createElement(`span`);n.className=`cast-transcript__spinner`,n.setAttribute(`aria-hidden`,`true`),t.append(n,document.createTextNode(`Loading transcript…`)),this.list.appendChild(t),this.loadingEl=t}onTranscriptError(){this.showStatusMessage(`Transcript unavailable.`)}showStatusMessage(e){var t;if(!this.list)return;this.list.textContent=``,this.loadingEl=void 0,(t=this.scroll)==null||t.removeAttribute(`aria-busy`),this.toolsEl&&(this.toolsEl.hidden=!0);let n=document.createElement(`p`);n.className=`cast-transcript__loading`,n.setAttribute(`role`,`status`),n.textContent=e,this.list.appendChild(n)}toggleOpen(){var e,t;this.open=!this.open,(e=this.section)==null||e.classList.toggle(`is-open`,this.open),(t=this.toggleButton)==null||t.setAttribute(`aria-expanded`,this.open?`true`:`false`),this.applyInert(),this.open&&this.controller&&(this.controller.dispatchEvent(new CustomEvent(`castpanelopen`,{detail:{kind:`transcript`}})),!this.controller.transcriptLoaded&&!this.controller.transcriptLoading&&(this.showLoading(),this.controller.requestTranscript()),this.setActive(this.controller.currentCueIndex,!0))}applyInert(){this.panelBody&&(this.open?this.panelBody.removeAttribute(`inert`):this.panelBody.setAttribute(`inert`,``))}toggleFollow(){var e,t;this.follow=!this.follow,(e=this.followButton)==null||e.setAttribute(`aria-pressed`,this.follow?`true`:`false`),(t=this.followButton)==null||t.classList.toggle(`is-suspended`,this.searchSuspended&&this.follow),H(z,this.follow),this.follow&&this.controller&&this.setActive(this.controller.currentCueIndex,!0)}renderCues(e){var t;if(!this.list)return;if(this.cues=e,this.list.textContent=``,this.loadingEl=void 0,(t=this.scroll)==null||t.removeAttribute(`aria-busy`),this.cueButtons=[],this.countLabel&&(this.countLabel.textContent=e.length?`${e.length} lines`:``),e.length===0){this.activeIndex=-1,this.matchIndices=[],this.matchCursor=-1,this.showStatusMessage(`No transcript available for this episode.`);return}this.toolsEl&&(this.toolsEl.hidden=!1);let n=e.some(e=>e.speaker.trim()!==``);this.list.classList.toggle(`cast-transcript__cues--labelled`,n);let r=null;e.forEach((e,t)=>{let i=e.speaker.trim(),a=r===null||i!==r;if(n&&a){let t=document.createElement(`div`);if(t.className=`cast-transcript__speaker`,i){var o;let e=document.createElement(`span`);e.className=`cast-transcript__speaker-chip`,e.setAttribute(`aria-hidden`,`true`),e.textContent=((o=Array.from(i)[0])==null?``:o).toUpperCase();let n=document.createElement(`span`);n.className=`cast-transcript__speaker-name`,n.textContent=i,t.append(e,n)}let n=document.createElement(`span`);n.className=`cast-transcript__speaker-time`,n.textContent=c(e.start),t.appendChild(n),this.list.appendChild(t)}r=i;let s=document.createElement(`button`);s.type=`button`,s.className=`cast-transcript__cue`,a&&s.classList.add(`is-run-start`),s.tabIndex=this.tabbable?0:-1,s.dataset.start=String(e.start),s.dataset.end=String(e.end);
1let l=document.createElement(`span`);l.className=`cast-transcript__time`,l.textContent=c(e.start);let u=document.createElement(`span`);if(u.className=`cast-transcript__text`,u.textContent=e.text,n&&i){let e=document.createElement(`span`);e.className=`cast-transcript__sr`,e.textContent=`${i}: `,s.appendChild(e)}s.append(l,u),s.addEventListener(`click`,()=>{var e,n;(e=this.controller)==null||e.seekToCue(t),(n=this.controller)==null||n.play()}),this.list.appendChild(s),this.cueButtons.push(s)}),this.activeIndex=-1,this.controller&&this.setActive(this.controller.currentCueIndex),this.searchInput&&this.searchInput.value&&this.runSearch(this.searchInput.value)}setActive(e,t=!1){if(e!==this.activeIndex){let t=this.cueButtons[this.activeIndex];t&&(t.removeAttribute(`aria-current`),t.classList.remove(`is-current`)),this.activeIndex=e;let n=this.cueButtons[e];n&&(n.setAttribute(`aria-current`,`true`),n.classList.add(`is-current`))}let n=this.cueButtons[e];n&&this.open&&(this.follow||t)&&!this.searchSuspended&&this.scrollIntoView(n)}scrollIntoView(e){let t=typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches?`auto`:`smooth`;if(t===`smooth`&&this.scroll){let n=this.scroll.getBoundingClientRect(),r=e.getBoundingClientRect(),i=Math.max(n.top-r.bottom,r.top-n.bottom);n.height>0&&i>n.height*2&&(t=`auto`)}try{e.scrollIntoView({behavior:t,block:`nearest`})}catch(e){}}runSearch(e){var t;let n=e.trim().toLowerCase(),r=this.searchSuspended;this.searchSuspended=n!==``,(t=this.followButton)==null||t.classList.toggle(`is-suspended`,this.searchSuspended&&this.follow),this.matchIndices=[],this.matchCursor=-1,this.cues.forEach((e,t)=>{var r;let i=(r=this.cueButtons[t])==null?void 0:r.querySelector(`.cast-transcript__text`);i&&(i.textContent=e.text,n&&e.text.toLowerCase().includes(n)&&(this.markMatches(i,e.text,n),this.matchIndices.push(t)))}),this.announceMatches(n),n&&this.matchIndices.length&&this.gotoMatch(1,!1),r&&!this.searchSuspended&&this.follow&&this.controller&&this.setActive(this.controller.currentCueIndex,!0)}markMatches(e,t,n){let r=t.toLowerCase();e.textContent=``;let i=0,a=r.indexOf(n,i);for(;a!==-1;){a>i&&e.appendChild(document.createTextNode(t.slice(i,a)));let o=document.createElement(`mark`);o.textContent=t.slice(a,a+n.length),e.appendChild(o),i=a+n.length,a=r.indexOf(n,i)}i<t.length&&e.appendChild(document.createTextNode(t.slice(i)))}announceMatches(e){if(!this.searchStatus)return;if(!e){this.searchStatus.textContent=``;return}let t=this.matchIndices.length;this.searchStatus.textContent=t===1?`1 match`:`${t} matches`}gotoMatch(e,t=!0){var n;if(this.matchIndices.length===0)return;(n=this.list)==null||n.querySelectorAll(`mark.is-active-match`).forEach(e=>e.classList.remove(`is-active-match`)),this.matchCursor=this.matchCursor===-1?e===1?0:this.matchIndices.length-1:(this.matchCursor+e+this.matchIndices.length)%this.matchIndices.length;let r=this.matchIndices[this.matchCursor],i=this.cueButtons[r];if(i){var a;(a=i.querySelector(`mark`))==null||a.classList.add(`is-active-match`),this.scrollIntoView(i),t&&i.focus()}}applyTabbable(){for(let e of this.cueButtons)e.tabIndex=this.tabbable?0:-1}},K=`cast-transcript`;function q(){customElements.get(`cast-transcript`)||customElements.define(K,G)}function J(){N(),R(),q()}J();

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.