PageSourceSearch

https://www.aftonbladet.se/front-page-assets/_astro/RenderWebCompo…_astro_type_script_index_0_lang.Bkx2gFuT.js

js aftonbladet.se collected 2026-09-24 08:29:13 UTC 22,105 bytes, 10 lines download raw bytes

1(function(){try{var e=typeof window<`u`?window:typeof global<`u`?global:typeof globalThis<`u`?globalThis:typeof self<`u`?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]=`667982dc-4d1d-4fd2-8839-4885b17fd135`,e._sentryDebugIdIdentifier=`sentry-dbid-667982dc-4d1d-4fd2-8839-4885b17fd135`)}catch{}})();import{r as e,t}from"./hermes.bjb7DIUq.js";import{t as n}from"./smart-frame.DqhXL5Hx.js";import{nt as r}from"./_auto-entry_aftonbladetv2-B-WVqE-D.C2LFvg-u.js";import{o as i,r as a}from"./src.CKunkmSd.js";import{t as o}from"./strings.CKGeFAoY.js";import{getGlobalIdentityInstance as s}from"https://esm.schibsted.tech/@schibsted/nanostores-account";var c={en:{now:{long:`Now`,short:`Now`},minutes:{long:`minutes`,short:`min`},hours:{long:`hours`,short:`hr`},days:{long:`days`,short:`day`}},"nb-NO":{now:{long:`NÃ¥`,short:`NÃ¥`},minutes:{long:`minutter`,short:`min`},hours:{long:`timer`,short:`t`},days:{long:`dager`,short:`d`}},"sv-SE":{now:{long:`Nu`,short:`Nu`},minutes:{long:`minuter`,short:`min`},hours:{long:`timmar`,short:`tim`},days:{long:`dagar`,short:`d`}}},l={day:`numeric`,hour:`numeric`,minute:`numeric`,month:`long`,weekday:`long`,year:`numeric`,i18n:`long`};function u(e,t=`nb-NO`,n,r=!1){let i=new Date(e),a=new Date(new Date(e).setHours(0,0,0,0)),o={...l,...n},s=new Date,u=new Date(new Date().setHours(0,0,0,0)),d=(i.getTime()-s.getTime())/6e4,f=d/60,p=(a.getTime()-u.getTime())/864e5,m=new Intl.RelativeTimeFormat(t,{numeric:`always`}),h=new Intl.RelativeTimeFormat(t,{numeric:`auto`});return!r&&o.minute!==!1&&d>-5&&1>d?c[t].now[o.i18n]:!r&&o.minute!==!1&&d>-60&&60>d?`${Math.abs(Math.round(d))} ${c[t].minutes[o.i18n]}`:!r&&o.hour!==!1&&f>-3&&3>f?`${Math.abs(Math.round(f))} ${c[t].hours[o.i18n]}`:!r&&p>-7&&2>p?`${((e=!0)=>e?h:m)(Math.round(p)!==-2).format(Math.round(p),`day`)} ${o.hour!==!1&&o.minute!==!1?i.toLocaleTimeString(t,{...o.hour&&{hour:o.hour},...o.minute&&{minute:o.minute}}):``}`.trim():!r&&p>1&&7>p?i.toLocaleDateString(t,{...o.weekday&&{weekday:o.weekday},...o.hour&&{hour:o.hour},...o.minute&&{minute:o.minute}}).replace(`,`,``):i.toLocaleDateString(t,{...o.weekday&&{weekday:o.weekday},...o.day&&{day:o.day},...o.month&&{month:o.month},...o.year&&i.getFullYear()!==s.getFullYear()&&{year:o.year},...o.hour&&{hour:o.hour},...o.minute&&{minute:o.minute}}).replace(`,`,``)}var d=class extends HTMLElement{interval=null;timeElement=null;updateFreshState(){if(!this.timeElement||!this.dataset.freshThresholdMs)return;let e=Number(this.dataset.freshThresholdMs),t=new Date(this.timeElement.dateTime).getTime();Number.isFinite(e)&&Number.isFinite(t)&&(this.timeElement.dataset.fresh=(Math.abs(Date.now()-t)<=e).toString())}update(e,t){if(!this.timeElement)throw Error(`No time element found`);let n=this.timeElement.dateTime;if(!n)throw Error(`No timestamp attribute found`);this.updateFreshState();let r=new Date(n).getTime(),i=o(u(r,t,e)),a=this.timeElement.querySelector(`span`);if(a){a.textContent!==i&&(a.textContent=i);return}this.timeElement.textContent!==i&&(this.timeElement.textContent=i)}connectedCallback(){this.timeElement=this.querySelector(`time`);let e=this.options,t=this.locale;this.update(e,t),this.interval=setInterval(()=>this.update(e,t),1e3)}disconnectedCallback(){this.interval&&clearInterval(this.interval)}get options(){let{options:e}=this.dataset;return e?JSON.parse(e):{}}get locale(){return this.dataset.locale}},f=new Set,p=500,m=`0px`,h=()=>window.matchMedia(`(hover: hover) and (pointer: fine)`).matches;function g(e){e instanceof HTMLVideoElement&&e.play(),e?.classList.add(`preview-video-in-screen`)}var _=new Map;function v(e,t=1e3){if(t===0){g(e);return}if(!_.has(e)){let n=setTimeout(()=>g(e),t);_.set(e,n)}}function y(e){_.has(e)&&(clearTimeout(_.get(e)),_.delete(e)),e.classList.remove(`preview-video-in-screen`)}function b(e){let{target:t,isIntersecting:n}=e;n?f.add(t):(f.delete(t),y(t));let[r]=f;v(r,p)}var x=(e=!1)=>e?`img`:`video`,S,C=async e=>{if(e&&e instanceof HTMLVideoElement&&!navigator.userAgent.includes(`Android`)&&S===void 0)try{await e.play(),S=!1}catch{S=!h()}},w=class extends HTMLElement{observer=null;eventController=new AbortController;constructor(){super(),this.attachShadow({mode:`open`})}connectedCallback(){this.observer=new IntersectionObserver(e=>{let[t]=e;
1if(t.isIntersecting)this.render(),C(this.getMediaElement()).catch(()=>{this.render()});else{let e=this.getMediaElement();if(!e||(e instanceof HTMLVideoElement&&e.pause?.(),!this.shadowRoot))return;this.eventController?.abort(),this.shadowRoot.innerHTML=``}b(t)},{threshold:[.5],rootMargin:m}),this.observer.observe(this)}disconnectedCallback(){this.observer?.disconnect(),this.observer=null,this.eventController?.abort(),f.delete(this)}getMediaElement(){return this.shadowRoot?this.shadowRoot.querySelector(x(S)):null}async render(){let e=Array.from(this.attributes),t=x(S);if(this.eventController=new AbortController,!this.shadowRoot)return;let n=Object.assign(document.createElement(t),{muted:!0,playsInline:!0,autoplay:!0,preload:`auto`,controlsList:`nodownload nofullscreen noremoteplayback`,disableRemotePlayback:!0,disablePictureInPicture:!0,loop:!0}),r=HTMLVideoElement?`play`:`load`,i=this.eventController.signal;n.addEventListener(r,()=>{this.classList.add(`preview-video-loaded`)},{signal:i}),n.setAttribute(`x-webkit-airplay`,`deny`);for(let t of e)n.setAttribute(t.name,t.value);this.shadowRoot.innerHTML=`
2      <style>
3        video, img {
4          width: 100%;
5          height: 100%;
6          object-fit: cover;
7        }
8      </style>
9    `,this.shadowRoot.appendChild(n)}},T=async()=>{let e=await s();return e?e.isLoggedIn():!1},E=class extends HTMLElement{observer=null;loadVideo;_innerNode=null;constructor(){super(),this.loadVideo=a()}getConfig(){return JSON.parse(this.dataset.config||`{}`)}ensureId(){if(!this.innerNode)throw Error(`Inner node not found`);return this.innerNode.id??=`svp-player-${Math.random().toString(36).slice(2,9)}`,this.innerNode.id}get innerNode(){return this._innerNode??=this.querySelector(`div`),this._innerNode}async connectedCallback(){let e=this.getConfig(),t=await T();if(!this.isConnected)return;let n={ads:{bumper:!0,midroll:!0,pausead:!0},context:e.context,site:e.brand,dnaStyle:e.brand,noFirstAd:e.noFirstAd,ui:{videoPreview:e.videoPreview}},i={assetId:e.id,aspectRatio:e.aspectRatio,tags:e.tags,isUserLoggedIn:t,startMode:e.autoplay?`auto`:`manual`,isUsedInOverlayVideoPlayer:e.isUsedInOverlayVideoPlayer,isLiveStudio:e.isLiveStudio,assetSection:e.assetSection,isApp:e.isApp,deviceType:e.deviceType,isAndroidApp:e.isAndroidApp,publisher:e?.pulse?.provider},a={api:e.api,autoplay:e.autoplay?`viewable`:!1,autopause:`viewable`,id:Number(e.id),mute:e.mute,node:this.ensureId(),repeat:e.repeat,locale:e.locale,settings:{na:e.assetType===`audio`},skin:e.assetType===`video`?void 0:{name:e.assetType,url:e.skinUrl},subscriptionUrl:e.subscriptionUrl,vendor:e.vendor,pulse:e.pulse,adn:r.getVideoAdsConfig(i)},o=()=>{this.loadVideo?.({config:a,options:n})};this.dataset.loading===`eager`?o():(this.observer=new IntersectionObserver((e,t)=>{e.forEach(e=>{e.isIntersecting&&(t.disconnect(),this.observer=null,o())})},{rootMargin:`100%`}),this.observer.observe(this))}disconnectedCallback(){this.observer?.disconnect(),this.observer=null}},D=[.5,.75,1,1.25,1.5,2],O=new class{currentState=`idle`;_currentTime=0;_currentTrack=null;_duration=0;_playbackRate=1;pauseRequested=!1;queue=[];initAbort=null;loadVideoFn=null;loadVideoOptions;player=null;playerContainer=null;listeners=new Map;init(e,t){this.loadVideoFn=e,this.loadVideoOptions=t}resolveLoadVideo(){if(!this.loadVideoFn)throw Error(`AudioController: loadVideo not initialized. Call audioController.init(loadVideo) first.`);return this.loadVideoFn}get state(){return this.currentState}get currentTime(){return this._currentTime}get duration(){return this._duration}get playbackRate(){return this._playbackRate}get currentTrack(){return this._currentTrack}async play(n){if(t()){e(n.assetId,n.provider);return}if(this._currentTrack?.assetId===n.assetId&&this.currentState===`paused`){this.resume();return}this.teardown(),this._currentTrack=n,this._currentTime=0,this._duration=0,this.pauseRequested=!1,this.setState(`loading`),await this.initPlayer(n)}resume(){this.player&&this.currentState===`paused`&&(this.pauseRequested=!1,this.player.play())}pause(){this.player&&(this.currentState===`playing`||this.currentState===`adPlaying`)&&(this.pauseRequested=!0,this.player.pause())}async toggle(e){let t=this._currentTrack?.assetId===e.assetId;t&&this.currentState===`loading`||(t&&(this.currentState===`playing`||this.currentState===`adPlaying`)?this.pause():await this.play(e))}seek(e){this.player&&this.player.seek(Math.max(0,Math.min(e,this.duration)))}seekRelative(e){this.seek(this.currentTime+e)}setPlaybackRate(e){this.player&&(this.player.setPlaybackRate(e),this._playbackRate=e,this.emit
9(`ratechange`))}cyclePlaybackRate(){let e=(D.indexOf(this.playbackRate)+1)%D.length;this.setPlaybackRate(D[e])}setQueue(e){this.queue=e}async playNext(){if(this.queue.length===0)return;let e=this.queue.findIndex(e=>e.assetId===this._currentTrack?.assetId),t=this.queue[e+1];t&&await this.play(t)}stop(){this.teardown(),this._currentTrack=null,this._currentTime=0,this._duration=0,this.setState(`idle`)}on(e,t){this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e)?.add(t)}off(e,t){this.listeners.get(e)?.delete(t)}async initPlayer(e){let t=new AbortController;this.initAbort=t;try{let n=this.resolveLoadVideo(),r=this.createNode(),i=e.vendor??`vgtv`,a=await n({options:this.loadVideoOptions,config:{vendor:i,node:r.id,id:Number(e.assetId),mute:!1,recommended:!1,repeat:!1,locale:`no`,pulse:{provider:e.provider??`vg`}}});if(t.signal.aborted){a?.remove();return}if(!a){this.setState(`error`);return}this.player=a,this.bindPlayerEvents(a,t),a.on(`ready`,()=>{t.signal.aborted||this.handleLockedPlayer(a)||a.play()}),a.on(`error`,()=>{t.signal.aborted||(this.setState(`error`),this.emit(`error`))})}catch{t.signal.aborted||(this.setState(`error`),this.emit(`error`))}}bindPlayerEvents(e,t){let n=()=>{if(!t.signal.aborted&&this.currentState!==`locked`)try{let t=e.getState(),n=this.mapSvpState(t);if(n===`paused`&&!this.pauseRequested&&this.currentState===`loading`)return;n!==`paused`&&(this.pauseRequested=!1),this._playbackRate=e.getPlaybackRate(),this.setState(n)}catch{}},r=(e,n)=>{t.signal.aborted||(this._currentTime=e,this._duration=n,this.emit(`timeupdate`))};e.on(`play`,n),e.on(`pause`,n),e.on(`assetPlay`,n),e.on(`assetReady`,()=>{if(t.signal.aborted)return;this.handleLockedPlayer(e);let n=e.getRawAsset();n?.title&&this._currentTrack&&!this._currentTrack.title&&(this._currentTrack={...this._currentTrack,title:n.title}),n?.duration&&(this._duration=n.duration/1e3,this.emit(`durationchange`))}),e.on(`adPlay`,n),e.on(`adPause`,n),e.on(`adStarted`,n),e.on(`adFinished`,n),e.on(`time`,r),e.on(`adProgress`,r),e.on(`complete`,()=>{t.signal.aborted||(this.setState(`ended`),this.emit(`ended`),this.playNext())}),e.on(`initialPlay`,n)}mapSvpState(e){switch(e){case`playing`:return`playing`;case`paused`:return`paused`;case`buffering`:case`loading`:case`stalled`:return`loading`;case`complete`:return`ended`;case`error`:return`error`;case`adPlaying`:return`adPlaying`;default:return`idle`}}handleLockedPlayer(e){if(!(e.getRawAsset()?.additional?.metadata?.[`1variantType`]===`Subscription`&&e.getContainer().querySelector(`.svp-login-overlay[href]`)))return!1;try{e.pause()}catch{}return this.setState(`locked`),!0}createNode(){let e=document.createElement(`div`);e.style.position=`absolute`,e.style.width=`0`,e.style.height=`0`,e.style.overflow=`hidden`;let t=`audio-player-${Math.random().toString(36).slice(2,9)}`,n=document.createElement(`div`);return n.id=t,e.appendChild(n),document.body.appendChild(e),this.playerContainer=e,n}teardown(){this.initAbort?.abort(),this.initAbort=null,this.pauseRequested=!1,this.player&&=(this.player.remove(),null),this.playerContainer?.remove(),this.playerContainer=null}setState(e){this.currentState!==e&&(this.currentState=e,this.emit(`statechange`))}emit(e){let t=this.getDetail();for(let n of this.listeners.get(e)??[])n(t)}getDetail(){return{state:this.currentState,currentTime:this._currentTime,duration:this._duration,playbackRate:this._playbackRate,assetId:this._currentTrack?.assetId??null,isLive:this._currentTrack?.isLive??!1}}},k=[`asset-id`,`title`,`provider`,`vendor`],A=class extends HTMLElement{static observedAttributes=[...k];state_=`idle`;get track(){let e=this.getAttribute(`asset-id`);return e?{assetId:e,title:this.getAttribute(`title`)??void 0,provider:this.getAttribute(`provider`)??void 0,vendor:this.getAttribute(`vendor`)??void 0,isLive:this.hasAttribute(`is-live`)}:null}get playing(){return this.state_===`playing`}handleClick=e=>{e.preventDefault(),e.stopPropagation();let t=this.track??O.currentTrack;t&&O.toggle(t)};handleStateChange=e=>{let t=this.getAttribute(`asset-id`);if(!t){this.updateState(e.state);return}if(e.assetId!==t){this.updateState(`idle`);return}this.updateState(e.state)};updateState(e){this.toggleAttribute(`hidden`,e===`locked`),this.setAttribute(`data-state`,e),this.state_!==e&&(this.state_=e,this.dispatchEvent(new CustomEvent(`audio-state-change`,{bubbles:!0,detail:{state:e}})))}syncState(){let e=this.getAttribute(`asset-id`),t=O.currentTrack?.assetId??null;if(e&&t!==e){this.updateState(`idle`);return}this.updateState(O.state)}connectedCallback(){this.addEventListener(`click`,this.handleClick),O.on(`statechange`,this.handleStateChange),this.setAttribute(`role`,`button`),this.setAttribute(`tabindex`,`0`),this.syncState(),this.addEventListener(`ke
9ydown`,this.handleKeydown)}disconnectedCallback(){this.removeEventListener(`click`,this.handleClick),this.removeEventListener(`keydown`,this.handleKeydown),O.off(`statechange`,this.handleStateChange)}handleKeydown=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.handleClick(e))}};function j(e=`audio-play-button`){customElements.get(e)||customElements.define(e,A)}var M=class extends HTMLElement{#e=()=>{O.cyclePlaybackRate()};#t=e=>{this.setAttribute(`data-rate`,String(e.playbackRate)),this.textContent=`${e.playbackRate}x`};connectedCallback(){this.addEventListener(`click`,this.#e),O.on(`ratechange`,this.#t),this.setAttribute(`role`,`button`),this.setAttribute(`tabindex`,`0`),this.setAttribute(`data-rate`,String(O.playbackRate)),this.textContent=`${O.playbackRate}x`,this.addEventListener(`keydown`,this.#n)}disconnectedCallback(){this.removeEventListener(`click`,this.#e),this.removeEventListener(`keydown`,this.#n),O.off(`ratechange`,this.#t)}#n=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),this.#e())};static get rates(){return D}};function N(e=`audio-playback-rate`){customElements.get(e)||customElements.define(e,M)}var P=class extends HTMLElement{state_=`idle`;currentAssetId=null;stopButton=null;handleStateChange=e=>{e.assetId!==this.currentAssetId&&(this.currentAssetId=e.assetId,this.syncAssetId(e.assetId)),this.updateState(e.state),this.syncTitle(O.currentTrack?.title??``),this.toggleAttribute(`data-live`,e.isLive)};updateState(e){this.state_!==e&&(this.state_=e,this.setAttribute(`data-state`,e))}syncAssetId(e){let t=this.querySelectorAll(`audio-progress, audio-time-display`);for(let n=0;n<t.length;n++)e?t[n].setAttribute(`asset-id`,e):t[n].removeAttribute(`asset-id`)}syncTitle(e){let t=this.querySelector(`[data-audio-title]`);t&&t.textContent!==e&&(t.textContent=e)}handleStop=()=>{O.stop()};connectedCallback(){this.setAttribute(`data-state`,`idle`),O.on(`statechange`,this.handleStateChange),this.stopButton=this.querySelector(`[data-audio-stop]`),this.stopButton?.addEventListener(`click`,this.handleStop),O.state!==`idle`&&(this.updateState(O.state),this.currentAssetId=O.currentTrack?.assetId??null,this.syncAssetId(this.currentAssetId),this.syncTitle(O.currentTrack?.title??``),this.toggleAttribute(`data-live`,O.currentTrack?.isLive??!1))}disconnectedCallback(){O.off(`statechange`,this.handleStateChange),this.stopButton?.removeEventListener(`click`,this.handleStop)}};function F(e=`audio-player`){customElements.get(e)||customElements.define(e,P)}var I=class extends HTMLElement{isDragging=!1;lastAssetId=null;get assetId(){return this.getAttribute(`asset-id`)}isActiveTrack(e){return!this.assetId||e.assetId===this.assetId}handleStateChange=e=>{e.assetId!==this.lastAssetId&&(this.lastAssetId=e.assetId,this.updateProgress(0,0))};handleTimeUpdate=e=>{!this.isDragging&&this.isActiveTrack(e)&&this.updateProgress(e.currentTime,e.duration)};handleDurationChange=e=>{this.isActiveTrack(e)&&this.updateProgress(e.currentTime,e.duration)};updateProgress(e,t){let n=t>0?Math.max(0,Math.min(1,e/t)):0;this.style.setProperty(`--audio-progress`,String(n))}handlePointerDown=e=>{this.isDragging=!0,this.setPointerCapture(e.pointerId),this.seekFromPointer(e)};handlePointerMove=e=>{this.isDragging&&this.seekFromPointer(e)};handlePointerUp=e=>{this.isDragging=!1,this.releasePointerCapture(e.pointerId)};handlePointerCancel=e=>{this.isDragging=!1,this.releasePointerCapture(e.pointerId)};handleClick=e=>{e.stopPropagation()};seekFromPointer(e){let t=this.getBoundingClientRect(),n=Math.max(0,Math.min(1,(e.clientX-t.left)/t.width)),r=O.duration;r>0&&(O.seek(n*r),this.updateProgress(n*r,r))}connectedCallback(){this.setAttribute(`role`,`slider`),this.setAttribute(`aria-valuemin`,`0`),this.setAttribute(`aria-valuemax`,`100`),this.setAttribute(`aria-valuenow`,`0`),this.setAttribute(`tabindex`,`0`),this.style.setProperty(`--audio-progress`,`0`),O.on(`timeupdate`,this.handleTimeUpdate),O.on(`durationchange`,this.handleDurationChange),O.on(`statechange`,this.handleStateChange),this.addEventListener(`pointerdown`,this.handlePointerDown),this.addEventListener(`pointermove`,this.handlePointerMove),this.addEventListener(`pointerup`,this.handlePointerUp),this.addEventListener(`pointercancel`,this.handlePointerCancel),this.addEventListener(`click`,this.handleClick),this.addEventListener(`ke
9ydown`,this.handleKeydown)}disconnectedCallback(){O.off(`timeupdate`,this.handleTimeUpdate),O.off(`durationchange`,this.handleDurationChange),O.off(`statechange`,this.handleStateChange),this.removeEventListener(`pointerdown`,this.handlePointerDown),this.removeEventListener(`pointermove`,this.handlePointerMove),this.removeEventListener(`pointerup`,this.handlePointerUp),this.removeEventListener(`pointercancel`,this.handlePointerCancel),this.removeEventListener(`click`,this.handleClick),this.removeEventListener(`keydown`,this.handleKeydown)}handleKeydown=e=>{e.key===`ArrowRight`?(e.preventDefault(),O.seekRelative(10)):e.key===`ArrowLeft`&&(e.preventDefault(),O.seekRelative(-10))}};function L(e=`audio-progress`){customElements.get(e)||customElements.define(e,I)}function R(e){if(!Number.isFinite(e)||e<0)return`00:00`;let t=Math.floor(e/3600),n=Math.floor(e%3600/60),r=Math.floor(e%60),i=String(n).padStart(2,`0`),a=String(r).padStart(2,`0`);return t>0?`${t}:${i}:${a}`:`${i}:${a}`}function z(e,t={}){return!Number.isFinite(e)||e<0?t.emptyWhenZero?``:`0 s`:t.emptyWhenZero&&e===0?``:e<60?`${Math.max(0,Math.floor(e))} s`:`${Math.floor(e/60)} min`}var B=class extends HTMLElement{static observedAttributes=[`duration`,`format`,`mode`];lastText=``;baseTime=0;baseDuration=0;get assetId(){return this.getAttribute(`asset-id`)}get mode(){return this.getAttribute(`mode`)??`current-of-duration`}set mode(e){this.setOptionalAttribute(`mode`,e)}get format(){return this.getAttribute(`format`)??`default`}set format(e){this.setOptionalAttribute(`format`,e)}get initialDuration(){let e=Number(this.getAttribute(`duration`));return Number.isFinite(e)&&e>0?e/1e3:0}getDuration(e){return e>0?e:this.initialDuration}setOptionalAttribute(e,t){if(t==null){this.removeAttribute(e);return}this.setAttribute(e,t)}isActiveAsset(e){let t=this.assetId,n=e?.assetId??O.currentTrack?.assetId;return!t||n===t}reset(){this.baseTime=0,this.baseDuration=this.initialDuration,this.renderText(this.baseTime,this.baseDuration)}handleStateChange=e=>{if(!this.isActiveAsset(e)){this.reset();return}this.sync()};handleTimeUpdate=e=>{this.isActiveAsset(e)&&(this.baseDuration=this.getDuration(e.duration),this.baseTime=e.currentTime,this.renderText(this.baseTime,this.baseDuration))};handleDurationChange=e=>{this.isActiveAsset(e)&&(this.baseDuration=this.getDuration(e.duration),this.sync())};sync(){this.baseTime=O.currentTime,this.baseDuration=this.getDuration(O.duration),this.renderText(this.baseTime,this.baseDuration)}renderText(e,t){let n,r=(e,t=!1)=>this.format===`compact`?z(e,{emptyWhenZero:t}):R(e);switch(this.mode){case`current`:n=r(e);break;case`duration`:n=r(t,!0);break;case`remaining`:n=this.format===`compact`?r(t-e,!0):`-${r(t-e)}`;break;case`current-of-duration`:n=`${r(e)} / ${r(t)}`}n!==this.lastText&&(this.lastText=n,this.textContent=n)}attributeChangedCallback(){this.renderText(this.baseTime,this.baseDuration||this.initialDuration)}connectedCallback(){O.on(`statechange`,this.handleStateChange),O.on(`timeupdate`,this.handleTimeUpdate),O.on(`durationchange`,this.handleDurationChange),this.isActiveAsset()?this.sync():this.reset()}disconnectedCallback(){O.off(`statechange`,this.handleStateChange),O.off(`timeupdate`,this.handleTimeUpdate),O.off(`durationchange`,this.handleDurationChange)}};function V(e=`audio-time-display`){customElements.get(e)||customElements.define(e,B)}function H(e){F(),j(),N(),L(),V();let t=a();t&&O.init(t,e),i().then(e=>{e.addEventListener(`overlay/open`,()=>{O.pause()})}).catch(()=>{})}if(customElements.get(`friendly-timestamp`)||customElements.define(`friendly-timestamp`,d),customElements.get(`preview-video`)||customElements.define(`preview-video`,w),customElements.get(`smart-frame`)||customElements.define(`smart-frame`,n),customElements.get(`svp-player`)||customElements.define(`svp-player`,E),!customElements.get(`audio-play-button`)){let e=document.getElementById(`web-component-config`),{brand:t}=JSON.parse(e?.textContent??`{}`);H({site:t,dnaStyle:t})}
10//# sourceMappingURL=RenderWebComponent.astro_astro_type_script_index_0_lang.Bkx2gFuT.js.map

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.