(() => {
  var __getOwnPropNames = Object.getOwnPropertyNames;
  var __commonJS = (cb, mod) => function __require() {
    return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  };

  // <stdin>
  var require_stdin = __commonJS({
    "<stdin>"(exports, module) {
      (function(global2, factory) {
        typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, global2.jarallax = factory());
      })(exports, function() {
        "use strict";
        function ready(callback) {
          if (document.readyState === "complete" || document.readyState === "interactive") {
            callback();
          } else {
            document.addEventListener("DOMContentLoaded", callback, {
              capture: true,
              once: true,
              passive: true
            });
          }
        }
        let win;
        if (typeof window !== "undefined") {
          win = window;
        } else if (typeof global !== "undefined") {
          win = global;
        } else if (typeof self !== "undefined") {
          win = self;
        } else {
          win = {};
        }
        var global$1 = win;
        var defaults = {
          // Base parallax options.
          type: "scroll",
          speed: 0.5,
          containerClass: "jarallax-container",
          imgSrc: null,
          imgElement: ".jarallax-img",
          imgSize: "cover",
          imgPosition: "50% 50%",
          imgRepeat: "no-repeat",
          keepImg: false,
          elementInViewport: null,
          zIndex: -100,
          disableParallax: false,
          // Callbacks.
          onScroll: null,
          onInit: null,
          onDestroy: null,
          onCoverImage: null,
          // Video options.
          videoClass: "jarallax-video",
          videoSrc: null,
          videoStartTime: 0,
          videoEndTime: 0,
          videoVolume: 0,
          videoLoop: true,
          videoPlayOnlyVisible: true,
          videoLazyLoading: true,
          disableVideo: false,
          // Video callbacks.
          onVideoInsert: null,
          onVideoWorkerInit: null
        };
        function css(el, styles) {
          if (typeof styles === "string") {
            return global$1.getComputedStyle(el).getPropertyValue(styles);
          }
          Object.keys(styles).forEach((key) => {
            el.style[key] = styles[key];
          });
          return el;
        }
        function extend(out, ...args) {
          out = out || {};
          Object.keys(args).forEach((i) => {
            if (!args[i]) {
              return;
            }
            Object.keys(args[i]).forEach((key) => {
              out[key] = args[i][key];
            });
          });
          return out;
        }
        function getParents(elem) {
          const parents = [];
          while (elem.parentElement !== null) {
            elem = elem.parentElement;
            if (elem.nodeType === 1) {
              parents.push(elem);
            }
          }
          return parents;
        }
        const {
          navigator: navigator$1
        } = global$1;
        const mobileAgent = /* @__PURE__ */ /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator$1.userAgent);
        function isMobile() {
          return mobileAgent;
        }
        let wndW;
        let wndH;
        let $deviceHelper;
        function getDeviceHeight() {
          if (!$deviceHelper && document.body) {
            $deviceHelper = document.createElement("div");
            $deviceHelper.style.cssText = "position: fixed; top: -9999px; left: 0; height: 100vh; width: 0;";
            document.body.appendChild($deviceHelper);
          }
          return ($deviceHelper ? $deviceHelper.clientHeight : 0) || global$1.innerHeight || document.documentElement.clientHeight;
        }
        function updateWindowHeight() {
          wndW = global$1.innerWidth || document.documentElement.clientWidth;
          if (isMobile()) {
            wndH = getDeviceHeight();
          } else {
            wndH = global$1.innerHeight || document.documentElement.clientHeight;
          }
        }
        updateWindowHeight();
        global$1.addEventListener("resize", updateWindowHeight);
        global$1.addEventListener("orientationchange", updateWindowHeight);
        global$1.addEventListener("load", updateWindowHeight);
        ready(() => {
          updateWindowHeight();
        });
        function getWindowSize() {
          return {
            width: wndW,
            height: wndH
          };
        }
        const jarallaxList = [];
        function updateParallax() {
          if (!jarallaxList.length) {
            return;
          }
          const {
            width: wndW2,
            height: wndH2
          } = getWindowSize();
          jarallaxList.forEach((data, k) => {
            const {
              instance,
              oldData
            } = data;
            if (!instance.isVisible()) {
              return;
            }
            const clientRect = instance.$item.getBoundingClientRect();
            const newData = {
              width: clientRect.width,
              height: clientRect.height,
              top: clientRect.top,
              bottom: clientRect.bottom,
              wndW: wndW2,
              wndH: wndH2
            };
            const isResized = !oldData || oldData.wndW !== newData.wndW || oldData.wndH !== newData.wndH || oldData.width !== newData.width || oldData.height !== newData.height;
            const isScrolled = isResized || !oldData || oldData.top !== newData.top || oldData.bottom !== newData.bottom;
            jarallaxList[k].oldData = newData;
            if (isResized) {
              instance.onResize();
            }
            if (isScrolled) {
              instance.onScroll();
            }
          });
          global$1.requestAnimationFrame(updateParallax);
        }
        const visibilityObserver = /* @__PURE__ */ new global$1.IntersectionObserver((entries) => {
          entries.forEach((entry) => {
            entry.target.jarallax.isElementInViewport = entry.isIntersecting;
          });
        }, {
          // We have to start parallax calculation before the block is in view
          // to prevent possible parallax jumping.
          rootMargin: "50px"
        });
        function addObserver(instance) {
          jarallaxList.push({
            instance
          });
          if (jarallaxList.length === 1) {
            global$1.requestAnimationFrame(updateParallax);
          }
          visibilityObserver.observe(instance.options.elementInViewport || instance.$item);
        }
        function removeObserver(instance) {
          jarallaxList.forEach((data, key) => {
            if (data.instance.instanceID === instance.instanceID) {
              jarallaxList.splice(key, 1);
            }
          });
          visibilityObserver.unobserve(instance.options.elementInViewport || instance.$item);
        }
        const {
          navigator
        } = global$1;
        let instanceID = 0;
        class Jarallax {
          constructor(item, userOptions) {
            const self2 = this;
            self2.instanceID = instanceID;
            instanceID += 1;
            self2.$item = item;
            self2.defaults = {
              ...defaults
            };
            const dataOptions = self2.$item.dataset || {};
            const pureDataOptions = {};
            Object.keys(dataOptions).forEach((key) => {
              const lowerCaseOption = key.substr(0, 1).toLowerCase() + key.substr(1);
              if (lowerCaseOption && typeof self2.defaults[lowerCaseOption] !== "undefined") {
                pureDataOptions[lowerCaseOption] = dataOptions[key];
              }
            });
            self2.options = self2.extend({}, self2.defaults, pureDataOptions, userOptions);
            self2.pureOptions = self2.extend({}, self2.options);
            Object.keys(self2.options).forEach((key) => {
              if (self2.options[key] === "true") {
                self2.options[key] = true;
              } else if (self2.options[key] === "false") {
                self2.options[key] = false;
              }
            });
            self2.options.speed = Math.min(2, Math.max(-1, parseFloat(self2.options.speed)));
            if (typeof self2.options.disableParallax === "string") {
              self2.options.disableParallax = new RegExp(self2.options.disableParallax);
            }
            if (self2.options.disableParallax instanceof RegExp) {
              const disableParallaxRegexp = self2.options.disableParallax;
              self2.options.disableParallax = () => disableParallaxRegexp.test(navigator.userAgent);
            }
            if (typeof self2.options.disableParallax !== "function") {
              self2.options.disableParallax = () => false;
            }
            if (typeof self2.options.disableVideo === "string") {
              self2.options.disableVideo = new RegExp(self2.options.disableVideo);
            }
            if (self2.options.disableVideo instanceof RegExp) {
              const disableVideoRegexp = self2.options.disableVideo;
              self2.options.disableVideo = () => disableVideoRegexp.test(navigator.userAgent);
            }
            if (typeof self2.options.disableVideo !== "function") {
              self2.options.disableVideo = () => false;
            }
            let elementInVP = self2.options.elementInViewport;
            if (elementInVP && typeof elementInVP === "object" && typeof elementInVP.length !== "undefined") {
              [elementInVP] = elementInVP;
            }
            if (!(elementInVP instanceof Element)) {
              elementInVP = null;
            }
            self2.options.elementInViewport = elementInVP;
            self2.image = {
              src: self2.options.imgSrc || null,
              $container: null,
              useImgTag: false,
              // 1. Position fixed is needed for the most of browsers because absolute position have glitches
              // 2. On MacOS with smooth scroll there is a huge lags with absolute position - https://github.com/nk-o/jarallax/issues/75
              // 3. Previously used 'absolute' for mobile devices. But we re-tested on iPhone 12 and 'fixed' position is working better, then 'absolute', so for now position is always 'fixed'
              position: "fixed"
            };
            if (self2.initImg() && self2.canInitParallax()) {
              self2.init();
            }
          }
          css(el, styles) {
            return css(el, styles);
          }
          extend(out, ...args) {
            return extend(out, ...args);
          }
          // get window size and scroll position. Useful for extensions
          getWindowData() {
            const {
              width,
              height
            } = getWindowSize();
            return {
              width,
              height,
              y: document.documentElement.scrollTop
            };
          }
          // Jarallax functions
          initImg() {
            const self2 = this;
            let $imgElement = self2.options.imgElement;
            if ($imgElement && typeof $imgElement === "string") {
              $imgElement = self2.$item.querySelector($imgElement);
            }
            if (!($imgElement instanceof Element)) {
              if (self2.options.imgSrc) {
                $imgElement = new Image();
                $imgElement.src = self2.options.imgSrc;
              } else {
                $imgElement = null;
              }
            }
            if ($imgElement) {
              if (self2.options.keepImg) {
                self2.image.$item = $imgElement.cloneNode(true);
              } else {
                self2.image.$item = $imgElement;
                self2.image.$itemParent = $imgElement.parentNode;
              }
              self2.image.useImgTag = true;
            }
            if (self2.image.$item) {
              return true;
            }
            if (self2.image.src === null) {
              self2.image.src = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
              self2.image.bgImage = self2.css(self2.$item, "background-image");
            }
            return !(!self2.image.bgImage || self2.image.bgImage === "none");
          }
          canInitParallax() {
            return !this.options.disableParallax();
          }
          init() {
            const self2 = this;
            const containerStyles = {
              position: "absolute",
              top: 0,
              left: 0,
              width: "100%",
              height: "100%",
              overflow: "hidden"
            };
            let imageStyles = {
              pointerEvents: "none",
              transformStyle: "preserve-3d",
              backfaceVisibility: "hidden"
            };
            if (!self2.options.keepImg) {
              const curStyle = self2.$item.getAttribute("style");
              if (curStyle) {
                self2.$item.setAttribute("data-jarallax-original-styles", curStyle);
              }
              if (self2.image.useImgTag) {
                const curImgStyle = self2.image.$item.getAttribute("style");
                if (curImgStyle) {
                  self2.image.$item.setAttribute("data-jarallax-original-styles", curImgStyle);
                }
              }
            }
            if (self2.css(self2.$item, "position") === "static") {
              self2.css(self2.$item, {
                position: "relative"
              });
            }
            if (self2.css(self2.$item, "z-index") === "auto") {
              self2.css(self2.$item, {
                zIndex: 0
              });
            }
            self2.image.$container = document.createElement("div");
            self2.css(self2.image.$container, containerStyles);
            self2.css(self2.image.$container, {
              "z-index": self2.options.zIndex
            });
            if (this.image.position === "fixed") {
              self2.css(self2.image.$container, {
                "-webkit-clip-path": "polygon(0 0, 100% 0, 100% 100%, 0 100%)",
                "clip-path": "polygon(0 0, 100% 0, 100% 100%, 0 100%)"
              });
            }
            self2.image.$container.setAttribute("id", `jarallax-container-${self2.instanceID}`);
            if (self2.options.containerClass) {
              self2.image.$container.setAttribute("class", self2.options.containerClass);
            }
            self2.$item.appendChild(self2.image.$container);
            if (self2.image.useImgTag) {
              imageStyles = self2.extend({
                "object-fit": self2.options.imgSize,
                "object-position": self2.options.imgPosition,
                "max-width": "none"
              }, containerStyles, imageStyles);
            } else {
              self2.image.$item = document.createElement("div");
              if (self2.image.src) {
                imageStyles = self2.extend({
                  "background-position": self2.options.imgPosition,
                  "background-size": self2.options.imgSize,
                  "background-repeat": self2.options.imgRepeat,
                  "background-image": self2.image.bgImage || `url("${self2.image.src}")`
                }, containerStyles, imageStyles);
              }
            }
            if (self2.options.type === "opacity" || self2.options.type === "scale" || self2.options.type === "scale-opacity" || self2.options.speed === 1) {
              self2.image.position = "absolute";
            }
            if (self2.image.position === "fixed") {
              const $parents = getParents(self2.$item).filter((el) => {
                const styles = global$1.getComputedStyle(el);
                const parentTransform = styles["-webkit-transform"] || styles["-moz-transform"] || styles.transform;
                const overflowRegex = /(auto|scroll)/;
                return parentTransform && parentTransform !== "none" || overflowRegex.test(styles.overflow + styles["overflow-y"] + styles["overflow-x"]);
              });
              self2.image.position = $parents.length ? "absolute" : "fixed";
            }
            imageStyles.position = self2.image.position;
            self2.css(self2.image.$item, imageStyles);
            self2.image.$container.appendChild(self2.image.$item);
            self2.onResize();
            self2.onScroll(true);
            if (self2.options.onInit) {
              self2.options.onInit.call(self2);
            }
            if (self2.css(self2.$item, "background-image") !== "none") {
              self2.css(self2.$item, {
                "background-image": "none"
              });
            }
            addObserver(self2);
          }
          destroy() {
            const self2 = this;
            removeObserver(self2);
            const originalStylesTag = self2.$item.getAttribute("data-jarallax-original-styles");
            self2.$item.removeAttribute("data-jarallax-original-styles");
            if (!originalStylesTag) {
              self2.$item.removeAttribute("style");
            } else {
              self2.$item.setAttribute("style", originalStylesTag);
            }
            if (self2.image.useImgTag) {
              const originalStylesImgTag = self2.image.$item.getAttribute("data-jarallax-original-styles");
              self2.image.$item.removeAttribute("data-jarallax-original-styles");
              if (!originalStylesImgTag) {
                self2.image.$item.removeAttribute("style");
              } else {
                self2.image.$item.setAttribute("style", originalStylesTag);
              }
              if (self2.image.$itemParent) {
                self2.image.$itemParent.appendChild(self2.image.$item);
              }
            }
            if (self2.image.$container) {
              self2.image.$container.parentNode.removeChild(self2.image.$container);
            }
            if (self2.options.onDestroy) {
              self2.options.onDestroy.call(self2);
            }
            delete self2.$item.jarallax;
          }
          coverImage() {
            const self2 = this;
            const {
              height: wndH2
            } = getWindowSize();
            const rect = self2.image.$container.getBoundingClientRect();
            const contH = rect.height;
            const {
              speed
            } = self2.options;
            const isScroll = self2.options.type === "scroll" || self2.options.type === "scroll-opacity";
            let scrollDist = 0;
            let resultH = contH;
            let resultMT = 0;
            if (isScroll) {
              if (speed < 0) {
                scrollDist = speed * Math.max(contH, wndH2);
                if (wndH2 < contH) {
                  scrollDist -= speed * (contH - wndH2);
                }
              } else {
                scrollDist = speed * (contH + wndH2);
              }
              if (speed > 1) {
                resultH = Math.abs(scrollDist - wndH2);
              } else if (speed < 0) {
                resultH = scrollDist / speed + Math.abs(scrollDist);
              } else {
                resultH += (wndH2 - contH) * (1 - speed);
              }
              scrollDist /= 2;
            }
            self2.parallaxScrollDistance = scrollDist;
            if (isScroll) {
              resultMT = (wndH2 - resultH) / 2;
            } else {
              resultMT = (contH - resultH) / 2;
            }
            self2.css(self2.image.$item, {
              height: `${resultH}px`,
              marginTop: `${resultMT}px`,
              left: self2.image.position === "fixed" ? `${rect.left}px` : "0",
              width: `${rect.width}px`
            });
            if (self2.options.onCoverImage) {
              self2.options.onCoverImage.call(self2);
            }
            return {
              image: {
                height: resultH,
                marginTop: resultMT
              },
              container: rect
            };
          }
          isVisible() {
            return this.isElementInViewport || false;
          }
          onScroll(force) {
            const self2 = this;
            if (!force && !self2.isVisible()) {
              return;
            }
            const {
              height: wndH2
            } = getWindowSize();
            const rect = self2.$item.getBoundingClientRect();
            const contT = rect.top;
            const contH = rect.height;
            const styles = {};
            const beforeTop = Math.max(0, contT);
            const beforeTopEnd = Math.max(0, contH + contT);
            const afterTop = Math.max(0, -contT);
            const beforeBottom = Math.max(0, contT + contH - wndH2);
            const beforeBottomEnd = Math.max(0, contH - (contT + contH - wndH2));
            const afterBottom = Math.max(0, -contT + wndH2 - contH);
            const fromViewportCenter = 1 - 2 * ((wndH2 - contT) / (wndH2 + contH));
            let visiblePercent = 1;
            if (contH < wndH2) {
              visiblePercent = 1 - (afterTop || beforeBottom) / contH;
            } else if (beforeTopEnd <= wndH2) {
              visiblePercent = beforeTopEnd / wndH2;
            } else if (beforeBottomEnd <= wndH2) {
              visiblePercent = beforeBottomEnd / wndH2;
            }
            if (self2.options.type === "opacity" || self2.options.type === "scale-opacity" || self2.options.type === "scroll-opacity") {
              styles.transform = "translate3d(0,0,0)";
              styles.opacity = visiblePercent;
            }
            if (self2.options.type === "scale" || self2.options.type === "scale-opacity") {
              let scale = 1;
              if (self2.options.speed < 0) {
                scale -= self2.options.speed * visiblePercent;
              } else {
                scale += self2.options.speed * (1 - visiblePercent);
              }
              styles.transform = `scale(${scale}) translate3d(0,0,0)`;
            }
            if (self2.options.type === "scroll" || self2.options.type === "scroll-opacity") {
              let positionY = self2.parallaxScrollDistance * fromViewportCenter;
              if (self2.image.position === "absolute") {
                positionY -= contT;
              }
              styles.transform = `translate3d(0,${positionY}px,0)`;
            }
            self2.css(self2.image.$item, styles);
            if (self2.options.onScroll) {
              self2.options.onScroll.call(self2, {
                section: rect,
                beforeTop,
                beforeTopEnd,
                afterTop,
                beforeBottom,
                beforeBottomEnd,
                afterBottom,
                visiblePercent,
                fromViewportCenter
              });
            }
          }
          onResize() {
            this.coverImage();
          }
        }
        const jarallax = function(items, options, ...args) {
          if (typeof HTMLElement === "object" ? items instanceof HTMLElement : items && typeof items === "object" && items !== null && items.nodeType === 1 && typeof items.nodeName === "string") {
            items = [items];
          }
          const len = items.length;
          let k = 0;
          let ret;
          for (k; k < len; k += 1) {
            if (typeof options === "object" || typeof options === "undefined") {
              if (!items[k].jarallax) {
                items[k].jarallax = new Jarallax(items[k], options);
              }
            } else if (items[k].jarallax) {
              ret = items[k].jarallax[options].apply(items[k].jarallax, args);
            }
            if (typeof ret !== "undefined") {
              return ret;
            }
          }
          return items;
        };
        jarallax.constructor = Jarallax;
        const $ = global$1.jQuery;
        if (typeof $ !== "undefined") {
          const $Plugin = function(...args) {
            Array.prototype.unshift.call(args, this);
            const res = jarallax.apply(global$1, args);
            return typeof res !== "object" ? res : this;
          };
          $Plugin.constructor = jarallax.constructor;
          const old$Plugin = $.fn.jarallax;
          $.fn.jarallax = $Plugin;
          $.fn.jarallax.noConflict = function() {
            $.fn.jarallax = old$Plugin;
            return this;
          };
        }
        ready(() => {
          jarallax(document.querySelectorAll("[data-jarallax]"));
        });
        return jarallax;
      });
    }
  });
  require_stdin();
})();
/*!
 * Jarallax v2.1.3 (https://github.com/nk-o/jarallax)
 * Copyright 2023 nK <https://nkdev.info>
 * Licensed under MIT (https://github.com/nk-o/jarallax/blob/master/LICENSE)
 */
