1(self.webpackChunk=self.webpackChunk||[]).push([[752],{752:(t,e,i)=>{"use strict";i.r(e),i.d(e,{default:()=>a});i(3197);var s=window.matchMedia("(prefers-reduced-motion: reduce)").matches;function a(){var t=document.querySelectorAll("[data-vbg]");if(t.length>0){var e=new VideoBackgrounds("[data-vbg]"),i=function(){var t=e.index[a],i=t.element.parentElement;t.params.autoplay&&!s||(t.play(),t.pause(),i.addEventListener("click",function(){"playing"===t.currentState?t.pause():t.play()}))};for(var a in e.index)i();t.forEach(function(t){var e=t.parentElement;t.addEventListener("video-background-play",function(){e.classList.add("playing")}),t.addEventListener("video-background-pause",function(){e.classList.remove("playing")}),t.addEventListener("video-background-mute",function(){}),t.addEventListener("video-background-unmute",function(){})})}s&&document.querySelectorAll("video[autoplay]").forEach(function(t){t.pause()})}},3197:(t,e,i)=>{var s=i(4692);(()=>{function t(t){t&&(t.element.classList.add(t.stateClassName),t.element.firstChild.classList.remove(t.stateChildClassNames[0]),t.element.firstChild.classList.add(t.stateChildClassNames[1]),t.element.setAttribute("aria-pressed",!1))}function e(e,i){const s=document.createElement("button");s.className=i.className,s.innerHTML=i.innerHtml,s.setAttribute("role","switch"),s.firstChild.classList.add(i.stateChildClassNames[0]),s.setAttribute("aria-pressed",!i.initialState),i.element=s,e.params[i.condition_parameter]===i.initialState&&t(i),s.addEventListener("click",function(s){var a;this.classList.contains(i.stateClassName)?((a=i)&&(a.element.classList.remove(a.stateClassName),a.element.firstChild.classList.add(a.stateChildClassNames[0]),a.element.firstChild.classList.remove(a.stateChildClassNames[1]),a.element.setAttribute("aria-pressed",!0)),e[i.actions[0]]()):(t(i),e[i.actions[1]]())}),e.buttons[i.name]={element:s,button_properties:i},e.controls_element.appendChild(s)}function i(t){if(/^\s*null\s*$/.test(t))return null;const e=function(t){if(/^\s*(true|false)\s*$/i.test(t))return"true"===t}(t);return void 0!==e?e:function(t){return/^\s*\d+\s*$/.test(t)?parseInt(t):/^\s*[\d.]+\s*$/.test(t)?parseFloat(t):void 0}(t)||function(t){if(/^\s*\[.*\]\s*$/.test(t))try{return JSON.parse(t)}catch(t){}}(t)||function(t){if(/^\s*\{.*\}\s*$/.test(t))try{return JSON.parse(t)}catch(t){}}(t)||function(t){if(/^\s*\/.*\/g?i?\s*$/.test(t))try{return new RegExp(t)}catch(t){}}(t)||t}function a(t){return Array.isArray(t)}function r(t,e,i=!1){if(t=Number(t),e=Number(e),isNaN(t)||isNaN(e))throw new TypeError("Both min and max must be numbers");if(t>e&&([t,e]=[e,t]),t===e)return t;t=Math.round(t),e=Math.round(e);const s=i?function(){if(!crypto)return Math.random();if(crypto.getRandomValues)return crypto.getRandomValues(new Uint32Array(1))[0]/4294967295}():Math.random();return Math.floor(s*(e-t+1))+t}var n=/(?:youtube\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?\/ ]{11})/i,o=/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/(?:[^\/]*)\/videos\/|album\/(?:\d+)\/video\/|video\/|)(\d+)(?:[a-zA-Z0-9_\-]+)?/i,h=/\/([^\/]+\.(?:mp4|ogg|ogv|ogm|webm|avi))\s*$/i;function l(t,e=document){if(t instanceof Array||t instanceof NodeList)return t;if(t instanceof Element)return[t];if(e instanceof Element||e instanceof Document)return e.querySelectorAll(t);if("string"==typeof e&&(e=l(e)),!e instanceof Array&&!e instanceof NodeList)return[];const i=[];for(const s of e)i.push(...s.querySelectorAll(t));return i}function d(t,e=1,i=0){t instanceof Element&&(t=[t]),"string"==typeof t&&(t=l(t));for(const s of t){const t=s.parentNode.offsetHeight+i,a=s.parentNode.offsetWidth+i;e>a/t?(s.style.width=t*e+"px",s.style.height=t+"px"):(s.style.width=a+"px",s.style.height=a/e+"px")}}var u,p=class{constructor(t,i,s,a,r,n){if(!s)return;var o;this.is_mobile="maxTouchPoints"in navigator?navigator.maxTouchPoints>0:"matchMedia"in window?!!matchMedia("(pointer:coarse)").matches:"orientation"in window||(o=navigator.userAgent,/\b(BlackBerry|webOS|iPhone|IEMobile)\b/i.test(o)||/\b(Android|Windows Phone|iPad|iPod)\b/i.test(o)),this.type=r,this.id=s,this.factoryInstance=n,this.element=t,this.playerElement=null,this.uid=a,this.element.setAttribute("data-vbg-uid",a),this.buttons={},this.isIntersecting=!1,this.paused=!1,this.muted=!1,this.currentState="notstarted",this.initialPlay=!1,this.initialVolume=!1,this.volume=1,this.params={};this.params=this.parseProperties(i,{pause:!1,"play-button":!1,"mute-button":!1,autoplay:!0,muted:!0,loop:!0,mobile:!0,"load-background":!1,resolution:"16:9","inline-styles":!0,"fit-box":!1,offset:100,"start-at":0,"end-at":0,poster:null,"always-play":!1,volume:1,"no-cookie":!0,"force-on-low-battery":!1,lazyloading:!1,title:"Video background"},this.element,["data-ytbg-","data-vbg-"]),this.params.pause&&(this.params["play-button"]=this.params.pause),this.params.resolution_mod=function(t){const e=1.7777777778;if(!t||!t.length||/16[\:x\-\/]{1}9/i.test(t))return e;const i=t.split(/\s?[\:x\-\/]{1}\s?/i);if(i.length<2)return e;const s=parseInt(i[0]),a=parseInt(i[1]);return 0===s||0===a||isNaN(s)||isNaN(a)?e:s/a}(this.params.resolution),this.muted=this.params.muted,this.volume=this.params.volume,this.currentTime=this.params["start-at"]||0,this.duration=this.params["end-at"]||0,this.percentComplete=0,this.params["start-at"]&&(this.percentComplete=this.timeToPercentage(this.params["start-at"])),this.buildWrapperHTML(),this.is_mobile&&!this.params.mobile||(this.params["play-button"]&&e(this,{name:"playing",className:"play-toggle",innerHtml:'<i class="fa"></i>',initialState:!this.paused,stateClassName:"paused",condition_parameter:"paused",stateChildClassNames:["fa-pause-circle","fa-play-circle"],actions:["play","pause"]}),this.params["mute-button"]&&e(this,{name:"muted",className:"mute-toggle",innerHtml:'<i class="fa"></i>',initialState:this.muted,stateClassName:"muted",condition_parameter:"muted",stateChildClassNames:["fa-volume-up","fa-volume-mute"],actions:["unmute","mute"]}))}timeToPercentage(t){if(t<=this.params["start-at"])return 0;if(t>=this.duration)return 100;if(t<=0)return 0;t-=this.params["start-at"];const e=this.duration-this.params["start-at"];return s=e,!(i=t)||!s||Number.isNaN(i)||Number.isNaN(s)?0:i/s*100;var i,s}percentageToTime(t){if(!this.duration)return this.params["start-at"]||0;if(t>100)return this.duration;if(t<=0)return this.params["start-at"]||0;const e=this.duration-this.params["start-at"];let i=t*e/100;var s,a;return s=i,i=(a=3)?parseFloat(s.toFixed(a)):parseInt(s),i>e&&(i=e),this.params["start-at"]&&(i+=this.params["start-at"]),i}resize(t){this.params["fit-box"]||d(t||this.playerElement,this.params.resolution_mod,this.params.offset),this.dispatchEvent("video-background-resize")}stylePlayerElement(t){t&&(this.params["inline-styles"]&&(t.style.top="50%",t.style.left="50%",t.style.transform="translateX(-50%) translateY(-50%)",t.style.position="absolute",t.style.opacity=0),this.params["fit-box"]&&(t.style.width="100%",t.style.height="100%"))}buildWrapperHTML(){const t=this.element.parentNode;this.element.classList.add("youtube-background","video-background");const e={height:"100%",width:"100%","z-index":"0",position:"absolute",overflow:"hidden",top:0,left:0,bottom:0,right:0};if(this.params["mute-button"]||(e["pointer-events"]="none"),(this.params["load-background"]||this.params.poster)&&(this.loadBackgroun
1d(this.id),this.params.poster&&(e["background-image"]=`url(${this.params.poster})`),e["background-size"]="cover",e["background-repeat"]="no-repeat",e["background-position"]="center"),this.params["inline-styles"]){for(let t in e)this.element.style[t]=e[t];["absolute","fixed","relative","sticky"].indexOf(t.style.position)||(t.style.position="relative")}if(this.params["play-button"]||this.params["mute-button"]){const e=document.createElement("div");e.className="video-background-controls",e.style.position="absolute",e.style.top="10px",e.style.right="10px",e.style["z-index"]=2,this.controls_element=e,t.appendChild(e)}return this.element}loadBackground(t){this.params["load-background"]&&t&&("youtube"===this.type&&(this.element.style["background-image"]=`url(https://img.youtube.com/vi/${t}/hqdefault.jpg)`),"vimeo"===this.type&&(this.element.style["background-image"]=`url(https://vumbnail.com/${t}.jpg)`))}destroy(){this.playerElement.remove(),this.element.classList.remove("youtube-background","video-background"),this.element.removeAttribute("data-vbg-uid"),this.element.style="",(this.params["play-button"]||this.params["mute-button"])&&this.controls_element.remove(),this.timeUpdateTimer&&clearInterval(this.timeUpdateTimer),this.dispatchEvent("video-background-destroyed")}setDuration(t){this.duration!==t&&(this.params["end-at"]?t>this.params["end-at"]?this.duration=this.params["end-at"]:t<this.params["end-at"]?this.duration=t:t<=0&&(this.duration=this.params["end-at"]):this.duration=t)}setStartAt(t){this.params["start-at"]=t}setEndAt(t){this.params["end-at"]=t,this.duration>t&&(this.duration=t),this.currentTime>t&&this.onVideoEnded()}dispatchEvent(t){this.element.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:this}))}shouldPlay(){return!("ended"===this.currentState&&!this.params.loop)&&(!(!this.params["always-play"]||"playing"===this.currentState)||!(!this.isIntersecting||!this.params.autoplay||"playing"===this.currentState))}mobileLowBatteryAutoplayHack(){if(!this.params["force-on-low-battery"])return;if(!this.is_mobile&&this.params.mobile)return;document.addEventListener("touchstart",function(){!this.initialPlay&&this.params.autoplay&&this.params.muted&&(this.softPlay(),this.isIntersecting||this.params["always-play"]||this.softPause())}.bind(this),{once:!0})}parseProperties(t,e,s,r){let n={};if(t)for(let i in e)n[i]=t.hasOwnProperty(i)?t[i]:e[i];else n=e;if(!s)return n;for(let t in n){let e;if(a(r))for(let i=0;i<r.length;i++){const a=s.getAttribute(r[i]+t);if(a){e=a;break}}else e=s.getAttribute(r+t);null!=e&&(n[t]=i(e))}return n}},m=class extends p{constructor(t,e,i,s,a){super(t,e,i,s,"youtube",a),i&&(this.is_mobile&&!this.params.mobile||(this.injectScript(),this.player=null,this.injectPlayer(),this.STATES={"-1":"notstarted",0:"ended",1:"playing",2:"paused",3:"buffering",5:"cued"},this.timeUpdateTimer=null,this.timeUpdateInterval=250,this.initYTPlayer()))}startTimeUpdateTimer(){this.timeUpdateTimer||(this.timeUpdateTimer=setInterval(this.onVideoTimeUpdate.bind(this),this.timeUpdateInterval))}stopTimeUpdateTimer(){clearInterval(this.timeUpdateTimer),this.timeUpdateTimer=null}convertState(t){return this.STATES[t]}initYTPlayer(){window.hasOwnProperty("YT")&&null===this.player&&(this.player=new YT.Player(this.uid,{events:{onReady:this.onVideoPlayerReady.bind(this),onStateChange:this.onVideoStateChange.bind(this)}}),1===this.volume||this.muted||this.setVolume(this.volume))}onVideoError(t){console.error(t)}injectScript(){const t="https://www.youtube.com/player_api";if(window.hasOwnProperty("YT")||document.querySelector(`script[src="${t}"]`))return;const e=document.createElement("script");e.async=!0,e.src=t;const i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(e,i)}generatePlayerElement(){const t=document.createElement("iframe");return this.params.title&&t.setAttribute("title",this.params.title),t.setAttribute("frameborder",0),t.setAttribute("allow","autoplay; mute"),this.params.lazyloading&&t.setAttribute("loading","lazy"),t}generateSrcURL(t){let e="https://www.youtube.com/embed/";this.params["no-cookie"]&&(e="https://www.youtube-nocookie.com/embed/");let i=`${e}${t}?&enablejsapi=1&disablekb=1&controls=0&rel=0&iv_load_policy=3&cc_load_policy=0&playsinline=1&showinfo=0&modestbranding=1&fs=0`;return this.params.muted&&(i+="&mute=1"),this.params.autoplay&&(this.params["always-play"]||this.isIntersecting)&&(i+="&autoplay=1"),this.params.loop&&(i+="&loop=1"),i}injectPlayer(){this.playerElement=this.generatePlayerElement(),this.src=this.generateSrcURL(this.id),this.playerElement.src=this.src,this.playerElement.id=this.uid,this.stylePlayerElement(this.playerElement),this.element.appendChild(this.playerElement),this.resize(this.playerElement)}setSource(t){const e=t.match(n);e&&e.length&&(this.id=e[1],this.src=this.generateSrcURL(this.id),this.playerElement.src=this.src,this.element.hasAttribute("data-vbg")&&this.element.setAttribute("data-vbg",this.src
1),this.element.hasAttribute("data-ytbg")&&this.element.setAttribute("data-ytbg",this.src),this.loadBackground(this.id))}onVideoTimeUpdate(){const t=this.player.getCurrentTime();if(t!==this.currentTime){if(this.currentTime=t,this.percentComplete=this.timeToPercentage(this.currentTime),this.params["end-at"]&&this.duration&&this.currentTime>=this.duration)return this.currentState="ended",this.dispatchEvent("video-background-state-change"),this.onVideoEnded(),void this.stopTimeUpdateTimer();this.dispatchEvent("video-background-time-update")}}onVideoPlayerReady(){this.mobileLowBatteryAutoplayHack(),this.params.autoplay&&(this.params["always-play"]||this.isIntersecting)&&(this.params["start-at"]&&this.seekTo(this.params["start-at"]),this.player.playVideo()),this.setDuration(this.player.getDuration()),this.dispatchEvent("video-background-ready")}onVideoStateChange(t){this.currentState=this.convertState(t.data),"ended"===this.currentState&&this.onVideoEnded(),"notstarted"===this.currentState&&this.params.autoplay&&(this.seekTo(this.params["start-at"]),this.player.playVideo()),"playing"===this.currentState&&this.onVideoPlay(),"paused"===this.currentState&&this.onVideoPause(),this.dispatchEvent("video-background-state-change")}onVideoPlay(){this.initialPlay||(this.initialPlay=!0,this.playerElement.style.opacity=1);const t=this.player.getCurrentTime();this.params["start-at"]&&t<this.params["start-at"]&&this.seekTo(this.params["start-at"]),this.duration&&t>=this.duration&&this.seekTo(this.params["start-at"]),this.duration||this.setDuration(this.player.getDuration()),this.dispatchEvent("video-background-play"),this.startTimeUpdateTimer()}onVideoPause(){this.stopTimeUpdateTimer(),this.dispatchEvent("video-background-pause")}onVideoEnded(){if(this.dispatchEvent("video-background-ended"),!this.params.loop)return this.pause();this.seekTo(this.params["start-at"]),this.player.playVideo()}seek(t){this.seekTo(this.percentageToTime(t),!0)}seekTo(t,e=!0){this.player&&(this.player.seekTo(t,e),this.dispatchEvent("video-background-seeked"))}softPause(){this.player&&"paused"!==this.currentState&&(this.stopTimeUpdateTimer(),this.player.pauseVideo())}softPlay(){this.player&&"playing"!==this.currentState&&this.player.playVideo()}play(){this.player&&(this.paused=!1,this.player.playVideo())}pause(){this.player&&(this.paused=!0,this.stopTimeUpdateTimer(),this.player.pauseVideo())}unmute(){this.player&&(this.muted=!1,this.initialVolume||(this.initialVolume=!0,this.setVolume(this.params.volume)),this.player.unMute(),this.dispatchEvent("video-background-unmute"))}mute(){this.player&&(this.muted=!0,this.player.mute(),this.dispatchEvent("video-background-mute"))}getVolume(){if(this.player)return this.player.getVolume()/100}setVolume(t){this.player&&(this.volume=t,this.player.setVolume(100*t),this.dispatchEvent("video-background-volume-change"))}},c=class extends p{constructor(t,e,i,s,a){super(t,e,i.id,s,"vimeo",a),i&&(this.unlisted=i.unlisted,this.is_mobile&&!this.params.mobile||(this.injectScript(),this.player=null,this.injectPlayer(),this.initVimeoPlayer()))}injectScript(){const t="https://player.vimeo.com/api/player.js";if(window.hasOwnProperty("Vimeo")||document.querySelector(`script[src="${t}"]`))return;const e=document.createElement("script");e.async=!0,window.hasOwnProperty("onVimeoIframeAPIReady")&&"function"==typeof window.onVimeoIframeAPIReady&&e.addEventListener("load",()=>{window.onVimeoIframeAPIReady()}),e.src=t;const i=document.getElementsByTagName("script")[0];i.parentNode.insertBefore(e,i)}initVimeoPlayer(){window.hasOwnProperty("Vimeo")&&null===this.player&&(this.player=new Vimeo.Player(this.playerElement),this.player.on("loaded",this.onVideoPlayerReady.bind(this)),this.player.on("ended",this.onVideoEnded.bind(this)),this.player.on("play",this.onVideoPlay.bind(this)),this.player.on("pause",this.onVideoPause.bind(this)),this.player.on("bufferstart",this.onVideoBuffering.bind(this)),this.player.on("timeupdate",this.onVideoTimeUpdate.bind(this)),1===this.volume||this.muted||this.setVolume(this.volume))}onVideoError(t){console.error(t)}generatePlayerElement(){const t=document.createElement("iframe");return this.params.title&&t.setAttribute("title",this.params.title),t.setAttribute("frameborder",0),t.setAttribute("allow","autoplay; mute"),this.params.lazyloading&&t.setAttribute("loading","lazy"),t}generateSrcURL(t,e){let i=`https://player.vimeo.com/video/${t}?${e=e?`h=${e}&`:""}background=1&controls=0`;return this.params.muted&&(i+="&muted=1"),this.params.autoplay&&(this.params["always-play"]||this.isIntersecting)&&(i+="&autoplay=1"),this.params.loop&&(i+="&loop=1&auto
1pause=0"),this.params["no-cookie"]&&(i+="&dnt=1"),this.params["start-at"]&&(i+="#t="+this.params["start-at"]+"s"),i}injectPlayer(){this.playerElement=this.generatePlayerElement(),this.src=this.generateSrcURL(this.id,this.unlisted),this.playerElement.src=this.src,this.playerElement.id=this.uid,this.stylePlayerElement(this.playerElement),this.element.appendChild(this.playerElement),this.resize(this.playerElement)}updateState(t){this.currentState=t,this.dispatchEvent("video-background-state-change")}setSource(t){const e=t.match(o);e&&e.length&&(this.id=e[1],this.src=this.generateSrcURL(this.id),this.playerElement.src=this.src,this.element.hasAttribute("data-vbg")&&this.element.setAttribute("data-vbg",this.src),this.element.hasAttribute("data-ytbg")&&this.element.setAttribute("data-ytbg",this.src),this.loadBackground(this.id))}onVideoPlayerReady(){this.mobileLowBatteryAutoplayHack(),this.params["start-at"]&&this.seekTo(this.params["start-at"]),this.params.autoplay&&(this.params["always-play"]||this.isIntersecting)&&this.player.play(),this.player.getDuration().then(t=>{this.setDuration(t)}),this.dispatchEvent("video-background-ready")}onVideoEnded(){if(this.updateState("ended"),this.dispatchEvent("video-background-ended"),!this.params.loop)return this.pause();this.seekTo(this.params["start-at"]),this.updateState("playing"),this.dispatchEvent("video-background-play")}onVideoTimeUpdate(t){this.currentTime=t.seconds,this.percentComplete=this.timeToPercentage(t.seconds),this.dispatchEvent("video-background-time-update"),this.setDuration(t.duration),this.params["end-at"]&&this.duration&&t.seconds>=this.duration&&this.onVideoEnded()}onVideoBuffering(){this.updateState("buffering")}onVideoPlay(t){if(this.setDuration(t.duration),!this.initialPlay&&(this.initialPlay=!0,this.playerElement.style.opacity=1,this.player.setLoop(this.params.loop),!this.params.autoplay||!this.params["always-play"]&&!this.isIntersecting))return this.player.pause();const e=t.seconds;this.params["start-at"]&&e<this.params["start-at"]&&this.seekTo(this.params["start-at"]),this.duration&&e>=this.duration&&this.seekTo(this.params["start-at"]),this.updateState("playing"),this.dispatchEvent("video-background-play")}onVideoPause(){this.updateState("paused"),this.dispatchEvent("video-background-pause")}seek(t){this.seekTo(this.percentageToTime(t))}seekTo(t){this.player&&(this.player.setCurrentTime(t),this.dispatchEvent("video-background-seeked"))}softPause(){this.player&&"paused"!==this.currentState&&this.player.pause()}softPlay(){this.player&&"playing"!==this.currentState&&this.player.play()}play(){this.player&&(this.paused=!1,this.player.play())}pause(){this.player&&(this.paused=!0,this.player.pause())}unmute(){this.player&&(this.muted=!1,this.initialVolume||(this.initialVolume=!0,this.setVolume(this.params.volume)),this.player.setMuted(!1),this.dispatchEvent("video-background-unmute"))}mute(){this.player&&(this.muted=!0,this.player.setMuted(!0),this.dispatchEvent("video-background-mute"))}getVolume(){if(this.player)return this.player.getVolume()}setVolume(t){this.player&&(this.volume=t,this.player.setVolume(t),this.dispatchEvent("video-background-volume-change"))}},y=class extends p{constructor(t,e,i,s,a){super(t,e,i.link,s,"video",a),i&&i.link&&(this.is_mobile&&!this.params.mobile||(this.src=i.link,this.ext=/(?:\.([^.]+))?$/.exec(i.id)[1],this.uid=s,this.element.setAttribute("data-vbg-uid",s),this.player=null,this.buttons={},this.MIME_MAP={ogv:"video/ogg",ogm:"video/ogg",ogg:"video/ogg",avi:"video/avi",mp4:"video/mp4",webm:"video/webm",m4v:"video/x-m4v",mov:"video/quicktime",qt:"video/quicktime"},this.mime=this.MIME_MAP[this.ext.toLowerCase()],this.injectPlayer(),this.mobileLowBatteryAutoplayHack(),this.dispatchEvent("video-background-ready")))}generatePlayerElement(){const t=document.createElement("video");return this.params.title&&t.setAttribute("title",this.params.title),t.setAttribute("playsinline",""),this.params.loop&&t.setAttribute("loop",""),this.params.autoplay&&(this.params["always-play"]||this.isIntersecting)&&(t.setAttribute("autoplay",""),t.autoplay=!0),this.muted&&(t.setAttribute("muted",""),t.muted=!0),this.params.lazyloading&&t.setAttribute("loading","lazy"),t}injectPlayer(){this.player=this.generatePlayerElement(),this.playerElement=this.player,1===this.volume||this.muted||this.setVolume(this.volume),this.playerElement.setAttribute("id",this.uid),this.stylePlayerElement(this.playerElement),this.player.addEventListener("loadedmetadata",this.onVideoLoadedMetadata.bind(this)),this.player.addEventListener("durationchange",this.onVideoLoadedMetadata.bind(this)),this.player.addEventListener("canplay",this.onVideoCanPlay.bind(this)),this.player.addEventListener("timeupdate",this.onVideoTimeUpdate.bind(this)),this.player.addEventListener("play",this.onVideoPlay.bind(this)),this.player.addEventListener("pause",this.onVideoPause.bind(this)),this.player.addEventListener("waiting",this.onVideoBuffering.bind(this)),this.player.addEventListener("ended",this.onVideoEnded.bind(this)),this.element.appendChild(this.playerElement);const t=document.createElement("source");
1t.setAttribute("src",this.src),t.setAttribute("type",this.mime),this.playerElement.appendChild(t),this.resize(this.playerElement)}updateState(t){this.currentState=t,this.dispatchEvent("video-background-state-change")}setSource(t){const e=t.match(h);if(!e||!e.length)return;this.id=e[1],this.ext=/(?:\.([^.]+))?$/.exec(this.id)[1],this.mime=this.MIME_MAP[this.ext.toLowerCase()],this.playerElement.innerHTML="";const i=document.createElement("source");i.setAttribute("src",t),i.setAttribute("type",this.mime),this.playerElement.appendChild(i),this.src=t,this.element.hasAttribute("data-vbg")&&this.element.setAttribute("data-vbg",this.src),this.element.hasAttribute("data-ytbg")&&this.element.setAttribute("data-ytbg",this.src)}onVideoLoadedMetadata(){this.setDuration(this.player.duration)}onVideoCanPlay(){this.setDuration(this.player.duration)}onVideoTimeUpdate(){this.currentTime=this.player.currentTime,this.percentComplete=this.timeToPercentage(this.player.currentTime),this.dispatchEvent("video-background-time-update"),this.params["end-at"]&&this.currentTime>=this.duration&&this.onVideoEnded()}onVideoPlay(){this.initialPlay||(this.initialPlay=!0,this.playerElement.style.opacity=1);const t=this.player.currentTime;this.params["start-at"]&&t<=this.params["start-at"]&&this.seekTo(this.params["start-at"]),this.duration&&t>=this.duration&&this.seekTo(this.params["start-at"]),this.updateState("playing"),this.dispatchEvent("video-background-play")}onVideoPause(){this.updateState("paused"),this.dispatchEvent("video-background-pause")}onVideoEnded(){if(this.updateState("ended"),this.dispatchEvent("video-background-ended"),!this.params.loop)return this.pause();this.seekTo(this.params["start-at"]),this.onVideoPlay()}onVideoBuffering(){this.updateState("buffering")}seek(t){this.seekTo(this.percentageToTime(t))}seekTo(t){this.player&&(this.player.hasOwnProperty("fastSeek")?this.player.fastSeek(t):(this.player.currentTime=t,this.dispatchEvent("video-background-seeked")))}softPause(){this.player&&"paused"!==this.currentState&&this.player.pause()}softPlay(){this.player&&"playing"!==this.currentState&&this.player.play()}play(){this.player&&(this.paused=!1,this.player.play())}pause(){this.player&&(this.paused=!0,this.player.pause())}unmute(){this.player&&(this.muted=!1,this.player.muted=!1,this.initialVolume||(this.initialVolume=!0,this.setVolume(this.params.volume)),this.dispatchEvent("video-background-unmute"))}mute(){this.player&&(this.muted=!0,this.player.muted=!0,this.dispatchEvent("video-background-mute"))}getVolume(){if(this.player)return this.player.volume}setVolume(t){this.player&&(this.volume=t,this.player.volume=t,this.dispatchEvent("video-background-volume-change"))}},b=class{constructor(t,e){this.elements=t,this.elements instanceof Element&&(this.elements=[this.elements]),"string"==typeof this.elements&&(this.elements=document.querySelectorAll(t)),this.index={};const i=this;if(this.intersectionObserver=null,"IntersectionObserver"in window&&(this.intersectionObserver=new IntersectionObserver(function(t){t.forEach(function(t){const e=t.target.getAttribute("data-vbg-uid");if(e&&i.index.hasOwnProperty(e)&&t.isIntersecting){i.index[e].isIntersecting=!0;try{i.index[e].player&&!i.index[e].paused&&i.index[e].softPlay()}catch(t){}}else{i.index[e].isIntersecting=!1;try{i.index[e].player&&i.index[e].softPause()}catch(t){}}})})),this.resizeObserver=null,"ResizeObserver"in window?this.resizeObserver=new ResizeObserver(function(t){t.forEach(function(t){const e=t.target.getAttribute("data-vbg-uid");e&&i.index.hasOwnProperty(e)&&window.requestAnimationFrame(()=>i.index[e].resize())})}):window.addEventListener("resize",function(){for(let t in i.index)window.requestAnimationFrame(()=>i.index[t].resize(i.index[t].playerElement))}),this.initPlayers(),this.elements&&this.elements.length){for(let t=0;t<this.elements.length;t++){const i=this.elements[t];this.add(i,e)}document.addEventListener("visibilitychange",this.onVisibilityChange.bind(this))}}onVisibilityChange(){if(!document.hidden)for(let t in this.index){const e=this.index[t];e.shouldPlay()&&e.softPlay()}}
1add(t,e){if(!t)return;if(t.hasAttribute("data-vbg-uid"))return;this.intersectionObserver||(e||(e={}),e["always-play"]=!0);const i=t.getAttribute("data-youtube")||t.getAttribute("data-vbg"),s=this.getVidID(i);if(!s)return;const a=this.generateUID(s.id);if(a){switch(s.type){case"YOUTUBE":const i=new m(t,e,s.id,a,this);this.index[a]=i;break;case"VIMEO":const r=new c(t,e,s,a,this);this.index[a]=r;break;case"VIDEO":const n=new y(t,e,s,a,this);this.index[a]=n}this.resizeObserver&&this.resizeObserver.observe(t),!this.index[a].params["always-play"]&&this.intersectionObserver&&this.intersectionObserver.observe(t)}}destroy(t){const e=t.uid||t.getAttribute("data-vbg-uid");e&&this.index.hasOwnProperty(e)&&(!this.index[e].params["always-play"]&&this.intersectionObserver&&this.intersectionObserver.unobserve(t),this.resizeObserver&&this.resizeObserver.unobserve(t),this.index[e].destroy(),delete this.index[e])}destroyAll(){for(let t in this.index)this.destroy(this.index[t].playerElement)}getVidID(t){if(void 0!==t||null!==t){this.re={},this.re.YOUTUBE=n,this.re.VIMEO=o,this.re.VIDEO=h;for(let e in this.re){const i=t.match(this.re[e]);if(i&&i.length){this.re[e].lastIndex=0;const s={id:i[1],type:e,regex_pts:i,link:t};if("VIMEO"===e){const e=/(\?|&)h=([^=&#?]+)/,i=/\/[^\/\:\.]+(\:|\/)([^:?\/]+)\s?$/,a=t.match(i)||t.match(e);a&&(s.unlisted=a[2])}return s}}}}generateUID(t){let e=(t="vbg-"+(t=(t=(t=t.replace(/[^a-zA-Z0-9\-_]/g,"-")).replace(/-{2,}/g,"-")).replace(/^-+/,"").replace(/-+$/,"")))+"-"+r(0,9999);for(;this.index.hasOwnProperty(e);)e=t+"-"+r(0,9999);return e}get(t){const e="string"==typeof t?t:t.getAttribute("data-vbg-uid");if(e&&this.index.hasOwnProperty(e))return this.index[e]}pauseAll(){for(let t in this.index)this.index[t].pause()}playAll(){for(let t in this.index)this.index[t].play()}muteAll(){for(let t in this.index)this.index[t].mute()}unmuteAll(){for(let t in this.index)this.index[t].unmute()}setVolumeAll(t){for(let e in this.index)this.index[e].setVolume(t)}initPlayers(t){const e=this;window.onYouTubeIframeAPIReady=function(){for(let t in e.index)e.index[t]instanceof m&&e.index[t].initYTPlayer();t&&setTimeout(t,100)},window.hasOwnProperty("YT")&&window.YT.loaded&&window.onYouTubeIframeAPIReady(),window.onVimeoIframeAPIReady=function(){for(let t in e.index)e.index[t]instanceof c&&e.index[t].initVimeoPlayer();t&&setTimeout(t,100)},window.hasOwnProperty("Vimeo")&&window.Vimeo.hasOwnProperty("Player")&&window.onVimeoIframeAPIReady()}};"function"==typeof s&&((u=s).fn.youtube_background=function(t){const e=u(this);return window.hasOwnProperty("VIDEO_BACKGROUNDS")?(window.VIDEO_BACKGROUNDS.add(e,t),e):(window.VIDEO_BACKGROUNDS=new b(this,t),e)}),window.VideoBackgrounds=b})()}}]);
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.