// source --> https://embanews.com.br/wp-content/themes/chromenews-pro/assets/script.js?ver=6.0.4 
(function (e) {
  'use strict';
  var n = window.AFTHRAMPES_JS || {};
  (n.mobileMenu = {
    init: function () {
      this.toggleMenu(), this.menuMobile(), this.menuArrow();

      if (e('.aft-mobile-navigation').length) {
        var navElement = document.querySelector('.aft-mobile-navigation');
        if (navElement) {
          n.trapFocus(navElement);
        }
      }
    },
    toggleMenu: function () {
      e('#masthead').on('click', '.toggle-menu', function (event) {
        var ethis = e('.main-navigation .menu .menu-mobile');
        if (ethis.css('display') == 'block') {
          ethis.slideUp('300');
        } else {
          ethis.slideDown('300');
        }
        e('.ham').toggleClass('exit');
      });
      e('#masthead .main-navigation ').on(
        'click',
        '.menu-mobile a button',
        function (event) {
          event.preventDefault();
          var ethis = e(this),
            eparent = ethis.closest('li');
          if (eparent.find('> .children').length) {
            var esub_menu = eparent.find('> .children');
          } else {
            var esub_menu = eparent.find('> .sub-menu');
          }
          if (esub_menu.css('display') == 'none') {
            esub_menu.slideDown('300');
            ethis.addClass('active');
          } else {
            esub_menu.slideUp('300');
            ethis.removeClass('active');
          }
          return false;
        }
      );
    },
    menuMobile: function () {
      if (e('.main-navigation .menu > ul').length) {
        var ethis = e('.main-navigation .menu > ul'),
          eparent = ethis.closest('.main-navigation'),
          pointbreak = eparent.data('epointbreak'),
          window_width = window.innerWidth;
        if (typeof pointbreak == 'undefined') {
          pointbreak = 991;
        }
        if (pointbreak >= window_width) {
          ethis.addClass('menu-mobile').removeClass('menu-desktop');
          e('.main-navigation .toggle-menu').css('display', 'block');
          e('.main-navigation').addClass('aft-mobile-navigation');
        } else {
          ethis
            .addClass('menu-desktop')
            .removeClass('menu-mobile')
            .css('display', '');
          e('.main-navigation .toggle-menu').css('display', '');
          e('.main-navigation').removeClass('aft-mobile-navigation');
        }
      }
    },
    menuArrow: function () {
      if (e('#masthead .main-navigation div.menu > ul').length) {
        e('#masthead .main-navigation div.menu > ul .sub-menu')
          .parent('li')
          .find('> a')
          .append('<button class="fa fa-angle-down">');
        e('#masthead .main-navigation div.menu > ul .children')
          .parent('li')
          .find('> a')
          .append('<button class="fa fa-angle-down">');
      }
    },
  }),
    (n.trapFocus = function (element) {
      var focusableEls = element.querySelectorAll(
          'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])'
        ),
        firstFocusableEl = focusableEls[0],
        lastFocusableEl = focusableEls[focusableEls.length - 1],
        KEYCODE_TAB = 9;

      element.addEventListener('keydown', function (e) {
        var isTabPressed = e.key === 'Tab' || e.keyCode === KEYCODE_TAB;

        if (!isTabPressed) {
          return;
        }

        if (e.shiftKey) {
          /* shift + tab */ if (document.activeElement === firstFocusableEl) {
            lastFocusableEl.focus();
            e.preventDefault();
          }
        } /* tab */ else {
          if (document.activeElement === lastFocusableEl) {
            firstFocusableEl.focus();
            e.preventDefault();
          }
        }
      });
    }),
    (n.DataBackground = function () {
      var pageSection = e('.data-bg');
      pageSection.each(function (indx) {
        if (e(this).attr('data-background')) {
          e(this).css(
            'background-image',
            'url(' + e(this).data('background') + ')'
          );
        }
      });
      e('.bg-image').each(function () {
        var src = e(this).children('img').attr('src');
        e(this)
          .css('background-image', 'url(' + src + ')')
          .children('img')
          .hide();
      });
    }),
    (n.setInstaHeight = function () {
      e('.insta-slider-block').each(function () {
        var img_width = e(this)
          .find('.insta-item .af-insta-height')
          .eq(0)
          .innerWidth();
        e(this).find('.insta-item .af-insta-height').css('height', img_width);
      });
    }),
    (n.Preloader = function () {
      e('#loader-wrapper').fadeOut();
      e('#af-preloader').delay(500).fadeOut('slow');
    }),
    (n.Search = function () {
      e('.af-search-click').on('click', function () {
        e('#af-search-wrap').toggleClass('af-search-toggle');
      });
    }),
    (n.Offcanvas = function () {
      e('#sidr').addClass('aft-mobile-off-canvas');
      var offCanvasElement = document.querySelector('.aft-mobile-off-canvas');
      if (offCanvasElement) {
        n.trapFocus(offCanvasElement);
      }

      e('.offcanvas-nav').sidr({
        speed: 300,
        side: 'left',
      });
      e('.sidr-class-sidr-button-close').on('click', function () {
        e.sidr('close', 'sidr');
      });
    }),
    // SHOW/HIDE SCROLL UP //
    (n.show_hide_scroll_top = function () {
      if (e(window).scrollTop() > e(window).height() / 2) {
        e('#scroll-up').fadeIn(300);
      } else {
        e('#scroll-up').fadeOut(300);
      }
    }),
    (n.scroll_up = function () {
      e('#scroll-up').on('click', function () {
        e('html, body').animate(
          {
            scrollTop: 0,
          },
          800
        );
        return false;
      });
    }),
    (n.MagnificPopup = function () {
      e('div.zoom-gallery').magnificPopup({
        delegate: 'a.insta-hover',
        type: 'image',
        closeOnContentClick: false,
        closeBtnInside: false,
        mainClass: 'mfp-with-zoom mfp-img-mobile',
        image: {
          verticalFit: true,
          titleSrc: function (item) {
            return item.el.attr('title');
          },
        },
        gallery: {
          enabled: true,
        },
        zoom: {
          enabled: true,
          duration: 300,
          opener: function (element) {
            return element.find('img');
          },
        },
      });
      e('.gallery').each(function () {
        e(this).magnificPopup({
          delegate: 'a',
          type: 'image',
          gallery: {
            enabled: true,
          },
          zoom: {
            enabled: true,
            duration: 300,
            opener: function (element) {
              return element.find('img');
            },
          },
        });
      });

      e('.wp-block-gallery').each(function () {
        e(this).magnificPopup({
          delegate: 'a',
          type: 'image',
          gallery: {
            enabled: true,
          },
          zoom: {
            enabled: true,
            duration: 300,
            opener: function (element) {
              return element.find('img');
            },
          },
        });
      });
    }),
    (n.searchReveal = function () {
      jQuery('.search-overlay .search-icon').on('click', function () {
        jQuery(this).parent().toggleClass('reveal-search');
        return false;
      });

      jQuery('body').on('click', function (e) {
        if (jQuery('.search-overlay').hasClass('reveal-search')) {
          var container = jQuery('.search-overlay');
          if (!container.is(e.target) && container.has(e.target).length === 0) {
            container.removeClass('reveal-search');
          }
        }
      });
    }),
    (n.em_sticky = function () {
      jQuery('.home #secondary.aft-sticky-sidebar').theiaStickySidebar({
        additionalMarginTop: 30,
      });
    }),
    (n.lightDarkToggle = function () {
      jQuery('#aft-dark-light-mode-btn').on('click', function (event) {
        event.preventDefault();
        var DefaultSiteModeAttr = e(this).data('site-mode');
        var DefaultSiteModeCls = e(this).attr('class');
        n.lightDarkToggleFunction(DefaultSiteModeAttr);

        if (DefaultSiteModeAttr === DefaultSiteModeCls) {
          n.lightDarkToggleFunction(DefaultSiteModeAttr);
        } else {
          n.lightDarkToggleFunction(DefaultSiteModeCls);
        }
      });
    }),
    (n.lightDarkToggleFunction = function (DefaultSiteModeAttr) {
      var actualSiteModeAttr = e('#aft-dark-light-mode-btn').data('site-mode');

      var switchSiteModeAttr = 'aft-dark-mode';
      if (DefaultSiteModeAttr === 'aft-dark-mode') {
        if (actualSiteModeAttr === 'aft-default-mode') {
          switchSiteModeAttr = 'aft-default-mode';
        } else {
          switchSiteModeAttr = 'aft-light-mode';
        }
      }

      if (e('body').hasClass(DefaultSiteModeAttr)) {
        e('body').removeClass(DefaultSiteModeAttr);
        e('body').addClass(switchSiteModeAttr);
        e('#aft-dark-light-mode-btn').removeClass(DefaultSiteModeAttr);
        e('#aft-dark-light-mode-btn').addClass(switchSiteModeAttr);
      }
    }),
    (n.jQueryMarquee = function () {
      e('.marquee.aft-flash-slide').marquee({
        //duration in milliseconds of the marquee
        speed: 120000,
        //gap in pixels between the tickers
        gap: 0,
        //time in milliseconds before the marquee will start animating
        delayBeforeStart: 0,
        //'left' or 'right'
        // direction: 'right',
        //true or false - should the marquee be duplicated to show an effect of continues flow
        duplicated: true,
        pauseOnHover: true,
        startVisible: true,
      });
    }),
    (n.SliderAsNavFor = function () {
      if (e('.banner-single-slider-1-wrap').hasClass('no-thumbnails')) {
        return null;
      } else {
        return '.af-banner-slider-thumbnail';
      }
    }),
    (n.RtlCheck = function () {
      if (e('body').hasClass('rtl')) {
        return true;
      } else {
        return false;
      }
    }),
    (n.SlickSliderControls = function (widgetClass, controlWrap) {
      var widgetID = e(widgetClass).parents('.chromenews-widget').attr('id');
      console.log(widgetID);
      return e(widgetID).find(controlWrap);
    }),
    (n.checkThumbOption = function () {
      if (e('.hasthumbslide').hasClass('side')) {
        return '.af-post-slider-thumbnail';
      } else {
        return false;
      }
    }),
    //slick slider
    (n.SlickBannerCarousel = function () {
      e('.af-banner-carousel-1')
        .not('.slick-initialized')
        .slick({
          infinite: true,
          nextArrow:
            '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
          prevArrow:
            '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
          appendArrows: e('.af-main-navcontrols'),
          rtl: n.RtlCheck(),
        });
    }),
    (n.BootstrapTabsChange = function () {
      e('a.aft-tab-item[data-toggle="tab"]').on('shown.bs.tab', function () {
        e('.aft-tabbed-carousel').slick('refresh');
      });
    });

  //Slick Carousel
  (n.SlickTrendingVerticalCarousel = function () {
    e('.aft-banner-tiled .aft-4-trending-posts.banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 4,
        slidesToScroll: 1,
        autoplaySpeed: 7000,
        autoplay: true,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: '.af-trending-navcontrols',
        responsive: [
          {
            breakpoint: 600,
            settings: {
              slidesToShow: 1,
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
            },
          },
        ],
      });

    e('.aft-banner-horizontal .banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 3,
        slidesToScroll: 1,
        autoplaySpeed: 7000,
        autoplay: true,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: '.af-trending-navcontrols',
        rtl: n.RtlCheck(),
        responsive: [
          {
            breakpoint: 769,
            settings: {
              slidesToShow: 2,
              slidesToScroll: 2,
            },
          },
          {
            breakpoint: 480,
            settings: {
              slidesToShow: 1,
              slidesToScroll: 1,
            },
          },
        ],
      });

    e('.aft-banner-tiled .banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 3,
        slidesToScroll: 1,
        autoplaySpeed: 7000,
        autoplay: true,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: '.af-trending-navcontrols',
        responsive: [
          {
            breakpoint: 600,
            settings: {
              slidesToShow: 1,
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
            },
          },
        ],
      });

    e('.aft-horizontal-trending-part .banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        autoplaySpeed: 7000,
        autoplay: true,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: '.af-trending-navcontrols',
        responsive: [
          {
            breakpoint: 600,
            settings: {
              slidesToShow: 1,
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
            },
          },
        ],
      });

    e('.aft-5-trending-posts .banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 5,
        slidesToScroll: 1,
        autoplay: true,
        infinite: true,
        loop: true,
        vertical: true,
        verticalSwiping: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
        appendArrows: e('.af-trending-navcontrols'),
        responsive: [
          {
            breakpoint: 1025,
            settings: {
              slidesToShow: 2,
              slidesToScroll: 1,
              vertical: false,
              verticalSwiping: false,
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
              rtl: n.RtlCheck(),
            },
          },
          {
            breakpoint: 600,
            settings: {
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
            },
          },
        ],
      });

    e('.aft-3-trending-posts .banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 3,
        slidesToScroll: 1,
        infinite: true,
        loop: true,
        vertical: true,
        verticalSwiping: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
        appendArrows: e('.af-trending-navcontrols'),
        responsive: [
          {
            breakpoint: 1025,
            settings: {
              slidesToShow: 2,
              slidesToScroll: 1,
              vertical: false,
              verticalSwiping: false,
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
              rtl: n.RtlCheck(),
            },
          },
          {
            breakpoint: 600,
            settings: {
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
            },
          },
        ],
      });

    e('.aft-4-trending-posts .banner-vertical-slider')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 4,
        slidesToScroll: 1,
        autoplay: true,
        infinite: true,
        loop: true,
        vertical: true,
        verticalSwiping: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
        appendArrows: e('.af-trending-navcontrols'),
        responsive: [
          {
            breakpoint: 1025,
            settings: {
              slidesToShow: 2,
              slidesToScroll: 1,
              vertical: false,
              verticalSwiping: false,
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
              rtl: n.RtlCheck(),
            },
          },
          {
            breakpoint: 600,
            settings: {
              draggable: false,
              swipeToSlide: false,
              touchMove: false,
              swipe: false,
            },
          },
        ],
      });

    e('.aft-banner-aligned .banner-thumb-carousel')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 3,
        slidesToScroll: 1,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: e('.af-thumb-navcontrols'),
        rtl: n.RtlCheck(),
        responsive: [
          {
            breakpoint: 769,
            settings: {
              slidesToShow: 2,
              slidesToScroll: 2,
            },
          },
          {
            breakpoint: 480,
            settings: {
              slidesToShow: 1,
              slidesToScroll: 1,
            },
          },
        ],
      });

    e('.aft-banner-compressed .banner-thumb-carousel')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 1,
        slidesToScroll: 1,
        autoplay: true,
        autoplaySpeed: 8000,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: e('.af-thumb-navcontrols'),
        rtl: n.RtlCheck(),
        responsive: [
          {
            breakpoint: 480,
            settings: {
              slidesToShow: 1,
              slidesToScroll: 1,
            },
          },
        ],
      });

    e('.banner-thumb-carousel')
      .not('.slick-initialized')
      .slick({
        slidesToShow: 2,
        slidesToScroll: 1,
        autoplay: true,
        autoplaySpeed: 8000,
        infinite: true,
        loop: true,
        dots: false,
        nextArrow:
          '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
        prevArrow:
          '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
        appendArrows: e('.af-thumb-navcontrols'),
        rtl: n.RtlCheck(),
        responsive: [
          {
            breakpoint: 480,
            settings: {
              slidesToShow: 1,
              slidesToScroll: 1,
            },
          },
        ],
      });
  }),
    (n.SlickWidgetPostSlider = function () {
      e('.af-widget-post-slider').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 5000,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-post-slider-navcontrols'),
            rtl: n.RtlCheck(),
          });
      });
    }),
    //Slick Carousel
    (n.SlickCarousel = function () {
      e('.af-featured-post-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 5000,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e('.af-widget-featured-post-carousel-navcontrols'),
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 1025,
                settings: {
                  slidesToShow: 3,
                  slidesToScroll: 3,
                },
              },
              {
                breakpoint: 769,
                settings: {
                  slidesToShow: 2,
                  slidesToScroll: 2,
                },
              },
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  slidesToScroll: 1,
                },
              },
              {
                breakpoint: 480,
                settings: {
                  slidesToShow: 1,
                  slidesToScroll: 1,
                },
              },
            ],
          });
      });
    }),
    (n.WidgetSlickCarousel = function () {
      e('#secondary .af-widget-post-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 5000,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-post-carousel-navcontrols'),
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 769,
                settings: {
                  slidesToShow: 2,
                  slidesToScroll: 2,
                },
              },
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  slidesToScroll: 1,
                },
              },
            ],
          });
      });

      e('.primary-footer .af-widget-post-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 5000,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-post-carousel-navcontrols'),
            rtl: n.RtlCheck(),
          });
      });

      e('#sidr .af-widget-post-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 5000,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-post-carousel-navcontrols'),
            rtl: n.RtlCheck(),
          });
      });

      e('body.full-width-content #primary .af-widget-post-carousel').each(
        function () {
          e(this)
            .not('.slick-initialized')
            .slick({
              slidesToShow: 3,
              slidesToScroll: 1,
              autoplay: true,
              autoplaySpeed: 5000,
              infinite: true,
              nextArrow:
                '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
              prevArrow:
                '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
              appendArrows: e(this)
                .parents('.chromenews-widget')
                .find('.af-widget-post-carousel-navcontrols'),
              rtl: n.RtlCheck(),
              responsive: [
                {
                  breakpoint: 600,
                  settings: {
                    slidesToShow: 1,
                    slidesToScroll: 1,
                  },
                },
              ],
            });
        }
      );

      e('.af-widget-post-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 2,
            slidesToScroll: 1,
            autoplay: true,
            autoplaySpeed: 5000,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-post-carousel-navcontrols'),
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  slidesToScroll: 1,
                },
              },
            ],
          });
      });
    }),
    //slick slider
    (n.SlickTabbedCarousel = function () {
      e('body.full-width-content #primary .aft-tabbed-carousel').each(
        function () {
          e(this)
            .not('.slick-initialized')
            .slick({
              slidesToShow: 3,
              slidesToScroll: 1,
              autoplay: true,
              infinite: true,
              loop: true,
              dots: false,
              arrows: false,
              rtl: n.RtlCheck(),
              responsive: [
                {
                  breakpoint: 1025,
                  settings: {
                    slidesToShow: 2,
                    draggable: false,
                    swipeToSlide: false,
                    touchMove: false,
                    swipe: false,
                  },
                },
                {
                  breakpoint: 600,
                  settings: {
                    slidesToShow: 1,
                    draggable: false,
                    swipeToSlide: false,
                    touchMove: false,
                    swipe: false,
                  },
                },
              ],
            });
        }
      );

      e('#primary .aft-tabbed-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 2,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            dots: false,
            arrows: false,
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                },
              },
            ],
          });
      });

      e('.primary-footer .aft-tabbed-carousel').each(function () {
        e(this).not('.slick-initialized').slick({
          slidesToShow: 3,
          slidesToScroll: 1,
          autoplay: true,
          infinite: true,
          loop: true,
          vertical: true,
          verticalSwiping: true,
          dots: false,
          arrows: false,
        });
      });

      e('#sidr .aft-tabbed-carousel').each(function () {
        e(this).not('.slick-initialized').slick({
          slidesToShow: 3,
          slidesToScroll: 1,
          autoplay: true,
          infinite: true,
          loop: true,
          vertical: true,
          verticalSwiping: true,
          dots: false,
          arrows: false,
        });
      });

      e('.aft-banner-compressed-aligned .aft-tabbed-carousel').each(
        function () {
          e(this).not('.slick-initialized').slick({
            slidesToShow: 4,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            arrows: false,
          });
        }
      );

      e('.aft-tabbed-carousel')
        .not('.slick-initialized')
        .slick({
          slidesToShow: 3,
          slidesToScroll: 1,
          autoplaySpeed: 10000,
          autoplay: true,
          infinite: true,
          loop: true,
          vertical: true,
          verticalSwiping: true,
          dots: false,
          arrows: false,
          responsive: [
            {
              breakpoint: 1025,
              settings: {
                slidesToShow: 2,
                slidesToScroll: 1,
                vertical: false,
                verticalSwiping: false,
                draggable: false,
                swipeToSlide: false,
                touchMove: false,
                swipe: false,
                rtl: n.RtlCheck(),
              },
            },
            {
              breakpoint: 600,
              settings: {
                draggable: false,
                swipeToSlide: false,
                touchMove: false,
                swipe: false,
              },
            },
          ],
        });
    }),
    (n.SlickWidgetTrendingVerticalCarousel = function () {
      e('body.full-width-content #primary .af-trending-widget-carousel').each(
        function () {
          e(this)
            .not('.slick-initialized')
            .slick({
              slidesToShow: 3,
              slidesToScroll: 1,
              autoplay: true,
              infinite: true,
              loop: true,
              dots: false,
              nextArrow:
                '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
              prevArrow:
                '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
              appendArrows: e(this)
                .parents('.chromenews-widget')
                .find('.af-widget-trending-carousel-navcontrols'),
              rtl: n.RtlCheck(),
              responsive: [
                {
                  breakpoint: 1025,
                  settings: {
                    slidesToShow: 2,
                    draggable: false,
                    swipeToSlide: false,
                    touchMove: false,
                    swipe: false,
                  },
                },
                {
                  breakpoint: 600,
                  settings: {
                    slidesToShow: 1,
                    draggable: false,
                    swipeToSlide: false,
                    touchMove: false,
                    swipe: false,
                  },
                },
              ],
            });
        }
      );

      e('#primary .af-trending-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 2,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-trending-carousel-navcontrols'),
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                },
              },
            ],
          });
      });

      e('.primary-footer .af-trending-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-trending-carousel-navcontrols'),
          });
      });

      e('#sidr .af-trending-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-trending-carousel-navcontrols'),
          });
      });

      e('.af-trending-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-trending-carousel-navcontrols'),
            responsive: [
              {
                breakpoint: 1025,
                settings: {
                  slidesToShow: 2,
                  slidesToScroll: 1,
                  vertical: false,
                  verticalSwiping: false,
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                  rtl: n.RtlCheck(),
                },
              },
              {
                breakpoint: 600,
                settings: {
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                },
              },
            ],
          });
      });
    }),
    (n.SlickWidgetPopularVerticalCarousel = function () {
      e('body.full-width-content #primary .af-popular-widget-carousel').each(
        function () {
          e(this)
            .not('.slick-initialized')
            .slick({
              slidesToShow: 3,
              slidesToScroll: 1,
              autoplay: true,
              infinite: true,
              loop: true,
              dots: false,
              nextArrow:
                '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
              prevArrow:
                '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
              appendArrows: e(this)
                .parents('.chromenews-widget')
                .find('.af-widget-popular-carousel-navcontrols'),
              rtl: n.RtlCheck(),
              responsive: [
                {
                  breakpoint: 1025,
                  settings: {
                    slidesToShow: 2,
                    draggable: false,
                    swipeToSlide: false,
                    touchMove: false,
                    swipe: false,
                  },
                },
                {
                  breakpoint: 600,
                  settings: {
                    slidesToShow: 1,
                    draggable: false,
                    swipeToSlide: false,
                    touchMove: false,
                    swipe: false,
                  },
                },
              ],
            });
        }
      );

      e('#primary .af-popular-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 2,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-popular-carousel-navcontrols'),
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                },
              },
            ],
          });
      });

      e('.primary-footer .af-popular-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-popular-carousel-navcontrols'),
          });
      });

      e('#sidr .af-popular-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-popular-carousel-navcontrols'),
          });
      });

      e('.af-popular-widget-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            autoplay: true,
            infinite: true,
            loop: true,
            vertical: true,
            verticalSwiping: true,
            dots: false,
            nextArrow:
              '<span class="slide-icon slide-next icon-up fas fa-angle-up"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-down fas fa-angle-down"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-popular-carousel-navcontrols'),
            responsive: [
              {
                breakpoint: 1025,
                settings: {
                  slidesToShow: 2,
                  slidesToScroll: 1,
                  vertical: false,
                  verticalSwiping: false,
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                  rtl: n.RtlCheck(),
                },
              },
              {
                breakpoint: 600,
                settings: {
                  draggable: false,
                  swipeToSlide: false,
                  touchMove: false,
                  swipe: false,
                },
              },
            ],
          });
      });
    }),
    //Video thumbnail
    (n.YouTubeThumbnail = function () {
      e('.af-youtube-slider').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 1,
            slidesToScroll: 1,
            loop: true,
            infinite: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-widget')
              .find('.af-widget-yt-carousel-navcontrols'),
            fade: true,
            rtl: n.RtlCheck(),
            asNavFor: '.af-youtube-slider-thumbnail',
          });
      });

      e('.af-youtube-video-carousel').each(function () {
        e(this)
          .not('.slick-initialized')
          .slick({
            slidesToShow: 3,
            slidesToScroll: 1,
            loop: true,
            infinite: true,
            dots: false,
            arrows: true,
            nextArrow:
              '<span class="slide-icon slide-next icon-right fas fa-angle-right"></span>',
            prevArrow:
              '<span class="slide-icon slide-prev icon-left fas fa-angle-left"></span>',
            appendArrows: e(this)
              .parents('.chromenews-customizer')
              .find('.af-widget-featured-yt-carousel-navcontrols'),
            rtl: n.RtlCheck(),
            responsive: [
              {
                breakpoint: 1025,
                settings: {
                  slidesToShow: 2,
                  slidesToScroll: 1,
                  infinite: true,
                },
              },
              {
                breakpoint: 600,
                settings: {
                  slidesToShow: 1,
                  slidesToScroll: 1,
                },
              },
            ],
          });
      });

      e('body.full-width-content #primary .af-youtube-slider-thumbnail')
        .not('.slick-initialized')
        .slick({
          slidesToShow: 6,
          slidesToScroll: 1,
          loop: true,
          infinite: true,
          dots: false,
          arrows: false,
          focusOnSelect: true,
          asNavFor: '.af-youtube-slider',
          rtl: n.RtlCheck(),
          responsive: [
            {
              breakpoint: 1025,
              settings: {
                slidesToShow: 3,
                slidesToScroll: 1,
                infinite: true,
              },
            },
            {
              breakpoint: 600,
              settings: {
                slidesToShow: 2,
                slidesToScroll: 1,
                vertical: false,
                verticalSwiping: false,
              },
            },
          ],
        });

      e('.af-youtube-slider-thumbnail')
        .not('.slick-initialized')
        .slick({
          slidesToShow: 4,
          slidesToScroll: 1,
          loop: true,
          infinite: true,
          dots: false,
          arrows: false,
          focusOnSelect: true,
          asNavFor: '.af-youtube-slider',
          rtl: n.RtlCheck(),
          responsive: [
            {
              breakpoint: 1025,
              settings: {
                slidesToShow: 3,
                slidesToScroll: 1,
                infinite: true,
              },
            },
            {
              breakpoint: 600,
              settings: {
                slidesToShow: 2,
                slidesToScroll: 1,
                vertical: false,
                verticalSwiping: false,
              },
            },
          ],
        });

      /*JS FOR FEATURED SECTION THUMBNAILS*/
      e('.entry-header-yt-thumbnail').on('click', function (evt) {
        if (
          e(this)
            .parents('.primary-video')
            .find('.entry-header-yt-thumbnail')
            .hasClass('af-hide-item')
        ) {
          e(this)
            .parents('.primary-video')
            .find('.entry-header-yt-iframe')
            .addClass('af-hide-item');
          e(this)
            .parents('.primary-video')
            .find('.entry-header-yt-thumbnail')
            .removeClass('af-hide-item');
          e(this).parents('.primary-video').find('.vid_frame').attr('src', '');
        }

        e(this)
          .parents('.entry-header-yt-video-container')
          .find('.entry-header-yt-iframe')
          .removeClass('af-hide-item');
        e(this)
          .parents('.entry-header-yt-video-container')
          .find('.entry-header-yt-thumbnail')
          .addClass('af-hide-item');
        e(this).css('padding-top', 0);
        var video_link = e(this).attr('data-video-link');
        e(this).parent().find('.vid_frame').attr('src', video_link);
        e('.vid-container').fitVids();
      });

      e('.featured-yt-sec .slick-arrow').on('click', function (evt) {
        if (
          e(this)
            .parents('.primary-video')
            .find('.entry-header-yt-thumbnail')
            .hasClass('af-hide-item')
        ) {
          e(this)
            .parents('.primary-video')
            .find('.entry-header-yt-iframe')
            .addClass('af-hide-item');
          e(this)
            .parents('.primary-video')
            .find('.entry-header-yt-thumbnail')
            .removeClass('af-hide-item');
          e(this).parents('.primary-video').find('.vid_frame').attr('src', '');
        }
      });

      /*JS FOR WIDGET SECTION THUMBNAILS*/
      e('.widget-yt-thumbnail').on('click', function (evt) {
        if (
          e(this)
            .parents('.secondary-video')
            .find('.widget-yt-thumbnail')
            .hasClass('af-hide-item')
        ) {
          e(this)
            .parents('.secondary-video')
            .find('.widget-yt-iframe')
            .removeClass('af-hide-frame');
          e(this)
            .parents('.secondary-video')
            .find('.widget-yt-thumbnail')
            .addClass('af-hide-frame');
          e(this)
            .parents('.secondary-video')
            .find('.vid_frame')
            .attr('src', '');
        }

        e(this)
          .parents('.secondary-video')
          .find('.widget-yt-iframe')
          .removeClass('af-hide-frame');
        e(this)
          .parents('.secondary-video')
          .find('.widget-yt-thumbnail')
          .addClass('af-hide-frame');
        e(this).css('padding-top', 0);
        var video_link = e(this).attr('data-video-link');
        e(this).parent().find('.vid_frame').attr('src', video_link);
        //e(".vid-container").fitVids();
      });

      e('.slick-arrow').on('click', function (evt) {
        if (
          e(this)
            .parents('.secondary-video')
            .find('.widget-yt-thumbnail')
            .hasClass('af-hide-item')
        ) {
          e(this)
            .parents('.secondary-video')
            .find('.entry-header-yt-iframe')
            .addClass('af-hide-item');
          e(this)
            .parents('.secondary-video')
            .find('.entry-header-yt-thumbnail')
            .removeClass('af-hide-item');
          e(this)
            .parents('.secondary-video')
            .find('.vid_frame')
            .attr('src', '');
        }
      });
    }),
    (n.MasonryBlog = function () {
      if (e('.aft-masonry-archive-posts').length > 0) {
        jQuery('.aft-masonry-archive-posts').masonry();
      }
    }),
    (n.CurrentTimeRunner = function () {
      var topbarTimeElement = document.getElementById('topbar-time');
      if (topbarTimeElement) {
        var aftSetInterval = setInterval(function () {
          aftToLocaleTimeString();
        }, 100);

        function aftToLocaleTimeString() {
          var aftDate = new Date();
          var aftTimeFormat = AFlocalizedTime.format;
          topbarTimeElement.innerHTML =
            aftDate.toLocaleTimeString(aftTimeFormat);
        }
      }
    }),
    e(document).ready(function () {
      n.mobileMenu.init(), n.setInstaHeight(), n.searchReveal(), n.scroll_up();
    }),
    e(window).on('scroll', function () {
      n.show_hide_scroll_top();
    }),
    e(window).on('load', function () {
      n.DataBackground(),
        n.CurrentTimeRunner(),
        n.MasonryBlog(),
        n.Preloader(),
        n.BootstrapTabsChange(),
        n.Search();

      if (typeof e.fn.marquee == 'function') {
        n.jQueryMarquee();
      }

      if (typeof e.fn.sidr == 'function') {
        n.Offcanvas();
      }

      if (typeof e.fn.slick == 'function') {
        n.SlickBannerCarousel(),
          n.SlickWidgetPostSlider(),
          n.WidgetSlickCarousel(),
          n.SlickCarousel(),
          n.SlickTabbedCarousel(),
          n.SlickTrendingVerticalCarousel(),
          n.SlickWidgetTrendingVerticalCarousel(),
          n.SlickWidgetPopularVerticalCarousel(),
          n.YouTubeThumbnail();
      }

      if (typeof e.fn.magnificPopup == 'function') {
        n.MagnificPopup();
      }
    }),
    e(window).on('resize', function () {
      n.mobileMenu.menuMobile();
    });
})(jQuery);
// source --> https://embanews.com.br/wp-content/themes/chromenews-pro/assets/video-script.js?ver=6.0.4 
/*jshint browser:true */
/*!
* FitVids 1.1
* Copyright 2013, Chris Coyier - https://css-tricks.com + Dave Rupert - http://daverupert.com
* Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/
* Released under the WTFPL license - http://sam.zoy.org/wtfpl/
*
*/
$ = jQuery;
!(function(t) {
    "use strict";
    (t.fn.fitVids = function(e) {
        var i = { customSelector: null, ignore: null };
        if (!document.getElementById("fit-vids-style")) {
            var r = document.head || document.getElementsByTagName("head")[0],
                a =
                    ".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}",
                d = document.createElement("div");

            (d.innerHTML = '<p>x</p><style id="fit-vids-style">' + a + "</style>"),
                r.appendChild(d.childNodes[1]);
        }
        return (
            e && t.extend(i, e),
                this.each(function() {
                    var e = [
                        'iframe[src*="player.vimeo.com"]',
                        'iframe[src*="youtube.com"]',
                        'iframe[src*="youtube-nocookie.com"]',
                        'iframe[src*="kickstarter.com"][src*="video.html"]',
                        "object",
                        "embed"
                    ];
                    i.customSelector && e.push(i.customSelector);
                    var r = ".fitvidsignore";
                    i.ignore && (r = r + ", " + i.ignore);
                    var a = t(this).find(e.join(","));
                    (a = a.not("object object")),
                        (a = a.not(r)),
                        a.each(function() {
                            var e = t(this);
                            if (
                                !(
                                    e.parents(r).length > 0 ||
                                    ("embed" === this.tagName.toLowerCase() &&
                                        e.parent("object").length) ||
                                    e.parent(".fluid-width-video-wrapper").length
                                )
                            ) {
                                e.css("height") ||
                                e.css("width") ||
                                (!isNaN(e.attr("height")) && !isNaN(e.attr("width"))) ||
                                (e.attr("height", 9), e.attr("width", 16));
                                var i =
                                        "object" === this.tagName.toLowerCase() ||
                                        (e.attr("height") && !isNaN(parseInt(e.attr("height"), 10)))
                                            ? parseInt(e.attr("height"), 10)
                                            : e.height(),
                                    a = isNaN(parseInt(e.attr("width"), 10))
                                        ? e.width()
                                        : parseInt(e.attr("width"), 10),
                                    d = i / a;
                                if (!e.attr("name")) {
                                    var o = "fitvid" + t.fn.fitVids._count;
                                    e.attr("name", o), t.fn.fitVids._count++;
                                }
                                e
                                    .wrap('<div class="fluid-width-video-wrapper"></div>')
                                    .parent(".fluid-width-video-wrapper")
                                    .css("padding-top", 100 * d + "%"),
                                    e.removeAttr("height").removeAttr("width");
                            }
                        });
                })
        );
    }),
        (t.fn.fitVids._count = 0);
})(window.jQuery || window.Zepto);
// source --> https://embanews.com.br/wp-content/themes/chromenews-pro/assets/sidr/js/jquery.sidr.min.js?ver=6.0.4 
/*! sidr - v2.2.1 - 2016-02-17
 * http://www.berriart.com/sidr/
 * Copyright (c) 2013-2016 Alberto Varela; Licensed MIT */
!function(){"use strict";function a(a,b,c){var d=new o(b);switch(a){case"open":d.open(c);break;case"close":d.close(c);break;case"toggle":d.toggle(c);break;default:p.error("Method "+a+" does not exist on jQuery.sidr")}}function b(a){return"status"===a?h:s[a]?s[a].apply(this,Array.prototype.slice.call(arguments,1)):"function"!=typeof a&&"string"!=typeof a&&a?void q.error("Method "+a+" does not exist on jQuery.sidr"):s.toggle.apply(this,arguments)}function c(a,b){if("function"==typeof b.source){var c=b.source(name);a.html(c)}else if("string"==typeof b.source&&i.isUrl(b.source))u.get(b.source,function(b){a.html(b)});else if("string"==typeof b.source){var d="",e=b.source.split(",");if(u.each(e,function(a,b){d+='<div class="sidr-inner">'+u(b).html()+"</div>"}),b.renaming){var f=u("<div />").html(d);f.find("*").each(function(a,b){var c=u(b);i.addPrefixes(c)}),d=f.html()}a.html(d)}else null!==b.source&&u.error("Invalid Sidr Source");return a}function d(a){var d=i.transitions,e=u.extend({name:"sidr",speed:200,side:"left",source:null,renaming:!0,body:"body",displace:!0,timing:"ease",method:"toggle",bind:"touchstart click",onOpen:function(){},onClose:function(){},onOpenEnd:function(){},onCloseEnd:function(){}},a),f=e.name,g=u("#"+f);return 0===g.length&&(g=u("<div />").attr("id",f).appendTo(u("body"))),d.supported&&g.css(d.property,e.side+" "+e.speed/1e3+"s "+e.timing),g.addClass("sidr").addClass(e.side).data({speed:e.speed,side:e.side,body:e.body,displace:e.displace,timing:e.timing,method:e.method,onOpen:e.onOpen,onClose:e.onClose,onOpenEnd:e.onOpenEnd,onCloseEnd:e.onCloseEnd}),g=c(g,e),this.each(function(){var a=u(this),c=a.data("sidr"),d=!1;c||(h.moving=!1,h.opened=!1,a.data("sidr",f),a.bind(e.bind,function(a){a.preventDefault(),d||(d=!0,b(e.method,f),setTimeout(function(){d=!1},100))}))})}var e={};e.classCallCheck=function(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")},e.createClass=function(){function a(a,b){for(var c=0;c<b.length;c++){var d=b[c];d.enumerable=d.enumerable||!1,d.configurable=!0,"value"in d&&(d.writable=!0),Object.defineProperty(a,d.key,d)}}return function(b,c,d){return c&&a(b.prototype,c),d&&a(b,d),b}}();var f,g,h={moving:!1,opened:!1},i={isUrl:function(a){var b=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.?)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");return b.test(a)?!0:!1},addPrefixes:function(a){this.addPrefix(a,"id"),this.addPrefix(a,"class"),a.removeAttr("style")},addPrefix:function(a,b){var c=a.attr(b);"string"==typeof c&&""!==c&&"sidr-inner"!==c&&a.attr(b,c.replace(/([A-Za-z0-9_.\-]+)/g,"sidr-"+b+"-$1"))},transitions:function(){var a=document.body||document.documentElement,b=a.style,c=!1,d="transition";return d in b?c=!0:!function(){var a=["moz","webkit","o","ms"],e=void 0,f=void 0;d=d.charAt(0).toUpperCase()+d.substr(1),c=function(){for(f=0;f<a.length;f++)if(e=a[f],e+d in b)return!0;return!1}(),d=c?"-"+e.toLowerCase()+"-"+d.toLowerCase():null}(),{supported:c,property:d}}()},j=jQuery,k="sidr-animating",l="open",m="close",n="webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend",o=function(){function a(b){e.classCallCheck(this,a),this.name=b,this.item=j("#"+b),this.openClass="sidr"===b?"sidr-open":"sidr-open "+b+"-open",this.menuWidth=this.item.outerWidth(!0),this.speed=this.item.data("speed"),this.side=this.item.data("side"),this.displace=this.item.data("displace"),this.timing=this.item.data("timing"),this.method=this.item.data("method"),this.onOpenCallback=this.item.data("onOpen"),this.onCloseCallback=this.item.data("onClose"),this.onOpenEndCallback=this.item.data("onOpenEnd"),this.onCloseEndCallback=this.item.data("onCloseEnd"),this.body=j(this.item.data("body"))}return e.createClass(a,[{key:"getAnimation",value:function(a,b){var c={},d=this.side;return"open"===a&&"body"===b?c[d]=this.menuWidth+"px":"close"===a&&"menu"===b?c[d]="-"+this.menuWidth+"px":c[d]=0,c}},{key:"prepareBody",value:function(a){var b="open"===a?"hidden":"";if(this.body.is("body")){var c=j("html"),d=c.scrollTop();c.css("overflow-x",b).scrollTop(d)}}},{key:"openBody",value:function(){if(this.displace){var a=i.transitions,b=this.body;if(a.supported)b.css(a.property,this.side+" "+this.speed/1e3+"s "+this.timing).css(this.side,0).css({width:b.width(),position:"absolute"}),b.css(this.side,this.menuWidth+"px");else{var c=this.getAnimation(l,"body");b.css({width:b.width(),position:"absolute"}).animate(c,{queue:!1,duration:this.speed})}}}},{key:"onCloseBody",value:function(){var a=i.transitions,b={width:"",position:"",right:"",left:""};a.supported&&(b[a.property]=""),this.body.css(b).unbind(n)}},{key:"closeBody",value:function(){var a=this;if(this.displace)if(i.transitions.supported)this.body.css(this.side,0).one(n,function(){a.onCloseBody()});else{var b=this.getAnimation(m,"body");this.body.animate(b,{queue:!1,duration:this.speed,complete:function(){a.onCloseBody()}})}}},{key:"moveBody",value:function(a){a===l?this.openBody():this.closeBody()}},{key:"onOpenMenu",value:function(a){var b=this.name;h.moving=!1,h.opened=b,this.item.unbind(n),this.body.removeClass(k).addClass(this.openClass),this.onOpenEndCallback(),"function"==typeof a&&a(b)}},{key:"openMenu",value:function(a){var b=this,c=this.item;if(i.transitions.supported)c.css(this.side,0).one(n,function(){b.onOpenMenu(a)});else{var d=this.getAnimation(l,"menu");c.css("display","block").animate(d,{queue:!1,duration:this.speed,complete:function(){b.onOpenMenu(a)}})}}},{key:"onCloseMenu",value:function(a){this.item.css({left:"",right:""}).unbind(n),j("html").css("overflow-x",""),h.moving=!1,h.opened=!1,this.body.removeClass(k).removeClass(this.openClass),this.onCloseEndCallback(),"function"==typeof a&&a(name)}},{key:"closeMenu",value:function(a){var b=this,c=this.item;if(i.transitions.supported)c.css(this.side,"").one(n,function(){b.onCloseMenu(a)});else{var d=this.getAnimation(m,"menu");c.animate(d,{queue:!1,duration:this.speed,complete:function(){b.onCloseMenu()}})}}},{key:"moveMenu",value:function(a,b){this.body.addClass(k),a===l?this.openMenu(b):this.closeMenu(b)}},{key:"move",value:function(a,b){h.moving=!0,this.prepareBody(a),this.moveBody(a),this.moveMenu(a,b)}},{key:"open",value:function(b){var c=this;if(h.opened!==this.name&&!h.moving){if(h.opened!==!1){var d=new a(h.opened);return void d.close(function(){c.open(b)})}this.move("open",b),this.onOpenCallback()}}},{key:"close",value:function(a){h.opened!==this.name||h.moving||(this.move("close",a),this.onCloseCallback())}},{key:"toggle",value:function(a){h.opened===this.name?this.close(a):this.open(a)}}]),a}(),p=jQuery,q=jQuery,r=["open","close","toggle"],s={},t=function(b){return function(c,d){"function"==typeof c?(d=c,c="sidr"):c||(c="sidr"),a(b,c,d)}};for(f=0;f<r.length;f++)g=r[f],s[g]=t(g);var u=jQuery;jQuery.sidr=b,jQuery.fn.sidr=d}();
// source --> https://embanews.com.br/wp-content/themes/chromenews-pro/assets/marquee/jquery.marquee.js?ver=6.0.4 
/**
 * jQuery.marquee - scrolling text like old marquee element
 * @author Aamir Afridi - aamirafridi(at)gmail(dot)com / http://aamirafridi.com/jquery/jquery-marquee-plugin
 */;
(function($) {
    $.fn.marquee = function(options) {
        return this.each(function() {
            // Extend the options if any provided
            var o = $.extend({}, $.fn.marquee.defaults, options),
                $this = $(this),
                $marqueeWrapper, containerWidth, animationCss, verticalDir, elWidth,
                loopCount = 3,
                playState = 'animation-play-state',
                css3AnimationIsSupported = false,

                // Private methods
                _prefixedEvent = function(element, type, callback) {
                    var pfx = ["webkit", "moz", "MS", "o", ""];
                    for (var p = 0; p < pfx.length; p++) {
                        if (!pfx[p]) type = type.toLowerCase();
                        element.addEventListener(pfx[p] + type, callback, false);
                    }
                },

                _objToString = function(obj) {
                    var tabjson = [];
                    for (var p in obj) {
                        if (obj.hasOwnProperty(p)) {
                            tabjson.push(p + ':' + obj[p]);
                        }
                    }
                    tabjson.push();
                    return '{' + tabjson.join(',') + '}';
                },

                _startAnimationWithDelay = function() {
                    $this.timer = setTimeout(animate, o.delayBeforeStart);
                },

                // Public methods
                methods = {
                    pause: function() {
                        if (css3AnimationIsSupported && o.allowCss3Support) {
                            $marqueeWrapper.css(playState, 'paused');
                        } else {
                            // pause using pause plugin
                            if ($.fn.pause) {
                                $marqueeWrapper.pause();
                            }
                        }
                        // save the status
                        $this.data('runningStatus', 'paused');
                        // fire event
                        $this.trigger('paused');
                    },

                    resume: function() {
                        // resume using css3
                        if (css3AnimationIsSupported && o.allowCss3Support) {
                            $marqueeWrapper.css(playState, 'running');
                        } else {
                            // resume using pause plugin
                            if ($.fn.resume) {
                                $marqueeWrapper.resume();
                            }
                        }
                        // save the status
                        $this.data('runningStatus', 'resumed');
                        // fire event
                        $this.trigger('resumed');
                    },

                    toggle: function() {
                        methods[$this.data('runningStatus') == 'resumed' ? 'pause' : 'resume']();
                    },

                    destroy: function() {
                        // Clear timer
                        clearTimeout($this.timer);
                        // Unbind all events
                        $this.find("*").addBack().unbind();
                        // Just unwrap the elements that has been added using this plugin
                        $this.html($this.find('.js-marquee:first').html());
                    }
                };

            // Check for methods
            if (typeof options === 'string') {
                if ($.isFunction(methods[options])) {
                    // Following two IF statements to support public methods
                    if (!$marqueeWrapper) {
                        $marqueeWrapper = $this.find('.js-marquee-wrapper');
                    }
                    if ($this.data('css3AnimationIsSupported') === true) {
                        css3AnimationIsSupported = true;
                    }
                    methods[options]();
                }
                return;
            }

            /* Check if element has data attributes. They have top priority
               For details https://twitter.com/aamirafridi/status/403848044069679104 - Can't find a better solution :/
               jQuery 1.3.2 doesn't support $.data().KEY hence writting the following */
            var dataAttributes = {},
            attr;
            $.each(o, function(key, value) {
                // Check if element has this data attribute
                attr = $this.attr('data-' + key);
                if (typeof attr !== 'undefined') {
                    // Now check if value is boolean or not
                    switch (attr) {
                        case 'true':
                            attr = true;
                            break;
                        case 'false':
                            attr = false;
                            break;
                    }
                    o[key] = attr;
                }
            });

            // since speed option is changed to duration, to support speed for those who are already using it
            o.duration = o.speed || o.duration;

            // Shortcut to see if direction is upward or downward
            verticalDir = o.direction == 'up' || o.direction == 'down';

            // no gap if not duplicated
            o.gap = o.duplicated ? parseInt(o.gap) : 0;

            // wrap inner content into a div
            $this.wrapInner('<div class="js-marquee"></div>');

            // Make copy of the element
            var $el = $this.find('.js-marquee').css({
                'margin-right': o.gap,
                'float': 'left'
            });

            if (o.duplicated) {
                $el.clone(true).appendTo($this);
            }

            // wrap both inner elements into one div
            $this.wrapInner('<div style="width:100000px" class="js-marquee-wrapper"></div>');

            // Save the reference of the wrapper
            $marqueeWrapper = $this.find('.js-marquee-wrapper');

            // If direction is up or down, get the height of main element
            if (verticalDir) {
                var containerHeight = $this.height();
                $marqueeWrapper.removeAttr('style');
                $this.height(containerHeight);

                // Change the CSS for js-marquee element
                $this.find('.js-marquee').css({
                    'float': 'none',
                    'margin-bottom': o.gap,
                    'margin-right': 0
                });

                // Remove bottom margin from 2nd element if duplicated
                if (o.duplicated) $this.find('.js-marquee:last').css({
                    'margin-bottom': 0
                });

                var elHeight = $this.find('.js-marquee:first').height() + o.gap;

                // adjust the animation speed according to the text length
                if (o.startVisible && !o.duplicated) {
                    // Compute the complete animation duration and save it for later reference
                    // formula is to: (Height of the text node + height of the main container / Height of the main container) * speed;
                    o._completeDuration = ((parseInt(elHeight, 10) + parseInt(containerHeight, 10)) / parseInt(containerHeight, 10)) * o.duration;

                    // formula is to: (Height of the text node / height of the main container) * speed
                    o.duration = (parseInt(elHeight, 10) / parseInt(containerHeight, 10)) * o.duration;
                } else {
                    // formula is to: (Height of the text node + height of the main container / Height of the main container) * speed;
                    o.duration = ((parseInt(elHeight, 10) + parseInt(containerHeight, 10)) / parseInt(containerHeight, 10)) * o.duration;
                }

            } else {
                // Save the width of the each element so we can use it in animation
                elWidth = $this.find('.js-marquee:first').width() + o.gap;

                // container width
                containerWidth = $this.width();

                // adjust the animation speed according to the text length
                if (o.startVisible && !o.duplicated) {
                    // Compute the complete animation duration and save it for later reference
                    // formula is to: (Width of the text node + width of the main container / Width of the main container) * speed;
                    o._completeDuration = ((parseInt(elWidth, 10) + parseInt(containerWidth, 10)) / parseInt(containerWidth, 10)) * o.duration;

                    // (Width of the text node / width of the main container) * speed
                    o.duration = (parseInt(elWidth, 10) / parseInt(containerWidth, 10)) * o.duration;
                } else {
                    // formula is to: (Width of the text node + width of the main container / Width of the main container) * speed;
                    o.duration = ((parseInt(elWidth, 10) + parseInt(containerWidth, 10)) / parseInt(containerWidth, 10)) * o.duration;
                }
            }

            // if duplicated then reduce the speed
            if (o.duplicated) {
                o.duration = o.duration / 2;
            }

            if (o.allowCss3Support) {
                var
                elm = document.body || document.createElement('div'),
                    animationName = 'marqueeAnimation-' + Math.floor(Math.random() * 10000000),
                    domPrefixes = 'Webkit Moz O ms Khtml'.split(' '),
                    animationString = 'animation',
                    animationCss3Str = '',
                    keyframeString = '';

                // Check css3 support
                if (elm.style.animation) {
                    keyframeString = '@keyframes ' + animationName + ' ';
                    css3AnimationIsSupported = true;
                }

                if (css3AnimationIsSupported === false) {
                    for (var i = 0; i < domPrefixes.length; i++) {
                        if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {
                            var prefix = '-' + domPrefixes[i].toLowerCase() + '-';
                            animationString = prefix + animationString;
                            playState = prefix + playState;
                            keyframeString = '@' + prefix + 'keyframes ' + animationName + ' ';
                            css3AnimationIsSupported = true;
                            break;
                        }
                    }
                }

                if (css3AnimationIsSupported) {
                    animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's infinite ' + o.css3easing;
                    $this.data('css3AnimationIsSupported', true);
                }
            }

            var _rePositionVertically = function() {
                $marqueeWrapper.css('margin-top', o.direction == 'up' ? containerHeight + 'px' : '-' + elHeight + 'px');
            },
            _rePositionHorizontally = function() {
                $marqueeWrapper.css('margin-left', o.direction == 'left' ? containerWidth + 'px' : '-' + elWidth + 'px');
            };

            // if duplicated option is set to true than position the wrapper
            if (o.duplicated) {
                if (verticalDir) {
                    if (o.startVisible) {
                        $marqueeWrapper.css('margin-top', 0);
                    } else {
                        $marqueeWrapper.css('margin-top', o.direction == 'up' ? containerHeight + 'px' : '-' + ((elHeight * 2) - o.gap) + 'px');
                    }
                } else {
                    if (o.startVisible) {
                        $marqueeWrapper.css('margin-left', 0);
                    } else {
                        $marqueeWrapper.css('margin-left', o.direction == 'left' ? containerWidth + 'px' : '-' + ((elWidth * 2) - o.gap) + 'px');
                    }
                }

                // If the text starts out visible we can skip the two initial loops
                if (!o.startVisible) {
                  loopCount = 1;
                }
            } else if (o.startVisible) {
                // We only have two different loops if marquee is duplicated and starts visible 
                loopCount = 2;
            } else {
                if (verticalDir) {
                    _rePositionVertically();
                } else {
                    _rePositionHorizontally();
                }
            }

            // Animate recursive method
            var animate = function() {
                if (o.duplicated) {
                    // When duplicated, the first loop will be scroll longer so double the duration
                    if (loopCount === 1) {
                        o._originalDuration = o.duration;
                        if (verticalDir) {
                            o.duration = o.direction == 'up' ? o.duration + (containerHeight / ((elHeight) / o.duration)) : o.duration * 2;
                        } else {
                            o.duration = o.direction == 'left' ? o.duration + (containerWidth / ((elWidth) / o.duration)) : o.duration * 2;
                        }
                        // Adjust the css3 animation as well
                        if (animationCss3Str) {
                            animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's ' + o.css3easing;
                        }
                        loopCount++;
                    }
                    // On 2nd loop things back to normal, normal duration for the rest of animations
                    else if (loopCount === 2) {
                        o.duration = o._originalDuration;
                        // Adjust the css3 animation as well
                        if (animationCss3Str) {
                            animationName = animationName + '0';
                            keyframeString = $.trim(keyframeString) + '0 ';
                            animationCss3Str = animationName + ' ' + o.duration / 1000 + 's 0s infinite ' + o.css3easing;
                        }
                        loopCount++;
                    }
                }

                if (verticalDir) {
                    if (o.duplicated) {

                        // Adjust the starting point of animation only when first loops finishes
                        if (loopCount > 2) {
                            $marqueeWrapper.css('margin-top', o.direction == 'up' ? 0 : '-' + elHeight + 'px');
                        }

                        animationCss = {
                            'margin-top': o.direction == 'up' ? '-' + elHeight + 'px' : 0
                        };
                    } else if (o.startVisible) {
                        // This loop moves the marquee out of the container
                        if (loopCount === 2) {
                            // Adjust the css3 animation as well
                            if (animationCss3Str) {
                                animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's ' + o.css3easing;
                            }
                            animationCss = {
                                'margin-top': o.direction == 'up' ? '-' + elHeight + 'px' : containerHeight + 'px'
                            };
                            loopCount++;
                        } else if (loopCount === 3) {
                            // Set the duration for the animation that will run forever
                            o.duration = o._completeDuration;
                            // Adjust the css3 animation as well
                            if (animationCss3Str) {
                                    animationName = animationName + '0';
                                    keyframeString = $.trim(keyframeString) + '0 ';
                                    animationCss3Str = animationName + ' ' + o.duration / 1000 + 's 0s infinite ' + o.css3easing;
                            }
                            _rePositionVertically();
                        }
                    } else {
                        _rePositionVertically();
                        animationCss = {
                            'margin-top': o.direction == 'up' ? '-' + ($marqueeWrapper.height()) + 'px' : containerHeight + 'px'
                        };
                    }
                } else {
                    if (o.duplicated) {

                        // Adjust the starting point of animation only when first loops finishes
                        if (loopCount > 2) {
                            $marqueeWrapper.css('margin-left', o.direction == 'left' ? 0 : '-' + elWidth + 'px');
                        }

                        animationCss = {
                            'margin-left': o.direction == 'left' ? '-' + elWidth + 'px' : 0
                        };

                    } else if (o.startVisible) {
                        // This loop moves the marquee out of the container
                        if (loopCount === 2) {
                            // Adjust the css3 animation as well
                            if (animationCss3Str) {
                                animationCss3Str = animationName + ' ' + o.duration / 1000 + 's ' + o.delayBeforeStart / 1000 + 's ' + o.css3easing;
                            }
                            animationCss = {
                                'margin-left': o.direction == 'left' ? '-' + elWidth + 'px' : containerWidth + 'px'
                            };
                            loopCount++;
                        } else if (loopCount === 3) {
                            // Set the duration for the animation that will run forever
                            o.duration = o._completeDuration;
                            // Adjust the css3 animation as well
                            if (animationCss3Str) {
                                animationName = animationName + '0';
                                keyframeString = $.trim(keyframeString) + '0 ';
                                animationCss3Str = animationName + ' ' + o.duration / 1000 + 's 0s infinite ' + o.css3easing;
                            }
                            _rePositionHorizontally();
                        }
                    } else {
                        _rePositionHorizontally();
                        animationCss = {
                            'margin-left': o.direction == 'left' ? '-' + elWidth + 'px' : containerWidth + 'px'
                        };
                    }
                }

                // fire event
                $this.trigger('beforeStarting');

                // If css3 support is available than do it with css3, otherwise use jQuery as fallback
                if (css3AnimationIsSupported) {
                    // Add css3 animation to the element
                    $marqueeWrapper.css(animationString, animationCss3Str);
                    var keyframeCss = keyframeString + ' { 100%  ' + _objToString(animationCss) + '}',
                         $styles = $marqueeWrapper.find('style');

                    // Now add the keyframe animation to the marquee element
                    if ($styles.length !== 0) {
                        // Bug fixed for jQuery 1.3.x - Instead of using .last(), use following
                        $styles.filter(":last").html(keyframeCss);
                    } else {
                        $('head').append('<style>' + keyframeCss + '</style>');
                    }

                    // Animation iteration event
                    _prefixedEvent($marqueeWrapper[0], "AnimationIteration", function() {
                        $this.trigger('finished');
                    });
                    // Animation stopped
                    _prefixedEvent($marqueeWrapper[0], "AnimationEnd", function() {
                        animate();
                        $this.trigger('finished');
                    });

                } else {
                    // Start animating
                    $marqueeWrapper.animate(animationCss, o.duration, o.easing, function() {
                        // fire event
                        $this.trigger('finished');
                        // animate again
                        if (o.pauseOnCycle) {
                            _startAnimationWithDelay();
                        } else {
                            animate();
                        }
                    });
                }
                // save the status
                $this.data('runningStatus', 'resumed');
            };

            // bind pause and resume events
            $this.bind('pause', methods.pause);
            $this.bind('resume', methods.resume);

            if (o.pauseOnHover) {
                $this.bind('mouseenter mouseleave', methods.toggle);
            }

            // If css3 animation is supported than call animate method at once
            if (css3AnimationIsSupported && o.allowCss3Support) {
                animate();
            } else {
                // Starts the recursive method
                _startAnimationWithDelay();
            }

        });
    }; // End of Plugin
    // Public: plugin defaults options
    $.fn.marquee.defaults = {
        // If you wish to always animate using jQuery
        allowCss3Support: true,
        // works when allowCss3Support is set to true - for full list see http://www.w3.org/TR/2013/WD-css3-transitions-20131119/#transition-timing-function
        css3easing: 'linear',
        // requires jQuery easing plugin. Default is 'linear'
        easing: 'linear',
        // pause time before the next animation turn in milliseconds
        delayBeforeStart: 1000,
        // 'left', 'right', 'up' or 'down'
        direction: 'left',
        // true or false - should the marquee be duplicated to show an effect of continues flow
        duplicated: false,
        // speed in milliseconds of the marquee in milliseconds
        duration: 5000,
        // gap in pixels between the tickers
        gap: 20,
        // on cycle pause the marquee
        pauseOnCycle: false,
        // on hover pause the marquee - using jQuery plugin https://github.com/tobia/Pause
        pauseOnHover: false,
        // the marquee is visible initially positioned next to the border towards it will be moving
        startVisible: false
    };
})(jQuery);
// source --> https://embanews.com.br/wp-content/themes/chromenews-pro/assets/slick/js/slick.min.js?ver=6.0.4 
!(function (i) {
  'use strict';
  'function' == typeof define && define.amd
    ? define(['jquery'], i)
    : 'undefined' != typeof exports
    ? (module.exports = i(require('jquery')))
    : i(jQuery);
})(function (i) {
  'use strict';
  var e = window.Slick || {};
  ((e = (function () {
    var e = 0;
    return function (t, o) {
      var s,
        n = this;
      (n.defaults = {
        accessibility: !0,
        adaptiveHeight: !1,
        appendArrows: i(t),
        appendDots: i(t),
        arrows: !0,
        asNavFor: null,
        prevArrow:
          '<button class="slick-prev" aria-label="Previous" type="button">Previous</button>',
        nextArrow:
          '<button class="slick-next" aria-label="Next" type="button">Next</button>',
        autoplay: !1,
        autoplaySpeed: 3e3,
        centerMode: !1,
        centerPadding: '50px',
        cssEase: 'ease',
        customPaging: function (e, t) {
          return i('<button type="button" />').text(t + 1);
        },
        dots: !1,
        dotsClass: 'slick-dots',
        draggable: !0,
        easing: 'linear',
        edgeFriction: 0.35,
        fade: !1,
        focusOnSelect: !1,
        focusOnChange: !1,
        infinite: !0,
        initialSlide: 0,
        lazyLoad: 'ondemand',
        mobileFirst: !1,
        pauseOnHover: !0,
        pauseOnFocus: !0,
        pauseOnDotsHover: !1,
        respondTo: 'window',
        responsive: null,
        rows: 1,
        rtl: !1,
        slide: '',
        slidesPerRow: 1,
        slidesToShow: 1,
        slidesToScroll: 1,
        speed: 500,
        swipe: !0,
        swipeToSlide: !1,
        touchMove: !0,
        touchThreshold: 5,
        useCSS: !0,
        useTransform: !0,
        variableWidth: !1,
        vertical: !1,
        verticalSwiping: !1,
        waitForAnimate: !0,
        zIndex: 1e3,
      }),
        (n.initials = {
          animating: !1,
          dragging: !1,
          autoPlayTimer: null,
          currentDirection: 0,
          currentLeft: null,
          currentSlide: 0,
          direction: 1,
          $dots: null,
          listWidth: null,
          listHeight: null,
          loadIndex: 0,
          $nextArrow: null,
          $prevArrow: null,
          scrolling: !1,
          slideCount: null,
          slideWidth: null,
          $slideTrack: null,
          $slides: null,
          sliding: !1,
          slideOffset: 0,
          swipeLeft: null,
          swiping: !1,
          $list: null,
          touchObject: {},
          transformsEnabled: !1,
          unslicked: !1,
        }),
        i.extend(n, n.initials),
        (n.activeBreakpoint = null),
        (n.animType = null),
        (n.animProp = null),
        (n.breakpoints = []),
        (n.breakpointSettings = []),
        (n.cssTransitions = !1),
        (n.focussed = !1),
        (n.interrupted = !1),
        (n.hidden = 'hidden'),
        (n.paused = !0),
        (n.positionProp = null),
        (n.respondTo = null),
        (n.rowCount = 1),
        (n.shouldClick = !0),
        (n.$slider = i(t)),
        (n.$slidesCache = null),
        (n.transformType = null),
        (n.transitionType = null),
        (n.visibilityChange = 'visibilitychange'),
        (n.windowWidth = 0),
        (n.windowTimer = null),
        (s = i(t).data('slick') || {}),
        (n.options = i.extend({}, n.defaults, o, s)),
        (n.currentSlide = n.options.initialSlide),
        (n.originalSettings = n.options),
        void 0 !== document.mozHidden
          ? ((n.hidden = 'mozHidden'),
            (n.visibilityChange = 'mozvisibilitychange'))
          : void 0 !== document.webkitHidden &&
            ((n.hidden = 'webkitHidden'),
            (n.visibilityChange = 'webkitvisibilitychange')),
        (n.autoPlay = i.proxy(n.autoPlay, n)),
        (n.autoPlayClear = i.proxy(n.autoPlayClear, n)),
        (n.autoPlayIterator = i.proxy(n.autoPlayIterator, n)),
        (n.changeSlide = i.proxy(n.changeSlide, n)),
        (n.clickHandler = i.proxy(n.clickHandler, n)),
        (n.selectHandler = i.proxy(n.selectHandler, n)),
        (n.setPosition = i.proxy(n.setPosition, n)),
        (n.swipeHandler = i.proxy(n.swipeHandler, n)),
        (n.dragHandler = i.proxy(n.dragHandler, n)),
        (n.keyHandler = i.proxy(n.keyHandler, n)),
        (n.instanceUid = e++),
        (n.htmlExpr = /^(?:\s*(<[\w\W]+>)[^>]*)$/),
        n.registerBreakpoints(),
        n.init(!0);
    };
  })()).prototype.activateADA = function () {
    this.$slideTrack
      .find('.slick-active')
      .attr({ 'aria-hidden': 'false' })
      .find('a, input, button, select')
      .attr({ tabindex: '0' });
  }),
    (e.prototype.addSlide = e.prototype.slickAdd =
      function (e, t, o) {
        var s = this;
        if ('boolean' == typeof t) (o = t), (t = null);
        else if (t < 0 || t >= s.slideCount) return !1;
        s.unload(),
          'number' == typeof t
            ? 0 === t && 0 === s.$slides.length
              ? i(e).appendTo(s.$slideTrack)
              : o
              ? i(e).insertBefore(s.$slides.eq(t))
              : i(e).insertAfter(s.$slides.eq(t))
            : !0 === o
            ? i(e).prependTo(s.$slideTrack)
            : i(e).appendTo(s.$slideTrack),
          (s.$slides = s.$slideTrack.children(this.options.slide)),
          s.$slideTrack.children(this.options.slide).detach(),
          s.$slideTrack.append(s.$slides),
          s.$slides.each(function (e, t) {
            i(t).attr('data-slick-index', e);
          }),
          (s.$slidesCache = s.$slides),
          s.reinit();
      }),
    (e.prototype.animateHeight = function () {
      var i = this;
      if (
        1 === i.options.slidesToShow &&
        !0 === i.options.adaptiveHeight &&
        !1 === i.options.vertical
      ) {
        var e = i.$slides.eq(i.currentSlide).outerHeight(!0);
        i.$list.animate({ height: e }, i.options.speed);
      }
    }),
    (e.prototype.animateSlide = function (e, t) {
      var o = {},
        s = this;
      s.animateHeight(),
        !0 === s.options.rtl && !1 === s.options.vertical && (e = -e),
        !1 === s.transformsEnabled
          ? !1 === s.options.vertical
            ? s.$slideTrack.animate(
                { left: e },
                s.options.speed,
                s.options.easing,
                t
              )
            : s.$slideTrack.animate(
                { top: e },
                s.options.speed,
                s.options.easing,
                t
              )
          : !1 === s.cssTransitions
          ? (!0 === s.options.rtl && (s.currentLeft = -s.currentLeft),
            i({ animStart: s.currentLeft }).animate(
              { animStart: e },
              {
                duration: s.options.speed,
                easing: s.options.easing,
                step: function (i) {
                  (i = Math.ceil(i)),
                    !1 === s.options.vertical
                      ? ((o[s.animType] = 'translate(' + i + 'px, 0px)'),
                        s.$slideTrack.css(o))
                      : ((o[s.animType] = 'translate(0px,' + i + 'px)'),
                        s.$slideTrack.css(o));
                },
                complete: function () {
                  t && t.call();
                },
              }
            ))
          : (s.applyTransition(),
            (e = Math.ceil(e)),
            !1 === s.options.vertical
              ? (o[s.animType] = 'translate3d(' + e + 'px, 0px, 0px)')
              : (o[s.animType] = 'translate3d(0px,' + e + 'px, 0px)'),
            s.$slideTrack.css(o),
            t &&
              setTimeout(function () {
                s.disableTransition(), t.call();
              }, s.options.speed));
    }),
    (e.prototype.getNavTarget = function () {
      var e = this,
        t = e.options.asNavFor;
      return t && null !== t && (t = i(t).not(e.$slider)), t;
    }),
    (e.prototype.asNavFor = function (e) {
      var t = this.getNavTarget();
      null !== t &&
        'object' == typeof t &&
        t.each(function () {
          var t = i(this).slick('getSlick');
          t.unslicked || t.slideHandler(e, !0);
        });
    }),
    (e.prototype.applyTransition = function (i) {
      var e = this,
        t = {};
      !1 === e.options.fade
        ? (t[e.transitionType] =
            e.transformType + ' ' + e.options.speed + 'ms ' + e.options.cssEase)
        : (t[e.transitionType] =
            'opacity ' + e.options.speed + 'ms ' + e.options.cssEase),
        !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t);
    }),
    (e.prototype.autoPlay = function () {
      var i = this;
      i.autoPlayClear(),
        i.slideCount > i.options.slidesToShow &&
          (i.autoPlayTimer = setInterval(
            i.autoPlayIterator,
            i.options.autoplaySpeed
          ));
    }),
    (e.prototype.autoPlayClear = function () {
      var i = this;
      i.autoPlayTimer && clearInterval(i.autoPlayTimer);
    }),
    (e.prototype.autoPlayIterator = function () {
      var i = this,
        e = i.currentSlide + i.options.slidesToScroll;
      i.paused ||
        i.interrupted ||
        i.focussed ||
        (!1 === i.options.infinite &&
          (1 === i.direction && i.currentSlide + 1 === i.slideCount - 1
            ? (i.direction = 0)
            : 0 === i.direction &&
              ((e = i.currentSlide - i.options.slidesToScroll),
              i.currentSlide - 1 == 0 && (i.direction = 1))),
        i.slideHandler(e));
    }),
    (e.prototype.buildArrows = function () {
      var e = this;
      !0 === e.options.arrows &&
        ((e.$prevArrow = i(e.options.prevArrow).addClass('slick-arrow')),
        (e.$nextArrow = i(e.options.nextArrow).addClass('slick-arrow')),
        e.slideCount > e.options.slidesToShow
          ? (e.$prevArrow
              .removeClass('slick-hidden')
              .removeAttr('aria-hidden tabindex'),
            e.$nextArrow
              .removeClass('slick-hidden')
              .removeAttr('aria-hidden tabindex'),
            e.htmlExpr.test(e.options.prevArrow) &&
              e.$prevArrow.prependTo(e.options.appendArrows),
            e.htmlExpr.test(e.options.nextArrow) &&
              e.$nextArrow.appendTo(e.options.appendArrows),
            !0 !== e.options.infinite &&
              e.$prevArrow
                .addClass('slick-disabled')
                .attr('aria-disabled', 'true'))
          : e.$prevArrow
              .add(e.$nextArrow)
              .addClass('slick-hidden')
              .attr({ 'aria-disabled': 'true', tabindex: '-1' }));
    }),
    (e.prototype.buildDots = function () {
      var e,
        t,
        o = this;
      if (!0 === o.options.dots) {
        for (
          o.$slider.addClass('slick-dotted'),
            t = i('<ul />').addClass(o.options.dotsClass),
            e = 0;
          e <= o.getDotCount();
          e += 1
        )
          t.append(i('<li />').append(o.options.customPaging.call(this, o, e)));
        (o.$dots = t.appendTo(o.options.appendDots)),
          o.$dots.find('li').first().addClass('slick-active');
      }
    }),
    (e.prototype.buildOut = function () {
      var e = this;
      (e.$slides = e.$slider
        .children(e.options.slide + ':not(.slick-cloned)')
        .addClass('slick-slide')),
        (e.slideCount = e.$slides.length),
        e.$slides.each(function (e, t) {
          i(t)
            .attr('data-slick-index', e)
            .data('originalStyling', i(t).attr('style') || '');
        }),
        e.$slider.addClass('slick-slider'),
        (e.$slideTrack =
          0 === e.slideCount
            ? i('<div class="slick-track"/>').appendTo(e.$slider)
            : e.$slides.wrapAll('<div class="slick-track"/>').parent()),
        (e.$list = e.$slideTrack.wrap('<div class="slick-list"/>').parent()),
        e.$slideTrack.css('opacity', 0),
        (!0 !== e.options.centerMode && !0 !== e.options.swipeToSlide) ||
          (e.options.slidesToScroll = 1),
        i('img[data-lazy]', e.$slider).not('[src]').addClass('slick-loading'),
        e.setupInfinite(),
        e.buildArrows(),
        e.buildDots(),
        e.updateDots(),
        e.setSlideClasses(
          'number' == typeof e.currentSlide ? e.currentSlide : 0
        ),
        !0 === e.options.draggable && e.$list.addClass('draggable');
    }),
    (e.prototype.buildRows = function () {
      var i,
        e,
        t,
        o,
        s,
        n,
        r,
        l = this;
      if (
        ((o = document.createDocumentFragment()),
        (n = l.$slider.children()),
        l.options.rows > 1)
      ) {
        for (
          r = l.options.slidesPerRow * l.options.rows,
            s = Math.ceil(n.length / r),
            i = 0;
          i < s;
          i++
        ) {
          var d = document.createElement('div');
          for (e = 0; e < l.options.rows; e++) {
            var a = document.createElement('div');
            for (t = 0; t < l.options.slidesPerRow; t++) {
              var c = i * r + (e * l.options.slidesPerRow + t);
              n.get(c) && a.appendChild(n.get(c));
            }
            d.appendChild(a);
          }
          o.appendChild(d);
        }
        l.$slider.empty().append(o),
          l.$slider
            .children()
            .children()
            .children()
            .css({
              width: 100 / l.options.slidesPerRow + '%',
              display: 'inline-block',
            });
      }
    }),
    (e.prototype.checkResponsive = function (e, t) {
      var o,
        s,
        n,
        r = this,
        l = !1,
        d = r.$slider.width(),
        a = window.innerWidth || i(window).width();
      if (
        ('window' === r.respondTo
          ? (n = a)
          : 'slider' === r.respondTo
          ? (n = d)
          : 'min' === r.respondTo && (n = Math.min(a, d)),
        r.options.responsive &&
          r.options.responsive.length &&
          null !== r.options.responsive)
      ) {
        s = null;
        for (o in r.breakpoints)
          r.breakpoints.hasOwnProperty(o) &&
            (!1 === r.originalSettings.mobileFirst
              ? n < r.breakpoints[o] && (s = r.breakpoints[o])
              : n > r.breakpoints[o] && (s = r.breakpoints[o]));
        null !== s
          ? null !== r.activeBreakpoint
            ? (s !== r.activeBreakpoint || t) &&
              ((r.activeBreakpoint = s),
              'unslick' === r.breakpointSettings[s]
                ? r.unslick(s)
                : ((r.options = i.extend(
                    {},
                    r.originalSettings,
                    r.breakpointSettings[s]
                  )),
                  !0 === e && (r.currentSlide = r.options.initialSlide),
                  r.refresh(e)),
              (l = s))
            : ((r.activeBreakpoint = s),
              'unslick' === r.breakpointSettings[s]
                ? r.unslick(s)
                : ((r.options = i.extend(
                    {},
                    r.originalSettings,
                    r.breakpointSettings[s]
                  )),
                  !0 === e && (r.currentSlide = r.options.initialSlide),
                  r.refresh(e)),
              (l = s))
          : null !== r.activeBreakpoint &&
            ((r.activeBreakpoint = null),
            (r.options = r.originalSettings),
            !0 === e && (r.currentSlide = r.options.initialSlide),
            r.refresh(e),
            (l = s)),
          e || !1 === l || r.$slider.trigger('breakpoint', [r, l]);
      }
    }),
    (e.prototype.changeSlide = function (e, t) {
      var o,
        s,
        n,
        r = this,
        l = i(e.currentTarget);
      switch (
        (l.is('a') && e.preventDefault(),
        l.is('li') || (l = l.closest('li')),
        (n = r.slideCount % r.options.slidesToScroll != 0),
        (o = n
          ? 0
          : (r.slideCount - r.currentSlide) % r.options.slidesToScroll),
        e.data.message)
      ) {
        case 'previous':
          (s = 0 === o ? r.options.slidesToScroll : r.options.slidesToShow - o),
            r.slideCount > r.options.slidesToShow &&
              r.slideHandler(r.currentSlide - s, !1, t);
          break;
        case 'next':
          (s = 0 === o ? r.options.slidesToScroll : o),
            r.slideCount > r.options.slidesToShow &&
              r.slideHandler(r.currentSlide + s, !1, t);
          break;
        case 'index':
          var d =
            0 === e.data.index
              ? 0
              : e.data.index || l.index() * r.options.slidesToScroll;
          r.slideHandler(r.checkNavigable(d), !1, t),
            l.children().trigger('focus');
          break;
        default:
          return;
      }
    }),
    (e.prototype.checkNavigable = function (i) {
      var e, t;
      if (((e = this.getNavigableIndexes()), (t = 0), i > e[e.length - 1]))
        i = e[e.length - 1];
      else
        for (var o in e) {
          if (i < e[o]) {
            i = t;
            break;
          }
          t = e[o];
        }
      return i;
    }),
    (e.prototype.cleanUpEvents = function () {
      var e = this;
      e.options.dots &&
        null !== e.$dots &&
        (i('li', e.$dots)
          .off('click.slick', e.changeSlide)
          .off('mouseenter.slick', i.proxy(e.interrupt, e, !0))
          .off('mouseleave.slick', i.proxy(e.interrupt, e, !1)),
        !0 === e.options.accessibility &&
          e.$dots.off('keydown.slick', e.keyHandler)),
        e.$slider.off('focus.slick blur.slick'),
        !0 === e.options.arrows &&
          e.slideCount > e.options.slidesToShow &&
          (e.$prevArrow && e.$prevArrow.off('click.slick', e.changeSlide),
          e.$nextArrow && e.$nextArrow.off('click.slick', e.changeSlide),
          !0 === e.options.accessibility &&
            (e.$prevArrow && e.$prevArrow.off('keydown.slick', e.keyHandler),
            e.$nextArrow && e.$nextArrow.off('keydown.slick', e.keyHandler))),
        e.$list.off('touchstart.slick mousedown.slick', e.swipeHandler),
        e.$list.off('touchmove.slick mousemove.slick', e.swipeHandler),
        e.$list.off('touchend.slick mouseup.slick', e.swipeHandler),
        e.$list.off('touchcancel.slick mouseleave.slick', e.swipeHandler),
        e.$list.off('click.slick', e.clickHandler),
        i(document).off(e.visibilityChange, e.visibility),
        e.cleanUpSlideEvents(),
        !0 === e.options.accessibility &&
          e.$list.off('keydown.slick', e.keyHandler),
        !0 === e.options.focusOnSelect &&
          i(e.$slideTrack).children().off('click.slick', e.selectHandler),
        i(window).off(
          'orientationchange.slick.slick-' + e.instanceUid,
          e.orientationChange
        ),
        i(window).off('resize.slick.slick-' + e.instanceUid, e.resize),
        i('[draggable!=true]', e.$slideTrack).off(
          'dragstart',
          e.preventDefault
        ),
        i(window).off('load.slick.slick-' + e.instanceUid, e.setPosition);
    }),
    (e.prototype.cleanUpSlideEvents = function () {
      var e = this;
      e.$list.off('mouseenter.slick', i.proxy(e.interrupt, e, !0)),
        e.$list.off('mouseleave.slick', i.proxy(e.interrupt, e, !1));
    }),
    (e.prototype.cleanUpRows = function () {
      var i,
        e = this;
      e.options.rows > 1 &&
        ((i = e.$slides.children().children()).removeAttr('style'),
        e.$slider.empty().append(i));
    }),
    (e.prototype.clickHandler = function (i) {
      !1 === this.shouldClick &&
        (i.stopImmediatePropagation(), i.stopPropagation(), i.preventDefault());
    }),
    (e.prototype.destroy = function (e) {
      var t = this;
      t.autoPlayClear(),
        (t.touchObject = {}),
        t.cleanUpEvents(),
        i('.slick-cloned', t.$slider).detach(),
        t.$dots && t.$dots.remove(),
        t.$prevArrow &&
          t.$prevArrow.length &&
          (t.$prevArrow
            .removeClass('slick-disabled slick-arrow slick-hidden')
            .removeAttr('aria-hidden aria-disabled tabindex')
            .css('display', ''),
          t.htmlExpr.test(t.options.prevArrow) && t.$prevArrow.remove()),
        t.$nextArrow &&
          t.$nextArrow.length &&
          (t.$nextArrow
            .removeClass('slick-disabled slick-arrow slick-hidden')
            .removeAttr('aria-hidden aria-disabled tabindex')
            .css('display', ''),
          t.htmlExpr.test(t.options.nextArrow) && t.$nextArrow.remove()),
        t.$slides &&
          (t.$slides
            .removeClass(
              'slick-slide slick-active slick-center slick-visible slick-current'
            )
            .removeAttr('aria-hidden')
            .removeAttr('data-slick-index')
            .each(function () {
              i(this).attr('style', i(this).data('originalStyling'));
            }),
          t.$slideTrack.children(this.options.slide).detach(),
          t.$slideTrack.detach(),
          t.$list.detach(),
          t.$slider.append(t.$slides)),
        t.cleanUpRows(),
        t.$slider.removeClass('slick-slider'),
        t.$slider.removeClass('slick-initialized'),
        t.$slider.removeClass('slick-dotted'),
        (t.unslicked = !0),
        e || t.$slider.trigger('destroy', [t]);
    }),
    (e.prototype.disableTransition = function (i) {
      var e = this,
        t = {};
      (t[e.transitionType] = ''),
        !1 === e.options.fade ? e.$slideTrack.css(t) : e.$slides.eq(i).css(t);
    }),
    (e.prototype.fadeSlide = function (i, e) {
      var t = this;
      !1 === t.cssTransitions
        ? (t.$slides.eq(i).css({ zIndex: t.options.zIndex }),
          t.$slides
            .eq(i)
            .animate({ opacity: 1 }, t.options.speed, t.options.easing, e))
        : (t.applyTransition(i),
          t.$slides.eq(i).css({ opacity: 1, zIndex: t.options.zIndex }),
          e &&
            setTimeout(function () {
              t.disableTransition(i), e.call();
            }, t.options.speed));
    }),
    (e.prototype.fadeSlideOut = function (i) {
      var e = this;
      !1 === e.cssTransitions
        ? e.$slides
            .eq(i)
            .animate(
              { opacity: 0, zIndex: e.options.zIndex - 2 },
              e.options.speed,
              e.options.easing
            )
        : (e.applyTransition(i),
          e.$slides.eq(i).css({ opacity: 0, zIndex: e.options.zIndex - 2 }));
    }),
    (e.prototype.filterSlides = e.prototype.slickFilter =
      function (i) {
        var e = this;
        null !== i &&
          ((e.$slidesCache = e.$slides),
          e.unload(),
          e.$slideTrack.children(this.options.slide).detach(),
          e.$slidesCache.filter(i).appendTo(e.$slideTrack),
          e.reinit());
      }),
    (e.prototype.focusHandler = function () {
      var e = this;
      e.$slider
        .off('focus.slick blur.slick')
        .on('focus.slick blur.slick', '*', function (t) {
          t.stopImmediatePropagation();
          var o = i(this);
          setTimeout(function () {
            e.options.pauseOnFocus &&
              ((e.focussed = o.is(':focus')), e.autoPlay());
          }, 0);
        });
    }),
    (e.prototype.getCurrent = e.prototype.slickCurrentSlide =
      function () {
        return this.currentSlide;
      }),
    (e.prototype.getDotCount = function () {
      var i = this,
        e = 0,
        t = 0,
        o = 0;
      if (!0 === i.options.infinite)
        if (i.slideCount <= i.options.slidesToShow) ++o;
        else
          for (; e < i.slideCount; )
            ++o,
              (e = t + i.options.slidesToScroll),
              (t +=
                i.options.slidesToScroll <= i.options.slidesToShow
                  ? i.options.slidesToScroll
                  : i.options.slidesToShow);
      else if (!0 === i.options.centerMode) o = i.slideCount;
      else if (i.options.asNavFor)
        for (; e < i.slideCount; )
          ++o,
            (e = t + i.options.slidesToScroll),
            (t +=
              i.options.slidesToScroll <= i.options.slidesToShow
                ? i.options.slidesToScroll
                : i.options.slidesToShow);
      else
        o =
          1 +
          Math.ceil(
            (i.slideCount - i.options.slidesToShow) / i.options.slidesToScroll
          );
      return o - 1;
    }),
    (e.prototype.getLeft = function (i) {
      var e,
        t,
        o,
        s,
        n = this,
        r = 0;
      return (
        (n.slideOffset = 0),
        (t = n.$slides.first().outerHeight(!0)),
        !0 === n.options.infinite
          ? (n.slideCount > n.options.slidesToShow &&
              ((n.slideOffset = n.slideWidth * n.options.slidesToShow * -1),
              (s = -1),
              !0 === n.options.vertical &&
                !0 === n.options.centerMode &&
                (2 === n.options.slidesToShow
                  ? (s = -1.5)
                  : 1 === n.options.slidesToShow && (s = -2)),
              (r = t * n.options.slidesToShow * s)),
            n.slideCount % n.options.slidesToScroll != 0 &&
              i + n.options.slidesToScroll > n.slideCount &&
              n.slideCount > n.options.slidesToShow &&
              (i > n.slideCount
                ? ((n.slideOffset =
                    (n.options.slidesToShow - (i - n.slideCount)) *
                    n.slideWidth *
                    -1),
                  (r = (n.options.slidesToShow - (i - n.slideCount)) * t * -1))
                : ((n.slideOffset =
                    (n.slideCount % n.options.slidesToScroll) *
                    n.slideWidth *
                    -1),
                  (r = (n.slideCount % n.options.slidesToScroll) * t * -1))))
          : i + n.options.slidesToShow > n.slideCount &&
            ((n.slideOffset =
              (i + n.options.slidesToShow - n.slideCount) * n.slideWidth),
            (r = (i + n.options.slidesToShow - n.slideCount) * t)),
        n.slideCount <= n.options.slidesToShow &&
          ((n.slideOffset = 0), (r = 0)),
        !0 === n.options.centerMode && n.slideCount <= n.options.slidesToShow
          ? (n.slideOffset =
              (n.slideWidth * Math.floor(n.options.slidesToShow)) / 2 -
              (n.slideWidth * n.slideCount) / 2)
          : !0 === n.options.centerMode && !0 === n.options.infinite
          ? (n.slideOffset +=
              n.slideWidth * Math.floor(n.options.slidesToShow / 2) -
              n.slideWidth)
          : !0 === n.options.centerMode &&
            ((n.slideOffset = 0),
            (n.slideOffset +=
              n.slideWidth * Math.floor(n.options.slidesToShow / 2))),
        (e =
          !1 === n.options.vertical
            ? i * n.slideWidth * -1 + n.slideOffset
            : i * t * -1 + r),
        !0 === n.options.variableWidth &&
          ((o =
            n.slideCount <= n.options.slidesToShow || !1 === n.options.infinite
              ? n.$slideTrack.children('.slick-slide').eq(i)
              : n.$slideTrack
                  .children('.slick-slide')
                  .eq(i + n.options.slidesToShow)),
          (e =
            !0 === n.options.rtl
              ? o[0]
                ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width())
                : 0
              : o[0]
              ? -1 * o[0].offsetLeft
              : 0),
          !0 === n.options.centerMode &&
            ((o =
              n.slideCount <= n.options.slidesToShow ||
              !1 === n.options.infinite
                ? n.$slideTrack.children('.slick-slide').eq(i)
                : n.$slideTrack
                    .children('.slick-slide')
                    .eq(i + n.options.slidesToShow + 1)),
            (e =
              !0 === n.options.rtl
                ? o[0]
                  ? -1 * (n.$slideTrack.width() - o[0].offsetLeft - o.width())
                  : 0
                : o[0]
                ? -1 * o[0].offsetLeft
                : 0),
            (e += (n.$list.width() - o.outerWidth()) / 2))),
        e
      );
    }),
    (e.prototype.getOption = e.prototype.slickGetOption =
      function (i) {
        return this.options[i];
      }),
    (e.prototype.getNavigableIndexes = function () {
      var i,
        e = this,
        t = 0,
        o = 0,
        s = [];
      for (
        !1 === e.options.infinite
          ? (i = e.slideCount)
          : ((t = -1 * e.options.slidesToScroll),
            (o = -1 * e.options.slidesToScroll),
            (i = 2 * e.slideCount));
        t < i;

      )
        s.push(t),
          (t = o + e.options.slidesToScroll),
          (o +=
            e.options.slidesToScroll <= e.options.slidesToShow
              ? e.options.slidesToScroll
              : e.options.slidesToShow);
      return s;
    }),
    (e.prototype.getSlick = function () {
      return this;
    }),
    (e.prototype.getSlideCount = function () {
      var e,
        t,
        o = this;
      return (
        (t =
          !0 === o.options.centerMode
            ? o.slideWidth * Math.floor(o.options.slidesToShow / 2)
            : 0),
        !0 === o.options.swipeToSlide
          ? (o.$slideTrack.find('.slick-slide').each(function (s, n) {
              if (n.offsetLeft - t + i(n).outerWidth() / 2 > -1 * o.swipeLeft)
                return (e = n), !1;
            }),
            Math.abs(i(e).attr('data-slick-index') - o.currentSlide) || 1)
          : o.options.slidesToScroll
      );
    }),
    (e.prototype.goTo = e.prototype.slickGoTo =
      function (i, e) {
        this.changeSlide({ data: { message: 'index', index: parseInt(i) } }, e);
      }),
    (e.prototype.init = function (e) {
      var t = this;
      i(t.$slider).hasClass('slick-initialized') ||
        (i(t.$slider).addClass('slick-initialized'),
        t.buildRows(),
        t.buildOut(),
        t.setProps(),
        t.startLoad(),
        t.loadSlider(),
        t.initializeEvents(),
        t.updateArrows(),
        t.updateDots(),
        t.checkResponsive(!0),
        t.focusHandler()),
        e && t.$slider.trigger('init', [t]),
        !0 === t.options.accessibility && t.initADA(),
        t.options.autoplay && ((t.paused = !1), t.autoPlay());
    }),
    (e.prototype.initADA = function () {
      var e = this,
        t = Math.ceil(e.slideCount / e.options.slidesToShow),
        o = e.getNavigableIndexes().filter(function (i) {
          return i >= 0 && i < e.slideCount;
        });
      e.$slides
        .add(e.$slideTrack.find('.slick-cloned'))
        .attr({ 'aria-hidden': 'true', tabindex: '-1' })
        .find('a, input, button, select')
        .attr({ tabindex: '-1' }),
        null !== e.$dots &&
          (e.$slides
            .not(e.$slideTrack.find('.slick-cloned'))
            .each(function (t) {
              var s = o.indexOf(t);
              i(this).attr({
                role: 'tabpanel',
                id: 'slick-slide' + e.instanceUid + t,
                tabindex: -1,
              }),
                -1 !== s &&
                  i(this).attr({
                    'aria-describedby':
                      'slick-slide-control' + e.instanceUid + s,
                  });
            }),
          e.$dots
            .attr('role', 'tablist')
            .find('li')
            .each(function (s) {
              var n = o[s];
              i(this).attr({ role: 'presentation' }),
                i(this)
                  .find('button')
                  .first()
                  .attr({
                    role: 'tab',
                    id: 'slick-slide-control' + e.instanceUid + s,
                    'aria-controls': 'slick-slide' + e.instanceUid + n,
                    'aria-label': s + 1 + ' of ' + t,
                    'aria-selected': null,
                    tabindex: '-1',
                  });
            })
            .eq(e.currentSlide)
            .find('button')
            .attr({ 'aria-selected': 'true', tabindex: '0' })
            .end());
      for (var s = e.currentSlide, n = s + e.options.slidesToShow; s < n; s++)
        e.$slides.eq(s).attr('tabindex', 0);
      e.activateADA();
    }),
    (e.prototype.initArrowEvents = function () {
      var i = this;
      !0 === i.options.arrows &&
        i.slideCount > i.options.slidesToShow &&
        (i.$prevArrow
          .off('click.slick')
          .on('click.slick', { message: 'previous' }, i.changeSlide),
        i.$nextArrow
          .off('click.slick')
          .on('click.slick', { message: 'next' }, i.changeSlide),
        !0 === i.options.accessibility &&
          (i.$prevArrow.on('keydown.slick', i.keyHandler),
          i.$nextArrow.on('keydown.slick', i.keyHandler)));
    }),
    (e.prototype.initDotEvents = function () {
      var e = this;
      !0 === e.options.dots &&
        (i('li', e.$dots).on(
          'click.slick',
          { message: 'index' },
          e.changeSlide
        ),
        !0 === e.options.accessibility &&
          e.$dots.on('keydown.slick', e.keyHandler)),
        !0 === e.options.dots &&
          !0 === e.options.pauseOnDotsHover &&
          i('li', e.$dots)
            .on('mouseenter.slick', i.proxy(e.interrupt, e, !0))
            .on('mouseleave.slick', i.proxy(e.interrupt, e, !1));
    }),
    (e.prototype.initSlideEvents = function () {
      var e = this;
      e.options.pauseOnHover &&
        (e.$list.on('mouseenter.slick', i.proxy(e.interrupt, e, !0)),
        e.$list.on('mouseleave.slick', i.proxy(e.interrupt, e, !1)));
    }),
    (e.prototype.initializeEvents = function () {
      var e = this;
      e.initArrowEvents(),
        e.initDotEvents(),
        e.initSlideEvents(),
        e.$list.on(
          'touchstart.slick mousedown.slick',
          { action: 'start' },
          e.swipeHandler
        ),
        e.$list.on(
          'touchmove.slick mousemove.slick',
          { action: 'move' },
          e.swipeHandler
        ),
        e.$list.on(
          'touchend.slick mouseup.slick',
          { action: 'end' },
          e.swipeHandler
        ),
        e.$list.on(
          'touchcancel.slick mouseleave.slick',
          { action: 'end' },
          e.swipeHandler
        ),
        e.$list.on('click.slick', e.clickHandler),
        i(document).on(e.visibilityChange, i.proxy(e.visibility, e)),
        !0 === e.options.accessibility &&
          e.$list.on('keydown.slick', e.keyHandler),
        !0 === e.options.focusOnSelect &&
          i(e.$slideTrack).children().on('click.slick', e.selectHandler),
        i(window).on(
          'orientationchange.slick.slick-' + e.instanceUid,
          i.proxy(e.orientationChange, e)
        ),
        i(window).on(
          'resize.slick.slick-' + e.instanceUid,
          i.proxy(e.resize, e)
        ),
        i('[draggable!=true]', e.$slideTrack).on('dragstart', e.preventDefault),
        i(window).on('load.slick.slick-' + e.instanceUid, e.setPosition),
        i(e.setPosition);
    }),
    (e.prototype.initUI = function () {
      var i = this;
      !0 === i.options.arrows &&
        i.slideCount > i.options.slidesToShow &&
        (i.$prevArrow.show(), i.$nextArrow.show()),
        !0 === i.options.dots &&
          i.slideCount > i.options.slidesToShow &&
          i.$dots.show();
    }),
    (e.prototype.keyHandler = function (i) {
      var e = this;
      i.target.tagName.match('TEXTAREA|INPUT|SELECT') ||
        (37 === i.keyCode && !0 === e.options.accessibility
          ? e.changeSlide({
              data: { message: !0 === e.options.rtl ? 'next' : 'previous' },
            })
          : 39 === i.keyCode &&
            !0 === e.options.accessibility &&
            e.changeSlide({
              data: { message: !0 === e.options.rtl ? 'previous' : 'next' },
            }));
    }),
    (e.prototype.lazyLoad = function () {
      function e(e) {
        i('img[data-lazy]', e).each(function () {
          var e = i(this),
            t = i(this).attr('data-lazy'),
            o = i(this).attr('data-srcset'),
            s = i(this).attr('data-sizes') || n.$slider.attr('data-sizes'),
            r = document.createElement('img');
          (r.onload = function () {
            e.animate({ opacity: 0 }, 100, function () {
              o && (e.attr('srcset', o), s && e.attr('sizes', s)),
                e.attr('src', t).animate({ opacity: 1 }, 200, function () {
                  e.removeAttr('data-lazy data-srcset data-sizes').removeClass(
                    'slick-loading'
                  );
                }),
                n.$slider.trigger('lazyLoaded', [n, e, t]);
            });
          }),
            (r.onerror = function () {
              e
                .removeAttr('data-lazy')
                .removeClass('slick-loading')
                .addClass('slick-lazyload-error'),
                n.$slider.trigger('lazyLoadError', [n, e, t]);
            }),
            (r.src = t);
        });
      }
      var t,
        o,
        s,
        n = this;
      if (
        (!0 === n.options.centerMode
          ? !0 === n.options.infinite
            ? (s =
                (o = n.currentSlide + (n.options.slidesToShow / 2 + 1)) +
                n.options.slidesToShow +
                2)
            : ((o = Math.max(
                0,
                n.currentSlide - (n.options.slidesToShow / 2 + 1)
              )),
              (s = n.options.slidesToShow / 2 + 1 + 2 + n.currentSlide))
          : ((o = n.options.infinite
              ? n.options.slidesToShow + n.currentSlide
              : n.currentSlide),
            (s = Math.ceil(o + n.options.slidesToShow)),
            !0 === n.options.fade && (o > 0 && o--, s <= n.slideCount && s++)),
        (t = n.$slider.find('.slick-slide').slice(o, s)),
        'anticipated' === n.options.lazyLoad)
      )
        for (
          var r = o - 1, l = s, d = n.$slider.find('.slick-slide'), a = 0;
          a < n.options.slidesToScroll;
          a++
        )
          r < 0 && (r = n.slideCount - 1),
            (t = (t = t.add(d.eq(r))).add(d.eq(l))),
            r--,
            l++;
      e(t),
        n.slideCount <= n.options.slidesToShow
          ? e(n.$slider.find('.slick-slide'))
          : n.currentSlide >= n.slideCount - n.options.slidesToShow
          ? e(n.$slider.find('.slick-cloned').slice(0, n.options.slidesToShow))
          : 0 === n.currentSlide &&
            e(
              n.$slider.find('.slick-cloned').slice(-1 * n.options.slidesToShow)
            );
    }),
    (e.prototype.loadSlider = function () {
      var i = this;
      i.setPosition(),
        i.$slideTrack.css({ opacity: 1 }),
        i.$slider.removeClass('slick-loading'),
        i.initUI(),
        'progressive' === i.options.lazyLoad && i.progressiveLazyLoad();
    }),
    (e.prototype.next = e.prototype.slickNext =
      function () {
        this.changeSlide({ data: { message: 'next' } });
      }),
    (e.prototype.orientationChange = function () {
      var i = this;
      i.checkResponsive(), i.setPosition();
    }),
    (e.prototype.pause = e.prototype.slickPause =
      function () {
        var i = this;
        i.autoPlayClear(), (i.paused = !0);
      }),
    (e.prototype.play = e.prototype.slickPlay =
      function () {
        var i = this;
        i.autoPlay(),
          (i.options.autoplay = !0),
          (i.paused = !1),
          (i.focussed = !1),
          (i.interrupted = !1);
      }),
    (e.prototype.postSlide = function (e) {
      var t = this;
      t.unslicked ||
        (t.$slider.trigger('afterChange', [t, e]),
        (t.animating = !1),
        t.slideCount > t.options.slidesToShow && t.setPosition(),
        (t.swipeLeft = null),
        t.options.autoplay && t.autoPlay(),
        !0 === t.options.accessibility &&
          (t.initADA(),
          t.options.focusOnChange &&
            i(t.$slides.get(t.currentSlide)).attr('tabindex', 0).focus()));
    }),
    (e.prototype.prev = e.prototype.slickPrev =
      function () {
        this.changeSlide({ data: { message: 'previous' } });
      }),
    (e.prototype.preventDefault = function (i) {
      i.preventDefault();
    }),
    (e.prototype.progressiveLazyLoad = function (e) {
      e = e || 1;
      var t,
        o,
        s,
        n,
        r,
        l = this,
        d = i('img[data-lazy]', l.$slider);
      d.length
        ? ((t = d.first()),
          (o = t.attr('data-lazy')),
          (s = t.attr('data-srcset')),
          (n = t.attr('data-sizes') || l.$slider.attr('data-sizes')),
          ((r = document.createElement('img')).onload = function () {
            s && (t.attr('srcset', s), n && t.attr('sizes', n)),
              t
                .attr('src', o)
                .removeAttr('data-lazy data-srcset data-sizes')
                .removeClass('slick-loading'),
              !0 === l.options.adaptiveHeight && l.setPosition(),
              l.$slider.trigger('lazyLoaded', [l, t, o]),
              l.progressiveLazyLoad();
          }),
          (r.onerror = function () {
            e < 3
              ? setTimeout(function () {
                  l.progressiveLazyLoad(e + 1);
                }, 500)
              : (t
                  .removeAttr('data-lazy')
                  .removeClass('slick-loading')
                  .addClass('slick-lazyload-error'),
                l.$slider.trigger('lazyLoadError', [l, t, o]),
                l.progressiveLazyLoad());
          }),
          (r.src = o))
        : l.$slider.trigger('allImagesLoaded', [l]);
    }),
    (e.prototype.refresh = function (e) {
      var t,
        o,
        s = this;
      (o = s.slideCount - s.options.slidesToShow),
        !s.options.infinite && s.currentSlide > o && (s.currentSlide = o),
        s.slideCount <= s.options.slidesToShow && (s.currentSlide = 0),
        (t = s.currentSlide),
        s.destroy(!0),
        i.extend(s, s.initials, { currentSlide: t }),
        s.init(),
        e || s.changeSlide({ data: { message: 'index', index: t } }, !1);
    }),
    (e.prototype.registerBreakpoints = function () {
      var e,
        t,
        o,
        s = this,
        n = s.options.responsive || null;
      if ('array' === i.type(n) && n.length) {
        s.respondTo = s.options.respondTo || 'window';
        for (e in n)
          if (((o = s.breakpoints.length - 1), n.hasOwnProperty(e))) {
            for (t = n[e].breakpoint; o >= 0; )
              s.breakpoints[o] &&
                s.breakpoints[o] === t &&
                s.breakpoints.splice(o, 1),
                o--;
            s.breakpoints.push(t), (s.breakpointSettings[t] = n[e].settings);
          }
        s.breakpoints.sort(function (i, e) {
          return s.options.mobileFirst ? i - e : e - i;
        });
      }
    }),
    (e.prototype.reinit = function () {
      var e = this;
      (e.$slides = e.$slideTrack
        .children(e.options.slide)
        .addClass('slick-slide')),
        (e.slideCount = e.$slides.length),
        e.currentSlide >= e.slideCount &&
          0 !== e.currentSlide &&
          (e.currentSlide = e.currentSlide - e.options.slidesToScroll),
        e.slideCount <= e.options.slidesToShow && (e.currentSlide = 0),
        e.registerBreakpoints(),
        e.setProps(),
        e.setupInfinite(),
        e.buildArrows(),
        e.updateArrows(),
        e.initArrowEvents(),
        e.buildDots(),
        e.updateDots(),
        e.initDotEvents(),
        e.cleanUpSlideEvents(),
        e.initSlideEvents(),
        e.checkResponsive(!1, !0),
        !0 === e.options.focusOnSelect &&
          i(e.$slideTrack).children().on('click.slick', e.selectHandler),
        e.setSlideClasses(
          'number' == typeof e.currentSlide ? e.currentSlide : 0
        ),
        e.setPosition(),
        e.focusHandler(),
        (e.paused = !e.options.autoplay),
        e.autoPlay(),
        e.$slider.trigger('reInit', [e]);
    }),
    (e.prototype.resize = function () {
      var e = this;
      i(window).width() !== e.windowWidth &&
        (clearTimeout(e.windowDelay),
        (e.windowDelay = window.setTimeout(function () {
          (e.windowWidth = i(window).width()),
            e.checkResponsive(),
            e.unslicked || e.setPosition();
        }, 50)));
    }),
    (e.prototype.removeSlide = e.prototype.slickRemove =
      function (i, e, t) {
        var o = this;
        if (
          ((i =
            'boolean' == typeof i
              ? !0 === (e = i)
                ? 0
                : o.slideCount - 1
              : !0 === e
              ? --i
              : i),
          o.slideCount < 1 || i < 0 || i > o.slideCount - 1)
        )
          return !1;
        o.unload(),
          !0 === t
            ? o.$slideTrack.children().remove()
            : o.$slideTrack.children(this.options.slide).eq(i).remove(),
          (o.$slides = o.$slideTrack.children(this.options.slide)),
          o.$slideTrack.children(this.options.slide).detach(),
          o.$slideTrack.append(o.$slides),
          (o.$slidesCache = o.$slides),
          o.reinit();
      }),
    (e.prototype.setCSS = function (i) {
      var e,
        t,
        o = this,
        s = {};
      !0 === o.options.rtl && (i = -i),
        (e = 'left' == o.positionProp ? Math.ceil(i) + 'px' : '0px'),
        (t = 'top' == o.positionProp ? Math.ceil(i) + 'px' : '0px'),
        (s[o.positionProp] = i),
        !1 === o.transformsEnabled
          ? o.$slideTrack.css(s)
          : ((s = {}),
            !1 === o.cssTransitions
              ? ((s[o.animType] = 'translate(' + e + ', ' + t + ')'),
                o.$slideTrack.css(s))
              : ((s[o.animType] = 'translate3d(' + e + ', ' + t + ', 0px)'),
                o.$slideTrack.css(s)));
    }),
    (e.prototype.setDimensions = function () {
      var i = this;
      !1 === i.options.vertical
        ? !0 === i.options.centerMode &&
          i.$list.css({ padding: '0px ' + i.options.centerPadding })
        : (i.$list.height(
            i.$slides.first().outerHeight(!0) * i.options.slidesToShow
          ),
          !0 === i.options.centerMode &&
            i.$list.css({ padding: i.options.centerPadding + ' 0px' })),
        (i.listWidth = i.$list.width()),
        (i.listHeight = i.$list.height()),
        !1 === i.options.vertical && !1 === i.options.variableWidth
          ? ((i.slideWidth = Math.ceil(i.listWidth / i.options.slidesToShow)),
            i.$slideTrack.width(
              Math.ceil(
                i.slideWidth * i.$slideTrack.children('.slick-slide').length
              )
            ))
          : !0 === i.options.variableWidth
          ? i.$slideTrack.width(5e3 * i.slideCount)
          : ((i.slideWidth = Math.ceil(i.listWidth)),
            i.$slideTrack.height(
              Math.ceil(
                i.$slides.first().outerHeight(!0) *
                  i.$slideTrack.children('.slick-slide').length
              )
            ));
      var e = i.$slides.first().outerWidth(!0) - i.$slides.first().width();
      !1 === i.options.variableWidth &&
        i.$slideTrack.children('.slick-slide').width(i.slideWidth - e);
    }),
    (e.prototype.setFade = function () {
      var e,
        t = this;
      t.$slides.each(function (o, s) {
        (e = t.slideWidth * o * -1),
          !0 === t.options.rtl
            ? i(s).css({
                position: 'relative',
                right: e,
                top: 0,
                zIndex: t.options.zIndex - 2,
                opacity: 0,
              })
            : i(s).css({
                position: 'relative',
                left: e,
                top: 0,
                zIndex: t.options.zIndex - 2,
                opacity: 0,
              });
      }),
        t.$slides
          .eq(t.currentSlide)
          .css({ zIndex: t.options.zIndex - 1, opacity: 1 });
    }),
    (e.prototype.setHeight = function () {
      var i = this;
      if (
        1 === i.options.slidesToShow &&
        !0 === i.options.adaptiveHeight &&
        !1 === i.options.vertical
      ) {
        var e = i.$slides.eq(i.currentSlide).outerHeight(!0);
        i.$list.css('height', e);
      }
    }),
    (e.prototype.setOption = e.prototype.slickSetOption =
      function () {
        var e,
          t,
          o,
          s,
          n,
          r = this,
          l = !1;
        if (
          ('object' === i.type(arguments[0])
            ? ((o = arguments[0]), (l = arguments[1]), (n = 'multiple'))
            : 'string' === i.type(arguments[0]) &&
              ((o = arguments[0]),
              (s = arguments[1]),
              (l = arguments[2]),
              'responsive' === arguments[0] && 'array' === i.type(arguments[1])
                ? (n = 'responsive')
                : void 0 !== arguments[1] && (n = 'single')),
          'single' === n)
        )
          r.options[o] = s;
        else if ('multiple' === n)
          i.each(o, function (i, e) {
            r.options[i] = e;
          });
        else if ('responsive' === n)
          for (t in s)
            if ('array' !== i.type(r.options.responsive))
              r.options.responsive = [s[t]];
            else {
              for (e = r.options.responsive.length - 1; e >= 0; )
                r.options.responsive[e].breakpoint === s[t].breakpoint &&
                  r.options.responsive.splice(e, 1),
                  e--;
              r.options.responsive.push(s[t]);
            }
        l && (r.unload(), r.reinit());
      }),
    (e.prototype.setPosition = function () {
      var i = this;
      i.setDimensions(),
        i.setHeight(),
        !1 === i.options.fade
          ? i.setCSS(i.getLeft(i.currentSlide))
          : i.setFade(),
        i.$slider.trigger('setPosition', [i]);
    }),
    (e.prototype.setProps = function () {
      var i = this,
        e = document.body.style;
      (i.positionProp = !0 === i.options.vertical ? 'top' : 'left'),
        'top' === i.positionProp
          ? i.$slider.addClass('slick-vertical')
          : i.$slider.removeClass('slick-vertical'),
        (void 0 === e.WebkitTransition &&
          void 0 === e.MozTransition &&
          void 0 === e.msTransition) ||
          (!0 === i.options.useCSS && (i.cssTransitions = !0)),
        i.options.fade &&
          ('number' == typeof i.options.zIndex
            ? i.options.zIndex < 3 && (i.options.zIndex = 3)
            : (i.options.zIndex = i.defaults.zIndex)),
        void 0 !== e.OTransform &&
          ((i.animType = 'OTransform'),
          (i.transformType = '-o-transform'),
          (i.transitionType = 'OTransition'),
          void 0 === e.perspectiveProperty &&
            void 0 === e.webkitPerspective &&
            (i.animType = !1)),
        void 0 !== e.MozTransform &&
          ((i.animType = 'MozTransform'),
          (i.transformType = '-moz-transform'),
          (i.transitionType = 'MozTransition'),
          void 0 === e.perspectiveProperty &&
            void 0 === e.MozPerspective &&
            (i.animType = !1)),
        void 0 !== e.webkitTransform &&
          ((i.animType = 'webkitTransform'),
          (i.transformType = '-webkit-transform'),
          (i.transitionType = 'webkitTransition'),
          void 0 === e.perspectiveProperty &&
            void 0 === e.webkitPerspective &&
            (i.animType = !1)),
        void 0 !== e.msTransform &&
          ((i.animType = 'msTransform'),
          (i.transformType = '-ms-transform'),
          (i.transitionType = 'msTransition'),
          void 0 === e.msTransform && (i.animType = !1)),
        void 0 !== e.transform &&
          !1 !== i.animType &&
          ((i.animType = 'transform'),
          (i.transformType = 'transform'),
          (i.transitionType = 'transition')),
        (i.transformsEnabled =
          i.options.useTransform && null !== i.animType && !1 !== i.animType);
    }),
    (e.prototype.setSlideClasses = function (i) {
      var e,
        t,
        o,
        s,
        n = this;
      if (
        ((t = n.$slider
          .find('.slick-slide')
          .removeClass('slick-active slick-center slick-current')
          .attr('aria-hidden', 'true')),
        n.$slides.eq(i).addClass('slick-current'),
        !0 === n.options.centerMode)
      ) {
        var r = n.options.slidesToShow % 2 == 0 ? 1 : 0;
        (e = Math.floor(n.options.slidesToShow / 2)),
          !0 === n.options.infinite &&
            (i >= e && i <= n.slideCount - 1 - e
              ? n.$slides
                  .slice(i - e + r, i + e + 1)
                  .addClass('slick-active')
                  .attr('aria-hidden', 'false')
              : ((o = n.options.slidesToShow + i),
                t
                  .slice(o - e + 1 + r, o + e + 2)
                  .addClass('slick-active')
                  .attr('aria-hidden', 'false')),
            0 === i
              ? t
                  .eq(t.length - 1 - n.options.slidesToShow)
                  .addClass('slick-center')
              : i === n.slideCount - 1 &&
                t.eq(n.options.slidesToShow).addClass('slick-center')),
          n.$slides.eq(i).addClass('slick-center');
      } else
        i >= 0 && i <= n.slideCount - n.options.slidesToShow
          ? n.$slides
              .slice(i, i + n.options.slidesToShow)
              .addClass('slick-active')
              .attr('aria-hidden', 'false')
          : t.length <= n.options.slidesToShow
          ? t.addClass('slick-active').attr('aria-hidden', 'false')
          : ((s = n.slideCount % n.options.slidesToShow),
            (o = !0 === n.options.infinite ? n.options.slidesToShow + i : i),
            n.options.slidesToShow == n.options.slidesToScroll &&
            n.slideCount - i < n.options.slidesToShow
              ? t
                  .slice(o - (n.options.slidesToShow - s), o + s)
                  .addClass('slick-active')
                  .attr('aria-hidden', 'false')
              : t
                  .slice(o, o + n.options.slidesToShow)
                  .addClass('slick-active')
                  .attr('aria-hidden', 'false'));
      ('ondemand' !== n.options.lazyLoad &&
        'anticipated' !== n.options.lazyLoad) ||
        n.lazyLoad();
    }),
    (e.prototype.setupInfinite = function () {
      var e,
        t,
        o,
        s = this;
      if (
        (!0 === s.options.fade && (s.options.centerMode = !1),
        !0 === s.options.infinite &&
          !1 === s.options.fade &&
          ((t = null), s.slideCount > s.options.slidesToShow))
      ) {
        for (
          o =
            !0 === s.options.centerMode
              ? s.options.slidesToShow + 1
              : s.options.slidesToShow,
            e = s.slideCount;
          e > s.slideCount - o;
          e -= 1
        )
          (t = e - 1),
            i(s.$slides[t])
              .clone(!0)
              .attr('id', '')
              .attr('data-slick-index', t - s.slideCount)
              .prependTo(s.$slideTrack)
              .addClass('slick-cloned');
        for (e = 0; e < o + s.slideCount; e += 1)
          (t = e),
            i(s.$slides[t])
              .clone(!0)
              .attr('id', '')
              .attr('data-slick-index', t + s.slideCount)
              .appendTo(s.$slideTrack)
              .addClass('slick-cloned');
        s.$slideTrack
          .find('.slick-cloned')
          .find('[id]')
          .each(function () {
            i(this).attr('id', '');
          });
      }
    }),
    (e.prototype.interrupt = function (i) {
      var e = this;
      i || e.autoPlay(), (e.interrupted = i);
    }),
    (e.prototype.selectHandler = function (e) {
      var t = this,
        o = i(e.target).is('.slick-slide')
          ? i(e.target)
          : i(e.target).parents('.slick-slide'),
        s = parseInt(o.attr('data-slick-index'));
      s || (s = 0),
        t.slideCount <= t.options.slidesToShow
          ? t.slideHandler(s, !1, !0)
          : t.slideHandler(s);
    }),
    (e.prototype.slideHandler = function (i, e, t) {
      var o,
        s,
        n,
        r,
        l,
        d = null,
        a = this;
      if (
        ((e = e || !1),
        !(
          (!0 === a.animating && !0 === a.options.waitForAnimate) ||
          (!0 === a.options.fade && a.currentSlide === i)
        ))
      )
        if (
          (!1 === e && a.asNavFor(i),
          (o = i),
          (d = a.getLeft(o)),
          (r = a.getLeft(a.currentSlide)),
          (a.currentLeft = null === a.swipeLeft ? r : a.swipeLeft),
          !1 === a.options.infinite &&
            !1 === a.options.centerMode &&
            (i < 0 || i > a.getDotCount() * a.options.slidesToScroll))
        )
          !1 === a.options.fade &&
            ((o = a.currentSlide),
            !0 !== t
              ? a.animateSlide(r, function () {
                  a.postSlide(o);
                })
              : a.postSlide(o));
        else if (
          !1 === a.options.infinite &&
          !0 === a.options.centerMode &&
          (i < 0 || i > a.slideCount - a.options.slidesToScroll)
        )
          !1 === a.options.fade &&
            ((o = a.currentSlide),
            !0 !== t
              ? a.animateSlide(r, function () {
                  a.postSlide(o);
                })
              : a.postSlide(o));
        else {
          if (
            (a.options.autoplay && clearInterval(a.autoPlayTimer),
            (s =
              o < 0
                ? a.slideCount % a.options.slidesToScroll != 0
                  ? a.slideCount - (a.slideCount % a.options.slidesToScroll)
                  : a.slideCount + o
                : o >= a.slideCount
                ? a.slideCount % a.options.slidesToScroll != 0
                  ? 0
                  : o - a.slideCount
                : o),
            (a.animating = !0),
            a.$slider.trigger('beforeChange', [a, a.currentSlide, s]),
            (n = a.currentSlide),
            (a.currentSlide = s),
            a.setSlideClasses(a.currentSlide),
            a.options.asNavFor &&
              (l = (l = a.getNavTarget()).slick('getSlick')).slideCount <=
                l.options.slidesToShow &&
              l.setSlideClasses(a.currentSlide),
            a.updateDots(),
            a.updateArrows(),
            !0 === a.options.fade)
          )
            return (
              !0 !== t
                ? (a.fadeSlideOut(n),
                  a.fadeSlide(s, function () {
                    a.postSlide(s);
                  }))
                : a.postSlide(s),
              void a.animateHeight()
            );
          !0 !== t
            ? a.animateSlide(d, function () {
                a.postSlide(s);
              })
            : a.postSlide(s);
        }
    }),
    (e.prototype.startLoad = function () {
      var i = this;
      !0 === i.options.arrows &&
        i.slideCount > i.options.slidesToShow &&
        (i.$prevArrow.hide(), i.$nextArrow.hide()),
        !0 === i.options.dots &&
          i.slideCount > i.options.slidesToShow &&
          i.$dots.hide(),
        i.$slider.addClass('slick-loading');
    }),
    (e.prototype.swipeDirection = function () {
      var i,
        e,
        t,
        o,
        s = this;
      return (
        (i = s.touchObject.startX - s.touchObject.curX),
        (e = s.touchObject.startY - s.touchObject.curY),
        (t = Math.atan2(e, i)),
        (o = Math.round((180 * t) / Math.PI)) < 0 && (o = 360 - Math.abs(o)),
        o <= 45 && o >= 0
          ? !1 === s.options.rtl
            ? 'left'
            : 'right'
          : o <= 360 && o >= 315
          ? !1 === s.options.rtl
            ? 'left'
            : 'right'
          : o >= 135 && o <= 225
          ? !1 === s.options.rtl
            ? 'right'
            : 'left'
          : !0 === s.options.verticalSwiping
          ? o >= 35 && o <= 135
            ? 'down'
            : 'up'
          : 'vertical'
      );
    }),
    (e.prototype.swipeEnd = function (i) {
      var e,
        t,
        o = this;
      if (((o.dragging = !1), (o.swiping = !1), o.scrolling))
        return (o.scrolling = !1), !1;
      if (
        ((o.interrupted = !1),
        (o.shouldClick = !(o.touchObject.swipeLength > 10)),
        void 0 === o.touchObject.curX)
      )
        return !1;
      if (
        (!0 === o.touchObject.edgeHit &&
          o.$slider.trigger('edge', [o, o.swipeDirection()]),
        o.touchObject.swipeLength >= o.touchObject.minSwipe)
      ) {
        switch ((t = o.swipeDirection())) {
          case 'left':
          case 'down':
            (e = o.options.swipeToSlide
              ? o.checkNavigable(o.currentSlide + o.getSlideCount())
              : o.currentSlide + o.getSlideCount()),
              (o.currentDirection = 0);
            break;
          case 'right':
          case 'up':
            (e = o.options.swipeToSlide
              ? o.checkNavigable(o.currentSlide - o.getSlideCount())
              : o.currentSlide - o.getSlideCount()),
              (o.currentDirection = 1);
        }
        'vertical' != t &&
          (o.slideHandler(e),
          (o.touchObject = {}),
          o.$slider.trigger('swipe', [o, t]));
      } else
        o.touchObject.startX !== o.touchObject.curX &&
          (o.slideHandler(o.currentSlide), (o.touchObject = {}));
    }),
    (e.prototype.swipeHandler = function (i) {
      var e = this;
      if (
        !(
          !1 === e.options.swipe ||
          ('ontouchend' in document && !1 === e.options.swipe) ||
          (!1 === e.options.draggable && -1 !== i.type.indexOf('mouse'))
        )
      )
        switch (
          ((e.touchObject.fingerCount =
            i.originalEvent && void 0 !== i.originalEvent.touches
              ? i.originalEvent.touches.length
              : 1),
          (e.touchObject.minSwipe = e.listWidth / e.options.touchThreshold),
          !0 === e.options.verticalSwiping &&
            (e.touchObject.minSwipe = e.listHeight / e.options.touchThreshold),
          i.data.action)
        ) {
          case 'start':
            e.swipeStart(i);
            break;
          case 'move':
            e.swipeMove(i);
            break;
          case 'end':
            e.swipeEnd(i);
        }
    }),
    (e.prototype.swipeMove = function (i) {
      var e,
        t,
        o,
        s,
        n,
        r,
        l = this;
      return (
        (n = void 0 !== i.originalEvent ? i.originalEvent.touches : null),
        !(!l.dragging || l.scrolling || (n && 1 !== n.length)) &&
          ((e = l.getLeft(l.currentSlide)),
          (l.touchObject.curX = void 0 !== n ? n[0].pageX : i.clientX),
          (l.touchObject.curY = void 0 !== n ? n[0].pageY : i.clientY),
          (l.touchObject.swipeLength = Math.round(
            Math.sqrt(Math.pow(l.touchObject.curX - l.touchObject.startX, 2))
          )),
          (r = Math.round(
            Math.sqrt(Math.pow(l.touchObject.curY - l.touchObject.startY, 2))
          )),
          !l.options.verticalSwiping && !l.swiping && r > 4
            ? ((l.scrolling = !0), !1)
            : (!0 === l.options.verticalSwiping &&
                (l.touchObject.swipeLength = r),
              (t = l.swipeDirection()),
              void 0 !== i.originalEvent &&
                l.touchObject.swipeLength > 4 &&
                ((l.swiping = !0), i.preventDefault()),
              (s =
                (!1 === l.options.rtl ? 1 : -1) *
                (l.touchObject.curX > l.touchObject.startX ? 1 : -1)),
              !0 === l.options.verticalSwiping &&
                (s = l.touchObject.curY > l.touchObject.startY ? 1 : -1),
              (o = l.touchObject.swipeLength),
              (l.touchObject.edgeHit = !1),
              !1 === l.options.infinite &&
                ((0 === l.currentSlide && 'right' === t) ||
                  (l.currentSlide >= l.getDotCount() && 'left' === t)) &&
                ((o = l.touchObject.swipeLength * l.options.edgeFriction),
                (l.touchObject.edgeHit = !0)),
              !1 === l.options.vertical
                ? (l.swipeLeft = e + o * s)
                : (l.swipeLeft = e + o * (l.$list.height() / l.listWidth) * s),
              !0 === l.options.verticalSwiping && (l.swipeLeft = e + o * s),
              !0 !== l.options.fade &&
                !1 !== l.options.touchMove &&
                (!0 === l.animating
                  ? ((l.swipeLeft = null), !1)
                  : void l.setCSS(l.swipeLeft))))
      );
    }),
    (e.prototype.swipeStart = function (i) {
      var e,
        t = this;
      if (
        ((t.interrupted = !0),
        1 !== t.touchObject.fingerCount ||
          t.slideCount <= t.options.slidesToShow)
      )
        return (t.touchObject = {}), !1;
      void 0 !== i.originalEvent &&
        void 0 !== i.originalEvent.touches &&
        (e = i.originalEvent.touches[0]),
        (t.touchObject.startX = t.touchObject.curX =
          void 0 !== e ? e.pageX : i.clientX),
        (t.touchObject.startY = t.touchObject.curY =
          void 0 !== e ? e.pageY : i.clientY),
        (t.dragging = !0);
    }),
    (e.prototype.unfilterSlides = e.prototype.slickUnfilter =
      function () {
        var i = this;
        null !== i.$slidesCache &&
          (i.unload(),
          i.$slideTrack.children(this.options.slide).detach(),
          i.$slidesCache.appendTo(i.$slideTrack),
          i.reinit());
      }),
    (e.prototype.unload = function () {
      var e = this;
      i('.slick-cloned', e.$slider).remove(),
        e.$dots && e.$dots.remove(),
        e.$prevArrow &&
          e.htmlExpr.test(e.options.prevArrow) &&
          e.$prevArrow.remove(),
        e.$nextArrow &&
          e.htmlExpr.test(e.options.nextArrow) &&
          e.$nextArrow.remove(),
        e.$slides
          .removeClass('slick-slide slick-active slick-visible slick-current')
          .attr('aria-hidden', 'true')
          .css('width', '');
    }),
    (e.prototype.unslick = function (i) {
      var e = this;
      e.$slider.trigger('unslick', [e, i]), e.destroy();
    }),
    (e.prototype.updateArrows = function () {
      var i = this;
      Math.floor(i.options.slidesToShow / 2),
        !0 === i.options.arrows &&
          i.slideCount > i.options.slidesToShow &&
          !i.options.infinite &&
          (i.$prevArrow
            .removeClass('slick-disabled')
            .attr('aria-disabled', 'false'),
          i.$nextArrow
            .removeClass('slick-disabled')
            .attr('aria-disabled', 'false'),
          0 === i.currentSlide
            ? (i.$prevArrow
                .addClass('slick-disabled')
                .attr('aria-disabled', 'true'),
              i.$nextArrow
                .removeClass('slick-disabled')
                .attr('aria-disabled', 'false'))
            : i.currentSlide >= i.slideCount - i.options.slidesToShow &&
              !1 === i.options.centerMode
            ? (i.$nextArrow
                .addClass('slick-disabled')
                .attr('aria-disabled', 'true'),
              i.$prevArrow
                .removeClass('slick-disabled')
                .attr('aria-disabled', 'false'))
            : i.currentSlide >= i.slideCount - 1 &&
              !0 === i.options.centerMode &&
              (i.$nextArrow
                .addClass('slick-disabled')
                .attr('aria-disabled', 'true'),
              i.$prevArrow
                .removeClass('slick-disabled')
                .attr('aria-disabled', 'false')));
    }),
    (e.prototype.updateDots = function () {
      var i = this;
      null !== i.$dots &&
        (i.$dots.find('li').removeClass('slick-active').end(),
        i.$dots
          .find('li')
          .eq(Math.floor(i.currentSlide / i.options.slidesToScroll))
          .addClass('slick-active'));
    }),
    (e.prototype.visibility = function () {
      var i = this;
      i.options.autoplay &&
        (document[i.hidden] ? (i.interrupted = !0) : (i.interrupted = !1));
    }),
    (i.fn.slick = function () {
      var i,
        t,
        o = this,
        s = arguments[0],
        n = Array.prototype.slice.call(arguments, 1),
        r = o.length;
      for (i = 0; i < r; i++)
        if (
          ('object' == typeof s || void 0 === s
            ? (o[i].slick = new e(o[i], s))
            : (t = o[i].slick[s].apply(o[i].slick, n)),
          void 0 !== t)
        )
          return t;
      return o;
    });
});
// source --> https://embanews.com.br/wp-content/plugins/dflip/assets/js/dflip.min.js?ver=2.4.13 
!function(){var e={795:function(){var e,t;(t=t||(e=[],{getAll:function(){return e},add:function(t){e.push(t)},remove:function(t){var i=e.indexOf(t);-1!==i&&e.splice(i,1)},update:function(t){if(0===e.length)return!1;var i=0;for(t=null!=t?t:window.performance.now();i<e.length;)e[i].update(t)?i++:e.splice(i,1);return!0}})).Tween=function(e){var i={},n={},o={},s=1e3,a=!1,r=0,l=null,h=t.Easing.Linear.None,u=t.Interpolation.Linear,p=null,c=!1,d=null,f=null,g=null;for(var v in e)i[v]=parseFloat(e[v],10);this.to=function(e,t){return null!=t&&(s=t),n=e,this},this.start=function(s){for(var h in t.add(this),a=!0,c=!1,l=(null!=s?s:window.performance.now())+r,n){if(n[h]instanceof Array){if(0===n[h].length)continue;n[h]=[e[h]].concat(n[h])}null!=i[h]&&(i[h]=e[h],i[h]instanceof Array==!1&&(i[h]*=1),o[h]=i[h]||0)}return this},this.stop=function(){return a&&(t.remove(this),a=!1,null!=g&&g.call(e)),this},this.complete=function(){return a&&(t.remove(this),a=!1,null!=f&&f.call(e)),this},this.delay=function(e){return r=e,this},this.easing=function(e){return h=null==e?h:e,this},this.onStart=function(e){return p=e,this},this.onUpdate=function(e){return d=e,this},this.onComplete=function(e){return f=e,this},this.onStop=function(e){return g=e,this},this.update=function(t){if(t<l)return!0;for(o in!1===c&&(null!=p&&p.call(e),c=!0),a=(a=(t-l)/s)>1?1:a,r=h(a),n)if(null!=i[o]){var o,a,r,g=i[o]||0,v=n[o];v instanceof Array?e[o]=u(v,r):("string"==typeof v&&(v=v.startsWith("+")||v.startsWith("-")?g+parseFloat(v,10):parseFloat(v,10)),"number"==typeof v&&(e[o]=g+(v-g)*r))}return null!=d&&d.call(e,r),1!==a||(null!=f&&f.call(e),!1)}},t.Easing={Linear:{None:function(e){return e}},Quadratic:{InOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)}},Sinusoidal:{In:function(e){return 1-Math.cos(e*Math.PI/2)},Out:function(e){return Math.sin(e*Math.PI/2)}},Cubic:{InOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)}}},t.Interpolation={Linear:function(e,i){var n=e.length-1,o=n*i,s=Math.floor(o),a=t.Interpolation.Utils.Linear;return i<0?a(e[0],e[1],o):i>1?a(e[n],e[n-1],n-o):a(e[s],e[s+1>n?n:s+1],o-s)},Utils:{Linear:function(e,t,i){return(t-e)*i+e}}},window.TWEEN=t}},t={};function i(n){var o=t[n];if(void 0!==o)return o.exports;var s=t[n]={exports:{}};return e[n](s,s.exports,i),s.exports}i.amdO={},function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}function t(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||n(t)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,i){if(t){if("string"==typeof t)return e(t,i);var n=Object.prototype.toString.call(t).slice(8,-1);if("Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return e(t,i)}}var o,s,a=new WeakMap,r=new WeakMap;function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e instanceof l)return e;if(!(this instanceof l))return new l(e,t);if(a.set(this,[]),this.length=0,!e)return this;var i=[];return"string"==typeof e?i=e.trim().startsWith("<")&&e.trim().endsWith(">")?(i=Array.from(document.createRange().createContextualFragment(e.trim()).children)).map(function(e){return e.cloneNode(!0)}):Array.from(document.querySelectorAll(e)):e.nodeType||e===window||e===document?i=[e]:void 0!==e.length&&(i=Array.from(e)),this._setElements(i,t),this}function h(){return!0}function u(){return!1}l.prototype._getElements=function(){return a.get(this)||[]},l.prototype._setElements=function(e,i){var n=this;return a.set(this,e),this.length=e.length,Object.keys(this).forEach(function(e){isNaN(e)||delete n[e]}),e.forEach(function(e,o){if(i.hasOwnProperty("class")){var s;(s=e.classList).add.apply(s,t(i.class.trim().split(" ")))}i.hasOwnProperty("id")&&(e.id=i.id),i.hasOwnProperty("title")&&(e.title=i.title),i.hasOwnProperty("html")&&(e.innerHTML=i.html),n[o]=e}),this},l.prototype.on=function(e,t,i){var n,o;return"string"==typeof t&&"function"==typeof i?(o=t,n=i):(n=t,o=null),this._getElements().forEach(function(t){if(o){var i=function(e){if(e.target){var t=e.target.closest(o);t&&(e.originalEvent=e,n.call(t,e))}};t.addEventListener(e,i),t._queryHandlers||(t._queryHandlers={}),t._queryHandlers[e]||(t._queryHandlers[e]=[]),t._queryHandlers[e].push({original:n,wrapped:i,selector:o})}else{var s=function(e){e.originalEvent=e,n.call(t,e)};t.addEventListener(e,s),t._queryHandlers||(t._queryHandlers={}),t._queryHandlers[e]||(t._queryHandlers[e]=[]),t._queryHandlers[e].push({original:n,wrapped:s})}}),this},l.prototype.off=function(){return this._getElements().forEach(function(e){e._queryHandlers&&(Object.keys(e._queryHandlers).forEach(function(t){e._queryHandlers[t].forEach(function(i){e.removeEventListener(t,i.wrapped)})}),e._queryHandlers={})}),this},l.prototype.trigger=function(e){return this._getElements().forEach(function(t){if("string"==typeof e&&"function"==typeof t[e])t[e]();else{var i=new Event(e,{bubbles:!0});t.dispatchEvent(i)}}),this},l.prototype.addClass=function(e){return e&&this._getElements().forEach(function(i){if(i.classList){var n;(n=i.classList).add.apply(n,t(e.trim().split(" ")))}}),this},l.prototype.removeClass=function(e){return e&&this._getElements().forEach(function(i){if(i.classList){var n;(n=i.classList).remove.apply(n,t(e.trim().split(" ")))}}),this},l.prototype.hasClass=function(e){return this._getElements().some(function(t){return t.classList&&t.classList.contains(e)})},l.prototype.toggleClass=function(e,t){return this._getElements().forEach(function(i){void 0===t?i.classList.toggle(e):t?i.classList.add(e):i.classList.remove(e)}),this},l.prototype.css=function(e){var t=["width","height","min-width","min-height","max-width","max-height","margin","marginTop","marginRight","marginBottom","marginLeft","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","top","right","bottom","left","border-width","border-top-width","border-right-width","border-bottom-width","border-left-width","fontSize","lineHeight"];return this._getElements().forEach(function(i){Object.keys(e).forEach(function(n){var o=e[n];null!=o&&""!==o&&!isNaN(parseFloat(o))&&isFinite(o)&&t.includes(n)&&0!==o&&"0"!==o&&"number"==typeof o&&(o+="px"),i.style[n]=o})}),this},l.prototype.prepend=function(e){return e&&this._getElements().forEach(function(t){"string"==typeof e?t.insertAdjacentHTML("afterbegin",e):e instanceof l?e._getElements().forEach(function(e){t.insertBefore(e,t.firstChild)}):e.nodeType&&t.insertBefore(e,t.firstChild)}),this},l.prototype.append=function(e){return e&&this._getElements().forEach(function(t){"string"==typeof e?t.insertAdjacentHTML("beforeend",e):e instanceof l?e._getElements().forEach(function(e){t.contains(e)||t.appendChild(e)}):e.nodeType&&!t.contains(e)&&t.appendChild(e)}),this},l.prototype.appendTo=function(e){var t=e instanceof l?e._getElements()[0]:"string"==typeof e?document.querySelector(e):e;return t&&this._getElements().forEach(function(e){t.contains(e)||t.appendChild(e)}),this},l.prototype.after=function(e){return this._getElements().forEach(function(t){"string"==typeof e?t.insertAdjacentHTML("afterend",e):e instanceof l?e._getElements().forEach(function(e){t.parentNode.insertBefore(e,t.nextSibling)}):e.nodeType&&t.parentNode.insertBefore(e,t.nextSibling)}),this},l.prototype.html=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].innerHTML:"":(this._getElements().forEach(function(t){t.innerHTML=e}),this)},l.prototype.text=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].textContent:"":(this._getElements().forEach(function(t){t.textContent=e}),this)},l.prototype.find=function(e){var i=[];return this._getElements().forEach(function(n){var o=n.querySelectorAll(e);i.push.apply(i,t(Array.from(o)))}),new l(i)},l.prototype.children=function(e){var t=[];return this._getElements().forEach(function(i){Array.from(i.children).forEach(function(i){(!e||i.matches(e))&&t.push(i)})}),new l(t)},l.prototype.is=function(e){return this._getElements().some(function(t){return t.matches(e)})},l.prototype.closest=function(e){var t=[];return this._getElements().forEach(function(i){var n=i.closest(e);n&&!t.includes(n)&&t.push(n)}),new l(t)},l.prototype.contains=function(e){var t=e instanceof l?e._getElements()[0]:e;return this._getElements().some(function(e){return e.contains(t)})},l.prototype.siblings=function(e){var i=[];return this._getElements().forEach(function(n){var o=Array.from(n.parentElement.children).filter(function(e){return e!==n});e&&(o=o.filter(function(t){return t.matches(e)})),i.push.apply(i,t(o))}),new l(i)},l.prototype.parent=function(e){var t=this._getElements().map(function(e){return e.parentElement}).filter(function(e){return null!==e});return e&&(t=t.filter(function(t){return t.matches(e)})),new l(t)},l.prototype.each=function(e){return this._getElements().forEach(function(t,i){e.call(t,i,t)}),this},l.prototype.map=function(e){return this._getElements().map(function(t,i){return e.call(t,i,t)}),this},l.prototype.get=function(){return this._getElements()},l.prototype.attr=function(e,t){return 1==arguments.length?this._getElements()[0]?this._getElements()[0].getAttribute(e):void 0:(void 0===t?this._getElements().forEach(function(t){t.removeAttribute(e)}):this._getElements().forEach(function(i){i.setAttribute(e,t)}),this)},l.prototype.removeAttr=function(e){return this._getElements().forEach(function(t){t.removeAttribute(e)}),this},l.prototype.data=function(e,t){if(void 0===t){var i=this._getElements()[0];if(!i)return;var n=r.get(i)||{};if(void 0!==n[e])return n[e];var o=e.replace(/-([a-z])/g,function(e,t){return t.toUpperCase()});return i.dataset[o]}return this._getElements().forEach(function(i){if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)i.setAttribute("data-".concat(e),t);else if(null===t){i.removeAttribute("data-".concat(e));var n=r.get(i);n&&void 0!==n[e]&&(delete n[e],r.set(i,n))}else if((void 0===t?"undefined":t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"){var o=r.get(i)||{};o[e]=t,r.set(i,o)}}),this},l.prototype.height=function(e){if(void 0===e){if(0===this._getElements().length)return 0;var t=this._getElements()[0];return t===window?window.innerHeight:t.offsetHeight}return this._getElements().forEach(function(t){t.style.height="number"==typeof e?e+"px":e}),this},l.prototype.width=function(e){if(void 0===e){if(0===this._getElements().length)return 0;var t=this._getElements()[0];return t===window?window.innerWidth:t.offsetWidth}return this._getElements().forEach(function(t){t.style.width="number"==typeof e?e+"px":e}),this},l.prototype.offset=function(){return{top:this[0].offsetTop,left:this[0].offsetLeft}},l.prototype.remove=function(){return this._getElements().forEach(function(e){e.parentNode&&e.parentNode.removeChild(e)}),this._setElements([]),this},l.prototype.val=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].value:"":(this._getElements().forEach(function(t){t.value=e}),this)},l.prototype.hide=function(){return this._getElements().forEach(function(e){e.style.display="none"}),this},l.prototype.show=function(){return this._getElements().forEach(function(e){e.style.display="block"}),this},l.prototype.ready=function(e){document.addEventListener("DOMContentLoaded",e)},l.prototype.scrollTop=function(e){return void 0===e?this._getElements()[0]?this._getElements()[0].scrollTop:0:(this._getElements().forEach(function(t){t.scrollTop=e}),this)},l.prototype.change=function(e){return this._getElements().forEach(function(t){t.addEventListener("change",e)}),this},l.prototype.click=function(){return this._getElements().forEach(function(e){"function"==typeof e.click&&e.click()}),this},l.extend=function(e,t){for(var i=arguments.length,o=Array(i>2?i-2:0),s=2;s<i;s++)o[s-2]=arguments[s];if(!t)return{};var a=!0,r=!1,h=void 0;try{for(var u,p=o[Symbol.iterator]();!(a=(u=p.next()).done);a=!0){var c=u.value;if(c){var d=!0,f=!1,g=void 0;try{for(var v,m=Object.entries(c)[Symbol.iterator]();!(d=(v=m.next()).done);d=!0){var y,b=(y=v.value,function(e){if(Array.isArray(e))return e}(y)||function(e,t){var i,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var s=[],a=!0,r=!1;try{for(o=o.call(e);!(a=(i=o.next()).done)&&(s.push(i.value),2!==s.length);a=!0);}catch(e){r=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(r)throw n}}return s}}(y,2)||n(y,2)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),w=b[0],P=b[1];if(P instanceof l)t[w]=P;else switch(Object.prototype.toString.call(P)){case"[object Object]":"[object Object]"===Object.prototype.toString.call(t[w])?t[w]=l.extend(t[w],P):t[w]=l.extend({},P);break;case"[object Array]":t[w]=l.extend(Array(P.length),P);break;default:t[w]=P}}}catch(e){f=!0,g=e}finally{try{d||null==m.return||m.return()}finally{if(f)throw g}}}}}catch(e){r=!0,h=e}finally{try{a||null==p.return||p.return()}finally{if(r)throw h}}return t},l.Event=function(e,t){if(!(this instanceof l.Event))return new l.Event(e,t);e&&e.type?(this.originalEvent=e,this.type=e.type,this.isDefaultPrevented=e.defaultPrevented||void 0===e.defaultPrevented&&!1===e.returnValue?h:u,this.target=e.target&&3===e.target.nodeType?e.target.parentNode:e.target,this.currentTarget=e.currentTarget,this.relatedTarget=e.relatedTarget):this.type=e,t&&l.extend(this,t),this.timeStamp=e&&e.timeStamp||Date.now(),this._eventFixed=!0},l.Event.prototype={constructor:l.Event,isDefaultPrevented:u,isPropagationStopped:u,isImmediatePropagationStopped:u,isSimulated:!1,preventDefault:function(){var e=this.originalEvent;this.isDefaultPrevented=h,e&&!this.isSimulated&&e.preventDefault()},stopPropagation:function(){var e=this.originalEvent;this.isPropagationStopped=h,e&&!this.isSimulated&&e.stopPropagation()},stopImmediatePropagation:function(){var e=this.originalEvent;this.isImmediatePropagationStopped=h,e&&!this.isSimulated&&e.stopImmediatePropagation(),this.stopPropagation()}},l.event={fix:function(e){return e._eventFixed?e:new l.Event(e)}};var p={jQuery:null,version:"2.4.13",autoDetectLocation:!0,_isHashTriggered:!1,slug:void 0,locationVar:"dearViewerLocation",locationFile:void 0,MOUSE_CLICK_ACTIONS:{NONE:"none",NAV:"nav"},ARROW_KEYS_ACTIONS:{NONE:"none",NAV:"nav"},MOUSE_DBL_CLICK_ACTIONS:{NONE:"none",ZOOM:"zoom"},MOUSE_SCROLL_ACTIONS:{NONE:"none",ZOOM:"zoom",NAV:"nav"},PAGE_SCALE:{PAGE_FIT:"fit",PAGE_WIDTH:"width",AUTO:"auto",ACTUAL:"actual",MANUAL:"manual"},READ_DIRECTION:{LTR:"ltr",RTL:"rtl"},TURN_DIRECTION:{LEFT:"left",RIGHT:"right",NONE:"none"},INFO_TYPE:{INFO:"info",ERROR:"error"},FLIPBOOK_PAGE_MODE:{SINGLE:"single",DOUBLE:"double",AUTO:"auto"},FLIPBOOK_SINGLE_PAGE_MODE:{ZOOM:"zoom",BOOKLET:"booklet",AUTO:"auto"},FLIPBOOK_PAGE_SIZE:{AUTO:"auto",SINGLE:"single",DOUBLE_INTERNAL:"dbl_int",DOUBLE:"dbl",DOUBLE_COVER_BACK:"dbl_cover_back"},LINK_TARGET:{NONE:0,SELF:1,BLANK:2,PARENT:3,TOP:4},CONTROLS_POSITION:{HIDDEN:"hidden",TOP:"top",BOTTOM:"bottom"},TURN_CORNER:{TL:"tl",TR:"tr",BL:"bl",BR:"br",L:"l",R:"r",NONE:"none"},REQUEST_STATUS:{OFF:"none",ON:"pending",COUNT:"counting"},TEXTURE_TARGET:{THUMB:0,VIEWER:1,ZOOM:2},FLIPBOOK_CENTER_SHIFT:{RIGHT:1,LEFT:-1,NONE:0},FLIPBOOK_COVER_TYPE:{NONE:"none",PLAIN:"plain",BASIC:"basic",RIDGE:"ridge"}};function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=Array(t);i<t;i++)n[i]=e[i];return n}p.fakejQuery=!1,"undefined"==typeof jQuery?(p.fakejQuery=!0,p.jQuery=l):p.jQuery=jQuery,p._defaults={is3D:!0,has3DShadow:!0,color3DCover:"#aaaaaa",color3DSheets:"#fff",cover3DType:p.FLIPBOOK_COVER_TYPE.NONE,flexibility:.9,drag3D:!1,height:"auto",autoOpenOutline:!1,autoOpenThumbnail:!1,showDownloadControl:!0,showSearchControl:!0,showPrintControl:!0,enableSound:!0,duration:800,pageRotation:0,flipbook3DTiltAngleUp:0,flipbook3DTiltAngleLeft:0,readDirection:p.READ_DIRECTION.LTR,pageMode:p.FLIPBOOK_PAGE_MODE.AUTO,singlePageMode:p.FLIPBOOK_SINGLE_PAGE_MODE.AUTO,flipbookFitPages:!1,backgroundColor:"transparent",flipbookHardPages:"none",openPage:1,annotationClass:"",maxTextureSize:3200,minTextureSize:256,rangeChunkSize:524288,disableAutoFetch:!0,disableStream:!0,disableFontFace:!1,calendarMode:!1,icons:{altnext:"df-icon-arrow-right1",altprev:"df-icon-arrow-left1",next:"df-icon-arrow-right1",prev:"df-icon-arrow-left1",end:"df-icon-last-page",start:"df-icon-first-page",share:"df-icon-share","outline-open":"df-icon-arrow-right","outline-close":"df-icon-arrow-down",help:"df-icon-help",more:"df-icon-more",download:"df-icon-download",zoomin:"df-icon-add-circle",zoomout:"df-icon-minus-circle",resetzoom:"df-icon-minus-circle",fullscreen:"df-icon-fullscreen","fullscreen-off":"df-icon-fit-screen",fitscreen:"df-icon-fit-screen",thumbnail:"df-icon-grid-view",outline:"df-icon-list",close:"df-icon-close",doublepage:"df-icon-double-page",singlepage:"df-icon-file",print:"df-icon-print",play:"df-icon-play",pause:"df-icon-pause",search:"df-icon-search",sound:"df-icon-volume","sound-off":"df-icon-volume",facebook:"df-icon-facebook",google:"df-icon-google",twitter:"df-icon-twitter",whatsapp:"df-icon-whatsapp",linkedin:"df-icon-linkedin",pinterest:"df-icon-pinterest",mail:"df-icon-mail"},text:{toggleSound:"Turn on/off Sound",toggleThumbnails:"Toggle Thumbnails",toggleOutline:"Toggle Outline/Bookmark",previousPage:"Previous Page",nextPage:"Next Page",toggleFullscreen:"Toggle Fullscreen",zoomIn:"Zoom In",zoomOut:"Zoom Out",resetZoom:"Reset Zoom",pageFit:"Fit Page",widthFit:"Fit Width",toggleHelp:"Toggle Help",search:"Search in PDF",singlePageMode:"Single Page Mode",doublePageMode:"Double Page Mode",downloadPDFFile:"Download PDF File",gotoFirstPage:"Goto First Page",gotoLastPage:"Goto Last Page",print:"Print",play:"Start AutoPlay",pause:"Pause AutoPlay",share:"Share",close:"Close",mailSubject:"Check out this FlipBook",mailBody:"Check out this site {{url}}",loading:"Loading",thumbTitle:"Thumbnails",outlineTitle:"Table of Contents",searchTitle:"Search",searchPlaceHolder:"Search",analyticsEventCategory:"DearFlip",analyticsViewerReady:"Document Ready",analyticsViewerOpen:"Document Opened",analyticsViewerClose:"Document Closed",analyticsFirstPageChange:"First Page Changed"},share:{facebook:"https://www.facebook.com/sharer/sharer.php?u={{url}}&t={{mailsubject}}",twitter:"https://twitter.com/share?url={{url}}&text={{mailsubject}}",mail:void 0,whatsapp:"https://api.whatsapp.com/send/?text={{mailsubject}}+{{url}}&app_absent=0",linkedin:"https://www.linkedin.com/shareArticle?url={{url}}&title={{mailsubject}}",pinterest:"https://www.pinterest.com/pin/create/button/?url={{url}}&media=&description={{mailsubject}}"},allControls:"altPrev,pageNumber,altNext,play,outline,thumbnail,zoomIn,zoomOut,zoom,fullScreen,share,download,search,pageMode,startPage,endPage,sound,search,print,more",moreControls:"download,pageMode,pageFit,startPage,endPage,sound",leftControls:"outline,thumbnail",rightControls:"fullScreen,share,download,more",hideControls:"",hideShareControls:"",controlsPosition:p.CONTROLS_POSITION.BOTTOM,paddingTop:20,paddingLeft:15,paddingRight:15,paddingBottom:20,enableAnalytics:!1,zoomRatio:2,maxDPI:2,fakeZoom:1,progressiveZoom:!1,pageScale:p.PAGE_SCALE.PAGE_FIT,controlsFloating:!0,sideMenuOverlay:!0,enableAnnotation:!0,enableAutoLinks:!0,arrowKeysAction:p.ARROW_KEYS_ACTIONS.NAV,clickAction:p.MOUSE_CLICK_ACTIONS.NAV,dblClickAction:p.MOUSE_DBL_CLICK_ACTIONS.NONE,mouseScrollAction:p.MOUSE_SCROLL_ACTIONS.NONE,linkTarget:p.LINK_TARGET.BLANK,soundFile:"sound/turn2.mp3",imagesLocation:"images",imageResourcesPath:"images/pdfjs/",popupThumbPlaceholder:"data:image/svg+xml,"+escape('<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 210 297"><rect width="210" height="297" style="fill:#f1f2f2"/><circle cx="143" cy="95" r="12" style="fill:#e3e8ed"/><polygon points="131 138 120 149 95 124 34 184 176 185 131 138" style="fill:#e3e8ed"/></svg>'),cMapUrl:"js/libs/cmaps/",logo:"",logoUrl:"",sharePrefix:"",pageSize:p.FLIPBOOK_PAGE_SIZE.AUTO,backgroundImage:"",pixelRatio:window.devicePixelRatio||1,spotLightIntensity:.22,ambientLightColor:"#fff",ambientLightIntensity:.8,shadowOpacity:.1,slug:void 0,headerElementSelector:void 0,onReady:function(e){},onPageChanged:function(e){},beforePageChanged:function(e){},onCreate:function(e){},onCreateUI:function(e){},onFlip:function(e){},beforeFlip:function(e){},autoPDFLinktoViewer:!1,autoLightBoxFullscreen:!1,thumbLayout:"book-title-hover",cleanupAfterRender:!0,canvasWillReadFrequently:!0,providerType:"pdf",loadMoreCount:-1,autoPlay:!1,autoPlayDuration:1e3,autoPlayStart:!1,popupBackGroundColor:"#eee",mockupMode:!1,instantTextureProcess:!1,cachePDFTexture:!1,pdfVersion:"default"},p.defaults={},p.jQuery.extend(!0,p.defaults,p._defaults),p.viewers={},p.providers={},p.openFileOptions={},p.executeCallback=function(){};var d=p.jQuery,f="WebKitCSSMatrix"in window||document.body&&"MozPerspective"in document.body.style,g="onmousedown"in window,v=p.utils={mouseEvents:g?{type:"mouse",start:"mousedown",move:"mousemove",end:"mouseup"}:{type:"touch",start:"touchstart",move:"touchmove",end:"touchend"},html:{div:"<div></div>",a:"<a>",input:"<input type='text'/>",select:"<select></select>"},getSharePrefix:function(){return v.getSharePrefixes()[0]},getSharePrefixes:function(){return(p.defaults.sharePrefix+",dflip-,flipbook-,dearflip-,dearpdf-").split(",").map(function(e){return e.trim()})},toRad:function(e){return e*Math.PI/180},toDeg:function(e){return 180*e/Math.PI},ifdef:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return null==e?t:e},createBtn:function(e,t,i){var n=d(v.html.div,{class:"df-ui-btn df-ui-"+e,title:i,html:void 0!==i?"<span>"+i+"</span>":""});return void 0!==t&&t.indexOf("<svg")>-1?n.html(t.replace("<svg",'<svg xmlns="http://www.w3.org/2000/svg" ')):n.addClass(t),n},transition:function(e,t){return e?t/1e3+"s ease-out":"0s none"},display:function(e){return e?"block":"none"},resetTranslate:function(){return v.translateStr(0,0)},bgImage:function(e){return null==e||"blank"===e?"":' url("'+e+'")'},translateStr:function(e,t){return f?" translate3d("+e+"px,"+t+"px, 0px) ":" translate("+e+"px, "+t+"px) "},httpsCorrection:function(e){try{if(null==e)return null;if("string"!=typeof e)return e;var t=window.location;if(t.href.split(".")[0]===e.split(".")[0])return e;e.split("://")[1].split("/")[0].replace("www.","")===t.hostname.replace("www.","")&&e.indexOf(t.hostname.replace("www.",""))>-1&&(t.href.indexOf("https://")>-1?e=e.replace("http://","https://"):t.href.indexOf("http://")>-1&&(e=e.replace("https://","http://")),t.href.indexOf("://www.")>-1&&-1===e.indexOf("://www.")&&(e=e.replace("://","://www.")),-1===t.href.indexOf("://www.")&&e.indexOf("://www.")>-1&&(e=e.replace("://www.","://")))}catch(t){console.log("Skipping URL correction: "+e)}return e},rotateStr:function(e){return" rotateZ("+e+"deg) "},lowerPowerOfTwo:function(e){return Math.pow(2,Math.floor(Math.log(e)/Math.LN2))},nearestPowerOfTwo:function(e,t){return Math.min(t||2048,Math.pow(2,Math.ceil(Math.log(e)/Math.LN2)))},getFullscreenElement:function(){return document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement},hasFullscreenEnabled:function(){return document.fullscreenEnabled||document.mozFullScreenEnabled||document.webkitFullscreenEnabled||document.msFullscreenEnabled},fixMouseEvent:function(e){if(!e)return e;var t=e.originalEvent||e;if(!t.changedTouches||!(t.changedTouches.length>0))return e;var i=d.event.fix(e),n=t.changedTouches[0];return i.clientX=n.clientX,i.clientY=n.clientY,i.pageX=n.pageX,i.touches=t.touches,i.pageY=n.pageY,i.movementX=n.movementX,i.movementY=n.movementY,i},limitAt:function(e,t,i){return e<t?t:e>i?i:e},distOrigin:function(e,t){return v.distPoints(0,0,e,t)},distPoints:function(e,t,i,n){return Math.sqrt(Math.pow(i-e,2)+Math.pow(n-t,2))},angleByDistance:function(e,t){var i=t/2,n=v.limitAt(e,0,t);return n<i?v.toDeg(Math.asin(n/i)):90+v.toDeg(Math.asin((n-i)/i))},calculateScale:function(e,t){var i=v.distPoints(e[0].x,e[0].y,e[1].x,e[1].y);return v.distPoints(t[0].x,t[0].y,t[1].x,t[1].y)/i},getVectorAvg:function(e){return{x:e.map(function(e){return e.x}).reduce(v.sum)/e.length,y:e.map(function(e){return e.y}).reduce(v.sum)/e.length}},sum:function(e,t){return e+t},getTouches:function(e,t){return t=t||{left:0,top:0},Array.prototype.slice.call(e.touches).map(function(e){return{x:e.pageX-t.left,y:e.pageY-t.top}})},getScriptCallbacks:[],getScript:function(e,t,i,n){var o,s=v.getScriptCallbacks[e];function a(){o.removeEventListener("load",r,!1),o.removeEventListener("readystatechange",r,!1),o.removeEventListener("complete",r,!1),o.removeEventListener("error",l,!1),o.onload=o.onreadystatechange=null,o=null,o=null}function r(e,t){if(null!=o&&(t||!o.readyState||/loaded|complete/.test(o.readyState))){if(!t){for(var n=0;n<s.length;n++)s[n]&&s[n](),s[n]=null;i=null}a()}}function l(){i(),a(),i=null}if(0===d("script[src='"+e+"']").length){(s=v.getScriptCallbacks[e]=[]).push(t),o=document.createElement("script");var h=document.body.getElementsByTagName("script")[0];o.async=!0,o.setAttribute("data-cfasync","false"),!0===n&&o.setAttribute("type","module"),null!=h?(h.parentNode.insertBefore(o,h),h=null):document.body.appendChild(o),o.addEventListener("load",r,!1),o.addEventListener("readystatechange",r,!1),o.addEventListener("complete",r,!1),i&&o.addEventListener("error",l,!1),o.src=e+("MS"===v.prefix.dom?"?"+Math.random():"")}else s.push(t)},loadScript:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Promise(function(i,n){var o=document.createElement("script");o.src=e,o.onload=function(e){t&&o.remove(),i(e)},o.onerror=function(){n(Error("Cannot load script at: ".concat(o.src)))},(document.head||document.documentElement).append(o)})},detectScriptLocation:function(){if(void 0===window[p.locationVar])d("script").each(function(){var e=d(this)[0].src;if((e.indexOf("/"+p.locationFile+".js")>-1||e.indexOf("/"+p.locationFile+".min.js")>-1||e.indexOf("js/"+p.locationFile+".")>-1)&&(e.indexOf("https://")>-1||e.indexOf("http://")>-1)){var t=e.split("/");window[p.locationVar]=t.slice(0,-2).join("/")}});else if(-1==window[p.locationVar].indexOf(":")){var e=document.createElement("a");e.href=window[p.locationVar],window[p.locationVar]=e.href,e=null}void 0!==window[p.locationVar]&&window[p.locationVar].length>2&&"/"!==window[p.locationVar].slice(-1)&&(window.window[p.locationVar]+="/")},disposeObject:function(e){return e&&e.dispose&&e.dispose(),e=null},log:function(){for(var e,t=arguments.length,i=Array(t),n=0;n<t;n++)i[n]=arguments[n];!0===p.defaults.enableDebugLog&&window.console&&(e=console).log.apply(e,function(e){if(Array.isArray(e))return c(e)}(i)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||function(e,t){if(e){if("string"==typeof e)return c(e,void 0);var i=Object.prototype.toString.call(e).slice(8,-1);if("Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i)return Array.from(i);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return c(e,void 0)}}(i)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())},color:{getBrightness:function(e){var t=e.replace("#","").match(/.{1,2}/g).map(function(e){return parseInt(e,16)});return .299*t[0]+.587*t[1]+.114*t[2]},isLight:function(e){return!v.color.isDark(e)},isDark:function(e){return 128>v.color.getBrightness(e)}},isMobile:/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent),isIOS:/(iPad|iPhone|iPod)/g.test(navigator.userAgent),isIPad:"iPad"===navigator.platform||void 0!==navigator.maxTouchPoints&&navigator.maxTouchPoints>2&&/Mac/.test(navigator.platform),isMac:navigator.platform.toUpperCase().indexOf("MAC")>=0,isSafari:/constructor/i.test(window.HTMLElement)||"[object SafariRemoteNotification]"===(!window.safari||window.safari.pushNotification).toString(),isIEUnsupported:!!navigator.userAgent.match(/(MSIE|Trident)/),isSafariWindows:function(){return!v.isMac&&v.isSafari},hasWebgl:function(){try{var e=document.createElement("canvas");return!!(window.WebGLRenderingContext&&(e.getContext("webgl")||e.getContext("experimental-webgl")))}catch(e){return!1}}(),hasES2022:void 0!==Array.prototype.at,canSupport3D:function(){var e=!0;try{if(!1==v.hasWebgl)e=!1,console.log("Proper Support for Canvas webgl 3D not detected!");else if(!1==v.hasES2022)e=!1,console.log("Proper Support for 3D not extpected in older browser!");else if(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)e=!1,console.log("Proper Support for 3D not detected for IE!");else if(v.isSafariWindows())e=!1,console.log("Proper Support for 3D not detected for Safari!");else{var t=navigator.userAgent.toString().toLowerCase().match(/android\s([0-9\.]*)/i);(t=t?t[1]:void 0)&&(t=parseInt(t,10),!isNaN(t)&&t<9&&(e=!1,console.log("Proper Support for 3D not detected for Android below 9.0!")))}}catch(e){}return e},prefix:(o=window.getComputedStyle(document.documentElement,""),s=Array.prototype.slice.call(o).join("").match(/-(moz|webkit|ms)-/)[1],{dom:"WebKit|Moz|MS".match(RegExp("("+s+")","i"))[1],lowercase:s,css:"-"+s+"-",js:s[0].toUpperCase()+s.substr(1)}),scrollIntoView:function(e,t,i){(t=t||e.parentNode).scrollTop=e.offsetTop+(!1===i?e.offsetHeight-t.offsetHeight:0),t.scrollLeft=e.offsetLeft-t.offsetLeft},getVisibleElements:function(e){var t=e.container,i=e.elements,n=e.visible||[],o=t.scrollTop,s=o+t.clientHeight;if(0==s)return n;var a=0,r=i.length-1,l=i[a],h=l.offsetTop+l.clientTop+l.clientHeight;if(h<o)for(;a<r;){var u=a+r>>1;(h=(l=i[u]).offsetTop+l.clientTop+l.clientHeight)>o?r=u:a=u+1}for(var p=a;p<i.length;p++)if((l=i[p]).offsetTop+l.clientTop<=s)n.push(p+1);else break;return n},getMouseDelta:function(e){var t=0;return null!=e.wheelDelta?t=e.wheelDelta:null!=e.detail&&(t=-e.detail),t},pan:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.startPoint,o=e.app.zoomValue,s=e.left+(!0===i?0:t.raw.x-n.raw.x),a=e.top+(!0===i?0:t.raw.y-n.raw.y);e.left=Math.ceil(v.limitAt(s,-e.shiftWidth,e.shiftWidth)),e.top=Math.ceil(v.limitAt(a,-e.shiftHeight,e.shiftHeight)),1===o&&(e.left=0,e.top=0),!1===i&&(e.startPoint=t)},elementIntersection:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e[0].getBoundingClientRect(),o=t[0].getBoundingClientRect(),s=Math.max(n.left,Math.floor(o.left)),a=Math.max(n.top,Math.floor(o.top)),r=Math.min(n.right,o.right),l=Math.min(n.bottom,o.bottom),h=Math.max(r-s,0),u=Math.max(l-a,0);return i?{left:Math.max(n.left-o.left,0),top:Math.max(n.top-o.top,0),width:h,height:u}:{left:s,top:a,right:r,bottom:l,width:h,height:u}}};v.isChromeExtension=function(){return 0===window.location.href.indexOf("chrome-extension://")};var m=/\x00+/g,y=/[\x01-\x1F]/g;v.removeNullCharacters=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return"string"!=typeof e?(warn("The argument for removeNullCharacters must be a string."),e):(t&&(e=e.replace(y," ")),e.replace(m,""))},p.hashFocusBookFound=!1,v.detectHash=function(){p.preParseHash=window.location.hash;var e=v.getSharePrefixes();-1==e.indexOf("")&&e.push(""),Array.prototype.forEach.call(e,function(e){var t=p.preParseHash,i="#"+e;if(t&&t.indexOf(i)>=0&&!1===p.hashFocusBookFound){i.length>1&&(t=t.split(i)[1]);var n=t.split("/")[0].replace("#","");if(n.length>0)try{var o,s=t.split("/")[1];if(null!=s&&(s=s.split("/")[0]),o=d("[data-df-slug="+n+"]"),0===o.length&&(o=d("[data-slug="+n+"]")),0===o.length&&(o=d("#df-"+n+",#"+n)),0===o.length&&(o=d("[data-_slug="+n+"]")),o.length>0&&o.is("._df_thumb,._df_button,._df_custom,._df_link,._df_book,.df-element,.dp-element")){o=d(o[0]),p.hashFocusBookFound=!0,s=parseInt(s,10),v.focusHash(o);var a=p.activeLightBox&&p.activeLightBox.app||o.data("df-app");if(null!=a)return a.gotoPage(s),v.focusHash(a.element),!1;null!=s&&o.attr("data-hash-page",s),o.addClass("df-hash-focused",!0),null!=o.data("lightbox")||null!=o.data("df-lightbox")?(p._isHashTriggered=!0,o.trigger("click"),p._isHashTriggered=!1):null!=o.attr("href")&&o.attr("href").indexOf(".pdf")>-1&&o.trigger("click")}}catch(e){console.log(e)}}})},v.focusHash=function(e){var t,i;null===(t=(i=e[0]).scrollIntoView)||void 0===t||t.call(i,{behavior:"smooth",block:"nearest",inline:"nearest"})},v.contain=function(e,t,i,n){var o=Math.min(i/e,n/t);return{width:e*o,height:t*o}},v.containUnStretched=function(e,t,i,n){var o=Math.min(1,i/e,n/t);return{width:e*o,height:t*o}},v.fallbackOptions=function(e){return void 0===e.share.mail&&(e.share.mail="mailto:?subject="+e.text.mailSubject+"&body="+e.text.mailBody),e.openPage&&(e.openPage=parseInt(e.openPage,10)),e};var b=function(e){var t={},i={id:"",thumb:"",openPage:"data-hash-page,df-page,data-df-page,data-page,page",target:"",height:"",showDownloadControl:"data-download",source:"pdf-source,df-source,source",is3D:"webgl,is3d",viewerType:"viewertype,viewer-type",pagemode:""};for(var n in i)for(var o=(n+","+i[n]).split(","),s=0;s<o.length;s++){var a=o[s];if(""!==a){var r=e.data(a);if(null!==r&&""!==r&&void 0!==r||null!==(r=e.attr(a))&&""!==r&&void 0!==r){t[n]=r;break}}}return e.removeAttr("data-hash-page"),t};v.getOptions=function(e){void 0==(e=d(e)).data("df-option")&void 0==e.data("option")&&e.data("df-option","option_"+e.attr("id")),void 0!==e.attr("source")&&e.data("df-source",e.attr("source"));var t=e.data("df-option")||e.data("option"),i=void 0;i=(void 0===t?"undefined":t&&"undefined"!=typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"?t:null==t||""===t||null==window[t]?{}:window[t];var n=b(e);return d.extend(!0,{},i,n)},v.isTrue=function(e){return"true"===e||!0===e},v.parseInt=function(e){return parseInt(e,10)},v.parseFloat=function(e){return parseFloat(e)},v.parseIntIfExists=function(e){return void 0!==e&&(e=parseInt(e,10)),e},v.parseFloatIfExists=function(e){return void 0!==e&&(e=parseFloat(e)),e},v.parseBoolIfExists=function(e){return void 0!==e&&(e=v.isTrue(e)),e},v.getCurveAngle=function(e,t){var i,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return e?(i=t>135?180-(180-t)*2:t>45?t-45:0,i=v.limitAt(i,n,180)):(i=t<45?2*t:t<135?t+45:180,i=v.limitAt(i,0,180-n)),i},v.sanitizeOptions=function(e){if(e.showDownloadControl=v.parseBoolIfExists(e.showDownloadControl),e.showSearchControl=v.parseBoolIfExists(e.showSearchControl),e.showPrintControl=v.parseBoolIfExists(e.showPrintControl),e.flipbook3DTiltAngleLeft=v.parseIntIfExists(e.flipbook3DTiltAngleLeft),e.flipbook3DTiltAngleUp=v.parseIntIfExists(e.flipbook3DTiltAngleUp),e.paddingLeft=v.parseIntIfExists(e.paddingLeft),e.paddingRight=v.parseIntIfExists(e.paddingRight),e.paddingTop=v.parseIntIfExists(e.paddingTop),e.paddingBottom=v.parseIntIfExists(e.paddingBottom),e.duration=v.parseIntIfExists(e.duration),e.rangeChunkSize=v.parseIntIfExists(e.rangeChunkSize),e.maxTextureSize=v.parseIntIfExists(e.maxTextureSize),e.linkTarget=v.parseIntIfExists(e.linkTarget),e.zoomRatio=v.parseFloatIfExists(e.zoomRatio),e.enableAnalytics=v.parseBoolIfExists(e.enableAnalytics),e.autoPlay=v.parseBoolIfExists(e.autoPlay),e.autoPlayStart=v.parseBoolIfExists(e.autoPlayStart),e.autoPlayDuration=v.parseIntIfExists(e.autoPlayDuration),void 0!==e.loadMoreCount&&(e.loadMoreCount=v.parseInt(e.loadMoreCount),(isNaN(e.loadMoreCount)||0===e.loadMoreCount)&&(e.loadMoreCount=-1)),null!=e.source&&(Array===e.source.constructor||Array.isArray(e.source)||e.source instanceof Array))for(var t=0;t<e.source.length;t++)e.source[t]=v.httpsCorrection(e.source[t]);else e.source=v.httpsCorrection(e.source);return e},v.finalizeOptions=function(e){return e},v.urlify=function(e){for(var t,i,n=/[a-zA-Z0-9][^\s,]{3,}\.[^\s,]+[a-zA-Z0-9]/gi,o=[];t=n.exec(e);){var s=t[0];1==(s.match(/@/g)||[]).length?s.match(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,7})+/gi)&&o.push({index:t.index,length:s.length,text:s}):s.match(/[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b[-a-zA-Z0-9@:%_\+.~#?&//=]*/g)&&(0===(i=s.toLowerCase()).indexOf("http:")||0===i.indexOf("https:")||0===i.indexOf("www."))&&o.push({index:t.index,length:s.length,text:s})}return o},v.oldurlify=function(e){return e.replace(/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)/g,function(e,t,i,n,o){var s=e=e.toLowerCase();if(e.indexOf(":")>0&&-1===e.indexOf("http:")&&-1===e.indexOf("https:"))return v.log("AutoLink Rejected: "+s+" for "+e),e;if(0===e.indexOf("www."))s="http://"+e;else if(0===e.indexOf("http://")||0===e.indexOf("https://"));else if(0===e.indexOf("mailto:"));else if(e.indexOf("@")>0&&(s="mailto:"+e,null===e.match(/(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/)))return v.log("AutoLink Rejected: "+s+" for "+e),e;return v.log("AutoLink: "+s+" for "+e),'<a href="'+s+'" class="df-autolink" target="_blank">'+e+"</a>"})},v.supportsPassive=!1;try{var w=Object.defineProperty({},"passive",{get:function(){v.supportsPassive=!0}});window.addEventListener("testPassive",null,w),window.removeEventListener("testPassive",null,w)}catch(e){}p.parseCSSElements=function(){d(".dvcss").each(function(){var e,t=d(this),i=function(e){for(var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"dvcss_e_",n=e.classList,o=0;o<n.length;o++)if(0===(t=n[o]).indexOf(i))return t;return null}(t[0]);t.removeClass(i).removeClass("dvcss"),i=i.replace("dvcss_e_","");try{e=JSON.parse(atob(i))}catch(e){}if(e){var n="df_option_"+e.id;window[n]=d.extend(!0,{},window[n],e),t.addClass("df-element"),"none"!==e.lightbox&&(t.attr("data-df-lightbox",void 0===e.lightbox?"custom":e.lightbox),"thumb"==e.lightbox&&t.attr("data-df-thumb",e.pdfThumb),e.thumbLayout&&t.attr("data-df-thumb-layout",e.thumbLayout),e.apl&&t.attr("apl",e.apl)),t.data("df-option",n),t.attr("data-df-slug",e.slug),t.attr("id","df_"+e.id)}})},p.parseThumbs=function(e){e.element.html(""),(null==e.thumbURL||""==e.thumbURL.toString().trim())&&(e.element.addClass("df-thumb-not-found"),e.thumbURL=p.defaults.popupThumbPlaceholder);var t=d("<span class='df-book-title'>").html(e.title),i=d("<div class='df-book-wrapper'>").appendTo(e.element);i.append(d("<div class='df-book-page1'>")),i.append(d("<div class='df-book-page2'>"));var n=d("<div class='df-book-cover'>").append(t).appendTo(i),o=d('<img width="210px" height="297px" class="df-lazy" alt="'+e.title+'"/>');o.attr("data-src",e.thumbURL),o.attr("src",p.defaults.popupThumbPlaceholder),n.prepend(o),p.addLazyElement(o[0]),!0===p.defaults.displayLightboxPlayIcon&&n.addClass("df-icon-play-popup"),"book-title-top"===e.thumbLayout?t.prependTo(e.element):("book-title-bottom"===e.thumbLayout||"cover-title"===e.thumbLayout)&&(e.hasShelf?e.thumbLayout="book-title-fixed":t.appendTo(e.element),!0===p.defaults.displayLightboxPlayIcon&&(e.element.removeClass("df-icon-play-popup"),i.addClass("df-icon-play-popup"))),e.element.addClass("df-tl-"+e.thumbLayout),e.element.attr("title",e.title)},p.initId=10,p.embeds=[],p.activeEmbeds=[],p.removeEmbeds=[],p.removeEmbedsLimit=v.isMobile?1:2,p.parseNormalElements=function(){d(".df-posts").each(function(){if(!1!==p.defaults.loadMoreCount&&-1!==p.defaults.loadMoreCount){var e=d(this);if("true"!==e.data("df-parsed")){e.data("df-parsed","true"),e.attr("df-parsed","true");var t=0,i=e.find(".df-element"),n=i.length;i.each(function(){++t>p.defaults.loadMoreCount&&d(this).attr("skip-parse","true")}),n>p.defaults.loadMoreCount&&e.append("<div class='df-load-more-button-wrapper'><div class='df-load-more-button'>Load More..</div></div>")}}}),p.triggerId=10,d(".df-element").each(function(){var e=d(this);if("true"!==e.attr("skip-parse")&&"true"!==e.data("df-parsed")){e.data("df-parsed","true"),e.attr("df-parsed","true");var t=e.data("df-lightbox")||e.data("lightbox");if(void 0===t)e.addClass("df-lazy-embed"),p.addLazyElement(e[0]);else if(e.addClass("df-popup-"+t),"thumb"===t){var i=e.data("df-thumb-layout")||p.defaults.thumbLayout,n=v.httpsCorrection(e.data("df-thumb"));e.removeAttr("data-thumb").removeAttr("data-thumb-layout");var o=e.html().trim();(void 0===o||""===o)&&(o="Click to Open");var s=e.parent().hasClass("df-has-shelf");p.parseThumbs({element:e,thumbURL:n,title:o,thumbLayout:i,hasShelf:s}),s&&e.after(d("<df-post-shelf>"))}else"button"===t&&p.defaults.buttonClass&&e.addClass(p.defaults.buttonClass);var a=e.attr("data-trigger");null!=a&&a.length>1&&(a=a.split(","),p.triggerId++,a.forEach(function(t){e.attr("df-trigger-id",p.triggerId),d("#"+t).addClass("df-trigger").attr("df-trigger",p.triggerId)}))}}),p.handleLazy=function(){var e;if(p.removeEmbeds.length>p.removeEmbedsLimit&&(e=p.removeEmbeds.shift())){var t=d("[initID='"+e+"']");if(t.length>0){var i=t.data("df-app");if(i){t.attr("data-df-page",i.currentPageNumber),v.log("Removed app id "+e),i.dispose(),i=null;var n=p.activeEmbeds.indexOf(e);n>-1&&p.activeEmbeds.splice(n,1)}}}if(e=p.embeds.shift()){var o=d("[initID='"+e+"']");if(o.length>0){if(o.is("img"))o.hasClass("df-lazy")?(o.attr("src",o.attr("data-src")),o.removeAttr("data-src"),o.removeClass("df-lazy"),p.lazyObserver.unobserve(o[0])):v.log("Prevent this"),p.handleLazy();else{var s=o.data("df-app");null==s?new p.Application({element:o}):s.softInit(),v.log("Created app id "+e),p.activeEmbeds.push(e)}}}p.removeEmbeds.length<=p.removeEmbedsLimit&&0==p.embeds.length&&(p.checkRequestQueue=null)}},p.lazyObserver={observe:function(e){(e=d(e)).is("img")?e.hasClass("df-lazy")&&(e.attr("src",e.attr("data-src")),e.removeAttr("data-src"),e.removeClass("df-lazy")):new p.Application({element:e})}},"function"==typeof IntersectionObserver&&(p.lazyObserver=new IntersectionObserver(function(e,t){e.forEach(function(e){var t,i=d(e.target),n=i.attr("initID");e.isIntersecting?(!i.attr("initID")&&(i.attr("initID",p.initId),n=p.initId.toString(),p.initId++),(t=p.removeEmbeds.indexOf(n))>-1?(p.removeEmbeds.splice(t,1),v.log("Removed id "+n+"from Removal list")):-1==(t=p.embeds.indexOf(n))&&(p.embeds.push(n),v.log("Added id "+n+"to Add list"))):n&&((t=p.embeds.indexOf(n))>-1?(p.embeds.splice(t,1),v.log("Removed id "+n+" from Add list")):-1==(t=p.removeEmbeds.indexOf(n))&&(p.removeEmbeds.push(n),v.log("Added id "+n+" to Removal list"))),P=0,(p.removeEmbeds.length>p.removeEmbedsLimit||p.embeds.length>0)&&null==p.checkRequestQueue&&(p.checkRequestQueue=function(){P++,p.checkRequestQueue&&requestAnimationFrame(function(){p&&p.checkRequestQueue&&p.checkRequestQueue()}),P>20&&(P=0,p.handleLazy())},p.checkRequestQueue())})}));var P=0;p.addLazyElement=function(e){p.lazyObserver.observe(e)},p.parseElements=v.parseElements=function(){p.parseCSSElements(),p.parseNormalElements()},p.initUtils=function(){v.detectScriptLocation();var e=d("body");(v.isSafari||v.isIOS)&&e.addClass("df-ios"),e.on("click",function(){}),e.on("click",".df-posts .df-load-more-button",function(){var e=d(this).closest(".df-posts");if(e.length>0){var t=0;e.find(".df-element").each(function(){var e=d(this);"true"===e.attr("skip-parse")&&(t<p.defaults.loadMoreCount&&e.removeAttr("skip-parse"),t++)}),p.parseNormalElements()}}),p.defaults.shelfImage&&""!=p.defaults.shelfImage&&e.append("<style>.df-has-shelf df-post-shelf:before, .df-has-shelf df-post-shelf:after{background-image: url('"+p.defaults.shelfImage+"');}</style>")};var S=p.jQuery,E=p.utils,x=/*#__PURE__*/function(){var e;function t(e,i){(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,t),this.pages=[],this.app=i,this.parentElement=this.app.viewerContainer;var n="df-viewer "+(e.viewerClass||"");this.element=S("<div>",{class:n}),this.parentElement.append(this.element),this.wrapper=S("<div>",{class:"df-viewer-wrapper"}),this.element.append(this.wrapper),this.oldBasePageNumber=0,this.pages=[],this.minZoom=1,this.maxZoom=4,this.swipeThreshold=20,this.stageDOM=null,this.events={},this.arrowKeysAction=e.arrowKeysAction,this.clickAction=e.clickAction,this.scrollAction=e.scrollAction,this.dblClickAction=e.dblClickAction,this.pageBuffer=[],this.pageBufferSize=10,this.afterConstructor()}return e=[{key:"afterConstructor",value:function(){}},{key:"init",value:function(){}},{key:"softDispose",value:function(){}},{key:"updateBuffer",value:function(e){}},{key:"pageResetCallback",value:function(e){}},{key:"initCustomControls",value:function(){}},{key:"_getInnerWidth",value:function(){return this.app.dimensions.containerWidth-this.app.dimensions.padding.width-this.app.dimensions.offset.width}},{key:"_getInnerHeight",value:function(){return this.app.dimensions.maxHeight-this.app.dimensions.padding.height}},{key:"_getOuterHeight",value:function(e){return e}},{key:"dispose",value:function(){this.stageDOM&&(this.stageDOM.removeEventListener("mousemove",this.events.mousemove,!1),this.stageDOM.removeEventListener("mousedown",this.events.mousedown,!1),this.stageDOM.removeEventListener("mouseup",this.events.mouseup,!1),this.stageDOM.removeEventListener("touchmove",this.events.mousemove,!1),this.stageDOM.removeEventListener("touchstart",this.events.mousedown,!1),this.stageDOM.removeEventListener("touchend",this.events.mouseup,!1),this.stageDOM.removeEventListener("dblclick",this.events.dblclick,!1),this.stageDOM.removeEventListener("scroll",this.events.scroll,!1),this.stageDOM.removeEventListener("mousewheel",this.events.mousewheel,!1),this.stageDOM.removeEventListener("DOMMouseScroll",this.events.mousewheel,!1)),this.events=null,this.stageDOM=null,this.element.remove()}},{key:"checkDocumentPageSizes",value:function(){}},{key:"getViewerPageNumber",value:function(e){return e}},{key:"getDocumentPageNumber",value:function(e){return e}},{key:"getRenderContext",value:function(e,t){var i=this.app,n=i.provider,o=t.pageNumber,s=E.ifdef(t.textureTarget,p.TEXTURE_TARGET.VIEWER);i.dimensions.pageFit;var a=n.viewPorts[o],r=i.viewer.getTextureSize(t),l=null;if(l=s===p.TEXTURE_TARGET.THUMB?i.thumbSize:Math.floor(r.height),void 0===n.getCache(o,l)){var h=r.height/a.height,u=document.createElement("canvas"),c=this.filterViewPort(e.getViewport({scale:h,rotation:e._pageInfo.rotate+i.options.pageRotation}),o);s===p.TEXTURE_TARGET.THUMB&&(h=c.width/c.height>180/i.thumbSize?180*h/c.width:h*i.thumbSize/c.height,c=this.filterViewPort(e.getViewport({scale:h,rotation:e._pageInfo.rotate+i.options.pageRotation}),o)),u.height=Math.floor(c.height),u.width=Math.floor(c.width);var d=Math.abs(u.width-r.width)/r.width*100;return d>.001&&d<2&&(u.width=Math.floor(r.width),u.height=Math.floor(r.height)),i.viewer.filterViewPortCanvas(c,u,o),{canvas:u,canvasContext:u.getContext("2d",{willReadFrequently:!0===p.defaults.canvasWillReadFrequently}),viewport:c}}}},{key:"filterViewPort",value:function(e,t){return e}},{key:"getViewPort",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.app.provider.viewPorts[e];return t?null!=i?i:this.app.provider.defaultPage.viewPort:i}},{key:"pagesReady",value:function(){}},{key:"onReady",value:function(){}},{key:"filterViewPortCanvas",value:function(e){}},{key:"finalizeAnnotations",value:function(){}},{key:"finalizeTextContent",value:function(){}},{key:"updateTextContent",value:function(e){void 0==e&&(e=this.getBasePage(e)),this.app.provider.processTextContent(e,this.getTextElement(e,!0))}},{key:"isActivePage",value:function(e){return e===this.app.currentPageNumber}},{key:"initEvents",value:function(){var e=this.stageDOM=E.ifdef(this.stageDOM,this.parentElement[0]);e&&(e.addEventListener("mousemove",this.events.mousemove=this.mouseMove.bind(this),!1),e.addEventListener("mousedown",this.events.mousedown=this.mouseDown.bind(this),!1),e.addEventListener("mouseup",this.events.mouseup=this.mouseUp.bind(this),!1),e.addEventListener("touchmove",this.events.mousemove=this.mouseMove.bind(this),!1),e.addEventListener("touchstart",this.events.mousedown=this.mouseDown.bind(this),!1),e.addEventListener("touchend",this.events.mouseup=this.mouseUp.bind(this),!1),e.addEventListener("dblclick",this.events.dblclick=this.dblclick.bind(this),!1),e.addEventListener("scroll",this.events.scroll=this.onScroll.bind(this),!1),e.addEventListener("mousewheel",this.events.mousewheel=this.mouseWheel.bind(this),!1),e.addEventListener("DOMMouseScroll",this.events.mousewheel=this.mouseWheel.bind(this),!1)),this.startTouches=null,this.lastScale=null,this.startPoint=null}},{key:"refresh",value:function(){}},{key:"reset",value:function(){}},{key:"eventToPoint",value:function(e){var t={x:e.clientX,y:e.clientY};return t.x=t.x-this.app.viewerContainer[0].getBoundingClientRect().left,t.y=t.y-this.app.viewerContainer[0].getBoundingClientRect().top,{raw:t}}},{key:"mouseMove",value:function(e){e=E.fixMouseEvent(e),this.pinchMove(e),!0===this.pinchZoomDirty&&e.preventDefault(),this.startPoint&&!0!=this.pinchZoomDirty&&(this.pan(this.eventToPoint(e)),e.preventDefault())}},{key:"mouseDown",value:function(e){e=E.fixMouseEvent(e),this.pinchDown(e),this.startPoint=this.eventToPoint(e)}},{key:"mouseUp",value:function(e){e=E.fixMouseEvent(e),!0===this.pinchZoomDirty&&e.preventDefault();var t=this.eventToPoint(e),i=e.target||e.originalTarget,n=this.startPoint&&t.x===this.startPoint.x&&t.y===this.startPoint.y&&"A"!==i.nodeName;!0===e.ctrlKey&&n&&this.zoomOnPoint(t),this.pinchUp(e),this.startPoint=null}},{key:"pinchDown",value:function(e){null!=e.touches&&2==e.touches.length&&null==this.startTouches&&(this.startTouches=E.getTouches(e),this.app.viewer.zoomCenter=E.getVectorAvg(E.getTouches(e,this.parentElement.offset())),this.lastScale=1)}},{key:"pinchUp",value:function(e){null!=e.touches&&e.touches.length<2&&!0==this.pinchZoomDirty&&(this.app.viewer.lastScale=this.lastScale,this.app.container.removeClass("df-pinch-zoom"),this.updateTemporaryScale(!0),this.app.zoom(),this.lastScale=null,this.app.viewer.canSwipe=!1,this.pinchZoomDirty=!1,this.app.viewer._pinchZoomLastScale=null,this.startTouches=null)}},{key:"pinchMove",value:function(e){if(null!=e.touches&&2==e.touches.length&&null!=this.startTouches){this.pinchZoomDirty=!0,this.app.container.addClass("df-pinch-zoom");var t=E.calculateScale(this.startTouches,E.getTouches(e));this.lastScale,this.lastScale=t,this.app.viewer.pinchZoomUpdateScale=E.limitAt(t,this.app.viewer.minZoom/this.app.zoomValue,this.app.viewer.maxZoom/this.app.zoomValue),this.app.viewer._pinchZoomLastScale!=this.app.viewer.pinchZoomUpdateScale&&(this.app.viewer.pinchZoomRequestStatus=p.REQUEST_STATUS.ON,this.app.viewer._pinchZoomLastScale=this.app.viewer.pinchZoomUpdateScale),e.preventDefault();return}}},{key:"updateTemporaryScale",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(!0===e)this.parentElement[0].style.transform="none";else if(this.app.viewer.zoomCenter){var t=this.app.viewer.pinchZoomUpdateScale;this.parentElement[0].style.transformOrigin=this.app.viewer.zoomCenter.x+"px "+this.app.viewer.zoomCenter.y+"px",this.parentElement[0].style.transform="scale3d("+t+","+t+",1)"}}},{key:"pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.panRequestStatus=p.REQUEST_STATUS.ON,E.pan(this,e,t)}},{key:"updatePan",value:function(){this.element.css({transform:"translate3d("+this.left+"px,"+this.top+"px,0)"})}},{key:"dblclick",value:function(e){}},{key:"onScroll",value:function(e){}},{key:"mouseWheel",value:function(e){var t=this.app,i=E.getMouseDelta(e),n=!0===e.ctrlKey,o=t.options.mouseScrollAction===p.MOUSE_SCROLL_ACTIONS.ZOOM&&(!0===t.options.isLightBox||!0===t.isFullscreen);n||o?(i>0||i<0)&&(e.preventDefault(),t.viewer.zoomCenter=this.eventToPoint(e).raw,t.zoom(i),t.ui.update()):t.options.mouseScrollAction===p.MOUSE_SCROLL_ACTIONS.NAV&&(i>0?t.next():i<0&&t.prev())}},{key:"zoomOnPoint",value:function(e){this.app.viewer.zoomCenter=e.raw,this.app.zoom(1)}},{key:"getVisiblePages",value:function(){return this.visiblePagesCache=[],{main:this.visiblePagesCache,buffer:[]}}},{key:"getBasePage",value:function(){return this.app.currentPageNumber}},{key:"isFirstPage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),1===e}},{key:"isLastPage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),e===this.app.pageCount}},{key:"isEdgePage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),1===e||e===this.app.pageCount}},{key:"checkRequestQueue",value:function(){var e=p.REQUEST_STATUS;this.panRequestStatus===e.ON&&(this.updatePan(),this.panRequestStatus=e.OFF),this.app.viewer.pinchZoomRequestStatus===e.ON&&(this.app.viewer.updateTemporaryScale(),this.app.viewer.pinchZoomRequestStatus=e.OFF)}},{key:"isAnimating",value:function(){return!1}},{key:"updatePendingStatusClass",value:function(e){void 0===e&&(e=this.isAnimating()),this.app.container.toggleClass("df-pending",e)}},{key:"initPages",value:function(){}},{key:"resize",value:function(){}},{key:"determinePageMode",value:function(){}},{key:"zoom",value:function(){}},{key:"gotoPageCallBack",value:function(){this.requestRefresh()}},{key:"requestRefresh",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];this.app.refreshRequestStatus=!0===e?p.REQUEST_STATUS.ON:p.REQUEST_STATUS.OFF}},{key:"getPageByNumber",value:function(e){var t=this.pages,i=void 0;if(this.app.isValidPage(e)){for(var n=0;n<t.length;n++)if(e===t[n].pageNumber){i=t[n];break}}return i}},{key:"changeAnnotation",value:function(){return!1}},{key:"getAnnotationElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getPageByNumber(e);if(void 0!==i)return void 0===i.annotationElement&&(i.annotationElement=S("<div class='df-link-content'>"),i.contentLayer.append(i.annotationElement)),!0===t&&i.annotationElement.html(""),i.annotationElement[0]}},{key:"getTextElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.getPageByNumber(e);if(void 0!==i)return void 0===i.textElement&&(i.textElement=S("<div class='df-text-content'>"),i.contentLayer.append(i.textElement)),!0===t&&(i.textElement.html(""),i.textElement.siblings(".df-auto-link-content").html("")),i.textElement[0]}},{key:"render",value:function(){}},{key:"textureLoadedCallback",value:function(e){}},{key:"handleZoom",value:function(){}},{key:"getTextureSize",value:function(e){console.error("Texture calculation missing!")}},{key:"textureHeightLimit",value:function(e){return E.limitAt(e,1,this.app.dimensions.maxTextureHeight)}},{key:"textureWidthLimit",value:function(e){return E.limitAt(e,1,this.app.dimensions.maxTextureWidth)}},{key:"setPage",value:function(e){E.log("Set Page detected",e.pageNumber);var t=this.getPageByNumber(e.pageNumber);return!!t&&(e.callback=this.textureLoadedCallback.bind(this),t.loadTexture(e),this.updateBuffer(t),!0)}},{key:"cleanPage",value:function(e){return!0}},{key:"validatePageChange",value:function(e){return e!==this.app.currentPageNumber}},{key:"afterControlUpdate",value:function(){}},{key:"searchPage",value:function(e){return{include:!0,label:this.app.provider.getLabelforPage(e)}}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();function C(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function T(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function k(e,t,i){return t&&T(e.prototype,t),i&&T(e,i),e}function O(e){return(O=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function R(e,t){return(R=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var L=p.utils,_=p.jQuery,N=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&R(e,t)}(n,e);var t,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=O(n);return e=t?Reflect.construct(i,arguments,O(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)});function n(e){var t;return C(this,n),(t=i.call(this)).canvasMode=null,e&&e.parentElement&&(t.parentElement=e.parentElement),t.init(),t}return k(n,[{key:"init",value:function(){var e=this.element=_("<div>",{class:"df-page"});e[0].appendChild(this.contentLayer[0]),this.texture=new Image,this.parentElement&&this.parentElement[0].append(e[0])}},{key:"resetContent",value:function(){void 0!==this.annotationElement&&this.annotationElement.html(""),void 0!==this.textElement&&this.textElement.html("")}},{key:"setLoading",value:function(){this.element.toggleClass("df-loading",!0!==this.textureLoaded)}},{key:"loadTexture",value:function(e){var t=this,i=e.texture,n=e.callback;function o(){t.textureSrc=i,t.element.css({backgroundImage:L.bgImage(i)}),t.updateTextureLoadStatus(!0),"function"==typeof n&&n(e)}null===t.canvasMode&&i&&"CANVAS"===i.nodeName&&(t.canvasMode=!0),!0===t.canvasMode?(t.element.find("canvas").remove(),i!==t.textureLoadFallback&&(t.textureSrc=i,t.element.append(_(i))),t.updateTextureLoadStatus(!0),"function"==typeof n&&n(e)):i===t.textureLoadFallback?o():(t.texture.onload=o,t.texture.src=i)}},{key:"updateCSS",value:function(e){this.element.css(e)}},{key:"resetCSS",value:function(){this.element.css({transform:"",boxShadow:"",display:"block"})}}]),n}(/*#__PURE__*/function(){function e(){C(this,e),this.textureLoadFallback="blank",this.textureStamp="-1",this.textureLoaded=!1,this.texture="blank",this.textureSrc="blank",this.pageNumber=void 0,this.contentLayer=_("<div>",{class:"df-page-content"})}return k(e,[{key:"reset",value:function(){this.resetTexture(),this.resetContent()}},{key:"resetTexture",value:function(){this.textureLoaded=!1,this.textureStamp="-1",this.loadTexture({texture:this.textureLoadFallback}),this.contentLayer.removeClass("df-content-loaded")}},{key:"clearTexture",value:function(){this.loadTexture({texture:this.textureLoadFallback})}},{key:"resetContent",value:function(){}},{key:"loadTexture",value:function(e){}},{key:"getTexture",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.textureSrc;return!0===e&&t&&t.cloneNode&&(t=t.cloneNode()).getContext&&t.getContext("2d").drawImage(this.textureSrc,0,0),t}},{key:"setLoading",value:function(){}},{key:"updateTextureLoadStatus",value:function(e){this.textureLoaded=!0===e,L.log((!0===this.textureLoaded?"Loaded ":"Loading ")+this.textureStamp+" for "+this.pageNumber),this.contentLayer.toggleClass("df-content-loaded",!0===e),this.setLoading()}},{key:"changeTexture",value:function(e,t){var i=e+"|"+t;return this.textureStamp!==i&&(L.log("Page "+e+" : texture changed from - "+this.textureStamp+" to "+i),this.textureLoaded=!1,this.textureStamp=i,this.updateTextureLoadStatus(!1),!0)}}]),e}());function A(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e,t,i){return(I="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=M(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function M(e){return(M=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function D(e,t){return(D=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var z=p.utils,F=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&D(e,t)}(o,e);var t,i,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=M(o);return e=t?Reflect.construct(i,arguments,M(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:A(this)});function o(e,t){var i;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,o),e.viewerClass="df-reader",t.options.mouseScrollAction=p.MOUSE_SCROLL_ACTIONS.NONE,(i=n.call(this,e,t)).app.jumpStep=1,i.minZoom=.25,i.stackCount=i.app.pageCount,i.app.options.paddingLeft=0,i.app.options.paddingRight=0,i.app.options.paddingTop=10,i.app.options.paddingBottom=!0===i.app.options.controlsFloating?20:10,i.app.pageScaling=i.app.options.pageScale,i.acceptAppMouseEvents=!0,i.scrollStatus=p.REQUEST_STATUS.OFF,i.deltaPanX=0,i.deltaPanY=0,t._viewerPrepared(),i.zoomViewer=A(i),i}return i=[{key:"init",value:function(){I(M(o.prototype),"init",this).call(this),this.initEvents(),this.initPages(),this.initScrollBar()}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],I(M(o.prototype),"initEvents",this).call(this)}},{key:"initPages",value:function(){this.stackCount=this.app.pageCount;for(var e=0;e<this.stackCount;e++){var t=new N({parentElement:this.wrapper});t.index=e,t.viewer=this,this.pages.push(t)}}},{key:"initScrollBar",value:function(){this.scrollBar=jQuery("<div class='df-reader-scrollbar'>"),this.scrollBar.appendTo(this.app.container),this.scrollPageNumber=jQuery("<div class='df-reader-scroll-page-number'>").appendTo(this.app.container)}},{key:"afterControlUpdate",value:function(){void 0!==this.scrollBar&&(this.scrollBar[0].innerHTML=this.app.getCurrentLabel(),this.app.provider.pageLabels?this.scrollPageNumber[0].innerHTML=this.app.getCurrentLabel()+"<div>("+this.app.currentPageNumber+" of "+this.app.pageCount+")</div>":this.scrollPageNumber[0].innerHTML=this.app.getCurrentLabel()+"<div>of "+this.app.pageCount+"</div>")}},{key:"updateBuffer",value:function(e){if("-1"!==e.textureStamp&&void 0!==e.pageNumber){for(var t=e.pageNumber,i=e.pageNumber,n=0,o=0;o<this.pageBuffer.length;o++){var s=this.pageBuffer[o].pageNumber;if(t===s){z.log("Page "+t+" already in buffer, skipping");return}Math.abs(this.app.currentPageNumber-s)>Math.abs(this.app.currentPageNumber-i)&&(i=s,n=o)}this.pageBuffer.push(e),this.pageBuffer.length>this.pageBufferSize&&(z.log("Farthest buffer: "+i),this.pageBuffer[n].reset(),this.pageBuffer.splice(n,1))}}},{key:"initCustomControls",value:function(){var e=this.app.ui.controls;e.openRight.hide(),e.openLeft.hide()}},{key:"dispose",value:function(){I(M(o.prototype),"dispose",this).call(this),this.scrollBar&&this.scrollBar.remove(),this.scrollPageNumber&&this.scrollPageNumber.remove(),this.element.remove()}},{key:"_getInnerHeight",value:function(){I(M(o.prototype),"_getInnerHeight",this).call(this);var e=this.app.dimensions.maxHeight-this.app.dimensions.padding.height,t=this.app.dimensions.defaultPage.viewPort,i=this.app.dimensions.containerWidth-20-this.app.dimensions.padding.width;this.app.pageScaling===p.PAGE_SCALE.ACTUAL&&(i=1*this.app.provider.defaultPage.viewPort.width);var n=e;return this.app.pageScaling===p.PAGE_SCALE.PAGE_WIDTH?n=100*t.height:this.app.pageScaling===p.PAGE_SCALE.AUTO?n=1.5*t.height:this.app.pageScaling===p.PAGE_SCALE.ACTUAL&&(n=1*t.height),n-=2,this._containCover=z.contain(t.width,t.height,i,n),n=Math.min(e,this._containCover.height+2),this.app.pageScaleValue=this._containCover.height/t.height,this.app.dimensions.isFixedHeight?e:n}},{key:"handleZoom",value:function(){var e=this.app,t=this.maxZoom=4,i=e.zoomValue;!0===e.pendingZoom&&null!=e.zoomDelta?i=e.zoomDelta>0?i*e.options.zoomRatio:i/e.options.zoomRatio:null!=this.lastScale&&(i*=this.lastScale,this.lastScale=null),i=z.limitAt(i,this.minZoom,t),e.zoomValueChange=i/e.zoomValue,e.zoomChanged=e.zoomValue!==i,e.zoomValue=i}},{key:"resize",value:function(){var e=this.app;e.dimensions;var t=e.dimensions.padding,i=this.shiftHeight=0;this.element.css({top:-i,bottom:-i,right:-0,left:-0,paddingTop:t.top,paddingRight:t.right,paddingBottom:t.bottom,paddingLeft:t.left});for(var n=this.getVisiblePages().main[0]-1,o=(n=this.pages[n].element[0]).getBoundingClientRect(),s=this.parentElement[0].getBoundingClientRect(),a=0;a<this.pages.length;a++){var r=this.pages[a],l=this.getViewPort(a+1,!0),h=r.element[0].style;h.height=Math.floor(l.height*e.pageScaleValue*e.zoomValue)+"px",h.width=Math.floor(l.width*e.pageScaleValue*e.zoomValue)+"px"}if(this.oldScrollHeight!=this.element[0].scrollHeight&&void 0!==this.oldScrollHeight){var u,p=this.element[0].scrollHeight/this.oldScrollHeight;this.skipScrollCheck=!0;var c=n.offsetTop+n.clientTop-(o.top-s.top+n.clientTop)*p,d=n.offsetLeft+n.clientLeft-(o.left-s.left+n.clientLeft)*p;c+=(p-1)*10/2,d+=(p-1)*10/2,this.zoomCenter=null!==(u=this.zoomCenter)&&void 0!==u?u:{x:0,y:0},c+=(p-1)*this.zoomCenter.y,d+=(p-1)*this.zoomCenter.x,this.zoomCenter=null,this.element[0].scrollTop=c,this.element[0].scrollLeft=d,this.skipScrollCheck=!1}this.oldScrollHeight=this.element[0].scrollHeight,this.scrollBar[0].style.transform="none",this.updateScrollBar()}},{key:"onReady",value:function(){this.gotoPageCallBack(),this.oldScrollHeight=this.element[0].scrollHeight}},{key:"refresh",value:function(){for(var e=this.app,t=this.getVisiblePages().main,i=0;i<t.length;i++){var n=void 0,o=t[i];n=this.pages[o-1],o!==n.pageNumber&&(n.resetTexture(),this.app.textureRequestStatus=p.REQUEST_STATUS.ON),n.element.attr("number",o),n.pageNumber=o}this.requestRefresh(!1),e.textureRequestStatus=p.REQUEST_STATUS.ON}},{key:"isAnimating",value:function(){return this.scrollStatus===p.REQUEST_STATUS.ON||this.scrollStatus===p.REQUEST_STATUS.COUNT}},{key:"checkRequestQueue",value:function(){I(M(o.prototype),"checkRequestQueue",this).call(this),this.scrollStatus===p.REQUEST_STATUS.ON&&(this.scrollStatus=p.REQUEST_STATUS.OFF),this.scrollStatus===p.REQUEST_STATUS.COUNT&&(this.scrollStatus=p.REQUEST_STATUS.ON)}},{key:"isActivePage",value:function(e){return void 0!==this.visiblePagesCache&&this.visiblePagesCache.includes(e)}},{key:"getVisiblePages",value:function(){var e=z.getVisibleElements({container:this.element[0],elements:this.wrapper[0].children});return e=0===e.length?[this.app.currentPageNumber]:e.splice(0,this.pageBufferSize),this.visiblePagesCache=e,{main:e,buffer:[]}}},{key:"getPageByNumber",value:function(e){var t=this.pages[e-1];return void 0===t&&z.log("Page Not found for: "+e),t}},{key:"onScroll",value:function(e){for(var t=this.element[0].scrollTop+this.app.dimensions.containerHeight/2,i=this.getVisiblePages().main,n=i[0],o=0;o<i.length;o++){n=i[o];var s=this.pages[n-1].element[0],a=s.offsetTop+s.clientTop;if(a<=t&&s.clientHeight+a>=t)break;if(o>0&&a>t&&s.clientHeight+a>=t){n=i[o-1];break}}this.skipScrollIntoView=!0,this.app.gotoPage(n),this.skipScrollIntoView=!1,this.updateScrollBar(),e.preventDefault&&e.preventDefault(),e.stopPropagation(),this.requestRefresh(),this.scrollStatus=p.REQUEST_STATUS.COUNT,p.handlePopup(this.element,!1)}},{key:"updateScrollBar",value:function(){var e=this.element[0];this.app.container[0],e.scrollLeft;var t=60+(e.offsetHeight-40-60-60)*e.scrollTop/(e.scrollHeight-e.offsetHeight);isNaN(t)&&(t=60),this.scrollBar.lastY=t,this.scrollBar[0].style.transform="translateY("+t+"px)"}},{key:"validatePageChange",value:function(e){}},{key:"gotoPageCallBack",value:function(){if(!0!==this.skipScrollIntoView){var e=this.getPageByNumber(this.app.currentPageNumber);null!=e&&z.scrollIntoView(e.element[0],this.element[0])}this.skipScrollIntoView=!1,this.requestRefresh()}},{key:"getTextureSize",value:function(e){var t=this.app.provider.viewPorts[1];this.app.provider.viewPorts[e.pageNumber]&&(t=this.app.provider.viewPorts[e.pageNumber]);var i=this.app.options.pixelRatio;return{height:t.height*this.app.zoomValue*this.app.pageScaleValue*i,width:t.width*this.app.zoomValue*this.app.pageScaleValue*i}}},{key:"textureLoadedCallback",value:function(e){var t=this.getPageByNumber(e.pageNumber),i=this.app,n=this.getViewPort(e.pageNumber,!0);t.element.height(Math.floor(n.height*i.pageScaleValue*i.zoomValue)).width(Math.floor(n.width*i.pageScaleValue*i.zoomValue))}},{key:"pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.startPoint,n=e.raw.y-i.raw.y,o=e.raw.x-i.raw.x;this.deltaPanY+=n,this.deltaPanX+=o,this.panRequestStatus=p.REQUEST_STATUS.ON,!1===t&&(this.startPoint=e)}},{key:"updatePan",value:function(){this.element[0].scrollTop=this.element[0].scrollTop-this.deltaPanY,this.element[0].scrollLeft=this.element[0].scrollLeft-this.deltaPanX,this.deltaPanY=0,this.deltaPanX=0}},{key:"mouseMove",value:function(e){if(this.startPoint&&this.isScrollBarPressed){var t=z.fixMouseEvent(e),i=this.eventToPoint(t),n=this.element[0],s=this.scrollBar.lastY-(this.startPoint.raw.y-i.raw.y);this.scrollBar.lastY=s,n.scrollTop=(s-60)*(n.scrollHeight-n.offsetHeight)/(n.offsetHeight-40-60-60),this.startPoint=i,e.preventDefault();return}e.touches&&e.touches.length<2||I(M(o.prototype),"mouseMove",this).call(this,e)}},{key:"mouseDown",value:function(e){I(M(o.prototype),"mouseDown",this).call(this,e),e.srcElement===this.scrollBar[0]&&(this.isScrollBarPressed=!0,this.scrollBar.addClass("df-active"),this.scrollPageNumber.addClass("df-active"))}},{key:"mouseUp",value:function(e){I(M(o.prototype),"mouseUp",this).call(this,e),(this.isScrollBarPressed=this.scrollBar)&&(this.isScrollBarPressed=!1,this.scrollBar.removeClass("df-active"),this.scrollPageNumber.removeClass("df-active"))}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(o.prototype,i),o}(x);function B(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function H(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function U(e,t,i){return t&&H(e.prototype,t),i&&H(e,i),e}function V(e,t,i){return(V="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=j(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function j(e){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function W(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function G(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=j(e);return i=t?Reflect.construct(n,arguments,j(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}}var Z=p.jQuery,K=p.utils,X=/*#__PURE__*/function(e){W(i,e);var t=G(i);function i(e,n){var o,s;return B(this,i),e.viewerClass="df-flipbook "+(e.viewerClass||""),(o=t.call(this,e,n)).isFlipBook=!0,o.sheets=[],o.isRTL=o.app.isRTL,o.foldSense=o.isVertical()?0:50,o.isOneSided=!1,o.stackCount=null!==(s=e.stackCount)&&void 0!==s?s:6,o.annotedPage=null,o.pendingAnnotations=[],o.seamPositionX=0,o.seamPositionY=0,o.dragSheet=null,o.drag=null,o.soundOn=!0===e.enableSound,o.soundFile=null,o.minZoom=1,o.maxZoom=4,o.pureMaxZoom=4,(o.app.options.pageSize===p.FLIPBOOK_PAGE_SIZE.AUTO||o.app.options.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL)&&(o.app.checkSecondPage=!0),o.app.pageScaling=p.PAGE_SCALE.PAGE_FIT,e.viewerClass="",o.zoomViewer=new Y(e,n),o}return U(i,[{key:"init",value:function(){V(j(i.prototype),"init",this).call(this),this.initSound();var e=this.app;this.pageMode=e.options.pageMode===p.FLIPBOOK_PAGE_MODE.AUTO?K.isMobile||e.pageCount<=2?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE:e.options.pageMode,this.singlePageMode=e.options.singlePageMode||(K.isMobile?p.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET:p.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM),this.updatePageMode(),this.rightSheetHeight=this.leftSheetHeight=this._defaultPageSize.height,this.leftSheetWidth=this.rightSheetWidth=this._defaultPageSize.width,this.leftSheetTop=this.rightSheetTop=(this.availablePageHeight()-this._defaultPageSize.height)/2,this.topSheetLeft=this.bottomSheetLeft=(this.availablePageWidth()-this._defaultPageSize.width)/2,this.zoomViewer.rightSheetHeight=this.zoomViewer.leftSheetHeight=this._defaultPageSize.height,this.zoomViewer.leftSheetWidth=this.zoomViewer.rightSheetWidth=this._defaultPageSize.width}},{key:"determineHeight",value:function(){}},{key:"initCustomControls",value:function(){V(j(i.prototype),"initCustomControls",this).call(this);var e=this,t=this.app,n=t.ui,o=n.controls,s=t.options.text,a=t.options.icons;o.sound=K.createBtn("sound",a.sound,s.toggleSound).on("click",function(){e.soundOn=!e.soundOn,n.updateSound()}),n.updateSound=function(){!1===e.soundOn?o.sound.addClass("disabled"):o.sound.removeClass("disabled")},n.updateSound()}},{key:"dispose",value:function(){V(j(i.prototype),"dispose",this).call(this);for(var e=0;e<this.sheets.length;e++){var t=this.sheets[e];t&&t.currentTween&&(t.currentTween.stop(),t.currentTween=null)}this.zoomViewer.dispose(),this.soundFile=null}},{key:"determinePageMode",value:function(){var e=this.app,t=this.pageMode;if(this.app.pageCount<3)this.pageMode=p.FLIPBOOK_PAGE_MODE.SINGLE;else if(this.app.options.pageMode===p.FLIPBOOK_PAGE_MODE.AUTO&&!0!=this.pageModeChangedManually){if(!0===K.isMobile){if(this.app.dimensions.isAutoHeight&&!1==this.app.dimensions.isFixedHeight){var i=this._calculateInnerHeight(!0),n=this._calculateInnerHeight(!1),o=e.dimensions.stage.innerWidth+(!0!=e.options.sideMenuOverlay&&e.isSideMenuOpen?220:0);this.pageMode=i>1.1*n&&o<768?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE,this._calculateInnerHeight()}else{var s=e.dimensions.stage.innerWidth+(!0!=e.options.sideMenuOverlay&&e.isSideMenuOpen?220:0);this.pageMode=e.dimensions.stage.innerHeight>1.1*s&&s<768?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE}}this.pageMode!=t&&this.setPageMode({isSingle:this.pageMode==p.FLIPBOOK_PAGE_MODE.SINGLE})}}},{key:"initSound",value:function(){this.soundFile=document.createElement("audio"),this.soundFile.setAttribute("src",this.app.options.soundFile+"?ver="+p.version),this.soundFile.setAttribute("type","audio/mpeg")}},{key:"playSound",value:function(){try{!0===this.app.userHasInteracted&&!0===this.soundOn&&(this.soundFile.currentTime=0,this.soundFile.play())}catch(e){}}},{key:"checkDocumentPageSizes",value:function(){var e=this.app.provider;e.pageSize===p.FLIPBOOK_PAGE_SIZE.AUTO&&(e._page2Ratio&&e._page2Ratio>1.5*e.defaultPage.pageRatio?e.pageSize=p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL:e.pageSize=p.FLIPBOOK_PAGE_SIZE.SINGLE),e.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL&&(e.pageCount=1===e.numPages?1:2*e.numPages-2),(e.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK||e.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE)&&(e.pageCount=2*e.numPages)}},{key:"getViewerPageNumber",value:function(e){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL&&e>2&&(e=2*e-1),this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK&&e>2&&(e=2*e-1),e}},{key:"getDocumentPageNumber",value:function(e){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL&&e>2?Math.ceil((e-1)/2)+1:this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK&&e>1?e===this.app.pageCount?1:Math.ceil((e-1)/2)+1:e}},{key:"getViewPort",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;return this.filterViewPort(V(j(i.prototype),"getViewPort",this).call(this,e,t),e,n)}},{key:"isDoubleInternal",value:function(){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL}},{key:"isDoubleCoverBack",value:function(){return this.app.provider.pageSize===p.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK}},{key:"isDoubleInternalPage",value:function(e){return this.isDoubleInternal()&&e>1&&e<this.app.provider.pageCount}},{key:"getDoublePageWidthFix",value:function(e){return this.isDoubleInternalPage(e)||this.isDoubleCoverBack()?2:1}},{key:"isDoublePageFix",value:function(e){var t=!1;return(this.isDoubleCoverBack()||this.isDoubleInternalPage(e))&&(this.app.isRTL?e%2==0&&(t=!0):e%2==1&&(t=!0)),t}},{key:"finalizeAnnotations",value:function(e,t){}},{key:"finalizeTextContent",value:function(e,t){this.app.zoomValue>this.app.viewer.pureMaxZoom&&(this.zoomViewer.leftViewPort&&this.zoomViewer.leftPage.contentLayer[0].style.setProperty("--scale-factor",this.zoomViewer.leftSheetHeight/this.zoomViewer.leftViewPort.height),this.zoomViewer.rightViewPort&&this.zoomViewer.rightPage.contentLayer[0].style.setProperty("--scale-factor",this.zoomViewer.rightSheetHeight/this.zoomViewer.rightViewPort.height))}},{key:"isActivePage",value:function(e){return void 0!==this.visiblePagesCache&&this.visiblePagesCache.includes(e)}},{key:"isSheetCover",value:function(e){var t=this.isBooklet;return 0===e||t&&1===e||e===Math.ceil(this.app.pageCount/(t?1:2))-(t?0:1)}},{key:"isSheetHard",value:function(e){var t=this.app.options.flipbookHardPages;if(this.isBooklet,"cover"===t)return this.isSheetCover(e);if("all"===t)return!0;var i=(","+t+",").indexOf(","+(2*e+1)+",")>-1,n=(","+t+",").indexOf(","+(2*e+2)+",")>-1;return i||n}},{key:"sheetsIndexShift",value:function(e,t,i){e>t?(this.sheets[i-1].skipFlip=!0,this.sheets.unshift(this.sheets.pop())):e<t&&(this.sheets[0].skipFlip=!0,this.sheets.push(this.sheets.shift()))}},{key:"checkSwipe",value:function(e,t){if(!0!==this.pinchZoomDirty&&1===this.app.zoomValue&&!0===this.canSwipe){var i=this.isVertical()?e.y-this.lastPosY:e.x-this.lastPosX;null!=t.touches&&this.isVertical()&&i>5&&t.preventDefault(),Math.abs(i)>this.swipeThreshold&&(i<0?this.app.openRight():this.app.openLeft(),this.canSwipe=!1,t.preventDefault()),this.lastPosX=e.x,this.lastPosY=e.y}}},{key:"checkCenter",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.app,n=p.FLIPBOOK_CENTER_SHIFT,o=i.currentPageNumber%2==0,s=this.getBasePage(),a=this.isRTL,r=this.isSingle;e=0===s||this.isBooklet?this.isRTL?n.RIGHT:n.LEFT:s===i.pageCount?a?n.LEFT:n.RIGHT:r?a?o?n.LEFT:n.RIGHT:o?n.RIGHT:n.LEFT:n.NONE,!0!==this.centerNeedsUpdate&&(this.centerNeedsUpdate=this.centerShift!==e),this.centerNeedsUpdate&&(this.centerShift=e,this.updateCenter(t),this.centerNeedsUpdate=!1)}},{key:"updateCenter",value:function(){console.log("UpdateCenter: missing implementation.")}},{key:"reset",value:function(){for(var e,t=0;t<this.sheets.length;t++)(e=this.sheets[t]).reset(),e.pageNumber=-1,e.frontPage&&(e.frontPage.pageNumber=-1),e.backPage&&(e.backPage.pageNumber=-1),e.resetTexture();this.annotedPage=null,this.oldBasePageNumber=-1,this.centerShift=null,this.refresh()}},{key:"handleZoom",value:function(){var e=this.app;e.dimensions;var t=this.getLeftPageTextureSize({zoom:!1,isAnnotation:!0}),i=this.getRightPageTextureSize({zoom:!1,isAnnotation:!0});this.maxZoom,e.zoomValue,this.pureMaxZoom=e.dimensions.maxTextureSize/Math.max(t.height,t.width,i.height,i.width);var n=this.maxZoom=e.options.fakeZoom*this.pureMaxZoom,o=e.zoomValue,s=!1,a=!1;n<this.minZoom&&(n=this.maxZoom=this.minZoom),!0===e.pendingZoom&&null!=e.zoomDelta?o=e.zoomDelta>0?o*e.options.zoomRatio:o/e.options.zoomRatio:null!=this.lastScale&&(o*=this.lastScale,this.lastScale=null),o=K.limitAt(o,this.minZoom,n),e.zoomValueChange=o/e.zoomValue,(e.zoomChanged=e.zoomValue!==o)&&(1===o||1===e.zoomValue)&&(s=1===o,a=1===e.zoomValue),e.zoomValue=o,(a||s)&&(e.container.toggleClass("df-zoom-active",1!==o),a&&this.enterZoom(),s&&this.exitZoom())}},{key:"refresh",value:function(){var e=this.app,t=this.stackCount,i=this.isRTL,n=this.isBooklet,o=this.getBasePage(),s=n?1:2;i&&(o=e.pageCount-o);var a,r=this.oldBasePageNumber,l=Math.ceil(e.pageCount/s),h=Math.floor(t/2);o!==this.oldBasePageNumber&&(this.pageNumberChanged=!0,this.updatePendingStatusClass(!0),this.zoomViewer.reset()),this.sheetsIndexShift(r,o,t);var u=Math.ceil(o/s);for(a=0;a<t;a++){var c=void 0,d=u-h+a;if(i&&(d=l-d-1),null!=(c=this.sheets[a])){c.targetSide=a<h?p.TURN_DIRECTION.LEFT:p.TURN_DIRECTION.RIGHT;var f=c.side!==c.targetSide,g=d!==c.pageNumber,v=f&&!1===c.skipFlip&&1===e.zoomValue;!f&&g&&c.isFlipping&&c.currentTween&&c.currentTween.stop(),c.isHard=this.isSheetHard(d),c.isCover=this.isSheetCover(d),g&&(c.resetTexture(),(this.app.isRTL?c.backPage:c.frontPage).pageNumber=this.isBooklet?d:2*d+1,(this.app.isRTL?c.frontPage:c.backPage).pageNumber=this.isBooklet?-1:2*d+2,e.textureRequestStatus=p.REQUEST_STATUS.ON),c.pageNumber=d,this.refreshSheet({sheet:c,sheetNumber:d,totalSheets:l,zIndex:this.stackCount+(a<h?a-h:h-a),visible:n?i?a<h||c.isFlipping||v:a>=h||c.isFlipping||v:d>=0&&d<l||n&&d===l,index:a,needsFlip:v,midPoint:h})}}this.requestRefresh(!1),e.textureRequestStatus=p.REQUEST_STATUS.ON,this.oldBasePageNumber=o,this.checkCenter(),this.zoomViewer.refresh(),this.pageNumberChanged=!1}},{key:"validatePageChange",value:function(e){if(e===this.app.currentPageNumber)return!1;var t=this.app,i=!this.isFlipping()||void 0===t.oldPageNumber;return(i=i||t.currentPageNumber<e&&t.oldPageNumber<t.currentPageNumber)||t.currentPageNumber>e&&t.oldPageNumber>t.currentPageNumber}},{key:"getVisiblePages",value:function(){for(var e=[],t=this.getBasePage(),i=this.app.zoomValue>1?1:this.isBooklet&&K.isMobile?Math.min(this.stackCount/2,2):this.stackCount/2,n=0;n<i;n++)e.push(t-n),e.push(t+n+1);return this.visiblePagesCache=e,{main:e,buffer:[]}}},{key:"getBasePage",value:function(e){return(void 0===e&&(e=this.app.currentPageNumber),this.isBooklet)?e:2*Math.floor(e/2)}},{key:"getRightPageNumber",value:function(){return this.getBasePage()+(this.isBooklet?0:this.isRTL?0:1)}},{key:"getLeftPageNumber",value:function(){return this.getBasePage()+(this.isBooklet?0:this.isRTL?1:0)}},{key:"afterFlip",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],!0!==this.isAnimating()&&(this.pagesReady(),this.updatePendingStatusClass())}},{key:"isFlipping",value:function(){var e=!1;return this.sheets.forEach(function(t){!0===t.isFlipping&&(e=!0)}),e}},{key:"isAnimating",value:function(){return this.isFlipping()}},{key:"mouseWheel",value:function(e){this.app.options.mouseScrollAction===p.MOUSE_SCROLL_ACTIONS.ZOOM?this.zoomViewer.mouseWheel(e):V(j(i.prototype),"mouseWheel",this).call(this,e)}},{key:"checkRequestQueue",value:function(){this.app.zoomValue>1?this.zoomViewer.checkRequestQueue():V(j(i.prototype),"checkRequestQueue",this).call(this)}},{key:"updatePan",value:function(){}},{key:"resetPageTween",value:function(){}},{key:"gotoPageCallBack",value:function(){this.resetPageTween(),1!==this.app.zoomValue&&!0===this.app.options.resetZoomBeforeFlip&&this.app.resetZoom(),this.beforeFlip(),this.requestRefresh()}},{key:"beforeFlip",value:function(){this.app.executeCallback("beforeFlip"),1===this.app.zoomValue&&this.getBasePage()!==this.oldBasePageNumber&&this.playSound()}},{key:"onFlip",value:function(){this.app.executeCallback("onFlip")}},{key:"getAnnotationElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=void 0;return(o=this.app.zoomValue>1||!0===n?this.zoomViewer.getAnnotationElement(e,t):V(j(i.prototype),"getAnnotationElement",this).call(this,e,t))&&(o.parentNode.classList.toggle("df-double-internal",this.isDoubleInternalPage(e)),o.parentNode.classList.toggle("df-double-internal-fix",this.isDoublePageFix(e))),o}},{key:"getTextElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return this.app.zoomValue>1||!0===n?this.zoomViewer.getTextElement(e,t):V(j(i.prototype),"getTextElement",this).call(this,e,t)}},{key:"enterZoom",value:function(){this.exchangeTexture(this,this.zoomViewer)}},{key:"exitZoom",value:function(){this.exchangeTexture(this.zoomViewer,this)}},{key:"exchangeTexture",value:function(e,t){var i=this.getBasePage(),n=e.getPageByNumber(i),o=t.getPageByNumber(i);if(o&&"-1"===o.textureStamp?(o.textureStamp=n.textureStamp,o.loadTexture({texture:n.getTexture(!0)}),K.log("Texture Exchanging at "+i)):K.log("Texture Exchanging Bypassed at "+i),!this.isBooklet){var s=e.getPageByNumber(i+1),a=t.getPageByNumber(i+1);a&&"-1"===a.textureStamp?(a.textureStamp=s.textureStamp,a.loadTexture({texture:s.getTexture(!0)}),K.log("Texture Exchanging at "+(i+1))):K.log("Texture Exchanging Bypassed at "+(i+1))}t.pagesReady()}},{key:"setPageMode",value:function(e){var t=this.app,i=!0===e.isSingle;this.pageMode=i?p.FLIPBOOK_PAGE_MODE.SINGLE:p.FLIPBOOK_PAGE_MODE.DOUBLE,this.updatePageMode(),t.resizeRequestStart(),t.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.DOUBLE&&t.ui.controls.pageMode?t.ui.controls.pageMode.removeClass(t.options.icons.doublepage).addClass(t.options.icons.singlepage).attr("title",t.options.text.singlePageMode).html("<span>"+t.options.text.singlePageMode+"</span>"):t.ui.controls.pageMode.addClass(t.options.icons.doublepage).removeClass(t.options.icons.singlepage).attr("title",t.options.text.doublePageMode).html("<span>"+t.options.text.doublePageMode+"</span>")}},{key:"updatePageMode",value:function(){this.app.pageCount<3&&(this.pageMode=p.FLIPBOOK_PAGE_MODE.SINGLE),this.isSingle=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE,this.isBooklet=this.isSingle&&this.singlePageMode===p.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET,this.app.jumpStep=this.isSingle?1:2,this.totalSheets=Math.ceil(this.app.pageCount/(this.isBooklet?1:2)),this.sheets.length>0&&this.reset()}},{key:"setPage",value:function(e){return e.textureTarget===p.TEXTURE_TARGET.ZOOM?this.zoomViewer.setPage(e):V(j(i.prototype),"setPage",this).call(this,e)}},{key:"_calculateInnerHeight",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;void 0===e&&(e=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE);var t=this.app.dimensions.defaultPage.viewPort,i=this.availablePageWidth(!1,!0,e),n=this.app.dimensions.maxHeight-this.app.dimensions.padding.height,o=this.isVertical()&&!1==e?n/2:n;this._defaultPageSize=K.contain(t.width,t.height,i,o),this._pageFitArea={width:i,height:n};var s=this.app.dimensions.isFixedHeight?n:this._pageFitArea.height;return this.app.dimensions.isAutoHeight&&!1==this.app.dimensions.isFixedHeight&&(s=Math.floor(this._defaultPageSize.height)),s}},{key:"_getInnerHeight",value:function(){var e=this._calculateInnerHeight();return this.app.dimensions.stage.width=this.app.dimensions.stage.innerWidth+this.app.dimensions.padding.width,this.app.dimensions.stage.height=e+this.app.dimensions.padding.height,e}},{key:"availablePageWidth",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0;void 0===i&&(i=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE);var n=!0===t?this.app.dimensions.offset.width:0,o=this.app.dimensions.stage.innerWidth+n;return Math.floor((o/=!0===i||this.isVertical()?1:2)*(e?this.app.zoomValue:1))}},{key:"availablePageHeight",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;void 0===t&&(t=this.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE);var i=this.app.dimensions.stage.innerHeight;return!1===t&&this.isVertical()&&(i/=2),Math.floor(i*(e?this.app.zoomValue:1))}},{key:"getTextureSize",value:function(e){var t=this.getViewPort(e.pageNumber,!0),i=this.app.options.pixelRatio,n=!1===e.isRestricted?99999:this.app.options.maxTextureSize,o=K.contain(t.width,t.height,Math.min(i*this.availablePageWidth(e.zoom),n),Math.min(i*this.availablePageHeight(e.zoom),n));return{height:o.height,width:o.width}}},{key:"getLeftPageTextureSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.pageNumber=this.getLeftPageNumber(),this.getTextureSize(e)}},{key:"getRightPageTextureSize",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return e.pageNumber=this.getRightPageNumber(),this.getTextureSize(e)}},{key:"filterViewPort",value:function(e,t){var i=!(arguments.length>2)||void 0===arguments[2]||arguments[2];if(void 0!==e){if(!0!=i)return e;var n=e.clone();return n.width=n.width/this.getDoublePageWidthFix(t),n}}},{key:"filterViewPortCanvas",value:function(e,t,i){this.isDoublePageFix(i)&&(e.transform[4]=e.transform[4]-Math.floor(Math.min(t.width,2*e.width-t.width))),e.widthFix=this.isDoubleInternalPage(i)?2:1}},{key:"isClosedPage",value:function(e){return void 0===e&&(e=this.app.currentPageNumber),1===e||e===this.app.jumpStep*Math.ceil(this.app.pageCount/this.app.jumpStep)&&!this.isBooklet}},{key:"isLeftPage",value:function(e){return(void 0===e&&(e=this.app.currentPageNumber),this.isBooklet)?this.isRTL:e%2==(this.isRTL?1:0)}},{key:"cleanPage",value:function(e){if(!this.isDoubleInternalPage(e))return V(j(i.prototype),"cleanPage",this).call(this,e);var t=e+(e%2==1?-1:1);return!1===this.app.provider.requestedPages[e]&&!1===this.app.provider.requestedPages[t]}},{key:"onReady",value:function(){V(j(i.prototype),"onReady",this).call(this)}},{key:"searchPage",value:function(e){return{include:!this.isDoublePageFix(e),label:this.app.provider.getLabelforPage(e)+(this.isDoubleInternalPage(e)?"-"+this.app.provider.getLabelforPage(e+1):"")}}},{key:"isVertical",value:function(){return!1}}]),i}(x),Q=/*#__PURE__*/function(e){W(i,e);var t=G(i);function i(e){var n;return B(this,i),(n=t.call(this)).zoomStamp="",n.pendingZoomScale=1,n}return U(i,[{key:"resetZoomTexture",value:function(){this.zoomElement&&this.zoomElement.html(""),this.zoomStamp=""}},{key:"resetTexture",value:function(){V(j(i.prototype),"resetTexture",this).call(this),this.resetZoomTexture()}}]),i}(N),Y=/*#__PURE__*/function(e){W(i,e);var t=G(i);function i(e,n){var o;return B(this,i),e.viewerClass="df-zoomview "+(e.viewerClass||""),(o=t.call(this,e,n)).viewer=o.app.viewer,o.events={},o.init(),o.initEvents(),o.left=0,o.top=0,o.zoomUpdateCount=0,o}return U(i,[{key:"init",value:function(){this.leftPage=new Q,this.rightPage=new Q,this.pages.push(this.leftPage),this.pages.push(this.rightPage),this.leftPage.element.addClass("df-page-back"),this.rightPage.element.addClass("df-page-front"),this.wrapper.append(this.leftPage.element),this.wrapper.append(this.rightPage.element),this.bookShadow=Z("<div>",{class:"df-book-shadow"}),this.wrapper.append(this.bookShadow),this.wrapper.addClass("df-sheet")}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],V(j(i.prototype),"initEvents",this).call(this)}},{key:"dispose",value:function(){this.element.remove()}},{key:"resize",value:function(){var e=this.app.dimensions,t=e.padding,i=this.app.viewer.availablePageHeight(),n=this.app.viewer.availablePageWidth(),o=this.fullWidth=n*(this.app.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE||this.app.viewer.isVertical()?1:2),s=this.fullHeight=i*(this.app.viewer.isVertical()&&this.app.viewer.pageMode!==p.FLIPBOOK_PAGE_MODE.SINGLE?2:1),a=e.stage.innerWidth,r=e.stage.innerHeight,l=this.shiftHeight=Math.ceil(K.limitAt((s-r)/2,0,s)),h=this.shiftWidth=Math.ceil(K.limitAt((o-a)/2,0,o));if(1===this.app.zoomValue&&(this.left=0,this.top=0),this.element.css({top:-l,bottom:-l,right:-h,left:-h,paddingTop:t.top,paddingRight:t.right,paddingBottom:t.bottom,paddingLeft:t.left,transform:"translate3d("+this.left+"px,"+this.top+"px,0)"}),this.wrapper.css({width:o,height:s,marginTop:e.height-s-t.height>0?(e.height-t.height-s)/2:0}),this.wrapper.height(s).width(o-o%2),!0===this.app.pendingZoom&&this.zoom(),this.app.viewer.annotedPage=null,this.pagesReady(),!0===this.app.options.progressiveZoom){if(this.app.zoomValue>this.app.viewer.pureMaxZoom){if(this.startZoomUpdateRequest(),this.leftPage.zoomElement&&""!=this.leftPage.zoomStamp){var u=this.leftPage.zoomIntersection,c=this.leftSheetHeight/this.leftPage.zoomParentHeight;this.leftPage.zoomElement.css({left:u.left*c,top:u.top*c,width:u.width*c,height:u.height*c}),console.log("Left:"+c+" : "+this.leftPage.zoomElement[0].style.cssText)}if(this.rightPage.zoomElement&&""!=this.rightPage.zoomStamp){var d=this.rightPage.zoomIntersection,f=this.rightSheetHeight/this.rightPage.zoomParentHeight;this.rightPage.zoomElement.css({left:d.left*f,top:d.top*f,width:d.width*f,height:d.height*f}),console.log("Right:"+f+" : "+this.rightPage.zoomElement[0].style.cssText)}}else this.leftPage.resetZoomTexture(),this.rightPage.resetZoomTexture()}}},{key:"zoom",value:function(){var e=this.app;if(e.zoomChanged){var t=e.dimensions.origin,i=e.zoomValueChange;if(1===e.zoomValue)this.left=0,this.top=0;else{this.left*=i,this.top*=i,e.viewer.zoomCenter||(e.viewer.zoomCenter={x:t.x,y:t.y});var n={raw:e.viewer.zoomCenter},o={raw:{}},s=(n.raw.x-t.x)*i,a=(n.raw.y-t.y)*i;o.raw.x=t.x+s,o.raw.y=t.y+a,this.startPoint=o,this.pan(n),this.startPoint=null,e.container.toggleClass("df-zoom-region-active",this.app.zoomValue>this.app.viewer.pureMaxZoom)}}e.viewer.zoomCenter=null}},{key:"reset",value:function(){this.leftPage.resetTexture(),this.rightPage.resetTexture()}},{key:"refresh",value:function(){var e=this.app,t=e.viewer,i=t.getBasePage(),n=t.isBooklet?!e.isRTL:e.isRTL,o=n?this.rightPage:this.leftPage,s=n?this.leftPage:this.rightPage;o.pageNumber=i,s.pageNumber=i+1,o.updateCSS({display:0===i?"none":"block"}),s.updateCSS({display:s.pageNumber>e.pageCount||t.isBooklet?"none":"block"})}},{key:"updateCenter",value:function(){var e=this.app.viewer.isVertical();if(null!==this&&null!==this.app.viewer){var t=1*this.app.viewer.centerShift*(this.app.viewer.isRTL,this.app.viewer.isLeftPage()?e?this.leftSheetHeight:this.leftSheetWidth:e?this.rightSheetHeight:this.rightSheetWidth)/2;e?this.wrapper[0].style.top=t+"px":this.wrapper[0].style.left=t+"px"}}},{key:"isDoubleInternalPage",value:function(e){return this.app.viewer.isDoubleInternalPage(e)}},{key:"pagesReady",value:function(){if(!this.app.viewer.isFlipping()&&(1!==this.app.zoomValue&&this.app.viewer.updatePendingStatusClass(!1),!1===this.app.options.flipbookFitPages)){var e=this.app.viewer.getBasePage(),t=this.leftViewPort=this.app.viewer.getViewPort(e+(this.app.viewer.isBooklet?0:this.app.viewer.isRTL?1:0)),i=this.rightViewPort=this.app.viewer.getViewPort(e+(this.app.viewer.isBooklet?0:this.app.viewer.isRTL?0:1));if(t){var n=K.contain(t.width,t.height,this.app.viewer.availablePageWidth(),this.app.viewer.availablePageHeight());this.leftSheetWidth=Math.floor(n.width),this.leftSheetHeight=Math.floor(n.height),this.leftSheetTop=(this.app.viewer.availablePageHeight()-this.leftSheetHeight)/2,this.topSheetLeft=(this.app.viewer.availablePageWidth()-this.leftSheetWidth)/2,this.app.zoomValue>this.app.viewer.pureMaxZoom&&this.leftPage.contentLayer[0].style.setProperty("--scale-factor",this.leftSheetHeight/t.height)}if(i){var o=K.contain(i.width,i.height,this.app.viewer.availablePageWidth(),this.app.viewer.availablePageHeight());this.rightSheetWidth=Math.floor(o.width),this.rightSheetHeight=Math.floor(o.height),this.rightSheetTop=(this.app.viewer.availablePageHeight()-this.rightSheetHeight)/2,this.bottomSheetLeft=(this.app.viewer.availablePageWidth()-this.rightSheetWidth)/2,this.app.zoomValue>this.app.viewer.pureMaxZoom&&this.rightPage.contentLayer[0].style.setProperty("--scale-factor",this.rightSheetHeight/i.height)}(void 0!=t||void 0!=i)&&(this.totalSheetsWidth=this.leftSheetWidth+this.rightSheetWidth,this.leftPage.element.height(Math.floor(this.leftSheetHeight)).width(Math.floor(this.leftSheetWidth)),this.rightPage.element.height(Math.floor(this.rightSheetHeight)).width(Math.floor(this.rightSheetWidth)),this.app.viewer.isVertical()?(this.leftPage.element.css({transform:"translateX("+Math.floor(this.topSheetLeft)+"px)"}),this.rightPage.element.css({transform:"translateX("+Math.floor(this.bottomSheetLeft)+"px)"})):(this.leftPage.element.css({transform:"translateY("+Math.floor(this.leftSheetTop)+"px)"}),this.rightPage.element.css({transform:"translateY("+Math.floor(this.rightSheetTop)+"px)"})))}}},{key:"textureLoadedCallback",value:function(e){this.getPageByNumber(e.pageNumber),this.pagesReady()}},{key:"mouseUp",value:function(e){V(j(i.prototype),"mouseUp",this).call(this,e),this.startZoomUpdateRequest()}},{key:"setPage",value:function(e){return this.app,this.app.viewer,V(j(i.prototype),"setPage",this).call(this,e)}},{key:"startZoomUpdateRequest",value:function(){this.zoomUpdateStatus=p.REQUEST_STATUS.COUNT}},{key:"checkRequestQueue",value:function(){V(j(i.prototype),"checkRequestQueue",this).call(this),!0===this.app.options.progressiveZoom&&(this.zoomUpdateStatus===p.REQUEST_STATUS.ON?(this.zoomUpdateStatus=p.REQUEST_STATUS.OFF,this.zoomUpdate()):this.zoomUpdateStatus===p.REQUEST_STATUS.COUNT&&(this.zoomUpdateCount++,this.zoomUpdateCount>3&&(this.zoomUpdateCount=0,this.zoomUpdateStatus=p.REQUEST_STATUS.ON)))}},{key:"zoomUpdate",value:function(){this.zoomUpdatePage({pageNumber:this.app.viewer.getRightPageNumber(),refHeight:this.rightSheetHeight}),this.zoomUpdatePage({pageNumber:this.app.viewer.getLeftPageNumber(),refHeight:this.leftSheetHeight})}},{key:"zoomUpdatePage",value:function(e){var t=this.app,i=this.app.options.pixelRatio,n=this.app.viewer,o="",s=this.getPageByNumber(e.pageNumber);if(void 0!==s){var a=K.elementIntersection(t.element,s.element,!0);if(t.zoomValue>n.pureMaxZoom&&a.width*a.height>0){if(!0===DEARFLIP.skipZoom)return;var r=s.pageNumber+"|"+JSON.stringify(a);if(s.zoomStamp==r){console.log("Rendered "+s.pageNumber+" Duplicate zoom request");return}s.zoomStamp=r;var l=t.viewer.getDocumentPageNumber(e.pageNumber),h=t.provider,u=e.pageNumber,p=performance.now();h.pdfDocument.getPage(l).then(function(n){s.element.offset(),e.isRestricted=!1;var c=t.viewer.getRenderContext(n,e);h.viewPorts[l],c.viewport=n.getViewport({scale:e.refHeight*i/h.viewPorts[l].height}),c.canvas.height=a.height*i,c.canvas.width=a.width*i,o=c.canvas.width+"x"+c.canvas.height+" - of("+c.viewport.width.toFixed(2)+"x"+c.viewport.height.toFixed(2)+")",console.log("Page "+u+" rendering - "+c.canvas.width+"x"+c.canvas.height),c.viewport.transform[4]-=a.left*i,c.viewport.transform[5]-=a.top*i,h.requestedPages+=","+e.trace+"["+l+"|"+c.canvas.height+"]",n.cleanupAfterRender=!1,n.render(c).promise.then(function(){var i=K.elementIntersection(t.element,s.element,!0);if(s.zoomStamp!==r){console.log("Faulty zoom texture detected");return}if(s.zoomStamp!==s.pageNumber+"|"+JSON.stringify(i)){console.log("Faulty zoom texture detected - instant");return}if(void 0===s.zoomElement&&(s.zoomElement=Z("<div class='zoom-element'></div>"),s.element.append(s.zoomElement)),s.zoomElement.html(""),s.zoomElement.append(c.canvas),s.zoomElement.css({left:a.left,top:a.top,width:a.width,height:a.height}),s.zoomIntersection=a,s.zoomParentHeight=s.element.height(),!0===t.options.cleanupAfterRender){var d=","+e.trace+"["+l+"|"+c.canvas.height+"]";h.requestedPages.indexOf(d)>-1&&(h.requestedPages=h.requestedPages.replace(d,""),-1==h.requestedPages.indexOf("["+l+"|")&&(h.pagesToClean.push(n),h.pagesToClean.length>0&&h.cleanUpPages()))}c=null,console.log("Rendered "+u+" in "+Math.floor(performance.now()-p)+" ms : "+o+" for "+r)}).catch(function(e){console.log(e)})}).catch(function(e){console.log(e)})}}}}]),i}(x),J=/*#__PURE__*/function(){function e(t){B(this,e),this.parentElement=t.parentElement,this.isFlipping=!1,this.isOneSided=!1,this.viewer=t.viewer,this.frontPage=null,this.backPage=null,this.pageNumber=void 0,this.animateToReset=null}return U(e,[{key:"init",value:function(){}},{key:"flip",value:function(){}},{key:"frontImage",value:function(e){this.frontPage.loadTexture({texture:e.texture,callback:e.callback})}},{key:"backImage",value:function(e){this.backPage.loadTexture({texture:e.texture,callback:e.callback})}},{key:"resetTexture",value:function(){this.frontPage.resetTexture(),this.backPage.resetTexture()}},{key:"reset",value:function(){this.animateToReset=null,this.isFlipping=!1,this.currentTween=null,this.pendingPoint=null,this.magnetic=!1,this.skipFlip=!0,this.animateToReset=null,this.viewer.dragPage=null,this.viewer.flipPage=null,this.viewer.corner=p.TURN_CORNER.NONE}}]),e}();function $(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ee(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function et(e,t,i){return t&&ee(e.prototype,t),i&&ee(e,i),e}function ei(e,t,i){return(ei="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=en(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function en(e){return(en=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eo(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&es(e,t)}function es(e,t){return(es=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ea(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=en(e);return i=t?Reflect.construct(n,arguments,en(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}}var er=p.jQuery,el=p.utils,eh=/*#__PURE__*/function(e){eo(i,e);var t=ea(i);function i(e){var n;return $(this,i),(n=t.call(this,e)).init(),n}return et(i,[{key:"init",value:function(){var e="<div>",t=this.element=er(e,{class:"df-sheet"}),i=this.frontPage=new N;i.element.addClass("df-page-front");var n=this.backPage=new N;n.element.addClass("df-page-back");var o=this.wrapper=er(e,{class:"df-sheet-wrapper"}),s=this.foldInnerShadow=er(e,{class:"df-sheet-fold-inner-shadow"}),a=this.foldOuterShadow=er(e,{class:"df-sheet-fold-outer-shadow"});this.parentElement.append(t),t.append(o),t.append(a),o.append(i.element),o.append(n.element),o.append(s)}},{key:"updateCSS",value:function(e){this.element.css(e)}},{key:"resetCSS",value:function(){this.wrapper.css({transform:""}),this.frontPage.resetCSS(),this.backPage.resetCSS()}},{key:"updateSize",value:function(e,t,i,n){e=Math.floor(e),t=Math.floor(t),i=Math.floor(i),n=Math.floor(n),this.wrapper[0].style.height=this.wrapper[0].style.width=Math.ceil(el.distOrigin(e,t)*this.viewer.app.zoomValue)+"px",this.element[0].style.height=this.frontPage.element[0].style.height=this.backPage.element[0].style.height=this.foldInnerShadow[0].style.height=t+"px",this.element[0].style.width=this.frontPage.element[0].style.width=this.backPage.element[0].style.width=this.foldInnerShadow[0].style.width=e+"px",this.viewer.isVertical()?this.element[0].style.transform="translateX("+n+"px)":this.element[0].style.transform="translateY("+i+"px)"}},{key:"flip",value:function(e){var t=this;if(e=e||t.pendingPoint,null!=t&&null!=t.viewer){t.isFlipping=!0,t.viewer.flipPage=t;var i,n,o=t.viewer.isBooklet,s=t.side===p.TURN_DIRECTION.RIGHT,a=t.viewer.isRTL,r=t.viewer.corner===p.TURN_CORNER.BL||t.viewer.corner===p.TURN_CORNER.BR?t.element.height():0,l=t.viewer.leftSheetWidth+t.viewer.rightSheetWidth,h=0;n=t.end=t&&!0===t.animateToReset?{x:s?l:0,y:r}:{x:s?0:l,y:r},t.flipEasing=t.isHard?TWEEN.Easing.Quadratic.InOut:TWEEN.Easing.Linear.None;var u=t.viewer.app.options.duration;!0===t.isHard?(null!=e&&(h=el.angleByDistance(e.distance,e.fullWidth)),i=t.init={angle:h*(s?-1:1)},n=t.end=t&&!0===t.animateToReset?{angle:s?0:-0}:{angle:s?-180:180}):null==e?i=t.init=t&&!0===t.animateToReset?{x:s?0:l,y:0}:{x:s?l:0,y:0}:(i=t.init={x:e.x,y:e.y,opacity:1},u=t.viewer.app.options.duration*el.distPoints(i.x,i.y,n.x,n.y)/t.viewer.fullWidth,u=el.limitAt(u,t.viewer.app.options.duration/3,t.viewer.duration)),i.index=0,n.index=1,t.isFlipping=!0,o&&(!s&&!a||s&&a)&&(t.element[0].style.opacity=0),!0===t.isHard?t.currentTween=new TWEEN.Tween(i).delay(0).to(n,t.viewer.app.options.duration).onUpdate(function(){t.updateTween(this)}).easing(t.flipEasing).onComplete(t.completeTween.bind(t)).start():null==e?t.currentTween=new TWEEN.Tween(i).delay(0).to(n,t.viewer.app.options.duration).onUpdate(function(){t.updateTween(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(t.completeTween.bind(t)).start():t.currentTween=new TWEEN.Tween(i).delay(0).to(n,u).onUpdate(function(){t.updateTween(this)}).easing(TWEEN.Easing.Sinusoidal.Out).onComplete(t.completeTween.bind(t)).start()}}},{key:"updatePoint",value:function(e){if(null!=e){var t=this.element.width(),i=this.element.height(),n=this.viewer.corner!==p.TURN_CORNER.NONE?this.viewer.corner:e.corner,o=p.TURN_CORNER,s=this.side===p.TURN_DIRECTION.RIGHT,a=n===o.BL||n===o.BR;e.rx=!0===s?this.viewer.leftSheetWidth+t-e.x:e.x,e.ry=!0===a?i-e.y:e.y;var r=Math.atan2(e.ry,e.rx);r=Math.PI/2-el.limitAt(r,0,el.toRad(90));var l=t-e.rx/2,h=e.ry/2,u=Math.max(0,Math.sin(r-Math.atan2(h,l))*el.distOrigin(l,h)),c=.5*el.distOrigin(e.rx,e.ry),d=Math.ceil(t-u*Math.sin(r)),f=Math.ceil(u*Math.cos(r)),g=el.toDeg(r),v=a?s?180+(90-g):180+g:s?g:90-g,m=a?s?180+(90-g):g:s?g+180:v,y=a?s?90-g:g+90:s?v-90:v+180,b=s?t-d:d,w=a?i+f:-f,P=s?-d:d-t,S=a?-i-f:f,E=el.limitAt(.5*e.distance/t,0,.5),x=el.limitAt((this.viewer.leftSheetWidth+t-e.rx)*.5/t,.05,.3);this.element.addClass("df-folding");var C=s?this.backPage.element:this.frontPage.element,T=s?this.frontPage.element:this.backPage.element,k=this.foldOuterShadow,O=this.foldInnerShadow;this.wrapper.css({transform:el.translateStr(b,w)+el.rotateStr(v)}),T.css({transform:el.rotateStr(-v)+el.translateStr(-b,-w)}),C.css({transform:el.rotateStr(m)+el.translateStr(P,S),boxShadow:"rgba(0, 0, 0, "+E+") 0px 0px 20px"}),O.css({transform:el.rotateStr(m)+el.translateStr(P,S),opacity:x/2,backgroundImage:el.prefix.css+"linear-gradient( "+y+"deg, rgba(0, 0, 0, 0.25) , rgb(0, 0, 0) "+.7*c+"px, rgb(255, 255, 255) "+c+"px)"}),k.css({opacity:x/2,left:s?"auto":0,right:s?0:"auto",backgroundImage:el.prefix.css+"linear-gradient( "+(-y+180)+"deg, rgba(0, 0, 0,0) "+c/3+"px, rgb(0, 0, 0) "+c+"px)"})}}},{key:"updateAngle",value:function(e,t){if(this.viewer.isVertical()){var i=5*this.element.height();this.wrapper.css({perspective:i,perspectiveOrigin:!0===t?"50% 0%":"50% 100%"}),this.element.addClass("df-folding"),this.backPage.updateCSS({display:!0===t?e<=-90?"block":"none":e<90?"block":"none",transform:("MfS"!==el.prefix.dom?"":"perspective("+i+"px) ")+(!0===t?"translateY(-100%) ":"")+"rotateX("+((!0===t?180:0)-e)+"deg)"}),this.frontPage.updateCSS({display:!0===t?e>-90?"block":"none":e>=90?"block":"none",transform:("MSd"!==el.prefix.dom?"":"perspective("+i+"px) ")+(!1===t?"translateY(100%) ":"")+"rotateX("+((!1===t?-180:0)-e)+"deg)"})}else{var n=5*this.element.width();this.wrapper.css({perspective:n,perspectiveOrigin:!0===t?"0% 50%":"100% 50%"}),this.element.addClass("df-folding"),this.backPage.updateCSS({display:!0===t?e<=-90?"block":"none":e<90?"block":"none",transform:("MfS"!==el.prefix.dom?"":"perspective("+n+"px) ")+(!0===t?"translateX(-100%) ":"")+"rotateY("+((!0===t?180:0)+e)+"deg)"}),this.frontPage.updateCSS({display:!0===t?e>-90?"block":"none":e>=90?"block":"none",transform:("MSd"!==el.prefix.dom?"":"perspective("+n+"px) ")+(!1===t?"translateX(100%) ":"")+"rotateY("+((!1===t?-180:0)+e)+"deg)"})}}},{key:"updateTween",value:function(e){var t=this.viewer.isBooklet,i=this.side===p.TURN_DIRECTION.RIGHT,n=this.viewer.isRTL,o=!0===this.animateToReset;!0===this.isHard?(this.updateAngle(e.angle,i),this.angle=e.angle):(this.updatePoint({x:e.x,y:e.y}),this.x=e.x,this.y=e.y),t&&!o&&(this.element[0].style.opacity=i&&!n||!i&&n?e.index>.5?2*(1-e.index):1:e.index<.5?2*e.index:1)}},{key:"completeTween",value:function(){!0===this.isHard?(this.updateAngle(this.end.angle),this.backPage.element.css({display:"block"}),this.frontPage.element.css({display:"block"})):this.updatePoint({x:this.end.x,y:this.end.y}),this.element[0].style.opacity=1,!0!==this.animateToReset&&(this.side=this.targetSide),this.reset(),this.viewer.onFlip(),this.viewer.afterFlip(),this.viewer.requestRefresh()}}]),i}(J),eu=/*#__PURE__*/function(e){eo(i,e);var t=ea(i);function i(e,n){var o,s;return $(this,i),e.viewerClass=null!==(s=e.viewerClass)&&void 0!==s?s:"df-flipbook-2d",e.skipViewerLoaded=!0,(o=t.call(this,e,n)).bookShadow=er("<div>",{class:"df-book-shadow"}),o.wrapper.append(o.bookShadow),o.corner=p.TURN_CORNER.NONE,n._viewerPrepared(),o}return et(i,[{key:"init",value:function(){ei(en(i.prototype),"init",this).call(this),this.initEvents(),this.initPages()}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],ei(en(i.prototype),"initEvents",this).call(this)}},{key:"dispose",value:function(){ei(en(i.prototype),"dispose",this).call(this),this.element.remove()}},{key:"initPages",value:function(){for(var e=0;e<this.stackCount;e++){var t=new eh({parentElement:this.wrapper});t.index=e,t.viewer=this,this.sheets.push(t),this.pages.push(t.frontPage),this.pages.push(t.backPage)}}},{key:"resize",value:function(){ei(en(i.prototype),"resize",this).call(this);var e=this.app.dimensions,t=e.padding,n=this.availablePageHeight(),o=this.availablePageWidth(),s=this.fullWidth=o*(this.app.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE||this.app.viewer.isVertical()?1:2),a=this.fullHeight=n*(this.app.viewer.isVertical()&&this.app.viewer.pageMode!==p.FLIPBOOK_PAGE_MODE.SINGLE?2:1),r=e.width,l=e.height,h=this.shiftHeight=Math.ceil(el.limitAt((a-l+t.height)/2,0,a)),u=this.shiftWidth=Math.ceil(el.limitAt((s-r+t.width)/2,0,s));1===this.app.zoomValue&&(this.left=0,this.top=0),this.element.css({top:-h,bottom:-h,right:-u,left:-u,paddingTop:t.top,paddingRight:t.right,paddingBottom:t.bottom,paddingLeft:t.left,transform:"translate3d("+this.left+"px,"+this.top+"px,0)"}),this.wrapper.css({marginTop:Math.max(e.height-a-t.height)/2,width:s-s%2,height:a}),this.zoomViewer.resize(),this.centerNeedsUpdate=!0,this.checkCenter(!0),this.pagesReady()}},{key:"updateCenter",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.isVertical(),i=this.centerShift,n=(this.isRTL,this.isLeftPage()?this.leftSheetHeight:this.rightSheetHeight),o=this.isLeftPage()?this.leftSheetWidth:this.rightSheetWidth,s=t?0:i*o/2,a=t?i*n/2:0;this.wrapperShiftX=s,this.wrapperShiftY=a,this.seamPositionY=(this.app.dimensions.padding.heightDiff+this.app.dimensions.containerHeight)/2+a,this.seamPositionX=(-this.app.dimensions.offset.width+this.app.dimensions.containerWidth)/2+s,t?this.wrapper[0].style.top=this.wrapperShiftY+"px":this.wrapper[0].style.left=this.wrapperShiftX+"px",this.wrapper[0].style.transition=e?"none":"",this.zoomViewer.updateCenter()}},{key:"refreshSheet",value:function(e){var t=e.sheet,i=e.sheetNumber;!1===t.isFlipping&&(e.needsFlip?(t.element.addClass("df-flipping"),t.flip()):(t.skipFlip=!1,t.element.removeClass("df-flipping df-quick-turn df-folding df-left-side df-right-side"),t.element.addClass(t.targetSide===p.TURN_DIRECTION.LEFT?"df-left-side":"df-right-side"),t.side=t.targetSide,t.targetSide===p.TURN_DIRECTION.LEFT?this.isVertical()?t.updateSize(this.leftSheetWidth,this.leftSheetHeight,0,this.topSheetLeft):t.updateSize(this.leftSheetWidth,this.leftSheetHeight,this.leftSheetTop,0):this.isVertical()?t.updateSize(this.rightSheetWidth,this.rightSheetHeight,0,this.bottomSheetLeft):t.updateSize(this.rightSheetWidth,this.rightSheetHeight,this.rightSheetTop,0))),t.visible=e.visible,t.isHard?t.element.addClass("df-hard-sheet"):(t.element.removeClass("df-hard-sheet"),t.frontPage.updateCSS({display:"block"}),t.backPage.updateCSS({display:"block"})),t.updateCSS({display:!0===t.visible?"block":"none",zIndex:e.zIndex}),null==t.pendingPoint&&!1===t.isFlipping&&t.resetCSS(),i!==t.pageNumber&&(t.element.attr("number",i),t.backPage.element.attr("pagenumber",t.backPage.pageNumber),t.frontPage.element.attr("pagenumber",t.frontPage.pageNumber))}},{key:"eventToPoint",value:function(e){var t=this.isVertical();e=el.fixMouseEvent(e);var i,n,o,s,a,r,l,h,u,c,d=this.wrapper[0].getBoundingClientRect(),f=this.is3D,g=this.sheets,v=(this.app.dimensions,{x:e.clientX,y:e.clientY}),m=this.parentElement[0].getBoundingClientRect();v.x=v.x-m.left,v.y=v.y-m.top,i=(c=this.dragSheet?this.dragSheet.side===p.TURN_DIRECTION.RIGHT:t?v.y>this.seamPositionY:v.x>this.seamPositionX)?this.rightSheetWidth:this.leftSheetWidth,s=c?this.rightSheetHeight:this.leftSheetHeight,n=t?i:this.rightSheetWidth+this.leftSheetWidth,o=t?this.leftSheetHeight+this.rightSheetHeight:s,r=c?this.rightSheetTop:this.leftSheetTop,a=t?v.x-(this.seamPositionX-(c?this.rightSheetWidth:this.leftSheetWidth)/2):v.x-(this.seamPositionX-this.leftSheetWidth),r=v.y-(d.top-m.top)-r,l=this.drag===p.TURN_DIRECTION.NONE?a<i?a:n-a:this.drag===p.TURN_DIRECTION.LEFT?a:n-a,h=c?g[this.stackCount/2]:g[this.stackCount/2-1],u=a<this.foldSense?p.TURN_DIRECTION.LEFT:a>n-this.foldSense?p.TURN_DIRECTION.RIGHT:p.TURN_DIRECTION.NONE;var y,b=r,w=this.foldSense;return y=a>=0&&a<w?b>=0&&b<=w?p.TURN_CORNER.TL:b>=o-w&&b<=o?p.TURN_CORNER.BL:b>w&&b<o-w?p.TURN_CORNER.L:p.TURN_CORNER.NONE:a>=n-w&&a<=n?b>=0&&b<=w?p.TURN_CORNER.TR:b>=o-w&&b<=o?p.TURN_CORNER.BR:b>w&&b<o-w?p.TURN_CORNER.R:p.TURN_CORNER.NONE:p.TURN_CORNER.NONE,{isInsideSheet:a>=0&&a<=n&&b>=0&&b<=o,isInsideCorner:y!==p.TURN_CORNER.NONE&&y!==p.TURN_CORNER.L&&y!==p.TURN_CORNER.R,x:f?v.x:a,y:f?v.y:r,fullWidth:n,sheetWidth:i,sheetHeight:s,rawDistance:n-a,distance:l,sheet:h,drag:u,foldSense:this.foldSense,event:e,raw:v,corner:y}}},{key:"pan",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];el.pan(this,e,t)}},{key:"mouseMove",value:function(e){var t=this.eventToPoint(e);if(null!=e.touches&&2==e.touches.length){this.pinchMove(e);return}1!==this.app.zoomValue&&null!=this.startPoint&&!0===this.canSwipe&&(this.pan(t),e.preventDefault());var i=this.dragSheet||t.sheet;if(null==this.flipPage&&(null!=this.dragSheet||!0===t.isInsideCorner)){null!=this.dragSheet||(t.y=el.limitAt(t.y,1,this.availablePageHeight()-1),t.x=el.limitAt(t.x,1,t.fullWidth-1));var n=null!=this.dragSheet?this.corner:t.corner;if(i.isHard){var o=n===p.TURN_CORNER.BR||n===p.TURN_CORNER.TR,s=el.angleByDistance(t.distance,t.fullWidth);i.updateAngle(s*(o?-1:1),o)}else i.updatePoint(t);i.magnetic=!0,i.magneticCorner=t.corner,e.preventDefault()}null==this.dragSheet&&null!=i&&!1===t.isInsideCorner&&!0===i.magnetic&&(i.pendingPoint=t,i.animateToReset=!0,i.magnetic=!1,this.corner=i.magneticCorner,i.flip(i.pendingPoint),i.pendingPoint=null),this.checkSwipe(t,e)}},{key:"mouseUp",value:function(e){if(e.touches||0===e.button){if(null==this.dragSheet&&null!=e.touches&&0==e.touches.length){this.pinchUp(e);return}var t=this.eventToPoint(e),i=e.target||e.originalTarget,n=1===this.app.zoomValue&&t.x===this.startPoint.x&&t.y===this.startPoint.y&&"A"!==i.nodeName;if(!0===e.ctrlKey&&n)this.zoomOnPoint(t);else if(this.dragSheet){e.preventDefault();var o=this.dragSheet;if(o.pendingPoint=t,this.drag=t.drag,n&&(!0===t.isInsideCorner||t.isInsideSheet&&this.clickAction===p.MOUSE_CLICK_ACTIONS.NAV))t.corner.indexOf("l")>-1?this.app.openLeft():this.app.openRight();else{var s=this.getBasePage();t.distance>t.sheetWidth/2&&(t.sheet.side===p.TURN_DIRECTION.LEFT?this.app.openLeft():this.app.openRight()),s===this.getBasePage()&&(o.animateToReset=!0,o.flip(t))}this.dragSheet=null,o.magnetic=!1}else n&&!t.sheet.isFlipping&&t.isInsideSheet&&this.clickAction===p.MOUSE_CLICK_ACTIONS.NAV&&("left"===t.sheet.side?this.app.openLeft():this.app.openRight());this.startPoint=null,this.canSwipe=!1,this.drag=p.TURN_DIRECTION.NONE}}},{key:"mouseDown",value:function(e){if(e.touches||0===e.button){if(null!=e.touches&&2==e.touches.length){this.pinchDown(e);return}var t=this.eventToPoint(e);this.startPoint=t,this.lastPosX=t.x,this.lastPosY=t.y,t.isInsideCorner&&null==this.flipPage?(this.dragSheet=t.sheet,this.drag=t.drag,this.corner=t.corner,0===t.sheet.pageNumber?this.bookShadow.css({width:"50%",left:this.app.isRTL?0:"50%",transitionDelay:""}):t.sheet.pageNumber===Math.ceil(this.app.pageCount/2)-1&&this.bookShadow.css({width:"50%",left:this.app.isRTL?"50%":0,transitionDelay:""})):this.canSwipe=!0}}},{key:"onScroll",value:function(e){}},{key:"resetPageTween",value:function(){for(var e=0;e<this.stackCount;e++){var t=this.sheets[e];t.currentTween&&t.currentTween.complete(!0)}this.requestRefresh()}},{key:"pagesReady",value:function(){if(!this.isFlipping()){if(!1===this.app.options.flipbookFitPages){var e=this.app.viewer.getBasePage(),t=this.leftViewport=this.getViewPort(e+(this.isBooklet?0:this.isRTL?1:0)),i=this.rightViewPort=this.getViewPort(e+(this.isBooklet?0:this.isRTL?0:1));if(t){var n=el.contain(t.width,t.height,this.availablePageWidth(),this.availablePageHeight());this.leftSheetWidth=Math.floor(n.width),this.leftSheetHeight=Math.floor(n.height),this.leftSheetTop=(this.availablePageHeight()-this.leftSheetHeight)/2,this.topSheetLeft=(this.app.viewer.availablePageWidth()-this.leftSheetWidth)/2}if(i){var o=el.contain(i.width,i.height,this.availablePageWidth(),this.availablePageHeight());this.rightSheetWidth=Math.floor(o.width),this.rightSheetHeight=Math.floor(o.height),this.rightSheetTop=(this.availablePageHeight()-this.rightSheetHeight)/2,this.bottomSheetLeft=(this.app.viewer.availablePageWidth()-this.rightSheetWidth)/2}this.totalSheetsWidth=this.leftSheetWidth+this.rightSheetWidth;for(var s=0;s<this.sheets.length;s++){var a=this.sheets[s];a.side===p.TURN_DIRECTION.LEFT?this.isVertical()?a.updateSize(this.leftSheetWidth,this.leftSheetHeight,0,this.topSheetLeft):a.updateSize(this.leftSheetWidth,this.leftSheetHeight,this.leftSheetTop,0):this.isVertical()?a.updateSize(this.rightSheetWidth,this.rightSheetHeight,0,this.bottomSheetLeft):a.updateSize(this.rightSheetWidth,this.rightSheetHeight,this.rightSheetTop,0)}}this.updateCenter(),this.updatePendingStatusClass()}}},{key:"textureLoadedCallback",value:function(e){this.getPageByNumber(e.pageNumber),this.pagesReady()}},{key:"isSheetHard",value:function(e){return!!this.isVertical()||ei(en(i.prototype),"isSheetHard",this).call(this,e)}}]),i}(X);function ep(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ec(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function ed(e,t,i){return t&&ec(e.prototype,t),i&&ec(e,i),e}function ef(e,t,i){return(ef="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eg(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function eg(e){return(eg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ev(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&em(e,t)}function em(e,t){return(em=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ey(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=eg(e);return i=t?Reflect.construct(n,arguments,eg(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)}}var eb=p.utils,ew=/*#__PURE__*/function(e){ev(i,e);var t=ey(i);function i(){return ep(this,i),t.apply(this,arguments)}return ed(i,[{key:"init",value:function(){var e=this.element=jQuery("<div>",{class:"df-sheet"});(this.frontPage=new N).element.addClass("df-page-front").appendTo(this.element),(this.backPage=new N).element.addClass("df-page-back").appendTo(this.element),this.parentElement.append(e),this.frontPage.sheet=this.backPage.sheet=this}},{key:"completeTween",value:function(){this.isFlipping=!1,this.viewer.onFlip(),this.viewer.afterFlip(),this.viewer.requestRefresh(),this.element[0].style.opacity=1}},{key:"flip",value:function(e){this.side=this.targetSide,this.completeTween()}},{key:"updateSize",value:function(e,t,i,n){e=Math.floor(e),t=Math.floor(t),i=Math.floor(i),this.element[0].style.height=this.frontPage.element[0].style.height=t+"px",this.element[0].style.width=this.frontPage.element[0].style.width=e+"px",this.element[0].style.transform="translateX("+this.positionX+"px) translateY("+i+"px)"}}]),i}(eh),eP=/*#__PURE__*/function(e){ev(i,e);var t=ey(i);function i(e,n){var o;return ep(this,i),e.viewerClass="df-slider",e.pageMode=p.FLIPBOOK_PAGE_MODE.SINGLE,e.singlePageMode=p.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET,e.pageSize=p.FLIPBOOK_PAGE_SIZE.SINGLE,(o=t.call(this,e,n)).stackCount=10,o.soundOn=!1,o.foldSense=0,n._viewerPrepared(),o}return ed(i,[{key:"initPages",value:function(){for(var e=0;e<this.stackCount;e++){var t=new ew({parentElement:this.wrapper});t.index=e,t.viewer=this,this.sheets.push(t),this.pages.push(t.frontPage),this.pages.push(t.backPage)}}},{key:"resize",value:function(){ef(eg(i.prototype),"resize",this).call(this),this.skipTransition=!0}},{key:"refreshSheet",value:function(e){var t=e.sheet,i=e.sheetNumber;t.element.toggleClass("df-no-transition",t.skipFlip||this.skipTransition),!1===t.isFlipping&&(e.needsFlip?t.flip():(t.skipFlip=!1,t.element.removeClass("df-flipping df-quick-turn df-folding df-left-side df-right-side"),t.element.addClass(t.targetSide===p.TURN_DIRECTION.LEFT?"df-left-side":"df-right-side"),t.side=t.targetSide)),t.visible=e.visible,t.updateCSS({display:e.sheetNumber>0&&e.sheetNumber<=this.app.pageCount?"block":"none",zIndex:e.zIndex}),i!==t.pageNumber&&(t.element.attr("number",i),t.backPage.element.attr("pagenumber",t.backPage.pageNumber),t.frontPage.element.attr("pagenumber",t.frontPage.pageNumber))}},{key:"refresh",value:function(){ef(eg(i.prototype),"refresh",this).call(this),this.skipTransition=!1}},{key:"eventToPoint",value:function(e){var t=ef(eg(i.prototype),"eventToPoint",this).call(this,e);return t.isInsideSheet=jQuery(e.srcElement).closest(".df-page").length>0,t.isInsideCorner=!1,t}},{key:"initCustomControls",value:function(){var e=this.app.ui.controls;e.pageMode&&e.pageMode.hide()}},{key:"setPageMode",value:function(e){e.isSingle=!0,ef(eg(i.prototype),"setPageMode",this).call(this,e)}},{key:"pagesReady",value:function(){if(!this.isFlipping()){var e=0,t=0,i=this.app;this.stackCount;for(var n=[],o=i.currentPageNumber,s=0;s<this.stackCount/2;s++)n.push(o+s),n.push(o-s-1);for(var a=0;a<this.stackCount;a++){var r=n[a];if(this.getPageByNumber(r)){var l=this.getPageByNumber(r).sheet,h=this.getViewPort(l.pageNumber,!0),u=eb.contain(h.width,h.height,this.availablePageWidth(),this.availablePageHeight());i.currentPageNumber===l.pageNumber&&(this.leftSheetWidth=this.rightSheetWidth=Math.floor(u.width)),i.currentPageNumber>l.pageNumber?(e-=Math.floor(u.width)+10,l.positionX=e):(l.positionX=t,t+=Math.floor(u.width)+10);var p=(this.availablePageHeight()-u.height)/2;l.updateSize(Math.floor(u.width*i.zoomValue),Math.floor(u.height*i.zoomValue),p)}}this.updateCenter(),this.updatePendingStatusClass()}}},{key:"isVertical",value:function(){return!1}}]),i}(eu);function eS(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eE(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ex(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eC(e,t,i){return t&&ex(e.prototype,t),i&&ex(e,i),e}function eT(e){return(eT=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ek(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eO(e,t)}function eO(e,t){return(eO=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eR(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=eT(e);return i=t?Reflect.construct(n,arguments,eT(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:eS(this)}}var eL={};function e_(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function eN(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function eA(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eI(e,t,i){return t&&eA(e.prototype,t),i&&eA(e,i),e}function eM(e,t,i){return(eM="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eD(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function eD(e){return(eD=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ez(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eF(e,t)}function eF(e,t){return(eF=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function eB(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var i,n=eD(e);return i=t?Reflect.construct(n,arguments,eD(this).constructor):n.apply(this,arguments),i&&("object"==(i&&"undefined"!=typeof Symbol&&i.constructor===Symbol?"symbol":typeof i)||"function"==typeof i)?i:e_(this)}}eL.init=function(){if(!0!==eL.initialized){var e=window.THREE;eL={init:function(){},initialized:!0,GEOMETRY_TYPE:{PLANE:0,BOX:1,MODEL:2},MATERIAL_FACE:{FRONT:5,BACK:4},WHITE_COLOR:new e.Color("white"),defaults:{anisotropy:8,maxTextureSize:2048,groundTexture:"blank",color:16777215,shininess:15,width:210,height:297,depth:.2,segments:150,textureLoadFallback:"blank"},textureLoader:new e.TextureLoader,clearChild:function(e){var t,i=e.material;if(e.parent.remove(e),e=v.disposeObject(e),null!=i){if(null==i.length)i.map&&(t=i.map,i.dispose(),t.dispose()),i.bumpMap&&(t=i.bumpMap,i.dispose(),t.dispose()),i.normalMap&&(t=i.normalMap,i.dispose(),t.dispose());else for(var n=0;n<i.length;n++)i[n]&&(i[n].map&&(t=i[n].map,i[n].dispose(),t.dispose()),i[n].bumpMap&&(t=i[n].bumpMap,i[n].dispose(),t.dispose()),i[n].normalMap&&(t=i[n].normalMap,i[n].dispose(),t.dispose())),i[n]=null;i=null,t=null}},loadImage:function(t,i,n,o,s){if(null==i){var a=null==t.material[n]?null:t.material[n][o]?t.material[n][o].sourceFile:null;return null==a?null:a.indexOf("data:image")>-1?null:a}var r=null;return"CANVAS"===i.nodeName||"IMG"===i.nodeName?((r=new e.Texture(i)).needsUpdate=!0,eL.loadTexture(r,t,o,n),"function"==typeof s&&s(t,r)):"blank"!==i?(r=null==i?null:eL.textureLoader.load(i,function(e){e.sourceFile=i,eL.loadTexture(e,t,o,n),"function"==typeof s&&s(t,e)},void 0,function(){null==r.image&&eL.loadImage(t,eL.defaults.textureLoadFallback,n,o),eL.loadTextureFailed()}))&&(r.mapping=e.UVMapping):(eL.loadTexture(null,t,o,n),"function"==typeof s&&s(t,r)),0},loadTexture:function(t,i,n,o){if(t){var s=t.image;t.naturalWidth=s.naturalWidth,t.naturalHeight=s.naturalHeight,t.needsUpdate=!0,void 0!=i.textureRotation&&(t.rotation=e.MathUtils.degToRad(i.textureRotation),t.center=i.textureCenter)}null!==t&&"map"===n&&(t.anisotropy=0,eL.defaults.anisotropy>0&&(t.anisotropy=eL.defaults.anisotropy),!0===e.skipPowerOfTwo&&(t.minFilter=e.LinearFilter,t.magFilter=e.LinearFilter),t.name=new Date().toTimeString()),eL.clearTexture(i.material[o][n]),i.material[o][n]=t,"bumpMap"===n&&(i.material[o].bumpScale=i.sheet.getBumpScale(o)),i.material[o].needsUpdate=!0},loadTextureFailed:function(){return null},clearTexture:function(e){if(e){if(e.image&&"CANVAS"===e.image.nodeName){if(e.image.remove)try{e.image.remove()}catch(e){console.log(e)}delete e.image}e=v.disposeObject(e)}}},e.skipPowerOfTwo=!0;var t=/*#__PURE__*/function(t){ek(n,t);var i=eR(n);function n(t){eE(this,n);var o,s=t.width||eL.defaults.width,a=t.height||eL.defaults.height,r=t.color||eL.defaults.color,l=t.segments||eL.defaults.segments,h=t.depth||eL.defaults.depth,u={color:r,flatShading:!1,shininess:t.shininess||eL.defaults.shininess},p=new e.MeshPhongMaterial(u),c=[p,p,p,p,new e.MeshPhongMaterial(u),new e.MeshPhongMaterial(u)];return(o=i.call(this,new e.BoxGeometry(s,a,h,l,1,1),c)).material[5].transparent=!0,o.material[4].transparent=!0,o.baseType="Paper",o.type="Paper",o.castShadow=!0,o.receiveShadow=!0,t.parent3D.add(eS(o)),o}return eC(n,[{key:"loadImage",value:function(e,t,i){eL.loadImage(this,e,t,"map",i)}},{key:"frontImage",value:function(e,t){eL.loadImage(this,e,eL.MATERIAL_FACE.FRONT,"map",t)}},{key:"backImage",value:function(e,t){eL.loadImage(this,e,eL.MATERIAL_FACE.BACK,"map",t)}},{key:"loadBump",value:function(e){eL.loadImage(this,e,eL.MATERIAL_FACE.FRONT,"bumpMap",null),eL.loadImage(this,e,eL.MATERIAL_FACE.BACK,"bumpMap",null)}},{key:"loadNormalMap",value:function(e,t){if(void 0!==t){eL.loadImage(this,e,t,"normalMap",null);return}eL.loadImage(this,e,eL.MATERIAL_FACE.FRONT,"normalMap",null),eL.loadImage(this,e,eL.MATERIAL_FACE.BACK,"normalMap",null)}}]),n}(e.Mesh),i=/*#__PURE__*/function(e){ek(i,e);var t=eR(i);function i(e){var n;return eE(this,i),(n=t.call(this,e)).receiveShadow=!0,n.frontImage(eL.defaults.groundTexture),n.backImage(eL.defaults.groundTexture),n.type="Ground",n}return i}(t),n=/*#__PURE__*/function(t){ek(o,t);var n=eR(o);function o(t){eE(this,o);var s,a=eS(s=n.call(this));a.canvas=t.canvas||document.createElement("canvas"),a.canvas=s.canvas,a.camera=new e.PerspectiveCamera(20,a.width/a.height,4,5e4),a.renderer=new e.WebGLRenderer({canvas:a.canvas,antialias:!0,alpha:!0}),a.renderer.setPixelRatio(t.pixelRatio),a.renderer.setSize(a.width,a.height),a.renderer.setClearColor(16777215,0),a.renderer.shadowMap.enabled=!0,a.renderer.shadowMap.type=1,a.ground=new i({color:16777215,height:a.camera.far/10,width:a.camera.far/10,segments:2,parent3D:a}),a.ambientLight=new e.AmbientLight(4473924),a.add(a.ambientLight);var r=a.spotLight=new e.DirectionalLight(16777215,.25);return r.position.set(0,1,0),!1!==t.castShadow&&(r.castShadow=!0,r.shadow.camera.near=200,r.shadow.camera.far=2e3,r.shadow.camera.top=1350,r.shadow.camera.bottom=-1350,r.shadow.camera.left=-1350,r.shadow.camera.right=1350,r.shadow.radius=2,r.shadow.mapSize.width=1024,r.shadow.mapSize.height=1024,r.shadow.needsUpdate=!0),a.add(r),a.animateCount=0,a.renderCount=0,a.camera.position.set(-300,300,300),a.camera.lookAt(new e.Vector3(0,0,0)),s}return eC(o,[{key:"resizeCanvas",value:function(e,t){this.renderer.setSize(e,t),this.camera.aspect=e/t,this.camera.updateProjectionMatrix()}},{key:"render",value:function(){this.animateCount++,this.renderer.render(this,this.camera),null!=this.stats&&this.stats.update()}},{key:"clearMaterials",value:function(){for(var e=this.children.length,t=e-1;t>=0;t--){var i=this.children[t];if(i.baseType&&"Paper"===i.baseType&&i.material){if(i.material.length)for(var n=0;n<i.material.length;n++)i.material[n].needsUpdate=!0;else i.material.needsUpdate=!0}}}},{key:"clearChild",value:function(){this.spotLight.shadow.map=v.disposeObject(this.spotLight.shadow.map),this.spotLight.castShadow=!1,this.clearMaterials();for(var e=this.children.length,t=e-1;t>=0;t--){var i=this.children[t];if(i.children&&i.children.length>0)for(var n=i.children.length-1;n>=0;n--)eL.clearChild(i.children[n]);eL.clearChild(i),i=null}this.render()}}]),o}(e.Scene);eL.Paper=t,eL.Stage=n;var o=/*#__PURE__*/function(e){ek(i,e);var t=eR(i);function i(e){var n;return eE(this,i),(n=t.call(this)).element=e,n.element.style.position="absolute",n.addEventListener("removed",function(){null!==this.element.parentNode&&this.element.parentNode.removeChild(this.element)}),n}return i}(e.Object3D);e.CSS3DObject=o;var s=/*#__PURE__*/function(e){ek(i,e);var t=eR(i);function i(e){return eE(this,i),t.call(this,e)}return i}(e.CSS3DObject);e.CSS3DSprite=s,e.MathUtils&&(e.Math=e.MathUtils),e.CSS3DRenderer=function(){v.log("THREE.CSS3DRenderer",e.REVISION);var t,i,n,o,s=new e.Matrix4,a={camera:{fov:0,style:""},objects:{}},r=document.createElement("div");r.style.overflow="hidden",r.style.WebkitTransformStyle="preserve-3d",r.style.MozTransformStyle="preserve-3d",r.style.oTransformStyle="preserve-3d",r.style.transformStyle="preserve-3d",this.domElement=r;var l=document.createElement("div");l.style.WebkitTransformStyle="preserve-3d",l.style.MozTransformStyle="preserve-3d",l.style.oTransformStyle="preserve-3d",l.style.transformStyle="preserve-3d",r.appendChild(l),this.setClearColor=function(){},this.getSize=function(){return{width:t,height:i}},this.setSize=function(e,s){t=e,i=s,n=t/2,o=i/2,r.style.width=e+"px",r.style.height=s+"px",l.style.width=e+"px",l.style.height=s+"px"};var h=function(e){return Math.abs(e)<Number.EPSILON?0:e},u=function(e){var t=e.elements;return"matrix3d("+h(t[0])+","+h(-t[1])+","+h(t[2])+","+h(t[3])+","+h(t[4])+","+h(-t[5])+","+h(t[6])+","+h(t[7])+","+h(t[8])+","+h(-t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(-t[13])+","+h(t[14])+","+h(t[15])+")"},p=function(e){var t=e.elements;return"translate3d(-50%,-50%,0) matrix3d("+h(t[0])+","+h(t[1])+","+h(t[2])+","+h(t[3])+","+h(-t[4])+","+h(-t[5])+","+h(-t[6])+","+h(-t[7])+","+h(t[8])+","+h(t[9])+","+h(t[10])+","+h(t[11])+","+h(t[12])+","+h(t[13])+","+h(t[14])+","+h(t[15])+")"},c=function(t,i){if(t instanceof e.CSS3DObject){t instanceof e.CSS3DSprite?(s.copy(i.matrixWorldInverse),s.transpose(),s.copyPosition(t.matrixWorld),s.scale(t.scale),s.elements[3]=0,s.elements[7]=0,s.elements[11]=0,s.elements[15]=1,n=p(s)):n=p(t.matrixWorld);var n,o=t.element,r=a.objects[t.id];(void 0===r||r!==n)&&(o.style.WebkitTransform=n,o.style.MozTransform=n,o.style.oTransform=n,o.style.transform=n,a.objects[t.id]=n),o.parentNode!==l&&l.appendChild(o)}for(var h=0,u=t.children.length;h<u;h++)c(t.children[h],i)};this.render=function(t,s){var h=.5/Math.tan(e.Math.degToRad(.5*s.fov))*i;a.camera.fov!==h&&(r.style.WebkitPerspective=h+"px",r.style.MozPerspective=h+"px",r.style.oPerspective=h+"px",r.style.perspective=h+"px",a.camera.fov=h),t.updateMatrixWorld(),null===s.parent&&s.updateMatrixWorld(),s.matrixWorldInverse.invert?s.matrixWorldInverse.copy(s.matrixWorld).invert():s.matrixWorldInverse.getInverse(s.matrixWorld);var p="translate3d(0,0,"+h+"px)"+u(s.matrixWorldInverse)+" translate3d("+n+"px,"+o+"px, 0)";a.camera.style!==p&&(l.style.WebkitTransform=p,l.style.MozTransform=p,l.style.oTransform=p,l.style.transform=p,a.camera.style=p),c(t,s)}}}};var eH=p.jQuery,eU=p.utils,eV=/*#__PURE__*/function(e){ez(i,e);var t=eB(i);function i(e){var n;return eN(this,i),(n=t.call(this,e)).flexibility=e.flexibility,n.sheetAngle=180,n.curveAngle=0,n.parent3D=e.parent3D,n.segments=e.segments||50,n.width=e.width||100,n.height=e.height||100,n.depth=e.depth||.5,n.matColor="white",n.fallbackMatColor=eL.WHITE_COLOR,n.init(),n.bumpScale=[0,0,0,0,1,1],n}return eI(i,[{key:"init",value:function(){this.element=new eL.Paper({parent3D:this.parent3D,segments:this.segments,depth:this.depth,height:this.height,width:this.width,flatShading:0===this.flexibility}),this.element.sheet=this,this.frontPage=new eW({sheet:this,face:5}),this.backPage=new eW({sheet:this,face:4}),this.reset(),this.updateAngle()}},{key:"setMatColor",value:function(e,t){if(this.matColor=new THREE.Color(e),void 0===t)for(var i=0;i<6;i++)this.element.material[i].color=this.matColor;else this.element.material[t].color=this.matColor}},{key:"getBumpScale",value:function(e){return this.bumpScale[e]}},{key:"resetMatColor",value:function(e,t){this.element.material[e].color=t?this.matColor:this.fallbackMatColor}},{key:"frontImage",value:function(e,t){this.element.frontImage(e,t)}},{key:"backImage",value:function(e,t){this.element.backImage(e,t)}},{key:"updateAngle",value:function(){if(void 0!==this.viewer&&null!==this.viewer){var e=!0===this.isHard?0:this.flexibility,t=(this.viewer.isVertical()?this.height:this.width)*(1-Math.sin(e/2*(e/2))/2-e/20);this.element.scale.y=(this.viewer.isVertical()?this.width:this.height)/this.element.geometry.parameters.height;var i=this.segments,n=t/1,o=n*e,s=[],a=[],r=[],l=[],h=[],u=[],p=this.depth,c=0,d=[];d.push(c),h[0]=[],u[0]=[];var f=this.sheetAngle*Math.PI/180;this.viewer.isVertical()||(this.element.position.x=-Math.cos(f)*this.viewer.pageOffset),this.viewer.isVertical()&&(this.element.position.y=Math.cos(f)*this.viewer.pageOffset);var g=!0===this.isHard?f:this.curveAngle*Math.PI/180,v=this.sheetAngle*Math.PI/180,m=v-Math.PI/2,y=Math.sin(m)*p/2;h[0][0]=h[0][1]=new THREE.Vector3(-n*Math.cos(f),0,Math.sin(f)*n-y),u[0][0]=u[0][1]=new THREE.Vector3(h[0][0].x-Math.cos(m)*p,0,h[0][0].z+2*y),h[0][1]=new THREE.Vector3(-n/2*Math.cos(g),0,n/2*Math.sin(g)-y),u[0][1]=new THREE.Vector3(h[0][1].x-Math.cos(m)*p,0,h[0][1].z+2*y),v=(45+this.sheetAngle/2)*Math.PI/180,h[0][2]=new THREE.Vector3(-Math.cos(v)*o/2,0,Math.sin(v)*o-y),u[0][2]=new THREE.Vector3(h[0][2].x+Math.cos(m)*p,0,h[0][2].z+2*y),5e-4>Math.abs(u[0][2].x-0)&&(u[0][2].x=0),h[0][3]=new THREE.Vector3(0,0,-y),u[0][3]=new THREE.Vector3(h[0][3].x-Math.cos(m)*p,0,h[0][3].z+2*y),5e-4>Math.abs(u[0][3].x-0)&&(u[0][3].x=0);for(var b=0;b<1;b++){var w=Math.max(this.segments-1,1);s[b]=new THREE.CubicBezierCurve3(h[b][0],h[b][1],h[b][2],h[b][3]),r[b]=s[b].getPoints(w),w>2&&r[b].push(new THREE.Vector3().copy(r[b][w]));for(var P=void 0,S=r[b][0],E=1;E<r[b].length;E++)c+=(P=r[b][E]).distanceTo(S),d.push(c),S=P;a[b]=new THREE.CubicBezierCurve3(u[b][0],u[b][1],u[b][2],u[b][3]),l[b]=a[b].getPoints(w),w>2&&l[b].push(new THREE.Vector3().copy(l[b][w]))}var x=this.element.geometry;if(void 0!==x.attributes){var C=x.attributes.position,T=x.attributes.uv,k=i+1;C.setZ(0,r[0][i].z),C.setZ(2,r[0][i].z),C.setX(0,r[0][i].x),C.setX(2,r[0][i].x),C.setZ(1,l[0][i].z),C.setZ(3,l[0][i].z),C.setX(1,l[0][i].x),C.setX(3,l[0][i].x),C.setZ(5,r[0][0].z),C.setZ(7,r[0][0].z),C.setX(5,r[0][0].x),C.setX(7,r[0][0].x),C.setZ(4,l[0][0].z),C.setZ(6,l[0][0].z),C.setX(4,l[0][0].x),C.setX(6,l[0][0].x);for(var O=0;O<1;O++)for(var R=0;R<k;R++)C.setZ(8+0*k+R,r[0][R].z),C.setX(8+0*k+R,r[0][R].x),C.setZ(8+1*k+R,l[0][R].z),C.setX(8+1*k+R,l[0][R].x),C.setZ(8+2*k+R,r[0][R].z),C.setX(8+2*k+R,r[0][R].x),C.setZ(8+3*k+R,l[0][R].z),C.setX(8+3*k+R,l[0][R].x),C.setZ(8+4*k+R,r[0][R].z),C.setX(8+4*k+R,r[0][R].x),C.setZ(8+5*k+R,r[0][R].z),C.setX(8+5*k+R,r[0][R].x),T.setX(8+4*k+R,d[R]/c),T.setX(8+5*k+R,d[R]/c),C.setZ(8+6*k+R,l[0][i-R].z),C.setX(8+6*k+R,l[0][i-R].x),C.setZ(8+7*k+R,l[0][i-R].z),C.setX(8+7*k+R,l[0][i-R].x),T.setX(8+6*k+R,1-d[i-R]/c),T.setX(8+7*k+R,1-d[i-R]/c);x.computeBoundingBox(),this.element.scale.x=1*n/c,x.computeBoundingSphere(),C.needsUpdate=!0,T.needsUpdate=!0,x.computeVertexNormals()}else{var L=x.vertices,_=i-1,N=8;L[0].z=L[2].z=r[0][i].z,L[0].x=L[2].x=r[0][i].x,L[1].z=L[3].z=l[0][i].z,L[1].x=L[3].x=l[0][i].x,L[5].z=L[7].z=r[0][0].z,L[5].x=L[7].x=r[0][0].x,L[4].z=L[6].z=l[0][0].z,L[4].x=L[6].x=l[0][0].x;for(var A=0;A<1;A++)for(var I=1;I<i;I++)L[N].z=L[N+3*_].z=l[0][I].z,L[N].x=L[N+3*_].x=l[0][I].x,L[N+_].z=L[N+2*_].z=r[0][I].z,L[N+_].x=L[N+2*_].x=r[0][I].x,N++;for(var M=x.faceVertexUvs[0],D=x.faces,z=0,F=0;F<M.length;F++)if(D[F].materialIndex===eL.MATERIAL_FACE.BACK){var B=d[z]/c;F%2==0?(M[F][0].x=M[F][1].x=M[F+1][0].x=B,z++):M[F-1][2].x=M[F][1].x=M[F][2].x=B}else if(D[F].materialIndex===eL.MATERIAL_FACE.FRONT){var H=1-d[z]/c;F%2==0?(M[F][0].x=M[F][1].x=M[F+1][0].x=H,z--):M[F-1][2].x=M[F][1].x=M[F][2].x=H}x.computeBoundingBox(),this.element.scale.x=1*n/c,x.computeBoundingSphere(),x.verticesNeedUpdate=!0,x.computeFaceNormals(),x.computeVertexNormals(),x.uvsNeedUpdate=!0,x.normalsNeedUpdate=!0}s.forEach(function(e){}),a.forEach(function(e){}),l.forEach(function(e){}),r.forEach(function(e){})}}},{key:"flip",value:function(e,t){var i=this,n=i.viewer.isBooklet;!0===i.isCover&&(0===e&&(e=2.5*i.viewer.flexibility),180===e&&(e-=2.5*i.viewer.flexibility));var o=t-e,s=e>90,a=i.viewer.isRTL,r=s?i.backPage.pageNumber:i.frontPage.pageNumber,l=this.viewer.getViewPort(r);l&&(l=eU.contain(l.width,l.height,i.viewer.availablePageWidth(),i.viewer.availablePageHeight()));var h=-(i.viewer.has3DCover&&i.viewer.isClosedPage()?i.viewer.coverExtraWidth:0),u=-(i.viewer.has3DCover&&i.viewer.isClosedPage()?i.viewer.coverExtraHeight:0);i.init={angle:e,height:s?i.viewer.rightSheetHeight:i.viewer.leftSheetHeight,width:s?i.viewer.rightSheetWidth:i.viewer.leftSheetWidth,index:s&&!a||!s&&a?1:0,_index:0},i.first={angle:e+o/4,index:s&&!a||!s&&a?1:.25},i.mid={angle:e+2*o/4,index:.5},i.mid2={angle:e+3*o/4,index:s&&!a||!s&&a?.25:1},i.end={angle:t,index:s&&!a||!s&&a?0:1,height:u+(l?l.height:i.height),width:h+(l?l.width:i.width)},i.isFlipping=!0;var p=function(e){i.sheetAngle=e.angle,i.curveAngle=i.isHard?e.angle:eU.getCurveAngle(s,e.angle),!0===i.isHard?(i.flexibility=0,i.isCover&&i.viewer.flipCover(i)):i.flexibility=e.angle<90?i.leftFlexibility:i.rightFlexibility,i.element.position.z=(e.angle<90?i.leftPos:i.rightPos)+i.depth,n&&(i.element.material[5].opacity=i.element.material[4].opacity=e.index,i.element.castShadow=e.index>.5),i.height=e.height,i.width=e.width,i.updateAngle(!0)};n&&(!s&&!a||s&&a)&&(i.element.material[5].opacity=i.element.material[4].opacity=0,i.element.castShadow=!1),i.currentTween=new TWEEN.Tween(i.init).to({angle:[i.first.angle,i.mid.angle,i.mid2.angle,i.end.angle],index:[i.first.index,i.mid.index,i.mid2.index,i.end.index],_index:1,height:i.end.height,width:i.end.width},i.viewer.app.options.duration*Math.abs(o)/180).onUpdate(function(e){p(this,e)}).easing(TWEEN.Easing.Sinusoidal.Out).onStop(function(){i.currentTween=null,i.isFlipping=!1,i.isCover&&(i.viewer.leftCover.isFlipping=!1,i.viewer.rightCover.isFlipping=!1),i.element.material[5].opacity=i.element.material[4].opacity=1}).onComplete(function(){i.updateAngle(),i.element.material[5].opacity=i.element.material[4].opacity=1,i.element.castShadow=!0,i.isFlipping=!1,i.isCover&&(i.viewer.leftCover.isFlipping=!1,i.viewer.rightCover.isFlipping=!1),i.side=i.targetSide,i.viewer.onFlip(),i.viewer.afterFlip(),i.currentTween=null,i.viewer&&i.viewer.requestRefresh&&i.viewer.requestRefresh()}).start(),i.currentTween.update(window.performance.now())}}]),i}(J),ej=/*#__PURE__*/function(e){ez(i,e);var t=eB(i);function i(e,n){var o,s,a,r,l;return eN(this,i),e.viewerClass="df-flipbook-3d",(o=t.call(this,e,n)).pageOffset=5,o.spiralCount=20,o.groundDistance=null!==(s=e.groundDistance)&&void 0!==s?s:2,o.hasSpiral="true"===e.hasSpiral||!0===e.hasSpiral,o.flexibility=eU.limitAt(null!==(a=e.flexibility)&&void 0!==a?a:.9,0,10),o.hasSpiral&&(o.flexibility=0),0===o.flexibility&&(e.sheetSegments=8),o.drag3D=eU.isTrue(e.drag3D),o.texturePowerOfTwo=!eU.isMobile&&(null===(r=e.texturePowerOfTwo)||void 0===r||r),o.color3DSheets=null!==(l=o.app.options.color3DSheets)&&void 0!==l?l:"white",o.midPosition=0,o.initMOCKUP(function(){n._viewerPrepared()}),o}return eI(i,[{key:"initMOCKUP",value:function(e){var t=this.app;"undefined"==typeof THREE?(t.updateInfo(t.options.text.loading+" WEBGL 3D ..."),"function"==typeof window.define&&window.define.amd&&window.requirejs?(window.requirejs.config({paths:{three:t.options.threejsSrc.replace(".js","")},shim:{three:{exports:"THREE"}}}),window.require(["three"],function(t){return window.THREE=t,eL.init(),"function"==typeof e&&e(),t})):"function"==typeof window.define&&window.define.amd?window.require(["three",t.options.threejsSrc.replace(".js","")],function(t){t(function(){eL.init(),"function"==typeof e&&e()})}):eU.getScript(t.options.threejsSrc+"?ver="+p.version,function(){eL.init(),"function"==typeof e&&e()},function(){t.updateInfo("Unable to load THREE.js...")})):(eL.init(),"function"==typeof e&&e())}},{key:"init",value:function(){var e=this.app;eM(eD(i.prototype),"init",this).call(this),e.provider.defaultPage.pageRatio,this.pageScaleX=1,this.initDepth(),this.initStage(),this.initPages(),this.initEvents(),this.render()}},{key:"updatePageMode",value:function(){eM(eD(i.prototype),"updatePageMode",this).call(this);var e=this.app;this.has3DCover=e.options.cover3DType!==p.FLIPBOOK_COVER_TYPE.NONE&&e.pageCount>7&&!this.isBooklet,this.has3DCover&&"none"===e.options.flipbookHardPages&&(e.options.flipbookHardPages="cover")}},{key:"initDepth",value:function(){var e,t;this.sheetDepth=this.pageScaleX*(null!==(e=this.app.options.sheetDepth)&&void 0!==e?e:.5),this.sheetSegments=null!==(t=this.app.options.sheetSegments)&&void 0!==t?t:20,this.coverDepth=2*this.sheetDepth,this.sheetsDepth=Math.min(10,this.app.pageCount/4)*this.sheetDepth}},{key:"initStage",value:function(){var e=this.stage=new eL.Stage({pixelRatio:this.app.options.pixelRatio});(e.canvas=eH(e.renderer.domElement).addClass("df-3dcanvas")).appendTo(this.element),e.camera.position.set(0,0,600),e.camera.lookAt(new THREE.Vector3(0,0,0)),this.camera=e.camera,e.spotLight.position.set(-220,220,550),e.spotLight.castShadow=!eU.isMobile&&this.app.options.has3DShadow,e.spotLight.shadow&&(e.spotLight.shadow.bias=-.005),e.ambientLight.color=new THREE.Color("#fff"),e.ambientLight.intensity=.82;var t=new THREE.ShadowMaterial;t.opacity=this.app.options.shadowOpacity,e.ground.oldMaterial=e.ground.material,e.ground.material=t,e.ground.position.z=this.has3DCover?-6:-4,e.selectiveRendering=!0;var i=e.cssRenderer=new THREE.CSS3DRenderer;eH(i.domElement).css({position:"absolute",top:0,pointerEvents:"none"}).addClass("df-3dcanvas df-csscanvas"),this.element[0].appendChild(i.domElement),e.cssScene=new THREE.Scene,this.wrapper.remove(),this.wrapper=new THREE.Group,this.stage.add(this.wrapper),this.wrapper.add(e.ground),this.bookWrapper=new THREE.Group,this.bookWrapper.name="bookwrapper",this.wrapper.add(this.bookWrapper),this.bookHelper=e.bookHelper=new THREE.BoxHelper(this.bookWrapper,16776960),e.add(this.bookHelper),this.bookHelper.visible=!1,this.cameraWrapper=new THREE.Group,this.cameraWrapper.add(e.camera),e.add(this.cameraWrapper),this.app.renderRequestStatus=p.REQUEST_STATUS.ON}},{key:"initPages",value:function(){for(var e={parent3D:this.bookWrapper,viewer:this,segments:this.sheetSegments,depth:this.sheetDepth,flexibility:this.flexibility},t=0;t<this.stackCount;t++){var i=new eV(e);i.index=t,i.viewer=this,this.sheets.push(i),i.setMatColor(this.color3DSheets),this.pages.push(i.frontPage),this.pages.push(i.backPage),this.stage.cssScene.add(i.frontPage.cssPage),this.stage.cssScene.add(i.backPage.cssPage)}e.depth=this.sheetsDepth,e.segments=1,e.flexibility=0,this.leftSheets=new eV(e),this.rightSheets=new eV(e),this.leftSheets.setMatColor(this.color3DSheets),this.rightSheets.setMatColor(this.color3DSheets),e.depth=this.coverDepth,this.leftCover=new eV(e),this.rightCover=new eV(e),this.leftCover.isHard=!0,this.rightCover.isHard=!0,this.set3DCoverNormal(),this.setcolor3DCover(this.app.options.color3DCover),this.stage.cssScene.add(this.leftCover.frontPage.cssPage),this.stage.cssScene.add(this.rightCover.backPage.cssPage),this.zoomViewer.leftPage.element.css({backgroundColor:this.color3DSheets}),this.zoomViewer.rightPage.element.css({backgroundColor:this.color3DSheets}),this.isVertical()&&this.bookWrapper.children.forEach(function(e){e.rotateZ(THREE.MathUtils.degToRad(-90)),e.textureCenter=new THREE.Vector2(.5,.5),e.textureRotation=90}),this.initSpiral()}},{key:"initSpiral",value:function(){this.hasSpiral=!1}},{key:"set3DCoverNormal",value:function(){}},{key:"setcolor3DCover",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]}},{key:"initEvents",value:function(){this.stageDOM=this.element[0],eM(eD(i.prototype),"initEvents",this).call(this)}},{key:"dispose",value:function(){eM(eD(i.prototype),"dispose",this).call(this),this.stage&&(this.stage.clearChild(),this.stage.cssRenderer.domElement.parentNode.removeChild(this.stage.cssRenderer.domElement),this.stage.cssRenderer=null,this.stage.orbitControl=eU.disposeObject(this.stage.orbitControl),this.stage.renderer=eU.disposeObject(this.stage.renderer),eH(this.stage.canvas).remove(),this.stage.canvas=null,this.stage=eU.disposeObject(this.stage)),this.centerTween&&this.centerTween.stop&&this.centerTween.stop()}},{key:"render",value:function(){this.stage.render(),this.stage.cssRenderer.render(this.stage.cssScene,this.stage.camera)}},{key:"resize",value:function(){eM(eD(i.prototype),"resize",this).call(this);var e=this,t=e.app,n=e.stage,o=t.dimensions;o.padding,e.isSingle;var s=this.availablePageWidth(),a=this.availablePageHeight();n.resizeCanvas(o.stage.width,o.stage.height),n.cssRenderer.setSize(o.stage.width,o.stage.height),this.pageScaleX=Math.max(Math.max(s,a)/400,1),this.initDepth(),this.sheets.forEach(function(t){t.depth=e.sheetDepth}),t.refreshRequestStart();var r=this.refSize=Math.min(a,s);this.coverExtraWidth=(e.isVertical()?2:1)*r*.025,this.coverExtraHeight=(e.isVertical()?1:2)*r*.025,!0!==this.has3DCover&&(this.coverExtraWidth=0,this.coverExtraHeight=0),e.zoomViewer.resize(),e.cameraPositionDirty=!0,e.centerNeedsUpdate=!0,e.checkCenter(!0),e.pagesReady(),this.pageOffset=(this.hasSpiral?6:0)*Math.min(this._defaultPageSize.width,this._defaultPageSize.height)/1e3}},{key:"fitCameraToCenteredObject",value:function(e,t,i,n){var o=new THREE.Box3;o.setFromObject(t),new THREE.Vector3;var s=new THREE.Vector3;o.getSize(s);var a=this.coverExtraHeight,r=2*this.coverExtraWidth;this.isClosedPage()&&(r=0,a=0),s.x=s.x-r+this.app.dimensions.padding.width,s.y=s.y-a+this.app.dimensions.padding.height;var l=e.fov*(Math.PI/180),h=2*Math.atan(Math.tan(l/2)*e.aspect),u=Math.max(s.z/2+Math.abs(s.x/2/Math.tan(h/2)),s.z/2+Math.abs(s.y/2/Math.tan(l/2)));void 0!==i&&0!==i&&(u*=i),e.position.set(0,0,u);var p=o.min.z,c=p<0?-p+u:u-p;e.far=3*c,e.updateProjectionMatrix(),void 0!==n&&(n.target=new THREE.Vector3(0,0,0),n.maxDistance=2*c)}},{key:"updateShadowSize",value:function(){}},{key:"refresh",value:function(){var e=this.app,t=this.getBasePage();this.refreshRequested=!0;var n=1/e.pageCount*t,o=this.isRTL?1-n:n,s=Math.min(this.stackCount,this.totalSheets),a=eU.limitAt(this.totalSheets,this.stackCount,2*this.stackCount),r=this.isBooklet?0:this.flexibility/a;this.leftFlexibility=r*(1-o),this.rightFlexibility=r*o,this.midPosition=.5*s*this.sheetDepth,eM(eD(i.prototype),"refresh",this).call(this);var l=!0===this.has3DCover;this.leftCover.element.visible=this.rightCover.element.visible=this.leftSheets.element.visible=this.rightSheets.element.visible=l,this.wrapper.position.z=-this.midPosition;var h=0,u=0,p=this.isRTL,c=this.isFirstPage(),d=this.isLastPage(),f=this.isLeftClosed=this.isClosedPage()&&(p&&d||!p&&c),g=this.isRightClosed=this.isClosedPage()&&(!p&&d||p&&c);if(l){this.leftSheets.depth=p?this.sheetsDepth*(1-this.getBasePage()/e.pageCount):this.sheetsDepth*t/e.pageCount,this.leftSheets.element.visible=p?e.pageCount-this.getBasePage()>2:t>2,h-=this.leftSheets.depth/2,this.leftSheets.element.position.z=h,h-=this.coverDepth+(this.leftSheets.element.visible?this.leftSheets.depth/2:0)+3*this.coverDepth,this.leftCover.depth=this.rightCover.depth=this.coverDepth;var v=Math.max(this.leftSheetHeight,this.rightSheetHeight);g&&(v=this.leftSheetHeight),f&&(v=this.rightSheetHeight),!0!==this.leftCover.isFlipping&&(this.leftCover.element.position.z=f?this.midPosition+this.coverDepth:h+this.coverDepth/2,this.leftCover.element.position.z=Math.max(this.leftCover.element.position.z,-(.05*this.refSize)),this.leftCover.element.position.x=0,this.leftSheets.sheetAngle=this.leftCover.sheetAngle=f?180:0,this.leftSheets.curveAngle=this.leftCover.curveAngle=f?180:0,!0===this.rightCover.isFlipping||(this.leftCover.height=v,this.leftCover.width=this.leftCover.sheetAngle<90?this.leftSheetWidth:this.rightSheetWidth,this.isClosedPage()||(this.leftCover.width+=this.coverExtraWidth,this.leftCover.height+=this.coverExtraHeight)),this.leftSheets.updateAngle(),this.leftCover.updateAngle()),this.rightSheets.depth=this.sheetsDepth-this.leftSheets.depth,this.rightSheets.element.visible=p?t>2:e.pageCount-this.getBasePage()>2,u-=this.rightSheets.depth/2,this.rightSheets.element.position.z=u,u-=this.coverDepth+(this.rightSheets.element.visible?this.rightSheets.depth/2:0)+3*this.coverDepth,!0!==this.rightCover.isFlipping&&(this.rightCover.element.position.z=g?this.midPosition+this.coverDepth:u+this.coverDepth/2,this.rightCover.element.position.z=Math.max(this.rightCover.element.position.z,-(.05*this.refSize)),this.rightCover.element.position.x=0,this.rightSheets.sheetAngle=this.rightCover.sheetAngle=g?0:180,this.rightSheets.curveAngle=this.rightCover.curveAngle=g?0:180,!0===this.leftCover.isFlipping||(this.rightCover.height=v,this.rightCover.width=this.rightCover.sheetAngle<90?this.leftSheetWidth:this.rightSheetWidth,this.isClosedPage()||(this.rightCover.width+=this.coverExtraWidth,this.rightCover.height+=this.coverExtraHeight)),this.rightSheets.updateAngle(),this.rightCover.updateAngle()),this.updateSheets(),this.stage.ground.position.z=Math.min(h,u)-this.refSize*this.groundDistance/100,this.stage.ground.position.z=Math.max(this.stage.ground.position.z,-(.1*this.refSize))}else this.stage.ground.position.z=-this.midPosition-15*this.sheetDepth;!0===this.cameraPositionDirty&&this.updateCameraPosition(),this.refreshSpiral()}},{key:"refreshSpiral",value:function(){}},{key:"updateCameraPosition",value:function(){var e=this.app,t=this.stage,i=e.dimensions,n=i.padding,o=1/(2*Math.tan(Math.PI*t.camera.fov*.5/180)/(i.stage.height/e.zoomValue))+2.2;this.updateShadowSize(),this.stage.spotLight.position.x=-(330*this.pageScaleX),this.stage.spotLight.position.y=330*this.pageScaleX,this.stage.spotLight.position.z=550*this.pageScaleX,this.stage.spotLight.shadow.camera.far=1200*this.pageScaleX,this.stage.spotLight.shadow.camera.updateProjectionMatrix();var s=(n.top-n.bottom)/e.zoomValue/2,a=-(n.left-n.right)/e.zoomValue/2;t.camera.position.z!==o&&!0===e.pendingZoom&&(t.camera.position.z=o),1===e.zoomValue&&(this.bookWrapper.rotation.set(0,0,0),this.bookHelper.rotation.set(0,0,0),this.cameraWrapper.rotation.set(0,0,0),0!==e.options.flipbook3DTiltAngleUp||0!==e.options.flipbook3DTiltAngleLeft?(t.camera.aspect=i.stage.width/i.stage.height,t.camera.updateProjectionMatrix(),this.bookWrapper.rotateZ(THREE.Math.degToRad(-e.options.flipbook3DTiltAngleLeft)),this.bookWrapper.rotateX(THREE.Math.degToRad(-e.options.flipbook3DTiltAngleUp)),this.isVertical()?this.bookWrapper.scale.y=1/(this.isSingle?2:1):this.bookWrapper.scale.x=1/(this.isSingle?2:1),this.bookHelper.update(),this.fitCameraToCenteredObject(t.camera,this.bookWrapper),this.bookWrapper.rotation.set(0,0,0),this.bookWrapper.scale.x=1,this.bookWrapper.scale.y=1,t.camera.position.set(a,s,t.camera.position.z+t.ground.position.z),this.camera.aspect=i.stage.width/i.stage.height,this.camera.updateProjectionMatrix(),this.cameraWrapper.rotateX(THREE.Math.degToRad(e.options.flipbook3DTiltAngleUp)),this.cameraWrapper.rotateZ(THREE.Math.degToRad(e.options.flipbook3DTiltAngleLeft))):t.camera.position.set(a,s,o)),t.camera.updateProjectionMatrix(),this.app.renderRequestStatus=p.REQUEST_STATUS.ON,this.cameraPositionDirty=!1}},{key:"refreshSheet",value:function(e){var t,i=e.sheet,n=e.index,o=i.sheetAngle,s=!(i.isHard||0===this.flexibility);i.leftFlexibility=s?this.leftFlexibility:0,i.rightFlexibility=s?this.rightFlexibility:0,i.leftPos=this.midPosition+(n-e.midPoint+1)*this.sheetDepth-this.sheetDepth/2,i.rightPos=this.midPosition-(n-e.midPoint)*this.sheetDepth-this.sheetDepth/2,t=i.targetSide===p.TURN_DIRECTION.LEFT?0:180,!1===i.isFlipping&&(e.needsFlip?(i.isFlipping=!0,i.isCover&&0===e.sheetNumber&&(this.isRTL?this.rightCover.isFlipping=!0:this.leftCover.isFlipping=!0),i.isCover&&this.totalSheets-e.sheetNumber==1&&(this.isRTL?this.leftCover.isFlipping=!0:this.rightCover.isFlipping=!0),i.element.position.z=Math.max(o<90?i.leftPos:i.rightPos,this.midPosition)+this.sheetDepth,i.flexibility=o<90?i.leftFlexibility:i.rightFlexibility,i.flip(o,t)):(i.skipFlip=!1,i.sheetAngle=i.curveAngle=t,i.flexibility=t<90?i.leftFlexibility:i.rightFlexibility,i.element.position.z=t<90?i.leftPos:i.rightPos,i.side=i.targetSide,i.height=t<90?this.leftSheetHeight:this.rightSheetHeight,i.width=t<90?this.leftSheetWidth:this.rightSheetWidth),i.updateAngle(),this.app.renderRequestStatus=p.REQUEST_STATUS.ON),i.element.visible=e.visible}},{key:"updateCenter",value:function(){var e=this,t=this.app,i=this.isVertical(),n=i?e.wrapper.position.y:e.wrapper.position.x,o=(this.isVertical()?-1:1)*e.centerShift*(this.isLeftPage()?i?this.leftSheetHeight:this.leftSheetWidth:i?this.rightSheetHeight:this.rightSheetWidth)/2;e.seamPositionY=(t.dimensions.padding.heightDiff+t.dimensions.containerHeight)/2-o,e.seamPositionX=(-t.dimensions.offset.width+t.dimensions.containerWidth)/2+o,o!==e.centerEnd&&(e.centerTween&&e.centerTween.stop&&e.centerTween.stop(),e.onCenterStartAnimation(this),e.centerTween=new TWEEN.Tween({x:n}).delay(0).to({x:o},1===t.zoomValue&&!0!==e.skipCenterAnimation?e.app.options.duration:1).onStart(function(){}).onUpdate(function(){e.onCenterUpdateAnimation(this)}).onComplete(function(){e.onCenterCompleteAnimation(this)}).onStop(function(){e.onCenterStopAnimation(this)}).easing(TWEEN.Easing.Cubic.InOut).start(),this.updatePendingStatusClass(),e.skipCenterAnimation=!1,e.centerEnd=o),e.renderRequestStatus=p.REQUEST_STATUS.ON,this.zoomViewer.updateCenter()}},{key:"onCenterUpdateAnimation",value:function(e){this.isVertical()?(this.wrapper.position.y=e.x,this.stage&&this.stage.cssScene&&(this.stage.cssScene.position.y=e.x)):(this.wrapper.position.x=e.x,this.stage&&this.stage.cssScene&&(this.stage.cssScene.position.x=e.x))}},{key:"onCenterStartAnimation",value:function(e){}},{key:"onCenterStopAnimation",value:function(e){}},{key:"onCenterCompleteAnimation",value:function(e){}},{key:"flipCover",value:function(e){var t,i,n=null;0===e.pageNumber||this.isBooklet&&1===e.pageNumber?(n=this.isRTL?this.rightCover:this.leftCover,t=this.isRTL?1:-1):e.pageNumber===this.totalSheets-1&&(n=this.isRTL?this.leftCover:this.rightCover,t=this.isRTL?-1:1),null!==n&&(i=n.depth+e.depth+1,n.sheetAngle=e.sheetAngle,n.curveAngle=e.curveAngle,this.rightCover.height=this.leftCover.height=e.height+this.coverExtraHeight,this.rightCover.width=this.leftCover.width=e.width+this.coverExtraWidth,n.flexibility=e.flexibility,this.rightCover.updateAngle(),this.leftCover.updateAngle(),n.element.position.x=e.element.position.x+t*Math.sin(e.sheetAngle*Math.PI/180)*i,n.element.position.z=e.element.position.z+t*Math.cos(e.sheetAngle*Math.PI/180)*i)}},{key:"pagesReady",value:function(){if(!this.isAnimating()&&!0===this.refreshRequested){if(!1===this.app.options.flipbookFitPages){var e=this.app.viewer.getBasePage(),t=this.leftViewport=this.getViewPort(e+(this.isBooklet?0:this.isRTL?1:0)),i=this.rightViewPort=this.getViewPort(e+(this.isBooklet?0:this.isRTL?0:1));if(t){var n=eU.contain(t.width,t.height,this.availablePageWidth(),this.availablePageHeight());(this.leftSheetWidth!=Math.floor(n.width)||this.leftSheetHeight!=Math.floor(n.height))&&(this.cameraPositionDirty=!0),this.leftSheetWidth=Math.floor(n.width),this.leftSheetHeight=Math.floor(n.height)}if(i){var o=eU.contain(i.width,i.height,this.availablePageWidth(),this.availablePageHeight());(this.rightSheetWidth!=Math.floor(o.width)||this.rightSheetWidth!=Math.floor(o.height))&&(this.cameraPositionDirty=!0),this.rightSheetWidth=Math.floor(o.width),this.rightSheetHeight=Math.floor(o.height)}for(var s=0;s<this.sheets.length;s++){var a=this.sheets[s];a.side===p.TURN_DIRECTION.LEFT?(a.height=this.leftSheetHeight,a.width=this.leftSheetWidth):(a.height=this.rightSheetHeight,a.width=this.rightSheetWidth),a.updateAngle()}if(this.isClosedPage()){var r=this.isRTL&&this.isLastPage()||!this.isRTL&&this.isFirstPage();this.leftCover.width=this.rightCover.width=r?this.rightSheetWidth:this.leftSheetWidth,this.leftCover.height=this.rightCover.height=r?this.rightSheetHeight:this.leftSheetHeight}else this.leftCover.height=this.rightCover.height=this.coverExtraHeight+Math.max(this.leftSheetHeight,this.rightSheetHeight),this.leftCover.width=this.coverExtraWidth+this.leftSheetWidth,this.rightCover.width=this.coverExtraWidth+this.rightSheetWidth;this.leftSheets.width=this.leftSheetWidth,this.leftSheets.height=this.leftSheetHeight,this.rightSheets.height=this.rightSheetHeight,this.rightSheets.width=this.rightSheetWidth,this.leftCover.updateAngle(),this.leftSheets.updateAngle(),this.rightCover.updateAngle(),this.rightSheets.updateAngle(),this.updateSheets(!0)}this.updateCenter(),this.updateCSSLayer(),this.updatePendingStatusClass(),this.refreshSpiral(),!0===this.cameraPositionDirty&&this.updateCameraPosition()}}},{key:"updateSheets",value:function(e){if(!0!==this.isClosedPage()){var t=this.getPageByNumber(this.getRightPageNumber());if(!0!==this.rightCover.isFlipping&&t&&t.sheet.element.geometry.attributes){var i=this.rightSheets.element.geometry.attributes.position,n=e?t.sheet.element.geometry.boundingBox.max.x*t.sheet.element.scale.x:this.rightSheets.lastSlopeX;i.setX(21,n),i.setX(23,n),i.setX(4,n),i.setX(6,n),i.setX(10,n),i.setX(14,n),i.needsUpdate=!0,this.rightSheets.element.geometry.attributes.uv.needsUpdate=!0,this.rightSheets.element.geometry.computeVertexNormals(),e&&(this.rightSheets.lastSlopeX=n)}var o=this.getPageByNumber(this.getLeftPageNumber());if(!0!==this.leftCover.isFlipping&&o&&o.sheet.element.geometry.attributes){var s=this.leftSheets.element.geometry.attributes.position,a=e?o.sheet.element.geometry.boundingBox.min.x*o.sheet.element.scale.x:this.leftSheets.lastSlopeX;s.setX(16,a),s.setX(18,a),s.setX(5,a),s.setX(7,a),s.setX(8,a),s.setX(12,a),s.needsUpdate=!0,this.leftSheets.element.geometry.attributes.uv.needsUpdate=!0,this.leftSheets.element.geometry.computeVertexNormals(),e&&(this.leftSheets.lastSlopeX=a)}}}},{key:"updateCSSLayer",value:function(){}},{key:"mouseMove",value:function(e){if(e=eU.fixMouseEvent(e),this.app.renderRequestStatus=p.REQUEST_STATUS.ON,null!=e.touches&&2===e.touches.length){this.pinchMove(e);return}var t=this.eventToPoint(e);if(null!==this.dragSheet&&!1!==this.drag3D&&Math.abs(t.x-this.startPoint.x)>2){!0!==this.isDragging&&(this.updatePendingStatusClass(!0),this.isDragging=!0);var i=this.dragSheet.width,n=t.x-(this.app.dimensions.origin.x+this.centerEnd-i),o=eU.limitAt(1-n/i,-1,1),s=eU.toDeg(Math.acos(o)),a=this.dragSheet,r=this.drag===p.TURN_DIRECTION.LEFT;a.sheetAngle=s;var l=eU.getCurveAngle(r,s,45);a.isCover&&a.viewer.flipCover(a),a.curveAngle=a.isHard?s:l,a.updateAngle()}this.checkSwipe(t,e)}},{key:"mouseUp",value:function(e){if((e=eU.fixMouseEvent(e)).touches||0===e.button){if(null==this.dragSheet&&null!=e.touches&&0===e.touches.length){this.pinchUp(e);return}var t=this.eventToPoint(e);if(1===this.app.zoomValue){if(null!==this.dragSheet){var i=t.x-this.startPoint.x;Math.abs(i)>2*this.swipeThreshold&&(this.drag===p.TURN_DIRECTION.LEFT&&i>0?this.app.openLeft():this.drag===p.TURN_DIRECTION.RIGHT&&i<0&&this.app.openRight()),this.requestRefresh(),this.updatePendingStatusClass()}var n=e.target||e.originalTarget,o=this.startPoint&&t.x===this.startPoint.x&&t.y===this.startPoint.y&&"A"!==n.nodeName;!0===e.ctrlKey&&o?this.zoomOnPoint(t):o&&t.sheet&&this.clickAction===p.MOUSE_CLICK_ACTIONS.NAV&&(t.sheet.sheetAngle>90?this.app.openRight():this.app.openLeft())}this.dragSheet=null,this.drag=null,!0===this.isDragging&&(this.isDragging=!1),this.startPoint=null,this.canSwipe=!1,this.app.renderRequestStatus=p.REQUEST_STATUS.ON}}},{key:"raycastCLick",value:function(e){this.mouse=new THREE.Vector2,this.raycaster=new THREE.Raycaster,this.mouse.x=e.offsetX/this.app.dimensions.stage.width*2-1,this.mouse.y=1-e.offsetY/this.app.dimensions.stage.height*2,this.raycaster.setFromCamera(this.mouse,this.camera);var t=this.raycaster.intersectObjects(this.bookWrapper.children,!0);if(t.length>0){var i,n=0;do{if((i=null!=t[n]?t[n].object:null).sheet&&i.sheet.index&&!0!==i.sheet.isFlipping)return i;n++}while(n<t.length)}}},{key:"mouseDown",value:function(e){if((e=eU.fixMouseEvent(e)).touches||0===e.button){if(null!=e.touches&&2===e.touches.length)this.pinchDown(e);else{e=eU.fixMouseEvent(e);var t=this.eventToPoint(e);this.startPoint=t,this.lastPosX=t.x,this.lastPosY=t.y;var i=this.raycastCLick(e),n=t.sheet?t.sheet.width-Math.abs(t.x-(this.app.dimensions.origin.x+this.centerEnd)):0;t.sheet&&i&&t.isInsideSheet&&n<t.sheet.width/2?(this.dragSheet=i.sheet,this.drag=t.sheet.sheetAngle<90?p.TURN_DIRECTION.LEFT:p.TURN_DIRECTION.RIGHT):this.canSwipe=!0}}}},{key:"eventToPoint",value:function(e){var t=this.app.dimensions,i={x:(e=eU.fixMouseEvent(e)).clientX,y:e.clientY};i.x=i.x-this.parentElement[0].getBoundingClientRect().left,i.y=i.y-this.parentElement[0].getBoundingClientRect().top;var n=(-t.offset.width+t.containerWidth)/2-t.stage.width/2,o=(-t.offset.width+t.containerWidth)/2+t.stage.width/2,s=t.padding.top,a=t.padding.top+this.availablePageHeight(),r=this.isVertical()?i.y<this.seamPositionY:i.x<this.seamPositionX,l=this.getBasePage()+(r?0:1),h=this.getPageByNumber(l);h&&(h=h.sheet);var u=i.x>n&&i.x<o&&i.y>s&&i.y<a;return{isInsideSheet:u,isInsideDragZone:u&&i.x-n<this.foldSense||o-i.x<this.foldSense,x:i.x,y:i.y,left:n,top:s,right:o,bottom:a,raw:i,isLeftSheet:r,sheet:h}}},{key:"checkPageLoading",value:function(){for(var e=!0,t=this.getVisiblePages().main,i=0;i<(this.isBooklet?1:2);i++){var n=this.getPageByNumber(t[i]);n&&(e=n.textureLoaded&&e)}this.element.toggleClass("df-loading",!e)}},{key:"textureLoadedCallback",value:function(e){this.app.renderRequestStart(),this.pagesReady()}},{key:"getTextureSize",value:function(e){var t=eM(eD(i.prototype),"getTextureSize",this).call(this,e);if(1!==this.app.zoomValue||!0===e.isAnnotation)return t;var n=eU.nearestPowerOfTwo(t.height),o=t.width*n/t.height;return this.texturePowerOfTwo?{height:n,width:o}:t}},{key:"getPageByNumber",value:function(e){if(this.has3DCover){var t=!this.isBooklet&&e===this.app.pageCount&&e%2==0,n=1===e;if(!this.isRTL&&n||this.isRTL&&t)return this.leftCover.frontPage;if(!this.isRTL&&t||this.isRTL&&n)return this.rightCover.backPage}return eM(eD(i.prototype),"getPageByNumber",this).call(this,e)}},{key:"setPage",value:function(e){return eM(eD(i.prototype),"setPage",this).call(this,e)}},{key:"beforeFlip",value:function(){eM(eD(i.prototype),"beforeFlip",this).call(this)}}]),i}(X),eW=/*#__PURE__*/function(e){ez(i,e);var t=eB(i);function i(e){eN(this,i);var n,o=e_(n=t.call(this,e));return o.element=null,o.face=e.face,o.parent3D=e.sheet,o.sheet=e.sheet,o.cssPage=new THREE.CSS3DObject(o.contentLayer[0]),n}return eI(i,[{key:"setLoading",value:function(){this.sheet.viewer.checkPageLoading()}},{key:"clearMap",value:function(){this.sheet.element.material[this.face].map=null,this.sheet.element.material[this.face].needsUpdate=!0}},{key:"loadTexture",value:function(e){var t=this,i=e.texture,n=e.callback;function o(i,o){t.updateTextureLoadStatus(!0),t.sheet.resetMatColor(t.face,e.texture===t.textureLoadFallback),"function"==typeof n&&n(e)}t.textureSrc=i,"function"==typeof p.defaults.beforeLoadTexture&&p.defaults.beforeLoadTexture({texture:i,page:t}),4===this.face?this.sheet.backImage(i,o):this.sheet.frontImage(i,o)}}]),i}(N);function eq(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function eG(e,t,i){return(eG="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=eZ(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(i||e):o.value}})(e,t,i||e)}function eZ(e){return(eZ=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function eK(e,t){return(eK=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var eX=p.jQuery,eQ=p.utils;ej.prototype.resizeAnnotations=function(e){var t=this.getAnnotationElement(e);if((!t||""===t.style.width)&&1===this.app.zoomValue){var i=this.getPageByNumber(e),n=X.prototype.getViewPort.call(this,e);if(i&&n){n=n.clone({dontFlip:!0});var o=e+"|"+this.rightSheetHeight,s=i.cssPage;if(s.lastStamp!==o){s.lastStamp=o;var a=i.sheet.element.geometry.boundingBox,r=Math.abs(a.max.x-a.min.x)*i.sheet.element.scale.x,l=this.getDoublePageWidthFix(e)*r/n.width,h=i.sheet.height/n.height,u=s.element.querySelectorAll("section");u.length>0&&u.forEach(function(e){e.style.transform="matrix("+l+", 0, 0, "+h+","+n.transform[4]*l+","+n.transform[5]*h+")"}),this.app.provider.processTextContent(e,this.getTextElement(e,!0))}}}},ej.prototype.finalizeAnnotations=function(e,t){X.prototype.finalizeAnnotations.call(this,e,t),this.resizeAnnotations(t)},ej.prototype.updateCSSLayer=function(){var e,t,i=this.getBasePage(),n=i+(this.isBooklet?0:this.isRTL?1:0),o=i+(this.isBooklet?0:this.isRTL?0:1),s=!this.isRTL&&this.isBooklet?void 0:this.getPageByNumber(n),a=this.isRTL&&this.isBooklet?void 0:this.getPageByNumber(o);eX(this.stage.cssRenderer.domElement).find(".df-page-content").css({display:"none"});var r=this.isVertical();if(this.leftViewport&&null!=s&&s.sheet.element.visible){var l=s.cssPage;if(null!=l){var h=s.sheet.element.geometry.boundingBox;e=Math.abs(h.max.x-h.min.x)*s.sheet.element.scale.x,t=Math.abs(h.max.y-h.min.y)*s.sheet.element.scale.y,l.rotation.y=0,l.position.z=0,l.position.x=0,eX(l.element).css({width:r?t:e,height:r?e:t,top:r?this.pageOffset+e/2:0,left:r?0:-this.pageOffset-e/2,display:"block"}),this.resizeAnnotations(n)}}if(this.rightViewPort&&null!=a&&a.sheet.element.visible){var u=a.cssPage;if(null!=u){var p=a.sheet.element.geometry.boundingBox;e=Math.abs(p.max.x-p.min.x)*a.sheet.element.scale.x,t=Math.abs(p.max.y-p.min.y)*a.sheet.element.scale.y,u.rotation.y=0,u.position.z=0,u.position.x=0,eX(u.element).css({width:r?t:e,height:r?e:t,top:r?-this.pageOffset-e/2:0,left:r?0:this.pageOffset+e/2,display:"block"}),this.resizeAnnotations(o)}}},ej.prototype.initSpiral=function(){if(this.app.pageCount<3&&(this.hasSpiral=!1),!0===this.hasSpiral){this.spirals=new THREE.Group,this.leftHoles=new THREE.Group,this.rightHoles=new THREE.Group,this.spiralGroup=new THREE.Group;var e,t=new THREE.TorusGeometry(30,2,6,20),i=new THREE.MeshPhongMaterial({color:null!==(e=this.app.options.spiralColor)&&void 0!==e?e:8947848}),n=new THREE.Mesh(t,i);n.castShadow=!0,n.rotateX(-THREE.MathUtils.degToRad(-90));for(var o=new THREE.Mesh(new THREE.BoxGeometry(8,15,5,1,1,1),new THREE.MeshPhongMaterial({color:4473924,shininess:0})),s=new THREE.Mesh(new THREE.BoxGeometry(8,15,5,1,1,1),new THREE.MeshPhongMaterial({color:4473924,shininess:0})),a=0;a<this.spiralCount;a++){var r=-467.5+935*a/this.spiralCount+935/this.spiralCount/2,l=n.clone();l.position.y=r-4,this.spirals.add(l),(l=n.clone()).position.y=r+4,this.spirals.add(l),(l=o.clone()).position.y=r,l.position.x=-28,this.leftHoles.add(l),(l=s.clone()).position.y=r,l.position.x=28,this.rightHoles.add(l)}this.spiralGroup.add(this.spirals),this.spiralGroup.add(this.leftHoles),this.spiralGroup.add(this.rightHoles),this.bookWrapper.add(this.spiralGroup),this.isVertical()&&this.spiralGroup.rotateZ(THREE.MathUtils.degToRad(-90)),this.spiralGroup.scale.set(.1,.1,.1)}},ej.prototype.set3DCoverNormal=function(){var e=this.app.options.cover3DType;if(e!==p.FLIPBOOK_COVER_TYPE.PLAIN){var t,i=e==p.FLIPBOOK_COVER_TYPE.RIDGE&&!this.isVertical();this.leftCover.fallbackMatColor=new THREE.Color("#f7f7f7"),this.rightCover.fallbackMatColor=new THREE.Color("#f7f7f7"),this.leftCover.setMatColor(this.color3DSheets,5),this.rightCover.setMatColor(this.color3DSheets,4);var n="rgb(127,127,255)",o=document.createElement("canvas");o.height=128,o.width=128;var s=o.getContext("2d");s.fillStyle=n,s.fillRect(0,0,128,128),(t=s.createLinearGradient(0,0,1.92,0)).addColorStop(0,n),t.addColorStop(1,"rgb(127,255,255)"),s.fillStyle=t,s.beginPath(),s.moveTo(0,0),s.lineTo(1.92,1.92),s.lineTo(1.92,126.08),s.lineTo(0,126.08),s.closePath(),s.fill(),i&&((t=s.createLinearGradient(1.92,0,7.68,0)).addColorStop(0,"rgb(127,127,255)"),t.addColorStop(.25,"rgb(255,127,255)"),t.addColorStop(.5,"rgb(0,127,255)"),t.addColorStop(.75,"rgb(127,127,255)"),t.addColorStop(1,"rgb(127,127,255)"),s.fillStyle=t,s.fillRect(1.92,0,7.68,128)),(t=s.createLinearGradient(0,1.92,0,0)).addColorStop(0,n),t.addColorStop(1,"rgb(127,255,255)"),s.fillStyle=t,s.beginPath(),s.moveTo(i?5.76:1.92,0),s.lineTo(128,0),s.lineTo(126.08,1.92),s.lineTo(i?7.68:1.92,1.92),s.closePath(),s.fill(),(t=s.createLinearGradient(126.08,0,128,0)).addColorStop(0,n),t.addColorStop(1,"rgb(255,127,255)"),s.fillStyle=t,s.beginPath(),s.moveTo(126.08,1.92),s.lineTo(128,0),s.lineTo(128,128),s.lineTo(126.08,126.08),s.closePath(),s.fill(),(t=s.createLinearGradient(0,126.08,0,128)).addColorStop(0,n),t.addColorStop(1,"rgb(127,0,255)"),s.fillStyle=t,s.beginPath(),s.moveTo(i?7.68:1.92,126.08),s.lineTo(126.08,126.08),s.lineTo(128,128),s.lineTo(i?5.76:1.92,128),s.closePath(),s.fill(),this.leftCover.element.loadNormalMap(o,eL.MATERIAL_FACE.FRONT);var a=document.createElement("canvas");a.height=128,a.width=128;var r=a.getContext("2d");r.fillStyle=n,r.fillRect(0,0,128,128),(t=r.createLinearGradient(126.08,0,128,0)).addColorStop(0,n),t.addColorStop(1,"rgb(255,127,255)"),r.fillStyle=t,r.beginPath(),r.moveTo(126.08,1.92),r.lineTo(128,0),r.lineTo(128,128),r.lineTo(126.08,126.08),r.closePath(),r.fill(),i&&((t=r.createLinearGradient(120.32,0,126.08,0)).addColorStop(0,"rgb(127,127,255)"),t.addColorStop(.25,"rgb(127,127,255)"),t.addColorStop(.5,"rgb(255,127,255)"),t.addColorStop(.75,"rgb(0,127,255)"),t.addColorStop(1,"rgb(127,127,255)"),r.fillStyle=t,r.fillRect(120.32,0,5.76,128)),(t=r.createLinearGradient(0,1.92,0,0)).addColorStop(0,n),t.addColorStop(1,"rgb(127,255,255)"),r.fillStyle=t,r.beginPath(),r.moveTo(0,0),r.lineTo(128-1.92*(i?3:0),0),r.lineTo(128-1.92*(i?4:1),1.92),r.lineTo(1.92,1.92),r.closePath(),r.fill(),(t=r.createLinearGradient(0,0,1.92,0)).addColorStop(0,n),t.addColorStop(1,"rgb(127,255,255)"),r.fillStyle=t,r.beginPath(),r.moveTo(0,0),r.lineTo(1.92,1.92),r.lineTo(1.92,126.08),r.lineTo(0,126.08),r.closePath(),r.fill(),(t=r.createLinearGradient(0,126.08,0,128)).addColorStop(0,n),t.addColorStop(1,"rgb(127,0,255)"),r.fillStyle=t,r.beginPath(),r.moveTo(1.92,126.08),r.lineTo(128-1.92*(i?4:1),126.08),r.lineTo(128-1.92*(i?3:0),128),r.lineTo(0,128),r.closePath(),r.fill(),this.rightCover.element.loadNormalMap(a,eL.MATERIAL_FACE.BACK)}},ej.prototype.setcolor3DCover=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";0==(e=e.trim()).indexOf("#")&&4===e.length&&(e=e.split("").map(function(e){return"#"==e?e:e+e}).join(""));var t=eQ.color.getBrightness(e);isNaN(t)&&(console.log("Improper Color code value. Needs a hex value! Using default 0.25"),t=.25);var i=(255-t)/255,n=1024,o=document.createElement("canvas");o.height=n,o.width=n;var s=o.getContext("2d");if(s.fillStyle=e,s.fillRect(0,0,n,n),s.strokeStyle="rgba(50,50,50,"+(i/2+.4)+")",s.strokeRect(.1*n,.05*n,n*(this.hasSpiral?.9:.85),.9*n),s.beginPath(),s.strokeStyle="rgba(50,50,50,"+(i/2+.3)+")",s.lineWidth=2,s.moveTo(0,0),s.lineTo(.1*n,.05*n),s.stroke(),s.beginPath(),s.strokeStyle="rgba(50,50,50,"+(i/2+.4)+")",s.moveTo(0,n),s.lineTo(.1*n,.95*n),s.stroke(),s.beginPath(),s.strokeStyle="rgba(255,255,255,0.3)",s.lineWidth=4,this.isVertical()?(s.moveTo(0,n),s.lineTo(n,n)):(s.moveTo(0,0),s.lineTo(0,n)),s.moveTo(0,0),s.lineTo(n,0),s.stroke(),s.beginPath(),s.strokeStyle="rgba(50,50,50,"+(i/2+.3)+")",s.lineWidth=4,this.isVertical()?(s.moveTo(0,0),s.lineTo(n,0)):(s.moveTo(0,n),s.lineTo(n,n)),s.stroke(),!1===this.hasSpiral){s.beginPath();var a=s.createLinearGradient(.95*n,0,n,0);a.addColorStop(0,"rgba(30,30,30,"+(i+.3)+")"),a.addColorStop(1,"rgba(60,60,60,"+(i+.3)+")"),s.fillStyle=a,s.fillRect(.95*n,0,.05*n,n),s.beginPath(),s.lineWidth=1,s.strokeStyle="rgba(40,40,40,"+(i+.3)+")";for(var r=0;r<17;r++)s.moveTo(n-3*r,0),s.lineTo(n-3*r,n);s.stroke()}else s.beginPath(),s.strokeStyle="rgba(50,50,50,0.2)",s.lineWidth=4,s.moveTo(n,0),s.lineTo(n,n),s.stroke();this.leftCover.backImage(o);var l=document.createElement("canvas");l.height=n,l.width=n;var h=l.getContext("2d");if(h.fillStyle=e,h.fillRect(0,0,n,n),h.strokeStyle="rgba(50,50,50,"+(i/2+.5)+")",h.strokeRect(n*(this.hasSpiral?0:.05),.05*n,n*(this.hasSpiral?.9:.85),.9*n),h.beginPath(),h.strokeStyle="rgba(50,50,50,"+(i/2+.3)+")",h.lineWidth=2,h.moveTo(n,0),h.lineTo(.9*n,.05*n),h.stroke(),h.beginPath(),h.strokeStyle="rgba(50,50,50,"+(i/2+.5)+")",h.moveTo(n,n),h.lineTo(.9*n,.95*n),h.stroke(),h.beginPath(),h.strokeStyle="rgba(255,255,255,0.3)",h.lineWidth=4,this.isVertical()?(h.moveTo(0,n),h.lineTo(n,n)):(h.moveTo(0,0),h.lineTo(n,0)),h.stroke(),h.beginPath(),h.strokeStyle="rgba(50,50,50,"+(i/2+.3)+")",h.lineWidth=4,h.moveTo(n,0),h.lineTo(n,n),this.isVertical()?(h.moveTo(0,0),h.lineTo(n,0)):(h.moveTo(0,n),h.lineTo(n,n)),h.stroke(),!1===this.hasSpiral){h.beginPath();var u=h.createLinearGradient(0,0,.05*n,0);u.addColorStop(0,"rgba(0,0,0,"+(i+.3)+")"),u.addColorStop(.2,"rgba(10,10,10,"+(i+.3)+")"),u.addColorStop(1,"rgba(80,80,80,"+(i+.3)+")"),h.fillStyle=u,h.fillRect(0,0,.05*n,n),h.beginPath(),h.lineWidth=1,h.strokeStyle="rgba(40,40,40,"+(i+.3)+")";for(var c=0;c<17;c++)h.moveTo(3*c,0),h.lineTo(3*c,n);h.stroke()}else h.beginPath(),h.strokeStyle="rgba(255,255,255,0.2)",h.lineWidth=4,h.moveTo(0,0),h.lineTo(0,n),h.stroke();this.rightCover.frontImage(l);var d=document.createElement("canvas");n=128,d.height=n,d.width=n;var f=d.getContext("2d");f.fillStyle="#ffffff",f.fillRect(0,0,n,n),f.strokeStyle="#cccccc",f.lineWidth=1;for(var g=0;g<n/4;g++)f.moveTo(4*g,0),f.lineTo(4*g,n);f.stroke(),this.leftSheets.element.loadImage(d,1,null),this.rightSheets.element.loadImage(d,3,null),this.app.renderRequestStatus=p.REQUEST_STATUS.ON},ej.prototype.refreshSpiral=function(){if(!0===this.hasSpiral){var e=this.midPosition+this.sheetDepth;this.bookWrapper.children.forEach(function(t){t&&t.sheetAngle&&t.position.z+t.depth/2>e&&(e=t.position.z+t.depth/2)}),this.leftHoles.visible=this.isBooklet?this.isRTL:!1==this.isLeftClosed&&!1==this.leftCover.isFlipping,this.rightHoles.visible=this.isBooklet?!this.isRTL:!1==this.isRightClosed&&!1==this.rightCover.isFlipping;var t=this.isVertical()?Math.max(this.leftHoles.visible?this.leftSheetWidth:0,this.rightHoles.visible?this.rightSheetWidth:0):Math.max(this.leftHoles.visible?this.leftSheetHeight:0,this.rightHoles.visible?this.rightSheetHeight:0);t/=1e3,this.leftHoles.position.z=this.rightHoles.position.z=e+2/t+(this.isClosedPage()?2*this.leftCover.depth:0)/t,this.spiralGroup.scale.set(t,t,t)}};var eY=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&eK(e,t)}(o,e);var t,i,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=eZ(o);return e=t?Reflect.construct(i,arguments,eZ(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this)});function o(e,t){return eq(this,o),e.flipbook3DTiltAngleUp=0,e.flipbook3DTiltAngleLeft=0,e.hasSpiral=!1,e.flexibility=0,(e.cover3DType===p.FLIPBOOK_COVER_TYPE.RIDGE||e.cover3DType===p.FLIPBOOK_COVER_TYPE.BASIC)&&(e.cover3DType=p.FLIPBOOK_COVER_TYPE.PLAIN),n.call(this,e,t)}return i=[{key:"init",value:function(){eG(eZ(o.prototype),"init",this).call(this),this.texturePowerOfTwo=!1,this.app.container.addClass("df-hybrid-viewer df-pending")}},{key:"getAnnotationElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return eG(eZ(o.prototype),"getAnnotationElement",this).call(this,e,t,!0)}},{key:"getTextElement",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return eG(eZ(o.prototype),"getTextElement",this).call(this,e,t,!0)}},{key:"isAnimating",value:function(){return this.isFlipping()}},{key:"onCenterStartAnimation",value:function(e){this.app.container.addClass("df-hide-zoomview")}},{key:"onCenterStopAnimation",value:function(e){this.finalizeCenterAnimation()}},{key:"onCenterCompleteAnimation",value:function(e){this.zoomViewer.updateCenter(),this.finalizeCenterAnimation()}},{key:"finalizeCenterAnimation",value:function(){this.app.container.removeClass("df-hide-zoomview")}},{key:"afterFlip",value:function(){arguments.length>0&&void 0!==arguments[0]&&arguments[0],!0!==this.isAnimating()&&(this.pagesReady(),this.updatePendingStatusClass(),this.updateZoomViewerTexture({pageNumber:this.getBasePage()}),this.updateZoomViewerTexture({pageNumber:this.getBasePage()+1}))}},{key:"exchangeTexture",value:function(e,t){this.skipCenterAnimation=!0,eG(eZ(o.prototype),"exchangeTexture",this).call(this,e,t),this.updateZoomViewerTextContent({pageNumber:this.getBasePage()}),this.updateZoomViewerTextContent({pageNumber:this.getBasePage()+1})}},{key:"updateZoomViewerTexture",value:function(e){var t=this.zoomViewer.getPageByNumber(e.pageNumber);t&&"-1"===t.textureStamp&&this.zoomViewer.setPage({pageNumber:t.pageNumber,texture:this.getPageByNumber(t.pageNumber).getTexture()})&&this.updateZoomViewerTextContent(e)}},{key:"updateZoomViewerTextContent",value:function(e){this.app.provider.processAnnotations(e.pageNumber,this.app.viewer.getAnnotationElement(e.pageNumber,!0)),this.app.provider.processTextContent(e.pageNumber,this.app.viewer.getTextElement(e.pageNumber,!0))}},{key:"textureLoadedCallback",value:function(e){this.app.renderRequestStart(),this.updateZoomViewerTexture(e),this.pagesReady()}},{key:"resizeAnnotations",value:function(e){}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(o.prototype,i),o}(ej);function eJ(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function e$(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function e0(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function e1(e,t,i){return t&&e0(e.prototype,t),i&&e0(e,i),e}function e2(e){return(e2=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function e5(e,t){return(e5=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function e3(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}X.prototype.isVertical=function(){return!0===this.app.options.calendarMode},x.prototype.afterConstructor=function(){!0===this.app.options.calendarMode&&this.element.addClass("df-vertical")},p.viewers=p.viewers||{},p.viewers.flipbook=function e(t,i){return(eq(this,e),(!1==p.utils.canSupport3D()||void 0===t.is3D)&&(t.is3D=!1),"flat3D"===t.is3D)?(t.flexibility=0,new eY(t,i)):eQ.isTrue(t.is3D)?new ej(t,i):new eu(t,i)},p.viewers.default=p.viewers.reader=F,p.viewers.slider=eP;var e8=p.jQuery,e9=p.utils,e4=/*#__PURE__*/function(){function e(){e$(this,e),this.baseUrl=null,this.pdfDocument=null,this.pdfApp=null,this.pdfHistory=null,this.externalLinkRel=null,this.externalLinkEnabled=!0,this._pagesRefCache=null}return e1(e,[{key:"dispose",value:function(){this.baseUrl=null,this.pdfDocument=null,this.pdfApp=null,this.pdfHistory=null,this._pagesRefCache=null}},{key:"setDocument",value:function(e,t){this.baseUrl=t,this.pdfDocument=e,this._pagesRefCache=Object.create(null)}},{key:"setViewer",value:function(e){this.pdfApp=e,this.externalLinkTarget=e.options.linkTarget}},{key:"setHistory",value:function(e){this.pdfHistory=e}},{key:"pagesCount",get:function(){return this.pdfDocument.numPages}},{key:"page",get:function(){return this.pdfApp.currentPageNumber},set:function(e){this.pdfApp.gotoPage(e)}},{key:"navigateTo",value:function(e){this.goToDestination(e)}},{key:"addLinkAttributes",value:function(e,t){arguments.length>2&&void 0!==arguments[2]&&arguments[2];var i=this.externalLinkTarget,n=this.externalLinkRel,o=this.externalLinkEnabled;if(!t||"string"!=typeof t)throw Error('A valid "url" parameter must provided.');var s=(0,e9.removeNullCharacters)(t);o?e.href=e.title=s:(e.href="",e.title="Disabled: ".concat(s),e.onclick=function(){return!1});var a="";switch(i){case p.LINK_TARGET.NONE:break;case p.LINK_TARGET.SELF:a="_self";break;case p.LINK_TARGET.BLANK:a="_blank";break;case p.LINK_TARGET.PARENT:a="_parent";break;case p.LINK_TARGET.TOP:a="_top"}e.target=a,e.rel="string"==typeof n?n:"noopener noreferrer nofollow"}},{key:"goToDestination",value:function(e){var t,i="",n=this,o=function(t){e9.log("Requested: ",t);var s=t instanceof Object?n._pagesRefCache[t.num+" "+t.gen+" R"]:t+1;s?((s=n.pdfApp.viewer.getViewerPageNumber(s))>n.pdfApp.pageCount&&(s=n.pdfApp.pageCount),e9.log("Loading for:",t," at page ",s),n.pdfApp.requestDestRefKey===t.num+" "+t.gen+" R"?(n.pdfApp.gotoPage(s),n.pdfHistory&&n.pdfHistory.push({dest:e,hash:i,page:s})):e9.log("Expired Request for ",s," with ",t)):(n.pdfApp.container.addClass("df-fetch-pdf"),n.pdfDocument.getPageIndex(t).then(function(e){var i=t.num+" "+t.gen+" R";n._pagesRefCache[i]=e+1,o(t)}))};"string"==typeof e?(i=e,t=this.pdfDocument.getDestination(e)):t=Promise.resolve(e),t.then(function(t){e9.log("Started:",t),e=t,t instanceof Array&&(n.pdfApp.requestDestRefKey=t[0].num+" "+t[0].gen+" R",o(t[0]))})}},{key:"customNavigateTo",value:function(e){if(""!==e&&null!=e&&"null"!==e){var t=null;if(isNaN(Math.floor(e))){if("string"==typeof e&&isNaN(t=parseInt(e.replace("#",""),10))){window.open(e,this.pdfApp.options.linkTarget===p.LINK_TARGET.SELF?"_self":"_blank");return}}else t=e;null!=t&&this.pdfApp.gotoPage(t)}}},{key:"getDestinationHash",value:function(e){if("string"==typeof e)return this.getAnchorUrl("#"+escape(e));if(e instanceof Array){var t=e[0],i=t instanceof Object?this._pagesRefCache[t.num+" "+t.gen+" R"]:t+1;if(i){var n=this.getAnchorUrl("#page="+i),o=e[1];if((void 0===o?"undefined":e3(o))==="object"&&"name"in o&&"XYZ"===o.name){var s=e[4]||this.pdfApp.pageScaleValue,a=parseFloat(s);a&&(s=100*a),n+="&zoom="+s,(e[2]||e[3])&&(n+=","+(e[2]||0)+","+(e[3]||0))}return n}}return this.getAnchorUrl("")}},{key:"getCustomDestinationHash",value:function(e){return"#"+escape(e)}},{key:"getAnchorUrl",value:function(e){return(this.baseUrl||"")+e}},{key:"executeNamedAction",value:function(e){switch(e){case"GoBack":this.pdfHistory&&this.pdfHistory.back();break;case"GoForward":this.pdfHistory&&this.pdfHistory.forward();break;case"NextPage":this.page++;break;case"PrevPage":this.page--;break;case"LastPage":this.page=this.pagesCount;break;case"FirstPage":this.page=1}var t=document.createEvent("CustomEvent");t.initCustomEvent("namedaction",!0,!0,{action:e}),this.pdfApp.container.dispatchEvent(t)}},{key:"cachePageRef",value:function(e,t){var i=t.num+" "+t.gen+" R";this._pagesRefCache[i]=e}}]),e}(),e7=/*#__PURE__*/function(){function e(t,i){e$(this,e),this.props=t,this.app=i,this.textureCache=[],this.pageCount=0,this.numPages=0,this.outline=[],this.viewPorts=[],this.requestedPages="",this.requestIndex=0,this.pagesToClean=[],this.defaultPage=void 0,this.pageSize=this.app.options.pageSize,this._page1Pass=!1,this._page2Pass=!1,this.pageLabels=void 0,this.textSearchLength=0,this.textSearch="",this.textContentSearch=[],this.textContentJoinedSearch=[],this.textOffsetSearch=[],this.textContent=[],this.textContentJoined=[],this.textOffset=[],this.autoLinkItemsCache=[],this.autoLinkHitsCache=[],this.searchHitItemsCache=[],this.searchHits=[],this.PDFLinkItemsCache=[],this.canPrint=!0,this.textPostion=[]}return e1(e,[{key:"finalize",value:function(){}},{key:"dispose",value:function(){}},{key:"softDispose",value:function(){}},{key:"setCache",value:function(e,t,i){i&&(void 0===this.textureCache[i]&&(this.textureCache[i]=[]),this.textureCache[i][e]=t)}},{key:"getCache",value:function(e,t){return void 0===this.textureCache[t]?void 0:this.textureCache[t][e]}},{key:"_isValidPage",value:function(e){return e>0&&e<=this.pageCount}},{key:"getLabelforPage",value:function(e){return this.pageLabels&&void 0!==this.pageLabels[e-1]?this.pageLabels[e-1]:e}},{key:"getThumbLabel",value:function(e){var t=this.getLabelforPage(e);return t!==e?t+" ("+e+")":e}},{key:"getPageNumberForLabel",value:function(e){if(!this.pageLabels)return e;var t=this.pageLabels.indexOf(e);return t<0?null:t+1}},{key:"processPage",value:function(e){}},{key:"cleanUpPages",value:function(){}},{key:"checkRequestQueue",value:function(){}},{key:"processAnnotations",value:function(){}},{key:"processTextContent",value:function(){}},{key:"loadDocument",value:function(){}},{key:"pagesLoaded",value:function(){this._page1Pass&&this._page2Pass&&(this.app.viewer.checkDocumentPageSizes(),this.finalize())}},{key:"_documentLoaded",value:function(){this.finalizeOutLine(),this.app&&this.app.dimensions&&void 0===this.app.dimensions.pageFit&&e9.log("Provider needs to initialize page properties for the app"),this.app._documentLoaded()}},{key:"finalizeOutLine",value:function(){if(null!==this.app&&null!==this.app.options){var e=this.app.options.outline;if(e)for(var t=0;t<e.length;t++)e[t].custom=!0,e[t].dest=e[t].dest.replace(/javascript:/g,""),this.outline.push(e[t])}}},{key:"search",value:function(){}}]),e}(),e6=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&e5(e,t)}(o,e);var t,n=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=e2(o);return e=t?Reflect.construct(i,arguments,e2(this).constructor):i.apply(this,arguments),e&&("object"===e3(e)||"function"==typeof e)?e:eJ(this)});function o(e,t){e$(this,o);var s,a,r=function(e){l.updateInfo(l.options.text.loading+" PDF Worker ...");var t=document.createElement("a");t.href=l.options.pdfjsWorkerSrc+h.cacheBustParameters,t.hostname!==window.location.hostname&&!0===p.loadCorsPdfjsWorker?(l.updateInfo(l.options.text.loading+" PDF Worker CORS ..."),e8.ajax({url:l.options.pdfjsWorkerSrc+h.cacheBustParameters,cache:!0,success:function(t){l.options.pdfjsWorkerSrc=e9.createObjectURL(t,"text/javascript"),"function"==typeof e&&e()}})):"function"==typeof e&&e()},l=(s=n.call(this,e,t)).app,h=eJ(s);return h.pdfDocument=void 0,h._page2Ratio=void 0,h.cacheBustParameters="?ver="+p.version+"&pdfver="+l.options.pdfVersion,a=function(){pdfjsLib.GlobalWorkerOptions.workerSrc=l.options.pdfjsWorkerSrc+h.cacheBustParameters,pdfjsLib.canvasWillReadFrequently=p.defaults.canvasWillReadFrequently,h.loadDocument()},"undefined"==typeof pdfjsLib?(l.updateInfo(l.options.text.loading+" PDF Service ..."),e9.getScript(l.options.pdfjsSrc+h.cacheBustParameters,function(){"function"==typeof define&&i.amdO&&window.requirejs&&window.require&&window.require.config?(l.updateInfo(l.options.text.loading+" PDF Service (require) ..."),window.require.config({paths:{"pdfjs-dist/build/pdf.worker":l.options.pdfjsWorkerSrc.replace(".js","")}}),window.require(["pdfjs-dist/build/pdf"],function(e){window.pdfjsLib=e,r(a)})):r(a)},function(){l.updateInfo("Unable to load PDF service.."),h.dispose()},l.options.pdfjsSrc.indexOf("pdfjs-4")>1)):"function"==typeof a&&a(),s}return e1(o,[{key:"dispose",value:function(){this.pdfDocument&&this.pdfDocument.destroy(),this.linkService=e9.disposeObject(this.linkService),this.pdfLoadProgress&&this.pdfLoadProgress.destroy(),this.pdfLoadProgress=null,this.pdfDocument=null}},{key:"loadDocument",value:function(){var e=this.app,t=this.app.options,i=this,n=t.pdfParameters||{};if(n.url=e9.httpsCorrection(n.url||t.source),n.rangeChunkSize=t.rangeChunkSize,n.cMapPacked=!0,n.disableAutoFetch=t.disableAutoFetch,n.disableStream=t.disableStream,n.disableRange=!0===t.disableRange,n.disableFontFace=t.disableFontFace,n.isEvalSupported=!1,n.cMapUrl=t.cMapUrl,n.imagesLocation=t.imagesLocation,n.imageResourcesPath=t.imageResourcesPath,!n.url&&!n.data&&!n.range){e.updateInfo("ERROR : No PDF File provided! ","df-error");return}var o=i.pdfLoadProgress=pdfjsLib.getDocument(n);o._worker.promise.then(function(t){e.updateInfo(e.options.text.loading+" PDF ...")}),o.onPassword=function(e,t){switch(t){case pdfjsLib.PasswordResponses.NEED_PASSWORD:var i=prompt("Enter the password to open the PDF file.");if(null===i)throw Error("No password givsen.");e(i);break;case pdfjsLib.PasswordResponses.INCORRECT_PASSWORD:var i=prompt("Invalid password. Please try again.");if(!i)throw Error("No password givaen.");e(i)}},o.promise.then(function(n){i.pdfDocument=n,n.getPage(1).then(function(o){i.defaultPage=o;var s,a=i.defaultPage.viewPort=o.getViewport({scale:1,rotation:o._pageInfo.rotate+e.options.pageRotation}),r=i.defaultPage.pageRatio=a.width/a.height;i.viewPorts[1]=a,e.dimensions.defaultPage={ratio:r,viewPort:a,width:a.width,height:a.height},e.dimensions.maxTextureHeight=(null!==(s=t.maxTextureSize)&&void 0!==s?s:3200)/(r>1?r:1),e.dimensions.maxTextureWidth=e.dimensions.maxTextureHeight*r,e.dimensions.autoHeightRatio=1/r,i.pageCount=n.numPages,i.numPages=n.numPages,i._page1Pass=!0,i.pagesLoaded()}),n.numPages>1&&!0===e.checkSecondPage?n.getPage(2).then(function(t){var n=t.getViewport({scale:1,rotation:t._pageInfo.rotate+e.options.pageRotation});i._page2Ratio=n.width/n.height,i.viewPorts[2]=n,i._page2Pass=!0,i.pagesLoaded()}):(i._page2Pass=!0,i.pagesLoaded())}).catch(function(t){if(null!==e&&null!=e.options){var n,o="",s=document.createElement("a");s.href=e.options.source,s.hostname===window.location.hostname||-1!==s.href.indexOf("file://")||e9.isChromeExtension()||-1!==s.href.indexOf("blob:")||(o="<strong>CROSS ORIGIN!! </strong>");var a=(null===(n=e.options)||void 0===n?void 0:n.fileName)||s.href;e.updateInfo(o+"<strong>Error: Cannot access file!  </strong>"+a+"<br><br>"+t.message,"df-error"),console.log(t),e.container.removeClass("df-loading").addClass("df-error"),i.dispose()}}),o.getTotalLength=function(){return i.pdfLoadProgress._transport._networkStream._fullRequestReader.contentLength},o.onProgress=function(t){if(null!==e){var i=100*t.loaded/o.getTotalLength();isNaN(i)?t&&t.loaded?(void 0===o.lastLoaded||o.lastLoaded+25e4<t.loaded)&&(o.lastLoaded=t.loaded,e.updateInfo(e.options.text.loading+" PDF "+(Math.ceil(t.loaded/1e4)/100).toFixed(2).toString()+"MB ...")):e.updateInfo(e.options.text.loading+" PDF ..."):e.updateInfo(e.options.text.loading+" PDF "+Math.ceil(Math.min(100,i)).toString().split(".")[0]+"% ...")}}}},{key:"pdfFetchStarted",value:function(){this.pdfFetchStatusCount=0,this.app.container.addClass("df-fetch-pdf"),this.pdfFetchStatus=p.REQUEST_STATUS.COUNT}},{key:"checkRequestQueue",value:function(){}},{key:"finalize",value:function(){var e=this.app,t=this;null!==e&&null!==e.options&&(t.linkService=new e4,t.linkService.setDocument(t.pdfDocument,null),t.linkService.setViewer(e),t.pdfDocument.getOutline().then(function(i){!0===e.options.overwritePDFOutline&&(i=[]),i=i||[],t.outline=i}).finally(function(){t._getLabels()}))}},{key:"_getLabels",value:function(){var e=this.app,t=this;t.pdfDocument.getPageLabels().then(function(i){if(i&&!0!==e.options.disablePageLabels){for(var n=i.length,o=0,s=0,a=0;a<n;a++){var r=i[a];if(r===(a+1).toString())o++;else if(""===r)s++;else break}o>=n||s>=n||(t.pageLabels=i)}}).finally(function(){t._getPermissions()})}},{key:"_getPermissions",value:function(){var e=this.app,t=this;t.pdfDocument.getPermissions().then(function(i){null!==i&&Array.isArray(i)&&(t.canPrint=i.indexOf(pdfjsLib.PermissionFlag.PRINT)>-1,!1==t.canPrint&&(console.log("PDF printing is disabled."),e.options.showPrintControl=e.options.showPrintControl&&t.canPrint))}).finally(function(){t._documentLoaded()})}},{key:"processPage",value:function(e){var t=this.app,i=this,n=e.pageNumber,o=performance.now(),s="",a=t.viewer.getTextureSize(e);if(!0===DEARFLIP.defaults.cachePDFTexture&&void 0!==this.getCache(n,a.height)){t.applyTexture(this.getCache(n,a.height),e),e9.log("Texture loaded from cache for : "+n);return}var r=t.viewer.getDocumentPageNumber(n);e9.log("Requesting PDF Page:"+r),i.pdfDocument.getPage(r).then(function(l){i.viewPorts[n]||(e.isFreshPage=!0,i.viewPorts[n]=l.getViewport({scale:1,rotation:l._pageInfo.rotate+t.options.pageRotation}));var h,u=t.viewer.getRenderContext(l,e);i.viewPorts[n].lastScale=u.viewport.scale,i.viewPorts[n].lastHeight=u.canvas.height,e.isFreshPage&&(null===(h=t.viewer.getPageByNumber(e.pageNumber))||void 0===h||h.changeTexture(e.pageNumber,u.canvas.height)),s=u.canvas.width+"x"+u.canvas.height,e9.log("Page "+n+" rendering - "+s),e.trace=i.requestIndex++,i.requestedPages+=","+e.trace+"["+r+"|"+u.canvas.height+"]",l.cleanupAfterRender=!1,l.render(u).promise.then(function(){if(t.applyTexture(u.canvas,e),!0===DEARFLIP.defaults.cachePDFTexture&&i.setCache(e.pageNumber,u.canvas,a.height),!0===t.options.cleanupAfterRender){var h=","+e.trace+"["+r+"|"+u.canvas.height+"]";i.requestedPages.indexOf(h)>-1&&(i.requestedPages=i.requestedPages.replace(h,""),-1==i.requestedPages.indexOf("["+r+"|")&&(i.pagesToClean.push(l),i.pagesToClean.length>0&&i.cleanUpPages()))}u=null,e9.log("Rendered "+n+" in "+Math.floor(performance.now()-o)+" ms : "+s)}).catch(function(e){console.log(e)})}).catch(function(e){console.log(e)})}},{key:"cleanUpPages",value:function(){for(;this.pagesToClean.length>0;)this.pagesToClean.splice(-1)[0].cleanup()}},{key:"clearSearch",value:function(){this.searchHits=[],this.searchHitItemsCache=[],this.totalHits=0,this.app.searchResults.html(""),this.app.container.removeClass("df-search-open"),this.textSearch="",this.app.container.find(".df-search-hits").remove()}},{key:"search",value:function(e){if(this.textSearch!==e){if(this.clearSearch(),e.length<3&&""!=e){this.app.updateSearchInfo("Minimum 3 letters required.");return}this.textSearch=e,this.textSearchLength=e.length,this.app.searchContainer.addClass("df-searching"),this.app.container.addClass("df-fetch-pdf"),this._search(e,1)}}},{key:"_search",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=this;i.app.updateSearchInfo("Searching Page: "+t),i.searchPage(t).then(function(n){for(var o,s=RegExp(e,"gi"),a=[];o=s.exec(n);)a.push({index:o.index,length:i.textSearchLength});if(i.searchHits[t]=a,a.length>0){var r=i.app.viewer.searchPage(t);!0===r.include&&(i.totalHits+=a.length,i.app.searchResults.append('<div class="df-search-result '+(i.app.currentPageNumber===t?"df-active":"")+'" data-df-page="'+t+'"><span>Page '+r.label+"</span><span>"+a.length+" "+(a.length>1?"results":"result")+"</span></div>"))}i.app.viewer.isActivePage(t)&&(i.processTextContent(t,i.app.viewer.getTextElement(t,!0)),i.app.ui.update()),i._search(e,t+1)}).catch(function(){}).finally(function(){0==i.totalHits?i.app.updateSearchInfo("No results Found!"):i.app.updateSearchInfo(i.totalHits+" results found"),i.app.searchContainer.removeClass("df-searching"),i.app.container.removeClass("df-fetch-pdf")})}},{key:"prepareTextContent",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=this;if(void 0==n.textContentJoinedSearch[t]||i){var o,n=this,s=0,a=0,r=0;n.textContentSearch[t]=[],n.textContent[t]=[],n.textOffsetSearch[t]=[],n.textOffset[t]=[],n.textContentJoinedSearch[t]=[],n.textContentJoined[t]=[];for(var l=0;l<e.items.length;l++)o=e.items[l],n.textContentSearch[t].push(!0===o.hasEOL?o.str+" ":o.str),n.textContent[t].push(o.str+" "),a+=r=(o.str.length||0)+(!0===o.hasEOL?1:0),n.textOffsetSearch[t].push({length:r,offset:a-r}),s+=r=(o.str.length||0)+1,n.textOffset[t].push({length:r,offset:s-r});n.textContentJoinedSearch[t]=n.textContentSearch[t].join(""),n.textContentJoined[t]=n.textContent[t].join("")}}},{key:"searchPage",value:function(e){var t=this;return new Promise(function(i,n){if(t._isValidPage(e))try{var o=t.app.viewer.getDocumentPageNumber(e);void 0==t.textContentJoinedSearch[o]?t.pdfDocument.getPage(o).then(function(e){e.getTextContent().then(function(e){t.prepareTextContent(e,o),i(t.textContentJoinedSearch[o])})}):i(t.textContentJoinedSearch[o])}catch(e){e9.log(e),n(e)}else n()})}}]),o}(e7);function te(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tt(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function ti(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tn(e,t,i){return t&&ti(e.prototype,t),i&&ti(e,i),e}function to(e){return(to=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ts(e,t){return(ts=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}p.providers.pdf=e6;var ta=p.jQuery,tr=p.utils,tl=/*#__PURE__*/function(){function e(t){tt(this,e),this._viewPort=new tu(0,0),this._pageInfo={rotate:0},this.src=t.src}return tn(e,[{key:"getViewport",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{scale:1};return new tu(this._viewPort.height*e.scale,this._viewPort.width*e.scale,e.scale)}}]),e}(),th=/*#__PURE__*/function(){function e(t){tt(this,e),this.source=[],this.pages=[],this.numPages=t.length;for(var i=0;i<t.length;i++)this.source[i]=tr.httpsCorrection(t[i].toString()),this.pages.push(new tl({src:this.source[i]}))}return tn(e,[{key:"getPage",value:function(e){var t=this;return new Promise(function(i,n){try{var o=ta("<img/>");o.attr("src",t.source[e-1]),o[0].crossOrigin="Anonymous",o.on("load",function(){ta(this).off();var e=new tl({src:this.src});e._viewPort.height=this.height,e._viewPort.width=this.width,e._viewPort.scale=1,e.image=this,i(e)})}catch(e){n(e)}})}}]),e}(),tu=/*#__PURE__*/function(){function e(t,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;tt(this,e),this.scale=n,this.height=t,this.width=i,this.scale=n,this.transform=[0,0,0,0,0,this.height]}return tn(e,[{key:"clone",value:function(){return new e(this.height,this.width,this.scale)}}]),e}(),tp=/*#__PURE__*/function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ts(e,t)}(n,e);var t,i=(t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}(),function(){var e,i=to(n);return e=t?Reflect.construct(i,arguments,to(this).constructor):i.apply(this,arguments),e&&("object"==(e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e)||"function"==typeof e)?e:te(this)});function n(e,t){tt(this,n);var o,s=(o=i.call(this,e,t)).app,a=te(o);return a.document=new th(s.options.source),a.pageCount=a.document.numPages,a.numPages=a.document.numPages,a.loadDocument(),o}return tn(n,[{key:"dispose",value:function(){}},{key:"loadDocument",value:function(){var e=this.app,t=this.app.options,i=this;i.document.getPage(1).then(function(n){i.defaultPage=n;var o,s=i.defaultPage.viewPort=n._viewPort,a=i.defaultPage.pageRatio=s.width/s.height;i.viewPorts[1]=s,e.dimensions.defaultPage={ratio:a,viewPort:s,width:s.width,height:s.height},e.dimensions.maxTextureHeight=(null!==(o=t.maxTextureSize)&&void 0!==o?o:3200)/(a>1?a:1),e.dimensions.maxTextureWidth=e.dimensions.maxTextureHeight*a,e.dimensions.autoHeightRatio=1/a,i._page1Pass=!0,i.pagesLoaded()}),i.pageCount>1&&!0===e.checkSecondPage?i.document.getPage(2).then(function(e){var t=e._viewPort;i._page2Ratio=t.width/t.height,i.viewPorts[2]=t,i._page2Pass=!0,i.pagesLoaded()}):(i._page2Pass=!0,i.pagesLoaded())}},{key:"finalize",value:function(){var e=this.app;null!==e&&null!==e.options&&(this.linkService=new e4,this.linkService.setViewer(e),this._documentLoaded())}},{key:"processPage",value:function(e){var t=this.app,i=this,n=e.pageNumber,o=performance.now(),s=t.viewer.getDocumentPageNumber(n);tr.log("Requesting PDF Page:"+s),i.document.getPage(s).then(function(s){i.viewPorts[n]||(e.isFreshPage=!0,i.viewPorts[n]=s._viewPort);var a,r,l=t.viewer.getRenderContext(s,e);(e.isFreshPage&&(null===(a=t.viewer.getPageByNumber(e.pageNumber))||void 0===a||a.changeTexture(e.pageNumber,l.canvas.height)),e.preferCanvas=!0,!0===e.preferCanvas)?(l.canvas.getContext("2d").drawImage(s.image,l.viewport.transform[4],0,l.canvas.width*(null!==(r=l.viewport.widthFix)&&void 0!==r?r:1),l.canvas.height),t.applyTexture(l.canvas,e)):t.applyTexture({src:s.src,height:l.canvas.height,width:l.canvas.width},e),tr.log("Rendered "+n+" in "+(performance.now()-o)+" milliseconds")})}}]),n}(e7);function tc(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function td(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function tf(e,t,i){return t&&td(e.prototype,t),i&&td(e,i),e}function tg(e){return e&&"undefined"!=typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}p.providers.image=tp,i(795);var tv=p.jQuery,tm=p.utils,ty=p.REQUEST_STATUS,tb=/*#__PURE__*/function(){function e(t,i){tc(this,e),this.options=t,this.app=i,this.parentElement=this.app.container,this.element=tv("<div>",{class:"df-ui"}),this.leftElement=tv("<div>",{class:"df-ui-left"}).appendTo(this.element),this.centerElement=tv("<div>",{class:"df-ui-center"}).appendTo(this.element),this.rightElement=tv("<div>",{class:"df-ui-right"}).appendTo(this.element),this.parentElement.append(this.element),this.events={},this.controls={}}return tf(e,[{key:"init",value:function(){var e=this,t="<div>",i=this.app,n=this.controls,o=i.options.text,s=i.options.icons;e.createLogo(),this.openRight=n.openRight=tv(t,{class:"df-ui-nav df-ui-next",title:i.isRTL?o.previousPage:o.nextPage,html:'<div class="df-ui-btn '+s.next+'"></div>'}).on("click",function(){i.openRight()}),this.openLeft=n.openLeft=tv(t,{class:"df-ui-nav df-ui-prev",title:i.isRTL?o.nextPage:o.previousPage,html:'<div class="df-ui-btn '+s.prev+'"></div>'}).on("click",function(){i.openLeft()}),!0==i.options.autoPlay&&(this.play=n.play=tm.createBtn("play",s.play,o.play).on("click",function(){var e=tv(this);i.setAutoPlay(!e.hasClass(i.options.icons.pause))}),i.setAutoPlay(i.options.autoPlayStart)),this.pageNumber=n.pageNumber=tm.createBtn("page").on("change",function(){i.gotoPageLabel(n.pageInput.val())}).on("keyup",function(e){13===e.keyCode&&i.gotoPageLabel(n.pageInput.val())});var a="df_book_page_number_"+Math.ceil(performance.now()/10);this.pageInput=n.pageInput=tv('<input id="'+a+'" type="text"/>').appendTo(n.pageNumber),this.pageLabel=n.pageLabel=tv('<label for="'+a+'"></label>').appendTo(n.pageNumber),this.thumbnail=n.thumbnail=tm.createBtn("thumbnail",s.thumbnail,o.toggleThumbnails),n.thumbnail.on("click",function(){var t=tv(this);null==i.thumblist&&i.initThumbs(),i.thumbContainer.toggleClass("df-sidemenu-visible"),t.toggleClass("df-active"),t.hasClass("df-active")&&(t.siblings(".df-active").trigger("click"),i.thumbRequestStatus=ty.ON),e.update(),!1===i.options.sideMenuOverlay&&i.resizeRequestStart()}).addClass("df-sidemenu-trigger"),i.hasOutline()&&(this.outline=n.outline=tm.createBtn("outline",s.outline,o.toggleOutline),n.outline.on("click",function(){var t=tv(this);if(null==i.outlineViewer&&i.initOutline(),i.outlineContainer){var n=i.outlineContainer;t.toggleClass("df-active"),n.toggleClass("df-sidemenu-visible"),t.hasClass("df-active")&&t.siblings(".df-active").trigger("click"),e.update(),!1===i.options.sideMenuOverlay&&i.resizeRequestStart()}}).addClass("df-sidemenu-trigger")),!0===i.options.showSearchControl&&!0!==tm.isMobile&&"string"==typeof i.options.source&&(n.search=tm.createBtn("search",s.search,o.search),n.search.on("click",function(){var t=tv(this);if(null==i.searchContainer&&i.initSearch(),i.searchContainer){var n=i.searchContainer;t.toggleClass("df-active"),n.toggleClass("df-sidemenu-visible"),t.hasClass("df-active")&&(t.siblings(".df-active").trigger("click"),i.searchBox[0].focus()),e.update(),!1===i.options.sideMenuOverlay&&i.resizeRequestStart()}}).addClass("df-sidemenu-trigger"));var r=e.element;if(this.zoomIn=n.zoomIn=tm.createBtn("zoomin",s.zoomin,o.zoomIn).on("click",function(){i.zoom(1),e.update()}),this.zoomOut=n.zoomOut=tm.createBtn("zoomout",s.zoomout,o.zoomOut).on("click",function(){i.zoom(-1),e.update()}),this.resetZoom=n.resetZoom=tm.createBtn("resetzoom",s.resetzoom,o.resetZoom).on("click",function(){i.resetZoom(-1),e.update()}),i.viewer.isFlipBook){if(i.pageCount>2){var l=i.viewer.pageMode===p.FLIPBOOK_PAGE_MODE.SINGLE;this.pageMode=n.pageMode=tm.createBtn("pagemode",s[l?"doublepage":"singlepage"],l?o.doublePageMode:o.singlePageMode).on("click",function(){var e=tv(this);i.viewer.setPageMode({isSingle:!e.hasClass(s.doublepage)}),i.viewer.pageModeChangedManually=!0})}}else this.pageFit=n.pageFit=tm.createBtn("pagefit",s.pagefit,o.pageFit).on("click",function(){var e=n.pageFit;!0==!e.hasClass(s.widthfit)?(e.addClass(s.widthfit),e.html("<span>"+o.widthFit+"</span>"),e.attr("title",o.widthFit)):(e.removeClass(s.widthfit),e.html("<span>"+o.pageFit+"</span>"),e.attr("title",o.pageFit))});if(this.share=n.share=tm.createBtn("share",s.share,o.share).on("click",function(){null==e.shareBox&&(e.shareBox=new tw(i.container,i.options)),!0===e.shareBox.isOpen?e.shareBox.close():(e.shareBox.update(i.getURLHash()),e.shareBox.show())}),this.more=n.more=tm.createBtn("more",s.more).on("click",function(t){!0!==e.moreContainerOpen&&(tv(this).addClass("df-active"),e.moreContainerOpen=!0,t.stopPropagation())}),this.startPage=n.startPage=tm.createBtn("start",s.start,o.gotoFirstPage).on("click",function(){i.start()}),this.endPage=n.endPage=tm.createBtn("end",s.end,o.gotoLastPage).on("click",function(){i.end()}),!0===i.options.showPrintControl&&!0!==tm.isMobile&&"string"==typeof i.options.source&&(this.print=n.print=tm.createBtn("print",s.print,o.print).on("click",function(){p.printHandler=p.printHandler||new tS,p.printHandler.printPDF(i.options.source)})),!0===i.options.showDownloadControl&&"string"==typeof i.options.source){var h="df-ui-btn df-ui-download "+s.download;this.download=n.download=tv('<a download target="_blank" class="'+h+'"><span>'+o.downloadPDFFile+"</span></a>"),n.download.attr("href",tm.httpsCorrection(i.options.source)).attr("title",o.downloadPDFFile)}e.moreContainer=tv(t,{class:"df-more-container"}),n.more.append(e.moreContainer),!0===i.options.isLightBox&&!0!==i.fullscreenSupported||(this.fullScreen=n.fullScreen=tm.createBtn("fullscreen",s.fullscreen,o.toggleFullscreen).on("click",i.switchFullscreen.bind(i))),i.viewer.initCustomControls();var u=i.options.allControls.replace(/ /g,"").split(","),c=","+i.options.moreControls.replace(/ /g,"")+",",d=","+i.options.hideControls.replace(/ /g,"")+",";i.options.leftControls.replace(/ /g,""),i.options.rightControls.replace(/ /g,""),d+=",";for(var f=0;f<u.length;f++){var g=u[f];if(0>d.indexOf(","+g+",")){var v=n[g];null!=v&&(void 0===v?"undefined":tg(v))=="object"&&(c.indexOf(","+g+",")>-1&&"more"!==g&&"pageNumber"!==g?e.moreContainer.append(v):!0==i.options.controlsFloating?r.append(v):this.centerElement.append(v))}}0==e.moreContainer.children().length&&this.more.addClass("df-hidden"),i.container.append(r),i.container.append(n.openLeft),i.container.append(this.controls.openRight),window.addEventListener("click",e.events.closePanels=e.closePanels.bind(e),!1),window.addEventListener("keyup",e.events.keyup=e.keyUp.bind(e),!1),document.addEventListener("fullscreenchange",e.events.fullscreenChange=e.fullscreenChange.bind(e),!1),!0===i.options.autoOpenThumbnail&&e.controls.thumbnail.trigger("click"),i.hasOutline()&&!0===i.options.autoOpenOutline&&e.controls.outline.trigger("click"),i.executeCallback("onCreateUI")}},{key:"closePanels",value:function(e){if(!0===this.moreContainerOpen){var t;null===(t=this.controls.more)||void 0===t||t.removeClass("df-active"),this.moreContainerOpen=!1}}},{key:"fullscreenChange",value:function(e){void 0===tm.getFullscreenElement()&&!0===this.app.isFullscreen&&this.app.switchFullscreen()}},{key:"keyUp",value:function(e){var t=this.app;if("INPUT"!==e.target.nodeName){var i=!1;switch(t.options.arrowKeysAction===p.ARROW_KEYS_ACTIONS.NAV&&((!0===t.isFullscreen||!0===t.options.isLightBox)&&(i=!0),!0!=t.options.isLightBox&&p.activeEmbeds.length<2&&!1===tv("body").hasClass("df-lightbox-open")&&(i=!0)),e.keyCode){case 27:p.activeLightBox&&p.activeLightBox.app&&!tm.isChromeExtension()&&p.activeLightBox.closeButton.trigger("click");break;case 37:i&&t.openLeft();break;case 39:i&&t.openRight();break;case 38:i&&t.viewer.isVertical()&&t.openLeft();break;case 40:i&&t.viewer.isVertical()&&t.openRight()}}}},{key:"createLogo",value:function(){var e=this.app,t=null;e.options.logo.indexOf("<")>-1?t=tv(e.options.logo).addClass("df-logo df-logo-html"):e.options.logo.trim().length>2&&(t=tv('<a class="df-logo df-logo-img" target="_blank" href="'+e.options.logoUrl+'"><img alt="" src="'+e.options.logo+'"/>')),this.element.append(t)}},{key:"dispose",value:function(){for(var e in this.controls)if(this.controls.hasOwnProperty(e)){var t=this.controls[e];null!==t&&(void 0===t?"undefined":tg(t))=="object"&&t.off().remove()}this.element.remove(),this.shareBox=tm.disposeObject(this.shareBox),window.removeEventListener("click",this.events.closePanels,!1),window.removeEventListener("keyup",this.events.keyup,!1),document.removeEventListener("fullscreenchange",this.events.fullscreenChange,!1)}},{key:"update",value:function(){var e=this.app,t=this.controls;!0!==this._pageLabelWidthSet&&(this.pageLabel.width(""),e.provider.pageLabels?this.pageLabel.html("88888888888888888".substring(0,3*e.pageCount.toString().length+4)):this.pageLabel.html("88888888888".substring(0,2*e.pageCount.toString().length+3)),this.pageNumber.width(this.pageLabel.width()),this.pageLabel.width(this.pageLabel.width()),this.pageLabel.html(""),this._pageLabelWidthSet=!0);var i=e.getCurrentLabel();i.toString()!==e.currentPageNumber.toString()?t.pageLabel.html(i+"("+e.currentPageNumber+"/"+e.pageCount+")"):t.pageLabel.html(i+"/"+e.pageCount),t.pageInput.val(i),e.container.toggleClass("df-sidemenu-open",e.container.find(".df-sidemenu-visible").length>0);var n=e.provider.totalHits>0&&e.container.find(".df-sidemenu-visible.df-search-container").length>0;if(e.container.toggleClass("df-search-open",n),n){var o=e.searchContainer.find(".df-search-result[data-df-page="+e.currentPageNumber+"]");if(e.searchContainer.find(".df-search-result.df-active").removeClass("df-active"),o.length>0&&!o.hasClass(".df-active")){o.addClass("df-active");var s=e.searchResults[0],a=s.scrollTop;a+s.getBoundingClientRect().height<(o=o[0]).offsetTop+o.scrollHeight?tm.scrollIntoView(o,null,!1):a>o.offsetTop&&tm.scrollIntoView(o)}}t.zoomIn.toggleClass("disabled",e.zoomValue===e.viewer.maxZoom),t.zoomOut.toggleClass("disabled",e.zoomValue===e.viewer.minZoom);var r=e.isRTL,l=e.currentPageNumber===e.startPage,h=e.currentPageNumber===e.endPage,u=l&&!r||h&&r,p=h&&!r||l&&r;t.openRight.toggleClass("df-hidden",p),t.openLeft.toggleClass("df-hidden",u),e.viewer.afterControlUpdate()}}]),e}(),tw=/*#__PURE__*/function(){function e(t,i){tc(this,e),this.isOpen=!1,this.shareUrl="",this.init(t,i)}return tf(e,[{key:"init",value:function(e,t){var i=this;for(var n in i.wrapper=tv('<div class="df-share-wrapper" style="display: none;">').on("click",function(){i.close()}),i.box=tv('<div class="df-share-box">'),i.box.on("click",function(e){e.preventDefault(),e.stopPropagation()}),i.box.appendTo(i.wrapper).html('<span class="df-share-title">'+t.text.share+"</span>"),i.urlInput=tv('<textarea name="df-share-url" class="df-share-url">').on("click",function(){this.select()}),i.box.append(i.urlInput),t.share)!function(e){if(t.share.hasOwnProperty(e)&&0>t.hideShareControls.indexOf(e)){var n=t.share[e];null!==n&&(i[e]=tv("<div>",{class:"df-share-button df-share-"+e+" "+t.icons[e]}).on("click",function(e){e.preventDefault(),window.open(n.replace("{{url}}",encodeURIComponent(i.shareUrl)).replace("{{mailsubject}}",t.text.mailSubject),"Sharer","width=500,height=400"),e.stopPropagation()}),i.box.append(i[e]))}}(n);tv(e).append(i.wrapper)}},{key:"show",value:function(){this.wrapper.show(),this.urlInput.val(this.shareUrl),this.urlInput.trigger("click"),this.isOpen=!0}},{key:"dispose",value:function(){for(var e in this)this.hasOwnProperty(e)&&this[e]&&this[e].off&&this[e].off();this.wrapper.remove()}},{key:"close",value:function(){this.wrapper.hide(),this.isOpen=!1}},{key:"update",value:function(e){this.shareUrl=e}}]),e}(),tP=/*#__PURE__*/function(){function e(t){tc(this,e),this.duration=300;var i=this;return i.lightboxWrapper=tv("<div>").addClass("df-lightbox-wrapper"),i.backGround=tv("<div>").addClass("df-lightbox-bg").appendTo(i.lightboxWrapper),i.element=tv("<div>").addClass("df-app").appendTo(i.lightboxWrapper),i.controls=tv("<div>").addClass("df-lightbox-controls").appendTo(i.lightboxWrapper),i.closeButton=tv("<div>").addClass("df-lightbox-close df-ui-btn "+p.defaults.icons.close).on("click",function(){i.close(t)}).appendTo(i.controls),i.lightboxWrapper.append(i.element),i}return tf(e,[{key:"show",value:function(e){return 0===this.lightboxWrapper.parent().length&&tv("body").append(this.lightboxWrapper),tv("html,body").addClass("df-lightbox-open"),this.lightboxWrapper.show(),"function"==typeof e&&e(),this}},{key:"close",value:function(e){return this.lightboxWrapper.hide(),Array.prototype.forEach.call(p.utils.getSharePrefixes(),function(e){0===window.location.hash.indexOf("#"+e)&&!0==p.defaults.hashNavigationEnabled&&history.replaceState(void 0,void 0,"#_")}),"function"==typeof e&&setTimeout(e,this.duration),tv("html,body").removeClass("df-lightbox-open"),this.element.attr("class","df-app").attr("style",""),this.lightboxWrapper.attr("class","df-lightbox-wrapper").attr("style","display:none"),this.backGround.attr("style",""),this}}]),e}(),tS=/*#__PURE__*/function(){function e(){tc(this,e);var t=this;return t.frame=tv('<iframe id="df-print-frame" style="display:none">').appendTo(tv("body")),t.frame.on("load",function(){try{t.frame[0].contentWindow.print()}catch(e){console.log(e)}}),t}return tf(e,[{key:"printPDF",value:function(e){this.frame[0].src=e}}]),e}(),tE=/*#__PURE__*/function(){function e(t,i){tc(this,e),this.options=t,this.app=i,this.parentElement=t.parentElement,this.element=tv("<div>",{class:"df-sidemenu-wrapper"}),this.parentElement.append(this.element),this.buttons=tv("<div>",{class:"df-sidemenu-buttons df-ui-wrapper"}).appendTo(this.element),this.close=tm.createBtn("close",i.options.icons.close,i.options.text.close),this.buttons.append(this.close)}return tf(e,[{key:"dispose",value:function(){this.element.remove()}}]),e}(),tx=/*#__PURE__*/function(){function e(t){tc(this,e),this.outline=null,this.lastToggleIsShow=!0,this.container=t.container,this.linkService=t.linkService,this.outlineItemClass=t.outlineItemClass||"outlineItem",this.outlineToggleClass=t.outlineToggleClass||"outlineItemToggler",this.outlineToggleHiddenClass=t.outlineToggleHiddenClass||"outlineItemsHidden"}return tf(e,[{key:"dispose",value:function(){this.container&&this.container.parentNode&&this.container.parentNode.removeChild(this.container),this.linkService=null}},{key:"reset",value:function(){this.outline=null,this.lastToggleIsShow=!0;for(var e=this.container;e.firstChild;)e.removeChild(e.firstChild)}},{key:"_dispatchEvent",value:function(e){var t=document.createEvent("CustomEvent");t.initCustomEvent("outlineloaded",!0,!0,{outlineCount:e}),this.container.dispatchEvent(t)}},{key:"_bindLink",value:function(e,t){var i=this.linkService;if(!0===t.custom)e.href=i.getCustomDestinationHash(t.dest),e.onclick=function(){return i.customNavigateTo(t.dest),!1};else{if(t.url){pdfjsLib.addLinkAttributes(e,{url:t.url});return}e.href=i.getDestinationHash(t.dest),e.onclick=function(){return i.navigateTo(t.dest),!1}}}},{key:"_addToggleButton",value:function(e){var t=this,i=document.createElement("div");i.className=this.outlineToggleClass+" "+this.outlineToggleHiddenClass,i.onclick=(function(n){if(n.stopPropagation(),i.classList.toggle(this.outlineToggleHiddenClass),n.shiftKey){var o=!i.classList.contains(this.outlineToggleHiddenClass);t._toggleOutlineItem(e,o)}}).bind(this),e.insertBefore(i,e.firstChild)}},{key:"_toggleOutlineItem",value:function(e,t){this.lastToggleIsShow=t;for(var i=e.querySelectorAll("."+this.outlineToggleClass),n=0,o=i.length;n<o;++n)i[n].classList[t?"remove":"add"](this.outlineToggleHiddenClass)}},{key:"render",value:function(e){var t=e&&e.outline||null,i=0;if(this.outline&&this.reset(),this.outline=t,t){for(var n=document.createDocumentFragment(),o=[{parent:n,items:this.outline,custom:!1}],s=!1;o.length>0;)for(var a=o.shift(),r=a.custom,l=0,h=a.items.length;l<h;l++){var u=a.items[l],p=document.createElement("div");p.className=this.outlineItemClass;var c=document.createElement("a");if(null==u.custom&&null!=r&&(u.custom=r),this._bindLink(c,u),c.textContent=u.title.replace(/\x00/g,""),p.appendChild(c),u.items&&u.items.length>0){s=!0,this._addToggleButton(p);var d=document.createElement("div");d.className=this.outlineItemClass+"s",p.appendChild(d),o.push({parent:d,custom:u.custom,items:u.items})}a.parent.appendChild(p),i++}s&&(null!=this.container.classList?this.container.classList.add(this.outlineItemClass+"s"):null!=this.container.className&&(this.container.className+=" picWindow")),this.container.appendChild(n),this._dispatchEvent(i)}}}]),e}(),tC=/*#__PURE__*/function(){function e(t){tc(this,e);var i=function(){s.thumbRequestCount=0,s.thumbRequestStatus=ty.COUNT},n=this.itemHeight=t.itemHeight,o=this.itemWidth=t.itemWidth,s=this.app=t.app;this.items=t.items,this.generatorFn=t.generatorFn,this.totalRows=t.totalRows||t.items&&t.items.length,this.addFn=t.addFn,this.scrollFn=t.scrollFn,this.container=document.createElement("div");for(var a=this,r=0;r<this.totalRows;r++){var l=document.createElement("div"),h=r+1;l.id="df-thumb"+h;var u=document.createElement("div"),p=document.createElement("div"),c=document.createElement("div");c.className="df-wrapper",p.className="df-thumb-number",l.className="df-thumb",u.className="df-bg-image",c.style.height=n+"px",c.style.width=o+"px",p.innerText=s.provider.getLabelforPage(h),l.appendChild(c),c.appendChild(p),c.appendChild(u),this.container.appendChild(l)}a.dispose=function(){a.container&&a.container.parentNode&&a.container.parentNode.removeChild(a.container),a.container.removeEventListener("scroll",i)},a.container.addEventListener("scroll",i)}return tf(e,[{key:"processThumbRequest",value:function(){tm.log("Thumb Request Initiated");var e=this.app;if(e.thumbRequestStatus=ty.OFF,e.activeThumb!==e.currentPageNumber&&null!=e.thumbContainer&&e.thumbContainer.hasClass("df-sidemenu-visible")){var t=e.thumblist.container,i=t.scrollTop,n=t.getBoundingClientRect().height,o=e.thumbContainer.find("#df-thumb"+e.currentPageNumber);o.length>0?(e.thumbContainer.find(".df-selected").removeClass("df-selected"),o.addClass("df-selected"),i+n<(o=o[0]).offsetTop+o.scrollHeight?tm.scrollIntoView(o,null,!1):i>o.offsetTop&&tm.scrollIntoView(o),e.activeThumb=e.currentPageNumber):(tv(t).scrollTop(124*e.currentPageNumber),e.thumbRequestStatus=ty.ON)}if(0===e.thumblist.container.getElementsByClassName("df-thumb-requested").length){var s=tm.getVisibleElements({container:e.thumblist.container,elements:e.thumblist.container.children});-1===s.indexOf(e.activeThumb)&&s.unshift(e.activeThumb);for(var a=0;a<s.length;a++){var r=e.thumblist.container.children[s[a]-1];if(void 0!==r&&!1===r.classList.contains("df-thumb-loaded")&&!1===r.classList.contains("df-thumb-requested"))return r.classList.add("df-thumb-requested"),tm.log("Thumb Requested for "+s[a]),e.provider.processPage({pageNumber:s[a],textureTarget:p.TEXTURE_TARGET.THUMB}),!1}}}},{key:"setPage",value:function(e){var t=this.app,i=e.pageNumber,n=e.texture;if(e.textureTarget===p.TEXTURE_TARGET.THUMB){var o=t.container.find("#df-thumb"+i);o.find(".df-wrapper").css({height:e.height,width:e.width}),o.find(".df-bg-image").css({backgroundImage:tm.bgImage(n)}),o.addClass("df-thumb-loaded").removeClass("df-thumb-requested")}tm.log("Thumbnail set for "+e.pageNumber),t.thumbRequestStatus=ty.ON}}]),e}();function tT(){if(void 0===p.openLocalFileInput){var e=p.openLocalFileInput=tv('<input type="file" accept=".pdf" style="display:none">').appendTo(tv("body")).data("df-option",p.openFileOptions);e.change(function(){var t,i=e[0].files;i.length&&(t=i[0],e.val(""),p.openFile(t))})}}p.openLightBox=function(e){p.activeLightBox||(p.activeLightBox=new tP(function(){p.activeLightBox.app&&(p.activeLightBox.app.closeRequested=!0,p.activeLightBox.app.analytics({eventAction:p.activeLightBox.app.options.analyticsViewerClose,options:p.activeLightBox.app.options})),p.activeLightBox.app=tm.disposeObject(p.activeLightBox.app)})),p.activeLightBox.duration=300,(void 0===p.activeLightBox.app||null===p.activeLightBox.app||!0===p.activeLightBox.app.closeRequested||p.openLocalFileInput==e)&&(p.activeLightBox.app=tm.disposeObject(p.activeLightBox.app),null===p.activeLightBox.app&&p.activeLightBox.show(function(){p.activeLightBox.app=new p.Application({transparent:!1,isLightBox:!0,height:"100%",dataElement:e,element:p.activeLightBox.element}),!0!==p._isHashTriggered&&!0==p.defaults.hashNavigationEnabled&&history.pushState(null,null,"#"),p.activeLightBox.lightboxWrapper.toggleClass("df-lightbox-padded",!1===p.activeLightBox.app.options.popupFullsize),p.activeLightBox.lightboxWrapper.toggleClass("df-rtl",p.activeLightBox.app.options.readDirection===p.READ_DIRECTION.RTL),p.activeLightBox.backGround.css({backgroundColor:"transparent"===p.activeLightBox.app.options.backgroundColor?p.defaults.popupBackGroundColor:p.activeLightBox.app.options.backgroundColor})}))},p.checkBrowserURLforDefaults=function(){if(!tm.isIEUnsupported){var e=new URL(location.href).searchParams.get("viewer-type")||new URL(location.href).searchParams.get("viewertype"),t=new URL(location.href).searchParams.get("is-3d")||new URL(location.href).searchParams.get("is3d");e&&(p.defaults.viewerType=e),("true"===t||"false"===t)&&(p.defaults.is3D="true"===t)}},p.fileDropHandler=function(e,t){var i=e[0];"application/pdf"===i.type&&(t.preventDefault(),t.stopPropagation(),p.openFile(i))},p.openFile=function(e){if(e){var t;p.oldLocalFileObjectURL&&window.URL.revokeObjectURL(p.oldLocalFileObjectURL),p.oldLocalFileObjectURL=window.URL.createObjectURL(e),null===(t=p.openFileSelected)||void 0===t||t.call(p,{url:p.oldLocalFileObjectURL,file:e}),p.openURL(p.oldLocalFileObjectURL)}else p.openURL()},p.openURL=function(e){tT(),e&&(p.openFileOptions.source=e,p.openFileOptions.pdfParameters=null),p.openLightBox(p.openLocalFileInput)},p.openBase64=function(e){p.openFileOptions.source=null,p.openFileOptions.pdfParameters={data:atob(e)},p.openURL()},p.openLocalFile=function(){tT(),p.openLocalFileInput.click()},p.initControls=function(){var e=tv("body");if(!1!==p.defaults.autoPDFLinktoViewer&&e.on("click",'a[href$=".pdf"]',function(e){var t=tv(this);void 0!==t.attr("download")||"_blank"===t.attr("target")||t.hasClass("df-ui-btn")||t.parents(".df-app").length>0||(e.preventDefault(),t.data("df-source",t.attr("href")),p.openLightBox(t))}),window.addEventListener("popstate",function(e){p.activeLightBox&&p.activeLightBox.app&&!tm.isChromeExtension()&&p.activeLightBox.closeButton.trigger("click")}),e.on("click",".df-open-local-file",function(e){p.openLocalFile()}),e.on("click",".df-sidemenu-buttons .df-ui-close",function(){tv(this).closest(".df-app").find(".df-ui-btn.df-active").trigger("click")}),e.on("mouseout",".df-link-content section.squareAnnotation, .df-link-content section.textAnnotation, .df-link-content section.freeTextAnnotation",function(){var e=tv(this);p.handlePopup(e,!1)}),e.on("mouseover",".df-link-content section.squareAnnotation, .df-link-content section.textAnnotation, .df-link-content section.freeTextAnnotation",function(){var e=tv(this);p.handlePopup(e,!0)}),p.handlePopup=function(e){var t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],i=e.closest(".df-container"),n=i.find(".df-comment-popup");if(n.toggleClass("df-active",t),t){var o=e[0].getBoundingClientRect(),s=i[0].getBoundingClientRect(),a=e.find(".popupWrapper").first();if(e.hasClass("popupTriggerArea")){var r=e.data("annotation-id");void 0!==r&&(a=e.siblings("[data-annotation-id=popup_"+r+"]"))}n.html(a.html());var l=o.left-s.left;l+360>s.width?l=s.width-360-10:l<10&&(l=10);var h=o.top-s.top+o.height+5;h+n.height()>s.height?h=o.top-n.height()-o.height-10:h<10&&(h=10),n.css({left:l,top:h})}},void 0!=p.fileDropElement){var t=tv(p.fileDropElement);t.length>0&&(t.on("dragover",function(e){e.preventDefault(),e.stopPropagation(),tv(this).addClass("df-dragging")}),t.on("dragleave",function(e){e.preventDefault(),e.stopPropagation(),tv(this).removeClass("df-dragging")}),t.on("drop",function(e){var t=e.originalEvent.dataTransfer.files;t.length&&p.fileDropHandler(t,e)}))}};var tk=p.jQuery,tO=p.REQUEST_STATUS,tR=p.utils,tL=/*#__PURE__*/function(){var e;function t(e){var i,n,o;(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")})(this,t),this.options=e,this.viewerType=this.options.viewerType,this.startPage=1,this.endPage=1,this.element=tk(this.options.element),e.maxTextureSize=null!==(i=e.maxTextureSize)&&void 0!==i?i:2048,tR.isMobile&&(e.maxTextureSize=4096===e.maxTextureSize?3200:e.maxTextureSize),this.dimensions={padding:{},offset:{},pageFit:{},stage:{},isAutoHeight:"auto"===e.height,maxTextureSize:e.maxTextureSize},this.is3D=e.is3D,this.options.pixelRatio=tR.limitAt(this.options.pixelRatio,1,this.options.maxDPI),this.options.fakeZoom=null!==(n=this.options.fakeZoom)&&void 0!==n?n:1,this.events={},this.links=e.links,this.thumbSize=128,this.pendingZoom=!0,this.currentPageNumber=this.options.openPage||this.startPage,this.hashNavigationEnabled=!0===this.options.hashNavigationEnabled,this.pendingZoom=!0,this.zoomValue=1,this.pageScaling=p.PAGE_SCALE.MANUAL,this.isRTL=e.readDirection===p.READ_DIRECTION.RTL,this.jumpStep=1,this.resizeRequestStatus=tO.OFF,this.refreshRequestStatus=tO.OFF,this.refreshRequestCount=0,this.resizeRequestCount=0,this.fullscreenSupported=tR.hasFullscreenEnabled(),this.thumbRequestCount=0,this.isExternalReady=null===(o=this.options.isExternalReady)||void 0===o||o,this.init(),!0===this.options.autoLightBoxFullscreen&&!0===this.options.isLightBox&&this.switchFullscreen(),this.executeCallback("onCreate"),this.target=this}return e=[{key:"init",value:function(){var e=this.options;if(this.initDOM(),this.initResourcesLocation(),this.initInfo(),(null==e.source||0===e.source.length)&&null==e.pdfParameters){this.updateInfo("ERROR: Set a Valid Document Source.",p.INFO_TYPE.ERROR),this.container.removeClass("df-loading").addClass("df-error");return}if(tR.isIEUnsupported){this.updateInfo("Your browser (Internet Explorer) is out of date! <br><a href='https://browsehappy.com/'>Upgrade to a new browser.</a>","df-old-browser"),this.container.removeClass("df-loading").addClass("df-error");return}this.commentPopup=tk('<div class="df-comment-popup">').appendTo(this.container),this.viewer=new this.viewerType(e,this),this.sideMenu=new tE({parentElement:this.container},this),this.provider=new p.providers[e.providerType](e,this),this.state="loading",this.checkRequestQueue()}},{key:"initDOM",value:function(){this.element.addClass("df-app").removeClass("df-container df-loading"),this.container=tk("<div>").appendTo(this.element),this.container.addClass("df-container df-loading df-init df-controls-"+this.options.controlsPosition+(!0===this.options.controlsFloating?" df-float":" df-float-off")+("transparent"===this.options.backgroundColor?" df-transparent":"")+(!0===this.isRTL?" df-rtl":"")+(!0===tR.isIOS||!0===tR.isIPad?" df-ios":"")),this._offsetParent=this.container[0].offsetParent,this.backGround=tk("<div class='df-bg'>").appendTo(this.container).css({backgroundColor:this.options.backgroundColor,backgroundImage:this.options.backgroundImage?"url('"+this.options.backgroundImage+"')":""}),this.viewerContainer=tk("<div>").appendTo(this.container),this.viewerContainer.addClass("df-viewer-container")}},{key:"initResourcesLocation",value:function(){var e=this.options;if(void 0!==window[p.locationVar]){if(e.pdfjsSrc=window[p.locationVar]+"js/libs/pdf.min.js",e.threejsSrc=window[p.locationVar]+"js/libs/three.min.js",e.pdfjsWorkerSrc=window[p.locationVar]+"js/libs/pdf.worker.min.js",e.soundFile=window[p.locationVar]+e.soundFile,e.imagesLocation=window[p.locationVar]+e.imagesLocation,e.imageResourcesPath=window[p.locationVar]+e.imageResourcesPath,e.cMapUrl=window[p.locationVar]+e.cMapUrl,void 0!==e.pdfVersion){var t="";"latest"==e.pdfVersion||"beta"==e.pdfVersion?t="latest":"stable"==e.pdfVersion&&(t="stable"),("latest"==e.pdfVersion||"default"==e.pdfVersion)&&(Array.prototype.at,void 0===Array.prototype.at&&(t="stable",console.log("Proper Support for Latest version PDF.js 3.7 not available. Switching to PDF.js 2.5!"))),"default"!==t&&""!==t&&(e.pdfjsSrc=window[p.locationVar]+"js/libs/pdfjs/"+t+"/pdf.min.js",e.pdfjsWorkerSrc=window[p.locationVar]+"js/libs/pdfjs/"+t+"/pdf.worker.min.js"),"stable"===t&&(this.options.fakeZoom=1)}}else console.warn("DEARVIEWER locationVar not found!");this.executeCallback("onInitResourcesLocation")}},{key:"initEvents",value:function(){var e=this.container[0];window.addEventListener("resize",this.events.resize=this.resetResizeRequest.bind(this),!1),e.addEventListener("mousemove",this.events.mousemove=this.mouseMove.bind(this),!1),e.addEventListener("mousedown",this.events.mousedown=this.mouseDown.bind(this),!1),window.addEventListener("mouseup",this.events.mouseup=this.mouseUp.bind(this),!1),e.addEventListener("touchmove",this.events.touchmove=this.mouseMove.bind(this),!1),e.addEventListener("touchstart",this.events.touchstart=this.mouseDown.bind(this),!1),window.addEventListener("touchend",this.events.touchend=this.mouseUp.bind(this),!1)}},{key:"mouseMove",value:function(e){e.touches&&e.touches.length>1&&e.preventDefault(),!0===this.viewer.acceptAppMouseEvents&&this.viewer.mouseMove(e)}},{key:"mouseDown",value:function(e){this.userHasInteracted=!0,!0===this.viewer.acceptAppMouseEvents&&0===tk(e.srcElement).closest(".df-sidemenu").length&&this.viewer.mouseDown(e)}},{key:"mouseUp",value:function(e){this.viewer&&!0===this.viewer.acceptAppMouseEvents&&this.viewer.mouseUp(e)}},{key:"softDispose",value:function(){this.softDisposed=!0,this.provider.dispose(),this.viewer.dispose()}},{key:"softInit",value:function(){this.viewer=new this.viewerType(this.options,this),this.provider=new p.providers[this.options.providerType](this.options,this),this.softDisposed=!1}},{key:"dispose",value:function(){var e,t,i,n,o,s=this.container[0];clearInterval(this.autoPlayTimer),this.autoPlayTimer=null,this.autoPlayFunction=null,this.provider=tR.disposeObject(this.provider),this.contentProvider=null,this.target=null,this.viewer=tR.disposeObject(this.viewer),this.sideMenu=tR.disposeObject(this.sideMenu),this.ui=tR.disposeObject(this.ui),this.thumblist=tR.disposeObject(this.thumblist),this.outlineViewer=tR.disposeObject(this.outlineViewer),this.events&&(window.removeEventListener("resize",this.events.resize,!1),s.removeEventListener("mousemove",this.events.mousemove,!1),s.removeEventListener("mousedown",this.events.mousedown,!1),window.removeEventListener("mouseup",this.events.mouseup,!1),s.removeEventListener("touchmove",this.events.touchmove,!1),s.removeEventListener("touchstart",this.events.touchstart,!1),window.removeEventListener("touchend",this.events.touchend,!1)),this.events=null,this.options=null,this.element.removeClass("df-app"),this.viewerType=null,this.checkRequestQueue=null,null===(e=this.info)||void 0===e||e.remove(),this.info=null,null===(t=this.loadingIcon)||void 0===t||t.remove(),this.loadingIcon=null,null===(i=this.backGround)||void 0===i||i.remove(),this.backGround=null,null===(n=this.outlineContainer)||void 0===n||n.remove(),this.outlineContainer=null,null===(o=this.commentPopup)||void 0===o||o.remove(),this.commentPopup=null,this.viewerContainer.off(),this.viewerContainer.remove(),this.viewerContainer=null,this.container.off(),this.container.remove(),this.container=null,this.element.off(),this.element.data("df-app",null),this.element=null,this._offsetParent=null,this.dimensions=null}},{key:"resetResizeRequest",value:function(){this.resizeRequestStatus=tO.COUNT,this.resizeRequestCount=0,this.container.addClass("df-pendingresize"),this.pendingResize=!0}},{key:"initInfo",value:function(){this.info=tk("<div>",{class:"df-loading-info"}),this.container.append(this.info),this.info.html(this.options.text.loading+"..."),this.loadingIcon=tk("<div>",{class:"df-loading-icon"}).appendTo(this.container)}},{key:"updateInfo",value:function(e,t){tR.log(e),void 0!==this.info&&this.info.html(e)}},{key:"_documentLoaded",value:function(){tR.log("Document Loaded"),this.isDocumentReady=!0,this.contentProvider=this.provider,this.executeCallback("onDocumentLoad"),this.endPage=this.pageCount=this.provider.pageCount,this.currentPageNumber=this.getValidPage(this.currentPageNumber)}},{key:"_viewerPrepared",value:function(){tR.log("Viewer Prepared"),this.isViewerPrepared=!0,this.executeCallback("onViewerLoad")}},{key:"requestFinalize",value:function(){!0===this.isDocumentReady&&!0===this.isViewerPrepared&&!0===this.isExternalReady&&!0!==this.finalizeRequested&&(this.finalizeRequested=!0,this.finalize())}},{key:"finalizeComponents",value:function(){this.ui=new tb({},this),this.ui.init(),this.calculateLayout(),this.viewer.init()}},{key:"finalize",value:function(){this.resize(),this.ui.update(),this.initEvents(),!0==this.options.isLightBox&&this.analytics({eventAction:this.options.analyticsViewerOpen,options:this.options}),this.container.removeClass("df-loading df-init"),this.viewer.onReady(),this.analytics({eventAction:this.options.analyticsViewerReady,options:this.options}),this.executeCallback("onReady"),!0===this.options.dataElement.hasClass("df-hash-focused")&&(tR.focusHash(this.options.dataElement),this.options.dataElement.removeClass("df-hash-focused")),!0===this.hashNavigationEnabled&&this.getURLHash(),tR.log("App Finalized")}},{key:"initOutline",value:function(){var e=tk("<div>").addClass("df-outline-container df-sidemenu");e.append('<div class="df-sidemenu-title">'+this.options.text.outlineTitle+"</div>");var t=tk("<div>").addClass("df-wrapper");e.append(t),this.sideMenu.element.append(e),this.outlineContainer=e,this.outlineViewer=new tx({container:t[0],linkService:this.provider.linkService,outlineItemClass:"df-outline-item",outlineToggleClass:"df-outline-toggle",outlineToggleHiddenClass:"df-outlines-hidden"}),this.outlineViewer.render({outline:this.provider.outline})}},{key:"initThumbs",value:function(){var e=this;e.thumblist=new tC({app:e,addFn:function(e){},scrollFn:function(){e.thumbRequestStatus=tO.ON},itemHeight:e.thumbSize,itemWidth:tR.limitAt(Math.floor(e.dimensions.defaultPage.ratio*e.thumbSize),32,180),totalRows:e.pageCount}),e.thumblist.lastScrolled=Date.now(),e.thumbRequestStatus=tO.ON;var t=tk("<div>").addClass("df-thumb-container df-sidemenu");t.append('<div class="df-sidemenu-title">'+this.options.text.thumbTitle+"</div>"),t.append(tk(e.thumblist.container).addClass("df-wrapper")),e.thumbContainer=t,e.sideMenu.element.append(t),e.container.on("click",".df-thumb-container .df-thumb",function(t){t.stopPropagation();var i=tk(this).attr("id").replace("df-thumb","");e.gotoPage(parseInt(i,10))})}},{key:"initSearch",value:function(){var e=this,t=tk("<div>").addClass("df-search-container df-sidemenu");t.append('<div class="df-sidemenu-title">'+this.options.text.searchTitle+"</div>"),e.searchForm=tk('<div class="df-search-form">').appendTo(t),e.searchBox=tk('<input type="text" class="df-search-text" placeholder="'+this.options.text.searchPlaceHolder+'">').on("keyup",function(t){13===t.keyCode&&e.search()}).appendTo(e.searchForm),e.searchButton=tk('<div class="df-ui-btn df-search-btn df-icon-search">').on("click",function(t){e.search()}).appendTo(e.searchForm),e.clearButton=tk('<a class="df-search-clear">Clear</a>').on("click",function(t){e.clearSearch()}).appendTo(e.searchForm),e.searchInfo=tk('<div class="df-search-info">').appendTo(t),e.searchResults=tk('<div class="df-wrapper df-search-results">').appendTo(t),e.searchContainer=t,e.sideMenu.element.append(t),e.container.on("click",".df-search-result",function(t){t.stopPropagation();var i=tk(this).data("df-page");e.gotoPage(parseInt(i,10))})}},{key:"search",value:function(e){void 0==e&&(e=this.searchBox.val()),this.provider.search(e.trim())}},{key:"clearSearch",value:function(){this.searchBox.val(""),this.searchInfo.html(""),this.provider.clearSearch()}},{key:"updateSearchInfo",value:function(e){tR.log(e),void 0!==this.searchInfo&&this.searchInfo.html(e)}},{key:"checkRequestQueue",value:function(){var e=this;if(e.checkRequestQueue&&requestAnimationFrame(function(){e&&e.checkRequestQueue&&e.checkRequestQueue()}),!e.softDisposed){if("ready"!=e.state){"loading"===e.state&&!0===this.isDocumentReady&&!0===this.isViewerPrepared&&!0===this.isExternalReady&&(e.state="finalizing",this.finalizeComponents()),"finalizing"===e.state&&(e.state="ready",e.finalize());return}e.container&&e.container[0]&&e._offsetParent!==e.container[0].offsetParent&&(e._offsetParent=e.container[0].offsetParent,null!==e._offsetParent&&(e.resize(),e.resizeRequestStatus=tO.OFF),tR.log("Visibility Resize Detected")),(null!==e._offsetParent||e.isFullscreen)&&(TWEEN.getAll().length>0&&(TWEEN.update(),e.renderRequestStatus=tO.ON),e.resizeRequestStatus===tO.ON?(e.resizeRequestStatus=tO.OFF,e.resize()):e.resizeRequestStatus===tO.COUNT&&(e.resizeRequestCount++,e.resizeRequestCount>10&&(e.resizeRequestCount=0,e.resizeRequestStatus=tO.ON)),e.refreshRequestStatus===tO.ON?(e.refreshRequestStatus=tO.OFF,e.pendingResize=!1,e.viewer.refresh(),e.container.removeClass("df-pendingresize")):e.refreshRequestStatus===tO.COUNT&&(e.refreshRequestCount++,e.refreshRequestCount>3&&(e.refreshRequestCount=0,e.refreshRequestStatus=tO.ON)),e.textureRequestStatus===tO.ON&&e.processTextureRequest(),e.thumbRequestStatus===tO.ON?e.processThumbRequest():e.thumbRequestStatus===tO.COUNT&&(e.thumbRequestCount++,e.thumbRequestCount>3&&(e.thumbRequestCount=0,e.thumbRequestStatus=tO.ON)),e.renderRequestStatus===tO.ON&&(e.viewer.render(),e.renderRequestStatus=tO.OFF),e.provider.checkRequestQueue(),e.viewer.checkRequestQueue())}}},{key:"processTextureRequest",value:function(){var e,t,i=this.viewer,n=this.provider,o=i.getVisiblePages().main,s=0,a=this.zoomValue>1;if(i.isAnimating()&&!0!==DEARFLIP.defaults.instantTextureProcess)this.textureRequestStatus=tO.ON;else{tR.log("Texture Request Working");for(var r=0;r<o.length;r++){s=0;var l=o[r];if(l>0&&l<=this.pageCount){if(e=a?i.zoomViewer.getPageByNumber(l):i.getPageByNumber(l)){t=i.getTextureSize({pageNumber:l});var h={pageNumber:l,textureTarget:a?p.TEXTURE_TARGET.ZOOM:p.TEXTURE_TARGET.VIEWER};e.changeTexture(l,Math.floor(t.height))&&(n.processPage(h),s++,this.viewer.getAnnotationElement(l,!0)),!0===this.options.progressiveZoom&&this.zoomValue>1.1*i.pureMaxZoom&&this.viewer.zoomViewer.startZoomUpdateRequest()}if(s>0)break}}0===s&&(this.textureRequestStatus=tO.OFF)}}},{key:"applyTexture",value:function(e,t){var i=void 0!==e.toDataURL;if(t.textureTarget===p.TEXTURE_TARGET.THUMB){if(t.height=e.height,t.width=e.width,i){var n=e.toDataURL("image/png");this.provider.setCache(t.pageNumber,n,this.thumbSize),t.texture=n}else t.texture=e.src;this.thumblist.setPage(t)}else t.texture=i?e:e.src,!0===this.viewer.setPage(t)&&(this.provider.processAnnotations(t.pageNumber,this.viewer.getAnnotationElement(t.pageNumber,!0)),this.provider.processTextContent(t.pageNumber,this.viewer.getTextElement(t.pageNumber,!0)))}},{key:"processThumbRequest",value:function(){null!==this.thumblist&&void 0!==this.thumblist&&this.thumblist.processThumbRequest()}},{key:"refreshRequestStart",value:function(){this.refreshRequestStatus=tO.COUNT,this.refreshRequestCount=0}},{key:"renderRequestStart",value:function(){this.renderRequestStatus=tO.ON}},{key:"resizeRequestStart",value:function(){this.resizeRequestStatus=tO.ON}},{key:"zoom",value:function(e){this.pendingZoom=!0,this.zoomDelta=e,this.resize()}},{key:"resetZoom",value:function(){1!==this.zoomValue&&(this.zoomValue=1.001,this.zoom(-1))}},{key:"calculateLayout",value:function(){var e,t,i=this.isSideMenuOpen=this.container.hasClass("df-sidemenu-open"),n=this.dimensions,o=this.dimensions.padding,s=tk(window).height();n.offset={top:0,left:this.options.sideMenuOverlay||!i||this.isRTL?0:220,right:!this.options.sideMenuOverlay&&i&&this.isRTL?220:0,bottom:0,width:!this.options.sideMenuOverlay&&i?220:0},this.viewerContainer.css({left:n.offset.left,right:n.offset.right});var a=n.controlsHeight=this.container.find(".df-ui").height();if(o.top=this.options.paddingTop+(this.options.controlsPosition===p.CONTROLS_POSITION.TOP?a:0),o.left=this.options.paddingLeft,o.right=this.options.paddingRight,o.bottom=this.options.paddingBottom+(this.options.controlsPosition===p.CONTROLS_POSITION.BOTTOM?a:0),o.height=o.top+o.bottom,o.width=o.left+o.right,o.heightDiff=o.top-o.bottom,o.widthDiff=o.left-o.right,n.isFullSize=!0===this.isFullscreen,n.isFixedHeight=n.isFullSize||!n.isAutoHeight,n.containerWidth=n.isFullSize?tk(window).width():this.element.width(),this.container.toggleClass("df-xs",n.containerWidth<400).toggleClass("df-xss",n.containerWidth<320),n.maxHeight=s-(n.containerWidth>600&&null!==(t=tk(null!==(e=this.options.headerElementSelector)&&void 0!==e?e:"#wpadminbar").height())&&void 0!==t?t:0),n.isFixedHeight){if(n.isFullSize)n.maxHeight=s;else{this.element.height(this.options.height);var r=this.element.height();n.maxHeight=Math.min(r,n.maxHeight)}}n.width,n.stage.innerWidth=this.viewer._getInnerWidth();var l=n.stage.innerHeight=this.viewer._getInnerHeight(),h=this.viewer._getOuterHeight(l+n.padding.height);n.containerHeight=n.isFullSize?s:h,this.element.height(n.containerHeight);var u=this.element.height();n.isFullSize||u==n.containerHeight||(n.containerHeight=u,n.stage.innerHeight=u-n.padding.height,n.stage.height=u),n.origin={x:(o.widthDiff+n.containerWidth-n.offset.left-n.offset.right)/2,y:(o.heightDiff+n.containerHeight)/2},this.viewer.determinePageMode()}},{key:"resize",value:function(){var e=!(arguments.length>0)||void 0===arguments[0]||arguments[0];tR.log("Resize Request Initiated"),this.calculateLayout(),this.viewer.handleZoom(),this.viewer.resize(),!1!==e&&(this.pendingZoom?(this.viewer.refresh(),tR.log("Pending Zoom updated")):this.refreshRequestStart(),this.ui.update(),this.renderRequestStatus=tO.ON,this.zoomChanged=!1,this.pendingZoom=!1,this.executeCallback("afterResize"))}},{key:"hasOutline",value:function(){if(this.provider.outline.length>0)return!0}},{key:"switchFullscreen",value:function(){var e,t,i=this,n=i.container[0];if(i.container.toggleClass("df-fullscreen",!0!==i.isFullscreen),(null==i?void 0:null===(t=i.ui)||void 0===t?void 0:null===(e=t.controls)||void 0===e?void 0:e.fullscreen)&&i.ui.controls.fullScreen.toggleClass(i.options.icons["fullscreen-off"],!0!==i.isFullscreen),!0!==i.isFullscreen){var o=null;n.requestFullscreen?o=n.requestFullscreen():n.msRequestFullscreen?o=n.msRequestFullscreen():n.mozRequestFullScreen?o=n.mozRequestFullScreen():n.webkitRequestFullscreen&&(o=n.webkitRequestFullscreen()),o&&o.then&&o.then(function(){i.refreshRequestStatus,tO.ON,i.resize()}),i.isFullscreen=!0}else i.isFullscreen=!1,document.exitFullscreen?document.fullscreenElement&&document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen&&document.webkitExitFullscreen(),tR.hasFullscreenEnabled()||i.container[0].scrollIntoView();tR.hasFullscreenEnabled()||(i.resizeRequestStatus=tO.ON)}},{key:"next",value:function(){this.jumpBy(this.jumpStep)}},{key:"prev",value:function(){this.jumpBy(-this.jumpStep)}},{key:"jumpBy",value:function(e){var t=this.currentPageNumber+e;t=tR.limitAt(t,this.startPage,this.endPage),!0!=this.anyFirstPageChanged&&(this.analytics({eventAction:this.options.analyticsFirstPageChange,options:this.options}),this.anyFirstPageChanged=!0),this.gotoPage(t),this.ui.update()}},{key:"openRight",value:function(){this.isRTL?this.prev():this.next()}},{key:"openLeft",value:function(){this.isRTL?this.next():this.prev()}},{key:"start",value:function(){this.gotoPage(this.startPage)}},{key:"end",value:function(){this.gotoPage(this.endPage)}},{key:"gotoPage",value:function(e){e=this.getValidPage(parseInt(e,10)),null!==this.viewer&&!1!==this.viewer.validatePageChange(e)&&(this.executeCallback("beforePageChanged"),this.requestDestRefKey=void 0,this.container.removeClass("df-fetch-pdf"),this.oldPageNumber=this.currentPageNumber,this.currentPageNumber=e,this.thumbRequestStatus=tO.ON,this.viewer.gotoPageCallBack&&this.viewer.gotoPageCallBack(),this.ui.update(),!0==this.autoPlay&&this.setAutoPlay(this.autoPlay),!0===this.hashNavigationEnabled&&this.getURLHash(),this.executeCallback("onPageChanged"))}},{key:"gotoPageLabel",value:function(e){this.gotoPage(this.provider.getPageNumberForLabel(e.toString().trim()))}},{key:"getCurrentLabel",value:function(){return this.provider.getLabelforPage(this.currentPageNumber)}},{key:"autoPlayFunction",value:function(){this&&this.autoPlay&&(tR.limitAt(this.currentPageNumber+this.jumpStep,this.startPage,this.endPage)!==this.currentPageNumber?this.next():this.setAutoPlay(!1))}},{key:"setAutoPlay",value:function(e){if(this.options.autoPlay){var t=(e=!0==e)?this.options.text.pause:this.options.text.play;this.ui.controls.play.toggleClass(this.options.icons.pause,e),this.ui.controls.play.html("<span>"+t+"</span>"),this.ui.controls.play.attr("title",t),clearInterval(this.autoPlayTimer),e&&(this.autoPlayTimer=setInterval(this.autoPlayFunction.bind(this),this.options.autoPlayDuration)),this.autoPlay=e}}},{key:"isValidPage",value:function(e){return this.provider._isValidPage(e)}},{key:"getValidPage",value:function(e){return isNaN(e)?e=this.currentPageNumber:e<1?e=1:e>this.pageCount&&(e=this.pageCount),e}},{key:"getURLHash",value:function(){if(null!=this.options.id){var e=tR.getSharePrefix(this.options.sharePrefix)+(null!=this.options.slug?this.options.slug:this.options.id)+"/";null!=this.currentPageNumber&&(e+=this.currentPageNumber+"/"),history.replaceState(void 0,void 0,"#"+e)}return window.location.href}},{key:"executeCallback",value:function(e){}},{key:"analytics",value:function(e){}}],function(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),t}();p.prepareOptions=function(e){e.element instanceof tk||(e.element=tk(e.element));var t=e.element;null==e.dataElement&&(e.dataElement=t);var i=e.dataElement,n=p.utils.getOptions(i),o=tk.extend(!0,{},p.defaults,e,n);o=tR.fallbackOptions(o),tR.log(o);var s=tk.extend(!0,{},p._defaults,o);return tR.isMobile&&"function"==typeof p.viewers[s.mobileViewerType]&&(s.viewerType=s.mobileViewerType),"function"!=typeof p.viewers[s.viewerType]?(console.warn("Invalid Viewer Type! "+s.viewerType+" | Using default Viewer!"),s.viewerType=p.viewers.default):s.viewerType=p.viewers[s.viewerType],s=tR.finalizeOptions(tR.sanitizeOptions(s))},p.Application=function(e){var t=p.prepareOptions(e),i=new tL(t);return e.element.data("df-app",i),null!=t.id&&!0!==t.isLightBox&&(window[t.id.toString()]=i),i},void 0!==window.jQuery&&!1==p.fakejQuery&&tk.fn.extend({dearviewer_options:function(e){return null==e&&(e={}),e.element=tk(this),new p.prepareOptions(e)},dearviewer:function(e){return null==e&&(e={}),e.element=tk(this),new p.Application(e)}});var t_=p.jQuery;function tN(e,t,i){for(var n=[],o=!1,s=0,a=0,r=0,l=void 0,h=0,u=0;u<e.length;u++){var p,c,d,f,g=function(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{},n=Object.keys(i);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(i).filter(function(e){return Object.getOwnPropertyDescriptor(i,e).enumerable}))),n.forEach(function(t){var n;n=i[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},e[u]);for(r=(a=t[u].offset)+t[u].length,!1==o&&(l=null===(p=i[h])||void 0===p?void 0:p.index,s=null===(c=i[h])||void 0===c?void 0:c.length);l>=a&&l<r;)g.searchHits||(g.searchHits=[]),g.searchHits.push({start:l-a,length:s,text:i[h].text}),1==g.searchHits.length&&n.push(g),l+s>r?(s=l+s-r,l=r,o=!0):(o=!1,l=null===(d=i[++h])||void 0===d?void 0:d.index,s=null===(f=i[h])||void 0===f?void 0:f.length)}return n}p.defaults.search=!0,tL.prototype.executeCallback=function(e){this.options&&"function"==typeof this.options[e]&&this.options[e](this)},tL.prototype.analytics=function(e){if(!0==this.options.enableAnalytics)try{var t=e.options,i=void 0;t&&(i=t.bookTitle||t.slug||t.id);var n=window.gtag;n?n("event",e.eventAction,{event_category:t.analyticsEventCategory,event_label:i}):(window.ga||window.__gaTracker)("send",{hitType:"event",eventCategory:t.analyticsEventCategory,eventAction:e.eventAction,eventLabel:i})}catch(e){}},p.executeCallback=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window;"function"==typeof t[e]&&t[e]()},p.openAttachmentLightBoxes=function(){var e=t_("body .df-auto-open-lightbox");e.length>0&&(p._isHashTriggered=!0,t_(e[0]).trigger("click"),p._isHashTriggered=!1),t_(window).on("hashchange",function(e){var t=location.hash;t&&t.length>5&&(p.hashFocusBookFound=!1,v.detectHash(),!0===p.hashFocusBookFound&&-1===window.location.hash.indexOf("/_")&&history.replaceState(void 0,void 0,window.location.href+"_"))})},e7.prototype.processCustomLinks=function(e,t){var i=this,n=this.app;if(!1!==n.options.enableAnnotation&&i._isValidPage(e)&&null!=t){var o=n.viewer.getDocumentPageNumber(e),s=n.options.links;if(null!=s&&null!=s[o])for(var a=s[o],r=0;r<a.length;r++){var l=a[r],h=void 0;l.dest&&l.dest.indexOf&&0==l.dest.indexOf("[html]")?((h=document.createElement("div")).innerHTML=l.dest.substr(6),h.className="customHtmlAnnotation"):((h=document.createElement("a")).setAttribute("dest",l.dest),h.className="customLinkAnnotation",h.href="#"+l.dest,h.onclick=function(){var e=this.getAttribute("dest");return e&&i.linkService.customNavigateTo(e),!1}),h.style.left=l.x+"%",h.style.top=l.y+"%",h.style.width=l.w+"%",h.style.height=l.h+"%",t.appendChild(h)}}},e6.prototype.processTextContent=function(e,t){var i=this,n=this.app;if(i._isValidPage(e)&&null!=t){var o=!0===n.options.enableAnnotation&&!0===n.options.enableAutoLinks;if(o||!1!==n.options.showSearchControl){var s=n.viewer.getDocumentPageNumber(e);t.innerHTML="",i.pdfDocument.getPage(s).then(function(a){var r=a.getViewport({scale:1,rotation:a._pageInfo.rotate+n.options.pageRotation});r=a.getViewport({scale:n.viewer.getTextureSize({pageNumber:e,isAnnotation:!0}).height/(r.height*n.options.pixelRatio),rotation:a._pageInfo.rotate+n.options.pageRotation}),t.parentNode.style.setProperty("--scale-factor",r.scale),a.getTextContent().then(function(a){i.prepareTextContent(a,s);var l,h=i.autoLinkItemsCache[s],u=i.autoLinkHitsCache[s],p=i.searchHitItemsCache[s],c=i.searchHits[e],d=i.textOffset[s];if(!0===o&&void 0==h){h=[],u=v.urlify(i.textContentJoined[s]);var f=i.PDFLinkItemsCache[s];f&&f.length<5&&(f=void 0),h=tN(a.items,d,u),i.autoLinkItemsCache[s]=h,i.autoLinkHitsCache[s]=u}void 0==p&&void 0!=i.textOffsetSearch[s]&&c&&c.length>0&&(p=tN(a.items,i.textOffsetSearch[s],c),i.searchHitItemsCache[s]=p),i.renderAutoLinks(h,a,t,r),i.renderSearchHits(p,a,t,r),null==n||null===(l=n.viewer)||void 0===l||l.finalizeTextContent(t,e)})})}}},e6.prototype.renderAutoLinks=function(e,t,i,n){if(e&&e.length>0){var o,s,a=t_(i).siblings(".df-auto-link-content");0===a.length&&(a=t_('<div class="df-auto-link-content">'),t_(i).parent().prepend(a)),a.html(""),t.items=e,pdfjsLib.TextLayer?s=(o=new pdfjsLib.TextLayer({textContentSource:t,viewport:n,container:a[0]})).render():s=(o=pdfjsLib.renderTextLayer({textContentSource:t,textContent:t,container:a[0],viewport:n,textDivs:[]})).promise;var r=0;s.then(function(e){var i;(null!==(i=o.textDivs)&&void 0!==i?i:o._textDivs).forEach(function(e){var i=t.items[r],n="",o=0,s=0,a=0,l="",h="";for(a=0;a<i.searchHits.length;a++)n+=i.str.substring(o,i.searchHits[a].start),o=i.searchHits[a].start,s=i.searchHits[a].length,l=i.str.substring(o,o+s),void 0!==(h=i.searchHits[a].text)&&(l.indexOf("@")>0?(h=h.toLowerCase()).indexOf(!1)&&(h="mailto:"+l):0===h.indexOf("www.")&&(h="http://"+h),n+='<a href="'+h+'" class="df-autolink" target="_blank">'+l+"</a>",v.log("AutoLink: "+h+" for "+l),o+=s);n+=i.str.substring(o,i.str.length),r++,e.innerHTML=n})})}},e6.prototype.renderSearchHits=function(e,t,i,n){if(e&&e.length>0){t.items=e,pdfjsLib.TextLayer?s=(o=new pdfjsLib.TextLayer({textContentSource:t,viewport:n,container:i})).render():s=(o=pdfjsLib.renderTextLayer({textContentSource:t,textContent:t,container:i,viewport:n,textDivs:[]})).promise;var o,s,a=0;s.then(function(){var e;(null!==(e=o.textDivs)&&void 0!==e?e:o._textDivs).forEach(function(e){var i=t.items[a],n="",o=0,s=0,r=0;for(r=0;r<i.searchHits.length;r++)n+=i.str.substring(o,i.searchHits[r].start),o=i.searchHits[r].start,s=i.searchHits[r].length,n+='<span class="df-search-highlight">'+i.str.substring(o,o+s)+"</span>",o+=s;n+=i.str.substring(o,i.str.length),a++,e.innerHTML=n,e.classList+=" df-search-hits"})})}},e6.prototype.processAnnotations=function(e,t){var i=this,n=this.app;if(!1!==n.options.enableAnnotation&&i._isValidPage(e)&&null!=t){var o=n.viewer.getDocumentPageNumber(e);i.pdfDocument.getPage(o).then(function(s){var a=s.getViewport({scale:1,rotation:s._pageInfo.rotate+n.options.pageRotation});a=s.getViewport({scale:n.viewer.getTextureSize({pageNumber:e,isAnnotation:!0}).height/(a.height*n.options.pixelRatio),rotation:s._pageInfo.rotate+n.options.pageRotation}),s.getAnnotations().then(function(r){if(null!==n.options&&null!==n.viewer&&0!=r.length){var l={annotations:r,div:t,page:s,viewport:a=a.clone({dontFlip:!0}),imageResourcesPath:n.options.imageResourcesPath,linkService:i.linkService};pdfjsLib.AnnotationLayer.hasOwnProperty("render")?pdfjsLib.AnnotationLayer.render(l):new pdfjsLib.AnnotationLayer(l).render(l),n.options.annotationClass&&""!==n.options.annotationClass&&t_(t).find(" > section").addClass(n.options.annotationClass),void 0==i.PDFLinkItemsCache[o]&&t_(t).find("a:not([href^='#'])").map(function(){return t_(this).attr("href")}).get().join(","),i.processCustomLinks(e,t),n.viewer.finalizeAnnotations(t,e)}})})}},tp.prototype.processAnnotations=function(e,t){this.processCustomLinks(e,t),this.app.viewer.finalizeAnnotations(t,e)},p.getPDFThumb=function(e){var t={};t.url=v.httpsCorrection(e.pdfURL),t.rangeChunkSize=524288,t.cMapPacked=!0,t.disableAutoFetch=!0,t.disableStream=!0,t.disableFontFace=p.defaults.disableFontFace,t.isEvalSupported=!1,t.cMapUrl=p.defaults.cMapUrl,t.imagesLocation=p.defaults.imagesLocation,t.imageResourcesPath=p.defaults.imageResourcesPath;var i=pdfjsLib.getDocument(t),n=i.promise.then(function(t){t.getPage(1).then(function(t){var o=1,s=document.createElement("canvas"),a=t.getViewport({scale:o});o=a.width>a.height?400*o/a.width:400*o/a.height,a=t.getViewport({scale:o}),s.height=Math.floor(a.height),s.width=Math.floor(a.width),t.render({canvas:s,canvasContext:s.getContext("2d"),viewport:a}).promise.then(function(){var t,o=s.toDataURL("image/jpeg",.9);null===(t=e.callback)||void 0===t||t.call(e,o),n.destroy&&n.destroy(),i.destroy&&i.destroy(),n=null,i=null})})});i.onProgress=function(t){var i=100*t.loaded/t.total;isNaN(i)?t&&t.loaded?e.updateInfo("Loading PDF "+(Math.ceil(t.loaded/1e4)/100).toFixed(2).toString()+"MB ..."):e.updateInfo("Loading PDF ..."):e.updateInfo("Loading PDF "+Math.ceil(i).toString().split(".")[0]+"% ...")}};var tA=p.jQuery,tI=window.DFLIP=window.DEARFLIP=p;window.dearPDFOpenFileOptions=p.openFileOptions,window.DEARPDF=window.DEARFLIP,tI.defaults.viewerType="flipbook",tI.defaults.analyticsEventCategory="Flipbook",tI.defaults.analyticsViewerReady="Book Ready",tI.defaults.analyticsViewerOpen="Open Book",tI.defaults.analyticsViewerClose="Book Closed",tI.defaults.analyticsFirstPageChange="First Page Flip",tI.slug="dflip",tI.locationVar="dFlipLocation",tI.locationFile="dflip",tI.PAGE_MODE={SINGLE:1,DOUBLE:2,AUTO:null},tI.SINGLE_PAGE_MODE={ZOOM:1,BOOKLET:2,AUTO:null},tI.CONTROLSPOSITION={HIDDEN:"hide",TOP:"top",BOTTOM:"bottom"},tI.DIRECTION={LTR:1,RTL:2},tI.PAGE_SIZE={AUTO:0,SINGLE:1,DOUBLEINTERNAL:2},tI.ConvertPageLinks=function(){for(var e,t=arguments[0]/100,i=arguments[1]/100,n=function(e,n,o,s,a){return{x:e/t,y:n/i,w:o/t,h:s/i,dest:a}},o=[],s=2;s<arguments.length;s++)e=arguments[s],o[s-2]=n.apply(this,e);return o},tI.parseLinks=function(e){var t;if(null!=e&&e.length>0)for(var i=0;i<e.length;i++)null!=(t=e[i])&&null!=t[0]&&null==t[0].dest&&(t=tI.ConvertPageLinks.apply(this,t),e[i]=t);return e},tI.parseFallBack=function(){tA(".df-posts").addClass("dflip-books"),tA(".dflip-books").addClass("df-posts"),tA("._df_button, ._df_thumb, ._df_custom, ._df_book, ._df_hidden, ._df_link").each(function(){var e=tA(this);"true"!==e.data("df-parsed")&&(e.addClass("df-element"),e.hasClass("_df_book")||(e.hasClass("_df_thumb")?(e.attr("data-df-lightbox","thumb"),void 0!==e.attr("thumb")&&e.data("df-thumb",e.attr("thumb"))):e.hasClass("_df_button")?e.attr("data-df-lightbox","button"):e.hasClass("_df_hidden")?e.attr("data-df-lightbox","hidden"):e.hasClass("_df_link")?e.attr("data-df-lightbox","link"):e.attr("data-df-lightbox","custom")))})},tI.parseBooks=function(){tI.parseFallBack(),tI.parseElements()};var tM=function(e){if(null!=e.source&&(Array===e.source.constructor||Array.isArray(e.source)||e.source instanceof Array)&&(e.providerType="image"),null!=e.cover3DType&&(!0==e.cover3DType||"true"==e.cover3DType?e.cover3DType=tI.FLIPBOOK_COVER_TYPE.BASIC:(!1==e.cover3DType||"false"==e.cover3DType)&&(e.cover3DType=tI.FLIPBOOK_COVER_TYPE.NONE)),void 0!==e.pageSize&&("1"===e.pageSize||1===e.pageSize||e.pageSize===tI.FLIPBOOK_PAGE_SIZE.SINGLE?e.pageSize=tI.FLIPBOOK_PAGE_SIZE.SINGLE:"2"===e.pageSize||2===e.pageSize||e.pageSize===tI.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL?e.pageSize=tI.FLIPBOOK_PAGE_SIZE.DOUBLE_INTERNAL:e.pageSize===tI.FLIPBOOK_PAGE_SIZE.DOUBLE_COVER_BACK||(e.pageSize=tI.FLIPBOOK_PAGE_SIZE.AUTO)),void 0!==e.pageMode&&("1"===e.pageMode||1===e.pageMode||e.pageMode===tI.FLIPBOOK_PAGE_MODE.SINGLE?e.pageMode=tI.FLIPBOOK_PAGE_MODE.SINGLE:"2"===e.pageMode||2===e.pageMode||e.pageMode===tI.FLIPBOOK_PAGE_MODE.DOUBLE?e.pageMode=tI.FLIPBOOK_PAGE_MODE.DOUBLE:e.pageMode=tI.FLIPBOOK_PAGE_MODE.AUTO),void 0!==e.singlePageMode&&("1"===e.singlePageMode||1===e.singlePageMode||e.singlePageMode===tI.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM?e.singlePageMode=tI.FLIPBOOK_SINGLE_PAGE_MODE.ZOOM:"2"===e.singlePageMode||2===e.singlePageMode||e.singlePageMode===tI.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET?e.singlePageMode=tI.FLIPBOOK_SINGLE_PAGE_MODE.BOOKLET:e.singlePageMode=tI.FLIPBOOK_SINGLE_PAGE_MODE.AUTO),void 0!==e.controlsPosition&&"hide"===e.controlsPosition&&(e.controlsPosition=tI.CONTROLS_POSITION.HIDDEN),void 0!==e.overwritePDFOutline&&(e.overwritePDFOutline=v.isTrue(e.overwritePDFOutline)),void 0!==e.webgl&&(e.is3D=e.webgl=e.webgl,delete e.webgl),void 0!==e.webglShadow&&(e.has3DShadow=v.isTrue(e.webglShadow),delete e.webglShadow),void 0!==e.scrollWheel&&(v.isTrue(e.scrollWheel)&&(e.mouseScrollAction=tI.MOUSE_SCROLL_ACTIONS.ZOOM),delete e.scrollWheel),void 0!==e.stiffness&&delete e.stiffness,void 0!==e.soundEnable&&(e.enableSound=v.isTrue(e.soundEnable),delete e.soundEnable),void 0!==e.enableDownload&&(e.showDownloadControl=v.isTrue(e.enableDownload),delete e.enableDownload),void 0!==e.autoEnableOutline&&(e.autoOpenOutline=v.isTrue(e.autoEnableOutline),delete e.autoEnableOutline),void 0!==e.autoEnableThumbnail&&(e.autoOpenThumbnail=v.isTrue(e.autoEnableThumbnail),delete e.autoEnableThumbnail),void 0!==e.direction&&("2"===e.direction||2===e.direction||e.direction===tI.READ_DIRECTION.RTL?e.readDirection=tI.READ_DIRECTION.RTL:e.readDirection=tI.READ_DIRECTION.LTR,delete e.direction),void 0!==e.hard&&(e.flipbookHardPages=e.hard,"hard"===e.flipbookHardPages&&(e.flipbookHardPages="all"),delete e.hard),void 0!==e.forceFit&&delete e.forceFit,"undefined"!=typeof dFlipWPGlobal&&"true"===e.wpOptions){if(!0!==e.linksparsed){e.linksparsed=!0;var t=[];try{for(var i in e.links){for(var n=e.links[i],o=[100,100],s=0;s<n.length;s++){for(var a=n[s].substr(1).slice(0,-1).split(","),r=[],l=0;l<5;l++)r[l]=a[l];o.push(r)}t[parseInt(i,10)+1]=o}}catch(e){console.error(e.stack)}e.links=tI.parseLinks(t)}}else e.links=tI.parseLinks(e.links);return v.sanitizeOptions(e)};void 0!==window.jQuery&&!1==p.fakejQuery&&tA.fn.extend({flipBook:function(e,t){return null==t&&(t={}),t.source=e,t.element=tA(this),new p.Application(t)}}),tA(document).ready(function(){var e=tA("body");tI.executeCallback("beforeDearFlipInit"),void 0!==window.dFlipWPGlobal&&tA.extend(!0,tI.defaults,tM(window.dFlipWPGlobal)),tI.initUtils(),tI.initControls(),e.on("click",".df-element[data-df-lightbox],.df-element[data-lightbox]",function(e){var t=tA(this),i=t.attr("target"),n=t.attr("href"),o=!1;"#"===n||void 0===n||t.hasClass("df-hash-focused")?o=!0:"_self"===i||"_blank"===i||(void 0==i&&"_self"===tI.defaults.targetWindow?t.attr("target","_self"):void 0==i&&"_blank"===tI.defaults.targetWindow?t.attr("target","_blank"):o=!0),o&&(e.preventDefault(),e.stopPropagation(),tI.openLightBox(t))}),e.on("click",".df-trigger",function(e){var t=tA(this).attr("df-trigger");return tA("[df-trigger-id='"+t+"']").trigger("click"),!1}),tI.checkBrowserURLforDefaults(),tI.parseCSSElements(),tI.parseFallBack(),v.detectHash(),tI.parseNormalElements(),tI.openAttachmentLightBoxes(),tI.executeCallback("afterDearFlipInit")}),v.finalizeOptions=function(e){return tM(e)},tp.prototype.processAnnotations=function(e,t){this.processCustomLinks(e,t),this.app.viewer.finalizeAnnotations(t,e)},tI.executeCallback("onDearFlipLoad")}()}();