// source --> https://www.lebens-retter.org/wp-content/plugins/advanced-backgrounds/assets/vendor/jarallax/dist/jarallax.min.js?ver=3.0.0 
/*!
 * Jarallax v3.0.0 (https://github.com/nk-o/jarallax)
 * Copyright 2026 nK <https://nkdev.info>
 * Licensed under MIT (https://github.com/nk-o/jarallax/blob/master/LICENSE)
 */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).jarallax=e()}(this,(function(){"use strict";function t(t){"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?t():document.addEventListener("DOMContentLoaded",t,{capture:!0,once:!0,passive:!0}))}let e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var i=e;const n={type:"scroll",speed:.5,containerClass:"jarallax-container",imgSrc:null,imgElement:".jarallax-img",imgSize:"cover",imgPosition:"50% 50%",imgRepeat:"no-repeat",keepImg:!1,elementInViewport:null,zIndex:-100,disableParallax:!1,onScroll:null,onInit:null,onDestroy:null,onCoverImage:null,videoClass:"jarallax-video",videoSrc:null,videoStartTime:0,videoEndTime:0,videoVolume:0,videoLoop:!0,videoPlayOnlyVisible:!0,videoLazyLoading:!0,disableVideo:!1,onVideoInsert:null,onVideoWorkerInit:null};const o=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(i.navigator?.userAgent??"");let s=0,a=0,r=null;function l(){return"undefined"!=typeof document&&void 0!==document.documentElement}function h(){if(!l())return s=i.innerWidth||0,void(a=i.innerHeight||0);s=i.innerWidth||document.documentElement.clientWidth,a=o?l()?(!r&&document.body&&(r=document.createElement("div"),r.style.cssText="position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;",document.body.appendChild(r)),(r?r.clientHeight:0)||i.innerHeight||document.documentElement.clientHeight):i.innerHeight||0:i.innerHeight||document.documentElement.clientHeight}function c(){return{width:s,height:a}}h(),i.addEventListener?.("resize",h),i.addEventListener?.("orientationchange",h),i.addEventListener?.("load",h),t((()=>{h()}));const m=[];function d(){if(!m.length)return;const{width:t,height:e}=c();m.forEach(((i,n)=>{const{instance:o,oldData:s}=i;if(!o.isVisible())return;const a=o.$item.getBoundingClientRect(),r={width:a.width,height:a.height,top:a.top,bottom:a.bottom,wndW:t,wndH:e},l=!s||s.wndW!==r.wndW||s.wndH!==r.wndH||s.width!==r.width||s.height!==r.height,h=l||!s||s.top!==r.top||s.bottom!==r.bottom;m[n].oldData=r,l&&o.onResize(),h&&o.onScroll()})),i.requestAnimationFrame(d)}const p=i.IntersectionObserver&&new i.IntersectionObserver((t=>{t.forEach((t=>{const e=t.target;e.jarallax&&(e.jarallax.isElementInViewport=t.isIntersecting)}))}),{rootMargin:"50px"});const g=i.navigator??{userAgent:""},u="undefined"!=typeof document&&"undefined"!=typeof Element&&"undefined"!=typeof HTMLElement;let f=0;function y(t){if("string"==typeof t){const e=t.match(/^\/(.*)\/([dgimsuvy]*)$/);t=e?new RegExp(e[1],e[2]):new RegExp(t)}if(t instanceof RegExp){const e=t;return()=>e.test(g.userAgent)}return"function"!=typeof t?()=>!0===t:t}class b{constructor(t,e){this.parallaxScrollDistance=0,this.isElementInViewport=!1,this.instanceID=f,f+=1,this.$item=t,this.defaults={...n};const i=this.$item.dataset||{},o={};Object.keys(i).forEach((t=>{const e=t.slice(0,1).toLowerCase()+t.slice(1);e&&void 0!==this.defaults[e]&&(o[e]=i[t])})),this.options=this.extend({},this.defaults,o,e||{}),this.pureOptions=this.extend({},this.options),Object.keys(this.options).forEach((t=>{const e=t,i=this.options[e];"true"===i?this.options[t]=!0:"false"===i&&(this.options[t]=!1)})),this.options.speed=Math.min(2,Math.max(-1,parseFloat(`${this.options.speed}`))),this.options.disableParallax=y(e?.disableParallax??this.options.disableParallax),this.options.disableVideo=y(e?.disableVideo??this.options.disableVideo);let s=this.options.elementInViewport;!s||"object"!=typeof s||!("length"in s)||s instanceof Element||([s]=Array.from(s)),s instanceof Element||(s=null),this.options.elementInViewport=s,this.image={src:this.options.imgSrc||null,$container:null,useImgTag:!1,position:"fixed"},this.initImg()&&this.canInitParallax()&&this.init()}css(t,e){return function(t,e){return"string"==typeof e?i.getComputedStyle(t).getPropertyValue(e):(Object.keys(e).forEach((i=>{t.style[i]=e[i]})),t)}(t,e)}extend(t,...e){return function(t,...e){const i=t||{};return Object.keys(e).forEach((t=>{const n=e[Number(t)];n&&Object.keys(n).forEach((t=>{i[t]=n[t]}))})),i}(t,...e)}getWindowData(){const{width:t,height:e}=c();return{width:t,height:e,y:u?document.documentElement.scrollTop:0}}initImg(){let t=this.options.imgElement;if(t&&"string"==typeof t&&(t=this.$item.querySelector(t)),!(t instanceof Element))if(this.options.imgSrc){const e=new Image;e.src=this.options.imgSrc,t=e}else t=null;return t&&(this.options.keepImg?this.image.$item=t.cloneNode(!0):(this.image.$item=t,this.image.$itemParent=t.parentNode),this.image.useImgTag=!0),!!this.image.$item||(null===this.image.src&&(this.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",this.image.bgImage=this.css(this.$item,"background-image")),Boolean(this.image.bgImage&&"none"!==this.image.bgImage))}canInitParallax(){return!this.options.disableParallax()}init(){const t={position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden"};let e={pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden"};if(!this.options.keepImg){const t=this.$item.getAttribute("style");if(t&&this.$item.setAttribute("data-jarallax-original-styles",t),this.image.useImgTag&&this.image.$item){const t=this.image.$item.getAttribute("style");t&&this.image.$item.setAttribute("data-jarallax-original-styles",t)}}if("static"===this.css(this.$item,"position")&&this.css(this.$item,{position:"relative"}),"auto"===this.css(this.$item,"z-index")&&this.css(this.$item,{zIndex:0}),this.image.$container=document.createElement("div"),this.css(this.image.$container,t),this.css(this.image.$container,{zIndex:this.options.zIndex}),"fixed"===this.image.position&&this.css(this.image.$container,{WebkitClipPath:"polygon(0 0, 100% 0, 100% 100%, 0 100%)",clipPath:"polygon(0 0, 100% 0, 100% 100%, 0 100%)"}),this.image.$container.setAttribute("id",`jarallax-container-${this.instanceID}`),this.options.containerClass&&this.image.$container.setAttribute("class",this.options.containerClass),this.$item.appendChild(this.image.$container),this.image.useImgTag&&this.image.$item?e=this.extend({objectFit:this.options.imgSize,objectPosition:this.options.imgPosition,maxWidth:"none"},t,e):(this.image.$item=document.createElement("div"),this.image.src&&(e=this.extend({backgroundPosition:this.options.imgPosition,backgroundSize:this.options.imgSize,backgroundRepeat:this.options.imgRepeat,backgroundImage:this.image.bgImage||`url("${this.image.src}")`},t,e))),"opacity"!==this.options.type&&"scale"!==this.options.type&&"scale-opacity"!==this.options.type&&1!==this.options.speed||(this.image.position="absolute"),"fixed"===this.image.position){const t=function(t){const e=[];let i=t;for(;null!==i.parentElement;)i=i.parentElement,1===i.nodeType&&e.push(i);return e}(this.$item).filter((t=>{const e=i.getComputedStyle(t),n=e.getPropertyValue("-webkit-transform")||e.getPropertyValue("-moz-transform")||e.transform;return n&&"none"!==n||/(auto|scroll)/.test(e.overflow+e.overflowY+e.overflowX)}));this.image.position=t.length?"absolute":"fixed"}var n;e.position=this.image.position,this.css(this.image.$item,e),this.image.$container.appendChild(this.image.$item),this.onResize(),this.onScroll(!0),this.options.onInit?.call(this),"none"!==this.css(this.$item,"background-image")&&this.css(this.$item,{backgroundImage:"none"}),n=this,m.push({instance:n}),1===m.length&&i.requestAnimationFrame(d),p?.observe(n.options.elementInViewport||n.$item)}destroy(){var t;t=this,m.forEach(((e,i)=>{e.instance.instanceID===t.instanceID&&m.splice(i,1)})),p?.unobserve(t.options.elementInViewport||t.$item);const e=this.$item.getAttribute("data-jarallax-original-styles");if(this.$item.removeAttribute("data-jarallax-original-styles"),e?this.$item.setAttribute("style",e):this.$item.removeAttribute("style"),this.image.useImgTag&&this.image.$item){const t=this.image.$item.getAttribute("data-jarallax-original-styles");this.image.$item.removeAttribute("data-jarallax-original-styles"),t?this.image.$item.setAttribute("style",t):this.image.$item.removeAttribute("style"),this.image.$itemParent?.appendChild(this.image.$item)}this.image.$container?.parentNode&&this.image.$container.parentNode.removeChild(this.image.$container),this.options.onDestroy?.call(this),delete this.$item.jarallax}coverImage(){const{height:t}=c(),e=this.image.$container.getBoundingClientRect(),i=e.height,{speed:n}=this.options,o="scroll"===this.options.type||"scroll-opacity"===this.options.type;let s=0,a=i;o&&(n<0?(s=n*Math.max(i,t),t<i&&(s-=n*(i-t))):s=n*(i+t),n>1?a=Math.abs(s-t):n<0?a=s/n+Math.abs(s):a+=(t-i)*(1-n),s/=2),this.parallaxScrollDistance=s;const r=(o?t-a:i-a)/2;return this.css(this.image.$item,{height:`${a}px`,marginTop:`${r}px`,left:"fixed"===this.image.position?`${e.left}px`:"0",width:`${e.width}px`}),this.options.onCoverImage?.call(this),{image:{height:a,marginTop:r},container:e}}isVisible(){return this.isElementInViewport||!1}onScroll(t){if(!t&&!this.isVisible())return;const{height:e}=c(),i=this.$item.getBoundingClientRect(),n=i.top,o=i.height,s={},a=Math.max(0,n),r=Math.max(0,o+n),l=Math.max(0,-n),h=Math.max(0,n+o-e),m=Math.max(0,o-(n+o-e)),d=Math.max(0,-n+e-o),p=1-(e-n)/(e+o)*2;let g=1;if(o<e?g=1-(l||h)/o:r<=e?g=r/e:m<=e&&(g=m/e),"opacity"!==this.options.type&&"scale-opacity"!==this.options.type&&"scroll-opacity"!==this.options.type||(s.transform="translate3d(0,0,0)",s.opacity=g),"scale"===this.options.type||"scale-opacity"===this.options.type){let t=1;this.options.speed<0?t-=this.options.speed*g:t+=this.options.speed*(1-g),s.transform=`scale(${t}) translate3d(0,0,0)`}if("scroll"===this.options.type||"scroll-opacity"===this.options.type){let t=this.parallaxScrollDistance*p;"absolute"===this.image.position&&(t-=n),s.transform=`translate3d(0,${t}px,0)`}this.css(this.image.$item,s),this.options.onScroll?.call(this,{section:i,beforeTop:a,beforeTopEnd:r,afterTop:l,beforeBottom:h,beforeBottomEnd:m,afterBottom:d,visiblePercent:g,fromViewportCenter:p})}onResize(){this.coverImage()}}const x=function(t,e,...i){let n,o=t;if(!t)return t;if(("object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&1===t.nodeType&&"string"==typeof t.nodeName)&&(o=[t]),!o||"object"!=typeof o||"number"!=typeof o.length)return o;if(!u)return"string"==typeof e?void 0:o;for(let t=0;t<o.length;t+=1){const s=o[t];if("object"==typeof e||void 0===e?s.jarallax||(s.jarallax=new b(s,e)):s.jarallax&&(n=s.jarallax[e].apply(s.jarallax,i)),void 0!==n)return n}return o};x.constructor=b;const $=i.jQuery;if(void 0!==$){const t=function(...t){Array.prototype.unshift.call(t,this);const e=x.apply(i,t);return"object"!=typeof e?e:this};t.constructor=x.constructor;const e=$.fn.jarallax;$.fn.jarallax=t,t.noConflict=function(){return $.fn.jarallax=e,this}}return t((()=>{x(document.querySelectorAll("[data-jarallax]"))})),x}));//# sourceMappingURL=jarallax.min.js.map;
// source --> https://www.lebens-retter.org/wp-content/plugins/advanced-backgrounds/assets/vendor/jarallax/dist/jarallax-video.min.js?ver=3.0.0 
/*!
 * Video Extension for Jarallax v3.0.0 (https://github.com/nk-o/jarallax)
 * Copyright 2026 nK <https://nkdev.info>
 * Licensed under MIT (https://github.com/nk-o/jarallax/blob/master/LICENSE)
 */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).jarallaxVideo=t()}(this,(function(){"use strict";
/*!
 * Video Worker v3.0.0 (https://github.com/nk-o/video-worker)
 * Copyright 2026 nK <https://nkdev.info>
 * Licensed under MIT (https://github.com/nk-o/video-worker/blob/master/LICENSE)
 */const e={autoplay:!1,loop:!1,mute:!1,volume:100,showControls:!0,accessibilityHidden:!1,startTime:0,endTime:0};let t,i=0;class s{constructor(t,i){this.type="none",this.destroyed=!1,this.url=t,this.options_default={...e},this.options=function(e,...t){const i=e||{};return Object.keys(t).forEach((e=>{const s=t[Number(e)];s&&Object.keys(s).forEach((e=>{const t=e,o=s[t];void 0!==o&&(i[t]=o)}))})),i}({...this.options_default},i),this.videoID=this.constructor.parseURL(t),this.videoID&&this.init()}isValid(){return!!this.videoID}init(){this.ID=i,i+=1,this.playerID=`VideoWorker-${this.ID}`}on(e,t){this.userEventsList=this.userEventsList||{},this.userEventsList[e]||(this.userEventsList[e]=[]),this.userEventsList[e].push(t)}off(e,t){this.userEventsList&&this.userEventsList[e]&&(t?this.userEventsList[e].forEach(((i,s)=>{var o;if(i===t){const t=null==(o=this.userEventsList)?void 0:o[e];t&&(t[s]=!1)}})):delete this.userEventsList[e])}fire(e,...t){this.userEventsList&&void 0!==this.userEventsList[e]&&this.userEventsList[e].forEach((e=>{e&&e.apply(this,t)}))}static parseURL(e){return!1}play(e){}pause(){}mute(){}unmute(){}setVolume(e=!1){}getVolume(e){}getMuted(e){}setCurrentTime(e=!1){}getCurrentTime(e){}getImageURL(e){}getVideo(e){}destroy(){var e,t;this.destroyed=!0,this.userEventsList=void 0,(null==(e=this.$video)?void 0:e.parentNode)&&this.$video.parentNode.removeChild(this.$video),(null==(t=this.hiddenContainer)?void 0:t.parentNode)&&this.hiddenContainer.parentNode.removeChild(this.hiddenContainer),this.player=void 0,this.$video=void 0,this.hiddenContainer=void 0}}class o{constructor(){this.doneCallbacks=[],this.failCallbacks=[]}execute(e,t){let i=e.length;for(;i;)i-=1,e[i](...t)}resolve(...e){this.execute(this.doneCallbacks,e)}reject(...e){this.execute(this.failCallbacks,e)}done(e){this.doneCallbacks.push(e)}fail(e){this.failCallbacks.push(e)}}t="undefined"!=typeof window?window:"undefined"!=typeof self?self:globalThis;var r=t;let a=0,n=0;const h=new o,l=r;let d=0,p=0;const u=new o,m=r;const v=function(e,t){let i=!1;return Object.keys(v.providers).forEach((s=>{!i&&v.providers[s].parseURL(e)&&(i=new v.providers[s](e,t))})),i||new s(e,t)};let y;v.BaseClass=s,v.providers={Youtube:class extends s{constructor(){super(...arguments),this.type="youtube"}static parseURL(e){const t=e.match(/.*(?:youtu.be\/|v\/|u\/\w\/|embed\/|shorts\/|watch\?v=)([^#&?]*).*/);return!(!t||11!==t[1].length)&&t[1]}init(){super.init(),function(){if(d)return;d=1;let e=document.createElement("script"),t=document.getElementsByTagName("head")[0]||null;t&&e&&(e.src="https://www.youtube.com/iframe_api",t.appendChild(e),t=null,e=null)}()}play(e){this.player&&this.player.playVideo&&m.YT&&(void 0!==e&&this.player.seekTo(e||0),m.YT.PlayerState.PLAYING!==this.player.getPlayerState()&&(this.options.endTime&&!this.options.loop?this.getCurrentTime((e=>{var t;e<this.options.endTime&&(null==(t=this.player)||t.playVideo())})):this.player.playVideo()))}pause(){this.player&&this.player.pauseVideo&&m.YT&&m.YT.PlayerState.PLAYING===this.player.getPlayerState()&&this.player.pauseVideo()}mute(){this.player&&this.player.mute&&this.player.mute()}unmute(){this.player&&this.player.unMute&&this.player.unMute()}setVolume(e=!1){this.player&&"number"==typeof e&&this.player.setVolume&&this.player.setVolume(e)}getVolume(e){this.player?this.player.getVolume&&e(this.player.getVolume()):e(!1)}getMuted(e){this.player?this.player.isMuted&&e(this.player.isMuted()):e(null)}setCurrentTime(e=!1){this.player&&"number"==typeof e&&this.player.seekTo&&this.player.seekTo(e)}getCurrentTime(e){this.player&&this.player.getCurrentTime&&e(this.player.getCurrentTime())}getImageURL(e){if(this.videoImage)return void e(this.videoImage);const t=["maxresdefault","sddefault","hqdefault","0"];let i=0;const s=new Image;s.onload=()=>{120!==(s.naturalWidth||s.width)||i===t.length-1?(this.videoImage=`https://img.youtube.com/vi/${String(this.videoID)}/${t[i]}.jpg`,e(this.videoImage)):(i+=1,s.src=`https://img.youtube.com/vi/${String(this.videoID)}/${t[i]}.jpg`)},s.src=`https://img.youtube.com/vi/${String(this.videoID)}/${t[i]}.jpg`}getVideo(e){this.destroyed||(this.$video?e(this.$video):function(e){void 0!==m.YT&&0!==m.YT.loaded||p?"object"==typeof m.YT&&1===m.YT.loaded?e():u.done((()=>{e()})):(p=1,m.onYouTubeIframeAPIReady=()=>{m.onYouTubeIframeAPIReady=null,u.resolve("done"),e()})}((()=>{if(this.destroyed)return;let t;this.$video||(t=document.createElement("div"),t.style.display="none"),this.playerOptions={host:"https://www.youtube-nocookie.com",videoId:String(this.videoID),playerVars:{autohide:1,rel:0,autoplay:0,playsinline:1},events:{onReady:e=>{if(this.options.mute?e.target.mute():"number"==typeof this.options.volume&&e.target.setVolume(this.options.volume),this.options.autoplay&&this.play(this.options.startTime),this.fire("ready",e),this.options.loop&&!this.options.endTime&&this.player){const e=.1;this.options.endTime=this.player.getDuration()-e}this.volumeChangeInterval&&clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=setInterval((()=>{this.getVolume((t=>{"number"==typeof t&&this.options.volume!==t&&(this.options.volume=t,this.fire("volumechange",e))}))}),150)},onStateChange:()=>{},onError:e=>{this.fire("error",e)}}},this.options.showControls||(this.playerOptions.playerVars.iv_load_policy=3,this.playerOptions.playerVars.modestbranding=1,this.playerOptions.playerVars.controls=0,this.playerOptions.playerVars.showinfo=0,this.playerOptions.playerVars.disablekb=1);let i=!1;this.playerOptions.events.onStateChange=e=>{m.YT&&this.player&&(this.options.loop&&e.data===m.YT.PlayerState.ENDED&&this.play(this.options.startTime),i||e.data!==m.YT.PlayerState.PLAYING||(i=!0,this.fire("started",e)),e.data===m.YT.PlayerState.PLAYING&&this.fire("play",e),e.data===m.YT.PlayerState.PAUSED&&this.fire("pause",e),e.data===m.YT.PlayerState.ENDED&&this.fire("ended",e),e.data===m.YT.PlayerState.PLAYING?(this.progressInterval&&clearInterval(this.progressInterval),this.progressInterval=setInterval((()=>{this.player&&(this.fire("timeupdate",e),this.options.endTime&&this.player.getCurrentTime()>=this.options.endTime&&(this.options.loop?this.play(this.options.startTime):this.pause()))}),150)):this.progressInterval&&(clearInterval(this.progressInterval),this.progressInterval=void 0))};const s=!this.$video;if(s&&t){this.hiddenContainer=t;const e=document.createElement("div");e.setAttribute("id",this.playerID),t.appendChild(e),document.body.appendChild(t)}this.player=this.player||new m.YT.Player(this.playerID,this.playerOptions),s&&(this.$video=document.getElementById(this.playerID),this.$video&&this.options.accessibilityHidden&&(this.$video.setAttribute("tabindex","-1"),this.$video.setAttribute("aria-hidden","true")),this.$video&&(this.videoWidth=parseInt(this.$video.getAttribute("width")||"1280",10)||1280,this.videoHeight=parseInt(this.$video.getAttribute("height")||"720",10)||720)),e(this.$video)})))}destroy(){var e;this.progressInterval&&(clearInterval(this.progressInterval),this.progressInterval=void 0),this.volumeChangeInterval&&(clearInterval(this.volumeChangeInterval),this.volumeChangeInterval=void 0),(null==(e=this.player)?void 0:e.destroy)&&this.player.destroy(),super.destroy()}},Vimeo:class extends s{constructor(){super(...arguments),this.type="vimeo"}static parseURL(e){const t=e.match(/https?:\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)/);return!!(null==t?void 0:t[3])&&t[3]}static parseURLHash(e){const t=e.match(/^.*(vimeo.com\/|video\/)(\d+)(\?.*&*h=|\/)+([\d,a-f]+)/);return t&&5===t.length?t[4]:null}init(){super.init(),function(){if(a)return;if(a=1,void 0!==l.Vimeo)return;let e=document.createElement("script"),t=document.getElementsByTagName("head")[0]||null;t&&e&&(e.src="https://player.vimeo.com/api/player.js",t.appendChild(e),t=null,e=null)}()}play(e){this.player&&(void 0!==e&&this.player.setCurrentTime(e),this.player.getPaused().then((e=>{var t;e&&(this.options.endTime&&!this.options.loop?this.getCurrentTime((e=>{var t;e<this.options.endTime&&(null==(t=this.player)||t.play())})):null==(t=this.player)||t.play())})))}pause(){this.player&&this.player.getPaused().then((e=>{var t;e||null==(t=this.player)||t.pause()}))}mute(){this.player&&this.player.setVolume&&this.setVolume(0)}unmute(){this.player&&this.player.setVolume&&this.setVolume(this.options.volume||100)}setVolume(e=!1){this.player&&"number"==typeof e&&this.player.setVolume&&this.player.setVolume(e/100)}getVolume(e){this.player?this.player.getVolume&&this.player.getVolume().then((t=>{e(100*t)})):e(!1)}getMuted(e){this.player?this.player.getVolume&&this.player.getVolume().then((t=>{e(0===t)})):e(null)}setCurrentTime(e=!1){this.player&&"number"==typeof e&&this.player.setCurrentTime&&this.player.setCurrentTime(e)}getCurrentTime(e){this.player&&this.player.getCurrentTime&&this.player.getCurrentTime().then((t=>{e(t)}))}getImageURL(e){if(this.destroyed)return;if(this.videoImage)return void e(this.videoImage);let t=r.innerWidth||1920;r.devicePixelRatio&&(t*=r.devicePixelRatio),t=Math.min(t,1920);let i=new XMLHttpRequest;this.imageRequest=i,i.open("GET",`https://vimeo.com/api/oembed.json?url=${this.url}&width=${t}`,!0),i.onreadystatechange=()=>{if(i&&4===i.readyState){if(i.status>=200&&i.status<400){const t=JSON.parse(i.responseText);t.thumbnail_url&&(this.videoImage=t.thumbnail_url,e(this.videoImage))}this.imageRequest=void 0}},i.send(),i=null}getVideo(e){this.destroyed||(this.$video?e(this.$video):function(e){if(void 0!==l.Vimeo||n)void 0!==l.Vimeo?e():h.done((()=>{e()}));else{n=1;const t=setInterval((()=>{void 0!==l.Vimeo&&(clearInterval(t),h.resolve("done"),e())}),20)}}((()=>{if(this.destroyed)return;let t;this.$video||(t=document.createElement("div"),t.style.display="none"),this.playerOptions={dnt:1,id:String(this.videoID),autopause:0,transparent:0,autoplay:this.options.autoplay?1:0,loop:this.options.loop?1:0,muted:this.options.mute||0===this.options.volume?1:0};const i=this.constructor.parseURLHash(this.url);if(i&&(this.playerOptions.h=i),this.options.showControls||(this.playerOptions.controls=0),!this.options.showControls&&this.options.loop&&this.options.autoplay&&(this.playerOptions.background=1),!this.$video&&t){this.hiddenContainer=t;let e="";Object.keys(this.playerOptions).forEach((t=>{var i;const s=t,o=null==(i=this.playerOptions)?void 0:i[s];void 0!==o&&(""!==e&&(e+="&"),e+=`${t}=${encodeURIComponent(String(o))}`)})),this.$video=document.createElement("iframe"),this.$video.setAttribute("id",this.playerID),this.$video.setAttribute("src",`https://player.vimeo.com/video/${String(this.videoID)}?${e}`),this.$video.setAttribute("frameborder","0"),this.$video.setAttribute("mozallowfullscreen",""),this.$video.setAttribute("allowfullscreen",""),this.$video.setAttribute("title","Vimeo video player"),this.options.accessibilityHidden&&(this.$video.setAttribute("tabindex","-1"),this.$video.setAttribute("aria-hidden","true")),t.appendChild(this.$video),document.body.appendChild(t)}this.player=this.player||new l.Vimeo.Player(this.$video,this.playerOptions),this.options.mute||"number"!=typeof this.options.volume||this.setVolume(this.options.volume),this.options.startTime&&this.options.autoplay&&this.player.setCurrentTime(this.options.startTime),this.player.getVideoWidth().then((e=>{this.videoWidth=e||1280})),this.player.getVideoHeight().then((e=>{this.videoHeight=e||720}));let s=!1;this.player.on("timeupdate",(e=>{s||(this.fire("started",e),s=!0),this.fire("timeupdate",e),this.options.endTime&&e.seconds>=this.options.endTime&&(this.options.loop?this.play(this.options.startTime):this.pause())})),this.player.on("play",(e=>{this.fire("play",e),this.options.startTime&&0===e.seconds&&this.play(this.options.startTime)})),this.player.on("pause",(e=>{this.fire("pause",e)})),this.player.on("ended",(e=>{this.fire("ended",e)})),this.player.on("loaded",(e=>{this.fire("ready",e)})),this.player.on("volumechange",(e=>{this.getVolume((e=>{"number"==typeof e&&(this.options.volume=e)})),this.fire("volumechange",e)})),this.player.on("error",(e=>{this.fire("error",e)})),e(this.$video)})))}destroy(){var e;this.imageRequest&&(this.imageRequest.abort(),this.imageRequest=void 0),(null==(e=this.player)?void 0:e.destroy)&&this.player.destroy(),super.destroy()}},Local:class extends s{constructor(){super(...arguments),this.type="local"}static parseURL(e){const t=e.split(/,(?=mp4:|webm:|ogv:|ogg:)/),i={};let s=0;return t.forEach((e=>{const t=e.match(/^(mp4|webm|ogv|ogg):(.*)/);if((null==t?void 0:t[1])&&t[2]){const e="ogv"===t[1]?"ogg":t[1];i[e]=t[2],s=1}})),!!s&&i}play(e){this.player&&(void 0!==e&&(this.player.currentTime=e),this.player.paused&&(this.options.endTime&&!this.options.loop?this.getCurrentTime((e=>{var t;e<this.options.endTime&&(null==(t=this.player)||t.play())})):this.player.play()))}pause(){this.player&&!this.player.paused&&this.player.pause()}mute(){this.player&&this.$video&&(this.$video.muted=!0)}unmute(){this.player&&this.$video&&(this.$video.muted=!1)}setVolume(e=!1){this.player&&this.$video&&"number"==typeof e&&(this.$video.volume=e/100)}getVolume(e){this.player&&this.$video?e(100*this.$video.volume):e(!1)}getMuted(e){this.player&&this.$video?e(this.$video.muted):e(null)}setCurrentTime(e=!1){this.player&&this.$video&&"number"==typeof e&&(this.$video.currentTime=e)}getCurrentTime(e){this.player&&e(this.player.currentTime)}getImageURL(e){this.videoImage&&e(this.videoImage)}getVideo(e){if(this.destroyed)return;if(this.$video)return void e(this.$video);let t;if(this.$video||(t=document.createElement("div"),t.style.display="none"),!this.$video&&t){this.$video=document.createElement("video"),this.player=this.$video,this.hiddenContainer=t,this.options.showControls&&(this.$video.controls=!0),"number"==typeof this.options.volume&&this.setVolume(this.options.volume),this.options.mute&&this.mute(),this.options.loop&&(this.$video.loop=!0),this.$video.setAttribute("playsinline",""),this.$video.setAttribute("webkit-playsinline",""),this.options.accessibilityHidden&&(this.$video.setAttribute("tabindex","-1"),this.$video.setAttribute("aria-hidden","true")),this.$video.setAttribute("id",this.playerID),t.appendChild(this.$video),document.body.appendChild(t),Object.keys(this.videoID).forEach((e=>{const t=this.videoID[e];t&&function(e,t,i){const s=document.createElement("source");s.src=t,s.type=i,e.appendChild(s)}(this.$video,t,`video/${e}`)}));const e=this.player;let i=!1;this.eventHandlers={playing:e=>{i||this.fire("started",e),i=!0},timeupdate:e=>{this.fire("timeupdate",e),this.options.endTime&&this.player&&this.player.currentTime>=this.options.endTime&&(this.options.loop?this.play(this.options.startTime):this.pause())},play:e=>{this.fire("play",e)},pause:e=>{this.fire("pause",e)},ended:e=>{this.fire("ended",e)},loadedmetadata:e=>{this.player&&(this.videoWidth=this.player.videoWidth||1280,this.videoHeight=this.player.videoHeight||720,this.fire("ready",e),this.options.autoplay&&this.play(this.options.startTime))},volumechange:e=>{this.getVolume((e=>{"number"==typeof e&&(this.options.volume=e)})),this.fire("volumechange",e)},error:e=>{this.fire("error",e)}},e.addEventListener("playing",this.eventHandlers.playing),e.addEventListener("timeupdate",this.eventHandlers.timeupdate),e.addEventListener("play",this.eventHandlers.play),e.addEventListener("pause",this.eventHandlers.pause),e.addEventListener("ended",this.eventHandlers.ended),e.addEventListener("loadedmetadata",this.eventHandlers.loadedmetadata),e.addEventListener("volumechange",this.eventHandlers.volumechange),e.addEventListener("error",this.eventHandlers.error)}e(this.$video)}destroy(){this.player&&this.eventHandlers&&(this.player.removeEventListener("playing",this.eventHandlers.playing),this.player.removeEventListener("timeupdate",this.eventHandlers.timeupdate),this.player.removeEventListener("play",this.eventHandlers.play),this.player.removeEventListener("pause",this.eventHandlers.pause),this.player.removeEventListener("ended",this.eventHandlers.ended),this.player.removeEventListener("loadedmetadata",this.eventHandlers.loadedmetadata),this.player.removeEventListener("volumechange",this.eventHandlers.volumechange),this.player.removeEventListener("error",this.eventHandlers.error)),this.eventHandlers=void 0,super.destroy()}}},y="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var c,g=y;function f(e=g.jarallax){if(void 0===e)return;const t=e.constructor,i=t.prototype.onScroll;t.prototype.onScroll=function(){i.apply(this);!this.isVideoInserted&&this.video&&(!this.options.videoLazyLoading||this.isElementInViewport)&&!this.options.disableVideo()&&(this.isVideoInserted=!0,this.video?.getVideo((e=>{const t=e,i=t.parentNode;this.css(t,{position:this.image.position,top:"0px",left:"0px",right:"0px",bottom:"0px",width:"100%",height:"100%",maxWidth:"none",maxHeight:"none",pointerEvents:"none",transformStyle:"preserve-3d",backfaceVisibility:"hidden",margin:0,zIndex:-1}),this.$video=t,"local"===this.video?.type&&(this.image.src?t.setAttribute("poster",this.image.src):"IMG"===this.image.$item?.tagName&&t.setAttribute("poster",this.image.$item.src)),this.options.videoClass&&t.setAttribute("class",`${this.options.videoClass} ${this.options.videoClass}-${this.video?.type}`),this.image.$container?.appendChild(t),i?.parentNode?.removeChild(i),this.options.onVideoInsert?.call(this)})))};const s=t.prototype.coverImage;t.prototype.coverImage=function(){const e=s.apply(this),t=this.image.$item?.nodeName;if(!e||!0===e||!this.video||!t||"IFRAME"!==t&&"VIDEO"!==t||!this.$video)return e;let i=e.image.height,o=i*(this.image.width||0)/(this.image.height||1),r=(e.container.width-o)/2,a=e.image.marginTop;return e.container.width>o&&(o=e.container.width,i=o*(this.image.height||0)/(this.image.width||1),r=0,a+=(e.image.height-i)/2),"IFRAME"===t&&(i+=400,a-=200),this.css(this.$video,{width:`${o}px`,marginLeft:`${r}px`,height:`${i}px`,marginTop:`${a}px`}),e};const o=t.prototype.initImg;t.prototype.initImg=function(){const e=o.apply(this);return this.options.videoSrc||(this.options.videoSrc=this.$item.getAttribute("data-jarallax-video")||null),this.options.videoSrc?(this.defaultInitImgResult=e,!0):e};const r=t.prototype.canInitParallax;t.prototype.canInitParallax=function(){let e=r.apply(this);if(!this.options.videoSrc)return e;const t=new v(this.options.videoSrc,{autoplay:!0,loop:this.options.videoLoop,showControls:!1,accessibilityHidden:!0,startTime:Number(this.options.videoStartTime||0),endTime:Number(this.options.videoEndTime||0),mute:!this.options.videoVolume,volume:Number(this.options.videoVolume||0)});this.options.onVideoWorkerInit?.call(this,t);const i=()=>{this.image.$default_item&&(this.image.$item=this.image.$default_item,this.image.$item.style.display="block",this.coverImage(),this.onScroll())};return t.isValid()?(this.options.disableParallax()&&(e=!0,this.image.position="absolute",this.options.type="scroll",this.options.speed=1),e?(t.on("ready",(()=>{if(this.options.videoPlayOnlyVisible){const e=this.onScroll;this.onScroll=function(){e.apply(this),this.videoError||!this.options.videoLoop&&(this.options.videoLoop||this.videoEnded)||(this.isVisible()?t.play():t.pause())}}else t.play()})),t.on("started",(()=>{this.image.$default_item=this.image.$item,this.image.$item=this.$video,this.image.width=this.video?.videoWidth||1280,this.image.height=this.video?.videoHeight||720,this.coverImage(),this.onScroll(),this.image.$default_item&&(this.image.$default_item.style.display="none")})),t.on("ended",(()=>{this.videoEnded=!0,this.options.videoLoop||i()})),t.on("error",(()=>{this.videoError=!0,i()})),this.video=t,this.defaultInitImgResult||(this.image.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7","local"===t.type)?e:(t.getImageURL((e=>{this.image.bgImage=`url("${e}")`,this.init()})),!1)):(this.defaultInitImgResult||t.getImageURL((e=>{const t=this.$item.getAttribute("style");t&&this.$item.setAttribute("data-jarallax-original-styles",t),this.css(this.$item,{backgroundImage:`url("${e}")`,backgroundPosition:"center",backgroundSize:"cover"})})),e)):e};const a=t.prototype.destroy;t.prototype.destroy=function(){this.image.$default_item&&(this.image.$item=this.image.$default_item,delete this.image.$default_item),a.apply(this)}}return f(),c=()=>{void 0!==g.jarallax&&g.jarallax(document.querySelectorAll("[data-jarallax-video]"))},"undefined"!=typeof document&&("complete"===document.readyState||"interactive"===document.readyState?c():document.addEventListener("DOMContentLoaded",c,{capture:!0,once:!0,passive:!0})),g.VideoWorker||(g.VideoWorker=v),f}));//# sourceMappingURL=jarallax-video.min.js.map;