vendor: 39,680 bytes, lines 1-6
1/*! 2 * Bootstrap v3.4.1 (https://getbootstrap.com/) 3 * Copyright 2011-2019 Twitter, Inc. 4 * Licensed under the MIT license 5 */ 6if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");!function(t){"use strict";var e=jQuery.fn.jquery.split(" ")[0].split(".");if(e[0]<2&&e[1]<9||1==e[0]&&9==e[1]&&e[2]<1||3<e[0])throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 4")}(),function(n){"use strict";n.fn.emulateTransitionEnd=function(t){var e=!1,i=this;n(this).one("bsTransitionEnd",function(){e=!0});return setTimeout(function(){e||n(i).trigger(n.support.transition.end)},t),this},n(function(){n.support.transition=function o(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(t.style[i]!==undefined)return{end:e[i]};return!1}(),n.support.transition&&(n.event.special.bsTransitionEnd={bindType:n.support.transition.end,delegateType:n.support.transition.end,handle:function(t){if(n(t.target).is(this))return t.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(s){"use strict";var e='[data-dismiss="alert"]',a=function(t){s(t).on("click",e,this.close)};a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.close=function(t){var e=s(this),i=e.attr("data-target");i||(i=(i=e.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),i="#"===i?[]:i;var o=s(document).find(i);function n(){o.detach().trigger("closed.bs.alert").remove()}t&&t.preventDefault(),o.length||(o=e.closest(".alert")),o.trigger(t=s.Event("close.bs.alert")),t.isDefaultPrevented()||(o.removeClass("in"),s.support.transition&&o.hasClass("fade")?o.one("bsTransitionEnd",n).emulateTransitionEnd(a.TRANSITION_DURATION):n())};var t=s.fn.alert;s.fn.alert=function o(i){return this.each(function(){var t=s(this),e=t.data("bs.alert");e||t.data("bs.alert",e=new a(this)),"string"==typeof i&&e[i].call(t)})},s.fn.alert.Constructor=a,s.fn.alert.noConflict=function(){return s.fn.alert=t,this},s(document).on("click.bs.alert.data-api",e,a.prototype.close)}(jQuery),function(s){"use strict";var n=function(t,e){this.$element=s(t),this.options=s.extend({},n.DEFAULTS,e),this.isLoading=!1};function i(o){return this.each(function(){var t=s(this),e=t.data("bs.button"),i="object"==typeof o&&o;e||t.data("bs.button",e=new n(this,i)),"toggle"==o?e.toggle():o&&e.setState(o)})}n.VERSION="3.4.1",n.DEFAULTS={loadingText:"loading..."},n.prototype.setState=function(t){var e="disabled",i=this.$element,o=i.is("input")?"val":"html",n=i.data();t+="Text",null==n.resetText&&i.data("resetText",i[o]()),setTimeout(s.proxy(function(){i[o](null==n[t]?this.options[t]:n[t]),"loadingText"==t?(this.isLoading=!0,i.addClass(e).attr(e,e).prop(e,!0)):this.isLoading&&(this.isLoading=!1,i.removeClass(e).removeAttr(e).prop(e,!1))},this),0)},n.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")?(i.prop("checked")&&(t=!1),e.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==i.prop("type")&&(i.prop("checked")!==this.$element.hasClass("active")&&(t=!1),this.$element.toggleClass("active")),i.prop("checked",this.$element.hasClass("active")),t&&i.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var t=s.fn.button;s.fn.button=i,s.fn.button.Constructor=n,s.fn.button.noConflict=function(){return s.fn.button=t,this},s(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(t){var e=s(t.target).closest(".btn");i.call(e,"toggle"),s(t.target).is('input[type="radio"], input[type="checkbox"]')||(t.preventDefault(),e.is("input,button")?e.trigger("focus"):e.find("input:visible,button:visible").first().trigger("focus"))}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(t){s(t.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(t.type))})}(jQuery),function(p){"use strict";var c=function(t,e){this.$element=p(t),this.$indicators=this.$element.find(".carousel-indicators"),this.options=e,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",p.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",p.proxy(this.pause,this)).on("mouseleave.bs.carousel",p.proxy(this.cycle,this))};function r(n){return this.each(function(){var t=p(this),e=t.data("bs.carousel"),i=p.extend({},c.DEFAULTS,t.data(),"object"==typeof n&&n),o="string"==typeof n?n:i.slide;e||t.data("bs.carousel",e=new c(this,i)),"number"==typeof n?e.to(n):o?e[o]():i.interval&&e.pause().cycle()})}c.VERSION="3.4.1",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(t){if(!/input|textarea/i.test(t.target.tagName)){switch(t.which){case 37:this.prev();break;case 39:this.next();break;default:return}t.preventDefault()}},c.prototype.cycle=function(t){return t||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(p.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(t){return this.$items=t.parent().children(".item"),this.$items.index(t||this.$active)},c.prototype.getItemForDirection=function(t,e){var i=this.getItemIndex(e);if(("prev"==t&&0===i||"next"==t&&i==this.$items.length-1)&&!this.options.wrap)return e;var o=(i+("prev"==t?-1:1))%this.$items.length;return this.$items.eq(o)},c.prototype.to=function(t){var e=this,i=this.getItemIndex(this.$active=this.$element.find(".item.active"));if(!(t>this.$items.length-1||t<0))return this.sliding?this.$element.one("slid.bs.carousel",function(){e.to(t)}):i==t?this.pause().cycle():this.slide(i<t?"next":"prev",this.$items.eq(t))},c.prototype.pause=function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&p.support.transition&&(this.$element.trigger(p.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){if(!this.sliding)return this.slide("next")},c.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},c.prototype.slide=function(t,e){var i=this.$element.find(".item.active"),o=e||this.getItemForDirection(t,i),n=this.interval,s="next"==t?"left":"right",a=this;if(o.hasClass("active"))return this.sliding=!1;var r=o[0],l=p.Event("slide.bs.carousel",{relatedTarget:r,direction:s});if(this.$element.trigger(l),!l.isDefaultPrevented()){if(this.sliding=!0,n&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var h=p(this.$indicators.children()[this.getItemIndex(o)]);h&&h.addClass("active")}var d=p.Event("slid.bs.carousel",{relatedTarget:r,direction:s});return p.support.transition&&this.$element.hasClass("slide")?(o.addClass(t),"object"==typeof o&&o.length&&o[0].offsetWidth,i.addClass(s),o.addClass(s),i.one("bsTransitionEnd",function(){o.removeClass([t,s].join(" ")).addClass("active"),i.removeClass(["active",s].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger(d)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(i.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger(d)),n&&this.cycle(),this}};var t=p.fn.carousel;p.fn.carousel=r,p.fn.carousel.Constructor=c,p.fn.carousel.noConflict=function(){return p.fn.carousel=t,this};var e=function(t){var e=p(this),i=e.attr("href");i&&(i=i.replace(/.*(?=#[^\s]+$)/,""));var o=e.attr("data-target")||i,n=p(document).find(o);if(n.hasClass("carousel")){var s=p.extend({},n.data(),e.data()),a=e.attr("data-slide-to");a&&(s.interval=!1),r.call(n,s),a&&n.data("bs.carousel").to(a),t.preventDefault()}};p(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),p(window).on("load",function(){p('[data-ride="carousel"]').each(function(){var t=p(this);r.call(t,t.data())})})}(jQuery),function(a){"use strict";var r=function(t,e){this.$element=a(t),this.options=a.extend({},r.DEFAULTS,e),this.$trigger=a('[data-toggle="collapse"][href="#'+t.id+'"],[data-toggle="collapse"][data-target="#'+t.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};function n(t){var e,i=t.attr("data-target")||(e=t.attr("href"))&&e.replace(/.*(?=#[^\s]+$)/,"");return a(document).find(i)}function l(o){return this.each(function(){var t=a(this),e=t.data("bs.collapse"),i=a.extend({},r.DEFAULTS,t.data(),"object"==typeof o&&o);!e&&i.toggle&&/show|hide/.test(o)&&(i.toggle=!1),e||t.data("bs.collapse",e=new r(this,i)),"string"==typeof o&&e[o]()})}r.VERSION="3.4.1",r.TRANSITION_DURATION=350,r.DEFAULTS={toggle:!0},r.prototype.dimension=function(){return this.$element.hasClass("width")?"width":"height"},r.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var t,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(t=e.data("bs.collapse"))&&t.transitioning)){var i=a.Event("show.bs.collapse");if(this.$element.trigger(i),!i.isDefaultPrevented()){e&&e.length&&(l.call(e,"hide"),t||e.data("bs.collapse",null));var o=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[o](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var n=function(){this.$element.removeClass("collapsing").addClass("collapse in")[o](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return n.call(this);var s=a.camelCase(["scroll",o].join("-"));this.$element.one("bsTransitionEnd",a.proxy(n,this)).emulateTransitionEnd(r.TRANSITION_DURATION)[o](this.$element[0][s])}}}},r.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var t=a.Event("hide.bs.collapse");if(this.$element.trigger(t),!t.isDefaultPrevented()){var e=this.dimension();this.$element[e](this.$element[e]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var i=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};if(!a.support.transition)return i.call(this);this.$element[e](0).one("bsTransitionEnd",a.proxy(i,this)).emulateTransitionEnd(r.TRANSITION_DURATION)}}},r.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},r.prototype.getParent=function(){return a(document).find(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(t,e){var i=a(e);this.addAriaAndCollapsedClass(n(i),i)},this)).end()},r.prototype.addAriaAndCollapsedClass=function(t,e){var i=t.hasClass("in");t.attr("aria-expanded",i),e.toggleClass("collapsed",!i).attr("aria-expanded",i)};var t=a.fn.collapse;a.fn.collapse=l,a.fn.collapse.Constructor=r,a.fn.collapse.noConflict=function(){return a.fn.collapse=t,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(t){var e=a(this);e.attr("data-target")||t.preventDefault();var i=n(e),o=i.data("bs.collapse")?"toggle":e.data();l.call(i,o)})}(jQuery),function(a){"use strict";var r='[data-toggle="dropdown"]',o=function(t){a(t).on("click.bs.dropdown",this.toggle)};function l(t){var e=t.attr("data-target");e||(e=(e=t.attr("href"))&&/#[A-Za-z]/.test(e)&&e.replace(/.*(?=#[^\s]*$)/,""));var i="#"!==e?a(document).find(e):null;return i&&i.length?i:t.parent()}function s(o){o&&3===o.which||(a(".dropdown-backdrop").remove(),a(r).each(function(){var t=a(this),e=l(t),i={relatedTarget:this};e.hasClass("open")&&(o&&"click"==o.type&&/input|textarea/i.test(o.target.tagName)&&a.contains(e[0],o.target)||(e.trigger(o=a.Event("hide.bs.dropdown",i)),o.isDefaultPrevented()||(t.attr("aria-expanded","false"),e.removeClass("open").trigger(a.Event("hidden.bs.dropdown",i)))))}))}o.VERSION="3.4.1",o.prototype.toggle=function(t){var e=a(this);if(!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(s(),!o){"ontouchstart"in document.documentElement&&!i.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",s);var n={relatedTarget:this};if(i.trigger(t=a.Event("show.bs.dropdown",n)),t.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),i.toggleClass("open").trigger(a.Event("shown.bs.dropdown",n))}return!1}},o.prototype.keydown=function(t){if(/(38|40|27|32)/.test(t.which)&&!/input|textarea/i.test(t.target.tagName)){var e=a(this);if(t.preventDefault(),t.stopPropagation(),!e.is(".disabled, :disabled")){var i=l(e),o=i.hasClass("open");if(!o&&27!=t.which||o&&27==t.which)return 27==t.which&&i.find(r).trigger("focus"),e.trigger("click");var n=i.find(".dropdown-menu li:not(.disabled):visible a");if(n.length){var s=n.index(t.target);38==t.which&&0<s&&s--,40==t.which&&s<n.length-1&&s++,~s||(s=0),n.eq(s).trigger("focus")}}}};var t=a.fn.dropdown;a.fn.dropdown=function e(i){return this.each(function(){var t=a(this),e=t.data("bs.dropdown");e||t.data("bs.dropdown",e=new o(this)),"string"==typeof i&&e[i].call(t)})},a.fn.dropdown.Constructor=o,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=t,this},a(document).on("click.bs.dropdown.data-api",s).on("click.bs.dropdown.data-api",".dropdown form",function(t){t.stopPropagation()}).on("click.bs.dropdown.data-api",r,o.prototype.toggle).on("keydown.bs.dropdown.data-api",r,o.prototype.keydown).on("keydown.bs.dropdown.data-api",".dropdown-menu",o.prototype.keydown)}(jQuery),function(a){"use strict";var s=function(t,e){this.options=e,this.$body=a(document.body),this.$element=a(t),this.$dialog=this.$element.find(".modal-dialog"),this.$backdrop=null,this.isShown=null,this.originalBodyPad=null,this.scrollbarWidth=0,this.ignoreBackdropClick=!1,this.fixedContent=".navbar-fixed-top, .navbar-fixed-bottom",this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};function r(o,n){return this.each(function(){var t=a(this),e=t.data("bs.modal"),i=a.extend({},s.DEFAULTS,t.data(),"object"==typeof o&&o);e||t.data("bs.modal",e=new s(this,i)),"string"==typeof o?e[o](n):i.show&&e.show(n)})}s.VERSION="3.4.1",s.TRANSITION_DURATION=300,s.BACKDROP_TRANSITION_DURATION=150,s.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},s.prototype.toggle=function(t){return this.isShown?this.hide():this.show(t)},s.prototype.show=function(i){var o=this,t=a.Event("show.bs.modal",{relatedTarget:i});this.$element.trigger(t),this.isShown||t.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.setScrollbar(),this.$body.addClass("modal-open"),this.escape(),this.resize(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.$dialog.on("mousedown.dismiss.bs.modal",function(){o.$element.one("mouseup.dismiss.bs.modal",function(t){a(t.target).is(o.$element)&&(o.ignoreBackdropClick=!0)})}),this.backdrop(function(){var t=a.support.transition&&o.$element.hasClass("fade");o.$element.parent().length||o.$element.appendTo(o.$body),o.$element.show().scrollTop(0),o.adjustDialog(),t&&o.$element[0].offsetWidth,o.$element.addClass("in"),o.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:i});t?o.$dialog.one("bsTransitionEnd",function(){o.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(s.TRANSITION_DURATION):o.$element.trigger("focus").trigger(e)}))},s.prototype.hide=function(t){t&&t.preventDefault(),t=a.Event("hide.bs.modal"),this.$element.trigger(t),this.isShown&&!t.isDefaultPrevented()&&(this.isShown=!1,this.escape(),this.resize(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"),this.$dialog.off("mousedown.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(s.TRANSITION_DURATION):this.hideModal())},s.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(t){document===t.target||this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},s.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keydown.dismiss.bs.modal",a.proxy(function(t){27==t.which&&this.hide()},this)):this.isShown||this.$element.off("keydown.dismiss.bs.modal")},s.prototype.resize=function(){this.isShown?a(window).on("resize.bs.modal",a.proxy(this.handleUpdate,this)):a(window).off("resize.bs.modal")},s.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$body.removeClass("modal-open"),t.resetAdjustments(),t.resetScrollbar(),t.$element.trigger("hidden.bs.modal")})},s.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},s.prototype.backdrop=function(t){var e=this,i=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var o=a.support.transition&&i;if(this.$backdrop=a(document.createElement("div")).addClass("modal-backdrop "+i).appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(t){this.ignoreBackdropClick?this.ignoreBackdropClick=!1:t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus():this.hide())},this)),o&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!t)return;o?this.$backdrop.one("bsTransitionEnd",t).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):t()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var n=function(){e.removeBackdrop(),t&&t()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",n).emulateTransitionEnd(s.BACKDROP_TRANSITION_DURATION):n()}else t&&t()},s.prototype.handleUpdate=function(){this.adjustDialog()},s.prototype.adjustDialog=function(){var t=this.$element[0].scrollHeight>document.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&t?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!t?this.scrollbarWidth:""})},s.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},s.prototype.checkScrollbar=function(){var t=window.innerWidth;if(!t){var e=document.documentElement.getBoundingClientRect();t=e.right-Math.abs(e.left)}this.bodyIsOverflowing=document.body.clientWidth<t,this.scrollbarWidth=this.measureScrollbar()},s.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.originalBodyPad=document.body.style.paddingRight||"";var n=this.scrollbarWidth;this.bodyIsOverflowing&&(this.$body.css("padding-right",t+n),a(this.fixedContent).each(function(t,e){var i=e.style.paddingRight,o=a(e).css("padding-right");a(e).data("padding-right",i).css("padding-right",parseFloat(o)+n+"px")}))},s.prototype.resetScrollbar=function(){this.$body.css("padding-right",this.originalBodyPad),a(this.fixedContent).each(function(t,e){var i=a(e).data("padding-right");a(e).removeData("padding-right"),e.style.paddingRight=i||""})},s.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var t=a.fn.modal;a.fn.modal=r,a.fn.modal.Constructor=s,a.fn.modal.noConflict=function(){return a.fn.modal=t,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(t){var e=a(this),i=e.attr("href"),o=e.attr("data-target")||i&&i.replace(/.*(?=#[^\s]+$)/,""),n=a(document).find(o),s=n.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(i)&&i},n.data(),e.data());e.is("a")&&t.preventDefault(),n.one("show.bs.modal",function(t){t.isDefaultPrevented()||n.one("hidden.bs.modal",function(){e.is(":visible")&&e.trigger("focus")})}),r.call(n,s,this)})}(jQuery),function(g){"use strict";var o=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],t={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function u(t,e){var i=t.nodeName.toLowerCase();if(-1!==g.inArray(i,e))return-1===g.inArray(i,a)||Boolean(t.nodeValue.match(r)||t.nodeValue.match(l));for(var o=g(e).filter(function(t,e){return e instanceof RegExp}),n=0,s=o.length;n<s;n++)if(i.match(o[n]))return!0;return!1}function n(t,e,i){if(0===t.length)return t;if(i&&"function"==typeof i)return i(t);if(!document.implementation||!document.implementation.createHTMLDocument)return t;var o=document.implementation.createHTMLDocument("sanitization");o.body.innerHTML=t;for(var n=g.map(e,function(t,e){return e}),s=g(o.body).find("*"),a=0,r=s.length;a<r;a++){var l=s[a],h=l.nodeName.toLowerCase();if(-1!==g.inArray(h,n))for(var d=g.map(l.attributes,function(t){return t}),p=[].concat(e["*"]||[],e[h]||[]),c=0,f=d.length;c<f;c++)u(d[c],p)||l.removeAttribute(d[c].nodeName);else l.parentNode.removeChild(l)}return o.body.innerHTML}var m=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.inState=null,this.init("tooltip",t,e)};m.VERSION="3.4.1",m.TRANSITION_DURATION=150,m.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0},sanitize:!0,sanitizeFn:null,whiteList:t},m.prototype.init=function(t,e,i){if(this.enabled=!0,this.type=t,this.$element=g(e),this.options=this.getOptions(i),this.$viewport=this.options.viewport&&g(document).find(g.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,g.proxy(this.toggle,this));else if("manual"!=s){var a="hover"==s?"mouseenter":"focusin",r="hover"==s?"mouseleave":"focusout";this.$element.on(a+"."+this.type,this.options.selector,g.proxy(this.enter,this)),this.$element.on(r+"."+this.type,this.options.selector,g.proxy(this.leave,this))}}this.options.selector?this._options=g.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},m.prototype.getDefaults=function(){return m.DEFAULTS},m.prototype.getOptions=function(t){var e=this.$element.data();for(var i in e)e.hasOwnProperty(i)&&-1!==g.inArray(i,o)&&delete e[i];return(t=g.extend({},this.getDefaults(),e,t)).delay&&"number"==typeof t.delay&&(t.delay={show:t.delay,hide:t.delay}),t.sanitize&&(t.template=n(t.template,t.whiteList,t.sanitizeFn)),t},m.prototype.getDelegateOptions=function(){var i={},o=this.getDefaults();return this._options&&g.each(this._options,function(t,e){o[t]!=e&&(i[t]=e)}),i},m.prototype.enter=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusin"==t.type?"focus":"hover"]=!0),e.tip().hasClass("in")||"in"==e.hoverState)e.hoverState="in";else{if(clearTimeout(e.timeout),e.hoverState="in",!e.options.delay||!e.options.delay.show)return e.show();e.timeout=setTimeout(function(){"in"==e.hoverState&&e.show()},e.options.delay.show)}},m.prototype.isInStateTrue=function(){for(var t in this.inState)if(this.inState[t])return!0;return!1},m.prototype.leave=function(t){var e=t instanceof this.constructor?t:g(t.currentTarget).data("bs."+this.type);if(e||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e)),t instanceof g.Event&&(e.inState["focusout"==t.type?"focus":"hover"]=!1),!e.isInStateTrue()){if(clearTimeout(e.timeout),e.hoverState="out",!e.options.delay||!e.options.delay.hide)return e.hide();e.timeout=setTimeout(function(){"out"==e.hoverState&&e.hide()},e.options.delay.hide)}},m.prototype.show=function(){var t=g.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(t);var e=g.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(t.isDefaultPrevented()||!e)return;var i=this,o=this.tip(),n=this.getUID(this.type);this.setContent(),o.attr("id",n),this.$element.attr("aria-describedby",n),this.options.animation&&o.addClass("fade");var s="function"==typeof this.options.placement?this.options.placement.call(this,o[0],this.$element[0]):this.options.placement,a=/\s?auto?\s?/i,r=a.test(s);r&&(s=s.replace(a,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(s).data("bs."+this.type,this),this.options.container?o.appendTo(g(document).find(this.options.container)):o.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var l=this.getPosition(),h=o[0].offsetWidth,d=o[0].offsetHeight;if(r){var p=s,c=this.getPosition(this.$viewport);s="bottom"==s&&l.bottom+d>c.bottom?"top":"top"==s&&l.top-d<c.top?"bottom":"right"==s&&l.right+h>c.width?"left":"left"==s&&l.left-h<c.left?"right":s,o.removeClass(p).addClass(s)}var f=this.getCalculatedOffset(s,l,h,d);this.applyPlacement(f,s);var u=function(){var t=i.hoverState;i.$element.trigger("shown.bs."+i.type),i.hoverState=null,"out"==t&&i.leave(i)};g.support.transition&&this.$tip.hasClass("fade")?o.one("bsTransitionEnd",u).emulateTransitionEnd(m.TRANSITION_DURATION):u()}},m.prototype.applyPlacement=function(t,e){var i=this.tip(),o=i[0].offsetWidth,n=i[0].offsetHeight,s=parseInt(i.css("margin-top"),10),a=parseInt(i.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(a)&&(a=0),t.top+=s,t.left+=a,g.offset.setOffset(i[0],g.extend({using:function(t){i.css({top:Math.round(t.top),left:Math.round(t.left)})}},t),0),i.addClass("in");var r=i[0].offsetWidth,l=i[0].offsetHeight;"top"==e&&l!=n&&(t.top=t.top+n-l);var h=this.getViewportAdjustedDelta(e,t,r,l);h.left?t.left+=h.left:t.top+=h.top;var d=/top|bottom/.test(e),p=d?2*h.left-o+r:2*h.top-n+l,c=d?"offsetWidth":"offsetHeight";i.offset(t),this.replaceArrow(p,i[0][c],d)},m.prototype.replaceArrow=function(t,e,i){this.arrow().css(i?"left":"top",50*(1-t/e)+"%").css(i?"top":"left","")},m.prototype.setContent=function(){var t=this.tip(),e=this.getTitle();this.options.html?(this.options.sanitize&&(e=n(e,this.options.whiteList,this.options.sanitizeFn)),t.find(".tooltip-inner").html(e)):t.find(".tooltip-inner").text(e),t.removeClass("fade in top bottom left right")},m.prototype.hide=function(t){var e=this,i=g(this.$tip),o=g.Event("hide.bs."+this.type);function n(){"in"!=e.hoverState&&i.detach(),e.$element&&e.$element.removeAttr("aria-describedby").trigger("hidden.bs."+e.type),t&&t()}if(this.$element.trigger(o),!o.isDefaultPrevented())return i.removeClass("in"),g.support.transition&&i.hasClass("fade")?i.one("bsTransitionEnd",n).emulateTransitionEnd(m.TRANSITION_DURATION):n(),this.hoverState=null,this},m.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},m.prototype.hasContent=function(){return this.getTitle()},m.prototype.getPosition=function(t){var e=(t=t||this.$element)[0],i="BODY"==e.tagName,o=e.getBoundingClientRect();null==o.width&&(o=g.extend({},o,{width:o.right-o.left,height:o.bottom-o.top}));var n=window.SVGElement&&e instanceof window.SVGElement,s=i?{top:0,left:0}:n?null:t.offset(),a={scroll:i?document.documentElement.scrollTop||document.body.scrollTop:t.scrollTop()},r=i?{width:g(window).width(),height:g(window).height()}:null;return g.extend({},o,a,r,s)},m.prototype.getCalculatedOffset=function(t,e,i,o){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-o,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-o/2,left:e.left-i}:{top:e.top+e.height/2-o/2,left:e.left+e.width}},m.prototype.getViewportAdjustedDelta=function(t,e,i,o){var n={top:0,left:0};if(!this.$viewport)return n;var s=this.options.viewport&&this.options.viewport.padding||0,a=this.getPosition(this.$viewport);if(/right|left/.test(t)){var r=e.top-s-a.scroll,l=e.top+s-a.scroll+o;r<a.top?n.top=a.top-r:l>a.top+a.height&&(n.top=a.top+a.height-l)}else{var h=e.left-s,d=e.left+s+i;h<a.left?n.left=a.left-h:d>a.right&&(n.left=a.left+a.width-d)}return n},m.prototype.getTitle=function(){var t=this.$element,e=this.options;return t.attr("data-original-title")||("function"==typeof e.title?e.title.call(t[0]):e.title)},m.prototype.getUID=function(t){for(;t+=~~(1e6*Math.random()),document.getElementById(t););return t},m.prototype.tip=function(){if(!this.$tip&&(this.$tip=g(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},m.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},m.prototype.enable=function(){this.enabled=!0},m.prototype.disable=function(){this.enabled=!1},m.prototype.toggleEnabled=function(){this.enabled=!this.enabled},m.prototype.toggle=function(t){var e=this;t&&((e=g(t.currentTarget).data("bs."+this.type))||(e=new this.constructor(t.currentTarget,this.getDelegateOptions()),g(t.currentTarget).data("bs."+this.type,e))),t?(e.inState.click=!e.inState.click,e.isInStateTrue()?e.enter(e):e.leave(e)):e.tip().hasClass("in")?e.leave(e):e.enter(e)},m.prototype.destroy=function(){var t=this;clearTimeout(this.timeout),this.hide(function(){t.$element.off("."+t.type).removeData("bs."+t.type),t.$tip&&t.$tip.detach(),t.$tip=null,t.$arrow=null,t.$viewport=null,t.$element=null})},m.prototype.sanitizeHtml=function(t){return n(t,this.options.whiteList,this.options.sanitizeFn)};var e=g.fn.tooltip;g.fn.tooltip=function i(o){return this.each(function(){var t=g(this),e=t.data("bs.tooltip"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.tooltip",e=new m(this,i)),"string"==typeof o&&e[o]())})},g.fn.tooltip.Constructor=m,g.fn.tooltip.noConflict=function(){return g.fn.tooltip=e,this}}(jQuery),function(n){"use strict";var s=function(t,e){this.init("popover",t,e)};if(!n.fn.tooltip)throw new Error("Popover requires tooltip.js");s.VERSION="3.4.1",s.DEFAULTS=n.extend({},n.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),((s.prototype=n.extend({},n.fn.tooltip.Constructor.prototype)).constructor=s).prototype.getDefaults=function(){return s.DEFAULTS},s.prototype.setContent=function(){var t=this.tip(),e=this.getTitle(),i=this.getContent();if(this.options.html){var o=typeof i;this.options.sanitize&&(e=this.sanitizeHtml(e),"string"===o&&(i=this.sanitizeHtml(i))),t.find(".popover-title").html(e),t.find(".popover-content").children().detach().end()["string"===o?"html":"append"](i)}else t.find(".popover-title").text(e),t.find(".popover-content").children().detach().end().text(i);t.removeClass("fade top bottom left right in"),t.find(".popover-title").html()||t.find(".popover-title").hide()},s.prototype.hasContent=function(){return this.getTitle()||this.getContent()},s.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},s.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var t=n.fn.popover;n.fn.popover=function e(o){return this.each(function(){var t=n(this),e=t.data("bs.popover"),i="object"==typeof o&&o;!e&&/destroy|hide/.test(o)||(e||t.data("bs.popover",e=new s(this,i)),"string"==typeof o&&e[o]())})},n.fn.popover.Constructor=s,n.fn.popover.noConflict=function(){return n.fn.popover=t,this}}(jQuery),function(s){"use strict";function n(t,e){this.$body=s(document.body),this.$scrollElement=s(t).is(document.body)?s(window):s(t),this.options=s.extend({},n.DEFAULTS,e),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",s.proxy(this.process,this)),this.refresh(),this.process()}function e(o){return this.each(function(){var t=s(this),e=t.data("bs.scrollspy"),i="object"==typeof o&&o;e||t.data("bs.scrollspy",e=new n(this,i)),"string"==typeof o&&e[o]()})}n.VERSION="3.4.1",n.DEFAULTS={offset:10},n.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},n.prototype.refresh=function(){var t=this,o="offset",n=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),s.isWindow(this.$scrollElement[0])||(o="position",n=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var t=s(this),e=t.data("target")||t.attr("href"),i=/^#./.test(e)&&s(e);return i&&i.length&&i.is(":visible")&&[[i[o]().top+n,e]]||null}).sort(function(t,e){return t[0]-e[0]}).each(function(){t.offsets.push(this[0]),t.targets.push(this[1])})},n.prototype.process=function(){var t,e=this.$scrollElement.scrollTop()+this.options.offset,i=this.getScrollHeight(),o=this.options.offset+i-this.$scrollElement.height(),n=this.offsets,s=this.targets,a=this.activeTarget;if(this.scrollHeight!=i&&this.refresh(),o<=e)return a!=(t=s[s.length-1])&&this.activate(t);if(a&&e<n[0])return this.activeTarget=null,this.clear();for(t=n.length;t--;)a!=s[t]&&e>=n[t]&&(n[t+1]===undefined||e<n[t+1])&&this.activate(s[t])},n.prototype.activate=function(t){this.activeTarget=t,this.clear();var e=this.selector+'[data-target="'+t+'"],'+this.selector+'[href="'+t+'"]',i=s(e).parents("li").addClass("active");i.parent(".dropdown-menu").length&&(i=i.closest("li.dropdown").addClass("active")),i.trigger("activate.bs.scrollspy")},n.prototype.clear=function(){s(this.selector).parentsUntil(this.options.target,".active").removeClass("active")};var t=s.fn.scrollspy;s.fn.scrollspy=e,s.fn.scrollspy.Constructor=n,s.fn.scrollspy.noConflict=function(){return s.fn.scrollspy=t,this},s(window).on("load.bs.scrollspy.data-api",function(){s('[data-spy="scroll"]').each(function(){var t=s(this);e.call(t,t.data())})})}(jQuery),function(r){"use strict";var a=function(t){this.element=r(t)};function e(i){return this.each(function(){var t=r(this),e=t.data("bs.tab");e||t.data("bs.tab",e=new a(this)),"string"==typeof i&&e[i]()})}a.VERSION="3.4.1",a.TRANSITION_DURATION=150,a.prototype.show=function(){var t=this.element,e=t.closest("ul:not(.dropdown-menu)"),i=t.data("target");if(i||(i=(i=t.attr("href"))&&i.replace(/.*(?=#[^\s]*$)/,"")),!t.parent("li").hasClass("active")){var o=e.find(".active:last a"),n=r.Event("hide.bs.tab",{relatedTarget:t[0]}),s=r.Event("show.bs.tab",{relatedTarget:o[0]});if(o.trigger(n),t.trigger(s),!s.isDefaultPrevented()&&!n.isDefaultPrevented()){var a=r(document).find(i);this.activate(t.closest("li"),e),this.activate(a,a.parent(),function(){o.trigger({type:"hidden.bs.tab",relatedTarget:t[0]}),t.trigger({type:"shown.bs.tab",relatedTarget:o[0]})})}}},a.prototype.activate=function(t,e,i){var o=e.find("> .active"),n=i&&r.support.transition&&(o.length&&o.hasClass("fade")||!!e.find("> .fade").length);function s(){o.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),t.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),n?(t[0].offsetWidth,t.addClass("in")):t.removeClass("fade"),t.parent(".dropdown-menu").length&&t.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),i&&i()}o.length&&n?o.one("bsTransitionEnd",s).emulateTransitionEnd(a.TRANSITION_DURATION):s(),o.removeClass("in")};var t=r.fn.tab;r.fn.tab=e,r.fn.tab.Constructor=a,r.fn.tab.noConflict=function(){return r.fn.tab=t,this};var i=function(t){t.preventDefault(),e.call(r(this),"show")};r(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',i).on("click.bs.tab.data-api",'[data-toggle="pill"]',i)}(jQuery),function(l){"use strict";var h=function(t,e){this.options=l.extend({},h.DEFAULTS,e);var i=this.options.target===h.DEFAULTS.target?l(this.options.target):l(document).find(this.options.target);this.$target=i.on("scroll.bs.affix.data-api",l.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",l.proxy(this.checkPositionWithEventLoop,this)),this.$element=l(t),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};function i(o){return this.each(function(){var t=l(this),e=t.data("bs.affix"),i="object"==typeof o&&o;e||t.data("bs.affix",e=new h(this,i)),"string"==typeof o&&e[o]()})}h.VERSION="3.4.1",h.RESET="affix affix-top affix-bottom",h.DEFAULTS={offset:0,target:window},h.prototype.getState=function(t,e,i,o){var n=this.$target.scrollTop(),s=this.$element.offset(),a=this.$target.height();if(null!=i&&"top"==this.affixed)return n<i&&"top";if("bottom"==this.affixed)return null!=i?!(n+this.unpin<=s.top)&&"bottom":!(n+a<=t-o)&&"bottom";var r=null==this.affixed,l=r?n:s.top;return null!=i&&n<=i?"top":null!=o&&t-o<=l+(r?a:e)&&"bottom"},h.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(h.RESET).addClass("affix");var t=this.$target.scrollTop(),e=this.$element.offset();return this.pinnedOffset=e.top-t},h.prototype.checkPositionWithEventLoop=function(){setTimeout(l.proxy(this.checkPosition,this),1)},h.prototype.checkPosition=function(){if(this.$element.is(":visible")){var t=this.$element.height(),e=this.options.offset,i=e.top,o=e.bottom,n=Math.max(l(document).height(),l(document.body).height());"object"!=typeof e&&(o=i=e),"function"==typeof i&&(i=e.top(this.$element)),"function"==typeof o&&(o=e.bottom(this.$element));var s=this.getState(n,t,i,o);if(this.affixed!=s){null!=this.unpin&&this.$element.css("top","");var a="affix"+(s?"-"+s:""),r=l.Event(a+".bs.affix");if(this.$element.trigger(r),r.isDefaultPrevented())return;this.affixed=s,this.unpin="bottom"==s?this.getPinnedOffset():null,this.$element.removeClass(h.RESET).addClass(a).trigger(a.replace("affix","affixed")+".bs.affix")}"bottom"==s&&this.$element.offset({top:n-t-o})}};var t=l.fn.affix;l.fn.affix=i,l.fn.affix.Constructor=h,l.fn.affix.noConflict=function(){return l.fn.affix=t,this},l(window).on("load",function(){l('[data-spy="affix"]').each(function(){var t=l(this),e=t.data();e.offset=e.offset||{},null!=e.offsetBottom&&(e.offset.bottom=e.offsetBottom),null!=e.offsetTop&&(e.offset.top=e.offsetTop),i.call(t,e)})})}(jQuery);
6 7/* 8 Sticky-kit v1.1.2 | WTFPL | Leaf Corcoran 2015 | http://leafo.net 9*/ 10(function(){var b,f;b=this.jQuery||window.jQuery;f=b(window);b.fn.stick_in_parent=function(d){var A,w,J,n,B,K,p,q,k,E,t;null==d&&(d={});t=d.sticky_class;B=d.inner_scrolling;E=d.recalc_every;k=d.parent;q=d.offset_top;p=d.spacer;w=d.bottoming;null==q&&(q=0);null==k&&(k=void 0);null==B&&(B=!0);null==t&&(t="is_stuck");A=b(document);null==w&&(w=!0);J=function(a,d,n,C,F,u,r,G){var v,H,m,D,I,c,g,x,y,z,h,l;if(!a.data("sticky_kit")){a.data("sticky_kit",!0);I=A.height();g=a.parent();null!=k&&(g=g.closest(k)); 11if(!g.length)throw"failed to find stick parent";v=m=!1;(h=null!=p?p&&a.closest(p):b("<div />"))&&h.css("position",a.css("position"));x=function(){var c,f,e;if(!G&&(I=A.height(),c=parseInt(g.css("border-top-width"),10),f=parseInt(g.css("padding-top"),10),d=parseInt(g.css("padding-bottom"),10),n=g.offset().top+c+f,C=g.height(),m&&(v=m=!1,null==p&&(a.insertAfter(h),h.detach()),a.css({position:"",top:"",width:"",bottom:""}).removeClass(t),e=!0),F=a.offset().top-(parseInt(a.css("margin-top"),10)||0)-q, 12u=a.outerHeight(!0),r=a.css("float"),h&&h.css({width:a.outerWidth(!0),height:u,display:a.css("display"),"vertical-align":a.css("vertical-align"),"float":r}),e))return l()};x();if(u!==C)return D=void 0,c=q,z=E,l=function(){var b,l,e,k;if(!G&&(e=!1,null!=z&&(--z,0>=z&&(z=E,x(),e=!0)),e||A.height()===I||x(),e=f.scrollTop(),null!=D&&(l=e-D),D=e,m?(w&&(k=e+u+c>C+n,v&&!k&&(v=!1,a.css({position:"fixed",bottom:"",top:c}).trigger("sticky_kit:unbottom"))),e<F&&(m=!1,c=q,null==p&&("left"!==r&&"right"!==r||a.insertAfter(h), 13h.detach()),b={position:"",width:"",top:""},a.css(b).removeClass(t).trigger("sticky_kit:unstick")),B&&(b=f.height(),u+q>b&&!v&&(c-=l,c=Math.max(b-u,c),c=Math.min(q,c),m&&a.css({top:c+"px"})))):e>F&&(m=!0,b={position:"fixed",top:c},b.width="border-box"===a.css("box-sizing")?a.outerWidth()+"px":a.width()+"px",a.css(b).addClass(t),null==p&&(a.after(h),"left"!==r&&"right"!==r||h.append(a)),a.trigger("sticky_kit:stick")),m&&w&&(null==k&&(k=e+u+c>C+n),!v&&k)))return v=!0,"static"===g.css("position")&&g.css({position:"relative"}), 14a.css({position:"absolute",bottom:d,top:"auto"}).trigger("sticky_kit:bottom")},y=function(){x();return l()},H=function(){G=!0;f.off("touchmove",l);f.off("scroll",l);f.off("resize",y);b(document.body).off("sticky_kit:recalc",y);a.off("sticky_kit:detach",H);a.removeData("sticky_kit");a.css({position:"",bottom:"",top:"",width:""});g.position("position","");if(m)return null==p&&("left"!==r&&"right"!==r||a.insertAfter(h),h.remove()),a.removeClass(t)},f.on("touchmove",l),f.on("scroll",l),f.on("resize", 15y),b(document.body).on("sticky_kit:recalc",y),a.on("sticky_kit:detach",H),setTimeout(l,0)}};n=0;for(K=this.length;n<K;n++)d=this[n],J(b(d));return this}}).call(this); 16 17/** 18 * Swiper 3.4.2 19 * Most modern mobile touch slider and framework with hardware accelerated transitions 20 * 21 * http://www.idangero.us/swiper/ 22 * 23 * Copyright 2017, Vladimir Kharlampidi 24 * The iDangero.us 25 * http://www.idangero.us/ 26 * 27 * Licensed under MIT 28 * 29 * Released on: March 10, 2017 30 */ 31!function(){"use strict";var e,a=function(t,s){function r(e){return Math.floor(e)}function i(){var e=x.params.autoplay,a=x.slides.eq(x.activeIndex);a.attr("data-swiper-autoplay")&&(e=a.attr("data-swiper-autoplay")||x.params.autoplay),x.autoplayTimeoutId=setTimeout(function(){x.params.loop?(x.fixLoop(),x._slideNext(),x.emit("onAutoplay",x)):x.isEnd?s.autoplayStopOnLast?x.stopAutoplay():(x._slideTo(0),x.emit("onAutoplay",x)):(x._slideNext(),x.emit("onAutoplay",x))},e)}function n(a,t){var s=e(a.target);if(!s.is(t))if("string"==typeof t)s=s.parents(t);else if(t.nodeType){var r;return s.parents().each(function(e,a){a===t&&(r=t)}),r?t:void 0}if(0!==s.length)return s[0]}function o(e,a){a=a||{};var t=window.MutationObserver||window.WebkitMutationObserver,s=new t(function(e){e.forEach(function(e){x.onResize(!0),x.emit("onObserverUpdate",x,e)})});s.observe(e,{attributes:void 0===a.attributes||a.attributes,childList:void 0===a.childList||a.childList,characterData:void 0===a.characterData||a.characterData}),x.observers.push(s)}function l(e){e.originalEvent&&(e=e.originalEvent);var a=e.keyCode||e.charCode;
31if(!x.params.allowSwipeToNext&&(x.isHorizontal()&&39===a||!x.isHorizontal()&&40===a))return!1;if(!x.params.allowSwipeToPrev&&(x.isHorizontal()&&37===a||!x.isHorizontal()&&38===a))return!1;if(!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||document.activeElement&&document.activeElement.nodeName&&("input"===document.activeElement.nodeName.toLowerCase()||"textarea"===document.activeElement.nodeName.toLowerCase()))){if(37===a||39===a||38===a||40===a){var t=!1;if(x.container.parents("."+x.params.slideClass).length>0&&0===x.container.parents("."+x.params.slideActiveClass).length)return;var s={left:window.pageXOffset,top:window.pageYOffset},r=window.innerWidth,i=window.innerHeight,n=x.container.offset();x.rtl&&(n.left=n.left-x.container[0].scrollLeft);for(var o=[[n.left,n.top],[n.left+x.width,n.top],[n.left,n.top+x.height],[n.left+x.width,n.top+x.height]],l=0;l<o.length;l++){var p=o[l];p[0]>=s.left&&p[0]<=s.left+r&&p[1]>=s.top&&p[1]<=s.top+i&&(t=!0)}if(!t)return}x.isHorizontal()?(37!==a&&39!==a||(e.preventDefault?e.preventDefault():e.returnValue=!1),(39===a&&!x.rtl||37===a&&x.rtl)&&x.slideNext(),(37===a&&!x.rtl||39===a&&x.rtl)&&x.slidePrev()):(38!==a&&40!==a||(e.preventDefault?e.preventDefault():e.returnValue=!1),40===a&&x.slideNext(),38===a&&x.slidePrev()),x.emit("onKeyPress",x,a)}}function p(e){var a=0,t=0,s=0,r=0;return"detail"in e&&(t=e.detail),"wheelDelta"in e&&(t=-e.wheelDelta/120),"wheelDeltaY"in e&&(t=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(a=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(a=t,t=0),s=10*a,r=10*t,"deltaY"in e&&(r=e.deltaY),"deltaX"in e&&(s=e.deltaX),(s||r)&&e.deltaMode&&(1===e.deltaMode?(s*=40,r*=40):(s*=800,r*=800)),s&&!a&&(a=s<1?-1:1),r&&!t&&(t=r<1?-1:1),{spinX:a,spinY:t,pixelX:s,pixelY:r}}function d(e){e.originalEvent&&(e=e.originalEvent);var a=0,t=x.rtl?-1:1,s=p(e);if(x.params.mousewheelForceToAxis)if(x.isHorizontal()){if(!(Math.abs(s.pixelX)>Math.abs(s.pixelY)))return;a=s.pixelX*t}else{if(!(Math.abs(s.pixelY)>Math.abs(s.pixelX)))return;a=s.pixelY}else a=Math.abs(s.pixelX)>Math.abs(s.pixelY)?-s.pixelX*t:-s.pixelY;if(0!==a){if(x.params.mousewheelInvert&&(a=-a),x.params.freeMode){var r=x.getWrapperTranslate()+a*x.params.mousewheelSensitivity,i=x.isBeginning,n=x.isEnd;if(r>=x.minTranslate()&&(r=x.minTranslate()),r<=x.maxTranslate()&&(r=x.maxTranslate()),x.setWrapperTransition(0),x.setWrapperTranslate(r),x.updateProgress(),x.updateActiveIndex(),(!i&&x.isBeginning||!n&&x.isEnd)&&x.updateClasses(),x.params.freeModeSticky?(clearTimeout(x.mousewheel.timeout),x.mousewheel.timeout=setTimeout(function(){x.slideReset()},300)):x.params.lazyLoading&&x.lazy&&x.lazy.load(),x.emit("onScroll",x,e),x.params.autoplay&&x.params.autoplayDisableOnInteraction&&x.stopAutoplay(),0===r||r
31===x.maxTranslate())return}else{if((new window.Date).getTime()-x.mousewheel.lastScrollTime>60)if(a<0)if(x.isEnd&&!x.params.loop||x.animating){if(x.params.mousewheelReleaseOnEdges)return!0}else x.slideNext(),x.emit("onScroll",x,e);else if(x.isBeginning&&!x.params.loop||x.animating){if(x.params.mousewheelReleaseOnEdges)return!0}else x.slidePrev(),x.emit("onScroll",x,e);x.mousewheel.lastScrollTime=(new window.Date).getTime()}return e.preventDefault?e.preventDefault():e.returnValue=!1,!1}}function m(a,t){a=e(a);var s,r,i,n=x.rtl?-1:1;s=a.attr("data-swiper-parallax")||"0",r=a.attr("data-swiper-parallax-x"),i=a.attr("data-swiper-parallax-y"),r||i?(r=r||"0",i=i||"0"):x.isHorizontal()?(r=s,i="0"):(i=s,r="0"),r=r.indexOf("%")>=0?parseInt(r,10)*t*n+"%":r*t*n+"px",i=i.indexOf("%")>=0?parseInt(i,10)*t+"%":i*t+"px",a.transform("translate3d("+r+", "+i+",0px)")}function u(e){return 0!==e.indexOf("on")&&(e=e[0]!==e[0].toUpperCase()?"on"+e[0].toUpperCase()+e.substring(1):"on"+e),e}if(!(this instanceof a))return new a(t,s);var c={direction:"horizontal",touchEventsTarget:"container",initialSlide:0,speed:300,autoplay:!1,autoplayDisableOnInteraction:!0,autoplayStopOnLast:!1,iOSEdgeSwipeDetection:!1,iOSEdgeSwipeThreshold:20,freeMode:!1,freeModeMomentum:!0,freeModeMomentumRatio:1,freeModeMomentumBounce:!0,freeModeMomentumBounceRatio:1,freeModeMomentumVelocityRatio:1,freeModeSticky:!1,freeModeMinimumVelocity:.02,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",coverflow:{rotate:50,stretch:0,depth:100,modifier:1,slideShadows:!0},flip:{slideShadows:!0,limitRotation:!0},cube:{slideShadows:!0,shadow:!0,shadowOffset:20,shadowScale:.94},fade:{crossFade:!1},parallax:!1,zoom:!1,zoomMax:3,zoomMin:1,zoomToggle:!0,scrollbar:null,scrollbarHide:!0,scrollbarDraggable:!1,scrollbarSnapOnRelease:!1,keyboardControl:!1,mousewheelControl:!1,mousewheelReleaseOnEdges:!1,mousewheelInvert:!1,mousewheelForceToAxis:!1,mousewheelSensitivity:1,mousewheelEventsTarged:"container",hashnav:!1,hashnavWatchState:!1,history:!1,replaceState:!1,breakpoints:void 0,spaceBetween:0,slidesPerView:1,slidesPerColumn:1,slidesPerColumnFill:"column",slidesPerGroup:1,centeredSlides:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,onlyExternal:!1,threshold:0,touchMoveStopPropagation:!0,touchReleaseOnEdges:!1,uniqueNavElements:!0,pagination:null,paginationElement:"span",paginationClickable:!1,paginationHide:!1,paginationBulletRender:null,paginationProgressRender:null,paginationFractionRender:null,paginationCustomRender:null,paginationType:"bullets",resistance:!0,resistanceRatio:.85,nextButton:null,prevButton:null,watchSlidesProgress:!1,watchSlidesVisibility:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,lazyLoading:!1,lazyLoadingInPrevNext:!1,lazyLoadingInPrevNextAmount:1,lazyLoadingOnTransitionStart:!1,preloadImages:!0,updateOnImagesReady:!0,loop:!1,loopAdditionalSlides:0,loopedSlides:null,control:void 0,controlInverse:!1,controlBy:"slide",normalizeSlideIndex:!0,allowSwipeToPrev:!0,allowSwipeToNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",passiveListeners:!0,containerModifierClass:"swiper-container-",slideClass:"swiper-slide",slideActiveClass:"swiper-slide-active",slideDuplicateActiveClass:"swiper-slide-duplicate-active",slideVisibleClass:"swiper-slide-visible",slideDuplicateClass:"swiper-slide-duplicate",slideNextClass:"swiper-slide-next",slideDuplicateNextClass:"swiper-slide-duplicate-next",slidePrevClass:"swiper-slide-prev",slideDuplicatePrevClass:"swiper-slide-duplicate-prev",wrapperClass:"swiper-wrapper",bulletClass:"swiper-pagination-bullet",bulletActiveClass:"swiper-pagination-bullet-active",buttonDisabledClass:"swiper-button-disabled",paginationCurrentClass:"swiper-pagination-current",paginationTotalClass:"swiper-pagination-total",paginationHiddenClass:"swiper-pagination-hidden",paginationProgressbarClass:"swiper-pagination-progressbar",paginationClickableClass:"swiper-pagination-clickable",paginationModifierClass:"swiper-pagination-",lazyLoadingClass:"swiper-lazy",lazyStatusLoadingClass:"swiper-lazy-loading",lazyStatusLoadedClass:"swiper-lazy-loaded",lazyPreloaderClass:"swiper-lazy-preloader",notificationClass:"swiper-notification",preloaderClass:"preloader",zoomContainerClass:"swiper-zoom-container",observer:!1,observeParents:!1,a11y:!1,prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",runCallbacksOnInit:!0},g=s&&s.virtualTranslate;s=s||{};var h={};for(var v in s)if("object"!=typeof s[v]||null===s[v]||(s[v].nodeType||s[v]===window||s[v]===document||"undefined"!=typeof Dom7&&s[v]instanceof Dom7||"undefined"!=typeof jQuery&&s[v]instanceof jQuery))h[v]=s[v];else{h[v]={};for(var f in s[v])h[v][f]=s[v][f]}for(var w in c)if(void 0===s[w])s[w]=c[w];else if("object"==typeof s[w])for(var y in c[w])void 0===s[w][y]&&(s[w][y]=c[w][y]);var x=this;if(x.params=s,x.originalParams=h,x.classNames=[],void 0!==e&&"undefined"!=typeof Dom7&&(e=Dom7),(void 0!==e||(e="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7))&&(x.$=e,x.currentBreakpoint=void 0,x.getActiveBreakpoint=function(){if(!x.params.breakpoints)return!1;var e,a=!1,t=[];for(e in x.params.breakpoints)x.params.breakpoints.hasOwnProperty(e)&&t.push(e);t.sort(function(e,a){return parseInt(e,10)>parseInt(a,10)});for(var s=0;s<t.length;s++)(e=t[s])>=window.innerWidth&&!a&&(a=e);return a||"max"},x.setBreakpoint=function(){var e=x.getActiveBreakpoint();if(e&&x.currentBreakpoint!==e){var a=e in x.params.breakpoints?x.params.breakpoints[e]:x.originalParams,t=x.params.loop&&a.slidesPerView!==x.params.slidesPerView;for(var s in a)x.params[s]=a[s];x.currentBreakpoint=e,t&&x.destroyLoop&&x.reLoop(!0)}},x.params.breakpoints&&x.setBreakpoint(),x.container=e(t),0!==x.container.length)){if(x.container.length>1){var T=[];return x.container.each(function(){T.push(new a(this,s))}),T}
31x.container[0].swiper=x,x.container.data("swiper",x),x.classNames.push(x.params.containerModifierClass+x.params.direction),x.params.freeMode&&x.classNames.push(x.params.containerModifierClass+"free-mode"),x.support.flexbox||(x.classNames.push(x.params.containerModifierClass+"no-flexbox"),x.params.slidesPerColumn=1),x.params.autoHeight&&x.classNames.push(x.params.containerModifierClass+"autoheight"),(x.params.parallax||x.params.watchSlidesVisibility)&&(x.params.watchSlidesProgress=!0),x.params.touchReleaseOnEdges&&(x.params.resistanceRatio=0),["cube","coverflow","flip"].indexOf(x.params.effect)>=0&&(x.support.transforms3d?(x.params.watchSlidesProgress=!0,x.classNames.push(x.params.containerModifierClass+"3d")):x.params.effect="slide"),"slide"!==x.params.effect&&x.classNames.push(x.params.containerModifierClass+x.params.effect),"cube"===x.params.effect&&(x.params.resistanceRatio=0,x.params.slidesPerView=1,x.params.slidesPerColumn=1,x.params.slidesPerGroup=1,x.params.centeredSlides=!1,x.params.spaceBetween=0,x.params.virtualTranslate=!0),"fade"!==x.params.effect&&"flip"!==x.params.effect||(x.params.slidesPerView=1,x.params.slidesPerColumn=1,x.params.slidesPerGroup=1,x.params.watchSlidesProgress=!0,x.params.spaceBetween=0,void 0===g&&(x.params.virtualTranslate=!0)),x.params.grabCursor&&x.support.touch&&(x.params.grabCursor=!1),x.wrapper=x.container.children("."+x.params.wrapperClass),x.params.pagination&&(x.paginationContainer=e(x.params.pagination),x.params.uniqueNavElements&&"string"==typeof x.params.pagination&&x.paginationContainer.length>1&&1===x.container.find(x.params.pagination).length&&(x.paginationContainer=x.container.find(x.params.pagination)),"bullets"===x.params.paginationType&&x.params.paginationClickable?x.paginationContainer.addClass(x.params.paginationModifierClass+"clickable"):x.params.paginationClickable=!1,x.paginationContainer.addClass(x.params.paginationModifierClass+x.params.paginationType)),(x.params.nextButton||x.params.prevButton)&&(x.params.nextButton&&(x.nextButton=e(x.params.nextButton),x.params.uniqueNavElements&&"string"==typeof x.params.nextButton&&x.nextButton.length>1&&1===x.container.find(x.params.nextButton).length&&(x.nextButton=x.container.find(x.params.nextButton))),x.params.prevButton&&(x.prevButton=e(x.params.prevButton),x.params.uniqueNavElements&&"string"==typeof x.params.prevButton&&x.prevButton.length>1&&1===x.container.find(x.params.prevButton).length&&(x.prevButton=x.container.find(x.params.prevButton)))),x.isHorizontal=function(){return"horizontal"===x.params.direction},x.rtl=x.isHorizontal()&&("rtl"===x.container[0].dir.toLowerCase()||"rtl"===x.c
31ontainer.css("direction")),x.rtl&&x.classNames.push(x.params.containerModifierClass+"rtl"),x.rtl&&(x.wrongRTL="-webkit-box"===x.wrapper.css("display")),x.params.slidesPerColumn>1&&x.classNames.push(x.params.containerModifierClass+"multirow"),x.device.android&&x.classNames.push(x.params.containerModifierClass+"android"),x.container.addClass(x.classNames.join(" ")),x.translate=0,x.progress=0,x.velocity=0,x.lockSwipeToNext=function(){x.params.allowSwipeToNext=!1,x.params.allowSwipeToPrev===!1&&x.params.grabCursor&&x.unsetGrabCursor()},x.lockSwipeToPrev=function(){x.params.allowSwipeToPrev=!1,x.params.allowSwipeToNext===!1&&x.params.grabCursor&&x.unsetGrabCursor()},x.lockSwipes=function(){x.params.allowSwipeToNext=x.params.allowSwipeToPrev=!1,x.params.grabCursor&&x.unsetGrabCursor()},x.unlockSwipeToNext=function(){x.params.allowSwipeToNext=!0,x.params.allowSwipeToPrev===!0&&x.params.grabCursor&&x.setGrabCursor()},x.unlockSwipeToPrev=function(){x.params.allowSwipeToPrev=!0,x.params.allowSwipeToNext===!0&&x.params.grabCursor&&x.setGrabCursor()},x.unlockSwipes=function(){x.params.allowSwipeToNext=x.params.allowSwipeToPrev=!0,x.params.grabCursor&&x.setGrabCursor()},x.setGrabCursor=function(e){x.container[0].style.cursor="move",x.container[0].style.cursor=e?"-webkit-grabbing":"-webkit-grab",x.container[0].style.cursor=e?"-moz-grabbin":"-moz-grab",x.container[0].style.cursor=e?"grabbing":"grab"},x.unsetGrabCursor=function(){x.container[0].style.cursor=""},x.params.grabCursor&&x.setGrabCursor(),x.imagesToLoad=[],x.imagesLoaded=0,x.loadImage=function(e,a,t,s,r,i){function n(){i&&i()}var o;e.complete&&r?n():a?(o=new window.Image,o.onload=n,o.onerror=n,s&&(o.sizes=s),t&&(o.srcset=t),a&&(o.src=a)):n()},x.preloadImages=function(){function e(){void 0!==x&&null!==x&&x&&(void 0!==x.imagesLoaded&&x.imagesLoaded++,x.imagesLoaded===x.imagesToLoad.length&&(x.params.updateOnImagesReady&&x.update(),x.emit("onImagesReady",x)))}x.imagesToLoad=x.container.find("img");for(var a=0;a<x.imagesToLoad.length;a++)x.loadImage(x.imagesToLoad[a],x.imagesToLoad[a].currentSrc||x.imagesToLoad[a].getAttribute("src"),x.imagesToLoad[a].srcset||x.imagesToLoad[a].getAttribute("srcset"),x.imagesToLoad[a].sizes||x.imagesToLoad[a].getAttribute("sizes"),!0,e)},x.autoplayTimeoutId=void 0,x.autoplaying=!1,x.autoplayPaused=!1,x.startAutoplay=function(){return void 0===x.autoplayTimeoutId&&(!!x.params.autoplay&&(!x.autoplaying&&(x.autoplaying=!0,x.emit("onAutoplayStart",x),void i())))},x.stopAutoplay=function(e){x.autoplayTimeoutId&&(x.autoplayTimeoutId&&clearTimeout(x.autoplayTimeoutId),x.autoplaying=!1,x.autoplayTimeoutId=void 0,x.emit("onAutoplayStop",x))},x.pauseAutoplay=function(e){x.autoplayPaused||(x.autoplayTimeoutId&&clearTimeout(x.autoplayTimeoutId),x.autoplayPaused=!0,0===e?(x.autoplayPaused=!1,i()):x.wrapper.transitionEnd(function(){x&&(x.autoplayPaused=!1,x.autoplaying?i():x.stopAutoplay())}))},x.minTranslate=function(){return-x.snapGrid[0]},x.maxTranslate=function(){return-x.snapGrid[x.snapGrid.length-1]},x.updateAutoHeight=function(){var e,a=[],t=0;if("auto"!==x.params.slidesPerView&&x.params.slidesPerView>1)for(e=0;e<Math.ceil(x.params.slidesPerView);e++){var s=x.activeIndex+e;if(s>x.slides.length)break;a.push(x.slides.eq(s)[0])}else a.push(x.slides.eq(x.activeIndex)[0]);for(e=0;e<a.length;e++)if(void 0!==a[e]){var r=a[e].offsetHeight;t=r>t?r:t}t&&x.wrapper.css("height",t+"px")},x.updateContainerSize=function(){var e,a;e=void 0!==x.params.width?x.params.width:x.container[0].clientWidth,a=void 0!==x.params.height?x.params.height:x.container[0].clientHeight,0===e&&x.isHorizontal()||0===a&&!x.isHorizontal()||(e=e-parseInt(x.container.css("padding-left"),10)-parseInt(x.container.css("padding-right"),10),a=a-parseInt(x.container.css("padding-top"),10)-parseInt(x.container.css("padding-bottom"),10),x.width=e,x.height=a,x.size=x.isHorizontal()?x.width:x.height)},x.updateSlidesSize=function(){x.slides=x.wrapper.children("."+x.params.slideClass),x.snapGrid=[],x.slidesGrid=[],x.slidesSizesGrid=[];var e,a=x.params.spaceBetween,t=-x.params.slidesOffsetBefore,s=0,i=0;if(void 0!==x.size){"string"==typeof a&&a.indexOf("%")>=0&&(a=parseFloat(a.replace("%",""))/100*x.size),x.virtualSize=-a,x.rtl?x.slides.css({marginLeft:"",marginTop:""}):x.slides.css({marginRight:"",marginBottom:""});var n;x.params.slidesPerColumn>1&&(n=Math.floor(x.slides.length/x.params.slidesPerColumn)===x.slides.length/x.params.slidesPerColumn?x.slides.length:Math.ceil(x.slides.length/x.params.slidesPerColumn)*x.params.slidesPerColumn,"auto"!==x.params.slidesPerView&&"row"===x.params.slidesPerColumnFill&&(n=Math.max(n,x.params.slidesPerView*x.params.slidesPerColumn)));var o,l=x.params.slidesPerColumn,p=n/l,d=p-(x.params.slidesPerColumn*p-x.slides.length);for(e=0;e<x.slides.length;e++){o=0;var m=x.slides.eq(e);
31if(x.params.slidesPerColumn>1){var u,c,g;"column"===x.params.slidesPerColumnFill?(c=Math.floor(e/l),g=e-c*l,(c>d||c===d&&g===l-1)&&++g>=l&&(g=0,c++),u=c+g*n/l,m.css({"-webkit-box-ordinal-group":u,"-moz-box-ordinal-group":u,"-ms-flex-order":u,"-webkit-order":u,order:u})):(g=Math.floor(e/p),c=e-g*p),m.css("margin-"+(x.isHorizontal()?"top":"left"),0!==g&&x.params.spaceBetween&&x.params.spaceBetween+"px").attr("data-swiper-column",c).attr("data-swiper-row",g)}"none"!==m.css("display")&&("auto"===x.params.slidesPerView?(o=x.isHorizontal()?m.outerWidth(!0):m.outerHeight(!0),x.params.roundLengths&&(o=r(o))):(o=(x.size-(x.params.slidesPerView-1)*a)/x.params.slidesPerView,x.params.roundLengths&&(o=r(o)),x.isHorizontal()?x.slides[e].style.width=o+"px":x.slides[e].style.height=o+"px"),x.slides[e].swiperSlideSize=o,x.slidesSizesGrid.push(o),x.params.centeredSlides?(t=t+o/2+s/2+a,0===s&&0!==e&&(t=t-x.size/2-a),0===e&&(t=t-x.size/2-a),Math.abs(t)<.001&&(t=0),i%x.params.slidesPerGroup==0&&x.snapGrid.push(t),x.slidesGrid.push(t)):(i%x.params.slidesPerGroup==0&&x.snapGrid.push(t),x.slidesGrid.push(t),t=t+o+a),x.virtualSize+=o+a,s=o,i++)}x.virtualSize=Math.max(x.virtualSize,x.size)+x.params.slidesOffsetAfter;var h;if(x.rtl&&x.wrongRTL&&("slide"===x.params.effect||"coverflow"===x.params.effect)&&x.wrapper.css({width:x.virtualSize+x.params.spaceBetween+"px"}),x.support.flexbox&&!x.params.setWrapperSize||(x.isHorizontal()?x.wrapper.css({width:x.virtualSize+x.params.spaceBetween+"px"}):x.wrapper.css({height:x.virtualSize+x.params.spaceBetween+"px"})),x.params.slidesPerColumn>1&&(x.virtualSize=(o+x.params.spaceBetween)*n,x.virtualSize=Math.ceil(x.virtualSize/x.params.slidesPerColumn)-x.params.spaceBetween,x.isHorizontal()?x.wrapper.css({width:x.virtualSize+x.params.spaceBetween+"px"}):x.wrapper.css({height:x.virtualSize+x.params.spaceBetween+"px"}),x.params.centeredSlides)){for(h=[],e=0;e<x.snapGrid.length;e++)x.snapGrid[e]<x.virtualSize+x.snapGrid[0]&&h.push(x.snapGrid[e]);x.snapGrid=h}if(!x.params.centeredSlides){for(h=[],e=0;e<x.snapGrid.length;e++)x.snapGrid[e]<=x.virtualSize-x.size&&h.push(x.snapGrid[e]);x.snapGrid=h,Math.floor(x.virtualSize-x.size)-Math.floor(x.snapGrid[x.snapGrid.length-1])>1&&x.snapGrid.push(x.virtualSize-x.size)}0===x.snapGrid.length&&(x.snapGrid=[0]),0!==x.params.spaceBetween&&(x.isHorizontal()?x.rtl?x.slides.css({marginLeft:a+"px"}):x.slides.css({marginRight:a+"px"}):x.slides.css({marginBottom:a+"px"})),x.params.watchSlidesProgress&&x.updateSlidesOffset()}},x.updateSlidesOffset=function(){for(var e=0;e<x.slides.length;e++)x.slides[e].swiperSlideOffset=x.isHorizontal()?x.slides[e].offsetLeft:x.slides[e].offsetTop},x.currentSlidesPerView=function(){var e,a,t=1;if(x.params.centeredSlides){var s,r=x.slides[x.activeIndex].swiperSlideSize;for(e=x.activeIndex+1;e<x.slides.length;e++)x.slides[e]&&!s&&(r+=x.slides[e].swiperSlideSize,t++,r>x.size&&(s=!0));for(a=x.activeIndex-1;a>=0;a--)x.slides[a]&&!s&&(r+=x.slides[a].swiperSlideSize,t++,r>x.size&&(s=!0))}else for(e=x.activeIndex+1;e<x.slides.length;e++)x.slidesGrid[e]-x.slidesGrid[x.activeIndex]<x.size&&t++;return t},x.updateSlidesProgress=function(e){if(void 0===e&&(e=x.translate||0),0!==x.slides.length){void 0===x.slides[0].swiperSlideOffset&&x.updateSlidesOffset();var a=-e;x.rtl&&(a=e),x.slides.removeClass(x.params.slideVisibleClass);for(var t=0;t<x.slides.length;t++){var s=x.slides[t],r=(a+(x.params.centeredSlides?x.minTranslate():0)-s.swiperSlideOffset)/(s.swiperSlideSize+x.params.spaceBetween);if(x.params.watchSlidesVisibility){var i=-(a-s.swiperSlideOffset),n=i+x.slidesSizesGrid[t];(i>=0&&i<x.size||n>0&&n<=x.size||i<=0&&n>=x.size)&&x.slides.eq(t).addClass(x.params.slideVisibleClass)}s.progress=x.rtl?-r:r}}},x.updateProgress=function(e){void 0===e&&(e=x.translate||0);var a=x.maxTranslate()-x.minTranslate(),t=x.isBeginning,s=x.isEnd;0===a?(x.progress=0,x.isBeginning=x.isEnd=!0):(x.progress=(e-x.minTranslate())/a,x.isBeginning=x.progress<=0,x.isEnd=x.progress>=1),x.isBeginning&&!t&&x.emit("onReachBeginning",x),x.isEnd&&!s&&x.emit("onReachEnd",x),x.params.watchSlidesProgress&&x.updateSlidesProgress(e),x.emit("onProgress",x,x.progress)},x.updateActiveIndex=function(){var e,a,t,s=x.rtl?x.translate:-x.translate;
31for(a=0;a<x.slidesGrid.length;a++)void 0!==x.slidesGrid[a+1]?s>=x.slidesGrid[a]&&s<x.slidesGrid[a+1]-(x.slidesGrid[a+1]-x.slidesGrid[a])/2?e=a:s>=x.slidesGrid[a]&&s<x.slidesGrid[a+1]&&(e=a+1):s>=x.slidesGrid[a]&&(e=a);x.params.normalizeSlideIndex&&(e<0||void 0===e)&&(e=0),t=Math.floor(e/x.params.slidesPerGroup),t>=x.snapGrid.length&&(t=x.snapGrid.length-1),e!==x.activeIndex&&(x.snapIndex=t,x.previousIndex=x.activeIndex,x.activeIndex=e,x.updateClasses(),x.updateRealIndex())},x.updateRealIndex=function(){x.realIndex=parseInt(x.slides.eq(x.activeIndex).attr("data-swiper-slide-index")||x.activeIndex,10)},x.updateClasses=function(){x.slides.removeClass(x.params.slideActiveClass+" "+x.params.slideNextClass+" "+x.params.slidePrevClass+" "+x.params.slideDuplicateActiveClass+" "+x.params.slideDuplicateNextClass+" "+x.params.slideDuplicatePrevClass);var a=x.slides.eq(x.activeIndex);a.addClass(x.params.slideActiveClass),s.loop&&(a.hasClass(x.params.slideDuplicateClass)?x.wrapper.children("."+x.params.slideClass+":not(."+x.params.slideDuplicateClass+')[data-swiper-slide-index="'+x.realIndex+'"]').addClass(x.params.slideDuplicateActiveClass):x.wrapper.children("."+x.params.slideClass+"."+x.params.slideDuplicateClass+'[data-swiper-slide-index="'+x.realIndex+'"]').addClass(x.params.slideDuplicateActiveClass));var t=a.next("."+x.params.slideClass).addClass(x.params.slideNextClass);x.params.loop&&0===t.length&&(t=x.slides.eq(0),t.addClass(x.params.slideNextClass));var r=a.prev("."+x.params.slideClass).addClass(x.params.slidePrevClass);if(x.params.loop&&0===r.length&&(r=x.slides.eq(-1),r.addClass(x.params.slidePrevClass)),s.loop&&(t.hasClass(x.params.slideDuplicateClass)?x.wrapper.children("."+x.params.slideClass+":not(."+x.params.slideDuplicateClass+')[data-swiper-slide-index="'+t.attr("data-swiper-slide-index")+'"]').addClass(x.params.slideDuplicateNextClass):x.wrapper.children("."+x.params.slideClass+"."+x.params.slideDuplicateClass+'[data-swiper-slide-index="'+t.attr("data-swiper-slide-index")+'"]').addClass(x.params.slideDuplicateNextClass),r.hasClass(x.params.slideDuplicateClass)?x.wrapper.children("."+x.params.slideClass+":not(."+x.params.slideDuplicateClass+')[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(x.params.slideDuplicatePrevClass):x.wrapper.children("."+x.params.slideClass+"."+x.params.slideDuplicateClass+'[data-swiper-slide-index="'+r.attr("data-swiper-slide-index")+'"]').addClass(x.params.slideDuplicatePrevClass)),x.paginationContainer&&x.paginationContainer.length>0){var i,n=x.params.loop?Math.ceil((x.slides.length-2*x.loopedSlides)/x.params.slidesPerGroup):x.snapGrid.length;if(x.params.loop?(i=Math.ceil((x.activeIndex-x.loopedSlides)/x.params.slidesPerGroup),i>x.slides.length-1-2*x.loopedSlides&&(i-=x.slides.length-2*x.loopedSlides),i>n-1&&(i-=n),i<0&&"bullets"!==x.params.paginationType&&(i=n+i)):i=void 0!==x.snapIndex?x.snapIndex:x.activeIndex||0,"bullets"===x.params.paginationType&&x.bullets&&x.bullets.length>0&&(x.bullets.removeClass(x.params.bulletActiveClass),x.paginationContainer.length>1?x.bullets.each(function(){e(this).index()===i&&e(this).addClass(x.params.bulletActiveClass)}):x.bullets.eq(i).addClass(x.params.bulletActiveClass)),"fraction"===x.params.paginationType&&(x.paginationContainer.find("."+x.params.paginationCurrentClass).text(i+1),x.paginationContainer.find("."+x.params.paginationTotalClass).text(n)),"progress"===x.params.paginationType){var o=(i+1)/n,l=o,p=1;x.isHorizontal()||(p=o,l=1),x.paginationContainer.find("."+x.params.paginationProgressbarClass).transform("translate3d(0,0,0) scaleX("+l+") scaleY("+p+")").transition(x.params.speed)}"custom"===x.params.paginationType&&x.params.paginationCustomRender&&(x.paginationContainer.html(x.params.paginationCustomRender(x,i+1,n)),x.emit("onPaginationRendered",x,x.paginationContainer[0]))}x.params.loop||(x.params.prevButton&&x.prevButton&&x.prevButton.length>0&&(x.isBeginning?(x.prevButton.addClass(x.params.buttonDisabledClass),x.params.a11y&&x.a11y&&x.a11y.disable(x.prevButton)):(x.prevButton.removeClass(x.params.buttonDisabledClass),x.params.a11y&&x.a11y&&x.a11y.enable(x.prevButton))),x.params.nextButton&&x.nextButton&&x.nextButton.length>0&&(x.isEnd?(x.nextButton.addClass(x.params.buttonDisabledClass),x.params.a11y&&x.a11y&&x.a11y.disable(x.nextButton)):(x.nextButton.removeClass(x.params.buttonDisabledClass),x.params.a11y&&x.a11y&&x.a11y.enable(x.nextButton))))},x.updatePagination=function(){if(x.params.pagination&&x.paginationContainer&&x.paginationContainer.length>0){var e="";if("bullets"===x.params.paginationType){for(var a=x.params.loop?Math.
31ceil((x.slides.length-2*x.loopedSlides)/x.params.slidesPerGroup):x.snapGrid.length,t=0;t<a;t++)e+=x.params.paginationBulletRender?x.params.paginationBulletRender(x,t,x.params.bulletClass):"<"+x.params.paginationElement+' class="'+x.params.bulletClass+'"></'+x.params.paginationElement+">";x.paginationContainer.html(e),x.bullets=x.paginationContainer.find("."+x.params.bulletClass),x.params.paginationClickable&&x.params.a11y&&x.a11y&&x.a11y.initPagination()}"fraction"===x.params.paginationType&&(e=x.params.paginationFractionRender?x.params.paginationFractionRender(x,x.params.paginationCurrentClass,x.params.paginationTotalClass):'<span class="'+x.params.paginationCurrentClass+'"></span> / <span class="'+x.params.paginationTotalClass+'"></span>',x.paginationContainer.html(e)),"progress"===x.params.paginationType&&(e=x.params.paginationProgressRender?x.params.paginationProgressRender(x,x.params.paginationProgressbarClass):'<span class="'+x.params.paginationProgressbarClass+'"></span>',x.paginationContainer.html(e)),"custom"!==x.params.paginationType&&x.emit("onPaginationRendered",x,x.paginationContainer[0])}},x.update=function(e){function a(){x.rtl,x.translate;t=Math.min(Math.max(x.translate,x.maxTranslate()),x.minTranslate()),x.setWrapperTranslate(t),x.updateActiveIndex(),x.updateClasses()}if(x){x.updateContainerSize(),x.updateSlidesSize(),x.updateProgress(),x.updatePagination(),x.updateClasses(),x.params.scrollbar&&x.scrollbar&&x.scrollbar.set();var t;if(e){x.controller&&x.controller.spline&&(x.controller.spline=void 0),x.params.freeMode?(a(),x.params.autoHeight&&x.updateAutoHeight()):(("auto"===x.params.slidesPerView||x.params.slidesPerView>1)&&x.isEnd&&!x.params.centeredSlides?x.slideTo(x.slides.length-1,0,!1,!0):x.slideTo(x.activeIndex,0,!1,!0))||a()}else x.params.autoHeight&&x.updateAutoHeight()}},x.onResize=function(e){x.params.onBeforeResize&&x.params.onBeforeResize(x),x.params.breakpoints&&x.setBreakpoint();var a=x.params.allowSwipeToPrev,t=x.params.allowSwipeToNext;x.params.allowSwipeToPrev=x.params.allowSwipeToNext=!0,x.updateContainerSize(),x.updateSlidesSize(),("auto"===x.params.slidesPerView||x.params.freeMode||e)&&x.updatePagination(),x.params.scrollbar&&x.scrollbar&&x.scrollbar.set(),x.controller&&x.controller.spline&&(x.controller.spline=void 0);var s=!1;if(x.params.freeMode){var r=Math.min(Math.max(x.translate,x.maxTranslate()),x.minTranslate());x.setWrapperTranslate(r),x.updateActiveIndex(),x.updateClasses(),x.params.autoHeight&&x.updateAutoHeight()}else x.updateClasses(),s=("auto"===x.params.slidesPerView||x.params.slidesPerView>1)&&x.isEnd&&!x.params.centeredSlides?x.slideTo(x.slides.length-1,0,!1,!0):x.slideTo(x.activeIndex,0,!1,!0);x.params.lazyLoading&&!s&&x.lazy&&x.lazy.load(),x.params.allowSwipeToPrev=a,x.params.allowSwipeToNext=t,x.params.onAfterResize&&x.params.onAfterResize(x)},x.touchEventsDesktop={start:"mousedown",move:"mousemove",end:"mouseup"},window.navigator.pointerEnabled?x.touchEventsDesktop={start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled&&(x.touchEventsDesktop={start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}),x.touchEvents={start:x.support.touch||!x.params.simulateTouch?"touchstart":x.touchEventsDesktop.start,move:x.support.touch||!x.params.simulateTouch?"touchmove":x.touchEventsDesktop.move,end:x.support.touch||!x.params.simulateTouch?"touchend":x.touchEventsDesktop.end},(window.navigator.pointerEnabled||window.navigator.msPointerEnabled)&&("container"===x.params.touchEventsTarget?x.container:x.wrapper).addClass("swiper-wp8-"+x.params.direction),x.initEvents=function(e){var a=e?"off":"on",t=e?"removeEventListener":"addEventListener",r="container"===x.params.touchEventsTarget?x.container[0]:x.wrapper[0],i=x.support.touch?r:document,n=!!x.params.nested;if(x.browser.ie)r[t](x.touchEvents.start,x.onTouchStart,!1),i[t](x.touchEvents.move,x.onTouchMove,n),i[t](x.touchEvents.end,x.onTouchEnd,!1);else{if(x.support.touch){var o=!("touchstart"!==x.touchEvents.start||!x.support.passiveListener||!x.params.passiveListeners)&&{passive:!0,capture:!1};r[t](x.touchEvents.start,x.onTouchStart,o),r[t](x.touchEvents.move,x.onTouchMove,n),r[t](x.touchEvents.end,x.onTouchEnd,o)}(s.simulateTouch&&!x.device.ios&&!x.device.android||s.simulateTouch&&!x.support.touch&&x.device.ios)&&(r[t]("mousedown",x.onTouchStart,!1),document[t]("mousemove",x.onTouchMove,n),document[t]("mouseup",x.onTouchEnd,!1))}window[t]("resize",x.onResize),x.params.nextButton&&x.nextButton&&x.nextButton.length>0&&(x.nextButton[a]("click",x.onClickNext),x.params.a11y&&x.a11y&&x.nextButton[a]("keydown",x.a11y.onEnterKey)),x.params.prevButton&&x.prevButton&&x.prevButton.length>0&&(x.prevButton[a]("click",x.onClickPrev),x.params.a11y&&x.a11y&&x.prevButton[a]("keydown",x.a11y.onEnterKey)),x.params.pagination&&x.params.paginationClickable&&(x.paginationContainer[a]("click","."+x.params.bulletClass,x.onClickIndex),x.params.a11y&&x.a11y&&x.paginationContainer[a]("keydown","."+x.params.bulletClass,x.a11y.onEnterKey)),(x.params.preventClicks||x.params.preventClicksPropagation)&&r[t]("click",x.preventClicks,!0)},x.attachEvents=function(){x.initEvents()},x.detachEvents=function(){x.initEvents(!0)},x.allowClick=!0,x.preventClicks=function(e){x.allowClick||(x.params.preventClicks&&e.preventDefault(),x.params.preventClicksPropagation&&x.animating&&(e.stopPropagation(),e.stopImmediatePropagation()))},x.onClickNext=function(e){e.preventDefault(),x.isEnd&&!x.params.loop||x.slideNext()},x.onClickPrev=function(e){e.preventDefault(),x.isBeginning&&!x.params.loop||x.slidePrev()},x.onClickIndex=function(a){a.preventDefault();var t=e(this).index()*x.params.slidesPerGroup 32;x.params.loop&&(t+=x.loopedSlides),x.slideTo(t)},x.updateClickedSlide=function(a){var t=n(a,"."+x.params.slideClass),s=!1;if(t)for(var r=0;r<x.slides.length;r++)x.slides[r]===t&&(s=!0);if(!t||!s)return x.clickedSlide=void 0,void(x.clickedIndex=void 0);if(x.clickedSlide=t,x.clickedIndex=e(t).index(),x.params.slideToClickedSlide&&void 0!==x.clickedIndex&&x.clickedIndex!==x.activeIndex){var i,o=x.clickedIndex,l="auto"===x.params.slidesPerView?x.currentSlidesPerView():x.params.slidesPerView;if(x.params.loop){if(x.animating)return;i=parseInt(e(x.clickedSlide).attr("data-swiper-slide-index"),10),x.params.centeredSlides?o<x.loopedSlides-l/2||o>x.slides.length-x.loopedSlides+l/2?(x.fixLoop(),o=x.wrapper.children("."+x.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.'+x.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){x.slideTo(o)},0)):x.slideTo(o):o>x.slides.length-l?(x.fixLoop(),o=x.wrapper.children("."+x.params.slideClass+'[data-swiper-slide-index="'+i+'"]:not(.'+x.params.slideDuplicateClass+")").eq(0).index(),setTimeout(function(){x.slideTo(o)},0)):x.slideTo(o)}else x.slideTo(o)}};var b,C,S,z,M,P,E,I,k,D,L="input, select, textarea, button, video",B=Date.now(),H=[];x.animating=!1,x.touches={startX:0,startY:0,currentX:0,currentY:0,diff:0};var G,X;
32x.onTouchStart=function(a){if(a.originalEvent&&(a=a.originalEvent),(G="touchstart"===a.type)||!("which"in a)||3!==a.which){if(x.params.noSwiping&&n(a,"."+x.params.noSwipingClass))return void(x.allowClick=!0);if(!x.params.swipeHandler||n(a,x.params.swipeHandler)){var t=x.touches.currentX="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,s=x.touches.currentY="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY;if(!(x.device.ios&&x.params.iOSEdgeSwipeDetection&&t<=x.params.iOSEdgeSwipeThreshold)){if(b=!0,C=!1,S=!0,M=void 0,X=void 0,x.touches.startX=t,x.touches.startY=s,z=Date.now(),x.allowClick=!0,x.updateContainerSize(),x.swipeDirection=void 0,x.params.threshold>0&&(I=!1),"touchstart"!==a.type){var r=!0;e(a.target).is(L)&&(r=!1),document.activeElement&&e(document.activeElement).is(L)&&document.activeElement.blur(),r&&a.preventDefault()}x.emit("onTouchStart",x,a)}}}},x.onTouchMove=function(a){if(a.originalEvent&&(a=a.originalEvent),!G||"mousemove"!==a.type){if(a.preventedByNestedSwiper)return x.touches.startX="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,void(x.touches.startY="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY);if(x.params.onlyExternal)return x.allowClick=!1,void(b&&(x.touches.startX=x.touches.currentX="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,x.touches.startY=x.touches.currentY="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY,z=Date.now()));if(G&&x.params.touchReleaseOnEdges&&!x.params.loop)if(x.isHorizontal()){if(x.touches.currentX<x.touches.startX&&x.translate<=x.maxTranslate()||x.touches.currentX>x.touches.startX&&x.translate>=x.minTranslate())return}else if(x.touches.currentY<x.touches.startY&&x.translate<=x.maxTranslate()||x.touches.currentY>x.touches.startY&&x.translate>=x.minTranslate())return;if(G&&document.activeElement&&a.target===document.activeElement&&e(a.target).is(L))return C=!0,void(x.allowClick=!1);if(S&&x.emit("onTouchMove",x,a),!(a.targetTouches&&a.targetTouches.length>1)){if(x.touches.currentX="touchmove"===a.type?a.targetTouches[0].pageX:a.pageX,x.touches.currentY="touchmove"===a.type?a.targetTouches[0].pageY:a.pageY,void 0===M){var t;x.isHorizontal()&&x.touches.currentY===x.touches.startY||!x.isHorizontal()&&x.touches.currentX===x.touches.startX?M=!1:(t=180*Math.atan2(Math.abs(x.touches.currentY-x.touches.startY),Math.abs(x.touches.currentX-x.touches.startX))/Math.PI,M=x.isHorizontal()?t>x.params.touchAngle:90-t>x.params.touchAngle)}if(M&&x.emit("onTouchMoveOpposite",x,a),void 0===X&&(x.touches.currentX===x.touches.startX&&x.touches.currentY===x.touches.startY||(X=!0)),b){if(M)return void(b=!1);if(X){x.allowClick=!1,x.emit("onSliderMove",x,a),a.preventDefault(),x.params.touchMoveStopPropagation&&!x.params.nested&&a.stopPropagation(),C||(s.loop&&x.fixLoop(),E=x.getWrapperTranslate(),x.setWrapperTransition(0),x.animating&&x.wrapper.trigger("webkitTransitionEnd transitionend oTransitionEnd MSTransitionEnd msTransitionEnd"),x.params.autoplay&&x.autoplaying&&(x.params.autoplayDisableOnInteraction?x.stopAutoplay():x.pauseAutoplay()),D=!1,!x.params.grabCursor||x.params.allowSwipeToNext!==!0&&x.params.allowSwipeToPrev!==!0||x.setGrabCursor(!0)),C=!0;var r=x.touches.diff=x.isHorizontal()?x.touches.currentX-x.touches.startX:x.touches.currentY-x.touches.startY;r*=x.params.touchRatio,x.rtl&&(r=-r),x.swipeDirection=r>0?"prev":"next",P=r+E;var i=!0;if(r>0&&P>x.minTranslate()?(i=!1,x.params.resistance&&(P=x.minTranslate()-1+Math.pow(-x.minTranslate()+E+r,x.params.resistanceRatio))):r<0&&P<x.maxTranslate()&&(i=!1,x.params.resistance&&(P=x.maxTranslate()+1-Math.pow(x.maxTranslate()-E-r,x.params.resistanceRatio))),i&&(a.preventedByNestedSwiper=!0),!x.params.allowSwipeToNext&&"next"===x.swipeDirection&&P<E&&(P=E),!x.params.allowSwipeToPrev&&"prev"===x.swipeDirection&&P>E&&(P=E),x.params.threshold>0){if(!(Math.abs(r)>x.params.threshold||I))return void(P=E);if(!I)return I=!0,x.touches.startX=x.touches.currentX,x.touches.startY=x.touches.currentY,P=E,void(x.touches.diff=x.isHorizontal()?x.touches.currentX-x.touches.startX:x.touches.currentY-x.touches.startY)}x.params.followFinger&&((x.params.freeMode||x.params.watchSlidesProgress)&&x.updateActiveIndex(),x.params.freeMode&&(0===H.length&&H.push({position:x.touches[x.isHorizontal()?"startX":"startY"],time:z}),H.push({position:x.touches[x.isHorizontal()?"currentX":"currentY"],time:(new window.Date).getTime()})),x.updateProgress(P),x.setWrapperTranslate(P))}}}}}
vendor: 10,281 bytes, line 32
32,x.onTouchEnd=function(a){if(a.originalEvent&&(a=a.originalEvent),S&&x.emit("onTouchEnd",x,a),S=!1,b){x.params.grabCursor&&C&&b&&(x.params.allowSwipeToNext===!0||x.params.allowSwipeToPrev===!0)&&x.setGrabCursor(!1);var t=Date.now(),s=t-z;if(x.allowClick&&(x.updateClickedSlide(a),x.emit("onTap",x,a),s<300&&t-B>300&&(k&&clearTimeout(k),k=setTimeout(function(){x&&(x.params.paginationHide&&x.paginationContainer.length>0&&!e(a.target).hasClass(x.params.bulletClass)&&x.paginationContainer.toggleClass(x.params.paginationHiddenClass),x.emit("onClick",x,a))},300)),s<300&&t-B<300&&(k&&clearTimeout(k),x.emit("onDoubleTap",x,a))),B=Date.now(),setTimeout(function(){x&&(x.allowClick=!0)},0),!b||!C||!x.swipeDirection||0===x.touches.diff||P===E)return void(b=C=!1);b=C=!1;var r;if(r=x.params.followFinger?x.rtl?x.translate:-x.translate:-P,x.params.freeMode){if(r<-x.minTranslate())return void x.slideTo(x.activeIndex);if(r>-x.maxTranslate())return void(x.slides.length<x.snapGrid.length?x.slideTo(x.snapGrid.length-1):x.slideTo(x.slides.length-1));if(x.params.freeModeMomentum){if(H.length>1){var i=H.pop(),n=H.pop(),o=i.position-n.position,l=i.time-n.time;x.velocity=o/l,x.velocity=x.velocity/2,Math.abs(x.velocity)<x.params.freeModeMinimumVelocity&&(x.velocity=0),(l>150||(new window.Date).getTime()-i.time>300)&&(x.velocity=0)}else x.velocity=0;x.velocity=x.velocity*x.params.freeModeMomentumVelocityRatio,H.length=0;var p=1e3*x.params.freeModeMomentumRatio,d=x.velocity*p,m=x.translate+d;x.rtl&&(m=-m);var u,c=!1,g=20*Math.abs(x.velocity)*x.params.freeModeMomentumBounceRatio;if(m<x.maxTranslate())x.params.freeModeMomentumBounce?(m+x.maxTranslate()<-g&&(m=x.maxTranslate()-g),u=x.maxTranslate(),c=!0,D=!0):m=x.maxTranslate();else if(m>x.minTranslate())x.params.freeModeMomentumBounce?(m-x.minTranslate()>g&&(m=x.minTranslate()+g),u=x.minTranslate(),c=!0,D=!0):m=x.minTranslate();else if(x.params.freeModeSticky){var h,v=0;for(v=0;v<x.snapGrid.length;v+=1)if(x.snapGrid[v]>-m){h=v;break}m=Math.abs(x.snapGrid[h]-m)<Math.abs(x.snapGrid[h-1]-m)||"next"===x.swipeDirection?x.snapGrid[h]:x.snapGrid[h-1],x.rtl||(m=-m)}if(0!==x.velocity)p=x.rtl?Math.abs((-m-x.translate)/x.velocity):Math.abs((m-x.translate)/x.velocity);else if(x.params.freeModeSticky)return void x.slideReset();x.params.freeModeMomentumBounce&&c?(x.updateProgress(u),x.setWrapperTransition(p),x.setWrapperTranslate(m),x.onTransitionStart(),x.animating=!0,x.wrapper.transitionEnd(function(){x&&D&&(x.emit("onMomentumBounce",x),x.setWrapperTransition(x.params.speed),x.setWrapperTranslate(u),x.wrapper.transitionEnd(function(){x&&x.onTransitionEnd()}))})):x.velocity?(x.updateProgress(m),x.setWrapperTransition(p),x.setWrapperTranslate(m),x.onTransitionStart(),x.animating||(x.animating=!0,x.wrapper.transitionEnd(function(){x&&x.onTransitionEnd()}))):x.updateProgress(m),x.updateActiveIndex()}return void((!x.params.freeModeMomentum||s>=x.params.longSwipesMs)&&(x.updateProgress(),x.updateActiveIndex()))}var f,w=0,y=x.slidesSizesGrid[0];for(f=0;f<x.slidesGrid.length;f+=x.params.slidesPerGroup)void 0!==x.slidesGrid[f+x.params.slidesPerGroup]?r>=x.slidesGrid[f]&&r<x.slidesGrid[f+x.params.slidesPerGroup]&&(w=f,y=x.slidesGrid[f+x.params.slidesPerGroup]-x.slidesGrid[f]):r>=x.slidesGrid[f]&&(w=f,y=x.slidesGrid[x.slidesGrid.length-1]-x.slidesGrid[x.slidesGrid.length-2]);var T=(r-x.slidesGrid[w])/y;if(s>x.params.longSwipesMs){if(!x.params.longSwipes)return void x.slideTo(x.activeIndex);"next"===x.swipeDirection&&(T>=x.params.longSwipesRatio?x.slideTo(w+x.params.slidesPerGroup):x.slideTo(w)),"prev"===x.swipeDirection&&(T>1-x.params.longSwipesRatio?x.slideTo(w+x.params.slidesPerGroup):x.slideTo(w))}else{if(!x.params.shortSwipes)return void x.slideTo(x.activeIndex);"next"===x.swipeDirection&&x.slideTo(w+x.params.slidesPerGroup),"prev"===x.swipeDirection&&x.slideTo(w)}}},x._slideTo=function(e,a){return x.slideTo(e,a,!0,!0)},x.slideTo=function(e,a,t,s){void 0===t&&(t=!0),void 0===e&&(e=0),e<0&&(e=0),x.snapIndex=Math.floor(e/x.params.slidesPerGroup),x.snapIndex>=x.snapGrid.length&&(x.snapIndex=x.snapGrid.length-1);var r=-x.snapGrid[x.snapIndex];if(x.params.autoplay&&x.autoplaying&&(s||!x.params.autoplayDisableOnInteraction?x.pauseAutoplay(a):x.stopAutoplay()),x.updateProgress(r),x.params.normalizeSlideIndex)for(var i=0;i<x.slidesGrid.length;i++)-Math.floor(100*r)>=Math.floor(100*x.slidesGrid[i])&&(e=i);return!(!x.params.allowSwipeToNext&&r<x.translate&&r<x.minTranslate())&&(!(!x.params.allowSwipeToPrev&&r>x.translate&&r>x.maxTranslate()&&(x.activeIndex||0)!==e)&&(void 0===a&&(a=x.params.speed),x.previousIndex=x.activeIndex||0,x.activeIndex=e,x.updateRealIndex(),x.rtl&&-r===x.translate||!x.rtl&&r===x.translate?(x.params.autoHeight&&x.updateAutoHeight(),x.updateClasses(),"slide"!==x.params.effect&&x.setWrapperTranslate(r),!1):(x.updateClasses(),x.onTransitionStart(t),0===a||x.browser.lteIE9?(x.setWrapperTranslate(r),x.setWrapperTransition(0),x.onTransitionEnd(t)):(x.setWrapperTranslate(r),x.setWrapperTransition(a),x.animating||(x.animating=!0,x.wrapper.transitionEnd(function(){x&&x.onTransitionEnd(t)}))),!0)))},x.onTransitionStart=function(e){void 0===e&&(e=!0),x.params.autoHeight&&x.updateAutoHeight(),x.lazy&&x.lazy.onTransitionStart(),e&&(x.emit("onTransitionStart",x),x.activeIndex!==x.previousIndex&&(x.emit("onSlideChangeStart",x),x.activeIndex>x.previousIndex?x.emit("onSlideNextStart",x):x.emit("onSlidePrevStart",x)))},x.onTransitionEnd=function(e){x.animating=!1,x.setWrapperTransition(0),void 0===e&&(e=!0),x.lazy&&x.lazy.onTransitionEnd(),e&&(x.emit("onTransitionEnd",x),x.activeIndex!==x.previousIndex&&(x.emit("onSlideChangeEnd",x),x.activeIndex>x.previousIndex?x.emit("onSlideNextEnd",x):x.emit("onSlidePrevEnd",x))),x.params.history&&x.history&&x.history.setHistory(x.params.history,x.activeIndex),x.params.hashnav&&x.hashnav&&x.hashnav.setHash()},x.slideNext=function(e,a,t){if(x.params.loop){if(x.animating)return!1;x.fixLoop();x.container[0].clientLeft;return x.slideTo(x.activeIndex+x.params.slidesPerGroup,a,e,t)}return x.slideTo(x.activeIndex+x.params.slidesPerGroup,a,e,t)},x._slideNext=function(e){return x.slideNext(!0,e,!0)},x.slidePrev=function(e,a,t){if(x.params.loop){if(x.animating)return!1;x.fixLoop();x.container[0].clientLeft;return x.slideTo(x.activeIndex-1,a,e,t)}return x.slideTo(x.activeIndex-1,a,e,t)},x._slidePrev=function(e){return x.slidePrev(!0,e,!0)},x.slideReset=function(e,a,t){return x.slideTo(x.activeIndex,a,e)},x.disableTouchControl=function(){return x.params.onlyExternal=!0,!0},x.enableTouchControl=function(){return x.params.onlyExternal=!1,!0},x.setWrapperTransition=function(e,a){x.wrapper.transition(e),"slide"!==x.params.effect&&x.effects[x.params.effect]&&x.effects[x.params.effect].setTransition(e),x.params.parallax&&x.parallax&&x.parallax.setTransition(e),x.params.scrollbar&&x.scrollbar&&x.scrollbar.setTransition(e),x.params.control&&x.controller&&x.controller.setTransition(e,a),x.emit("onSetTransition",x,e)},x.setWrapperTranslate=function(e,a,t){var s=0,i=0;x.isHorizontal()?s=x.rtl?-e:e:i=e,x.params.roundLengths&&(s=r(s),i=r(i)),x.params.virtualTranslate||(x.support.transforms3d?x.wrapper.transform("translate3d("+s+"px, "+i+"px, 0px)"):x.wrapper.transform("translate("+s+"px, "+i+"px)")),x.translate=x.isHorizontal()?s:i;var n,o=x.maxTranslate()-x.minTranslate();n=0===o?0:(e-x.minTranslate())/o,n!==x.progress&&x.updateProgress(e),a&&x.updateActiveIndex(),"slide"!==x.params.effect&&x.effects[x.params.effect]&&x.effects[x.params.effect].setTranslate(x.translate),x.params.parallax&&x.parallax&&x.parallax.setTranslate(x.translate),x.params.scrollbar&&x.scrollbar&&x.scrollbar.setTranslate(x.translate),x.params.control&&x.controller&&x.controller.setTranslate(x.translate,t),x.emit("onSetTranslate",x,x.translate)},x.getTranslate=function(e,a){var t,s,r,i;return void 0===a&&(a="x"),x.params.virtualTranslate?x.rtl?-x.translate:x.translate:(r=window.getComputedStyle(e,null),window.WebKitCSSMatrix?(s=r.transform||r.webkitTransform,s.split(",").length>6&&(s=s.split(", ").map(function(e){return e.replace(",",".")}).join(", ")),i=new window.WebKitCSSMatrix("none"===s?"":s)):(i=r.MozTransform||r.OTransform||r.MsTransform||r.msTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),t=i.toString().split(",")),"x"===a&&(s=window.WebKitCSSMatrix?i.m41:16===t.length?parseFloat(t[12]):parseFloat(t[4])),"y"===a&&(s=window.WebKitCSSMatrix?i.m42:16===t.length?parseFloat(t[13]):parseFloat(t[5])),x.rtl&&s&&(s=-s),s||0)},x.getWrapperTranslate=function(e){return void 0===e&&(e=x.isHorizontal()?"x":"y"),x.getTranslate(x.wrapper[0],e)},x.observers=[],x.initObservers=function(){if(x.params.observeParents)for(var e=x.container.parents(),a=0;a<e.length;a++)o(e[a]);o(x.container[0],{childList:!1}),o(x.wrapper[0],{attributes:!1})},x.disconnectObservers=function(){for(var e=0;e<x.observers.length;e++)x.observers[e].disconnect();x.observers=[]},x.createLoop=function(){x.wrapper.children("."+x.params.slideClass+"."+x.params.slideDuplicateClass).remove();var a=x.wrapper.children("."+x.params.slideClass);"auto"!==x.params.slidesPerView||x.params.loopedSlides||(x.params.loopedSlides=a.length),x.loopedSlides=parseInt(x.params.loopedSlides||x.params.slidesPerView,10),x.loopedSlides=x.loopedSlides+x.params.loopAdditionalSlides,x.loopedSlides>a.length&&(x.loopedSlides=a.length);var t,s=[],r=[];for(a.each(function(t,i){var n=e(this);t<x.loopedSlides&&r.push(i),t<a.length&&t>=a.length-x.loopedSlides&&s.push(i),n.attr("data-swiper-slide-index",t)}),t=0;t<r.length;t++)x.wrapper.append(e(r[t].cloneNode(!0)).addClass(x.params.slideDuplicateClass));for(t=s.length-1;t>=0;t--)x.wrapper.prepend(e(s[t].cloneNode(!0)).addClass(x.params.slideDuplicateClass))},x.destroyLoop=function(){x.wrapper.children("."+x.params.slideClass+"."+x.params.slideDuplicateClass).remove(),x.slides.removeAttr("data-swiper-slide-index")},x.reLoop=function(e){var a=x.activeIndex-x.loopedSlides;x.destroyLoop(),x.createLoop(),x.updateSlidesSize(),e&&x.slideTo(a+x.loopedSlides,0,!1)},x.fixLoop=function(){var e;x.activeIndex<x.loopedSlides?(e=x.slides.length-3*x.loopedSlides+x.activeIndex,e+=x.loopedSlides,x.slideTo(e,0,!1,!0)):("auto"===x.params.slidesPerView&&x.activeIndex>=2*x.loopedSlides||x.activeIndex>
32x.slides.length-2*x.params.slidesPerView)&&(e=-x.slides.length+x.activeIndex+x.loopedSlides,e+=x.loopedSlides,x.slideTo(e,0,!1,!0))},x.appendSlide=function(e){if(x.params.loop&&x.destroyLoop(),"object"==typeof e&&e.length)for(var a=0;a<e.length;a++)e[a]&&x.wrapper.append(e[a]);else x.wrapper.append(e);x.params.loop&&x.createLoop(),x.params.observer&&x.support.observer||x.update(!0)},x.prependSlide=function(e){x.params.loop&&x.destroyLoop();var a=x.activeIndex+1;if("object"==typeof e&&e.length){for(var t=0;t<e.length;t++)e[t]&&x.wrapper.prepend(e[t]);a=x.activeIndex+e.length}else x.wrapper.prepend(e);x.params.loop&&x.createLoop(),x.params.observer&&x.support.observer||x.update(!0),x.slideTo(a,0,!1)},x.removeSlide=function(e){x.params.loop&&(x.destroyLoop(),x.slides=x.wrapper.children("."+x.params.slideClass));var a,t=x.activeIndex;if("object"==typeof e&&e.length){for(var s=0;s<e.length;s++)a=e[s],x.slides[a]&&x.slides.eq(a).remove(),a<t&&t--;t=Math.max(t,0)}else a=e,x.slides[a]&&x.slides.eq(a).remove(),a<t&&t--,t=Math.max(t,0);x.params.loop&&x.createLoop(),x.params.observer&&x.support.observer||x.update(!0),x.params.loop?x.slideTo(t+x.loopedSlides,0,!1):x.slideTo(t,0,!1)},x.removeAllSlides=function(){for(var e=[],a=0;a<x.slides.length;a++)e.push(a);x.removeSlide(e)},x.effects={fade:{setTranslate:function(){for(var e=0;e<x.slides.length;e++){var a=x.slides.eq(e),t=a[0].swiperSlideOffset,s=-t;x.params.virtualTranslate||(s-=x.translate);var r=0;x.isHorizontal()||(r=s,s=0);var i=x.params.fade.crossFade?Math.max(1-Math.abs(a[0].progress),0):1+Math.min(Math.max(a[0].progress,-1),0);a.css({opacity:i}).transform("translate3d("+s+"px, "+r+"px, 0px)")}},setTransition:function(e){if(x.slides.transition(e),x.params.virtualTranslate&&0!==e){var a=!1;x.slides.transitionEnd(function(){if(!a&&x){a=!0,x.animating=!1;for(var e=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],t=0;t<e.length;t++)x.wrapper.trigger(e[t])}})}}},flip:{setTranslate:function(){for(var a=0;a<x.slides.length;a++){var t=x.slides.eq(a),s=t[0].progress;x.params.flip.limitRotation&&(s=Math.max(Math.min(t[0].progress,1),-1));var r=t[0].swiperSlideOffset,i=-180*s,n=i,o=0,l=-r,p=0;if(x.isHorizontal()?x.rtl&&(n=-n):(p=l,l=0,o=-n,n=0),t[0].style.zIndex=-Math.abs(Math.round(s))+x.slides.length,x.params.flip.slideShadows){var d=x.isHorizontal()?t.find(".swiper-slide-shadow-left"):t.find(".swiper-slide-shadow-top"),m=x.isHorizontal()?t.find(".swiper-slide-shadow-right"):t.find(".swiper-slide-shadow-bottom");0===d.length&&(d=e('<div class="swiper-slide-shadow-'+(x.isHorizontal()?"left":"top")+'"></div>'),t.append(d)),0===m.length&&(m=e('<div class="swiper-slide-shadow-'+(x.isHorizontal()?"right":"bottom")+'"></div>'),t.append(m)),d.length&&(d[0].style.opacity=Math.max(-s,0)),m.length&&(m[0].style.opacity=Math.max(s,0))}t.transform("translate3d("+l+"px, "+p+"px, 0px) rotateX("+o+"deg) rotateY("+n+"deg)")}},setTransition:function(a){if(x.slides.transition(a).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(a),x.params.virtualTranslate&&0!==a){var t=!1;x.slides.eq(x.activeIndex).transitionEnd(function(){if(!t&&x&&e(this).hasClass(x.params.slideActiveClass)){t=!0,x.animating=!1;for(var a=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],s=0;s<a.length;s++)x.wrapper.trigger(a[s])}})}}},cube:{setTranslate:function(){var a,t=0;x.params.cube.shadow&&(x.isHorizontal()?(a=x.wrapper.find(".swiper-cube-shadow"),0===a.length&&(a=e('<div class="swiper-cube-shadow"></div>'),x.wrapper.append(a)),a.css({height:x.width+"px"})):(a=x.container.find(".swiper-cube-shadow"),0===a.length&&(a=e('<div class="swiper-cube-shadow"></div>'),x.container.append(a))));for(var s=0;s<x.slides.length;s++){var r=x.slides.eq(s),i=90*s,n=Math.floor(i/360);x.rtl&&(i=-i,n=Math.floor(-i/360));var o=Math.max(Math.min(r[0].progress,1),-1),l=0,p=0,d=0;s%4==0?(l=4*-n*x.size,d=0):(s-1)%4==0?(l=0,d=4*-n*x.size):(s-2)%4==0?(l=x.size+4*n*x.size,d=x.size):(s-3)%4==0&&(l=-x.size,d=3*x.size+4*x.size*n),x.rtl&&(l=-l),x.isHorizontal()||(p=l,l=0);var m="rotateX("+(x.isHorizontal()?0:-i)+"deg) rotateY("+(x.isHorizontal()?i:0)+"deg) translate3d("+l+"px, "+p+"px, "+d+"px)";if(o<=1&&o>
32-1&&(t=90*s+90*o,x.rtl&&(t=90*-s-90*o)),r.transform(m),x.params.cube.slideShadows){var u=x.isHorizontal()?r.find(".swiper-slide-shadow-left"):r.find(".swiper-slide-shadow-top"),c=x.isHorizontal()?r.find(".swiper-slide-shadow-right"):r.find(".swiper-slide-shadow-bottom");0===u.length&&(u=e('<div class="swiper-slide-shadow-'+(x.isHorizontal()?"left":"top")+'"></div>'),r.append(u)),0===c.length&&(c=e('<div class="swiper-slide-shadow-'+(x.isHorizontal()?"right":"bottom")+'"></div>'),r.append(c)),u.length&&(u[0].style.opacity=Math.max(-o,0)),c.length&&(c[0].style.opacity=Math.max(o,0))}}if(x.wrapper.css({"-webkit-transform-origin":"50% 50% -"+x.size/2+"px","-moz-transform-origin":"50% 50% -"+x.size/2+"px","-ms-transform-origin":"50% 50% -"+x.size/2+"px","transform-origin":"50% 50% -"+x.size/2+"px"}),x.params.cube.shadow)if(x.isHorizontal())a.transform("translate3d(0px, "+(x.width/2+x.params.cube.shadowOffset)+"px, "+-x.width/2+"px) rotateX(90deg) rotateZ(0deg) scale("+x.params.cube.shadowScale+")");else{var g=Math.abs(t)-90*Math.floor(Math.abs(t)/90),h=1.5-(Math.sin(2*g*Math.PI/360)/2+Math.cos(2*g*Math.PI/360)/2),v=x.params.cube.shadowScale,f=x.params.cube.shadowScale/h,w=x.params.cube.shadowOffset;a.transform("scale3d("+v+", 1, "+f+") translate3d(0px, "+(x.height/2+w)+"px, "+-x.height/2/f+"px) rotateX(-90deg)")}var y=x.isSafari||x.isUiWebView?-x.size/2:0;x.wrapper.transform("translate3d(0px,0,"+y+"px) rotateX("+(x.isHorizontal()?0:t)+"deg) rotateY("+(x.isHorizontal()?-t:0)+"deg)")},setTransition:function(e){x.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e),x.params.cube.shadow&&!x.isHorizontal()&&x.container.find(".swiper-cube-shadow").transition(e)}},coverflow:{setTranslate:function(){for(var a=x.translate,t=x.isHorizontal()?-a+x.width/2:-a+x.height/2,s=x.isHorizontal()?x.params.coverflow.rotate:-x.params.coverflow.rotate,r=x.params.coverflow.depth,i=0,n=x.slides.length;i<n;i++){var o=x.slides.eq(i),l=x.slidesSizesGrid[i],p=o[0].swiperSlideOffset,d=(t-p-l/2)/l*x.params.coverflow.modifier,m=x.isHorizontal()?s*d:0,u=x.isHorizontal()?0:s*d,c=-r*Math.abs(d),g=x.isHorizontal()?0:x.params.coverflow.stretch*d,h=x.isHorizontal()?x.params.coverflow.stretch*d:0;Math.abs(h)<.001&&(h=0),Math.abs(g)<.001&&(g=0),Math.abs(c)<.001&&(c=0),Math.abs(m)<.001&&(m=0),Math.abs(u)<.001&&(u=0);var v="translate3d("+h+"px,"+g+"px,"+c+"px) rotateX("+u+"deg) rotateY("+m+"deg)";if(o.transform(v),o[0].style.zIndex=1-Math.abs(Math.round(d)),x.params.coverflow.slideShadows){var f=x.isHorizontal()?o.find(".swiper-slide-shadow-left"):o.find(".swiper-slide-shadow-top"),w=x.isHorizontal()?o.find(".swiper-slide-shadow-right"):o.find(".swiper-slide-shadow-bottom");0===f.length&&(f=e('<div class="swiper-slide-shadow-'+(x.isHorizontal()?"left":"top")+'"></div>'),o.append(f)),0===w.length&&(w=e('<div class="swiper-slide-shadow-'+(x.isHorizontal()?"right":"bottom")+'"></div>'),o.append(w)),f.length&&(f[0].style.opacity=d>0?d:0),w.length&&(w[0].style.opacity=-d>0?-d:0)}}if(x.browser.ie){x.wrapper[0].style.perspectiveOrigin=t+"px 50%"}},setTransition:function(e){x.slides.transition(e).find(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").transition(e)}}},x.lazy={initialImageLoaded:!1,loadImageInSlide:function(a,t){if(void 0!==a&&(void 0===t&&(t=!0),0!==x.slides.length)){var s=x.slides.eq(a),r=s.find("."+x.params.lazyLoadingClass+":not(."+x.params.lazyStatusLoadedClass+"):not(."+x.params.lazyStatusLoadingClass+")");!s.hasClass(x.params.lazyLoadingClass)||s.hasClass(x.params.lazyStatusLoadedClass)||s.hasClass(x.params.lazyStatusLoadingClass)||(r=r.add(s[0])),0!==r.length&&r.each(function(){var a=e(this);a.addClass(x.params.lazyStatusLoadingClass);var r=a.attr("data-background"),i=a.attr("data-src"),n=a.attr("data-srcset"),o=a.attr("data-sizes");x.loadImage(a[0],i||r,n,o,!1,function(){if(void 0!==x&&null!==x&&x){if(r?(a.css("background-image",'url("'+r+'")'),a.removeAttr("data-background")):(n&&(a.attr("srcset",n
32),a.removeAttr("data-srcset")),o&&(a.attr("sizes",o),a.removeAttr("data-sizes")),i&&(a.attr("src",i),a.removeAttr("data-src"))),a.addClass(x.params.lazyStatusLoadedClass).removeClass(x.params.lazyStatusLoadingClass),s.find("."+x.params.lazyPreloaderClass+", ."+x.params.preloaderClass).remove(),x.params.loop&&t){var e=s.attr("data-swiper-slide-index");if(s.hasClass(x.params.slideDuplicateClass)){var l=x.wrapper.children('[data-swiper-slide-index="'+e+'"]:not(.'+x.params.slideDuplicateClass+")");x.lazy.loadImageInSlide(l.index(),!1)}else{var p=x.wrapper.children("."+x.params.slideDuplicateClass+'[data-swiper-slide-index="'+e+'"]');x.lazy.loadImageInSlide(p.index(),!1)}}x.emit("onLazyImageReady",x,s[0],a[0])}}),x.emit("onLazyImageLoad",x,s[0],a[0])})}},load:function(){var a,t=x.params.slidesPerView;if("auto"===t&&(t=0),x.lazy.initialImageLoaded||(x.lazy.initialImageLoaded=!0),x.params.watchSlidesVisibility)x.wrapper.children("."+x.params.slideVisibleClass).each(function(){x.lazy.loadImageInSlide(e(this).index())});else if(t>1)for(a=x.activeIndex;a<x.activeIndex+t;a++)x.slides[a]&&x.lazy.loadImageInSlide(a);else x.lazy.loadImageInSlide(x.activeIndex);if(x.params.lazyLoadingInPrevNext)if(t>1||x.params.lazyLoadingInPrevNextAmount&&x.params.lazyLoadingInPrevNextAmount>1){var s=x.params.lazyLoadingInPrevNextAmount,r=t,i=Math.min(x.activeIndex+r+Math.max(s,r),x.slides.length),n=Math.max(x.activeIndex-Math.max(r,s),0);for(a=x.activeIndex+t;a<i;a++)x.slides[a]&&x.lazy.loadImageInSlide(a);for(a=n;a<x.activeIndex;a++)x.slides[a]&&x.lazy.loadImageInSlide(a)}else{var o=x.wrapper.children("."+x.params.slideNextClass);o.length>0&&x.lazy.loadImageInSlide(o.index());var l=x.wrapper.children("."+x.params.slidePrevClass);l.length>0&&x.lazy.loadImageInSlide(l.index())}},onTransitionStart:function(){x.params.lazyLoading&&(x.params.lazyLoadingOnTransitionStart||!x.params.lazyLoadingOnTransitionStart&&!x.lazy.initialImageLoaded)&&x.lazy.load()},onTransitionEnd:function(){x.params.lazyLoading&&!x.params.lazyLoadingOnTransitionStart&&x.lazy.load()}},x.scrollbar={isTouched:!1,setDragPosition:function(e){var a=x.scrollbar,t=x.isHorizontal()?"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageX:e.pageX||e.clientX:"touchstart"===e.type||"touchmove"===e.type?e.targetTouches[0].pageY:e.pageY||e.clientY,s=t-a.track.offset()[x.isHorizontal()?"left":"top"]-a.dragSize/2,r=-x.minTranslate()*a.moveDivider,i=-x.maxTranslate()*a.moveDivider;s<r?s=r:s>i&&(s=i),s=-s/a.moveDivider,x.updateProgress(s),x.setWrapperTranslate(s,!0)},dragStart:function(e){var a=x.scrollbar;a.isTouched=!0,e.preventDefault(),e.stopPropagation(),a.setDragPosition(e),clearTimeout(a.dragTimeout),a.track.transition(0),x.params.scrollbarHide&&a.track.css("opacity",1),x.wrapper.transition(100),a.drag.transition(100),x.emit("onScrollbarDragStart",x)},dragMove:function(e){var a=x.scrollbar;a.isTouched&&(e.preventDefault?e.preventDefault():e.returnValue=!1,a.setDragPosition(e),x.wrapper.transition(0),a.track.transition(0),a.drag.transition(0),x.emit("onScrollbarDragMove",x))},dragEnd:function(e){var a=x.scrollbar;a.isTouched&&(a.isTouched=!1,x.params.scrollbarHide&&(clearTimeout(a.dragTimeout),a.dragTimeout=setTimeout(function(){a.track.css("opacity",0),a.track.transition(400)},1e3)),x.emit("onScrollbarDragEnd",x),x.params.scrollbarSnapOnRelease&&x.slideReset())},draggableEvents:function(){return x.params.simulateTouch!==!1||x.support.touch?x.touchEvents:x.touchEventsDesktop}(),enableDraggable:function(){var a=x.scrollbar,t=x.support.touch?a.track:document;e(a.track).on(a.draggableEvents.start,a.dragStart),e(t).on(a.draggableEvents.move,a.dragMove),e(t).on(a.draggableEvents.end,a.dragEnd)},disableDraggable:function(){var a=x.scrollbar,t=x.support.touch?a.track:document;e(a.track).off(a.draggableEvents.start,a.dragStart),e(t).off(a.draggableEvents.move,a.dragMove),e(t).off(a.draggableEvents.end,a.dragEnd)},set:function(){if(x.params.scrollbar){var a=x.scrollbar;a.track=e(x.params.scrollbar),x.params.uniqueNavElements&&"string"==typeof x.params.scrollbar&&a.track.length>1&&1===x.container.find(x.params.scrollbar).length&&(a.track=x.container.find(x.params.scrollbar)),a.drag=a.track.find(".swiper-scrollbar-drag"),0===a.drag.length&&(a.drag=e('<div class="swiper-scrollbar-drag"></div>'),a.track.append(a.drag)),a.drag[0].style.width="",a.drag[0].style.height="",a.trackSize=x.isHorizontal()?a.track[0].offsetWidth:a.track[0].offsetHeight,a.divider=x.size/x.virtualSize,a.moveDivider=a.divider*(a.trackSize/x.size),a.dragSize=a.trackSize*a.divider,x.isHorizontal()?a.drag[0].style.width=a.dragSize+"px":a.drag[0].style.height=a.dragSize+"px",a.divider>=1?a.track[0].style.display="none":a.track[0].style.display="",x.params.scrollbarHide&&(a.track[0].style.opacity=0)}},setTranslate:function(){if(x.params.scrollbar){var e,a=x.scrollbar,t=(x.translate,a.dragSize);e=(a.trackSize-a.dragSize)*x.progress,x.rtl&&x.isHorizontal()?(e=-e,e>0?(t=a.dragSize-e,e=0):-e+a.dragSize>a.trackSize&&(t=a.trackSize+e)):e<0?(t=a.dragSize+e,e=0):e+a.dragSize>a.trackSize&&(t=a.trackSize-e),x.isHorizontal()?(x.support.transforms3d?a.drag.transform("translate3d("+e+"px, 0, 0)"):a.drag.transform("translateX("+e+"px)"),a.drag[0].style.width=t+"px"):(x.support.transforms3d?a.drag.transform("translate3d(0px, "+e+"px, 0)"):a.drag.transform("translateY("+e+"px)"),a.drag[0].style.height=t+"px"),x.params.scrollbarHide&&(clearTimeout(a.timeout),a.track[0].style.opacity=1,a.timeout=setTimeout(function(){a.track[0].style.opacity=0,a.track.transition(400)},1e3))}},setTransition:function(e){x.params.scrollbar&&x.scrollbar.drag.transition(e)}},x.controller={LinearSpline:function(e,a){var t=function(){var e,a,t;return function(s,r){for(a=-1,e=s.length;e-a>1;)s[t=e+a>>1]<=r?a=t:e=t;return e}}();this.x=e,this.y=a,this.lastIndex=e.length-1;var s,r;this.x.length;this.interpolate=function(e){return e?(r=t(this.x,e),s=r-1,(e-this.x[s])*(this.y[r]-this.y[s])/(this.x[r]-this.x[s])+this.y[s]):0}},getInterpolateFunction:function(e){x.controller.spline||(x.controller.spline=x.params.loop?new x.controller.LinearSpline(x.slidesGrid,e.slidesGrid):new x.controller.LinearSpline(x.snapGrid,e.snapGrid))},setTranslate:function(e,t){function s(a){e=a.rtl&&"horizontal"===a.params.direction?-x.translate:x.translate,"slide"===x.params.controlBy&&(x.controller.getInterpolateFunction(a),i=-x.controller.spline.interpolate(-e)),i&&"container"!==x.params.controlBy||(r=(a.maxTranslate()-a.minTranslate())/(x.maxTranslate()-x.minTranslate()),i=(e-x.minTranslate())*r+a.minTranslate()),x.params.controlInverse&&(i=a.maxTranslate()-i),a.updateProgress(i),a.setWrapperTranslate(i,!1,x),a.updateActiveIndex()}var r,i,n=x.params.control;if(Array.isArray(n))for(var o=0;o<n.length;o++)n[o]!==t&&n[o]instanceof a&&s(n[o]);else n instanceof a&&t!==n&&s(n)},setTransition:function(e,t){function s(a){a.setWrapperTransition(e,x),0!==e&&(a.onTransitionStart(),a.wrapper.transitionEnd(function(){i&&(a.params.loop&&"slide"===x.params.controlBy&&a.fixLoop(),a.onTransitionEnd())}))}var r,i=x.params.control;if(Array.isArray(i))for(r=0;r<i.length;r++)i[r]!==t&&i[r]instanceof a&&s(i[r]);else i instanceof a&&t!==i&&s(i)}},x.hashnav={onHashCange:function(e,a){var t=document.location.hash.replace("#","");t!==x.slides.eq(x.activeIndex).attr("data-hash")&&x.slideTo(x.wrapper.children("."+x.params.slideClass+'[data-hash="'+t+'"]').index())},attachEvents:function(a){var t=a?"off":"on";e(window)[t]("hashchange",x.hashnav.onHashCange)},setHash:function(){ 33if(x.hashnav.initialized&&x.params.hashnav)if(x.params.replaceState&&window.history&&window.history.replaceState)window.history.replaceState(null,null,"#"+x.slides.eq(x.activeIndex).attr("data-hash")||"");else{var e=x.slides.eq(x.activeIndex),a=e.attr("data-hash")||e.attr("data-history");document.location.hash=a||""}},init:function(){if(x.params.hashnav&&!x.params.history){x.hashnav.initialized=!0;var e=document.location.hash.replace("#","");if(e)for(var a=0,t=x.slides.length;a<t;a++){var s=x.slides.eq(a),r=s.attr("data-hash")||s.attr("data-history");if(r===e&&!s.hasClass(x.params.slideDuplicateClass)){var i=s.index();x.slideTo(i,0,x.params.runCallbacksOnInit,!0)}}x.params.hashnavWatchState&&x.hashnav.attachEvents()}},destroy:function(){x.params.hashnavWatchState&&x.hashnav.attachEvents(!0)}},x.history={init:function(){if(x.params.history){if(!window.history||
33!window.history.pushState)return x.params.history=!1,void(x.params.hashnav=!0);x.history.initialized=!0,this.paths=this.getPathValues(),(this.paths.key||this.paths.value)&&(this.scrollToSlide(0,this.paths.value,x.params.runCallbacksOnInit),x.params.replaceState||window.addEventListener("popstate",this.setHistoryPopState))}},setHistoryPopState:function(){x.history.paths=x.history.getPathValues(),x.history.scrollToSlide(x.params.speed,x.history.paths.value,!1)},getPathValues:function(){var e=window.location.pathname.slice(1).split("/"),a=e.length;return{key:e[a-2],value:e[a-1]}},setHistory:function(e,a){if(x.history.initialized&&x.params.history){var t=x.slides.eq(a),s=this.slugify(t.attr("data-history"));window.location.pathname.includes(e)||(s=e+"/"+s),x.params.replaceState?window.history.replaceState(null,null,s):window.history.pushState(null,null,s)}},slugify:function(e){return e.toString().toLowerCase().replace(/\s+/g,"-").replace(/[^\w\-]+/g,"").replace(/\-\-+/g,"-").replace(/^-+/,"").replace(/-+$/,"")},scrollToSlide:function(e,a,t){if(a)for(var s=0,r=x.slides.length;s<r;s++){var i=x.slides.eq(s),n=this.slugify(i.attr("data-history"));if(n===a&&!i.hasClass(x.params.slideDuplicateClass)){var o=i.index();x.slideTo(o,e,t)}}else x.slideTo(0,e,t)}},x.disableKeyboardControl=function(){x.params.keyboardControl=!1,e(document).off("keydown",l)},x.enableKeyboardControl=function(){x.params.keyboardControl=!0,e(document).on("keydown",l)},x.mousewheel={event:!1,lastScrollTime:(new window.Date).getTime()},x.params.mousewheelControl&&(x.mousewheel.event=navigator.userAgent.indexOf("firefox")>-1?"DOMMouseScroll":function(){var e="onwheel"in document;if(!e){var a=document.createElement("div");a.setAttribute("onwheel","return;"),e="function"==typeof a.onwheel}return!e&&document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0&&(e=document.implementation.hasFeature("Events.wheel","3.0")),e}()?"wheel":"mousewheel"),x.disableMousewheelControl=function(){if(!x.mousewheel.event)return!1;var a=x.container;return"container"!==x.params.mousewheelEventsTarged&&(a=e(x.params.mousewheelEventsTarged)),a.off(x.mousewheel.event,d),x.params.mousewheelControl=!1,!0},x.enableMousewheelControl=function(){if(!x.mousewheel.event)return!1;var a=x.container;return"container"!==x.params.mousewheelEventsTarged&&(a=e(x.params.mousewheelEventsTarged)),a.on(x.mousewheel.event,d),x.params.mousewheelControl=!0,!0},x.parallax={setTranslate:function(){x.container.children("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){m(this,x.progress)}),x.slides.each(function(){var a=e(this);a.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){m(this,Math.min(Math.max(a[0].progress,-1),1))})})},setTransition:function(a){void 0===a&&(a=x.params.speed),x.container.find("[data-swiper-parallax], [data-swiper-parallax-x], [data-swiper-parallax-y]").each(function(){var t=e(this),s=parseInt(t.attr("data-swiper-parallax-duration"),10)||a;0===a&&(s=0),t.transition(s)})}},x.zoom={scale:1,currentScale:1,isScaling:!1,gesture:{slide:void 0,slideWidth:void 0,slideHeight:void 0,image:void 0,imageWrap:void 0,zoomMax:x.params.zoomMax},image:{isTouched:void 0,isMoved:void 0,currentX:void 0,currentY:void 0,minX:void 0,minY:void 0,maxX:void 0,maxY:void 0,width:void 0,height:void 0,startX:void 0,startY:void 0,touchesStart:{},touchesCurrent:{}},velocity:{x:void 0,y:void 0,prevPositionX:void 0,prevPositionY:void 0,prevTime:void 0},getDistanceBetweenTouches:function(e){if(e.targetTouches.length<2)return 1;var a=e.targetTouches[0].pageX,t=e.targetTouches[0].pageY,s=e.targetTouches[1].pageX,r=e.targetTouches[1].pageY;return Math.sqrt(Math.pow(s-a,2)+Math.pow(r-t,2))},onGestureStart:function(a){var t=x.zoom;if(!x.support.gestures){if("touchstart"!==a.type||"touchstart"===a.type&&a.targetTouches.length<2)return;t.gesture.scaleStart=t.getDistanceBetweenTouches(a)}if(!(t.gesture.slide&&t.gesture.slide.length||(t.gesture.slide=e(this),0===t.gesture.slide.length&&(t.gesture.slide=x.slides.eq(x.activeIndex)),t.gesture.image=t.gesture.slide.find("img, svg, canvas"),t.gesture.imageWrap=t.gesture.image.parent("."+x.params.zoomContainerClass),t.gesture.zoomMax=t.gesture.imageWrap.attr("data-swiper-zoom")||x.params.zoomMax,0!==t.gesture.imageWrap.length)))return void(t.gesture.image=void 0);t.gesture.image.transition(0),t.isScaling=!0},onGestureChange:function(e){var a=x.zoom;if(!x.support.gestures){if("touchmove"!==e.type||"touchmove"===e.type&&e.targetTouches.length<2)return;a.gesture.scaleMove=a.getDistanceBetweenTouches(e)}a.gesture.image&&0!==a.gesture.image.length&&(x.support.gestures?a.scale=e.scale*a.currentScale:a.scale=a.gesture.scaleMove/a.gesture.scaleStart*a.currentScale,a.scale>a.gesture.zoomMax&&(a.scale=a.gesture.zoomMax-1+Math.pow(a.scale-a.gesture.zoomMax+1,.5)),a.scale<x.params.zoomMin&&(a.scale=x.params.zoomMin+1-Math.pow(x.params.zoomMin-a.scale+1,.5)),a.gesture.image.transform("translate3d(0,
330,0) scale("+a.scale+")"))},onGestureEnd:function(e){var a=x.zoom;!x.support.gestures&&("touchend"!==e.type||"touchend"===e.type&&e.changedTouches.length<2)||a.gesture.image&&0!==a.gesture.image.length&&(a.scale=Math.max(Math.min(a.scale,a.gesture.zoomMax),x.params.zoomMin),a.gesture.image.transition(x.params.speed).transform("translate3d(0,0,0) scale("+a.scale+")"),a.currentScale=a.scale,a.isScaling=!1,1===a.scale&&(a.gesture.slide=void 0))},onTouchStart:function(e,a){var t=e.zoom;t.gesture.image&&0!==t.gesture.image.length&&(t.image.isTouched||("android"===e.device.os&&a.preventDefault(),t.image.isTouched=!0,t.image.touchesStart.x="touchstart"===a.type?a.targetTouches[0].pageX:a.pageX,t.image.touchesStart.y="touchstart"===a.type?a.targetTouches[0].pageY:a.pageY))},onTouchMove:function(e){var a=x.zoom;if(a.gesture.image&&0!==a.gesture.image.length&&(x.allowClick=!1,a.image.isTouched&&a.gesture.slide)){a.image.isMoved||(a.image.width=a.gesture.image[0].offsetWidth,a.image.height=a.gesture.image[0].offsetHeight,a.image.startX=x.getTranslate(a.gesture.imageWrap[0],"x")||0,a.image.startY=x.getTranslate(a.gesture.imageWrap[0],"
33y")||0,a.gesture.slideWidth=a.gesture.slide[0].offsetWidth,a.gesture.slideHeight=a.gesture.slide[0].offsetHeight,a.gesture.imageWrap.transition(0),x.rtl&&(a.image.startX=-a.image.startX),x.rtl&&(a.image.startY=-a.image.startY));var t=a.image.width*a.scale,s=a.image.height*a.scale;if(!(t<a.gesture.slideWidth&&s<a.gesture.slideHeight)){if(a.image.minX=Math.min(a.gesture.slideWidth/2-t/2,0),a.image.maxX=-a.image.minX,a.image.minY=Math.min(a.gesture.slideHeight/2-s/2,0),a.image.maxY=-a.image.minY,a.image.touchesCurrent.x="touchmove"===e.type?e.targetTouches[0].pageX:e.pageX,a.image.touchesCurrent.y="touchmove"===e.type?e.targetTouches[0].pageY:e.pageY,!a.image.isMoved&&!a.isScaling){if(x.isHorizontal()&&Math.floor(a.image.minX)===Math.floor(a.image.startX)&&a.image.touchesCurrent.x<a.image.touchesStart.x||Math.floor(a.image.maxX)===Math.floor(a.image.startX)&&a.image.touchesCurrent.x>a.image.touchesStart.x)return void(a.image.isTouched=!1);if(!x.isHorizontal()&&Math.floor(a.image.minY)===Math.floor(a.image.startY)&&a.image.touchesCurrent.y<a.image.touchesStart.y||Math.floor(a.image.maxY)===Math.floor(a.image.startY)&&a.image.touchesCurrent.y>a.image.touchesStart.y)return void(a.image.isTouched=!1)}e.preventDefault(),e.stopPropagation(),a.image.isMoved=!0,a.image.currentX=a.image.touchesCurrent.x-a.image.touchesStart.x+a.image.startX,a.image.currentY=a.image.touchesCurrent.y-a.image.touchesStart.y+a.image.startY,a.image.currentX<a.image.minX&&(a.image.currentX=a.image.minX+1-Math.pow(a.image.minX-a.image.currentX+1,.8)),a.image.currentX>a.image.maxX&&(a.image.currentX=a.image.maxX-1+Math.pow(a.image.currentX-a.image.maxX+1,.8)),a.image.currentY<a.image.minY&&(a.image.currentY=a.image.minY+1-Math.pow(a.image.minY-a.image.currentY+1,.8)),a.image.currentY>a.image.maxY&&(a.image.currentY=a.image.maxY-1+Math.pow(a.image.currentY-a.image.maxY+1,.8)),a.velocity.prevPositionX||(a.velocity.prevPositionX=a.image.touchesCurrent.x),a.velocity.prevPositionY||(a.velocity.prevPositionY=a.image.touchesCurrent.y),a.velocity.prevTime||(a.velocity.prevTime=Date.now()),a.velocity.x=(a.image.touchesCurrent.x-a.velocity.prevPositionX)/(Date.now()-a.velocity.prevTime)/2,a.velocity.y=(a.image.touchesCurrent.y-a.velocity.prevPositionY)/(Date.now()-a.velocity.prevTime)/2,Math.abs(a.image.touchesCurrent.x-a.velocity.prevPositionX)<2&&(a.velocity.x=0),Math.abs(a.image.touchesCurrent.y-a.velocity.prevPositionY)<2&&(a.velocity.y=0),a.velocity.prevPositionX=a.image.touchesCurrent.x,a.velocity.prevPositionY=a.image.touchesCurrent.y,a.velocity.prevTime=Date.now(),a.gesture.imageWrap.transform("translate3d("+a.image.currentX+"px, "+a.image.currentY+"px,0)")}}},onTouchEnd:function(e,a){var t=e.zoom;if(t.gesture.image&&0!==t.gesture.image.length){if(!t.image.isTouched||!t.image.isMoved)return t.image.isTouched=!1,void(t.image.isMoved=!1);t.image.isTouched=!1,t.image.isMoved=!1;var s=300,r=300,i=t.velocity.x*s,n=t.image.currentX+i,o=t.velocity.y*r,l=t.image.currentY+o;0!==t.velocity.x&&(s=Math.abs((n-t.image.currentX)/t.velocity.x)),0!==t.velocity.y&&(r=Math.abs((l-t.image.currentY)/t.velocity.y));var p=Math.max(s,r);t.image.currentX=n,t.image.currentY=l;var d=t.image.width*t.scale,m=t.image.height*t.scale;t.image.minX=Math.min(t.gesture.slideWidth/2-d/2,0),t.image.maxX=-t.image.minX,t.image.minY=Math.min(t.gesture.slideHeight/2-m/2,0),t.image.maxY=-t.image.minY,t.image.currentX=Math.max(Math.min(t.image.currentX,t.image.maxX),t.image.minX),t.image.currentY=Math.max(Math.min(t.image.currentY,t.image.maxY),t.image.minY),t.gesture.imageWrap.transition(p).transform("translate3d("+t.image.currentX+"px, "+t.image.currentY+"px,0)")}},onTransitionEnd:function(e){var a=e.zoom;a.gesture.slide&&e.previousIndex!==e.activeIndex&&(a.gesture.image.transform("translate3d(0,0,0) scale(1)"),a.gesture.imageWrap.transform("translate3d(0,0,0)"),a.gesture.slide=a.gesture.image=a.gesture.imageWrap=void 0,a.scale=a.currentScale=1)},toggleZoom:function(a,t){var s=a.zoom;if(s.gesture.slide||(s.gesture.slide=a.clickedSlide?e(a.clickedSlide):a.slides.eq(a.activeIndex),s.gesture.image=s.gesture.slide.find("img, svg, canvas"),s.gesture.imageWrap=s.gesture.image.parent("."+a.params.zoomContainerClass)),s.gesture.image&&0!==s.gesture.image.length){var r,i,n,o,l,p,d,m,u,c,g,h,v,f,w,y,x,T;void 0===s.image.touchesStart.x&&t?(r="touchend"===t.type?t.changedTouches[0].pageX:t.pageX,i="touchend"===t.type?t.changedTouches[0].pageY:t.pageY):(r=s.image.touchesStart.x,i=s.image.touchesStart.y),s.scale&&1!==s.scale?(s.scale=s.currentScale=1,s.gesture.imageWrap.transition(300).transform("translate3d(0,
330,0)"),s.gesture.image.transition(300).transform("translate3d(0,0,0) scale(1)"),s.gesture.slide=void 0):(s.scale=s.currentScale=s.gesture.imageWrap.attr("data-swiper-zoom")||a.params.zoomMax,t?(x=s.gesture.slide[0].offsetWidth,T=s.gesture.slide[0].offsetHeight,n=s.gesture.slide.offset().left,o=s.gesture.slide.offset().top,l=n+x/2-r,p=o+T/2-i,u=s.gesture.image[0].offsetWidth,c=s.gesture.image[0].offsetHeight,g=u*s.scale,h=c*s.scale,v=Math.min(x/2-g/2,0),f=Math.min(T/2-h/2,0),w=-v,y=-f,d=l*s.scale,m=p*s.scale,d<v&&(d=v),d>w&&(d=w),m<f&&(m=f),m>y&&(m=y)):(d=0,m=0),s.gesture.imageWrap.transition(300).transform("translate3d("+d+"px, "+m+"px,0)"),s.gesture.image.transition(300).transform("translate3d(0,0,0) scale("+s.scale+")"))}},attachEvents:function(a){var t=a?"off":"on";if(x.params.zoom){var s=(x.slides,!("touchstart"!==x.touchEvents.start||!x.support.passiveListener||!x.params.passiveListeners)&&{passive:!0,capture:!1});x.support.gestures?(x.slides[t]("gesturestart",x.zoom.onGestureStart,s),x.slides[t]("gesturechange",x.zoom.onGestureChange,s),x.slides[t]("gestureend",x.zoom.onGestureEnd,s)):"touchstart"===x.touchEvents.start&&(x.slides[t](x.touchEvents.start,x.zoom.onGestureStart,s),x.slides[t](x.touchEvents.move,x.zoom.onGestureChange,s),x.slides[t](x.touchEvents.end,x.zoom.onGestureEnd,s)),x[t]("touchStart",x.zoom.onTouchStart),x.slides.each(function(a,s){e(s).find("."+x.params.zoomContainerClass).length>0&&e(s)[t](x.touchEvents.move,x.zoom.onTouchMove)}),x[t]("touchEnd",x.zoom.onTouchEnd),x[t]("transitionEnd",x.zoom.onTransitionEnd),x.params.zoomToggle&&x.on("doubleTap",x.zoom.toggleZoom)}},init:function(){x.zoom.attachEvents()},destroy:function(){x.zoom.attachEvents(!0)}},x._plugins=[];for(var Y in x.plugins){var A=x.plugins[Y](x,x.params[Y]);A&&x._plugins.push(A)}return x.callPlugins=function(e){for(var a=0;a<x._plugins.length;a++)e in x._plugins[a]&&x._plugins[a][e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},x.emitterEventListeners={},x.emit=function(e){x.params[e]&&x.params[e](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);var a;if(x.emitterEventListeners[e])for(a=0;a<x.emitterEventListeners[e].length;a++)x.emitterEventListeners[e][a](arguments[1],arguments[2],arguments[3],arguments[4],arguments[5]);x.callPlugins&&x.callPlugins(e,arguments[1],arguments[2],arguments[3],arguments[4],arguments[5])},x.on=function(e,a){return e=u(e),x.emitterEventListeners[e]||(x.emitterEventListeners[e]=[]),x.emitterEventListeners[e].push(a),x},x.off=function(e,a){var t;if(e=u(e),void 0===a)return x.emitterEventListeners[e]=[],x;if(x.emitterEventListeners[e]&&0!==x.emitterEventListeners[e].length){for(t=0;t<x.emitterEventListeners[e].length;t++)x.emitterEventListeners[e][t]===a&&x.emitterEventListeners[e].splice(t,1);return x}},x.once=function(e,a){e=u(e);var t=function(){a(arguments[0],arguments[1],arguments[2],arguments[3],arguments[4]),x.off(e,t)};return x.on(e,t),x},x.a11y={makeFocusable:function(e){return e.attr("tabIndex","0"),e},addRole:function(e,a){return e.attr("role",a),e},addLabel:function(e,a){return e.attr("aria-label",a),e},disable:function(e){return e.attr("aria-disabled",!0),e},enable:function(e){return e.attr("aria-disabled",!1),e},onEnterKey:function(a){13===a.keyCode&&(e(a.target).is(x.params.nextButton)?(x.onClickNext(a),x.isEnd?x.a11y.notify(x.params.lastSlideMessage):x.a11y.notify(x.params.nextSlideMessage)):e(a.target).is(x.params.prevButton)&&(x.onClickPrev(a),x.isBeginning?x.a11y.notify(x.params.firstSlideMessage):x.a11y.notify(x.params.prevSlideMessage)),e(a.target).is("."+x.params.bulletClass)&&e(a.target)[0].click())},liveRegion:e('<span class="'+x.params.notificationClass+'" aria-live="assertive" aria-atomic="true"></span>'),notify:function(e){var a=x.a11y.liveRegion;0!==a.length&&(a.html(""),a.html(e))},init:function(){x.params.nextButton&&x.nextButton&&x.nextButton.length>0&&(x.a11y.makeFocusable(x.nextButton),x.a11y.addRole(x.nextButton,"button"),x.a11y.addLabel(x.nextButton,x.params.nextSlideMessage)),x.params.prevButton&&x.prevButton&&x.prevButton.length>0&&(x.a11y.makeFocusable(x.prevButton),x.a11y.addRole(x.prevButton,"button"),x.a11y.addLabel(x.prevButton,x.params.prevSlideMessage)),e(x.container).append(x.a11y.liveRegion)},initPagination:function(){x.params.pagination&&x.params.paginationClickable&&x.bullets&&x.bullets.length&&x.bullets.each(function(){var a=e(this);x.a11y.makeFocusable(a),x.a11y.addRole(a,"button"),x.a11y.addLabel(a,x.params.paginationBulletMessage.replace(/{{index}}/,a.index()+1))})},destroy:function(){x.a11y.liveRegion&&x.a11y.liveRegion.length>0&&x.a11y.liveRegion.remove()}},x.init=function(){x.params.loop&&x.createLoop(),x.updateContainerSize(),x.updateSlidesSize(),x.updatePagination(),x.params.scrollbar&&x.scrollbar&&(x.scrollbar.set(),x.params.scrollbarDraggable&&x.scrollbar.enableDraggable()),"slide"!==x.params.effect&&x.effects[x.params.effect]&&(x.params.loop||x.updateProgress(),x.effects[x.params.effect].setTranslate()),x.params.loop?x.slideTo(x.params.initialSlide+x.loopedSlides,0,x.params.runCallbacksOnInit):(x.slideTo(x.params.initialSlide,0,x.params.runCallbacksOnInit),0===x.params.initialSlide&&(x.parallax&&x.params.parallax&&x.parallax.setTranslate(),x.lazy&&x.params.lazyLoading&&(x.lazy.load(),x.lazy.initialImageLoaded=!0))),x.attachEvents(),x.params.observer&&x.support.observer&&x.initObservers(),x.params.preloadImages&&!x.params.lazyLoading&&x.preloadImages(),x.params.zoom&&x.zoom&&x.zoom.init(),x.params.autoplay&&x.startAutoplay(),x.params.keyboardControl&&x.enableKeyboardControl&&x.enableKeyboardControl(),x.params.mousewheelControl&&x.enableMousewheelControl&&x.enableMousewheelControl(),x.params.hashnavReplaceState&&(x.params.replaceState=x.params.hashnavReplaceState),x.params.history&&x.history&&x.history.init(),x.params.hashnav&&x.hashnav&&x.hashnav.init(),x.params.a11y&&x.a11y&&x.a11y.init(),x.emit("onInit",x)},x.cleanupStyles=function(){x.container.removeClass(x.classNames.join(" ")).removeAttr("style"),x.wrapper.removeAttr("style"),x.slides&&x.slides.length&&x.slides.removeClass([x.params.slideVisibleClass,x.params.slideActiveClass,x.params.slideNextClass,x.params.slidePrevClass].join(" ")).removeAttr("style").removeAttr("data-swiper-column").removeAttr("data-swiper-row"),x.paginationContainer&&x.paginationContainer.length&&x.paginationContainer.removeClass(x.params.paginationHiddenClass),x.bullets&&x.bullets.length&&x.bullets.removeClass(x.params.bulletActiveClass),x.params.prevButton&&e(x.params.prevButton).removeClass(x.params.buttonDisabledClass),x.params.nextButton&&e(x.params.nextButton).removeClass(x.params.buttonDisabledClass),x.params.scrollbar&&x.scrollbar&&(x.scrollbar.track&&x.scrollbar.track.length&&x.scrollbar.track.removeAttr("style"),x.scrollbar.drag&&x.scrollbar.drag.length&&x.scrollbar.drag.removeAttr("style"))},x.destroy=function(e,a){x.detachEvents(),x.stopAutoplay(),x.params.scrollbar&&x.scrollbar&&x.params.scrollbarDraggable&&x.scrollbar.disableDraggable(),x.params.loop&&x.destroyLoop(),a&&x.cleanupStyles(),x.disconnectObservers(),x.params.zoom&&x.zoom&&x.zoom.destroy(),x.params.keyboardControl&&x.disableKeyboardControl&&x.disableKeyboardControl(),x.params.mousewheelControl&&x.disableMousewheelControl&&x.disableMousewheelControl(),x.params.a11y&&x.a11y&&x.a11y.destroy(),x.params.history&&!x.params.replaceState&&window.removeEventListener("popstate",x.history.setHistoryPopState),x.params.hashnav&&x.hashnav&&x.hashnav.destroy(),x.emit("onDestroy"),e!==!1&&(x=null)},x.init(),x}};a.prototype={isSafari:function(){var e=window.navigator.userAgent.toLowerCase();return e.indexOf("safari")>=0&&e.indexOf("chrome")<0&&e.indexOf("android")<0}
33(),isUiWebView:/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(window.navigator.userAgent),isArray:function(e){return"[object Array]"===Object.prototype.toString.apply(e)},browser:{ie:window.navigator.pointerEnabled||window.navigator.msPointerEnabled,ieTouch:window.navigator.msPointerEnabled&&window.navigator.msMaxTouchPoints>1||window.navigator.pointerEnabled&&window.navigator.maxTouchPoints>1,lteIE9:function(){var e=document.createElement("div");return e.innerHTML="<!--[if lte IE 9]><i></i><![endif]-->",1===e.getElementsByTagName("i").length}()},device:function(){var e=window.navigator.userAgent,a=e.match(/(Android);?[\s\/]+([\d.]+)?/),t=e.match(/(iPad).*OS\s([\d_]+)/),s=e.match(/(iPod)(.*OS\s([\d_]+))?/),r=!t&&e.match(/(iPhone\sOS|iOS)\s([\d_]+)/);return{ios:t||r||s,android:a}}(),support:{touch:window.Modernizr&&Modernizr.touch===!0||function(){return!!("ontouchstart"in window||window.DocumentTouch&&document instanceof DocumentTouch)}(),transforms3d:window.Modernizr&&Modernizr.csstransforms3d===!0||function(){var e=document.createElement("div").style;return"webkitPerspective"in e||"MozPerspective"in e||"OPerspective"in e||"MsPerspective"in e||"perspective"in e}(),flexbox:function(){for(var e=document.createElement("div").style,a="alignItems webkitAlignItems webkitBoxAlign msFlexAlign mozBoxAlign webkitFlexDirection msFlexDirection mozBoxDirection mozBoxOrient webkitBoxDirection webkitBoxOrient".split(" "),t=0;t<a.length;t++)if(a[t]in e)return!0}(),observer:function(){return"MutationObserver"in window||"WebkitMutationObserver"in window}(),passiveListener:function(){var e=!1;try{var a=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("testPassiveListener",null,a)}catch(e){}return e}(),gestures:function(){return"ongesturestart"in window}()},plugins:{}};for(var t=["jQuery","Zepto","Dom7"],s=0;s<t.length;s++)window[t[s]]&&function(e){e.fn.swiper=function(t){var s;return e(this).each(function(){var e=new a(this,t);s||(s=e)}),s}}(window[t[s]]);var r;r="undefined"==typeof Dom7?window.Dom7||window.Zepto||window.jQuery:Dom7,r&&("transitionEnd"in r.fn||(r.fn.transitionEnd=function(e){function a(i){if(i.target===this)for(e.call(this,i),t=0;t<s.length;t++)r.off(s[t],a)}var t,s=["webkitTransitionEnd","transitionend","oTransitionEnd","MSTransitionEnd","msTransitionEnd"],r=this;if(e)for(t=0;t<s.length;t++)r.on(s[t],a);return this}),"transform"in r.fn||(r.fn.transform=function(e){for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransform=t.MsTransform=t.msTransform=t.MozTransform=t.OTransform=t.transform=e}return this}),"transition"in r.fn||(r.fn.transition=function(e){"string"!=typeof e&&(e+="ms");for(var a=0;a<this.length;a++){var t=this[a].style;t.webkitTransitionDuration=t.MsTransitionDuration=t.msTransitionDuration=t.MozTransitionDuration=t.OTransitionDuration=t.transitionDuration=e}return this}),"outerWidth"in r.fn||(r.fn.outerWidth=function(e){return this.length>0?e?this[0].offsetWidth+parseFloat(this.css("margin-right"))+parseFloat(this.css("margin-left")):this[0].offsetWidth:null})),window.Swiper=a}(),"undefined"!=typeof module?module.exports=window.Swiper:"function"==typeof define&&define.amd&&define([],function(){"use strict";return window.Swiper}); 34//# 35 36/*!@license Copyright 2013, Heinrich Goebl, License: MIT, see https://github.com/hgoebl/mobile-detect.js*/ 37!function(a,b){a(function(){"use strict";function a(a,b){return null!=a&&null!=b&&a.toLowerCase()===b.toLowerCase()}function c(a,b){var c,d,e=a.length;if(!e||!b)return!1;for(c=b.toLowerCase(),d=0;d<e;++d)if(c===a[d].toLowerCase())return!0;return!1}function d(a){for(var b in a)i.call(a,b)&&(a[b]=new RegExp(a[b],"i"))}function e(a){return(a||"").substr(0,500)}function f(a,b){this.ua=e(a),this._cache={},this.maxPhoneWidth=b||600}var g={};g.mobileDetectRules=
vendor: 31,408 bytes, line 37
37{phones:{iPhone:"\\biPhone\\b|\\biPod\\b",BlackBerry:"BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+",Pixel:"; \\bPixel\\b",HTC:"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel",Nexus:"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6",Dell:"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b",Motorola:"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052",Samsung:"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F",LG:"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710",Sony:"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332",Asus:"Asus.*Galaxy|PadFone.*Mobile",Xiaomi:"^(?!.*\\bx11\\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G",NokiaLumia:"Lumia [0-9]{3,4}",Micromax:"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b",Palm:"PalmSource|Palm",Vertu:"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature",Pantech:"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790",Fly:"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250",Wiko:"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM",iMobile:"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)",SimValley:"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b",Wolfgang:"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q",Alcatel:"Alcatel",Nintendo:"Nintendo (3DS|Switch)",Amoi:"Amoi",INQ:"INQ",OnePlus:"ONEPLUS",GenericPhone:"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},tablets:{iPad:"iPad|iPad.*Mobile",NexusTablet:"Android.*Nexus[\\s]+(7|9|10)",GoogleTablet:"Android.*Pixel C",SamsungTablet:"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860",Kindle:"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)",SurfaceTablet:"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)",HPTablet:"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10",AsusTablet:"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b",BlackBerryTablet:"PlayBook|RIM Tablet",HTCtablet:"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410",MotorolaTablet:"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617",NookTablet:"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2",AcerTablet:"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30|A3-A40",ToshibaTablet:"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO",LGTablet:"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b",FujitsuTablet:"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b",PrestigioTablet:"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002",LenovoTablet:"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L",DellTablet:"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7",YarvikTablet:"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b",MedionTablet:"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB",ArnovaTablet:"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2",IntensoTablet:"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004",IRUTablet:"M702pro",MegafonTablet:"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b",EbodaTablet:"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)",AllViewTablet:"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)",ArchosTablet:"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b",AinolTablet:"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark",NokiaLumiaTablet:"Lumia 2520",SonyTablet:"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712",PhilipsTablet:"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b",CubeTablet:"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT",CobyTablet:"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010",MIDTablet:"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10",MSITablet:"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b",SMiTTablet:"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)",RockChipTablet:"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A",FlyTablet:"IQ310|Fly Vision",bqTablet:"Android.*(bq)?.*\\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\\b|Maxwell.*Lite|Maxwell.*Plus",HuaweiTablet:"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19",NecTablet:"\\bN-06D|\\bN-08D",PantechTablet:"Pantech.*P4100",BronchoTablet:"Broncho.*(N701|N708|N802|a710)",VersusTablet:"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b",ZyncTablet:"z1000|Z99 2G|z930|z990|z909|Z919|z900",PositivoTablet:"TB07STA|TB10STA|TB07FTA|TB10FTA",NabiTablet:"Android.*\\bNabi",KoboTablet:"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build",DanewTablet:"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b",TexetTablet:"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE",PlaystationTablet:"Playstation.*(Portable|Vita)",TrekstorTablet:"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab",PyleAudioTablet:"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b",AdvanTablet:"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ",DanyTechTablet:"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1",GalapadTablet:"Android [0-9.]+; [a-z-]+; \\bG1\\b",MicromaxTablet:"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b",KarbonnTablet:"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b",AllFineTablet:"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide",PROSCANTablet:"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b",YONESTablet:"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026",ChangJiaTablet:"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503",GUTablet:"TX-A1301|TX-M9002|Q702|kf026",PointOfViewTablet:"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10",OvermaxTablet:"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027",HCLTablet:"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync",DPSTablet:"DPS Dream 9|DPS Dual 7",VistureTablet:"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10",CrestaTablet:"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989",MediatekTablet:"\\bMT8125|MT8389|MT8135|MT8377\\b",ConcordeTablet:"Concorde([ ]+)?Tab|ConCorde ReadMan",GoCleverTablet:"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042",ModecomTablet:"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003",VoninoTablet:"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b",ECSTablet:"V07OT2|TM105A|S10OT1|TR10CS1",StorexTablet:"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab",VodafoneTablet:"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400",EssentielBTablet:"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2",RossMoorTablet:"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711",iMobileTablet:"i-mobile i-note",TolinoTablet:"tolino tab [0-9.]+|tolino shine",AudioSonicTablet:"\\bC-22Q|T7-QC|T-17B|T-17P\\b",AMPETablet:"Android.* A78 ",SkkTablet:"Android.* (SKYPAD|PHOENIX|CYCLOPS)",TecnoTablet:"TECNO P9|TECNO DP8D",JXDTablet:"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b",iJoyTablet:"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)",FX2Tablet:"FX2 PAD7|FX2 PAD10",XoroTablet:"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151",ViewsonicTablet:"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a",VerizonTablet:"QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1",OdysTablet:"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10",CaptivaTablet:"CAPTIVA PAD",IconbitTablet:"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S",TeclastTablet:"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi",OndaTablet:"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+|V10 \\b4G\\b",JaytechTablet:"TPC-PA762",BlaupunktTablet:"Endeavour 800NG|Endeavour 1010",DigmaTablet:"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b",EvolioTablet:"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b",LavaTablet:"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b",AocTablet:"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712",MpmanTablet:"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010",CelkonTablet:"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b",WolderTablet:"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b",MediacomTablet:"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA",MiTablet:"\\bMI PAD\\b|\\bHM NOTE 1W\\b",NibiruTablet:"Nibiru M1|Nibiru Jupiter One",NexoTablet:"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI",LeaderTablet:"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100",UbislateTablet:"UbiSlate[\\s]?7C",PocketBookTablet:"Pocketbook",KocasoTablet:"\\b(TB-1207)\\b",HisenseTablet:"\\b(F5281|E2371)\\b",Hudl:"Hudl HT7S3|Hudl 2",TelstraTablet:"T-Hub2",GenericTablet:"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107"},oss:{AndroidOS:"Android",BlackBerryOS:"blackberry|\\bBB10\\b|rim tablet os",PalmOS:"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino",SymbianOS:"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b",WindowsMobileOS:"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;",WindowsPhoneOS:"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;",iOS:"\\biPhone.*Mobile|\\biPod|\\biPad|AppleCoreMedia",iPadOS:"CPU OS 13",SailfishOS:"Sailfish",MeeGoOS:"MeeGo",MaemoOS:"Maemo",JavaOS:"J2ME/|\\bMIDP\\b|\\bCLDC\\b",webOS:"webOS|hpwOS",badaOS:"\\bBada\\b",BREWOS:"BREW"},uas:{Chrome:"\\bCrMo\\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?",Dolfin:"\\bDolfin\\b",Opera:"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+$|Coast/[0-9.]+",Skyfire:"Skyfire",Edge:"\\bEdgiOS\\b|Mobile Safari/[.0-9]* Edge",IE:"IEMobile|MSIEMobile",Firefox:"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS",Bolt:"bolt",TeaShark:"teashark",Blazer:"Blazer",Safari:"Version((?!\\bEdgiOS\\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari",WeChat:"\\bMicroMessenger\\b",UCBrowser:"UC.*Browser|UCWEB",baiduboxapp:"baiduboxapp",baidubrowser:"baidubrowser",DiigoBrowser:"DiigoBrowser",Mercury:"\\bMercury\\b",ObigoBrowser:"Obigo",NetFront:"NF-Browser",GenericBrowser:"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger",PaleMoon:"Android.*PaleMoon|Mobile.*PaleMoon"},props:{Mobile:"Mobile/[VER]",Build:"Build/[VER]",Version:"Version/[VER]",VendorID:"VendorID/[VER]",iPad:"iPad.*CPU[a-z ]+[VER]",iPhone:"iPhone.*CPU[a-z ]+[VER]",iPod:"iPod.*CPU[a-z ]+[VER]",Kindle:"Kindle/[VER]",Chrome:["Chrome/[VER]","CriOS/[VER]","CrMo/[VER]"],Coast:["Coast/[VER]"],Dolfin:"Dolfin/[VER]",Firefox:["Firefox/[VER]","FxiOS/[VER]"],Fennec:"Fennec/[VER]",Edge:"Edge/[VER]",IE:["IEMobile/[VER];","IEMobile [VER]","MSIE [VER];","Trident/[0-9.]+;.*rv:[VER]"],NetFront:"NetFront/[VER]",NokiaBrowser:"NokiaBrowser/[VER]",Opera:[" OPR/[VER]","Opera Mini/[VER]","Version/[VER]"],"Opera Mini":"Opera Mini/[VER]","Opera Mobi":"Version/[VER]",UCBrowser:["UCWEB[VER]","UC.*Browser/[VER]"],MQQBrowser:"MQQBrowser/[VER]",MicroMessenger:"MicroMessenger/[VER]",baiduboxapp:"baiduboxapp/[VER]",baidubrowser:"baidubrowser/[VER]",SamsungBrowser:"SamsungBrowser/[VER]",Iron:"Iron/[VER]",Safari:["Version/[VER]","Safari/[VER]"],Skyfire:"Skyfire/[VER]",Tizen:"Tizen/[VER]",Webkit:"webkit[ /][VER]",PaleMoon:"PaleMoon/[VER]",SailfishBrowser:"SailfishBrowser/[VER]",Gecko:"Gecko/[VER]",Trident:"Trident/[VER]",Presto:"Presto/[VER]",Goanna:"Goanna/[VER]",iOS:" \\bi?OS\\b [VER][ ;]{1}",Android:"Android [VER]",Sailfish:"Sailfish [VER]",BlackBerry:["BlackBerry[\\w]+/[VER]","BlackBerry.*Version/[VER]","Version/[VER]"],BREW:"BREW [VER]",Java:"Java/[VER]","Windows Phone OS":["Windows Phone OS [VER]","Windows Phone [VER]"],"Windows Phone":"Windows Phone [VER]","Windows CE":"Windows CE/[VER]","Windows NT":"Windows NT [VER]",Symbian:["SymbianOS/[VER]","Symbian/[VER]"],webOS:["webOS/[VER]","hpwOS/[VER];"]},utils:{Bot:"Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot",MobileBot:"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2",DesktopMode:"WPDesktop",TV:"SonyDTV|HbbTV",WebKit:"(webkit)[ /]([\\w.]+)",Console:"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|P
vendor: 7,611 bytes, lines 37-38
37LAYSTATION|Xbox)\\b",Watch:"SM-V700"}},g.detectMobileBrowsers={fullPattern:/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i, 38shortPattern:/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i,tabletPattern:/android|ipad|playbook|silk/i};var h,i=Object.prototype.hasOwnProperty;return g.FALLBACK_PHONE="UnknownPhone",g.FALLBACK_TABLET="UnknownTablet",g.FALLBACK_MOBILE="UnknownMobile",h="isArray"in Array?Array.isArray:function(a){return"[object Array]"===Object.prototype.toString.call(a)},function(){var a,b,c,e,f,j,k=g.mobileDetectRules;for(a in k.props)if(i.call(k.props,a)){for(b=k.props[a],h(b)||(b=[b]),f=b.length,e=0;e<f;++e)c=b[e],j=c.indexOf("[VER]"),j>=0&&(c=c.substring(0,j)+"([\\w._\\+]+)"+c.substring(j+5)),b[e]=new RegExp(c,"i");k.props[a]=b}d(k.oss),d(k.phones),d(k.tablets),d(k.uas),d(k.utils),k.oss0={WindowsPhoneOS:k.oss.WindowsPhoneOS,WindowsMobileOS:k.oss.WindowsMobileOS}}(),g.findMatch=function(a,b){for(var c in a)if(i.call(a,c)&&a[c].test(b))return c;return null},g.findMatches=function(a,b){var c=[];for(var d in a)i.call(a,d)&&a[d].test(b)&&c.push(d);return c},g.getVersionStr=function(a,b){var c,d,e,f,h=g.mobileDetectRules.props;if(i.call(h,a))for(c=h[a],e=c.length,d=0;d<e;++d)if(f=c[d].exec(b),null!==f)return f[1];return null},g.getVersion=function(a,b){var c=g.getVersionStr(a,b);return c?g.prepareVersionNo(c):NaN},g.prepareVersionNo=function(a){var b;return b=a.split(/[a-z._ \/\-]/i),1===b.length&&(a=b[0]),b.length>1&&(a=b[0]+".",b.shift(),a+=b.join("")),Number(a)},g.isMobileFallback=function(a){return g.detectMobileBrowsers.fullPattern.test(a)||g.detectMobileBrowsers.shortPattern.test(a.substr(0,4))},g.isTabletFallback=function(a){return g.detectMobileBrowsers.tabletPattern.test(a)},g.prepareDetectionCache=function(a,c,d){if(a.mobile===b){var e,h,i;return(h=g.findMatch(g.mobileDetectRules.tablets,c))?(a.mobile=a.tablet=h,void(a.phone=null)):(e=g.findMatch(g.mobileDetectRules.phones,c))?(a.mobile=a.phone=e,void(a.tablet=null)):void(g.isMobileFallback(c)?(i=f.isPhoneSized(d),i===b?(a.mobile=g.FALLBACK_MOBILE,a.tablet=a.phone=null):i?(a.mobile=a.phone=g.FALLBACK_PHONE,a.tablet=null):(a.mobile=a.tablet=g.FALLBACK_TABLET,a.phone=null)):g.isTabletFallback(c)?(a.mobile=a.tablet=g.FALLBACK_TABLET,a.phone=null):a.mobile=a.tablet=a.phone=null)}},g.mobileGrade=function(a){var b=null!==a.mobile();return a.os("iOS")&&a.version("iPad")>=4.3||a.os("iOS")&&a.version("iPhone")>=3.1||a.os("iOS")&&a.version("iPod")>=3.1||a.version("Android")>2.1&&a.is("Webkit")||a.version("Windows Phone OS")>=7||a.is("BlackBerry")&&a.version("BlackBerry")>=6||a.match("Playbook.*Tablet")||a.version("webOS")>=1.4&&a.match("Palm|Pre|Pixi")||a.match("hp.*TouchPad")||a.is("Firefox")&&a.version("Firefox")>=12||a.is("Chrome")&&a.is("AndroidOS")&&a.version("Android")>=4||a.is("Skyfire")&&a.version("Skyfire")>=4.1&&a.is("AndroidOS")&&a.version("Android")>=2.3||a.is("Opera")&&a.version("Opera Mobi")>11&&a.is("AndroidOS")||a.is("MeeGoOS")||a.is("Tizen")||a.is("Dolfin")&&a.version("Bada")>=2||(a.is("UC Browser")||a.is("Dolfin"))&&a.version("Android")>=2.3||a.match("Kindle Fire")||a.is("Kindle")&&a.version("Kindle")>=3||a.is("AndroidOS")&&a.is("NookTablet")||a.version("Chrome")>=11&&!b||a.version("Safari")>=5&&!b||a.version("Firefox")>=4&&!b||a.version("MSIE")>=7&&!b||a.version("Opera")>=10&&!b?"A":a.os("iOS")&&a.version("iPad")<4.3||a.os("iOS")&&a.version("iPhone")<3.1||a.os("iOS")&&a.version("iPod")<3.1||a.is("Blackberry")&&a.version("BlackBerry")>=5&&a.version("BlackBerry")<6||a.version("Opera Mini")>=5&&a.version("Opera Mini")<=6.5&&(a.version("Android")>=2.3||a.is("iOS"))||a.match("NokiaN8|NokiaC7|N97.*Series60|Symbian/3")||a.version("Opera Mobi")>=11&&a.is("SymbianOS")?"B":(a.version("BlackBerry")<5||a.match("MSIEMobile|Windows CE.*Mobile")||a.version("Windows Mobile")<=5.2,"C")},g.detectOS=function(a){return g.findMatch(g.mobileDetectRules.oss0,a)||g.findMatch(g.mobileDetectRules.oss,a)},g.getDeviceSmallerSide=function(){return window.screen.width<window.screen.height?window.screen.width:window.screen.height},f.prototype={constructor:f,mobile:function(){return g.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.mobile},phone:function(){return g.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.phone},tablet:function(){return g.prepareDetectionCache(this._cache,this.ua,this.maxPhoneWidth),this._cache.tablet},userAgent:function(){return this._cache.userAgent===b&&(this._cache.userAgent=g.findMatch(g.mobileDetectRules.uas,this.ua)),this._cache.userAgent},userAgents:function(){return this._cache.userAgents===b&&(this._cache.userAgents=g.findMatches(g.mobileDetectRules.uas,this.ua)),this._cache.userAgents},os:function(){return this._cache.os===b&&(this._cache.os=g.detectOS(this.ua)),this._cache.os},version:function(a){return g.getVersion(a,this.ua)},versionStr:function(a){return g.getVersionStr(a,this.ua)},is:function(b){return c(this.userAgents(),b)||a(b,this.os())||a(b,this.phone())||a(b,this.tablet())||c(g.findMatches(g.mobileDetectRules.utils,this.ua),b)},match:function(a){return a instanceof RegExp||(a=new RegExp(a,"i")),a.test(this.ua)},isPhoneSized:function(a){return f.isPhoneSized(a||this.maxPhoneWidth)},mobileGrade:function(){return this._cache.grade===b&&(this._cache.grade=g.mobileGrade(this)),this._cache.grade}},"undefined"!=typeof window&&window.screen?f.isPhoneSized=function(a){return a<0?b:g.getDeviceSmallerSide()<=a}:f.isPhoneSized=function(){},f._impl=g,f.version="1.4.5 2021-03-13",f})}(function(a){if("undefined"!=typeof module&&module.exports)return function(a){module.exports=a()};if("function"==typeof define&&define.amd)return define;if("undefined"!=typeof window)return function(a){window.MobileDetect=a()};throw new Error("unknown environment")}());
38 39/*! jQuery slabtext plugin v2.2 MIT/GPL2 @freqdec */ 40(function($){$.fn.slabText=function(options){var settings={fontRatio:0.78,forceNewCharCount:true,wrapAmpersand:true,headerBreakpoint:null,viewportBreakpoint:null,noResizeEvent:false,resizeThrottleTime:300,maxFontSize:999,postTweak:true,precision:3,minCharsPerLine:0};$("body").addClass("slabtexted");return this.each(function(){if(options){$.extend(settings,options);}var $this=$(this),keepSpans=$("span.slabtext",$this).length,words=keepSpans?[]:String($.trim($this.text())).replace(/\s{2,}/g," ").split(" "),origFontSize=null,idealCharPerLine=null,fontRatio=settings.fontRatio,forceNewCharCount=settings.forceNewCharCount,headerBreakpoint=settings.headerBreakpoint,viewportBreakpoint=settings.viewportBreakpoint,postTweak=settings.postTweak,precision=settings.precision,resizeThrottleTime=settings.resizeThrottleTime,minCharsPerLine=settings.minCharsPerLine,resizeThrottle=null,viewportWidth=$(window).width(),headLink=$this.find("a:first").attr("href")||$this.attr("href"),linkTitle=headLink?$this.find("a:first").attr("title"):"";if(!keepSpans&&minCharsPerLine&&words.join(" ").length<minCharsPerLine){return;}var grabPixelFontSize=function(){var dummy=jQuery('<div style="display:none;font-size:1em;margin:0;padding:0;height:auto;line-height:1;border:0;"> </div>').appendTo($this),emH=dummy.height();dummy.remove();return emH;};var resizeSlabs=function resizeSlabs(){var parentWidth=$this.width(),fs;$this.removeClass("slabtextdone slabtextinactive");if(viewportBreakpoint&&viewportBreakpoint>viewportWidth||headerBreakpoint&&headerBreakpoint>parentWidth){$this.addClass("slabtextinactive");return;}fs=grabPixelFontSize();if(!keepSpans&&(forceNewCharCount||fs!=origFontSize)){origFontSize=fs;var newCharPerLine=Math.min(60,Math.floor(parentWidth/(origFontSize*fontRatio))),wordIndex=0,lineText=[],counter=0,preText="",postText="",finalText="",slice,preDiff,postDiff;if(newCharPerLine!=idealCharPerLine){idealCharPerLine=newCharPerLine;while(wordIndex<words.length){postText="";while(postText.length<idealCharPerLine){preText=postText;postText+=words[wordIndex]+" ";if(++wordIndex>=words.length){break;}}if(minCharsPerLine){slice=words.slice(wordIndex).join(" ");if(slice.length<minCharsPerLine){postText+=slice;preText=postText;wordIndex=words.length+2;}}preDiff=idealCharPerLine-preText.length;postDiff=postText.length-idealCharPerLine;if((preDiff<postDiff)&&(preText.length>=(minCharsPerLine||2))){finalText=preText;wordIndex--;}else{finalText=postText;}finalText=$("<div/>").text(finalText).html();if(settings.wrapAmpersand){finalText=finalText.replace(/&/g,'<span class="amp">&</span>');}finalText=$.trim(finalText);lineText.push('<span class="slabtext">'+finalText+"</span>");}$this.html(lineText.join(" "));if(headLink){$this.wrapInner('<a href="'+headLink+'" '+(linkTitle?'title="'+linkTitle+'" ':"")+"/>");}}}else{origFontSize=fs;}$("span.slabtext",$this).each(function(){var $span=$(this),innerText=$span.text(),wordSpacing=innerText.split(" ").length>1,diff,ratio,fontSize;if(postTweak){$span.css({"word-spacing":0,"letter-spacing":0});}ratio=parentWidth/$span.width();fontSize=parseFloat(this.style.fontSize)||origFontSize;$span.css("font-size",Math.min((fontSize*ratio).toFixed(precision),settings.maxFontSize)+"px");diff=!!postTweak?parentWidth-$span.width():false;if(diff){$span.css((wordSpacing?"word":"letter")+"-spacing",(diff/(wordSpacing?innerText.split(" ").length-1:innerText.length)).toFixed(precision)+"px");}});$this.addClass("slabtextdone");};resizeSlabs();if(!settings.noResizeEvent){$(window).resize(function(){if($(window).width()==viewportWidth){return;}viewportWidth=$(window).width();clearTimeout(resizeThrottle);resizeThrottle=setTimeout(resizeSlabs,resizeThrottleTime);});}});};})(jQuery); 41/*! jQuery Lazy 1.6.7 - MIT & GPL-2.0 license - Copyright 2012-2016 Daniel 'Eisbehr' Kern */ 42!function(e,t,a,r){"use strict";function n(a,r,n,o){function i(){p=t.devicePixelRatio>1,l(n),r("delay")>=0&&setTimeout(function(){u(!0)},r("delay")),(r("delay")<0||r("combined"))&&(o.e=m(r("throttle"),function(e){"resize"===e.type&&(b=v=-1),u(e.all)}),o.a=function(e){l(e),n.push.apply(n,e)},o.g=function(){return n=e(n).filter(function(){return!e(this).data(r("loadedName"))})},u(),e(r("appendScroll")).on("scroll."+a.name+" resize."+a.name,o.e))}function l(t){if(t=e(t).filter(function(){return!e(this).data(r("handledName"))&&(e(this).attr(r("attribute"))||e(this).attr(r("loaderAttribute")))}).data("plugin_"+a.name,a),r("defaultImage")||r("placeholder"))for(var n=0;n<t.length;n++){var o=e(t[n]),i=t[n].tagName.toLowerCase(),l="background-image";"img"==i&&r("defaultImage")&&!o.attr("src")?o.attr("src",r("defaultImage")):"img"==i||!r("placeholder")||o.css(l)&&"none"!=o.css(l)||o.css(l,"url("/js/vendor/jquery-lazy/+r("placeholder")+")")}}function u(t){if(!n.length)return void(r("autoDestroy")&&a.destroy());for(var o=!1,i=r("imageBase")?r("imageBase"):"",l=0;l<n.length;
42l++)(function(a){if(c(a)||t){var n,l=e(a),u=a.tagName.toLowerCase(),f=l.attr(r("attribute"));l.data(r("handledName"))||r("visibleOnly")&&!l.is(":visible")||!(f&&("img"==u&&i+f!=l.attr("src")||"img"!=u&&i+f!=l.css("background-image"))||(n=l.attr(r("loaderAttribute"))))||(o=!0,l.data(r("handledName"),!0),d(l,u,i,n))}})(n[l]);o&&(n=e(n).filter(function(){return!e(this).data(r("handledName"))}))}function d(t,a,n,o){++h;var i=function(){A("onError",t),g()};if(A("beforeLoad",t),o)t.off("error").one("error",i),t.one("load",function(){r("removeAttribute")&&t.removeAttr(r("loaderAttribute")),t.data(r("loadedName"),!0),A("afterLoad",t),g()}),A(o,t,function(e){e?t.load():t.error()})||t.error();else{var l=e(new Image);l.one("error",i),l.one("load",function(){t.hide(),"img"==a?t.attr("src",l.attr("src")):t.css("background-image","url('"+l.attr("src")+"')"),t[r("effect")](r("effectTime")),r("removeAttribute")&&t.removeAttr(r("attribute")+" "+r("retinaAttribute")),t.data(r("loadedName"),!0),A("afterLoad",t),l.remove(),g()}),l.attr("src",n+t.attr(r(p&&t.attr(r("retinaAttribute"))?"retinaAttribute":"attribute"))),l.complete&&l.load()}}function c(e){var t=e.getBoundingClientRect(),a=r("scrollDirection"),n=r("threshold"),o=s()+n>t.top&&-n<t.bottom,i=f()+n>t.left&&-n<t.right;return"vertical"==a?o:"horizontal"==a?i:o&&i}function f(){return b>=0?b:b=e(t).width()}function s(){return v>=0?v:v=e(t).height()}function m(e,t){var n,o=0;return function(i,l){function u(){o=+new Date,t.call(a,i)}var d=+new Date-o;n&&clearTimeout(n),d>e||!r("enableThrottle")||l?u():n=setTimeout(u,e-d)}}function g(){--h,n.length||h||A("onFinishedAll")}function A(e,t,n){return(e=r(e))?(e.apply(a,[].slice.call(arguments,1)),!0):!1}var h=0,b=-1,v=-1,p=!1;!function(){"event"==r("bind")?i():e(t).on("load."+a.name,i)}()}function o(a,o){var i=this,l=e.extend({},i.configuration,o),u={};return i.config=function(e,t){return t===r?l[e]:(l[e]=t,i)},i.addItems=function(t){return u.a&&u.a("string"===e.type(t)?e(t):t),i},i.getItems=function(){return u.g?u.g():{}},i.update=function(e){return u.e&&u.e({},!e),i},i.loadAll=function(){return u.e&&u.e({all:!0},!0),i},i.destroy=function(){return e(i.config("appendScroll")).off("."+i.name,u.e),e(t).off("."+i.name),u={},r},n(i,i.config,a,u),i.config("chainable")?a:i}e.fn.Lazy=e.fn.lazy=function(e){return new o(this,e)},e.extend(o.prototype,{name:"lazy",configuration:{chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:t,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",retinaAttribute:"data-retina",loaderAttribute:"data-loader",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:null,afterLoad:null,onError:null,onFinishedAll:null}})}(jQuery,window,document); 43$(function() { 44 if ($('div.StageVoting_groupId').length) { 45 var vid = $('div.StageVoting_groupId').data('voting'); 46 var detail = $('div.StageVoting_groupId').data('detail'); 47 $.ajax({
48 url: '/_votings/arena/last.voting.php', 49 type: 'GET', 50 data: { 51 location: $(location).attr('href'), 52 select: 'id', 53 id:vid, 54 detail: detail 55 }, 56 dataType: 'html', 57 success: function (data) { 58 $('div.StageVoting_groupId').html(data); 59 60 } 61 }) 62 } 63 if($('div.StageVoting_groupAuto').length) { 64 $.ajax({ 65 url: '/_votings/arena/last.voting.php', 66 type: 'GET', 67 data: { 68 location: $(location).attr('href'), 69 select: 'last' 70 }, 71 dataType: 'html', 72 success: function (data) { 73 $('div.StageVoting_groupAuto').html(data); 74 75 } 76 }) 77 } 78 var request; 79 $(document).on('submit','form.StageVoting_form',function(e){ 80 e.preventDefault(); 81 var hash = $("input[name='i_vhash']:checked").val(); 82 if( typeof hash === "undefined"){ 83 $(".StageVoting_info").text("Bitte treffen Sie eine Auswahl"); 84 } else { 85 var $form = $(this); 86 var $inputs = $form.find("input, select, button, textarea"); 87 var serializedData = $form.serialize(); 88 $inputs.prop("disabled", true); 89 90 request = $.ajax({ 91 type: "POST", 92 url: "/_votings/arena/post.php", 93 data: serializedData, 94 }); 95 request.done(function (response, textStatus, jqXHR){ 96 // Log a message to the console 97 if($('div.StageVoting_groupAuto').length) { 98 $('div.StageVoting_groupAuto').html(response); 99 } 100 if($('div.StageVoting_groupId').length) { 101 $('div.StageVoting_groupId').html(response); 102 } 103 104 }); 105 request.fail(function (jqXHR, textStatus, errorThrown){ 106 // Log the error to the console 107 console.error( 108 "The following error occurred: "+ 109 textStatus, errorThrown 110 ); 111 }); 112 request.always(function () { 113 // Reenable the inputs 114 $inputs.prop("disabled", false); 115 }); 116 } 117 }) 118 119}); 120/* Click auf Logo nicht scrollen */ 121$(".Logo").on("click", function () { 122 localStorage.setItem('click','Logo'); 123}); 124 125/* ---- iPad-Events --- */ 126$(window).on("orientationchange resize",function(){ 127 if ( $(".Ad-superbanner .ad_superbanner").length) { 128 $(document).trigger("webskin"); 129 } 130}); 131 132/* --------------- GA Event Zählung --------------- */ 133var socialmedia_click = function(type, target) { 134 var fo_sm = { 135 'hitType': 'event', 136 'eventCategory': 'socialmedia-share_' + type, 137 'eventAction': 'Klick', 138 'eventLabel': target, 139 'page': window.location.pathname, 140 'location': window.location.href 141 }; 142 dfv_ga_repl(fo_sm); 143}; 144 145$("body").on("click", ".NavigationSharingHeader_itemLink", function(event){ 146 var d = event.currentTarget.getAttribute('data-te'); 147 if (d !== null) { 148 socialmedia_click("stickyheader", event.currentTarget.getAttribute('data-te')); 149 } 150}); 151$("body").on("click", ".NavigationSharingFooter_itemLink", function(event){ 152 var d = event.currentTarget.getAttribute('data-te'); 153 if (d !== null) { 154 socialmedia_click("footer", event.currentTarget.getAttribute('data-te')); 155 } 156}); 157 158$("body").on("click", ".PageArticle_sticky .ButtonSharing", function(event){ 159 var d = event.currentTarget.getAttribute('data-te'); 160 if (d !== null) { 161 socialmedia_click("content", event.currentTarget.getAttribute('data-te')); 162 } 163}); 164 165$("body").on("click", ".PageArticleAdvertorial_sticky .ButtonSharing", function(event){ 166 var d = event.currentTarget.getAttribute('data-te'); 167 if (d !== null) { 168 socialmedia_click("content", event.currentTarget.getAttribute('data-te')); 169 } 170}); 171 172$("body").on("click", ".MediaGallery_sharingButtons a", function(event){ 173 var d = event.currentTarget.getAttribute('data-te'); 174 if (d !== null) { 175 socialmedia_click("gallery", event.currentTarget.getAttribute('data-te')); 176 } 177}); 178 179$(".SiteHeader").on("click", ".NavigationMeta .FormLoginPopup_content button", function(event){
180 // Trigger Event bei Login-Link im Header 181 var fo_mr = { 182 'hitType': 'event', 183 'eventCategory': event.currentTarget.getAttribute('data-ga'), 184 'eventAction': 'Klick', 185 'eventLabel': 'Oben rechts', 186 'page': window.location.pathname, 187 'location': window.location.href 188 }; 189 dfv_ga_repl(fo_mr); 190}); 191 192$(".SiteHeader").on("click", ".NavigationMeta .FormLogoutPopup input[type=\"submit\"]", function(event){ 193 // Trigger Event bei Logout-Link im Header 194 var fo_mr = { 195 'hitType': 'event', 196 'eventCategory': event.currentTarget.getAttribute('data-ga'), 197 'eventAction': 'Klick', 198 'eventLabel': 'Oben rechts', 199 'page': window.location.pathname, 200 'location': window.location.href 201 }; 202 dfv_ga_repl(fo_mr); 203}); 204 205$(".StageGalleriesEdgewise, .StageStorechecks, .StageGalleries").on("click", "a", function(event){ 206 // Trigger Event bei Click auf Galerie Fotogaleriebühnen 207 var d = event.currentTarget.getAttribute('data-te'); 208 if (d !== null) { 209 var stageTitle = $(this).closest('article').parent().parent().find('.StageTitle a').text(); 210 if (typeof stageTitle === 'undefined' || stageTitle === '') { 211 stageTitle = $(this).closest('article').parent().parent().parent().find('.StageTitle a').text(); 212 } 213 214 var fo_pw = { 215 'hitType': 'event', 216 'eventCategory': stageTitle + ' Bühne', 217 'eventAction': 'Klick', 218 'eventLabel': event.currentTarget.getAttribute('data-te'), 219 'page': window.location.pathname, 220 'location': window.location.href 221 }; 222 dfv_ga_repl(fo_pw); 223 } 224}); 225 226/* Deaktiviert - Ticket LZT-3151 227$(".StageTeaserMostRead_listMostRead-numbered").on("click", "a", function(event){ 228 // Trigger Event bei Click auf Meist gelesen Blogroll 229 var d = event.currentTarget.getAttribute('data-te'); 230 if (d !== null) { 231 var fo_pw = { 232 'hitType': 'event', 233 'eventCategory': 'Meist gelesen Blogroll', 234 'eventAction': 'Klick', 235 'eventLabel': event.currentTarget.getAttribute('data-te'), 236 'page': window.location.pathname, 237 'location': window.location.href 238 }; 239 dfv_ga_repl(fo_pw); 240 } 241}); 242*/ 243 244$(".PageArticle_body").on("submit", ".StageVoting_form",function(){ 245 // Trigger Event bei Umfrage 246 var fo_mr = { 247 'hitType': 'event', 248 'eventCategory': 'Umfrage', 249 'eventAction': 'Klick', 250 'eventLabel': 'Detail', 251 'page': window.location.pathname, 252 'location': window.location.href 253 }; 254 dfv_ga_repl(fo_mr); 255 256}); 257 258$(".StageVoting").on("submit", ".StageVoting_form",function(){ 259 // Trigger Event bei Umfrage 260 var fo_mr = { 261 'hitType': 'event', 262 'eventCategory': 'Umfrage', 263 'eventAction': 'Klick', 264 'eventLabel': 'Arena', 265 'page': window.location.pathname, 266 'location': window.location.href 267 }; 268 dfv_ga_repl(fo_mr); 269 270}); 271 272/* --------------- Suche ---------- */ 273 274$(function(){ 275 var showSearch = function() { 276 277 var l = $("a.navsearch").position().left; 278 console.log($("a.navsearch").position()); 279 280 $("#header-searchinput").show(); 281 $("#header-searchinput").animate({ 282 width: "250px", 283 right: "0" 284 }, 200 ); 285 }; 286 287 var hideSearch = function() { 288 $( "#header-searchinput" ).animate({ 289 width: "0px", 290 right: "0" 291 }, 200, function() { 292 $("#header-searchinput").hide(); 293 }); 294 }; 295 296 var searchurl = $(location).attr('href'); 297 298 $(document).on("click touchstart",function(e) { 299 300 if($(e.target).attr('id') == "headersearch" && $("#header-searchinput").css("display") == "none") { 301 e.preventDefault(); 302 showSearch(); 303 } 304 else { 305 if ($(e.target).attr('id') == "header-searchfield" || $(e.target).attr('id') == "header-searchbutton") { 306 ;// Klick innerhalb des Suchfeldes 307 } 308 else { 309 hideSearch(); 310 } 311 } 312 }); 313 314}); 315 316/*---------- Aktionsseiten-Infobox ----------*/ 317 318$(document).on("show-infobox", function(event, info_box_id, info_icon_position){ 319 $("#"+info_box_id).css('top',info_icon_position.top + 30) 320 .css('left', info_icon_position.left - 160) 321 .css('display', 'block'); 322}); 323 324/*---------- Jobs auf News-Detailseite im Footer ----------*/ 325 326$(".NewsJobs_item, .NewsJobs_header, .NewsJobs_footer").on("click", function(event){ 327 if(event.currentTarget.getAttribute('data-te') !== undefined){ 328 var fo_pw = { 329 'hitType': 'event', 330 'eventCategory': 'Jobs', 331 'eventAction': 'Klick', 332 'eventLabel': event.currentTarget.getAttribute('data-te'), 333 'page': window.location.pathname, 334 'location': window.location.href 335 }; 336 dfv_ga_repl(fo_pw); 337 } 338}); 339 340 341/* Online-Specials Sponsoren */ 342 343$(".Sponsor_item-image img").on("click", function () { 344 var node = $(this).closest('a'); 345 var val = node.attr('href'); 346 if (val !== undefined) { 347 var fo_mr = { 348 'hitType': 'event', 349 'eventCategory': 'Dossiers', 350 'eventAction': 'click', 351 'eventLabel': val, 352 'page': window.location.pathname, 353 'location': window.location.href 354 }; 355 dfv_ga_repl(fo_mr); 356 } else { 357 return false;
358 } 359 return true; 360}); 361 362 363var md = new MobileDetect(window.navigator.userAgent); 364var oldScrollPosition; 365 366function preventEmptySearch() { 367 368 $('.PageSearchResults .SiteHeader_searchform button[type="submit"]').click(function(e) { 369 e.preventDefault(); 370 if ( $('.PageSearchResults .SiteHeader_searchform input[type="text"]').val() !== '' ) { 371 $('.PageSearchResults .SiteHeader_searchform form').submit(); 372 } 373 }); 374 375 $('.SiteHeader_searchform button[type="submit"]').not('.PageSearchResults .SiteHeader_searchform button[type="submit"]').click(function(e) { 376 e.preventDefault(); 377 if ( $('.SiteHeader_searchform input[type="text"]').val() !== '' ) { 378 $('.SiteHeader_searchform form').submit(); 379 } 380 }); 381 382 $('.SiteHeaderSticky_formSearch button[type="submit"]').click(function(e) { 383 e.preventDefault(); 384 if ( $('.SiteHeaderSticky_formSearch input[type="text"]').val() !== '' ) { 385 $('.SiteHeaderSticky_formSearch form').submit(); 386 } 387 }); 388 389 $('.FormSearchMobile button[type="submit"]').click(function(e) { 390 e.preventDefault(); 391 if ( $('.FormSearchMobile input[type="text"]').val() !== '' ) { 392 $('.FormSearchMobile').submit(); 393 } 394 }); 395 396 $('.FormSearch button[type="submit"]').click(function(e) { 397 e.preventDefault(); 398 if ( $('.FormSearch input[type="text"]').val() !== '' ) { 399 $('.FormSearch').submit(); 400 } 401 }); 402} 403 404function initAsideNav() { 405 $('.aside-menu .toggle-menu').click(function(e) { 406 e.preventDefault(); 407 $(this).closest('.aside-menu').toggleClass('open'); 408 $(this).closest('.aside-menu').find('.collapse-area').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', function(e) { 409 if (e.originalEvent.propertyName === 'max-height') { 410 $(document.body).trigger("sticky_kit:recalc"); 411 } 412 }); 413 }); 414} 415 416function initSearchToggle() { 417 $('.ToggleSearch').click(function() { 418 var searchform = '.SiteHeader .SiteHeader_searchform'; 419 420 if ( $(searchform+':visible').length === 0 ) { 421 $(searchform).slideDown(225); 422 $('.ToggleSearch').css('color', '#086F91') 423 .parent().addClass('isActive'); 424 } else if ( $(searchform+':visible').length > 0) { 425 $(searchform).slideUp(225); 426 $('.ToggleSearch').removeAttr('style') 427 .parent().removeClass('isActive'); 428 } 429 }); 430} 431 432function initMobileNav() { 433 $('.toggle-mobile-nav').click(function(e) { 434 $('body').toggleClass('mobile-nav-open'); 435 }); 436} 437 438function initNewsletterSelect() { 439 $('.newsletter-select').click(function(e) { 440 $(this).toggleClass('selected'); 441 }); 442} 443 444function initStickyColumn() { 445 var ButtonsSharing_margin_top = $('.PageArticle_content .PageArticle_sticky .ButtonsSharing, ' + 446 '.PageProduct_content .PageProduct_sticky .ButtonsSharing,' + 447 '.PageArticleAdvertorial_content .PageArticleAdvertorial_sticky .ButtonsSharing').css('margin-top'); 448 449 $('.PageArticle_content .PageArticle_sticky, .PageArticleAdvertorial_content .PageArticleAdvertorial_sticky, ' + 450 '.PageProduct_content .PageProduct_sticky').stick_in_parent({ 451 parent : '.sticky-container', 452 offset_top: 97, 453 bottoming: true 454 }).on("sticky_kit:stick", function(e) { 455 $(this).addClass('is_sticky'); 456 $('.PageArticle_content .PageArticle_sticky .ButtonsSharing,' + 457 '.PageProduct_content .PageProduct_sticky .ButtonsSharing,' + 458 '.PageArticleAdvertorial_content .PageArticleAdvertorial_sticky .ButtonsSharing ').css('margin-top',0); 459 }) 460 .on("sticky_kit:bottom", function(e) { 461 $(this).parent().css('position', 'static'); 462 }) 463 .on("sticky_kit:unstick", function(e) { 464 $(this).removeClass('is_sticky'); 465 $('.PageArticle_content .PageArticle_sticky .ButtonsSharing,' + 466 '.PageProduct_content .PageProduct_sticky .ButtonsSharing,' + 467 '.PageArticleAdvertorial_content .PageArticleAdvertorial_sticky .ButtonsSharing').css('margin-top',ButtonsSharing_margin_top); 468 }); 469 470 $('a[href="#"]').click(function(e){ 471 e.preventDefault(); 472 }); 473} 474 475var visible_ad = { v:false}; 476 477function checkAdvertisement(sw, ct_clicks, adIDs, adIterator, direction, galId) { 478 'use strict'; 479 480 if (typeof adIDs === 'undefined' || adIDs.length === 0) { 481 //sw.preventDefault(); 482 return [ct_clicks, adIterator]; 483 } 484 485 var firstCountDisplayBanner = 5; //Nutzer sieht 5 Bilder und nach 5. Klick den ersten Banner 486 var countDisplayBanner = firstCountDisplayBanner + 1; //Nutzer sieht 5 Bilder und nach 6. Klick nächsten Banner 487 var countSlides = sw.slides.length; 488 var hash; 489 490 //Banner ans Ende der Galerie setzen, wenn mehr Anzahl an Klicks definiert wurden, als es Galeriebilder (Slides) gibt 491 if ( firstCountDisplayBanner > (countSlides - 1) ) { 492 firstCountDisplayBanner = countDisplayBanner = countSlides - 1; 493 } 494 495 if (ct_clicks % countDisplayBanner === 0 || ct_clicks === firstCountDisplayBanner) { 496 if (ct_clicks === firstCountDisplayBanner) { 497 ct_clicks = countDisplayBanner; 498 } 499 sw.lockSwipes(); 500 sw.disableKeyboardControl(); 501 switch(direction) { 502 case 'next': hash = visible_ad.sn; 503 break; 504 case 'prev': hash = visible_ad.sp; 505 break; 506 default: break; 507 } 508 var banner_div = "<div id=\"renderSlot_Rectangle-Gal\" class=\"Ad banner gallery inner\"><script type=\"text/javascript\">adition.srq.push(function(api) { api.renderSlot(\"renderSlot_Rectangle-Gal\"); })</script></div>"; 509 var banner_name = "Rectangle-Gal"; 510 if (md.mobile() != null) { 511 banner_div = "<div id=\"renderSlot_Mobil-Rectangle-Gal\" class=\"Ad banner gallery inner\"><script type=\"text/javascript\">adition.srq.push(function(api) { api.renderSlot(\"renderSlot_Mobil-Rectangle-Gal\"); })</script></div>"; 512 banner_name = "Mobil-Rectangle-Gal"; 513 } 514 515 $(".swiper-container.gallery-thumbs").css("display","none"); 516 517 518 var content_pic = $("#" + galId + " .MediaGallery_sliderContainer.swiper-wrapper .swiper-slide[data-hash=\"" + hash + "\"], " + 519 "#" + galId + " .MediaGalleryFullWidth_sliderContainer.swiper-wrapper .swiper-slide[data-hash=\"" + hash + "\"]").html(); 520 521 adition.srq.push(function(api) {
522 api.configureRenderSlot("renderSlot_" + banner_name).setContentunitId(adIDs[adIterator]); 523 api.load(["renderSlot_" + banner_name ]).completeRendering(); 524 }); 525 adIterator++; 526 if (adIterator === adIDs.length) { 527 adIterator = 0; 528 } 529 530 531 $("#" + galId + " .swiper-wrapper .swiper-slide[data-hash=\"" + hash + "\"]").append(banner_div); 532 $("#" + galId + " .swiper-wrapper .swiper-slide[data-hash=\"" + hash + "\"]").children("div[class^='Media']").css('display','none'); 533 visible_ad.v = true; 534 535 536 // Desktop: Content einblenden, Swipen aktivieren 537 $(".swiper-button-prev, .swiper-button-next").on('click',{ sw: sw, content_pic: content_pic, visible_ad: visible_ad}, activateSwiping); 538 // Desktop: Content einblenden, Swipen aktivieren 539 $(document).on('keydown',{ sw: sw, content_pic: content_pic, visible_ad: visible_ad}, activateSwiping); 540 // Mobile-View: Content einblenden, Swipen aktivieren 541 $(".swiper-container").on('touchmove',{ sw: sw, content_pic: content_pic, visible_ad: visible_ad}, activateSwiping); 542 543 $('.swiper-button-prev, .swiper-button-next').css('width','18%'); 544 ct_clicks++; 545 } 546 return [ct_clicks, adIterator]; 547} 548 549function initLightbox(){ 550 551 $('.img-feature.zoom, .zoomable').on('click',function(e) { 552 e.preventDefault(); 553 var gid = $(this).data('gid'); 554 var url = $(this).data('url'); 555 var galtitle = $(this).data('title'); 556 var close = $(this).data('close'); 557 var divid = '#m'+gid; 558 // console.log(close); 559 // console.log('lenght:'+ $('#m'+gid).length); 560 var stateObj = { gallery: gid }; 561 history.pushState(stateObj, "start", url); 562 $.each( $('.modal'), function( key, value ) { 563 $(this).attr('class','unmodal hidden'); 564 }); 565 if($('#m'+gid).length == 0) { 566 $.ajax({ 567 url: '/gallery/modal.php', 568 type: 'GET', 569 async: false, 570 data: {gid:gid}, 571 dataType: 'HTML', 572 success: function(data) { 573 $('body').append(data); 574 } 575 }); 576 } else { 577 $('#m'+gid).attr('class','modal idle'); 578 } 579 //var adid = $(divid).data("adid"); 580 var adIDs = $(divid).data("adids"); 581 var adReturn = []; 582 var ct_clicks = 0; 583 var adIterator = 0; 584 585 var mySwiper = new Swiper ($(divid + ' .swiper-container'), { 586 // Optional parameters 587 direction: 'horizontal', 588 loop: true, 589 hashnav: true, 590 runCallbacksOnInit: false, 591 pagination: '.swiper-pagination', 592 nextButton: '.swiper-button-next', 593 prevButton: '.swiper-button-prev', 594 spaceBetween: 20, 595 observer: true, 596 observeParents: true, 597 onSlideChangeEnd: function (sw) { 598 visible_ad.sp = $("#" + gid + " .modal > .modal-background .swiper-wrapper .swiper-slide-prev").data("hash"); 599 visible_ad.sn = $("#" + gid + " .modal > .modal-background .swiper-wrapper .swiper-slide-next").data("hash"); 600 }, 601 onSlideNextStart: function(sw){ 602 if(sw.user_interaction === true){ 603 window.dfv_ga_vpageview(url, galtitle); 604 if (typeof window.sp_track_virtual_page_view === 'function') { 605 window.sp_track_virtual_page_view('m'+gid, url, galtitle); 606 } 607 ct_clicks++; 608 checkAdvertisement(sw, ct_clicks, adIDs, adIterator, 'next', galId); 609 } 610 }, 611 onSlidePrevStart: function(sw){ 612 if(sw.user_interaction === true){ 613 window.dfv_ga_vpageview(url, galtitle); 614 if (typeof window.sp_track_virtual_page_view === 'function') { 615 window.sp_track_virtual_page_view('m'+gid, url, galtitle); 616 } 617 ct_clicks++; 618 checkAdvertisement(sw, ct_clicks, adIDs, adIterator, 'prev', galId); 619 } 620 }, 621 onTouchStart(sw){ 622 sw.user_interaction = true; 623 } 624 }); 625 //console.log(mySwiper); 626 oldScrollPosition = $(document).scrollTop(); 627 //console.log($('#m'+gid)); 628 $('body').toggleClass('modal-open'); 629 //$('body ' + divid).toggleClass('modal-open'); 630 if (md.mobile() != null) { 631 // $('.modal').css('max-height', $(window).innerHeight()); 632 } 633 $('.modal .modal-close').one('click',function(e) { 634 $("#readmorem" + gid).removeClass("active"); 635 $(".swiper-slide .image img").removeClass("smooth"); 636 console.log('url:'+url); 637 e.preventDefault(); 638 if (close) { 639 $('body').removeClass('modal-open'); 640 var stateObj = { gallery: gid }; 641 history.pushState(stateObj, "close", '/galleries'); 642 if (md.mobile() != null) { 643 $(document).scrollTop(oldScrollPosition); 644 } 645 } else { 646 window.location.href = '/galleries'; 647 $('body').removeClass('modal-open'); 648 var stateObj = { gallery: gid }; 649 history.pushState(stateObj, "close", '/galleries'); 650 } 651 652 // Bannerlogik zurücksetzen 653 // console.log("reset advertisement"); 654 ct_clicks = 0; 655 visible_ad = { v:false }; 656 657 }); 658 659 /* Gallery Info Text */ 660 if($('#m' + gid + ' .infotext').length && !$("#m" + gid + ' .social-media-bar .infotext').length) { 661 var infotext = $('#m' + gid + ' .infotext').detach(); 662 infotext.appendTo("#m" + gid + ' .social-media-bar'); 663 } 664 $('.modal .infotext, .galleryreadmore').on('click tap', function(e) { 665 var view_width = $( window ).width(); 666 var view_height = $( window ).height(); 667 var info_width = $('#readmorem'+gid).width(); 668 var info_height = $('#readmorem'+gid).height(); 669 670 $('#readmorem'+gid).css("top", (view_height / 2) - (info_height / 2)); 671 $('#readmorem'+gid).css("left", (view_width / 2) - (info_width / 2)); 672 673 $("#readmorem" + gid).toggleClass("active"); 674 $(".swiper-slide .image img").toggleClass("smooth"); 675 676 if($(".galleryreadmore.active").length){ 677 mySwiper.lockSwipes(); 678 } 679 else{ 680 mySwiper.unlockSwipes(); 681 } 682 683 }); 684 685 $('.modal .modal-inner > .toggle-captions').on('click tap',function(e) { 686 console.log("toggle caption") 687 e.preventDefault(); 688 $(this).closest('.modal').toggleClass('show-captions'); 689 }); 690 691 }); 692 693} 694 695var galleryTop = new Array(); 696var galleryThumbs = new Array(); 697var galleryTopfw = new Array(); 698var galleryThumbsfw = new Array(); 699 700function activateSwiping(event){ 701 // Aktiviert das Blättern und setzt die Eventhandler für das Stoppen zurück 702 $(".PageGallery_content .gallery-top .swiper-slide-active, .PageGallery_content .gallery-top-fw .swiper-slide-active").html(event.data.content_pic); 703 $(this).parent().parent().find('.MediaGallery_sliderContainer.swiper-wrapper .swiper-slide-active, ' + 704 '.MediaGalleryFullWidth_sliderContainer.swiper-wrapper .swiper-slide-active').html(event.data.content_pic); 705 $(".banner.gallery.inner").remove(); 706 if (window.innerWidth > 768) { 707 $(".swiper-container.gallery-thumbs").css("display", "block"); 708 } 709 710 event.data.visible_ad.v = false;
711 event.data.sw.unlockSwipes(); 712 event.data.sw.enableKeyboardControl(); 713 $(".swiper-button-prev, .swiper-button-next").off('click',activateSwiping); 714 $(document).off('keydown', activateSwiping); 715 $(".swiper-container").off('touchmove', activateSwiping); 716} 717 718 719function initGallery() { 720 721 $('.MediaGallery').each(function(index){ 722 var galId = $(this).attr('id'); 723 var url = $(this).data('url'); 724 var galtitle = $(this).data('title'); 725 726 var close = $(this).data('close'); 727 var divid = $(this).parent().attr('id'); 728 729 //var adid = $("#"+galId).data("adid"); 730 var adIDs = $("#"+galId).data("adids"); 731 var adReturn = []; 732 var ct_clicks = 0; 733 var adIterator = 0; 734 735 galleryTop[index] = new Swiper ('#' + galId + ' .swiper-container.gallery-top', { 736 direction: 'horizontal', 737 loop: false, 738 spaceBetween: 30, 739 nextButton: '.swiper-button-next', 740 prevButton: '.swiper-button-prev', 741 control: galleryThumbs[index], 742 keyboardControl: true, 743 observer: true, 744 observeParents: true, 745 hashnav: false, 746 centeredSlides: true, 747 slideToClickedSlide: true, 748 runCallbacksOnInit: false, 749 //setTransform(slide,'translate3d('+(20)+'px,0,0)'), 750 onReachEnd: function(swiper) { 751 $('#swiper-left').css('width','15%'); 752 //alert('jetzt kommt Werbung') 753 }, 754 onTransitionEnd: function (sw) { 755 visible_ad.sp = $("#" + galId + " .swiper-wrapper .swiper-slide-prev").data("hash"); 756 visible_ad.sn = $("#" + galId + " .swiper-wrapper .swiper-slide-next").data("hash"); 757 }, 758 onSlideNextStart: function(sw){ 759 if(sw.user_interaction === true){ 760 window.dfv_iom_rpl(); 761 window.dfv_ga_vpageview(url, galtitle); 762 if (typeof window.sp_track_virtual_page_view === 'function') { 763 window.sp_track_virtual_page_view(galId, url, galtitle); 764 } 765 ct_clicks++; 766 adReturn = checkAdvertisement(sw, ct_clicks, adIDs, adIterator, 'next', galId); 767 ct_clicks = adReturn[0]; 768 adIterator = adReturn[1]; 769 //sw.stopPropagation(); 770 } 771 }, 772 onSlidePrevStart: function(sw){ 773 if(sw.user_interaction === true){ 774 window.dfv_iom_rpl(); 775 window.dfv_ga_vpageview(url, galtitle); 776 if (typeof window.sp_track_virtual_page_view === 'function') { 777 window.sp_track_virtual_page_view(galId, url, galtitle); 778 } 779 ct_clicks++; 780 adReturn = checkAdvertisement(sw, ct_clicks, adIDs, adIterator, 'prev', galId); 781 ct_clicks = adReturn[0]; 782 adIterator = adReturn[1]; 783 //sw.stopPropagation(); 784 } 785 }, 786 onTouchStart(sw){ 787 sw.user_interaction = true; 788 789 } 790 791 }); 792 galleryThumbs[index] = new Swiper ('#' + galId + ' .swiper-container.gallery-thumbs', { 793 // Optional parameters 794 loop: false, 795 slidesPerView: 'auto', 796 paginationClickable: true, 797 spaceBetween: 2, 798 slideToClickedSlide: true, 799 centeredSlides: true, 800 touchRatio: 0.2, 801 slidesOffsetBefore: '-350', 802// slideActiveClass: 'MediaGallery_thumbnailImageActive', 803 control: galleryTop[index] 804 }); 805 galleryTop[index].params.control = galleryThumbs[index]; 806 galleryThumbs[index].params.control = galleryTop[index]; 807 }); 808 809 $(".MediaGallery_slideArrowRight").css('opacity','1'); 810 $(".MediaGallery_slideRight").on("click touchstart swipe", function () { 811 $(".MediaGallery_slideLeft .MediaGallery_slideArrow").css('opacity','1'); 812 }); 813} 814 815function initFullWidthGallery() { 816 817 $('.MediaGalleryFullWidth').each(function(index){ 818 var galId = $(this).attr('id'); 819 var url = $(this).data('url'); 820 var galtitle = $(this).data('title'); 821 822 var close = $(this).data('close'); 823 var divid = $(this).parent().attr('id'); 824 825 //var adid = $("#"+galId).data("adid"); 826 var adIDs = $("#"+galId).data("adids"); 827 var adReturn = []; 828 var ct_clicks = 0; 829 var adIterator = 0; 830 831 galleryTopfw[index] = new Swiper ('#' + galId + ' .swiper-container.gallery-top-fw', { 832 direction: 'horizontal', 833 loop: true, 834 autoplay: 5000, 835 speed: 1000, 836 spaceBetween: 0, 837 nextButton: '.swiper-button-next', 838 prevButton: '.swiper-button-prev', 839 keyboardControl: true, 840 observer: true, 841 observeParents: true, 842 hashnav: false, 843 centeredSlides: true, 844// pagination: '.swiper-pagination', 845// paginationElement: 'span', 846// paginationClickable: true, 847// paginationType: 'bullets', 848 slideToClickedSlide: true, 849 runCallbacksOnInit: false, 850 autoHeight: (window.innerWidth > 768) ? false : true, 851 //setTransform(slide,'translate3d('+(20)+'px,0,0)'), 852 onReachEnd: function(swiper) { 853 $('#swiper-left').css('width','15%'); 854 //alert('jetzt kommt Werbung') 855 }, 856 onTransitionEnd: function (sw) { 857 visible_ad.sp = $("#" + galId + " .swiper-wrapper .swiper-slide-prev").data("hash"); 858 visible_ad.sn = $("#" + galId + " .swiper-wrapper .swiper-slide-next").data("hash"); 859 }, 860 onSlideNextStart: function(sw){ 861 if(sw.user_interaction === true){ 862 window.dfv_iom_rpl(); 863 window.dfv_ga_vpageview(url, galtitle); 864 if (typeof window.sp_track_virtual_page_view === 'function') { 865 window.sp_track_virtual_page_view(galId, url, galtitle); 866 } 867 ct_clicks++; 868 adReturn = checkAdvertisement(sw, ct_clicks, adIDs, adIterator, 'next', galId); 869 ct_clicks = adReturn[0]; 870 adIterator = adReturn[1]; 871 //sw.stopPropagation(); 872 } 873 }, 874 onSlidePrevStart: function(sw){ 875 if(sw.user_interaction === true){ 876 window.dfv_iom_rpl(); 877 window.dfv_ga_vpageview(url, galtitle); 878 if (typeof window.sp_track_virtual_page_view === 'function') { 879 window.sp_track_virtual_page_view(galId, url, galtitle); 880 } 881 ct_clicks++; 882 adReturn = checkAdvertisement(sw, ct_clicks, adIDs, adIterator, 'prev', galId); 883 ct_clicks = adReturn[0]; 884 adIterator = adReturn[1]; 885 //sw.stopPropagation(); 886 } 887 }, 888 onTouchStart(sw){ 889 sw.user_interaction = true; 890 } 891 892 }); 893 }); 894} 895 896function initCards() { 897 $('.card-collapse').on('click',(function(e) { 898 var me = $(this); 899 $('.card-collapse.open').not(this).removeClass('open'); 900 me.toggleClass('open'); 901 })); 902 $('.card-collapse').on('click','a',(function(e) { 903 //e.stopImmediatePropagation(); 904 console.log('offa'); 905 console.log($(this)); 906 $(this).trigger('click'); 907 })); 908} 909 910 911 912// __________________________________________________ 913// 914// 915// !Check Idle Time Mobile 916 917var timeoutID; 918 919function goInactive() { 920 if($('body').scrollTop() > 0) { 921 $('body').addClass('idle'); 922 } 923 924 $('.modal').addClass('idle'); 925} 926 927function goActive() { 928 $('body.idle').removeClass('idle'); 929 $('.modal.idle').removeClass('idle'); 930 startTimer(); 931} 932 933function resetTimer(e) { 934 window.clearTimeout(timeoutID); 935 goActive(); 936} 937 938function startTimer() { 939 // wait 2 seconds before calling goInactive 940 timeoutID = window.setTimeout(goInactive, 2000); 941} 942 943 944function make_square(element) { 945// var cw = $(element).width(); 946// $(element).css({'height':cw+'px'}); 947} 948 949 950 951 952 953 954function setupIdle() { 955 this.addEventListener("mousemove", resetTimer); 956 this.addEventListener("mousedown", resetTimer); 957 this.addEventListener("keypress", resetTimer); 958 this.addEventListener("DOMMouseScroll", resetTimer); 959 this.addEventListener('mousewheel', resetTimer, {passive: true}); 960 this.addEventListener("touchmove", resetTimer); 961 this.addEventListener("touchstart", resetTimer); 962 this.addEventListener("MSPointerMove", resetTimer); 963 964 startTimer(); 965} 966 967function initNewsletterBoxTheSpin() { 968 if ( $('.NLSpinBox') ) { 969 $('.NLSpinBox').css('bottom', '0'); 970 $('.NLSpinBox').css('height', '0'); 971 $('.NLSpinBox').delay(4000).css('display', 'block').animate({height: "210px"}, 500); 972 973 $('.NLSpinBox_close').click(function() { 974 $(".NLSpinBox").slideToggle(600, function() { 975 // Animation beendet 976 }); 977 }); 978 } 979} 980 981function createYoutubeApi() { 982 var tag = document.createElement('script'); 983 tag.src = "https://www.youtube.com/iframe_api"; 984 var firstScriptTag = document.getElementsByTagName('script')[0]; 985 firstScriptTag.parentNode.insertBefore(tag, firstScriptTag); 986} 987 988function adjustChartMobile() { 989 const mediaQuery = window.matchMedia('(max-width: 768px)'); 990 var balken = document.getElementsByClassName("balken"); 991 if (mediaQuery.matches) { 992 numItems = balken.length; 993 for (let i=0; i<numItems; i++) { 994 balken[i].removeAttribute('colspan'); 995 } 996 } 997} 998 999$(document).ready(function(){ 1000// $("a[href=#]").click(function(e) { 1001// e.preventDefault(); 1002// }); 1003// if (md.mobile() != null) { 1004// $('body').addClass('is-mobile'); 1005// }; 1006// if (md.phone() != null) { 1007// $('.stage-fashion > .row > .col-sm-4').slice(-2).remove(); 1008// } 1009 initSearchToggle(); 1010 setupIdle(); 1011 initStickyColumn(); 1012 initAsideNav(); 1013 initMobileNav(); 1014// preventEmptySearch(); 1015 initLightbox(); 1016 initCards(); 1017 initNewsletterSelect(); 1018 initGallery(); 1019 initFullWidthGallery(); 1020 initNewsletterBoxTheSpin(); 1021 createYoutubeApi(); 1022 adjustChartMobile(); 1023 1024 $('.ImageModal').colorbox({iframe:false, opacity: 0.8, maxWidth:'95%', maxHeight:'95%'}); 1025 1026 // mobile Navigation Flyout 1027 $(".NavigationFlyout_toggleButton").on('click',function(e){ 1028 e.preventDefault();$('.NavigationFlyout').toggleClass('isActive'); 1029 }); 1030 1031 // mobile Navigation Flyout 1032 $(".NavigationMobile_toggle").on('click',function(e){ 1033 e.preventDefault();$('.NavigationMobile').toggleClass('isActive'); 1034 $('body').toggleClass('isFixed'); 1035 }); 1036 1037 $('.paneltop').click( function() { 1038 $(this).css({"background-position":"0px -21px"}) 1039 .siblings().animate({"height":"100px"}, 200) 1040 }, function() { 1041 $(this).css({"background-position":"0px 0px"}) 1042 .siblings().animate({"height":"0px"}, 200); 1043 }) 1044 1045 // Bilder quadratisieren 1046 $( '.to-be-squared .teaser-image' ).each(function( index ) { 1047 make_square($(this)); 1048 }); 1049 1050 /* Abo-Panel */ 1051 var topnav_child_abo = document.getElementsByClassName('NavigationMeta_item')[6]; 1052 var abo_panel = document.getElementsByClassName('NavigationMeta_aboPopup')[0]; 1053 1054 function toggle_abo_panel() { 1055 abo_panel.classList.toggle('Hide'); 1056 } 1057 function toggle_topnav_state() { 1058 topnav_child_abo.classList.toggle('isActive'); 1059 } 1060 if (topnav_child_abo) { 1061 topnav_child_abo.onmouseover = function() { toggle_abo_panel(); toggle_topnav_state(); }; 1062 topnav_child_abo.onmouseout = function() { toggle_abo_panel(); toggle_topnav_state(); }; 1063 abo_panel.onmouseover = function() { toggle_abo_panel(); toggle_topnav_state(); }; 1064 abo_panel.onmouseout = function() { toggle_abo_panel(); toggle_topnav_state(); }; 1065 } 1066 1067 // Login-Popup/Logout-Popup 1068 var accountBtn = $(".NavigationMeta_item-account"); 1069 var accountBtnLink = $(".NavigationMeta_item-account .NavigationMeta_itemLink"); 1070 var loginPanel = $(".NavigationMeta .FormLoginPopup"); 1071 var logoutPanel = $(".NavigationMeta .FormLogoutPopup"); 1072 var panel = accountBtn.hasClass('isSignedOut') ? loginPanel : logoutPanel; 1073 var panel_input = $(".NavigationMeta .FormLoginPopup input"); 1074 1075 function showPanel(selector, a) { 1076 selector.css('visibility', 'visible'); 1077 a.addClass('isActive'); 1078 } 1079 function hidePanel(selector, a) { 1080 selector.removeAttr('style'); 1081 a.removeClass('isActive'); 1082 } 1083 1084 $(".NavigationMeta .FormLoginPopup .FormField_icon").click(function() { 1085 $('.NavigationMeta .FormLoginPopup .FormField_control').trigger('click'); 1086 }); 1087 1088 accountBtn.click(function(e) { 1089 e.preventDefault(); 1090 }); 1091 1092 accountBtn.mouseover( function() { showPanel(panel, accountBtn); } ); 1093 accountBtn.mouseout( function() { hidePanel(panel, accountBtn); } ); 1094 panel.mouseover( function() { showPanel(panel, accountBtn); } ); 1095 panel.mouseout( function() { 1096 if ( !panel_input.is(":focus") ) { 1097 hidePanel(panel, accountBtn); 1098 } 1099 }); 1100 1101}); 1102
1103// quadratische BildergröÃen beim Fenster-Verkleinern neu berechnen 1104$( window ).resize(function() { 1105 $( '.to-be-squared .teaser-image' ).each(function( index ) { 1106 make_square($(this)); 1107 }); 1108}); 1109 1110function manage_input_active_state(selector) { 1111 $(selector).each(function() { 1112 if ( $(this).val() ) { 1113 $(this).addClass('FormField_control-filled'); 1114 } 1115 $(this).change(function() { 1116 if ( $(this).val() ) { 1117 $(this).addClass('FormField_control-filled'); 1118 } 1119 if ( $(this).val() === '' ) { 1120 $(this).removeClass('FormField_control-filled'); 1121 } 1122 }); 1123 }); 1124} 1125 1126manage_input_active_state(".FormField_control:not([type='submit'])"); 1127manage_input_active_state(".FormField_controlGroupField:not([type='submit'])"); 1128 1129function manageCreditsLink(outerClassName) { 1130 document.addEventListener('DOMContentLoaded', function() { 1131 1132 const imageList = document.getElementsByClassName(outerClassName); 1133 for (let i = 0; i < imageList.length; i++) { 1134 1135 for (let j = 0; j < imageList[i].children.length; j++) { 1136 1137 if (imageList[i].children[j].classList[0] === 'MediaImage_credits') { 1138 let creditsText = imageList[i].children[j]; 1139 let creditsTextTrimmed = creditsText.innerHTML.replace(/^\s+|\s+$/g, ''); 1140 if (creditsTextTrimmed === '') { 1141 creditsText.remove(); //remove empty credits 1142 } else { 1143 //Open credits link in new tab 1144 let creditsLinkContainer = 1145 (creditsText.getElementsByClassName('MediaImage_credits-link')[0] !== undefined) 1146 ? creditsText.getElementsByClassName('MediaImage_credits-link')[0] 1147 : ''; 1148 let creditsLink = 1149 (creditsLinkContainer !== '' && creditsLinkContainer.dataset.href !== undefined) 1150 ? creditsLinkContainer.dataset.href 1151 : ''; 1152 if (creditsLink) { 1153 creditsLinkContainer.onclick = function(e) { 1154 e.preventDefault(); 1155 let opener = window.open(); 1156 opener.opener = null; 1157 opener.location = creditsLink; 1158 opener.target = '_blank'; 1159 }; 1160 } 1161 } 1162 } 1163 1164 } 1165 1166 } 1167 1168 }, false); 1169} 1170manageCreditsLink('MediaImage'); 1171manageCreditsLink('MediaImageGallery'); 1172 1173$(document).ready(function() { 1174 /** 1175 * ersetzt das Carousel 1176 * durch ein swipen beim neu Laden der Seite 1177 * in data-ride wird onPageLoad getsetzt 1178 * die Ids des Elements muessen eindeutig sein !!! 1179 */ 1180 $.each($("[data-ride]"), function (k, v) { 1181 if ($(this).data('ride') == 'onPageLoad') { 1182 var id = $(this).attr('id'); 1183 var store_name = 'onPageLoad' + id; 1184 var stack = []; 1185 var count_elm = $(this).children(".carousel-inner").children(".item").length; 1186 var random_stack_index = Math.floor(Math.random() * ((count_elm -1) + 1)); 1187 1188 if (sessionStorage.getItem(store_name)) { 1189 stack = JSON.parse(sessionStorage.getItem(store_name)); 1190 } 1191 if (stack.length !== count_elm) { 1192 stack = []; 1193 for (var i = 0; i < count_elm; i++) { 1194 stack[i] = 0; 1195 } 1196 stack[random_stack_index] = 1; 1197 } else { 1198 stack.unshift('0'); 1199 if (stack.pop() == 1) { 1200 stack[0] = 1; 1201 } 1202 } 1203 $.each($(this).children(".carousel-inner").children(".item"), function (i, x) { 1204 if (stack[i] == 0) { 1205 $(this).removeClass('active'); 1206 } else { 1207 $(this).addClass('active'); 1208 } 1209 }) 1210 sessionStorage.setItem(store_name, JSON.stringify(stack)); 1211 } 1212 }); 1213}); 1214!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:.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,
vendor: 6,594 bytes, line 1214
1214sliding:!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.o
vendor: 3,442 bytes, line 1214
1214ptions.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.
1214slick",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:
1214parseInt(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"}
1214,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}
vendor: 5,619 bytes, line 1214
1214,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={};
1214!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}
1214):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+
1214o: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","")}
vendor: 10,554 bytes, lines 1214-1221
1214,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}}); 1215 1216/*! 1217 Colorbox 1.6.3 1218 license: MIT 1219 http://www.jacklmoore.com/colorbox 1220*/ 1221(function(t,e,i){function n(i,n,o){var r=e.createElement(i);return n&&(r.id=Z+n),o&&(r.style.cssText=o),t(r)}function o(){return i.innerHeight?i.innerHeight:t(i).height()}function r(e,i){i!==Object(i)&&(i={}),this.cache={},this.el=e,this.value=function(e){var n;return void 0===this.cache[e]&&(n=t(this.el).attr("data-cbox-"+e),void 0!==n?this.cache[e]=n:void 0!==i[e]?this.cache[e]=i[e]:void 0!==X[e]&&(this.cache[e]=X[e])),this.cache[e]},this.get=function(e){var i=this.value(e);return t.isFunction(i)?i.call(this.el,this):i}}function h(t){var e=W.length,i=(A+t)%e;return 0>i?e+i:i}function a(t,e){return Math.round((/%/.test(t)?("x"===e?E.width():o())/100:1)*parseInt(t,10))}function s(t,e){return t.get("photo")||t.get("photoRegex").test(e)}function l(t,e){return t.get("retinaUrl")&&i.devicePixelRatio>1?e.replace(t.get("photoRegex"),t.get("retinaSuffix")):e}function d(t){"contains"in x[0]&&!x[0].contains(t.target)&&t.target!==v[0]&&(t.stopPropagation(),x.focus())}function c(t){c.str!==t&&(x.add(v).removeClass(c.str).addClass(t),c.str=t)}function g(e){A=0,e&&e!==!1&&"nofollow"!==e?(W=t("."+te).filter(function(){var i=t.data(this,Y),n=new r(this,i);return n.get("rel")===e}),A=W.index(_.el),-1===A&&(W=W.add(_.el),A=W.length-1)):W=t(_.el)}function u(i){t(e).trigger(i),ae.triggerHandler(i)}function f(i){var o;if(!G){if(o=t(i).data(Y),_=new r(i,o),g(_.get("rel")),!$){$=q=!0,c(_.get("className")),x.css({visibility:"hidden",display:"block",opacity:""}),I=n(se,"LoadedContent","width:0; height:0; overflow:hidden; visibility:hidden"),b.css({width:"",height:""}).append(I),j=T.height()+k.height()+b.outerHeight(!0)-b.height(),D=C.width()+H.width()+b.outerWidth(!0)-b.width(),N=I.outerHeight(!0),z=I.outerWidth(!0);var h=a(_.get("initialWidth"),"x"),s=a(_.get("initialHeight"),"y"),l=_.get("maxWidth"),f=_.get("maxHeight");_.w=Math.max((l!==!1?Math.min(h,a(l,"x")):h)-z-D,0),_.h=Math.max((f!==!1?Math.min(s,a(f,"y")):s)-N-j,0),I.css({width:"",height:_.h}),J.position(),u(ee),_.get("onOpen"),O.add(F).hide(),x.focus(),_.get("trapFocus")&&e.addEventListener&&(e.addEventListener("focus",d,!0),ae.one(re,function(){e.removeEventListener("focus",d,!0)})),_.get("returnFocus")&&ae.one(re,function(){t(_.el).focus()})}var p=parseFloat(_.get("opacity"));v.css({opacity:p===p?p:"",cursor:_.get("overlayClose")?"pointer":"",visibility:"visible"}).show(),_.get("closeButton")?B.html(_.get("close")).appendTo(b):B.appendTo("<div/>"),w()}}function p(){x||(V=!1,E=t(i),x=n(se).attr({id:Y,"class":t.support.opacity===!1?Z+"IE":"",role:"dialog",tabindex:"-1"}).hide(),v=n(se,"Overlay").hide(),L=t([n(se,"LoadingOverlay")[0],n(se,"LoadingGraphic")[0]]),y=n(se,"Wrapper"),b=n(se,"Content").append(F=n(se,"Title"),R=n(se,"Current"),P=t('<button type="button"/>').attr({id:Z+"Previous"}),K=t('<button type="button"/>').attr({id:Z+"Next"}),S=n("button","Slideshow"),L),B=t('<button type="button"/>').attr({id:Z+"Close"}),y.append(n(se).append(n(se,"TopLeft"),T=n(se,"TopCenter"),n(se,"TopRight")),n(se,!1,"clear:left").append(C=n(se,"MiddleLeft"),b,H=n(se,"MiddleRight")),n(se,!1,"clear:left").append(n(se,"BottomLeft"),k=n(se,"BottomCenter"),n(se,"BottomRight"))).find("div div").css({"float":"left"}),M=n(se,!1,"position:absolute; width:9999px; visibility:hidden; display:none; max-width:none;"),O=K.add(P).add(R).add(S)),e.body&&!x.parent().length&&t(e.body).append(v,x.append(y,M))}function m(){function i(t){t.which>1||t.shiftKey||t.altKey||t.metaKey||t.ctrlKey||(t.preventDefault(),f(this))}return x?(V||(V=!0,K.click(function(){J.next()}),P.click(function(){J.prev()}),B.click(function(){J.close()}),v.click(function(){_.get("overlayClose")&&J.close()}),t(e).bind("keydown."+Z,function(t){var e=t.keyCode;$&&_.get("escKey")&&27===e&&(t.preventDefault(),J.close()),$&&_.get("arrowKey")&&W[1]&&!t.altKey&&(37===e?(t.preventDefault(),P.click()):39===e&&(t.preventDefault(),K.click()))}),t.isFunction(t.fn.on)?t(e).on("click."+Z,"."+te,i):t("."+te).live("click."+Z,i)),!0):!1}function w(){var e,o,r,h=J.prep,d=++le;if(q=!0,U=!1,u(he),u(ie),_.get("onLoad"),_.h=_.get("height")?a(_.get("height"),"y")-N-j:_.get("innerHeight")&&a(_.get("innerHeight"),"y"),_.w=_.get("width")?a(_.get("width"),"x")-z-D:_.get("innerWidth")&&a(_.get("innerWidth"),"x"),_.mw=_.w,_.mh=_.h,_.get("maxWidth")&&(_.mw=a(_.get("maxWidth"),"x")-z-D,_.mw=_.w&&_.w<_.mw?_.w:_.mw),_.get("maxHeight")&&(_.mh=a(_.get("maxHeight"),"y")-N-j,_.mh=_.h&&_.h<_.mh?_.h:_.mh),e=_.get("href"),Q=setTimeout(function(){L.show()},100),_.get("inline")){var c=t(e);r=t("<div>").hide().insertBefore(c),ae.one(he,function(){r.replaceWith(c)}),h(c)}else _.get("iframe")?h(" "):_.get("html")?h(_.get("html")):s(_,e)?(e=l(_,e),U=_.get("createImg"),t(U).addClass(Z+"Photo").bind("error."+Z,function(){h(n(se,"Error").html(_.get("imgError")))}).one("load",function(){d===le&&setTimeout(function(){var e;_.get("retinaImage")&&i.devicePixelRatio>1&&(U.height=U.height/i.devicePixelRatio,U.width=U.width/i.devicePixelRatio),_.get("scalePhotos")&&(o=function(){U.height-=U.height*e,U.width-=U.width*e},_.mw&&U.width>_.mw&&(e=(U.width-_.mw)/U.width,o()),_.mh&&U.height>_.mh&&(e=(U.height-_.mh)/U.height,o())),_.h&&(U.style.marginTop=Math.max(_.mh-U.height,0)/2+"px"),W[1]&&(_.get("loop")||W[A+1])&&(U.style.cursor="pointer",t(U).bind("click."+Z,function(){J.next()})),U.style.width=U.width+"px",U.style.height=U.height+"px",h(U)},1)}),U.src=e):e&&M.load(e,_.get("data"),function(e,i){d===le&&h("error"===i?n(se,"Error").html(_.get("xhrError")):t(this).contents())})}var v,x,y,b,T,C,H,k,W,E,I,M,L,F,R,S,K,P,B,O,_,j,D,N,z,A,U,$,q,G,Q,J,V,X={html:!1,photo:!1,iframe:!1,inline:!1,transition:"elastic",speed:300,fadeOut:300,width:!1,initialWidth:"600",innerWidth:!1,maxWidth:!1,height:!1,initialHeight:"450",innerHeight:!1,maxHeight:!1,scalePhotos:!0,scrolling:!0,opacity:.9,preloading:!0,className:!1,overlayClose:!0,escKey:!0,arrowKey:!0,top:!1,bottom:!1,left:!1,right:!1,fixed:!1,data:void 0,closeButton:!0,fastIframe:!0,open:!1,reposition:!0,loop:!0,slideshow:!1,slideshowAuto:!0,slideshowSpeed:2500,slideshowStart:"start slideshow",slideshowStop:"stop slideshow",photoRegex:/\.(gif|png|jp(e|g|eg)|bmp|ico|webp|jxr|svg)((#|\?).*)?$/i,retinaImage:!1,retinaUrl:!1,retinaSuffix:"@2x.$1",current:"image {current} of {total}",previous:"previous",next:"next",close:"close",xhrError:"This content failed to load.",imgError:"This image failed to load.",returnFocus:!0,trapFocus:!0,onOpen:!1,onLoad:!1,onComplete:!1,onCleanup:!1,onClosed:!1,rel:function(){return this.rel},href:function(){return t(this).attr("href")},title:function(){return this.title},createImg:function(){var e=new Image,i=t(this).data("cbox-img-attrs");return"object"==typeof i&&t.each(i,function(t,i){e[t]=i}),e},createIframe:function(){var i=e.createElement("iframe"),n=t(this).data("cbox-iframe-attrs");return"object"==typeof n&&t.each(n,function(t,e){i[t]=e}),"frameBorder"in i&&(i.frameBorder=0),"allowTransparency"in i&&(i.allowTransparency="true"),i.name=(new Date).getTime(),i.allowFullscreen=!0,i}},Y="colorbox",Z="cbox",te=Z+"Element",ee=Z+"_open",ie=Z+"_load",ne=Z+"_complete",oe=Z+"_cleanup",re=Z+"_closed",he=Z+"_purge",ae=t("<a/>"),se="div",le=0,de={},ce=function(){function t(){clearTimeout(h)}function e(){(_.get("loop")||W[A+1])&&(t(),h=setTimeout(J.next,_.get("slideshowSpeed")))}function i(){S.html(_.get("slideshowStop")).unbind(s).one(s,n),ae.bind(ne,e).bind(ie,t),x.removeClass(a+"off").addClass(a+"on")}function n(){t(),ae.unbind(ne,e).unbind(ie,t),S.html(_.get("slideshowStart")).unbind(s).one(s,function(){J.next(),i()}),x.removeClass(a+"on").addClass(a+"off")}function o(){r=!1,S.hide(),t(),ae.unbind(ne,e).unbind(ie,t),x.removeClass(a+"off "+a+"on")}var r,h,a=Z+"Slideshow_",s="click."+Z;return function(){r?_.get("slideshow")||(ae.unbind(oe,o),o()):_.get("slideshow")&&W[1]&&(r=!0,ae.one(oe,o),_.get("slideshowAuto")?i():n(),S.show())}}();t[Y]||(t(p),J=t.fn[Y]=t[Y]=function(e,i){var n,o=this;return e=e||{},t.isFunction(o)&&(o=t("<a/>"),e.open=!0),o[0]?(p(),m()&&(i&&(e.onComplete=i),o.each(function(){var i=t.data(this,Y)||{};t.data(this,Y,t.extend(i,e))}).addClass(te),n=new r(o[0],e),n.get("open")&&f(o[0])),o):o},J.position=function(e,i){function n(){T[0].style.width=k[0].style.width=b[0].style.width=parseInt(x[0].style.width,10)-D+"px",b[0].style.height=C[0].style.height=H[0].style.height=parseInt(x[0].style.height,10)-j+"px"}var r,h,s,l=0,d=0,c=x.offset();if(E.unbind("resize."+Z),x.css({top:-9e4,left:-9e4}),h=E.scrollTop(),s=E.scrollLeft(),_.get("fixed")?(c.top-=h,c.left-=s,x.css({position:"fixed"})):(l=h,d=s,x.css({position:"absolute"})),d+=_.get("right")!==!1?Math.max(E.width()-_.w-z-D-a(_.get("right"),"x"),0):_.get("left")!==!1?a(_.get("left"),"x"):Math.round(Math.max(E.width()-_.w-z-D,0)/2),l+=_.get("bottom")!==!1?Math.max(o()-_.h-N-j-a(_.get("bottom"),"y"),0):_.get("top")!==!1?a(_.get("top"),"y"):Math.round(Math.max(o()-_.h-N-j,0)/2),x.css({top:c.top,left
1221:c.left,visibility:"visible"}),y[0].style.width=y[0].style.height="9999px",r={width:_.w+z+D,height:_.h+N+j,top:l,left:d},e){var g=0;t.each(r,function(t){return r[t]!==de[t]?(g=e,void 0):void 0}),e=g}de=r,e||x.css(r),x.dequeue().animate(r,{duration:e||0,complete:function(){n(),q=!1,y[0].style.width=_.w+z+D+"px",y[0].style.height=_.h+N+j+"px",_.get("reposition")&&setTimeout(function(){E.bind("resize."+Z,J.position)},1),t.isFunction(i)&&i()},step:n})},J.resize=function(t){var e;$&&(t=t||{},t.width&&(_.w=a(t.width,"x")-z-D),t.innerWidth&&(_.w=a(t.innerWidth,"x")),I.css({width:_.w}),t.height&&(_.h=a(t.height,"y")-N-j),t.innerHeight&&(_.h=a(t.innerHeight,"y")),t.innerHeight||t.height||(e=I.scrollTop(),I.css({height:"auto"}),_.h=I.height()),I.css({height:_.h}),e&&I.scrollTop(e),J.position("none"===_.get("transition")?0:_.get("speed")))},J.prep=function(i){function o(){return _.w=_.w||I.width(),_.w=_.mw&&_.mw<_.w?_.mw:_.w,_.w}function a(){return _.h=_.h||I.height(),_.h=_.mh&&_.mh<_.h?_.mh:_.h,_.h}if($){var d,g="none"===_.get("transition")?0:_.get("speed");I.remove(),I=n(se,"LoadedContent").append(i),I.hide().appendTo(M.show()).css({width:o(),overflow:_.get("scrolling")?"auto":"hidden"}).css({height:a()}).prependTo(b),M.hide(),t(U).css({"float":"none"}),c(_.get("className")),d=function(){function i(){t.support.opacity===!1&&x[0].style.removeAttribute("filter")}var n,o,a=W.length;$&&(o=function(){clearTimeout(Q),L.hide(),u(ne),_.get("onComplete")},F.html(_.get("title")).show(),I.show(),a>1?("string"==typeof _.get("current")&&R.html(_.get("current").replace("{current}",A+1).replace("{total}",a)).show(),K[_.get("loop")||a-1>A?"show":"hide"]().html(_.get("next")),P[_.get("loop")||A?"show":"hide"]().html(_.get("previous")),ce(),_.get("preloading")&&t.each([h(-1),h(1)],function(){var i,n=W[this],o=new r(n,t.data(n,Y)),h=o.get("href");h&&s(o,h)&&(h=l(o,h),i=e.createElement("img"),i.src=h)})):O.hide(),_.get("iframe")?(n=_.get("createIframe"),_.get("scrolling")||(n.scrolling="no"),t(n).attr({src:_.get("href"),"class":Z+"Iframe"}).one("load",o).appendTo(I),ae.one(he,function(){n.src="//about:blank"}),_.get("fastIframe")&&t(n).trigger("load")):o(),"fade"===_.get("transition")?x.fadeTo(g,1,i):i())},"fade"===_.get("transition")?x.fadeTo(g,0,function(){J.position(0,d)}):J.position(g,d)}},J.next=function(){!q&&W[1]&&(_.get("loop")||W[A+1])&&(A=h(1),f(W[A]))},J.prev=function(){!q&&W[1]&&(_.get("loop")||A)&&(A=h(-1),f(W[A]))},J.close=function(){$&&!G&&(G=!0,$=!1,u(oe),_.get("onCleanup"),E.unbind("."+Z),v.fadeTo(_.get("fadeOut")||0,0),x.stop().fadeTo(_.get("fadeOut")||0,0,function(){x.hide(),v.hide(),u(he),I.remove(),setTimeout(function(){G=!1,u(re),_.get("onClosed")},1)}))},J.remove=function(){x&&(x.stop(),t[Y].close(),x.stop(!1,!0).remove(),v.remove(),G=!1,x=null,t("."+te).removeData(Y).removeClass(te),t(e).unbind("click."+Z).unbind("keydown."+Z))},J.element=function(){return t(_.el)},J.settings=X)})(jQuery,document,window); 1222/* Javascript plotting library for jQuery, version 0.8.3. 1223 1224Copyright (c) 2007-2014 IOLA and Ole Laursen. 1225Licensed under the MIT license. 1226 1227*/ 1228 1229// first an inline dependency, jquery.colorhelpers.js, we inline it here 1230// for convenience 1231 1232/* Plugin for jQuery for working with colors. 1233 * 1234 * Version 1.1. 1235 * 1236 * Inspiration from jQuery color animation plugin by John Resig. 1237 * 1238 * Released under the MIT license by Ole Laursen, October 2009. 1239 * 1240 * Examples: 1241 * 1242 * $.color.parse("#fff").scale('rgb', 0.25).add('a', -0.5).toString() 1243 * var c = $.color.extract($("#mydiv"), 'background-color'); 1244 * console.log(c.r, c.g, c.b, c.a); 1245 * $.color.make(100, 50, 25, 0.4).toString() // returns "rgba(100,50,25,0.4)" 1246 * 1247 * Note that .scale() and .add() return the same modified object 1248 * instead of making a new one. 1249 * 1250 * V. 1.1: Fix error handling so e.g. parsing an empty string does 1251 * produce a color rather than just crashing. 1252 */ 1253(function($){$.color={};$.color.make=function(r,g,b,a){var o={};o.r=r||0;o.g=g||0;o.b=b||0;o.a=a!=null?a:1;o.add=function(c,d){for(var i=0;i<c.length;++i)o[c.charAt(i)]+=d;return o.normalize()};o.scale=function(c,f){for(var i=0;i<c.length;++i)o[c.charAt(i)]*=f;return o.normalize()};o.toString=function(){if(o.a>=1){return"rgb("+[o.r,o.g,o.b].join(",")+")"}else{return"rgba("+[o.r,o.g,o.b,o.a].join(",")+")"}};o.normalize=function(){function clamp(min,value,max){return value<min?min:value>max?max:value}o.r=clamp(0,parseInt(o.r),255);o.g=clamp(0,parseInt(o.g),255);o.b=clamp(0,parseInt(o.b),255);o.a=clamp(0,o.a,1);return o};o.clone=function(){return $.color.make(o.r,o.b,o.g,o.a)};return o.normalize()};$.color.extract=function(elem,css){var c;do{c=elem.css(css).toLowerCase();if(c!=""&&c!="transparent")break;elem=elem.parent()}while(elem.length&&!$.nodeName(elem.get(0),"body"));if(c=="rgba(0, 0, 0, 0)")c="transparent";return $.color.parse(c)};$.color.parse=function(str){var res,m=$.color.make;if(res=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3}
vendor: 124,626 bytes, lines 1253-4404
1253)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10));if(res=/rgba\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseInt(res[1],10),parseInt(res[2],10),parseInt(res[3],10),parseFloat(res[4]));if(res=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55);if(res=/rgba\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\s*\)/.exec(str))return m(parseFloat(res[1])*2.55,parseFloat(res[2])*2.55,parseFloat(res[3])*2.55,parseFloat(res[4]));if(res=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(str))return m(parseInt(res[1],16),parseInt(res[2],16),parseInt(res[3],16));if(res=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(str))return m(parseInt(res[1]+res[1],16),parseInt(res[2]+res[2],16),parseInt(res[3]+res[3],16));var name=$.trim(str).toLowerCase();if(name=="transparent")return m(255,255,255,0);else{res=lookupColors[name]||[0,0,0];return m(res[0],res[1],res[2])}};var lookupColors={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0,0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0]}})(jQuery); 1254 1255// the actual Flot code 1256(function($) { 1257 1258 // Cache the prototype hasOwnProperty for faster access 1259 1260 var hasOwnProperty = Object.prototype.hasOwnProperty; 1261 1262 // A shim to provide 'detach' to jQuery versions prior to 1.4. Using a DOM 1263 // operation produces the same effect as detach, i.e. removing the element 1264 // without touching its jQuery data. 1265 1266 // Do not merge this into Flot 0.9, since it requires jQuery 1.4.4+. 1267 1268 if (!$.fn.detach) { 1269 $.fn.detach = function() { 1270 return this.each(function() { 1271 if (this.parentNode) { 1272 this.parentNode.removeChild( this ); 1273 } 1274 }); 1275 }; 1276 } 1277 1278 /////////////////////////////////////////////////////////////////////////// 1279 // The Canvas object is a wrapper around an HTML5 <canvas> tag. 1280 // 1281 // @constructor 1282 // @param {string} cls List of classes to apply to the canvas. 1283 // @param {element} container Element onto which to append the canvas. 1284 // 1285 // Requiring a container is a little iffy, but unfortunately canvas 1286 // operations don't work unless the canvas is attached to the DOM. 1287 1288 function Canvas(cls, container) { 1289 1290 var element = container.children("." + cls)[0]; 1291 1292 if (element == null) { 1293 1294 element = document.createElement("canvas"); 1295 element.className = cls; 1296 1297 $(element).css({ direction: "ltr", position: "absolute", left: 0, top: 0 }) 1298 .appendTo(container); 1299 1300 // If HTML5 Canvas isn't available, fall back to [Ex|Flash]canvas 1301 1302 if (!element.getContext) { 1303 if (window.G_vmlCanvasManager) { 1304 element = window.G_vmlCanvasManager.initElement(element); 1305 } else { 1306 throw new Error("Canvas is not available. If you're using IE with a fall-back such as Excanvas, then there's either a mistake in your conditional include, or the page has no DOCTYPE and is rendering in Quirks Mode."); 1307 } 1308 } 1309 } 1310 1311 this.element = element; 1312 1313 var context = this.context = element.getContext("2d"); 1314 1315 // Determine the screen's ratio of physical to device-independent 1316 // pixels. This is the ratio between the canvas width that the browser 1317 // advertises and the number of pixels actually present in that space. 1318 1319 // The iPhone 4, for example, has a device-independent width of 320px, 1320 // but its screen is actually 640px wide. It therefore has a pixel 1321 // ratio of 2, while most normal devices have a ratio of 1. 1322 1323 var devicePixelRatio = window.devicePixelRatio || 1, 1324 backingStoreRatio = 1325 context.webkitBackingStorePixelRatio || 1326 context.mozBackingStorePixelRatio || 1327 context.msBackingStorePixelRatio || 1328 context.oBackingStorePixelRatio || 1329 context.backingStorePixelRatio || 1; 1330 1331 this.pixelRatio = devicePixelRatio / backingStoreRatio; 1332 1333 // Size the canvas to match the internal dimensions of its container 1334 1335 this.resize(container.width(), container.height()); 1336 1337 // Collection of HTML div layers for text overlaid onto the canvas 1338 1339 this.textContainer = null; 1340 this.text = {}; 1341 1342 // Cache of text fragments and metrics, so we can avoid expensively 1343 // re-calculating them when the plot is re-rendered in a loop. 1344 1345 this._textCache = {}; 1346 } 1347 1348 // Resizes the canvas to the given dimensions. 1349 // 1350 // @param {number} width New width of the canvas, in pixels. 1351 // @param {number} width New height of the canvas, in pixels. 1352 1353 Canvas.prototype.resize = function(width, height) { 1354 1355 if (width <= 0 || height <= 0) { 1356 throw new Error("Invalid dimensions for plot, width = " + width + ", height = " + height); 1357 } 1358 1359 var element = this.element, 1360 context = this.context, 1361 pixelRatio = this.pixelRatio; 1362 1363 // Resize the canvas, increasing its density based on the display's 1364 // pixel ratio; basically giving it more pixels without increasing the 1365 // size of its element, to take advantage of the fact that retina 1366 // displays have that many more pixels in the same advertised space. 1367 1368 // Resizing should reset the state (excanvas seems to be buggy though) 1369 1370 if (this.width != width) { 1371 element.width = width * pixelRatio; 1372 element.style.width = width + "px"; 1373 this.width = width; 1374 } 1375 1376 if (this.height != height) { 1377 element.height = height * pixelRatio; 1378 element.style.height = height + "px"; 1379 this.height = height; 1380 } 1381 1382 // Save the context, so we can reset in case we get replotted. The 1383 // restore ensure that we're really back at the initial state, and 1384 // should be safe even if we haven't saved the initial state yet. 1385 1386 context.restore(); 1387 context.save(); 1388 1389 // Scale the coordinate space to match the display density; so even though we 1390 // may have twice as many pixels, we still want lines and other drawing to 1391 // appear at the same size; the extra pixels will just make them crisper. 1392 1393 context.scale(pixelRatio, pixelRatio); 1394 }; 1395 1396 // Clears the entire canvas area, not including any overlaid HTML text 1397 1398 Canvas.prototype.clear = function() { 1399 this.context.clearRect(0, 0, this.width, this.height); 1400 }; 1401 1402 // Finishes rendering the canvas, including managing the text overlay. 1403 1404 Canvas.prototype.render = function() { 1405 1406 var cache = this._textCache; 1407 1408 // For each text layer, add elements marked as active that haven't 1409 // already been rendered, and remove those that are no longer active. 1410 1411 for (var layerKey in cache) { 1412 if (hasOwnProperty.call(cache, layerKey)) { 1413 1414 var layer = this.getTextLayer(layerKey), 1415 layerCache = cache[layerKey]; 1416 1417 layer.hide(); 1418 1419 for (var styleKey in layerCache) { 1420 if (hasOwnProperty.call(layerCache, styleKey)) { 1421 var styleCache = layerCache[styleKey]; 1422 for (var key in styleCache) { 1423 if (hasOwnProperty.call(styleCache, key)) { 1424 1425 var positions = styleCache[key].positions; 1426 1427 for (var i = 0, position; position = positions[i]; i++) { 1428 if (position.active) { 1429 if (!position.rendered) { 1430 layer.append(position.element); 1431 position.rendered = true; 1432 } 1433 } else { 1434 positions.splice(i--, 1); 1435 if (position.rendered) { 1436 position.element.detach(); 1437 } 1438 } 1439 } 1440 1441 if (positions.length == 0) { 1442 delete styleCache[key]; 1443 } 1444 } 1445 } 1446 } 1447 } 1448 1449 layer.show(); 1450 } 1451 } 1452 }; 1453 1454 // Creates (if necessary) and returns the text overlay container. 1455 // 1456 // @param {string} classes String of space-separated CSS classes used to 1457 // uniquely identify the text layer. 1458 // @return {object} The jQuery-wrapped text-layer div. 1459 1460 Canvas.prototype.getTextLayer = function(classes) { 1461 1462 var layer = this.text[classes]; 1463 1464 // Create the text layer if it doesn't exist 1465 1466 if (layer == null) { 1467 1468 // Create the text layer container, if it doesn't exist 1469 1470 if (this.textContainer == null) { 1471 this.textContainer = $("<div class='flot-text'></div>") 1472 .css({ 1473 position: "absolute", 1474 top: 0, 1475 left: 0, 1476 bottom: 0, 1477 right: 0, 1478 'font-size': "smaller", 1479 color: "#545454" 1480 }) 1481 .insertAfter(this.element); 1482 } 1483 1484 layer = this.text[classes] = $("<div></div>") 1485 .addClass(classes) 1486 .css({ 1487 position: "absolute", 1488 top: 0, 1489 left: 0, 1490 bottom: 0, 1491 right: 0 1492 }) 1493 .appendTo(this.textContainer); 1494 } 1495 1496 return layer; 1497 }; 1498 1499 // Creates (if necessary) and returns a text info object. 1500 // 1501 // The object looks like this: 1502 // 1503 // { 1504 // width: Width of the text's wrapper div. 1505 // height: Height of the text's wrapper div. 1506 // element: The jQuery-wrapped HTML div containing the text. 1507 // positions: Array of positions at which this text is drawn. 1508 // } 1509 // 1510 // The positions array contains objects that look like this: 1511 // 1512 // { 1513 // active: Flag indicating whether the text should be visible. 1514 // rendered: Flag indicating whether the text is currently visible. 1515 // element: The jQuery-wrapped HTML div containing the text. 1516 // x: X coordinate at which to draw the text. 1517 // y: Y coordinate at which to draw the text. 1518 // } 1519 // 1520 // Each position after the first receives a clone of the original element. 1521 // 1522 // The idea is that that the width, height, and general 'identity' of the 1523 // text is constant no matter where it is placed; the placements are a 1524 // secondary property. 1525 // 1526 // Canvas maintains a cache of recently-used text info objects; getTextInfo 1527 // either returns the cached element or creates a new entry. 1528 // 1529 // @param {string} layer A string of space-separated CSS classes uniquely 1530 // identifying the layer containing this text. 1531 // @param {string} text Text string to retrieve info for. 1532 // @param {(string|object)=} font Either a string of space-separated CSS 1533 // classes or a font-spec object, defining the text's font and style. 1534 // @param {number=} angle Angle at which to rotate the text, in degrees. 1535 // Angle is currently unused, it will be implemented in the future. 1536 // @param {number=} width Maximum width of the text before it wraps. 1537 // @return {object} a text info object. 1538 1539 Canvas.prototype.getTextInfo = function(layer, text, font, angle, width) { 1540 1541 var textStyle, layerCache, styleCache, info; 1542 1543 // Cast the value to a string, in case we were given a number or such 1544 1545 text = "" + text; 1546 1547 // If the font is a font-spec object, generate a CSS font definition 1548 1549 if (typeof font === "object") { 1550 textStyle = font.style + " " + font.variant + " " + font.weight + " " + font.size + "px/" + font.lineHeight + "px " + font.family; 1551 } else { 1552 textStyle = font; 1553 } 1554 1555 // Retrieve (or create) the cache for the text's layer and styles 1556 1557 layerCache = this._textCache[layer]; 1558 1559 if (layerCache == null) { 1560 layerCache = this._textCache[layer] = {}; 1561 } 1562 1563 styleCache = layerCache[textStyle]; 1564 1565 if (styleCache == null) { 1566 styleCache = layerCache[textStyle] = {}; 1567 } 1568 1569 info = styleCache[text]; 1570 1571 // If we can't find a matching element in our cache, create a new one 1572 1573 if (info == null) { 1574 1575 var element = $("<div></div>").html(text) 1576 .css({ 1577 position: "absolute", 1578 'max-width': width, 1579 top: -9999 1580 }) 1581 .appendTo(this.getTextLayer(layer)); 1582 1583 if (typeof font === "object") { 1584 element.css({ 1585 font: textStyle, 1586 color: font.color 1587 }); 1588 } else if (typeof font === "string") { 1589 element.addClass(font); 1590 } 1591 1592 info = styleCache[text] = { 1593 width: element.outerWidth(true), 1594 height: element.outerHeight(true), 1595 element: element, 1596 positions: [] 1597 }; 1598 1599 element.detach(); 1600 } 1601 1602 return info; 1603 }; 1604 1605 // Adds a text string to the canvas text overlay. 1606 // 1607 // The text isn't drawn immediately; it is marked as rendering, which will 1608 // result in its addition to the canvas on the next render pass. 1609 // 1610 // @param {string} layer A string of space-separated CSS classes uniquely 1611 // identifying the layer containing this text. 1612 // @param {number} x X coordinate at which to draw the text. 1613 // @param {number} y Y coordinate at which to draw the text. 1614 // @param {string} text Text string to draw. 1615 // @param {(string|object)=} font Either a string of space-separated CSS 1616 // classes or a font-spec object, defining the text's font and style. 1617 // @param {number=} angle Angle at which to rotate the text, in degrees. 1618 // Angle is currently unused, it will be implemented in the future. 1619 // @param {number=} width Maximum width of the text before it wraps. 1620 // @param {string=} halign Horizontal alignment of the text; either "left", 1621 // "center" or "right". 1622 // @param {string=} valign Vertical alignment of the text; either "top", 1623 // "middle" or "bottom". 1624 1625 Canvas.prototype.addText = function(layer, x, y, text, font, angle, width, halign, valign) { 1626 1627 var info = this.getTextInfo(layer, text, font, angle, width), 1628 positions = info.positions; 1629 1630 // Tweak the div's position to match the text's alignment 1631 1632 if (halign == "center") { 1633 x -= info.width / 2; 1634 } else if (halign == "right") { 1635 x -= info.width; 1636 } 1637 1638 if (valign == "middle") { 1639 y -= info.height / 2; 1640 } else if (valign == "bottom") { 1641 y -= info.height; 1642 } 1643 1644 // Determine whether this text already exists at this position. 1645 // If so, mark it for inclusion in the next render pass. 1646 1647 for (var i = 0, position; position = positions[i]; i++) { 1648 if (position.x == x && position.y == y) { 1649 position.active = true; 1650 return; 1651 } 1652 } 1653 1654 // If the text doesn't exist at this position, create a new entry 1655 1656 // For the very first position we'll re-use the original element, 1657 // while for subsequent ones we'll clone it. 1658 1659 position = { 1660 active: true, 1661 rendered: false, 1662 element: positions.length ? info.element.clone() : info.element, 1663 x: x, 1664 y: y 1665 }; 1666 1667 positions.push(position); 1668 1669 // Move the element to its final position within the container 1670 1671 position.element.css({ 1672 top: Math.round(y), 1673 left: Math.round(x), 1674 'text-align': halign // In case the text wraps 1675 }); 1676 }; 1677 1678 // Removes one or more text strings from the canvas text overlay. 1679 // 1680 // If no parameters are given, all text within the layer is removed. 1681 // 1682 // Note that the text is not immediately removed; it is simply marked as 1683 // inactive, which will result in its removal on the next render pass. 1684 // This avoids the performance penalty for 'clear and redraw' behavior, 1685 // where we potentially get rid of all text on a layer, but will likely 1686 // add back most or all of it later, as when redrawing axes, for example. 1687 // 1688 // @param {string} layer A string of space-separated CSS classes uniquely 1689 // identifying the layer containing this text. 1690 // @param {number=} x X coordinate of the text. 1691 // @param {number=} y Y coordinate of the text. 1692 // @param {string=} text Text string to remove. 1693 // @param {(string|object)=} font Either a string of space-separated CSS 1694 // classes or a font-spec object, defining the text's font and style. 1695 // @param {number=} angle Angle at which the text is rotated, in degrees. 1696 // Angle is currently unused, it will be implemented in the future. 1697 1698 Canvas.prototype.removeText = function(layer, x, y, text, font, angle) { 1699 if (text == null) { 1700 var layerCache = this._textCache[layer]; 1701 if (layerCache != null) { 1702 for (var styleKey in layerCache) { 1703 if (hasOwnProperty.call(layerCache, styleKey)) { 1704 var styleCache = layerCache[styleKey]; 1705 for (var key in styleCache) { 1706 if (hasOwnProperty.call(styleCache, key)) { 1707 var positions = styleCache[key].positions; 1708 for (var i = 0, position; position = positions[i]; i++) { 1709 position.active = false; 1710 } 1711 } 1712 } 1713 } 1714 } 1715 } 1716 } else { 1717 var positions = this.getTextInfo(layer, text, font, angle).positions; 1718 for (var i = 0, position; position = positions[i]; i++) { 1719 if (position.x == x && position.y == y) { 1720 position.active = false; 1721 } 1722 } 1723 } 1724 }; 1725 1726 /////////////////////////////////////////////////////////////////////////// 1727 // The top-level container for the entire plot. 1728 1729 function Plot(placeholder, data_, options_, plugins) { 1730 // data is on the form: 1731 // [ series1, series2 ... ] 1732 // where series is either just the data as [ [x1, y1], [x2, y2], ... ] 1733 // or { data: [ [x1, y1], [x2, y2], ... ], label: "some label", ... } 1734 1735 var series = [], 1736 options = { 1737 // the color theme used for graphs 1738 colors: ["#edc240", "#afd8f8", "#cb4b4b", "#4da74d", "#9440ed"], 1739 legend: { 1740 show: true, 1741 noColumns: 1, // number of colums in legend table 1742 labelFormatter: null, // fn: string -> string 1743 labelBoxBorderColor: "#ccc", // border color for the little label boxes 1744 container: null, // container (as jQuery object) to put legend in, null means default on top of graph 1745 position: "ne", // position of default legend container within plot 1746 margin: 5, // distance from grid edge to default legend container within plot 1747 backgroundColor: null, // null means auto-detect 1748 backgroundOpacity: 0.85, // set to 0 to avoid background 1749 sorted: null // default to no legend sorting 1750 }, 1751 xaxis: { 1752 show: null, // null = auto-detect, true = always, false = never 1753 position: "bottom", // or "top" 1754 mode: null, // null or "time" 1755 font: null, // null (derived from CSS in placeholder) or object like { size: 11, lineHeight: 13, style: "italic", weight: "bold", family: "sans-serif", variant: "small-caps" } 1756 color: null, // base color, labels, ticks 1757 tickColor: null, // possibly different color of ticks, e.g. "rgba(0,0,0,0.15)" 1758 transform: null, // null or f: number -> number to transform axis 1759 inverseTransform: null, // if transform is set, this should be the inverse function 1760 min: null, // min. value to show, null means set automatically 1761 max: null, // max. value to show, null means set automatically 1762 autoscaleMargin: null, // margin in % to add if auto-setting min/max 1763 ticks: null, // either [1, 3] or [[1, "a"], 3] or (fn: axis info -> ticks) or app. number of ticks for auto-ticks 1764 tickFormatter: null, // fn: number -> string 1765 labelWidth: null, // size of tick labels in pixels 1766 labelHeight: null, 1767 reserveSpace: null, // whether to reserve space even if axis isn't shown 1768 tickLength: null, // size in pixels of ticks, or "full" for whole line 1769 alignTicksWithAxis: null, // axis number or null for no sync 1770 tickDecimals: null, // no. of decimals, null means auto 1771 tickSize: null, // number or [number, "unit"] 1772 minTickSize: null // number or [number, "unit"] 1773 }, 1774 yaxis: { 1775 autoscaleMargin: 0.02, 1776 position: "left" // or "right" 1777 }, 1778 xaxes: [], 1779 yaxes: [], 1780 series: { 1781 points: { 1782 show: false, 1783 radius: 3, 1784 lineWidth: 2, // in pixels 1785 fill: true, 1786 fillColor: "#ffffff", 1787 symbol: "circle" // or callback 1788 }, 1789 lines: { 1790 // we don't put in show: false so we can see 1791 // whether lines were actively disabled 1792 lineWidth: 2, // in pixels 1793 fill: false, 1794 fillColor: null, 1795 steps: false 1796 // Omit 'zero', so we can later default its value to 1797 // match that of the 'fill' option. 1798 }, 1799 bars: { 1800 show: false, 1801 lineWidth: 2, // in pixels 1802 barWidth: 1, // in units of the x axis 1803 fill: true, 1804 fillColor: null, 1805 align: "left", // "left", "right", or "center" 1806 horizontal: false, 1807 zero: true 1808 }, 1809 shadowSize: 3, 1810 highlightColor: null 1811 }, 1812 grid: { 1813 show: true, 1814 aboveData: false, 1815 color: "#545454", // primary color used for outline and labels 1816 backgroundColor: null, // null for transparent, else color 1817 borderColor: null, // set if different from the grid color 1818 tickColor: null, // color for the ticks, e.g. "rgba(0,0,0,0.15)" 1819 margin: 0, // distance from the canvas edge to the grid 1820 labelMargin: 5, // in pixels 1821 axisMargin: 8, // in pixels 1822 borderWidth: 2, // in pixels 1823 minBorderMargin: null, // in pixels, null means taken from points radius 1824 markings: null, // array of ranges or fn: axes -> array of ranges 1825 markingsColor: "#f4f4f4", 1826 markingsLineWidth: 2, 1827 // interactive stuff 1828 clickable: false, 1829 hoverable: false, 1830 autoHighlight: true, // highlight in case mouse is near 1831 mouseActiveRadius: 10 // how far the mouse can be away to activate an item 1832 }, 1833 interaction: { 1834 redrawOverlayInterval: 1000/60 // time between updates, -1 means in same flow 1835 }, 1836 hooks: {} 1837 }, 1838 surface = null, // the canvas for the plot itself 1839 overlay = null, // canvas for interactive stuff on top of plot 1840 eventHolder = null, // jQuery object that events should be bound to 1841 ctx = null, octx = null, 1842 xaxes = [], yaxes = [], 1843 plotOffset = { left: 0, right: 0, top: 0, bottom: 0}, 1844 plotWidth = 0, plotHeight = 0, 1845 hooks = { 1846 processOptions: [], 1847 processRawData: [], 1848 processDatapoints: [], 1849 processOffset: [], 1850 drawBackground: [], 1851 drawSeries: [], 1852 draw: [], 1853 bindEvents: [], 1854 drawOverlay: [], 1855 shutdown: [] 1856 }, 1857 plot = this; 1858 1859 // public functions 1860 plot.setData = setData; 1861 plot.setupGrid = setupGrid; 1862 plot.draw = draw; 1863 plot.getPlaceholder = function() { return placeholder; }; 1864 plot.getCanvas = function() { return surface.element; }; 1865 plot.getPlotOffset = function() { return plotOffset; }; 1866 plot.width = function () { return plotWidth; }; 1867 plot.height = function () { return plotHeight; }; 1868 plot.offset = function () { 1869 var o = eventHolder.offset(); 1870 o.left += plotOffset.left; 1871 o.top += plotOffset.top; 1872 return o; 1873 }; 1874 plot.getData = function () { return series; }; 1875 plot.getAxes = function () { 1876 var res = {}, i; 1877 $.each(xaxes.concat(yaxes), function (_, axis) { 1878 if (axis) 1879 res[axis.direction + (axis.n != 1 ? axis.n : "") + "axis"] = axis; 1880 }); 1881 return res; 1882 }; 1883 plot.getXAxes = function () { return xaxes; }; 1884 plot.getYAxes = function () { return yaxes; }; 1885 plot.c2p = canvasToAxisCoords; 1886 plot.p2c = axisToCanvasCoords; 1887 plot.getOptions = function () { return options; }; 1888 plot.highlight = highlight; 1889 plot.unhighlight = unhighlight; 1890 plot.triggerRedrawOverlay = triggerRedrawOverlay; 1891 plot.pointOffset = function(point) { 1892 return { 1893 left: parseInt(xaxes[axisNumber(point, "x") - 1].p2c(+point.x) + plotOffset.left, 10), 1894 top: parseInt(yaxes[axisNumber(point, "y") - 1].p2c(+point.y) + plotOffset.top, 10) 1895 }; 1896 }; 1897 plot.shutdown = shutdown; 1898 plot.destroy = function () { 1899 shutdown(); 1900 placeholder.removeData("plot").empty(); 1901 1902 series = []; 1903 options = null; 1904 surface = null; 1905 overlay = null; 1906 eventHolder = null; 1907 ctx = null; 1908 octx = null; 1909 xaxes = []; 1910 yaxes = []; 1911 hooks = null; 1912 highlights = []; 1913 plot = null; 1914 }; 1915 plot.resize = function () { 1916 var width = placeholder.width(), 1917 height = placeholder.height(); 1918 surface.resize(width, height); 1919 overlay.resize(width, height); 1920 }; 1921 1922 // public attributes 1923 plot.hooks = hooks; 1924 1925 // initialize 1926 initPlugins(plot); 1927 parseOptions(options_); 1928 setupCanvases(); 1929 setData(data_); 1930 setupGrid(); 1931 draw(); 1932 bindEvents(); 1933 1934 1935 function executeHooks(hook, args) { 1936 args = [plot].concat(args); 1937 for (var i = 0; i < hook.length; ++i) 1938 hook[i].apply(this, args); 1939 } 1940 1941 function initPlugins() { 1942 1943 // References to key classes, allowing plugins to modify them 1944 1945 var classes = { 1946 Canvas: Canvas 1947 }; 1948 1949 for (var i = 0; i < plugins.length; ++i) { 1950 var p = plugins[i]; 1951 p.init(plot, classes); 1952 if (p.options) 1953 $.extend(true, options, p.options); 1954 } 1955 } 1956 1957 function parseOptions(opts) { 1958 1959 $.extend(true, options, opts); 1960 1961 // $.extend merges arrays, rather than replacing them. When less 1962 // colors are provided than the size of the default palette, we 1963 // end up with those colors plus the remaining defaults, which is 1964 // not expected behavior; avoid it by replacing them here. 1965 1966 if (opts && opts.colors) { 1967 options.colors = opts.colors; 1968 } 1969 1970 if (options.xaxis.color == null) 1971 options.xaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString(); 1972 if (options.yaxis.color == null) 1973 options.yaxis.color = $.color.parse(options.grid.color).scale('a', 0.22).toString(); 1974 1975 if (options.xaxis.tickColor == null) // grid.tickColor for back-compatibility 1976 options.xaxis.tickColor = options.grid.tickColor || options.xaxis.color; 1977 if (options.yaxis.tickColor == null) // grid.tickColor for back-compatibility 1978 options.yaxis.tickColor = options.grid.tickColor || options.yaxis.color; 1979 1980 if (options.grid.borderColor == null) 1981 options.grid.borderColor = options.grid.color; 1982 if (options.grid.tickColor == null) 1983 options.grid.tickColor = $.color.parse(options.grid.color).scale('a', 0.22).toString(); 1984 1985 // Fill in defaults for axis options, including any unspecified 1986 // font-spec fields, if a font-spec was provided. 1987 1988 // If no x/y axis options were provided, create one of each anyway, 1989 // since the rest of the code assumes that they exist. 1990 1991 var i, axisOptions, axisCount, 1992 fontSize = placeholder.css("font-size"), 1993 fontSizeDefault = fontSize ? +fontSize.replace("px", "") : 13, 1994 fontDefaults = { 1995 style: placeholder.css("font-style"), 1996 size: Math.round(0.8 * fontSizeDefault), 1997 variant: placeholder.css("font-variant"), 1998 weight: placeholder.css("font-weight"), 1999 family: placeholder.css("font-family") 2000 }; 2001 2002 axisCount = options.xaxes.length || 1; 2003 for (i = 0; i < axisCount; ++i) { 2004 2005 axisOptions = options.xaxes[i]; 2006 if (axisOptions && !axisOptions.tickColor) { 2007 axisOptions.tickColor = axisOptions.color; 2008 } 2009 2010 axisOptions = $.extend(true, {}, options.xaxis, axisOptions); 2011 options.xaxes[i] = axisOptions; 2012 2013 if (axisOptions.font) { 2014 axisOptions.font = $.extend({}, fontDefaults, axisOptions.font); 2015 if (!axisOptions.font.color) { 2016 axisOptions.font.color = axisOptions.color; 2017 } 2018 if (!axisOptions.font.lineHeight) { 2019 axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15); 2020 } 2021 } 2022 } 2023 2024 axisCount = options.yaxes.length || 1; 2025 for (i = 0; i < axisCount; ++i) { 2026 2027 axisOptions = options.yaxes[i]; 2028 if (axisOptions && !axisOptions.tickColor) { 2029 axisOptions.tickColor = axisOptions.color; 2030 } 2031 2032 axisOptions = $.extend(true, {}, options.yaxis, axisOptions); 2033 options.yaxes[i] = axisOptions; 2034 2035 if (axisOptions.font) { 2036 axisOptions.font = $.extend({}, fontDefaults, axisOptions.font); 2037 if (!axisOptions.font.color) { 2038 axisOptions.font.color = axisOptions.color; 2039 } 2040 if (!axisOptions.font.lineHeight) { 2041 axisOptions.font.lineHeight = Math.round(axisOptions.font.size * 1.15); 2042 } 2043 } 2044 } 2045 2046 // backwards compatibility, to be removed in future 2047 if (options.xaxis.noTicks && options.xaxis.ticks == null) 2048 options.xaxis.ticks = options.xaxis.noTicks; 2049 if (options.yaxis.noTicks && options.yaxis.ticks == null) 2050 options.yaxis.ticks = options.yaxis.noTicks; 2051 if (options.x2axis) { 2052 options.xaxes[1] = $.extend(true, {}, options.xaxis, options.x2axis); 2053 options.xaxes[1].position = "top"; 2054 // Override the inherit to allow the axis to auto-scale 2055 if (options.x2axis.min == null) { 2056 options.xaxes[1].min = null; 2057 } 2058 if (options.x2axis.max == null) { 2059 options.xaxes[1].max = null; 2060 } 2061 } 2062 if (options.y2axis) { 2063 options.yaxes[1] = $.extend(true, {}, options.yaxis, options.y2axis); 2064 options.yaxes[1].position = "right"; 2065 // Override the inherit to allow the axis to auto-scale 2066 if (options.y2axis.min == null) { 2067 options.yaxes[1].min = null; 2068 } 2069 if (options.y2axis.max == null) { 2070 options.yaxes[1].max = null; 2071 } 2072 } 2073 if (options.grid.coloredAreas) 2074 options.grid.markings = options.grid.coloredAreas; 2075 if (options.grid.coloredAreasColor) 2076 options.grid.markingsColor = options.grid.coloredAreasColor; 2077 if (options.lines) 2078 $.extend(true, options.series.lines, options.lines); 2079 if (options.points) 2080 $.extend(true, options.series.points, options.points); 2081 if (options.bars) 2082 $.extend(true, options.series.bars, options.bars); 2083 if (options.shadowSize != null) 2084 options.series.shadowSize = options.shadowSize; 2085 if (options.highlightColor != null) 2086 options.series.highlightColor = options.highlightColor; 2087 2088 // save options on axes for future reference 2089 for (i = 0; i < options.xaxes.length; ++i) 2090 getOrCreateAxis(xaxes, i + 1).options = options.xaxes[i]; 2091 for (i = 0; i < options.yaxes.length; ++i) 2092 getOrCreateAxis(yaxes, i + 1).options = options.yaxes[i]; 2093 2094 // add hooks from options 2095 for (var n in hooks) 2096 if (options.hooks[n] && options.hooks[n].length) 2097 hooks[n] = hooks[n].concat(options.hooks[n]); 2098 2099 executeHooks(hooks.processOptions, [options]); 2100 } 2101 2102 function setData(d) { 2103 series = parseData(d); 2104 fillInSeriesOptions(); 2105 processData(); 2106 } 2107 2108 function parseData(d) { 2109 var res = []; 2110 for (var i = 0; i < d.length; ++i) { 2111 var s = $.extend(true, {}, options.series); 2112 2113 if (d[i].data != null) { 2114 s.data = d[i].data; // move the data instead of deep-copy 2115 delete d[i].data; 2116 2117 $.extend(true, s, d[i]); 2118 2119 d[i].data = s.data; 2120 } 2121 else 2122 s.data = d[i]; 2123 res.push(s); 2124 } 2125 2126 return res; 2127 } 2128 2129 function axisNumber(obj, coord) { 2130 var a = obj[coord + "axis"]; 2131 if (typeof a == "object") // if we got a real axis, extract number 2132 a = a.n; 2133 if (typeof a != "number") 2134 a = 1; // default to first axis 2135 return a; 2136 } 2137 2138 function allAxes() { 2139 // return flat array without annoying null entries 2140 return $.grep(xaxes.concat(yaxes), function (a) { return a; }); 2141 } 2142 2143 function canvasToAxisCoords(pos) { 2144 // return an object with x/y corresponding to all used axes 2145 var res = {}, i, axis; 2146 for (i = 0; i < xaxes.length; ++i) { 2147 axis = xaxes[i]; 2148 if (axis && axis.used) 2149 res["x" + axis.n] = axis.c2p(pos.left); 2150 } 2151 2152 for (i = 0; i < yaxes.length; ++i) { 2153 axis = yaxes[i]; 2154 if (axis && axis.used) 2155 res["y" + axis.n] = axis.c2p(pos.top); 2156 } 2157 2158 if (res.x1 !== undefined) 2159 res.x = res.x1; 2160 if (res.y1 !== undefined) 2161 res.y = res.y1; 2162 2163 return res; 2164 } 2165 2166 function axisToCanvasCoords(pos) { 2167 // get canvas coords from the first pair of x/y found in pos 2168 var res = {}, i, axis, key; 2169 2170 for (i = 0; i < xaxes.length; ++i) { 2171 axis = xaxes[i]; 2172 if (axis && axis.used) { 2173 key = "x" + axis.n; 2174 if (pos[key] == null && axis.n == 1) 2175 key = "x"; 2176 2177 if (pos[key] != null) { 2178 res.left = axis.p2c(pos[key]); 2179 break; 2180 } 2181 } 2182 } 2183 2184 for (i = 0; i < yaxes.length; ++i) { 2185 axis = yaxes[i]; 2186 if (axis && axis.used) { 2187 key = "y" + axis.n; 2188 if (pos[key] == null && axis.n == 1) 2189 key = "y"; 2190 2191 if (pos[key] != null) { 2192 res.top = axis.p2c(pos[key]); 2193 break; 2194 } 2195 } 2196 } 2197 2198 return res; 2199 } 2200 2201 function getOrCreateAxis(axes, number) { 2202 if (!axes[number - 1]) 2203 axes[number - 1] = { 2204 n: number, // save the number for future reference 2205 direction: axes == xaxes ? "x" : "y", 2206 options: $.extend(true, {}, axes == xaxes ? options.xaxis : options.yaxis) 2207 }; 2208 2209 return axes[number - 1]; 2210 } 2211 2212 function fillInSeriesOptions() { 2213 2214 var neededColors = series.length, maxIndex = -1, i; 2215 2216 // Subtract the number of series that already have fixed colors or 2217 // color indexes from the number that we still need to generate. 2218 2219 for (i = 0; i < series.length; ++i) { 2220 var sc = series[i].color; 2221 if (sc != null) { 2222 neededColors--; 2223 if (typeof sc == "number" && sc > maxIndex) { 2224 maxIndex = sc; 2225 } 2226 } 2227 } 2228 2229 // If any of the series have fixed color indexes, then we need to 2230 // generate at least as many colors as the highest index. 2231 2232 if (neededColors <= maxIndex) { 2233 neededColors = maxIndex + 1; 2234 } 2235 2236 // Generate all the colors, using first the option colors and then 2237 // variations on those colors once they're exhausted. 2238 2239 var c, colors = [], colorPool = options.colors, 2240 colorPoolSize = colorPool.length, variation = 0; 2241 2242 for (i = 0; i < neededColors; i++) { 2243 2244 c = $.color.parse(colorPool[i % colorPoolSize] || "#666"); 2245 2246 // Each time we exhaust the colors in the pool we adjust 2247 // a scaling factor used to produce more variations on 2248 // those colors. The factor alternates negative/positive 2249 // to produce lighter/darker colors. 2250 2251 // Reset the variation after every few cycles, or else 2252 // it will end up producing only white or black colors. 2253 2254 if (i % colorPoolSize == 0 && i) { 2255 if (variation >= 0) { 2256 if (variation < 0.5) { 2257 variation = -variation - 0.2; 2258 } else variation = 0; 2259 } else variation = -variation; 2260 } 2261 2262 colors[i] = c.scale('rgb', 1 + variation); 2263 } 2264 2265 // Finalize the series options, filling in their colors 2266 2267 var colori = 0, s; 2268 for (i = 0; i < series.length; ++i) { 2269 s = series[i]; 2270 2271 // assign colors 2272 if (s.color == null) { 2273 s.color = colors[colori].toString(); 2274 ++colori; 2275 } 2276 else if (typeof s.color == "number") 2277 s.color = colors[s.color].toString(); 2278 2279 // turn on lines automatically in case nothing is set 2280 if (s.lines.show == null) { 2281 var v, show = true; 2282 for (v in s) 2283 if (s[v] && s[v].show) { 2284 show = false; 2285 break; 2286 } 2287 if (show) 2288 s.lines.show = true; 2289 } 2290 2291 // If nothing was provided for lines.zero, default it to match 2292 // lines.fill, since areas by default should extend to zero. 2293 2294 if (s.lines.zero == null) { 2295 s.lines.zero = !!s.lines.fill; 2296 } 2297 2298 // setup axes 2299 s.xaxis = getOrCreateAxis(xaxes, axisNumber(s, "x")); 2300 s.yaxis = getOrCreateAxis(yaxes, axisNumber(s, "y")); 2301 } 2302 } 2303 2304 function processData() { 2305 var topSentry = Number.POSITIVE_INFINITY, 2306 bottomSentry = Number.NEGATIVE_INFINITY, 2307 fakeInfinity = Number.MAX_VALUE, 2308 i, j, k, m, length, 2309 s, points, ps, x, y, axis, val, f, p, 2310 data, format; 2311 2312 function updateAxis(axis, min, max) { 2313 if (min < axis.datamin && min != -fakeInfinity) 2314 axis.datamin = min; 2315 if (max > axis.datamax && max != fakeInfinity) 2316 axis.datamax = max; 2317 } 2318 2319 $.each(allAxes(), function (_, axis) { 2320 // init axis 2321 axis.datamin = topSentry; 2322 axis.datamax = bottomSentry; 2323 axis.used = false; 2324 }); 2325 2326 for (i = 0; i < series.length; ++i) { 2327 s = series[i]; 2328 s.datapoints = { points: [] }; 2329 2330 executeHooks(hooks.processRawData, [ s, s.data, s.datapoints ]); 2331 } 2332 2333 // first pass: clean and copy data 2334 for (i = 0; i < series.length; ++i) { 2335 s = series[i]; 2336 2337 data = s.data; 2338 format = s.datapoints.format; 2339 2340 if (!format) { 2341 format = []; 2342 // find out how to copy 2343 format.push({ x: true, number: true, required: true }); 2344 format.push({ y: true, number: true, required: true }); 2345 2346 if (s.bars.show || (s.lines.show && s.lines.fill)) { 2347 var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero)); 2348 format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale }); 2349 if (s.bars.horizontal) { 2350 delete format[format.length - 1].y; 2351 format[format.length - 1].x = true; 2352 } 2353 } 2354 2355 s.datapoints.format = format; 2356 } 2357 2358 if (s.datapoints.pointsize != null) 2359 continue; // already filled in 2360 2361 s.datapoints.pointsize = format.length; 2362 2363 ps = s.datapoints.pointsize; 2364 points = s.datapoints.points; 2365 2366 var insertSteps = s.lines.show && s.lines.steps; 2367 s.xaxis.used = s.yaxis.used = true; 2368 2369 for (j = k = 0; j < data.length; ++j, k += ps) { 2370 p = data[j]; 2371 2372 var nullify = p == null; 2373 if (!nullify) { 2374 for (m = 0; m < ps; ++m) { 2375 val = p[m]; 2376 f = format[m]; 2377 2378 if (f) { 2379 if (f.number && val != null) { 2380 val = +val; // convert to number 2381 if (isNaN(val)) 2382 val = null; 2383 else if (val == Infinity) 2384 val = fakeInfinity; 2385 else if (val == -Infinity) 2386 val = -fakeInfinity; 2387 } 2388 2389 if (val == null) { 2390 if (f.required) 2391 nullify = true; 2392 2393 if (f.defaultValue != null) 2394 val = f.defaultValue; 2395 } 2396 } 2397 2398 points[k + m] = val; 2399 } 2400 } 2401 2402 if (nullify) { 2403 for (m = 0; m < ps; ++m) { 2404 val = points[k + m]; 2405 if (val != null) { 2406 f = format[m]; 2407 // extract min/max info 2408 if (f.autoscale !== false) { 2409 if (f.x) { 2410 updateAxis(s.xaxis, val, val); 2411 } 2412 if (f.y) { 2413 updateAxis(s.yaxis, val, val); 2414 } 2415 } 2416 } 2417 points[k + m] = null; 2418 } 2419 } 2420 else { 2421 // a little bit of line specific stuff that 2422 // perhaps shouldn't be here, but lacking 2423 // better means... 2424 if (insertSteps && k > 0 2425 && points[k - ps] != null 2426 && points[k - ps] != points[k] 2427 && points[k - ps + 1] != points[k + 1]) { 2428 // copy the point to make room for a middle point 2429 for (m = 0; m < ps; ++m) 2430 points[k + ps + m] = points[k + m]; 2431 2432 // middle point has same y 2433 points[k + 1] = points[k - ps + 1]; 2434 2435 // we've added a point, better reflect that 2436 k += ps; 2437 } 2438 } 2439 } 2440 } 2441 2442 // give the hooks a chance to run 2443 for (i = 0; i < series.length; ++i) { 2444 s = series[i]; 2445 2446 executeHooks(hooks.processDatapoints, [ s, s.datapoints]); 2447 } 2448 2449 // second pass: find datamax/datamin for auto-scaling 2450 for (i = 0; i < series.length; ++i) { 2451 s = series[i]; 2452 points = s.datapoints.points; 2453 ps = s.datapoints.pointsize; 2454 format = s.datapoints.format; 2455 2456 var xmin = topSentry, ymin = topSentry, 2457 xmax = bottomSentry, ymax = bottomSentry; 2458 2459 for (j = 0; j < points.length; j += ps) { 2460 if (points[j] == null) 2461 continue; 2462 2463 for (m = 0; m < ps; ++m) { 2464 val = points[j + m]; 2465 f = format[m]; 2466 if (!f || f.autoscale === false || val == fakeInfinity || val == -fakeInfinity) 2467 continue; 2468 2469 if (f.x) { 2470 if (val < xmin) 2471 xmin = val; 2472 if (val > xmax) 2473 xmax = val; 2474 } 2475 if (f.y) { 2476 if (val < ymin) 2477 ymin = val; 2478 if (val > ymax) 2479 ymax = val; 2480 } 2481 } 2482 } 2483 2484 if (s.bars.show) { 2485 // make sure we got room for the bar on the dancing floor 2486 var delta; 2487 2488 switch (s.bars.align) { 2489 case "left": 2490 delta = 0; 2491 break; 2492 case "right": 2493 delta = -s.bars.barWidth; 2494 break; 2495 default: 2496 delta = -s.bars.barWidth / 2; 2497 } 2498 2499 if (s.bars.horizontal) { 2500 ymin += delta; 2501 ymax += delta + s.bars.barWidth; 2502 } 2503 else { 2504 xmin += delta; 2505 xmax += delta + s.bars.barWidth; 2506 } 2507 } 2508 2509 updateAxis(s.xaxis, xmin, xmax); 2510 updateAxis(s.yaxis, ymin, ymax); 2511 } 2512 2513 $.each(allAxes(), function (_, axis) { 2514 if (axis.datamin == topSentry) 2515 axis.datamin = null; 2516 if (axis.datamax == bottomSentry) 2517 axis.datamax = null; 2518 }); 2519 } 2520 2521 function setupCanvases() { 2522 2523 // Make sure the placeholder is clear of everything except canvases 2524 // from a previous plot in this container that we'll try to re-use. 2525 2526 placeholder.css("padding", 0) // padding messes up the positioning 2527 .children().filter(function(){ 2528 return !$(this).hasClass("flot-overlay") && !$(this).hasClass('flot-base'); 2529 }).remove(); 2530 2531 if (placeholder.css("position") == 'static') 2532 placeholder.css("position", "relative"); // for positioning labels and overlay 2533 2534 surface = new Canvas("flot-base", placeholder); 2535 overlay = new Canvas("flot-overlay", placeholder); // overlay canvas for interactive features 2536 2537 ctx = surface.context; 2538 octx = overlay.context; 2539 2540 // define which element we're listening for events on 2541 eventHolder = $(overlay.element).unbind(); 2542 2543 // If we're re-using a plot object, shut down the old one 2544 2545 var existing = placeholder.data("plot"); 2546 2547 if (existing) { 2548 existing.shutdown(); 2549 overlay.clear(); 2550 } 2551 2552 // save in case we get replotted 2553 placeholder.data("plot", plot); 2554 } 2555 2556 function bindEvents() { 2557 // bind events 2558 if (options.grid.hoverable) { 2559 eventHolder.mousemove(onMouseMove); 2560 2561 // Use bind, rather than .mouseleave, because we officially 2562 // still support jQuery 1.2.6, which doesn't define a shortcut 2563 // for mouseenter or mouseleave. This was a bug/oversight that 2564 // was fixed somewhere around 1.3.x. We can return to using 2565 // .mouseleave when we drop support for 1.2.6. 2566 2567 eventHolder.bind("mouseleave", onMouseLeave); 2568 } 2569 2570 if (options.grid.clickable) 2571 eventHolder.click(onClick); 2572 2573 executeHooks(hooks.bindEvents, [eventHolder]); 2574 } 2575 2576 function shutdown() { 2577 if (redrawTimeout) 2578 clearTimeout(redrawTimeout); 2579 2580 eventHolder.unbind("mousemove", onMouseMove); 2581 eventHolder.unbind("mouseleave", onMouseLeave); 2582 eventHolder.unbind("click", onClick); 2583 2584 executeHooks(hooks.shutdown, [eventHolder]); 2585 } 2586 2587 function setTransformationHelpers(axis) { 2588 // set helper functions on the axis, assumes plot area 2589 // has been computed already 2590 2591 function identity(x) { return x; } 2592 2593 var s, m, t = axis.options.transform || identity, 2594 it = axis.options.inverseTransform; 2595 2596 // precompute how much the axis is scaling a point 2597 // in canvas space 2598 if (axis.direction == "x") { 2599 s = axis.scale = plotWidth / Math.abs(t(axis.max) - t(axis.min)); 2600 m = Math.min(t(axis.max), t(axis.min)); 2601 } 2602 else { 2603 s = axis.scale = plotHeight / Math.abs(t(axis.max) - t(axis.min)); 2604 s = -s; 2605 m = Math.max(t(axis.max), t(axis.min)); 2606 } 2607 2608 // data point to canvas coordinate 2609 if (t == identity) // slight optimization 2610 axis.p2c = function (p) { return (p - m) * s; }; 2611 else 2612 axis.p2c = function (p) { return (t(p) - m) * s; }; 2613 // canvas coordinate to data point 2614 if (!it) 2615 axis.c2p = function (c) { return m + c / s; }; 2616 else 2617 axis.c2p = function (c) { return it(m + c / s); }; 2618 } 2619 2620 function measureTickLabels(axis) { 2621 2622 var opts = axis.options, 2623 ticks = axis.ticks || [], 2624 labelWidth = opts.labelWidth || 0, 2625 labelHeight = opts.labelHeight || 0, 2626 maxWidth = labelWidth || (axis.direction == "x" ? Math.floor(surface.width / (ticks.length || 1)) : null), 2627 legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis", 2628 layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles, 2629 font = opts.font || "flot-tick-label tickLabel"; 2630 2631 for (var i = 0; i < ticks.length; ++i) { 2632 2633 var t = ticks[i]; 2634 2635 if (!t.label) 2636 continue; 2637 2638 var info = surface.getTextInfo(layer, t.label, font, null, maxWidth); 2639 2640 labelWidth = Math.max(labelWidth, info.width); 2641 labelHeight = Math.max(labelHeight, info.height); 2642 } 2643 2644 axis.labelWidth = opts.labelWidth || labelWidth; 2645 axis.labelHeight = opts.labelHeight || labelHeight; 2646 } 2647 2648 function allocateAxisBoxFirstPhase(axis) { 2649 // find the bounding box of the axis by looking at label 2650 // widths/heights and ticks, make room by diminishing the 2651 // plotOffset; this first phase only looks at one 2652 // dimension per axis, the other dimension depends on the 2653 // other axes so will have to wait 2654 2655 var lw = axis.labelWidth, 2656 lh = axis.labelHeight, 2657 pos = axis.options.position, 2658 isXAxis = axis.direction === "x", 2659 tickLength = axis.options.tickLength, 2660 axisMargin = options.grid.axisMargin, 2661 padding = options.grid.labelMargin, 2662 innermost = true, 2663 outermost = true, 2664 first = true, 2665 found = false; 2666 2667 // Determine the axis's position in its direction and on its side 2668 2669 $.each(isXAxis ? xaxes : yaxes, function(i, a) { 2670 if (a && (a.show || a.reserveSpace)) { 2671 if (a === axis) { 2672 found = true; 2673 } else if (a.options.position === pos) { 2674 if (found) { 2675 outermost = false; 2676 } else { 2677 innermost = false; 2678 } 2679 } 2680 if (!found) { 2681 first = false; 2682 } 2683 } 2684 }); 2685 2686 // The outermost axis on each side has no margin 2687 2688 if (outermost) { 2689 axisMargin = 0; 2690 } 2691 2692 // The ticks for the first axis in each direction stretch across 2693 2694 if (tickLength == null) { 2695 tickLength = first ? "full" : 5; 2696 } 2697 2698 if (!isNaN(+tickLength)) 2699 padding += +tickLength; 2700 2701 if (isXAxis) { 2702 lh += padding; 2703 2704 if (pos == "bottom") { 2705 plotOffset.bottom += lh + axisMargin; 2706 axis.box = { top: surface.height - plotOffset.bottom, height: lh }; 2707 } 2708 else { 2709 axis.box = { top: plotOffset.top + axisMargin, height: lh }; 2710 plotOffset.top += lh + axisMargin; 2711 } 2712 } 2713 else { 2714 lw += padding; 2715 2716 if (pos == "left") { 2717 axis.box = { left: plotOffset.left + axisMargin, width: lw }; 2718 plotOffset.left += lw + axisMargin; 2719 } 2720 else { 2721 plotOffset.right += lw + axisMargin; 2722 axis.box = { left: surface.width - plotOffset.right, width: lw }; 2723 } 2724 } 2725 2726 // save for future reference 2727 axis.position = pos; 2728 axis.tickLength = tickLength; 2729 axis.box.padding = padding; 2730 axis.innermost = innermost; 2731 } 2732 2733 function allocateAxisBoxSecondPhase(axis) { 2734 // now that all axis boxes have been placed in one 2735 // dimension, we can set the remaining dimension coordinates 2736 if (axis.direction == "x") { 2737 axis.box.left = plotOffset.left - axis.labelWidth / 2; 2738 axis.box.width = surface.width - plotOffset.left - plotOffset.right + axis.labelWidth; 2739 } 2740 else { 2741 axis.box.top = plotOffset.top - axis.labelHeight / 2; 2742 axis.box.height = surface.height - plotOffset.bottom - plotOffset.top + axis.labelHeight; 2743 } 2744 } 2745 2746 function adjustLayoutForThingsStickingOut() { 2747 // possibly adjust plot offset to ensure everything stays 2748 // inside the canvas and isn't clipped off 2749 2750 var minMargin = options.grid.minBorderMargin, 2751 axis, i; 2752 2753 // check stuff from the plot (FIXME: this should just read 2754 // a value from the series, otherwise it's impossible to 2755 // customize) 2756 if (minMargin == null) { 2757 minMargin = 0; 2758 for (i = 0; i < series.length; ++i) 2759 minMargin = Math.max(minMargin, 2 * (series[i].points.radius + series[i].points.lineWidth/2)); 2760 } 2761 2762 var margins = { 2763 left: minMargin, 2764 right: minMargin, 2765 top: minMargin, 2766 bottom: minMargin 2767 }; 2768 2769 // check axis labels, note we don't check the actual 2770 // labels but instead use the overall width/height to not 2771 // jump as much around with replots 2772 $.each(allAxes(), function (_, axis) { 2773 if (axis.reserveSpace && axis.ticks && axis.ticks.length) { 2774 if (axis.direction === "x") { 2775 margins.left = Math.max(margins.left, axis.labelWidth / 2); 2776 margins.right = Math.max(margins.right, axis.labelWidth / 2); 2777 } else { 2778 margins.bottom = Math.max(margins.bottom, axis.labelHeight / 2); 2779 margins.top = Math.max(margins.top, axis.labelHeight / 2); 2780 } 2781 } 2782 }); 2783 2784 plotOffset.left = Math.ceil(Math.max(margins.left, plotOffset.left)); 2785 plotOffset.right = Math.ceil(Math.max(margins.right, plotOffset.right)); 2786 plotOffset.top = Math.ceil(Math.max(margins.top, plotOffset.top)); 2787 plotOffset.bottom = Math.ceil(Math.max(margins.bottom, plotOffset.bottom)); 2788 } 2789 2790 function setupGrid() { 2791 var i, axes = allAxes(), showGrid = options.grid.show; 2792 2793 // Initialize the plot's offset from the edge of the canvas 2794 2795 for (var a in plotOffset) { 2796 var margin = options.grid.margin || 0; 2797 plotOffset[a] = typeof margin == "number" ? margin : margin[a] || 0; 2798 } 2799 2800 executeHooks(hooks.processOffset, [plotOffset]); 2801 2802 // If the grid is visible, add its border width to the offset 2803 2804 for (var a in plotOffset) { 2805 if(typeof(options.grid.borderWidth) == "object") { 2806 plotOffset[a] += showGrid ? options.grid.borderWidth[a] : 0; 2807 } 2808 else { 2809 plotOffset[a] += showGrid ? options.grid.borderWidth : 0; 2810 } 2811 } 2812 2813 $.each(axes, function (_, axis) { 2814 var axisOpts = axis.options; 2815 axis.show = axisOpts.show == null ? axis.used : axisOpts.show; 2816 axis.reserveSpace = axisOpts.reserveSpace == null ? axis.show : axisOpts.reserveSpace; 2817 setRange(axis); 2818 }); 2819 2820 if (showGrid) { 2821 2822 var allocatedAxes = $.grep(axes, function (axis) { 2823 return axis.show || axis.reserveSpace; 2824 }); 2825 2826 $.each(allocatedAxes, function (_, axis) { 2827 // make the ticks 2828 setupTickGeneration(axis); 2829 setTicks(axis); 2830 snapRangeToTicks(axis, axis.ticks); 2831 // find labelWidth/Height for axis 2832 measureTickLabels(axis); 2833 }); 2834 2835 // with all dimensions calculated, we can compute the 2836 // axis bounding boxes, start from the outside 2837 // (reverse order) 2838 for (i = allocatedAxes.length - 1; i >= 0; --i) 2839 allocateAxisBoxFirstPhase(allocatedAxes[i]); 2840 2841 // make sure we've got enough space for things that 2842 // might stick out 2843 adjustLayoutForThingsStickingOut(); 2844 2845 $.each(allocatedAxes, function (_, axis) { 2846 allocateAxisBoxSecondPhase(axis); 2847 }); 2848 } 2849 2850 plotWidth = surface.width - plotOffset.left - plotOffset.right; 2851 plotHeight = surface.height - plotOffset.bottom - plotOffset.top; 2852 2853 // now we got the proper plot dimensions, we can compute the scaling 2854 $.each(axes, function (_, axis) { 2855 setTransformationHelpers(axis); 2856 }); 2857 2858 if (showGrid) { 2859 drawAxisLabels(); 2860 } 2861 2862 insertLegend(); 2863 } 2864 2865 function setRange(axis) { 2866 var opts = axis.options, 2867 min = +(opts.min != null ? opts.min : axis.datamin), 2868 max = +(opts.max != null ? opts.max : axis.datamax), 2869 delta = max - min; 2870 2871 if (delta == 0.0) { 2872 // degenerate case 2873 var widen = max == 0 ? 1 : 0.01; 2874 2875 if (opts.min == null) 2876 min -= widen; 2877 // always widen max if we couldn't widen min to ensure we 2878 // don't fall into min == max which doesn't work 2879 if (opts.max == null || opts.min != null) 2880 max += widen; 2881 } 2882 else { 2883 // consider autoscaling 2884 var margin = opts.autoscaleMargin; 2885 if (margin != null) { 2886 if (opts.min == null) { 2887 min -= delta * margin; 2888 // make sure we don't go below zero if all values 2889 // are positive 2890 if (min < 0 && axis.datamin != null && axis.datamin >= 0) 2891 min = 0; 2892 } 2893 if (opts.max == null) { 2894 max += delta * margin; 2895 if (max > 0 && axis.datamax != null && axis.datamax <= 0) 2896 max = 0; 2897 } 2898 } 2899 } 2900 axis.min = min; 2901 axis.max = max; 2902 } 2903 2904 function setupTickGeneration(axis) { 2905 var opts = axis.options; 2906 2907 // estimate number of ticks 2908 var noTicks; 2909 if (typeof opts.ticks == "number" && opts.ticks > 0) 2910 noTicks = opts.ticks; 2911 else 2912 // heuristic based on the model a*sqrt(x) fitted to 2913 // some data points that seemed reasonable 2914 noTicks = 0.3 * Math.sqrt(axis.direction == "x" ? surface.width : surface.height); 2915 2916 var delta = (axis.max - axis.min) / noTicks, 2917 dec = -Math.floor(Math.log(delta) / Math.LN10), 2918 maxDec = opts.tickDecimals; 2919 2920 if (maxDec != null && dec > maxDec) { 2921 dec = maxDec; 2922 } 2923 2924 var magn = Math.pow(10, -dec), 2925 norm = delta / magn, // norm is between 1.0 and 10.0 2926 size; 2927 2928 if (norm < 1.5) { 2929 size = 1; 2930 } else if (norm < 3) { 2931 size = 2; 2932 // special case for 2.5, requires an extra decimal 2933 if (norm > 2.25 && (maxDec == null || dec + 1 <= maxDec)) { 2934 size = 2.5; 2935 ++dec; 2936 } 2937 } else if (norm < 7.5) { 2938 size = 5; 2939 } else { 2940 size = 10; 2941 } 2942 2943 size *= magn; 2944 2945 if (opts.minTickSize != null && size < opts.minTickSize) { 2946 size = opts.minTickSize; 2947 } 2948 2949 axis.delta = delta; 2950 axis.tickDecimals = Math.max(0, maxDec != null ? maxDec : dec); 2951 axis.tickSize = opts.tickSize || size; 2952 2953 // Time mode was moved to a plug-in in 0.8, and since so many people use it 2954 // we'll add an especially friendly reminder to make sure they included it. 2955 2956 if (opts.mode == "time" && !axis.tickGenerator) { 2957 throw new Error("Time mode requires the flot.time plugin."); 2958 } 2959 2960 // Flot supports base-10 axes; any other mode else is handled by a plug-in, 2961 // like flot.time.js. 2962 2963 if (!axis.tickGenerator) { 2964 2965 axis.tickGenerator = function (axis) { 2966 2967 var ticks = [], 2968 start = floorInBase(axis.min, axis.tickSize), 2969 i = 0, 2970 v = Number.NaN, 2971 prev; 2972 2973 do { 2974 prev = v; 2975 v = start + i * axis.tickSize; 2976 ticks.push(v); 2977 ++i; 2978 } while (v < axis.max && v != prev); 2979 return ticks; 2980 }; 2981 2982 axis.tickFormatter = function (value, axis) { 2983 2984 var factor = axis.tickDecimals ? Math.pow(10, axis.tickDecimals) : 1; 2985 var formatted = "" + Math.round(value * factor) / factor; 2986 2987 // If tickDecimals was specified, ensure that we have exactly that 2988 // much precision; otherwise default to the value's own precision. 2989 2990 if (axis.tickDecimals != null) { 2991 var decimal = formatted.indexOf("."); 2992 var precision = decimal == -1 ? 0 : formatted.length - decimal - 1; 2993 if (precision < axis.tickDecimals) { 2994 return (precision ? formatted : formatted + ".") + ("" + factor).substr(1, axis.tickDecimals - precision); 2995 } 2996 } 2997 2998 return formatted; 2999 }; 3000 } 3001 3002 if ($.isFunction(opts.tickFormatter)) 3003 axis.tickFormatter = function (v, axis) { return "" + opts.tickFormatter(v, axis); }; 3004 3005 if (opts.alignTicksWithAxis != null) { 3006 var otherAxis = (axis.direction == "x" ? xaxes : yaxes)[opts.alignTicksWithAxis - 1]; 3007 if (otherAxis && otherAxis.used && otherAxis != axis) { 3008 // consider snapping min/max to outermost nice ticks 3009 var niceTicks = axis.tickGenerator(axis); 3010 if (niceTicks.length > 0) { 3011 if (opts.min == null) 3012 axis.min = Math.min(axis.min, niceTicks[0]); 3013 if (opts.max == null && niceTicks.length > 1) 3014 axis.max = Math.max(axis.max, niceTicks[niceTicks.length - 1]); 3015 } 3016 3017 axis.tickGenerator = function (axis) { 3018 // copy ticks, scaled to this axis 3019 var ticks = [], v, i; 3020 for (i = 0; i < otherAxis.ticks.length; ++i) { 3021 v = (otherAxis.ticks[i].v - otherAxis.min) / (otherAxis.max - otherAxis.min); 3022 v = axis.min + v * (axis.max - axis.min); 3023 ticks.push(v); 3024 } 3025 return ticks; 3026 }; 3027 3028 // we might need an extra decimal since forced 3029 // ticks don't necessarily fit naturally 3030 if (!axis.mode && opts.tickDecimals == null) { 3031 var extraDec = Math.max(0, -Math.floor(Math.log(axis.delta) / Math.LN10) + 1), 3032 ts = axis.tickGenerator(axis); 3033 3034 // only proceed if the tick interval rounded 3035 // with an extra decimal doesn't give us a 3036 // zero at end 3037 if (!(ts.length > 1 && /\..*0$/.test((ts[1] - ts[0]).toFixed(extraDec)))) 3038 axis.tickDecimals = extraDec; 3039 } 3040 } 3041 } 3042 } 3043 3044 function setTicks(axis) { 3045 var oticks = axis.options.ticks, ticks = []; 3046 if (oticks == null || (typeof oticks == "number" && oticks > 0)) 3047 ticks = axis.tickGenerator(axis); 3048 else if (oticks) { 3049 if ($.isFunction(oticks)) 3050 // generate the ticks 3051 ticks = oticks(axis); 3052 else 3053 ticks = oticks; 3054 } 3055 3056 // clean up/labelify the supplied ticks, copy them over 3057 var i, v; 3058 axis.ticks = []; 3059 for (i = 0; i < ticks.length; ++i) { 3060 var label = null; 3061 var t = ticks[i]; 3062 if (typeof t == "object") { 3063 v = +t[0]; 3064 if (t.length > 1) 3065 label = t[1]; 3066 } 3067 else 3068 v = +t; 3069 if (label == null) 3070 label = axis.tickFormatter(v, axis); 3071 if (!isNaN(v)) 3072 axis.ticks.push({ v: v, label: label }); 3073 } 3074 } 3075 3076 function snapRangeToTicks(axis, ticks) { 3077 if (axis.options.autoscaleMargin && ticks.length > 0) { 3078 // snap to ticks 3079 if (axis.options.min == null) 3080 axis.min = Math.min(axis.min, ticks[0].v); 3081 if (axis.options.max == null && ticks.length > 1) 3082 axis.max = Math.max(axis.max, ticks[ticks.length - 1].v); 3083 } 3084 } 3085 3086 function draw() { 3087 3088 surface.clear(); 3089 3090 executeHooks(hooks.drawBackground, [ctx]); 3091 3092 var grid = options.grid; 3093 3094 // draw background, if any 3095 if (grid.show && grid.backgroundColor) 3096 drawBackground(); 3097 3098 if (grid.show && !grid.aboveData) { 3099 drawGrid(); 3100 } 3101 3102 for (var i = 0; i < series.length; ++i) { 3103 executeHooks(hooks.drawSeries, [ctx, series[i]]); 3104 drawSeries(series[i]); 3105 } 3106 3107 executeHooks(hooks.draw, [ctx]); 3108 3109 if (grid.show && grid.aboveData) { 3110 drawGrid(); 3111 } 3112 3113 surface.render(); 3114 3115 // A draw implies that either the axes or data have changed, so we 3116 // should probably update the overlay highlights as well. 3117 3118 triggerRedrawOverlay(); 3119 } 3120 3121 function extractRange(ranges, coord) { 3122 var axis, from, to, key, axes = allAxes(); 3123 3124 for (var i = 0; i < axes.length; ++i) { 3125 axis = axes[i]; 3126 if (axis.direction == coord) { 3127 key = coord + axis.n + "axis"; 3128 if (!ranges[key] && axis.n == 1) 3129 key = coord + "axis"; // support x1axis as xaxis 3130 if (ranges[key]) { 3131 from = ranges[key].from; 3132 to = ranges[key].to; 3133 break; 3134 } 3135 } 3136 } 3137 3138 // backwards-compat stuff - to be removed in future 3139 if (!ranges[key]) { 3140 axis = coord == "x" ? xaxes[0] : yaxes[0]; 3141 from = ranges[coord + "1"]; 3142 to = ranges[coord + "2"]; 3143 } 3144 3145 // auto-reverse as an added bonus 3146 if (from != null && to != null && from > to) { 3147 var tmp = from; 3148 from = to; 3149 to = tmp; 3150 } 3151 3152 return { from: from, to: to, axis: axis }; 3153 } 3154 3155 function drawBackground() { 3156 ctx.save(); 3157 ctx.translate(plotOffset.left, plotOffset.top); 3158 3159 ctx.fillStyle = getColorOrGradient(options.grid.backgroundColor, plotHeight, 0, "rgba(255, 255, 255, 0)"); 3160 ctx.fillRect(0, 0, plotWidth, plotHeight); 3161 ctx.restore(); 3162 } 3163 3164 function drawGrid() { 3165 var i, axes, bw, bc; 3166 3167 ctx.save(); 3168 ctx.translate(plotOffset.left, plotOffset.top); 3169 3170 // draw markings 3171 var markings = options.grid.markings; 3172 if (markings) { 3173 if ($.isFunction(markings)) { 3174 axes = plot.getAxes(); 3175 // xmin etc. is backwards compatibility, to be 3176 // removed in the future 3177 axes.xmin = axes.xaxis.min; 3178 axes.xmax = axes.xaxis.max; 3179 axes.ymin = axes.yaxis.min; 3180 axes.ymax = axes.yaxis.max; 3181 3182 markings = markings(axes); 3183 } 3184 3185 for (i = 0; i < markings.length; ++i) { 3186 var m = markings[i], 3187 xrange = extractRange(m, "x"), 3188 yrange = extractRange(m, "y"); 3189 3190 // fill in missing 3191 if (xrange.from == null) 3192 xrange.from = xrange.axis.min; 3193 if (xrange.to == null) 3194 xrange.to = xrange.axis.max; 3195 if (yrange.from == null) 3196 yrange.from = yrange.axis.min; 3197 if (yrange.to == null) 3198 yrange.to = yrange.axis.max; 3199 3200 // clip 3201 if (xrange.to < xrange.axis.min || xrange.from > xrange.axis.max || 3202 yrange.to < yrange.axis.min || yrange.from > yrange.axis.max) 3203 continue; 3204 3205 xrange.from = Math.max(xrange.from, xrange.axis.min); 3206 xrange.to = Math.min(xrange.to, xrange.axis.max); 3207 yrange.from = Math.max(yrange.from, yrange.axis.min); 3208 yrange.to = Math.min(yrange.to, yrange.axis.max); 3209 3210 var xequal = xrange.from === xrange.to, 3211 yequal = yrange.from === yrange.to; 3212 3213 if (xequal && yequal) { 3214 continue; 3215 } 3216 3217 // then draw 3218 xrange.from = Math.floor(xrange.axis.p2c(xrange.from)); 3219 xrange.to = Math.floor(xrange.axis.p2c(xrange.to)); 3220 yrange.from = Math.floor(yrange.axis.p2c(yrange.from)); 3221 yrange.to = Math.floor(yrange.axis.p2c(yrange.to)); 3222 3223 if (xequal || yequal) { 3224 var lineWidth = m.lineWidth || options.grid.markingsLineWidth, 3225 subPixel = lineWidth % 2 ? 0.5 : 0; 3226 ctx.beginPath(); 3227 ctx.strokeStyle = m.color || options.grid.markingsColor; 3228 ctx.lineWidth = lineWidth; 3229 if (xequal) { 3230 ctx.moveTo(xrange.to + subPixel, yrange.from); 3231 ctx.lineTo(xrange.to + subPixel, yrange.to); 3232 } else { 3233 ctx.moveTo(xrange.from, yrange.to + subPixel); 3234 ctx.lineTo(xrange.to, yrange.to + subPixel); 3235 } 3236 ctx.stroke(); 3237 } else { 3238 ctx.fillStyle = m.color || options.grid.markingsColor; 3239 ctx.fillRect(xrange.from, yrange.to, 3240 xrange.to - xrange.from, 3241 yrange.from - yrange.to); 3242 } 3243 } 3244 } 3245 3246 // draw the ticks 3247 axes = allAxes(); 3248 bw = options.grid.borderWidth; 3249 3250 for (var j = 0; j < axes.length; ++j) { 3251 var axis = axes[j], box = axis.box, 3252 t = axis.tickLength, x, y, xoff, yoff; 3253 if (!axis.show || axis.ticks.length == 0) 3254 continue; 3255 3256 ctx.lineWidth = 1; 3257 3258 // find the edges 3259 if (axis.direction == "x") { 3260 x = 0; 3261 if (t == "full") 3262 y = (axis.position == "top" ? 0 : plotHeight); 3263 else 3264 y = box.top - plotOffset.top + (axis.position == "top" ? box.height : 0); 3265 } 3266 else { 3267 y = 0; 3268 if (t == "full") 3269 x = (axis.position == "left" ? 0 : plotWidth); 3270 else 3271 x = box.left - plotOffset.left + (axis.position == "left" ? box.width : 0); 3272 } 3273 3274 // draw tick bar 3275 if (!axis.innermost) { 3276 ctx.strokeStyle = axis.options.color; 3277 ctx.beginPath(); 3278 xoff = yoff = 0; 3279 if (axis.direction == "x") 3280 xoff = plotWidth + 1; 3281 else 3282 yoff = plotHeight + 1; 3283 3284 if (ctx.lineWidth == 1) { 3285 if (axis.direction == "x") { 3286 y = Math.floor(y) + 0.5; 3287 } else { 3288 x = Math.floor(x) + 0.5; 3289 } 3290 } 3291 3292 ctx.moveTo(x, y); 3293 ctx.lineTo(x + xoff, y + yoff); 3294 ctx.stroke(); 3295 } 3296 3297 // draw ticks 3298 3299 ctx.strokeStyle = axis.options.tickColor; 3300 3301 ctx.beginPath(); 3302 for (i = 0; i < axis.ticks.length; ++i) { 3303 var v = axis.ticks[i].v; 3304 3305 xoff = yoff = 0; 3306 3307 if (isNaN(v) || v < axis.min || v > axis.max 3308 // skip those lying on the axes if we got a border 3309 || (t == "full" 3310 && ((typeof bw == "object" && bw[axis.position] > 0) || bw > 0) 3311 && (v == axis.min || v == axis.max))) 3312 continue; 3313 3314 if (axis.direction == "x") { 3315 x = axis.p2c(v); 3316 yoff = t == "full" ? -plotHeight : t; 3317 3318 if (axis.position == "top") 3319 yoff = -yoff; 3320 } 3321 else { 3322 y = axis.p2c(v); 3323 xoff = t == "full" ? -plotWidth : t; 3324 3325 if (axis.position == "left") 3326 xoff = -xoff; 3327 } 3328 3329 if (ctx.lineWidth == 1) { 3330 if (axis.direction == "x") 3331 x = Math.floor(x) + 0.5; 3332 else 3333 y = Math.floor(y) + 0.5; 3334 } 3335 3336 ctx.moveTo(x, y); 3337 ctx.lineTo(x + xoff, y + yoff); 3338 } 3339 3340 ctx.stroke(); 3341 } 3342 3343 3344 // draw border 3345 if (bw) { 3346 // If either borderWidth or borderColor is an object, then draw the border 3347 // line by line instead of as one rectangle 3348 bc = options.grid.borderColor; 3349 if(typeof bw == "object" || typeof bc == "object") { 3350 if (typeof bw !== "object") { 3351 bw = {top: bw, right: bw, bottom: bw, left: bw}; 3352 } 3353 if (typeof bc !== "object") { 3354 bc = {top: bc, right: bc, bottom: bc, left: bc}; 3355 } 3356 3357 if (bw.top > 0) { 3358 ctx.strokeStyle = bc.top; 3359 ctx.lineWidth = bw.top; 3360 ctx.beginPath(); 3361 ctx.moveTo(0 - bw.left, 0 - bw.top/2); 3362 ctx.lineTo(plotWidth, 0 - bw.top/2); 3363 ctx.stroke(); 3364 } 3365 3366 if (bw.right > 0) { 3367 ctx.strokeStyle = bc.right; 3368 ctx.lineWidth = bw.right; 3369 ctx.beginPath(); 3370 ctx.moveTo(plotWidth + bw.right / 2, 0 - bw.top); 3371 ctx.lineTo(plotWidth + bw.right / 2, plotHeight); 3372 ctx.stroke(); 3373 } 3374 3375 if (bw.bottom > 0) { 3376 ctx.strokeStyle = bc.bottom; 3377 ctx.lineWidth = bw.bottom; 3378 ctx.beginPath(); 3379 ctx.moveTo(plotWidth + bw.right, plotHeight + bw.bottom / 2); 3380 ctx.lineTo(0, plotHeight + bw.bottom / 2); 3381 ctx.stroke(); 3382 } 3383 3384 if (bw.left > 0) { 3385 ctx.strokeStyle = bc.left; 3386 ctx.lineWidth = bw.left; 3387 ctx.beginPath(); 3388 ctx.moveTo(0 - bw.left/2, plotHeight + bw.bottom); 3389 ctx.lineTo(0- bw.left/2, 0); 3390 ctx.stroke(); 3391 } 3392 } 3393 else { 3394 ctx.lineWidth = bw; 3395 ctx.strokeStyle = options.grid.borderColor; 3396 ctx.strokeRect(-bw/2, -bw/2, plotWidth + bw, plotHeight + bw); 3397 } 3398 } 3399 3400 ctx.restore(); 3401 } 3402 3403 function drawAxisLabels() { 3404 3405 $.each(allAxes(), function (_, axis) { 3406 var box = axis.box, 3407 legacyStyles = axis.direction + "Axis " + axis.direction + axis.n + "Axis", 3408 layer = "flot-" + axis.direction + "-axis flot-" + axis.direction + axis.n + "-axis " + legacyStyles, 3409 font = axis.options.font || "flot-tick-label tickLabel", 3410 tick, x, y, halign, valign; 3411 3412 // Remove text before checking for axis.show and ticks.length; 3413 // otherwise plugins, like flot-tickrotor, that draw their own 3414 // tick labels will end up with both theirs and the defaults. 3415 3416 surface.removeText(layer); 3417 3418 if (!axis.show || axis.ticks.length == 0) 3419 return; 3420 3421 for (var i = 0; i < axis.ticks.length; ++i) { 3422 3423 tick = axis.ticks[i]; 3424 if (!tick.label || tick.v < axis.min || tick.v > axis.max) 3425 continue; 3426 3427 if (axis.direction == "x") { 3428 halign = "center"; 3429 x = plotOffset.left + axis.p2c(tick.v); 3430 if (axis.position == "bottom") { 3431 y = box.top + box.padding; 3432 } else { 3433 y = box.top + box.height - box.padding; 3434 valign = "bottom"; 3435 } 3436 } else { 3437 valign = "middle"; 3438 y = plotOffset.top + axis.p2c(tick.v); 3439 if (axis.position == "left") { 3440 x = box.left + box.width - box.padding; 3441 halign = "right"; 3442 } else { 3443 x = box.left + box.padding; 3444 } 3445 } 3446 3447 surface.addText(layer, x, y, tick.label, font, null, null, halign, valign); 3448 } 3449 }); 3450 } 3451 3452 function drawSeries(series) { 3453 if (series.lines.show) 3454 drawSeriesLines(series); 3455 if (series.bars.show) 3456 drawSeriesBars(series); 3457 if (series.points.show) 3458 drawSeriesPoints(series); 3459 } 3460 3461 function drawSeriesLines(series) { 3462 function plotLine(datapoints, xoffset, yoffset, axisx, axisy) { 3463 var points = datapoints.points, 3464 ps = datapoints.pointsize, 3465 prevx = null, prevy = null; 3466 3467 ctx.beginPath(); 3468 for (var i = ps; i < points.length; i += ps) { 3469 var x1 = points[i - ps], y1 = points[i - ps + 1], 3470 x2 = points[i], y2 = points[i + 1]; 3471 3472 if (x1 == null || x2 == null) 3473 continue; 3474 3475 // clip with ymin 3476 if (y1 <= y2 && y1 < axisy.min) { 3477 if (y2 < axisy.min) 3478 continue; // line segment is outside 3479 // compute new intersection point 3480 x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; 3481 y1 = axisy.min; 3482 } 3483 else if (y2 <= y1 && y2 < axisy.min) { 3484 if (y1 < axisy.min) 3485 continue; 3486 x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; 3487 y2 = axisy.min; 3488 } 3489 3490 // clip with ymax 3491 if (y1 >= y2 && y1 > axisy.max) { 3492 if (y2 > axisy.max) 3493 continue; 3494 x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; 3495 y1 = axisy.max; 3496 } 3497 else if (y2 >= y1 && y2 > axisy.max) { 3498 if (y1 > axisy.max) 3499 continue; 3500 x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; 3501 y2 = axisy.max; 3502 } 3503 3504 // clip with xmin 3505 if (x1 <= x2 && x1 < axisx.min) { 3506 if (x2 < axisx.min) 3507 continue; 3508 y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; 3509 x1 = axisx.min; 3510 } 3511 else if (x2 <= x1 && x2 < axisx.min) { 3512 if (x1 < axisx.min) 3513 continue; 3514 y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; 3515 x2 = axisx.min; 3516 } 3517 3518 // clip with xmax 3519 if (x1 >= x2 && x1 > axisx.max) { 3520 if (x2 > axisx.max) 3521 continue; 3522 y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; 3523 x1 = axisx.max; 3524 } 3525 else if (x2 >= x1 && x2 > axisx.max) { 3526 if (x1 > axisx.max) 3527 continue; 3528 y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; 3529 x2 = axisx.max; 3530 } 3531 3532 if (x1 != prevx || y1 != prevy) 3533 ctx.moveTo(axisx.p2c(x1) + xoffset, axisy.p2c(y1) + yoffset); 3534 3535 prevx = x2; 3536 prevy = y2; 3537 ctx.lineTo(axisx.p2c(x2) + xoffset, axisy.p2c(y2) + yoffset); 3538 } 3539 ctx.stroke(); 3540 } 3541 3542 function plotLineArea(datapoints, axisx, axisy) { 3543 var points = datapoints.points, 3544 ps = datapoints.pointsize, 3545 bottom = Math.min(Math.max(0, axisy.min), axisy.max), 3546 i = 0, top, areaOpen = false, 3547 ypos = 1, segmentStart = 0, segmentEnd = 0; 3548 3549 // we process each segment in two turns, first forward 3550 // direction to sketch out top, then once we hit the 3551 // end we go backwards to sketch the bottom 3552 while (true) { 3553 if (ps > 0 && i > points.length + ps) 3554 break; 3555 3556 i += ps; // ps is negative if going backwards 3557 3558 var x1 = points[i - ps], 3559 y1 = points[i - ps + ypos], 3560 x2 = points[i], y2 = points[i + ypos]; 3561 3562 if (areaOpen) { 3563 if (ps > 0 && x1 != null && x2 == null) { 3564 // at turning point 3565 segmentEnd = i; 3566 ps = -ps; 3567 ypos = 2; 3568 continue; 3569 } 3570 3571 if (ps < 0 && i == segmentStart + ps) { 3572 // done with the reverse sweep 3573 ctx.fill(); 3574 areaOpen = false; 3575 ps = -ps; 3576 ypos = 1; 3577 i = segmentStart = segmentEnd + ps; 3578 continue; 3579 } 3580 } 3581 3582 if (x1 == null || x2 == null) 3583 continue; 3584 3585 // clip x values 3586 3587 // clip with xmin 3588 if (x1 <= x2 && x1 < axisx.min) { 3589 if (x2 < axisx.min) 3590 continue; 3591 y1 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; 3592 x1 = axisx.min; 3593 } 3594 else if (x2 <= x1 && x2 < axisx.min) { 3595 if (x1 < axisx.min) 3596 continue; 3597 y2 = (axisx.min - x1) / (x2 - x1) * (y2 - y1) + y1; 3598 x2 = axisx.min; 3599 } 3600 3601 // clip with xmax 3602 if (x1 >= x2 && x1 > axisx.max) { 3603 if (x2 > axisx.max) 3604 continue; 3605 y1 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; 3606 x1 = axisx.max; 3607 } 3608 else if (x2 >= x1 && x2 > axisx.max) { 3609 if (x1 > axisx.max) 3610 continue; 3611 y2 = (axisx.max - x1) / (x2 - x1) * (y2 - y1) + y1; 3612 x2 = axisx.max; 3613 } 3614 3615 if (!areaOpen) { 3616 // open area 3617 ctx.beginPath(); 3618 ctx.moveTo(axisx.p2c(x1), axisy.p2c(bottom)); 3619 areaOpen = true; 3620 } 3621 3622 // now first check the case where both is outside 3623 if (y1 >= axisy.max && y2 >= axisy.max) { 3624 ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.max)); 3625 ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.max)); 3626 continue; 3627 } 3628 else if (y1 <= axisy.min && y2 <= axisy.min) { 3629 ctx.lineTo(axisx.p2c(x1), axisy.p2c(axisy.min)); 3630 ctx.lineTo(axisx.p2c(x2), axisy.p2c(axisy.min)); 3631 continue; 3632 } 3633 3634 // else it's a bit more complicated, there might 3635 // be a flat maxed out rectangle first, then a 3636 // triangular cutout or reverse; to find these 3637 // keep track of the current x values 3638 var x1old = x1, x2old = x2; 3639 3640 // clip the y values, without shortcutting, we 3641 // go through all cases in turn 3642 3643 // clip with ymin 3644 if (y1 <= y2 && y1 < axisy.min && y2 >= axisy.min) { 3645 x1 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; 3646 y1 = axisy.min; 3647 } 3648 else if (y2 <= y1 && y2 < axisy.min && y1 >= axisy.min) { 3649 x2 = (axisy.min - y1) / (y2 - y1) * (x2 - x1) + x1; 3650 y2 = axisy.min; 3651 } 3652 3653 // clip with ymax 3654 if (y1 >= y2 && y1 > axisy.max && y2 <= axisy.max) { 3655 x1 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; 3656 y1 = axisy.max; 3657 } 3658 else if (y2 >= y1 && y2 > axisy.max && y1 <= axisy.max) { 3659 x2 = (axisy.max - y1) / (y2 - y1) * (x2 - x1) + x1; 3660 y2 = axisy.max; 3661 } 3662 3663 // if the x value was changed we got a rectangle 3664 // to fill 3665 if (x1 != x1old) { 3666 ctx.lineTo(axisx.p2c(x1old), axisy.p2c(y1)); 3667 // it goes to (x1, y1), but we fill that below 3668 } 3669 3670 // fill triangular section, this sometimes result 3671 // in redundant points if (x1, y1) hasn't changed 3672 // from previous line to, but we just ignore that 3673 ctx.lineTo(axisx.p2c(x1), axisy.p2c(y1)); 3674 ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2)); 3675 3676 // fill the other rectangle if it's there 3677 if (x2 != x2old) { 3678 ctx.lineTo(axisx.p2c(x2), axisy.p2c(y2)); 3679 ctx.lineTo(axisx.p2c(x2old), axisy.p2c(y2)); 3680 } 3681 } 3682 } 3683 3684 ctx.save(); 3685 ctx.translate(plotOffset.left, plotOffset.top); 3686 ctx.lineJoin = "round"; 3687 3688 var lw = series.lines.lineWidth, 3689 sw = series.shadowSize; 3690 // FIXME: consider another form of shadow when filling is turned on 3691 if (lw > 0 && sw > 0) { 3692 // draw shadow as a thick and thin line with transparency 3693 ctx.lineWidth = sw; 3694 ctx.strokeStyle = "rgba(0,0,0,0.1)"; 3695 // position shadow at angle from the mid of line 3696 var angle = Math.PI/18; 3697 plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/2), Math.cos(angle) * (lw/2 + sw/2), series.xaxis, series.yaxis); 3698 ctx.lineWidth = sw/2; 3699 plotLine(series.datapoints, Math.sin(angle) * (lw/2 + sw/4), Math.cos(angle) * (lw/2 + sw/4), series.xaxis, series.yaxis); 3700 } 3701 3702 ctx.lineWidth = lw; 3703 ctx.strokeStyle = series.color; 3704 var fillStyle = getFillStyle(series.lines, series.color, 0, plotHeight); 3705 if (fillStyle) { 3706 ctx.fillStyle = fillStyle; 3707 plotLineArea(series.datapoints, series.xaxis, series.yaxis); 3708 } 3709 3710 if (lw > 0) 3711 plotLine(series.datapoints, 0, 0, series.xaxis, series.yaxis); 3712 ctx.restore(); 3713 } 3714 3715 function drawSeriesPoints(series) { 3716 function plotPoints(datapoints, radius, fillStyle, offset, shadow, axisx, axisy, symbol) { 3717 var points = datapoints.points, ps = datapoints.pointsize; 3718 3719 for (var i = 0; i < points.length; i += ps) { 3720 var x = points[i], y = points[i + 1]; 3721 if (x == null || x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) 3722 continue; 3723 3724 ctx.beginPath(); 3725 x = axisx.p2c(x); 3726 y = axisy.p2c(y) + offset; 3727 if (symbol == "circle") 3728 ctx.arc(x, y, radius, 0, shadow ? Math.PI : Math.PI * 2, false); 3729 else 3730 symbol(ctx, x, y, radius, shadow); 3731 ctx.closePath(); 3732 3733 if (fillStyle) { 3734 ctx.fillStyle = fillStyle; 3735 ctx.fill(); 3736 } 3737 ctx.stroke(); 3738 } 3739 } 3740 3741 ctx.save(); 3742 ctx.translate(plotOffset.left, plotOffset.top); 3743 3744 var lw = series.points.lineWidth, 3745 sw = series.shadowSize, 3746 radius = series.points.radius, 3747 symbol = series.points.symbol; 3748 3749 // If the user sets the line width to 0, we change it to a very 3750 // small value. A line width of 0 seems to force the default of 1. 3751 // Doing the conditional here allows the shadow setting to still be 3752 // optional even with a lineWidth of 0. 3753 3754 if( lw == 0 ) 3755 lw = 0.0001; 3756 3757 if (lw > 0 && sw > 0) { 3758 // draw shadow in two steps 3759 var w = sw / 2; 3760 ctx.lineWidth = w; 3761 ctx.strokeStyle = "rgba(0,0,0,0.1)"; 3762 plotPoints(series.datapoints, radius, null, w + w/2, true, 3763 series.xaxis, series.yaxis, symbol); 3764 3765 ctx.strokeStyle = "rgba(0,0,0,0.2)"; 3766 plotPoints(series.datapoints, radius, null, w/2, true, 3767 series.xaxis, series.yaxis, symbol); 3768 } 3769 3770 ctx.lineWidth = lw; 3771 ctx.strokeStyle = series.color; 3772 plotPoints(series.datapoints, radius, 3773 getFillStyle(series.points, series.color), 0, false, 3774 series.xaxis, series.yaxis, symbol); 3775 ctx.restore(); 3776 } 3777 3778 function drawBar(x, y, b, barLeft, barRight, fillStyleCallback, axisx, axisy, c, horizontal, lineWidth) { 3779 var left, right, bottom, top, 3780 drawLeft, drawRight, drawTop, drawBottom, 3781 tmp; 3782 3783 // in horizontal mode, we start the bar from the left 3784 // instead of from the bottom so it appears to be 3785 // horizontal rather than vertical 3786 if (horizontal) { 3787 drawBottom = drawRight = drawTop = true; 3788 drawLeft = false; 3789 left = b; 3790 right = x; 3791 top = y + barLeft; 3792 bottom = y + barRight; 3793 3794 // account for negative bars 3795 if (right < left) { 3796 tmp = right; 3797 right = left; 3798 left = tmp; 3799 drawLeft = true; 3800 drawRight = false; 3801 } 3802 } 3803 else { 3804 drawLeft = drawRight = drawTop = true; 3805 drawBottom = false; 3806 left = x + barLeft; 3807 right = x + barRight; 3808 bottom = b; 3809 top = y; 3810 3811 // account for negative bars 3812 if (top < bottom) { 3813 tmp = top; 3814 top = bottom; 3815 bottom = tmp; 3816 drawBottom = true; 3817 drawTop = false; 3818 } 3819 } 3820 3821 // clip 3822 if (right < axisx.min || left > axisx.max || 3823 top < axisy.min || bottom > axisy.max) 3824 return; 3825 3826 if (left < axisx.min) { 3827 left = axisx.min; 3828 drawLeft = false; 3829 } 3830 3831 if (right > axisx.max) { 3832 right = axisx.max; 3833 drawRight = false; 3834 } 3835 3836 if (bottom < axisy.min) { 3837 bottom = axisy.min; 3838 drawBottom = false; 3839 } 3840 3841 if (top > axisy.max) { 3842 top = axisy.max; 3843 drawTop = false; 3844 } 3845 3846 left = axisx.p2c(left); 3847 bottom = axisy.p2c(bottom); 3848 right = axisx.p2c(right); 3849 top = axisy.p2c(top); 3850 3851 // fill the bar 3852 if (fillStyleCallback) { 3853 c.fillStyle = fillStyleCallback(bottom, top); 3854 c.fillRect(left, top, right - left, bottom - top) 3855 } 3856 3857 // draw outline 3858 if (lineWidth > 0 && (drawLeft || drawRight || drawTop || drawBottom)) { 3859 c.beginPath(); 3860 3861 // FIXME: inline moveTo is buggy with excanvas 3862 c.moveTo(left, bottom); 3863 if (drawLeft) 3864 c.lineTo(left, top); 3865 else 3866 c.moveTo(left, top); 3867 if (drawTop) 3868 c.lineTo(right, top); 3869 else 3870 c.moveTo(right, top); 3871 if (drawRight) 3872 c.lineTo(right, bottom); 3873 else 3874 c.moveTo(right, bottom); 3875 if (drawBottom) 3876 c.lineTo(left, bottom); 3877 else 3878 c.moveTo(left, bottom); 3879 c.stroke(); 3880 } 3881 } 3882 3883 function drawSeriesBars(series) { 3884 function plotBars(datapoints, barLeft, barRight, fillStyleCallback, axisx, axisy) { 3885 var points = datapoints.points, ps = datapoints.pointsize; 3886 3887 for (var i = 0; i < points.length; i += ps) { 3888 if (points[i] == null) 3889 continue; 3890 drawBar(points[i], points[i + 1], points[i + 2], barLeft, barRight, fillStyleCallback, axisx, axisy, ctx, series.bars.horizontal, series.bars.lineWidth); 3891 } 3892 } 3893 3894 ctx.save(); 3895 ctx.translate(plotOffset.left, plotOffset.top); 3896 3897 // FIXME: figure out a way to add shadows (for instance along the right edge) 3898 ctx.lineWidth = series.bars.lineWidth; 3899 ctx.strokeStyle = series.color; 3900 3901 var barLeft; 3902 3903 switch (series.bars.align) { 3904 case "left": 3905 barLeft = 0; 3906 break; 3907 case "right": 3908 barLeft = -series.bars.barWidth; 3909 break; 3910 default: 3911 barLeft = -series.bars.barWidth / 2; 3912 } 3913 3914 var fillStyleCallback = series.bars.fill ? function (bottom, top) { return getFillStyle(series.bars, series.color, bottom, top); } : null; 3915 plotBars(series.datapoints, barLeft, barLeft + series.bars.barWidth, fillStyleCallback, series.xaxis, series.yaxis); 3916 ctx.restore(); 3917 } 3918 3919 function getFillStyle(filloptions, seriesColor, bottom, top) { 3920 var fill = filloptions.fill; 3921 if (!fill) 3922 return null; 3923 3924 if (filloptions.fillColor) 3925 return getColorOrGradient(filloptions.fillColor, bottom, top, seriesColor); 3926 3927 var c = $.color.parse(seriesColor); 3928 c.a = typeof fill == "number" ? fill : 0.4; 3929 c.normalize(); 3930 return c.toString(); 3931 } 3932 3933 function insertLegend() { 3934 3935 if (options.legend.container != null) { 3936 $(options.legend.container).html(""); 3937 } else { 3938 placeholder.find(".legend").remove(); 3939 } 3940 3941 if (!options.legend.show) { 3942 return; 3943 } 3944 3945 var fragments = [], entries = [], rowStarted = false, 3946 lf = options.legend.labelFormatter, s, label; 3947 3948 // Build a list of legend entries, with each having a label and a color 3949 3950 for (var i = 0; i < series.length; ++i) { 3951 s = series[i]; 3952 if (s.label) { 3953 label = lf ? lf(s.label, s) : s.label; 3954 if (label) { 3955 entries.push({ 3956 label: label, 3957 color: s.color 3958 }); 3959 } 3960 } 3961 } 3962 3963 // Sort the legend using either the default or a custom comparator 3964 3965 if (options.legend.sorted) { 3966 if ($.isFunction(options.legend.sorted)) { 3967 entries.sort(options.legend.sorted); 3968 } else if (options.legend.sorted == "reverse") { 3969 entries.reverse(); 3970 } else { 3971 var ascending = options.legend.sorted != "descending"; 3972 entries.sort(function(a, b) { 3973 return a.label == b.label ? 0 : ( 3974 (a.label < b.label) != ascending ? 1 : -1 // Logical XOR 3975 ); 3976 }); 3977 } 3978 } 3979 3980 // Generate markup for the list of entries, in their final order 3981 3982 for (var i = 0; i < entries.length; ++i) { 3983 3984 var entry = entries[i]; 3985 3986 if (i % options.legend.noColumns == 0) { 3987 if (rowStarted) 3988 fragments.push('</tr>'); 3989 fragments.push('<tr>'); 3990 rowStarted = true; 3991 } 3992 3993 fragments.push( 3994 '<td class="legendColorBox"><div style="border:1px solid ' + options.legend.labelBoxBorderColor + ';padding:1px"><div style="width:4px;height:0;border:5px solid ' + entry.color + ';overflow:hidden"></div></div></td>' + 3995 '<td class="legendLabel">' + entry.label + '</td>' 3996 ); 3997 } 3998 3999 if (rowStarted) 4000 fragments.push('</tr>'); 4001 4002 if (fragments.length == 0) 4003 return; 4004 4005 var table = '<table style="font-size:smaller;color:' + options.grid.color + '">' + fragments.join("") + '</table>'; 4006 if (options.legend.container != null) 4007 $(options.legend.container).html(table); 4008 else { 4009 var pos = "", 4010 p = options.legend.position, 4011 m = options.legend.margin; 4012 if (m[0] == null) 4013 m = [m, m]; 4014 if (p.charAt(0) == "n") 4015 pos += 'top:' + (m[1] + plotOffset.top) + 'px;'; 4016 else if (p.charAt(0) == "s") 4017 pos += 'bottom:' + (m[1] + plotOffset.bottom) + 'px;'; 4018 if (p.charAt(1) == "e") 4019 pos += 'right:' + (m[0] + plotOffset.right) + 'px;'; 4020 else if (p.charAt(1) == "w") 4021 pos += 'left:' + (m[0] + plotOffset.left) + 'px;'; 4022 var legend = $('<div class="legend">' + table.replace('style="', 'style="position:absolute;' + pos +';') + '</div>').appendTo(placeholder); 4023 if (options.legend.backgroundOpacity != 0.0) { 4024 // put in the transparent background 4025 // separately to avoid blended labels and 4026 // label boxes 4027 var c = options.legend.backgroundColor; 4028 if (c == null) { 4029 c = options.grid.backgroundColor; 4030 if (c && typeof c == "string") 4031 c = $.color.parse(c); 4032 else 4033 c = $.color.extract(legend, 'background-color'); 4034 c.a = 1; 4035 c = c.toString(); 4036 } 4037 var div = legend.children(); 4038 $('<div style="position:absolute;width:' + div.width() + 'px;height:' + div.height() + 'px;' + pos +'background-color:' + c + ';"> </div>').prependTo(legend).css('opacity', options.legend.backgroundOpacity); 4039 } 4040 } 4041 } 4042 4043 4044 // interactive features 4045 4046 var highlights = [], 4047 redrawTimeout = null; 4048 4049 // returns the data item the mouse is over, or null if none is found 4050 function findNearbyItem(mouseX, mouseY, seriesFilter) { 4051 var maxDistance = options.grid.mouseActiveRadius, 4052 smallestDistance = maxDistance * maxDistance + 1, 4053 item = null, foundPoint = false, i, j, ps; 4054 4055 for (i = series.length - 1; i >= 0; --i) { 4056 if (!seriesFilter(series[i])) 4057 continue; 4058 4059 var s = series[i], 4060 axisx = s.xaxis, 4061 axisy = s.yaxis, 4062 points = s.datapoints.points, 4063 mx = axisx.c2p(mouseX), // precompute some stuff to make the loop faster 4064 my = axisy.c2p(mouseY), 4065 maxx = maxDistance / axisx.scale, 4066 maxy = maxDistance / axisy.scale; 4067 4068 ps = s.datapoints.pointsize; 4069 // with inverse transforms, we can't use the maxx/maxy 4070 // optimization, sadly 4071 if (axisx.options.inverseTransform) 4072 maxx = Number.MAX_VALUE; 4073 if (axisy.options.inverseTransform) 4074 maxy = Number.MAX_VALUE; 4075 4076 if (s.lines.show || s.points.show) { 4077 for (j = 0; j < points.length; j += ps) { 4078 var x = points[j], y = points[j + 1]; 4079 if (x == null) 4080 continue; 4081 4082 // For points and lines, the cursor must be within a 4083 // certain distance to the data point 4084 if (x - mx > maxx || x - mx < -maxx || 4085 y - my > maxy || y - my < -maxy) 4086 continue; 4087 4088 // We have to calculate distances in pixels, not in 4089 // data units, because the scales of the axes may be different 4090 var dx = Math.abs(axisx.p2c(x) - mouseX), 4091 dy = Math.abs(axisy.p2c(y) - mouseY), 4092 dist = dx * dx + dy * dy; // we save the sqrt 4093 4094 // use <= to ensure last point takes precedence 4095 // (last generally means on top of) 4096 if (dist < smallestDistance) { 4097 smallestDistance = dist; 4098 item = [i, j / ps]; 4099 } 4100 } 4101 } 4102 4103 if (s.bars.show && !item) { // no other point can be nearby 4104 4105 var barLeft, barRight; 4106 4107 switch (s.bars.align) { 4108 case "left": 4109 barLeft = 0; 4110 break; 4111 case "right": 4112 barLeft = -s.bars.barWidth; 4113 break; 4114 default: 4115 barLeft = -s.bars.barWidth / 2; 4116 } 4117 4118 barRight = barLeft + s.bars.barWidth; 4119 4120 for (j = 0; j < points.length; j += ps) { 4121 var x = points[j], y = points[j + 1], b = points[j + 2]; 4122 if (x == null) 4123 continue; 4124 4125 // for a bar graph, the cursor must be inside the bar 4126 if (series[i].bars.horizontal ? 4127 (mx <= Math.max(b, x) && mx >= Math.min(b, x) && 4128 my >= y + barLeft && my <= y + barRight) : 4129 (mx >= x + barLeft && mx <= x + barRight && 4130 my >= Math.min(b, y) && my <= Math.max(b, y))) 4131 item = [i, j / ps]; 4132 } 4133 } 4134 } 4135 4136 if (item) { 4137 i = item[0]; 4138 j = item[1]; 4139 ps = series[i].datapoints.pointsize; 4140 4141 return { datapoint: series[i].datapoints.points.slice(j * ps, (j + 1) * ps), 4142 dataIndex: j, 4143 series: series[i], 4144 seriesIndex: i }; 4145 } 4146 4147 return null; 4148 } 4149 4150 function onMouseMove(e) { 4151 if (options.grid.hoverable) 4152 triggerClickHoverEvent("plothover", e, 4153 function (s) { return s["hoverable"] != false; }); 4154 } 4155 4156 function onMouseLeave(e) { 4157 if (options.grid.hoverable) 4158 triggerClickHoverEvent("plothover", e, 4159 function (s) { return false; }); 4160 } 4161 4162 function onClick(e) { 4163 triggerClickHoverEvent("plotclick", e, 4164 function (s) { return s["clickable"] != false; }); 4165 } 4166 4167 // trigger click or hover event (they send the same parameters 4168 // so we share their code) 4169 function triggerClickHoverEvent(eventname, event, seriesFilter) { 4170 var offset = eventHolder.offset(), 4171 canvasX = event.pageX - offset.left - plotOffset.left, 4172 canvasY = event.pageY - offset.top - plotOffset.top, 4173 pos = canvasToAxisCoords({ left: canvasX, top: canvasY }); 4174 4175 pos.pageX = event.pageX; 4176 pos.pageY = event.pageY; 4177 4178 var item = findNearbyItem(canvasX, canvasY, seriesFilter); 4179 4180 if (item) { 4181 // fill in mouse pos for any listeners out there 4182 item.pageX = parseInt(item.series.xaxis.p2c(item.datapoint[0]) + offset.left + plotOffset.left, 10); 4183 item.pageY = parseInt(item.series.yaxis.p2c(item.datapoint[1]) + offset.top + plotOffset.top, 10); 4184 } 4185 4186 if (options.grid.autoHighlight) { 4187 // clear auto-highlights 4188 for (var i = 0; i < highlights.length; ++i) { 4189 var h = highlights[i]; 4190 if (h.auto == eventname && 4191 !(item && h.series == item.series && 4192 h.point[0] == item.datapoint[0] && 4193 h.point[1] == item.datapoint[1])) 4194 unhighlight(h.series, h.point); 4195 } 4196 4197 if (item) 4198 highlight(item.series, item.datapoint, eventname); 4199 } 4200 4201 placeholder.trigger(eventname, [ pos, item ]); 4202 } 4203 4204 function triggerRedrawOverlay() { 4205 var t = options.interaction.redrawOverlayInterval; 4206 if (t == -1) { // skip event queue 4207 drawOverlay(); 4208 return; 4209 } 4210 4211 if (!redrawTimeout) 4212 redrawTimeout = setTimeout(drawOverlay, t); 4213 } 4214 4215 function drawOverlay() { 4216 redrawTimeout = null; 4217 4218 // draw highlights 4219 octx.save(); 4220 overlay.clear(); 4221 octx.translate(plotOffset.left, plotOffset.top); 4222 4223 var i, hi; 4224 for (i = 0; i < highlights.length; ++i) { 4225 hi = highlights[i]; 4226 4227 if (hi.series.bars.show) 4228 drawBarHighlight(hi.series, hi.point); 4229 else 4230 drawPointHighlight(hi.series, hi.point); 4231 } 4232 octx.restore(); 4233 4234 executeHooks(hooks.drawOverlay, [octx]); 4235 } 4236 4237 function highlight(s, point, auto) { 4238 if (typeof s == "number") 4239 s = series[s]; 4240 4241 if (typeof point == "number") { 4242 var ps = s.datapoints.pointsize; 4243 point = s.datapoints.points.slice(ps * point, ps * (point + 1)); 4244 } 4245 4246 var i = indexOfHighlight(s, point); 4247 if (i == -1) { 4248 highlights.push({ series: s, point: point, auto: auto }); 4249 4250 triggerRedrawOverlay(); 4251 } 4252 else if (!auto) 4253 highlights[i].auto = false; 4254 } 4255 4256 function unhighlight(s, point) { 4257 if (s == null && point == null) { 4258 highlights = []; 4259 triggerRedrawOverlay(); 4260 return; 4261 } 4262 4263 if (typeof s == "number") 4264 s = series[s]; 4265 4266 if (typeof point == "number") { 4267 var ps = s.datapoints.pointsize; 4268 point = s.datapoints.points.slice(ps * point, ps * (point + 1)); 4269 } 4270 4271 var i = indexOfHighlight(s, point); 4272 if (i != -1) { 4273 highlights.splice(i, 1); 4274 4275 triggerRedrawOverlay(); 4276 } 4277 } 4278 4279 function indexOfHighlight(s, p) { 4280 for (var i = 0; i < highlights.length; ++i) { 4281 var h = highlights[i]; 4282 if (h.series == s && h.point[0] == p[0] 4283 && h.point[1] == p[1]) 4284 return i; 4285 } 4286 return -1; 4287 } 4288 4289 function drawPointHighlight(series, point) { 4290 var x = point[0], y = point[1], 4291 axisx = series.xaxis, axisy = series.yaxis, 4292 highlightColor = (typeof series.highlightColor === "string") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(); 4293 4294 if (x < axisx.min || x > axisx.max || y < axisy.min || y > axisy.max) 4295 return; 4296 4297 var pointRadius = series.points.radius + series.points.lineWidth / 2; 4298 octx.lineWidth = pointRadius; 4299 octx.strokeStyle = highlightColor; 4300 var radius = 1.5 * pointRadius; 4301 x = axisx.p2c(x); 4302 y = axisy.p2c(y); 4303 4304 octx.beginPath(); 4305 if (series.points.symbol == "circle") 4306 octx.arc(x, y, radius, 0, 2 * Math.PI, false); 4307 else 4308 series.points.symbol(octx, x, y, radius, false); 4309 octx.closePath(); 4310 octx.stroke(); 4311 } 4312 4313 function drawBarHighlight(series, point) { 4314 var highlightColor = (typeof series.highlightColor === "string") ? series.highlightColor : $.color.parse(series.color).scale('a', 0.5).toString(), 4315 fillStyle = highlightColor, 4316 barLeft; 4317 4318 switch (series.bars.align) { 4319 case "left": 4320 barLeft = 0; 4321 break; 4322 case "right": 4323 barLeft = -series.bars.barWidth; 4324 break; 4325 default: 4326 barLeft = -series.bars.barWidth / 2; 4327 } 4328 4329 octx.lineWidth = series.bars.lineWidth; 4330 octx.strokeStyle = highlightColor; 4331 4332 drawBar(point[0], point[1], point[2] || 0, barLeft, barLeft + series.bars.barWidth, 4333 function () { return fillStyle; }, series.xaxis, series.yaxis, octx, series.bars.horizontal, series.bars.lineWidth); 4334 } 4335 4336 function getColorOrGradient(spec, bottom, top, defaultColor) { 4337 if (typeof spec == "string") 4338 return spec; 4339 else { 4340 // assume this is a gradient spec; IE currently only 4341 // supports a simple vertical gradient properly, so that's 4342 // what we support too 4343 var gradient = ctx.createLinearGradient(0, top, 0, bottom); 4344 4345 for (var i = 0, l = spec.colors.length; i < l; ++i) { 4346 var c = spec.colors[i]; 4347 if (typeof c != "string") { 4348 var co = $.color.parse(defaultColor); 4349 if (c.brightness != null) 4350 co = co.scale('rgb', c.brightness); 4351 if (c.opacity != null) 4352 co.a *= c.opacity; 4353 c = co.toString(); 4354 } 4355 gradient.addColorStop(i / (l - 1), c); 4356 } 4357 4358 return gradient; 4359 } 4360 } 4361 } 4362 4363 // Add the plot function to the top level of the jQuery object 4364 4365 $.plot = function(placeholder, data, options) { 4366 //var t0 = new Date(); 4367 var plot = new Plot($(placeholder), data, options, $.plot.plugins); 4368 //(window.console ? console.log : alert)("time used (msecs): " + ((new Date()).getTime() - t0.getTime())); 4369 return plot; 4370 }; 4371 4372 $.plot.version = "0.8.3"; 4373 4374 $.plot.plugins = []; 4375 4376 // Also add the plot function as a chainable property 4377 4378 $.fn.plot = function(data, options) { 4379 return this.each(function() { 4380 $.plot(this, data, options); 4381 }); 4382 }; 4383 4384 // round to nearby lower multiple of base 4385 function floorInBase(n, base) { 4386 return base * Math.floor(n / base); 4387 } 4388 4389})(jQuery); 4390 4391/* Flot plugin for plotting textual data or categories. 4392 4393Copyright (c) 2007-2014 IOLA and Ole Laursen. 4394Licensed under the MIT license. 4395 4396Consider a dataset like [["February", 34], ["March", 20], ...]. This plugin 4397allows you to plot such a dataset directly. 4398 4399To enable it, you must specify mode: "categories" on the axis with the textual 4400labels, e.g. 4401 4402 $.plot("#placeholder", data, { xaxis: { mode: "categories" } }); 4403 4404By default, the labels are ordered as they are met in the data series. If you
4405need a different ordering, you can specify "categories" on the axis options 4406and list the categories there: 4407 4408 xaxis: { 4409 mode: "categories", 4410 categories: ["February", "March", "April"] 4411 } 4412 4413If you need to customize the distances between the categories, you can specify 4414"categories" as an object mapping labels to values 4415 4416 xaxis: { 4417 mode: "categories", 4418 categories: { "February": 1, "March": 3, "April": 4 } 4419 } 4420 4421If you don't specify all categories, the remaining categories will be numbered 4422from the max value plus 1 (with a spacing of 1 between each). 4423 4424Internally, the plugin works by transforming the input data through an auto- 4425generated mapping where the first category becomes 0, the second 1, etc. 4426Hence, a point like ["February", 34] becomes [0, 34] internally in Flot (this 4427is visible in hover and click events that return numbers rather than the 4428category labels). The plugin also overrides the tick generator to spit out the 4429categories as ticks instead of the values. 4430 4431If you need to map a value back to its label, the mapping is always accessible 4432as "categories" on the axis object, e.g. plot.getAxes().xaxis.categories. 4433 4434*/ 4435 4436(function ($) { 4437 var options = { 4438 xaxis: { 4439 categories: null 4440 }, 4441 yaxis: { 4442 categories: null 4443 } 4444 }; 4445 4446 function processRawData(plot, series, data, datapoints) { 4447 // if categories are enabled, we need to disable 4448 // auto-transformation to numbers so the strings are intact 4449 // for later processing 4450 4451 var xCategories = series.xaxis.options.mode == "categories", 4452 yCategories = series.yaxis.options.mode == "categories"; 4453 4454 if (!(xCategories || yCategories)) 4455 return; 4456 4457 var format = datapoints.format; 4458 4459 if (!format) { 4460 // FIXME: auto-detection should really not be defined here 4461 var s = series; 4462 format = []; 4463 format.push({ x: true, number: true, required: true }); 4464 format.push({ y: true, number: true, required: true }); 4465 4466 if (s.bars.show || (s.lines.show && s.lines.fill)) { 4467 var autoscale = !!((s.bars.show && s.bars.zero) || (s.lines.show && s.lines.zero)); 4468 format.push({ y: true, number: true, required: false, defaultValue: 0, autoscale: autoscale }); 4469 if (s.bars.horizontal) { 4470 delete format[format.length - 1].y; 4471 format[format.length - 1].x = true; 4472 } 4473 } 4474 4475 datapoints.format = format; 4476 } 4477 4478 for (var m = 0; m < format.length; ++m) { 4479 if (format[m].x && xCategories) 4480 format[m].number = false; 4481 4482 if (format[m].y && yCategories) 4483 format[m].number = false; 4484 } 4485 } 4486 4487 function getNextIndex(categories) { 4488 var index = -1; 4489 4490 for (var v in categories) 4491 if (categories[v] > index) 4492 index = categories[v]; 4493 4494 return index + 1; 4495 } 4496 4497 function categoriesTickGenerator(axis) { 4498 var res = []; 4499 for (var label in axis.categories) { 4500 var v = axis.categories[label]; 4501 if (v >= axis.min && v <= axis.max) 4502 res.push([v, label]); 4503 } 4504 4505 res.sort(function (a, b) { return a[0] - b[0]; }); 4506 4507 return res; 4508 } 4509 4510 function setupCategoriesForAxis(series, axis, datapoints) { 4511 if (series[axis].options.mode != "categories") 4512 return; 4513 4514 if (!series[axis].categories) { 4515 // parse options 4516 var c = {}, o = series[axis].options.categories || {}; 4517 if ($.isArray(o)) { 4518 for (var i = 0; i < o.length; ++i) 4519 c[o[i]] = i; 4520 } 4521 else { 4522 for (var v in o) 4523 c[v] = o[v]; 4524 } 4525 4526 series[axis].categories = c; 4527 } 4528 4529 // fix ticks 4530 if (!series[axis].options.ticks) 4531 series[axis].options.ticks = categoriesTickGenerator; 4532 4533 transformPointsOnAxis(datapoints, axis, series[axis].categories); 4534 } 4535 4536 function transformPointsOnAxis(datapoints, axis, categories) { 4537 // go through the points, transforming them 4538 var points = datapoints.points, 4539 ps = datapoints.pointsize, 4540 format = datapoints.format, 4541 formatColumn = axis.charAt(0), 4542 index = getNextIndex(categories); 4543 4544 for (var i = 0; i < points.length; i += ps) { 4545 if (points[i] == null) 4546 continue; 4547 4548 for (var m = 0; m < ps; ++m) { 4549 var val = points[i + m]; 4550 4551 if (val == null || !format[m][formatColumn]) 4552 continue; 4553 4554 if (!(val in categories)) { 4555 categories[val] = index; 4556 ++index; 4557 } 4558 4559 points[i + m] = categories[val]; 4560 } 4561 } 4562 } 4563 4564 function processDatapoints(plot, series, datapoints) { 4565 setupCategoriesForAxis(series, "xaxis", datapoints); 4566 setupCategoriesForAxis(series, "yaxis", datapoints); 4567 } 4568 4569 function init(plot) { 4570 plot.hooks.processRawData.push(processRawData); 4571 plot.hooks.processDatapoints.push(processDatapoints); 4572 } 4573 4574 $.plot.plugins.push({ 4575 init: init, 4576 options: options, 4577 name: 'categories', 4578 version: '1.0' 4579 });
vendor: 7,382 bytes, lines 4580-4826
4580})(jQuery); 4581 4582/* Flot plugin for rendering pie charts. 4583 4584Copyright (c) 2007-2014 IOLA and Ole Laursen. 4585Licensed under the MIT license. 4586 4587The plugin assumes that each series has a single data value, and that each 4588value is a positive integer or zero. Negative numbers don't make sense for a 4589pie chart, and have unpredictable results. The values do NOT need to be 4590passed in as percentages; the plugin will calculate the total and per-slice 4591percentages internally. 4592 4593* Created by Brian Medendorp 4594 4595* Updated with contributions from btburnett3, Anthony Aragues and Xavi Ivars 4596 4597The plugin supports these options: 4598 4599 series: { 4600 pie: { 4601 show: true/false 4602 radius: 0-1 for percentage of fullsize, or a specified pixel length, or 'auto' 4603 innerRadius: 0-1 for percentage of fullsize or a specified pixel length, for creating a donut effect 4604 startAngle: 0-2 factor of PI used for starting angle (in radians) i.e 3/2 starts at the top, 0 and 2 have the same result 4605 tilt: 0-1 for percentage to tilt the pie, where 1 is no tilt, and 0 is completely flat (nothing will show) 4606 offset: { 4607 top: integer value to move the pie up or down 4608 left: integer value to move the pie left or right, or 'auto' 4609 }, 4610 stroke: { 4611 color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#FFF') 4612 width: integer pixel width of the stroke 4613 }, 4614 label: { 4615 show: true/false, or 'auto' 4616 formatter: a user-defined function that modifies the text/style of the label text 4617 radius: 0-1 for percentage of fullsize, or a specified pixel length 4618 background: { 4619 color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#000') 4620 opacity: 0-1 4621 }, 4622 threshold: 0-1 for the percentage value at which to hide labels (if they're too small) 4623 }, 4624 combine: { 4625 threshold: 0-1 for the percentage value at which to combine slices (if they're too small) 4626 color: any hexidecimal color value (other formats may or may not work, so best to stick with something like '#CCC'), if null, the plugin will automatically use the color of the first slice to be combined 4627 label: any text value of what the combined slice should be labeled 4628 } 4629 highlight: { 4630 opacity: 0-1 4631 } 4632 } 4633 } 4634 4635More detail and specific examples can be found in the included HTML file. 4636 4637*/ 4638 4639(function($) { 4640 4641 // Maximum redraw attempts when fitting labels within the plot 4642 4643 var REDRAW_ATTEMPTS = 10; 4644 4645 // Factor by which to shrink the pie when fitting labels within the plot 4646 4647 var REDRAW_SHRINK = 0.95; 4648 4649 function init(plot) { 4650 4651 var canvas = null, 4652 target = null, 4653 options = null, 4654 maxRadius = null, 4655 centerLeft = null, 4656 centerTop = null, 4657 processed = false, 4658 ctx = null; 4659 4660 // interactive variables 4661 4662 var highlights = []; 4663 4664 // add hook to determine if pie plugin in enabled, and then perform necessary operations 4665 4666 plot.hooks.processOptions.push(function(plot, options) { 4667 if (options.series.pie.show) { 4668 4669 options.grid.show = false; 4670 4671 // set labels.show 4672 4673 if (options.series.pie.label.show == "auto") { 4674 if (options.legend.show) { 4675 options.series.pie.label.show = false; 4676 } else { 4677 options.series.pie.label.show = true; 4678 } 4679 } 4680 4681 // set radius 4682 4683 if (options.series.pie.radius == "auto") { 4684 if (options.series.pie.label.show) { 4685 options.series.pie.radius = 3/4; 4686 } else { 4687 options.series.pie.radius = 1; 4688 } 4689 } 4690 4691 // ensure sane tilt 4692 4693 if (options.series.pie.tilt > 1) { 4694 options.series.pie.tilt = 1; 4695 } else if (options.series.pie.tilt < 0) { 4696 options.series.pie.tilt = 0; 4697 } 4698 } 4699 }); 4700 4701 plot.hooks.bindEvents.push(function(plot, eventHolder) { 4702 var options = plot.getOptions(); 4703 if (options.series.pie.show) { 4704 if (options.grid.hoverable) { 4705 eventHolder.unbind("mousemove").mousemove(onMouseMove); 4706 } 4707 if (options.grid.clickable) { 4708 eventHolder.unbind("click").click(onClick); 4709 } 4710 } 4711 }); 4712 4713 plot.hooks.processDatapoints.push(function(plot, series, data, datapoints) { 4714 var options = plot.getOptions(); 4715 if (options.series.pie.show) { 4716 processDatapoints(plot, series, data, datapoints); 4717 } 4718 }); 4719 4720 plot.hooks.drawOverlay.push(function(plot, octx) { 4721 var options = plot.getOptions(); 4722 if (options.series.pie.show) { 4723 drawOverlay(plot, octx); 4724 } 4725 }); 4726 4727 plot.hooks.draw.push(function(plot, newCtx) { 4728 var options = plot.getOptions(); 4729 if (options.series.pie.show) { 4730 draw(plot, newCtx); 4731 } 4732 }); 4733 4734 function processDatapoints(plot, series, datapoints) { 4735 if (!processed) { 4736 processed = true; 4737 canvas = plot.getCanvas(); 4738 target = $(canvas).parent(); 4739 options = plot.getOptions(); 4740 plot.setData(combine(plot.getData())); 4741 } 4742 } 4743 4744 function combine(data) { 4745 4746 var total = 0, 4747 combined = 0, 4748 numCombined = 0, 4749 color = options.series.pie.combine.color, 4750 newdata = []; 4751 4752 // Fix up the raw data from Flot, ensuring the data is numeric 4753 4754 for (var i = 0; i < data.length; ++i) { 4755 4756 var value = data[i].data; 4757 4758 // If the data is an array, we'll assume that it's a standard 4759 // Flot x-y pair, and are concerned only with the second value. 4760 4761 // Note how we use the original array, rather than creating a 4762 // new one; this is more efficient and preserves any extra data 4763 // that the user may have stored in higher indexes. 4764 4765 if ($.isArray(value) && value.length == 1) { 4766 value = value[0]; 4767 } 4768 4769 if ($.isArray(value)) { 4770 // Equivalent to $.isNumeric() but compatible with jQuery < 1.7 4771 if (!isNaN(parseFloat(value[1])) && isFinite(value[1])) { 4772 value[1] = +value[1]; 4773 } else { 4774 value[1] = 0; 4775 } 4776 } else if (!isNaN(parseFloat(value)) && isFinite(value)) { 4777 value = [1, +value]; 4778 } else { 4779 value = [1, 0]; 4780 } 4781 4782 data[i].data = [value]; 4783 } 4784 4785 // Sum up all the slices, so we can calculate percentages for each 4786 4787 for (var i = 0; i < data.length; ++i) { 4788 total += data[i].data[0][1]; 4789 } 4790 4791 // Count the number of slices with percentages below the combine 4792 // threshold; if it turns out to be just one, we won't combine. 4793 4794 for (var i = 0; i < data.length; ++i) { 4795 var value = data[i].data[0][1]; 4796 if (value / total <= options.series.pie.combine.threshold) { 4797 combined += value; 4798 numCombined++; 4799 if (!color) { 4800 color = data[i].color; 4801 } 4802 } 4803 } 4804 4805 for (var i = 0; i < data.length; ++i) { 4806 var value = data[i].data[0][1]; 4807 if (numCombined < 2 || value / total > options.series.pie.combine.threshold) { 4808 newdata.push( 4809 $.extend(data[i], { /* extend to allow keeping all other original data values 4810 and using them e.g. in labelFormatter. */ 4811 data: [[1, value]], 4812 color: data[i].color, 4813 label: data[i].label, 4814 angle: value * Math.PI * 2 / total, 4815 percent: value / (total / 100) 4816 }) 4817 ); 4818 } 4819 } 4820 4821 if (numCombined > 1) { 4822 newdata.push({ 4823 data: [[1, combined]], 4824 color: color, 4825 label: options.series.pie.combine.label, 4826 angle: combined * Math.PI * 2 / total,
4827 percent: combined / (total / 100) 4828 }); 4829 } 4830 4831 return newdata; 4832 } 4833 4834 function draw(plot, newCtx) { 4835 4836 if (!target) { 4837 return; // if no series were passed 4838 } 4839 4840 var canvasWidth = plot.getPlaceholder().width(), 4841 canvasHeight = plot.getPlaceholder().height(), 4842 legendWidth = target.children().filter(".legend").children().width() || 0; 4843 4844 ctx = newCtx; 4845 4846 // WARNING: HACK! REWRITE THIS CODE AS SOON AS POSSIBLE! 4847 4848 // When combining smaller slices into an 'other' slice, we need to 4849 // add a new series. Since Flot gives plugins no way to modify the 4850 // list of series, the pie plugin uses a hack where the first call 4851 // to processDatapoints results in a call to setData with the new 4852 // list of series, then subsequent processDatapoints do nothing. 4853 4854 // The plugin-global 'processed' flag is used to control this hack; 4855 // it starts out false, and is set to true after the first call to 4856 // processDatapoints. 4857 4858 // Unfortunately this turns future setData calls into no-ops; they 4859 // call processDatapoints, the flag is true, and nothing happens. 4860
vendor: 14,920 bytes, lines 4861-5358
4861 // To fix this we'll set the flag back to false here in draw, when 4862 // all series have been processed, so the next sequence of calls to 4863 // processDatapoints once again starts out with a slice-combine. 4864 // This is really a hack; in 0.9 we need to give plugins a proper 4865 // way to modify series before any processing begins. 4866 4867 processed = false; 4868 4869 // calculate maximum radius and center point 4870 4871 maxRadius = Math.min(canvasWidth, canvasHeight / options.series.pie.tilt) / 2; 4872 centerTop = canvasHeight / 2 + options.series.pie.offset.top; 4873 centerLeft = canvasWidth / 2; 4874 4875 if (options.series.pie.offset.left == "auto") { 4876 if (options.legend.position.match("w")) { 4877 centerLeft += legendWidth / 2; 4878 } else { 4879 centerLeft -= legendWidth / 2; 4880 } 4881 if (centerLeft < maxRadius) { 4882 centerLeft = maxRadius; 4883 } else if (centerLeft > canvasWidth - maxRadius) { 4884 centerLeft = canvasWidth - maxRadius; 4885 } 4886 } else { 4887 centerLeft += options.series.pie.offset.left; 4888 } 4889 4890 var slices = plot.getData(), 4891 attempts = 0; 4892 4893 // Keep shrinking the pie's radius until drawPie returns true, 4894 // indicating that all the labels fit, or we try too many times. 4895 4896 do { 4897 if (attempts > 0) { 4898 maxRadius *= REDRAW_SHRINK; 4899 } 4900 attempts += 1; 4901 clear(); 4902 if (options.series.pie.tilt <= 0.8) { 4903 drawShadow(); 4904 } 4905 } while (!drawPie() && attempts < REDRAW_ATTEMPTS) 4906 4907 if (attempts >= REDRAW_ATTEMPTS) { 4908 clear(); 4909 target.prepend("<div class='error'>Could not draw pie with labels contained inside canvas</div>"); 4910 } 4911 4912 if (plot.setSeries && plot.insertLegend) { 4913 plot.setSeries(slices); 4914 plot.insertLegend(); 4915 } 4916 4917 // we're actually done at this point, just defining internal functions at this point 4918 4919 function clear() { 4920 ctx.clearRect(0, 0, canvasWidth, canvasHeight); 4921 target.children().filter(".pieLabel, .pieLabelBackground").remove(); 4922 } 4923 4924 function drawShadow() { 4925 4926 var shadowLeft = options.series.pie.shadow.left; 4927 var shadowTop = options.series.pie.shadow.top; 4928 var edge = 10; 4929 var alpha = options.series.pie.shadow.alpha; 4930 var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; 4931 4932 if (radius >= canvasWidth / 2 - shadowLeft || radius * options.series.pie.tilt >= canvasHeight / 2 - shadowTop || radius <= edge) { 4933 return; // shadow would be outside canvas, so don't draw it 4934 } 4935 4936 ctx.save(); 4937 ctx.translate(shadowLeft,shadowTop); 4938 ctx.globalAlpha = alpha; 4939 ctx.fillStyle = "#000"; 4940 4941 // center and rotate to starting position 4942 4943 ctx.translate(centerLeft,centerTop); 4944 ctx.scale(1, options.series.pie.tilt); 4945 4946 //radius -= edge; 4947 4948 for (var i = 1; i <= edge; i++) { 4949 ctx.beginPath(); 4950 ctx.arc(0, 0, radius, 0, Math.PI * 2, false); 4951 ctx.fill(); 4952 radius -= i; 4953 } 4954 4955 ctx.restore(); 4956 } 4957 4958 function drawPie() { 4959 4960 var startAngle = Math.PI * options.series.pie.startAngle; 4961 var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; 4962 4963 // center and rotate to starting position 4964 4965 ctx.save(); 4966 ctx.translate(centerLeft,centerTop); 4967 ctx.scale(1, options.series.pie.tilt); 4968 //ctx.rotate(startAngle); // start at top; -- This doesn't work properly in Opera 4969 4970 // draw slices 4971 4972 ctx.save(); 4973 var currentAngle = startAngle; 4974 for (var i = 0; i < slices.length; ++i) { 4975 slices[i].startAngle = currentAngle; 4976 drawSlice(slices[i].angle, slices[i].color, true); 4977 } 4978 ctx.restore(); 4979 4980 // draw slice outlines 4981 4982 if (options.series.pie.stroke.width > 0) { 4983 ctx.save(); 4984 ctx.lineWidth = options.series.pie.stroke.width; 4985 currentAngle = startAngle; 4986 for (var i = 0; i < slices.length; ++i) { 4987 drawSlice(slices[i].angle, options.series.pie.stroke.color, false); 4988 } 4989 ctx.restore(); 4990 } 4991 4992 // draw donut hole 4993 4994 drawDonutHole(ctx); 4995 4996 ctx.restore(); 4997 4998 // Draw the labels, returning true if they fit within the plot 4999 5000 if (options.series.pie.label.show) { 5001 return drawLabels(); 5002 } else return true; 5003 5004 function drawSlice(angle, color, fill) { 5005 5006 if (angle <= 0 || isNaN(angle)) { 5007 return; 5008 } 5009 5010 if (fill) { 5011 ctx.fillStyle = color; 5012 } else { 5013 ctx.strokeStyle = color; 5014 ctx.lineJoin = "round"; 5015 } 5016 5017 ctx.beginPath(); 5018 if (Math.abs(angle - Math.PI * 2) > 0.000000001) { 5019 ctx.moveTo(0, 0); // Center of the pie 5020 } 5021 5022 //ctx.arc(0, 0, radius, 0, angle, false); // This doesn't work properly in Opera 5023 ctx.arc(0, 0, radius,currentAngle, currentAngle + angle / 2, false); 5024 ctx.arc(0, 0, radius,currentAngle + angle / 2, currentAngle + angle, false); 5025 ctx.closePath(); 5026 //ctx.rotate(angle); // This doesn't work properly in Opera 5027 currentAngle += angle; 5028 5029 if (fill) { 5030 ctx.fill(); 5031 } else { 5032 ctx.stroke(); 5033 } 5034 } 5035 5036 function drawLabels() { 5037 5038 var currentAngle = startAngle; 5039 var radius = options.series.pie.label.radius > 1 ? options.series.pie.label.radius : maxRadius * options.series.pie.label.radius; 5040 5041 for (var i = 0; i < slices.length; ++i) { 5042 if (slices[i].percent >= options.series.pie.label.threshold * 100) { 5043 if (!drawLabel(slices[i], currentAngle, i)) { 5044 return false; 5045 } 5046 } 5047 currentAngle += slices[i].angle; 5048 } 5049 5050 return true; 5051 5052 function drawLabel(slice, startAngle, index) { 5053 5054 if (slice.data[0][1] == 0) { 5055 return true; 5056 } 5057 5058 // format label text 5059 5060 var lf = options.legend.labelFormatter, text, plf = options.series.pie.label.formatter; 5061 5062 if (lf) { 5063 text = lf(slice.label, slice); 5064 } else { 5065 text = slice.label; 5066 } 5067 5068 if (plf) { 5069 text = plf(text, slice); 5070 } 5071 5072 var halfAngle = ((startAngle + slice.angle) + startAngle) / 2; 5073 var x = centerLeft + Math.round(Math.cos(halfAngle) * radius); 5074 var y = centerTop + Math.round(Math.sin(halfAngle) * radius) * options.series.pie.tilt; 5075 5076 var html = "<span class='pieLabel' id='pieLabel" + index + "' style='position:absolute;top:" + y + "px;left:" + x + "px;'>" + text + "</span>"; 5077 target.append(html); 5078 5079 var label = target.children("#pieLabel" + index); 5080 var labelTop = (y - label.height() / 2); 5081 var labelLeft = (x - label.width() / 2); 5082 5083 label.css("top", labelTop); 5084 label.css("left", labelLeft); 5085 5086 // check to make sure that the label is not outside the canvas 5087 5088 if (0 - labelTop > 0 || 0 - labelLeft > 0 || canvasHeight - (labelTop + label.height()) < 0 || canvasWidth - (labelLeft + label.width()) < 0) { 5089 return false; 5090 } 5091 5092 if (options.series.pie.label.background.opacity != 0) { 5093 5094 // put in the transparent background separately to avoid blended labels and label boxes 5095 5096 var c = options.series.pie.label.background.color; 5097 5098 if (c == null) { 5099 c = slice.color; 5100 } 5101 5102 var pos = "top:" + labelTop + "px;left:" + labelLeft + "px;"; 5103 $("<div class='pieLabelBackground' style='position:absolute;width:" + label.width() + "px;height:" + label.height() + "px;" + pos + "background-color:" + c + ";'></div>") 5104 .css("opacity", options.series.pie.label.background.opacity) 5105 .insertBefore(label); 5106 } 5107 5108 return true; 5109 } // end individual label function 5110 } // end drawLabels function 5111 } // end drawPie function 5112 } // end draw function 5113 5114 // Placed here because it needs to be accessed from multiple locations 5115 5116 function drawDonutHole(layer) { 5117 if (options.series.pie.innerRadius > 0) { 5118 5119 // subtract the center 5120 5121 layer.save(); 5122 var innerRadius = options.series.pie.innerRadius > 1 ? options.series.pie.innerRadius : maxRadius * options.series.pie.innerRadius; 5123 layer.globalCompositeOperation = "destination-out"; // this does not work with excanvas, but it will fall back to using the stroke color 5124 layer.beginPath(); 5125 layer.fillStyle = options.series.pie.stroke.color; 5126 layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false); 5127 layer.fill(); 5128 layer.closePath(); 5129 layer.restore(); 5130 5131 // add inner stroke 5132 5133 layer.save(); 5134 layer.beginPath(); 5135 layer.strokeStyle = options.series.pie.stroke.color; 5136 layer.arc(0, 0, innerRadius, 0, Math.PI * 2, false); 5137 layer.stroke(); 5138 layer.closePath(); 5139 layer.restore(); 5140 5141 // TODO: add extra shadow inside hole (with a mask) if the pie is tilted. 5142 } 5143 } 5144 5145 //-- Additional Interactive related functions -- 5146 5147 function isPointInPoly(poly, pt) { 5148 for(var c = false, i = -1, l = poly.length, j = l - 1; ++i < l; j = i) 5149 ((poly[i][1] <= pt[1] && pt[1] < poly[j][1]) || (poly[j][1] <= pt[1] && pt[1]< poly[i][1])) 5150 && (pt[0] < (poly[j][0] - poly[i][0]) * (pt[1] - poly[i][1]) / (poly[j][1] - poly[i][1]) + poly[i][0]) 5151 && (c = !c); 5152 return c; 5153 } 5154 5155 function findNearbySlice(mouseX, mouseY) { 5156 5157 var slices = plot.getData(), 5158 options = plot.getOptions(), 5159 radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius, 5160 x, y; 5161 5162 for (var i = 0; i < slices.length; ++i) { 5163 5164 var s = slices[i]; 5165 5166 if (s.pie.show) { 5167 5168 ctx.save(); 5169 ctx.beginPath(); 5170 ctx.moveTo(0, 0); // Center of the pie 5171 //ctx.scale(1, options.series.pie.tilt); // this actually seems to break everything when here. 5172 ctx.arc(0, 0, radius, s.startAngle, s.startAngle + s.angle / 2, false); 5173 ctx.arc(0, 0, radius, s.startAngle + s.angle / 2, s.startAngle + s.angle, false); 5174 ctx.closePath(); 5175 x = mouseX - centerLeft; 5176 y = mouseY - centerTop; 5177 5178 if (ctx.isPointInPath) { 5179 if (ctx.isPointInPath(mouseX - centerLeft, mouseY - centerTop)) { 5180 ctx.restore(); 5181 return { 5182 datapoint: [s.percent, s.data], 5183 dataIndex: 0, 5184 series: s, 5185 seriesIndex: i 5186 }; 5187 } 5188 } else { 5189 5190 // excanvas for IE doesn;t support isPointInPath, this is a workaround. 5191 5192 var p1X = radius * Math.cos(s.startAngle), 5193 p1Y = radius * Math.sin(s.startAngle), 5194 p2X = radius * Math.cos(s.startAngle + s.angle / 4), 5195 p2Y = radius * Math.sin(s.startAngle + s.angle / 4), 5196 p3X = radius * Math.cos(s.startAngle + s.angle / 2), 5197 p3Y = radius * Math.sin(s.startAngle + s.angle / 2), 5198 p4X = radius * Math.cos(s.startAngle + s.angle / 1.5), 5199 p4Y = radius * Math.sin(s.startAngle + s.angle / 1.5), 5200 p5X = radius * Math.cos(s.startAngle + s.angle), 5201 p5Y = radius * Math.sin(s.startAngle + s.angle), 5202 arrPoly = [[0, 0], [p1X, p1Y], [p2X, p2Y], [p3X, p3Y], [p4X, p4Y], [p5X, p5Y]], 5203 arrPoint = [x, y]; 5204 5205 // TODO: perhaps do some mathmatical trickery here with the Y-coordinate to compensate for pie tilt? 5206 5207 if (isPointInPoly(arrPoly, arrPoint)) { 5208 ctx.restore(); 5209 return { 5210 datapoint: [s.percent, s.data], 5211 dataIndex: 0, 5212 series: s, 5213 seriesIndex: i 5214 }; 5215 } 5216 } 5217 5218 ctx.restore(); 5219 } 5220 } 5221 5222 return null; 5223 } 5224 5225 function onMouseMove(e) { 5226 triggerClickHoverEvent("plothover", e); 5227 } 5228 5229 function onClick(e) { 5230 triggerClickHoverEvent("plotclick", e); 5231 } 5232 5233 // trigger click or hover event (they send the same parameters so we share their code) 5234 5235 function triggerClickHoverEvent(eventname, e) { 5236 5237 var offset = plot.offset(); 5238 var canvasX = parseInt(e.pageX - offset.left); 5239 var canvasY = parseInt(e.pageY - offset.top); 5240 var item = findNearbySlice(canvasX, canvasY); 5241 5242 if (options.grid.autoHighlight) { 5243 5244 // clear auto-highlights 5245 5246 for (var i = 0; i < highlights.length; ++i) { 5247 var h = highlights[i]; 5248 if (h.auto == eventname && !(item && h.series == item.series)) { 5249 unhighlight(h.series); 5250 } 5251 } 5252 } 5253 5254 // highlight the slice 5255 5256 if (item) { 5257 highlight(item.series, eventname); 5258 } 5259 5260 // trigger any hover bind events 5261 5262 var pos = { pageX: e.pageX, pageY: e.pageY }; 5263 target.trigger(eventname, [pos, item]); 5264 } 5265 5266 function highlight(s, auto) { 5267 //if (typeof s == "number") { 5268 // s = series[s]; 5269 //} 5270 5271 var i = indexOfHighlight(s); 5272 5273 if (i == -1) { 5274 highlights.push({ series: s, auto: auto }); 5275 plot.triggerRedrawOverlay(); 5276 } else if (!auto) { 5277 highlights[i].auto = false; 5278 } 5279 } 5280 5281 function unhighlight(s) { 5282 if (s == null) { 5283 highlights = []; 5284 plot.triggerRedrawOverlay(); 5285 } 5286 5287 //if (typeof s == "number") { 5288 // s = series[s]; 5289 //} 5290 5291 var i = indexOfHighlight(s); 5292 5293 if (i != -1) { 5294 highlights.splice(i, 1); 5295 plot.triggerRedrawOverlay(); 5296 } 5297 } 5298 5299 function indexOfHighlight(s) { 5300 for (var i = 0; i < highlights.length; ++i) { 5301 var h = highlights[i]; 5302 if (h.series == s) 5303 return i; 5304 } 5305 return -1; 5306 } 5307 5308 function drawOverlay(plot, octx) { 5309 5310 var options = plot.getOptions(); 5311 5312 var radius = options.series.pie.radius > 1 ? options.series.pie.radius : maxRadius * options.series.pie.radius; 5313 5314 octx.save(); 5315 octx.translate(centerLeft, centerTop); 5316 octx.scale(1, options.series.pie.tilt); 5317 5318 for (var i = 0; i < highlights.length; ++i) { 5319 drawHighlight(highlights[i].series); 5320 } 5321 5322 drawDonutHole(octx); 5323 5324 octx.restore(); 5325 5326 function drawHighlight(series) { 5327 5328 if (series.angle <= 0 || isNaN(series.angle)) { 5329 return; 5330 } 5331 5332 //octx.fillStyle = parseColor(options.series.pie.highlight.color).scale(null, null, null, options.series.pie.highlight.opacity).toString(); 5333 octx.fillStyle = "rgba(255, 255, 255, " + options.series.pie.highlight.opacity + ")"; // this is temporary until we have access to parseColor 5334 octx.beginPath(); 5335 if (Math.abs(series.angle - Math.PI * 2) > 0.000000001) { 5336 octx.moveTo(0, 0); // Center of the pie 5337 } 5338 octx.arc(0, 0, radius, series.startAngle, series.startAngle + series.angle / 2, false); 5339 octx.arc(0, 0, radius, series.startAngle + series.angle / 2, series.startAngle + series.angle, false); 5340 octx.closePath(); 5341 octx.fill(); 5342 } 5343 } 5344 } // end init (plugin body) 5345 5346 // define pie specific options and their default values 5347 5348 var options = { 5349 series: { 5350 pie: { 5351 show: false, 5352 radius: "auto", // actual radius of the visible pie (based on full calculated radius if <=1, or hard pixel value) 5353 innerRadius: 0, /* for donut */ 5354 startAngle: 3/2, 5355 tilt: 1, 5356 shadow: { 5357 left: 5, // shadow left offset 5358 top: 15, // shadow top offset
5359 alpha: 0.02 // shadow alpha 5360 }, 5361 offset: { 5362 top: 0, 5363 left: "auto" 5364 }, 5365 stroke: { 5366 color: "#fff", 5367 width: 1 5368 }, 5369 label: { 5370 show: "auto", 5371 formatter: function(label, slice) { 5372 return "<div style='font-size:x-small;text-align:center;padding:2px;color:" + slice.color + ";'>" + label + "<br/>" + Math.round(slice.percent) + "%</div>"; 5373 }, // formatter function 5374 radius: 1, // radius at which to place the labels (based on full calculated radius if <=1, or hard pixel value) 5375 background: { 5376 color: null, 5377 opacity: 0 5378 }, 5379 threshold: 0 // percentage at which to hide the label (i.e. the slice is too narrow) 5380 }, 5381 combine: { 5382 threshold: -1, // percentage at which to combine little slices into one larger slice 5383 color: null, // color to give the new slice (auto-generated if null) 5384 label: "Other" // label to give the new slice 5385 }, 5386 highlight: { 5387 //color: "#fff", // will add this functionality once parseColor is available 5388 opacity: 0.5 5389 } 5390 } 5391 } 5392 }; 5393 5394 $.plot.plugins.push({ 5395 init: init, 5396 options: options, 5397 name: "pie", 5398 version: "1.1" 5399 }); 5400 5401})(jQuery); 5402 5403$(document).ready(function() { 5404 5405 $('.Form_newsletterSubscribe,' + 5406 '.PageArticle .FormRegisterNG,' + 5407 '.StageNewsletterSimple,' + 5408 '.PageRegister,' + 5409 '.StagePremiumPaywall' 5410 ).on('click', '.FormNLOptinPopup_open', function(e) { 5411 var parent = e.delegateTarget; 5412 $('.FormNLOptinPopup, .FormNLOptinPopup_overlay', parent).fadeIn(); 5413 5414 $('input', parent).each(function() { 5415 if ($(this).attr('name') === 'i_email') { 5416 var user_email = $(this).val(); 5417 if (user_email !== '' && user_email !== undefined) { 5418 var icon = "<i class=\"fas fa-envelope\"></i>"; 5419 $('.FormNLOptinPopup_email', parent).html(icon + user_email); 5420 } 5421 } 5422 }); 5423 5424 $('.FormNLOptinPopup_close-icon,' + 5425 '.FormNLOptinPopup_cancel,' + 5426 '.FormNLOptinPopup_overlay', parent).on('click', function(e) { 5427 $('.FormNLOptinPopup, .FormNLOptinPopup_overlay', parent).fadeOut(); 5428 }); 5429 5430 }); 5431 5432}); 5433 5434document.addEventListener("DOMContentLoaded", function(event) { 5435 element = document.querySelectorAll('.EventSearchItems-selects .FormField_control '); 5436 5437 for (let i = 0; i < element.length; i++) { 5438 element[i].addEventListener("change", function(){ 5439 document.querySelector(".EventSearchItems-form").submit(); 5440 }); 5441 } 5442 5443}); 5444document.addEventListener("DOMContentLoaded", function(event) { 5445 element = document.querySelectorAll('.EventIndexTerms-icon, .EventsThemen-icon, .EventDetailItem-icon'); 5446 5447 for (let i = 0; i < element.length; i++) { 5448 element[i].addEventListener("click", function(e){ 5449 e.preventDefault(); 5450 window.open(e.target.dataset.eventsUrl); // ,'_blank'); 5451 }); 5452 } 5453 5454}); 5455(()=>{var __webpack_modules__={768:(__unused_webpack_module,__webpack_exports__,__webpack_require__)=>{"use strict";__webpack_require__.d(__webpack_exports__,{Z:()=>Embed});var _module__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(631),_utils_sendRequest__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(58),_utils_adBlockCheck__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(173),_tracking_module__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(558);function _await(e,t,n){return n?t?t(e):e:(e&&e.then||(e=Promise.resolve(e)),t?e.then(t):e)}function _empty(){}function _invokeIgnored(e){var t=e();if(t&&t.then)return t.then(_empty)}function _async(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];try{return Promise.resolve(e.apply(this,t))}catch(e){return Promise.reject(e)}}}function _awaitIgnored(e,t){if(!t)return e&&e.then?e.then(_empty):Promise.resolve()}function _invoke(e,t){var n=e();return n&&n.then?n.then(t):t(n)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
5455t%2?ownKeys(Object(n),!0).forEach((function(t){_defineProperty(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ownKeys(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function _typeof(e){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function _createClass(e,t,n){return t&&_defineProperties(e.prototype,t),n&&_defineProperties(e,n),e}function _defineProperty(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var loadAutoplayList=_async((function(e,t,n,i){var o;return _invoke((function(){if(e.fallbackElementsPromise)return _awaitIgnored(e.fallbackElementsPromise)}),(function(){var a,r=null===(a=e.fallbackElements)||void 0===a?void 0:a.length;return _await(r?e.fallbackElements.map((function(e){return _objectSpread(_objectSpread({},e),{},{fallback_id:e.id})})):new Promise((function(n){(0,_utils_sendRequest__WEBPACK_IMPORTED_MODULE_1__.w)("https://api.embed.pinpoll.com/autoplay/nextEmbeds",{elementId:t,url:e.url,topic:e.topic},window.Pinpoll.storage).then((function(e){return e.json()})).then((function(t){var o;return n(null===(o=window.Pinpoll.embed)||void 0===o?void 0:o.sortPreferredAutoEmbeddedElements(t.elements,e,i))})).catch((function(e){console.log("Pinpoll: error during fetching autoplay polls",e),n([])}))})),(function(e){var t;return o=e,n&&(o=null===(t=o)||void 0===t?void 0:t.slice(0,n)),o}),r)}))})),Embed=function(){function Embed(e,t,n){var i=this;if(_classCallCheck(this,Embed),_defineProperty(this,"targetWindow",void 0),_defineProperty(this,"lazyLoading",void 0),_defineProperty(this,"type",void 0),_defineProperty(this,"id",void 0),_defineProperty(this,"iframe",void 0),_defineProperty(this,"element",void 0),_defineProperty(this,"mode",void 0),_defineProperty(this,"data",void 0),_defineProperty(this,"loaded",!1),_defineProperty(this,"instance",void 0),_defineProperty(this,"questionViewTriggered",!1),_defineProperty(this,"url",void 0),_defineProperty(this,"autoplay",null),_defineProperty(this,"nativeAd",null),_defineProperty(this,"pendings",{}),_defineProperty(this,"pendingPostMessages",[]),_defineProperty(this,"loadDataSet",!1),_defineProperty(this,"widgetIndex",void 0),_defineProperty(this,"stats",void 0),this.element=t,this.targetWindow=e.location,this.type=e.type,this.mode=e.mode,this.data=e,this.stats=n,this.id=generateId(e),this.widgetIndex=window.Pinpoll.embed.initedEmbeds,window.Pinpoll.embed.initedEmbeds+=1,this.lazyLoading="eager"!==e.loading&&"preload"!==e.loading,this.data.native)return this.loadNative(t,e).then((function(t){if(t){t.targetId=i.id,i.instance=t,i.instance.promises.preload?i.instance.promises.preload.then((function(){return i.stats.markLoad()})):i.stats.markLoad();var n=!1;i.instance.on("poll:initialized","global.js - statTracker",(function(){var e;n||(n=!0,i.stats.markRender(),i.stats.observeImpression((null===(e=i.instance)||void 0===e?void 0:e.container)||i.element))})),i.instance.on("poll:initialized","global.js",(function(){var n,o;t.elementId&&(e.id=+t.elementId,(0,_tracking_module__WEBPACK_IMPORTED_MODULE_2__.Z)(t.visitorStorage,{widgetIndex:"e"+(null!==(n=null===(o=window.Pinpoll.embed)||void 0===o?void 0:o.embeds.findIndex((function(e){return e===i})))&&void 0!==n?n:0),originPage:e.url,widgetLocation:buildUrl(e,t.targetId||"")}).start())}))}})).catch((function(e){console.error("Pinpoll: error during loading native embed",e)})),void this.registerEventListener();this.iframe=buildIframe(e,this.id),this.lazyLoading?(this.iframe.setAttribute("class","lazyload"),document.addEventListener("lazybeforeunveil",(function e(t){t.target===i.iframe&&((0,_module__WEBPACK_IMPORTED_MODULE_0__.oW)(i.data,i.element),i.url=buildUrl(i.data,i.id),i.iframe.setAttribute("data-src",
5455i.url),i.stats.markLoad(),document.removeEventListener("lazybeforeunveil",e))})),document.addEventListener("lazyloaded",(function e(t){t.target===i.iframe&&(i.loaded=!0,i.stats.markRender(),i.stats.observeImpression(i.iframe),document.removeEventListener("lazyloaded",e))}))):(this.loaded=!0,this.stats.markLoad(),this.url=buildUrl(e,this.id),this.iframe.src=this.url),this.registerEventListener(),t.parentNode===document.getElementsByTagName("head")[0]?document.body.appendChild(this.iframe):t.parentElement?t.parentElement.insertBefore(this.iframe,t):document.body.appendChild(this.iframe),this.lazyLoading||(this.stats.markRender(),this.stats.observeImpression(this.iframe))}return _createClass(Embed,[{key:"loadNative",value:function(e,t){if(!window.Pinpoll.nativeLoader){var n=document.createElement("script");n.async=!0,n.type="module",n.innerHTML="window.Pinpoll.nativeLoader = async (embedElement, options) => {\n const { createEmbed } = await import('".concat("https://tools.pinpoll.com/embed-v2/main.js?v=1790061720894","');\n return createEmbed(embedElement, options);\n }"),document.head.appendChild(n)}return new Promise((function(n){!function i(){if("function"==typeof window.Pinpoll.nativeLoader)return n(window.Pinpoll.nativeLoader(e,t));setTimeout(i,100)}()}))}},{key:"loadNextEmbed",value:function(){if(this.autoplay){var e;this.autoplay.currentIndex=this.autoplay.currentIndex||0;var t=null===(e=this.autoplay.nextAutoplayedElements)||void 0===e?void 0:e[this.autoplay.currentIndex++];t&&this.loadEmbedItem(t)}}},{key:"registerEventListener",value:function(){var e=this;window.addEventListener("message",(function(t){var n,i,o=t.data;try{if("string"==typeof o){if(!o.startsWith("{"))return!1;o=JSON.parse(o)}}catch(e){console.warn(e)}if(o&&"object"===_typeof(o)&&o.action)if("vote"===o.action||"unvote"===o.action)-1!==navigator.appName.indexOf("Internet Explorer")&&-1===navigator.appVersion.indexOf("MSIE 1")&&(o=JSON.stringify(o)),null!==(n=e.iframe)&&void 0!==n&&n.contentWindow||(e.iframe=document.getElementById(e.id)),null===(i=e.iframe.contentWindow)||void 0===i||i.postMessage(o,e.targetWindow);else if(o.target===e.id)switch(o.action){case"get:loaddata":e.setLoadData();break;case"set:height":e.data.height||e.setEmbedHeight(o.value);break;case"get:recaptcha":e.activateRecaptcha(o.top,o.sitekey);break;case"poll-view:finished":e.questionViewTriggered=!0;break;case"autoplay:check":var a;e.initAutoplay(),e.autoplay&&(null===(a=e.autoplay.loadPromise)||void 0===a||a.then((function(){var t,n,i,o;null!==(t=e.autoplay)&&void 0!==t&&null!==(n=t.nextAutoplayedElements)&&void 0!==n&&n.length&&e.autoplay.nextAutoplayedElements[e.autoplay.currentIndex||0]&&(null===(i=e.iframe)||void 0===i||null===(o=i.contentWindow)||void 0===o||o.postMessage({action:"autoplay:ready"},"*"))})));break;case"autoplay:fire":e.loadNextEmbed();break;case"update:visitor":window.Pinpoll.storage.visitor=o.visitor;break;case"native-ad:set":(0,_utils_adBlockCheck__WEBPACK_IMPORTED_MODULE_3__.I)().finally((function(){var t;if(window.Pinpoll.userHasAdblock&&1===(null===(t=o.adConfig)||void 0===t?void 0:t.type))return console.warn("Pinpoll Native Ad: AdBlock detected, no native ad will be shown");e.setNativeAd(o.adTag,o.adConfig),e.nativeAd&&e.pendings.nativeinterstitial&&(e.nativeAd.onInterstitialStart(""+e.pendings.nativeinterstitial),e.pendings.nativeinterstitial=null)}));break;case"interstitial-start":e.nativeAd?e.nativeAd.onInterstitialStart(o.ad.duration):e.pendings.nativeinterstitial=o.ad.duration}}))}}
5455,{key:"setLoadData",value:function(){var e,t=this;if(null!==(e=this.iframe)&&void 0!==e&&e.contentWindow){var n,i,o={embed_url:this.url,visitor:window.Pinpoll.storage.visitor,trackingDone:null===(n=window.Pinpoll.tracking)||void 0===n?void 0:n.requestDone,cookieEnabled:navigator.cookieEnabled,originPage:this.data.url,path:window.location.pathname,fallback_id:this.data.fallback_id,autoplayedElementId:this.data.autoplayedElementId,cssClass:this.data.cssClass,parent_id:this.id,autoplayDelay:this.data.autoplayDelay};for(["consent","targetAds","customURL","ppId"].forEach((function(e){t.data[e]&&(o[e]=t.data[e])})),window.Pinpoll.appName&&(o.app=window.Pinpoll.appName),this.loadDataSet||void 0===this.widgetIndex||(o.widgetIndex="e"+this.widgetIndex),null===(i=this.iframe)||void 0===i||i.contentWindow.postMessage({action:"set:loaddata",data:o},"*"),this.loadDataSet=!0;this.pendingPostMessages.length;){var a=this.pendingPostMessages.shift();a&&this.postMessage(a)}}}},{key:"setNativeAd",value:function setNativeAd(adTag,adConfig){var _this4=this;if(adTag)if(this.nativeAd)this.nativeAd.handle("reinitialized",{adTag,adConfig})||this.nativeAd.show();else{var _ref,_this$instance2,container=document.createElement("div");container.setAttribute("style","position:relative;"),null===(_ref=this.iframe||(null===(_this$instance2=this.instance)||void 0===_this$instance2?void 0:_this$instance2.container))||void 0===_ref||_ref.after(container);var script=document.createElement("script");script.adData={config:adConfig,embed:this},script.innerText=adTag,container.append(script),this.nativeAd={script,container,handle:function handle(handlerName,params){return!!_this4.nativeAd&&!!_this4.nativeAd.script.adData.config[handlerName]&&(eval(String(_this4.nativeAd.script.adData.config[handlerName]))(params),!0)},hide:function(){_this4.nativeAd&&(_this4.nativeAd.handle("hide")||(_this4.nativeAd.container.style.visibility="hidden"),_this4.nativeAd.handle("hidden"))},show:function(){_this4.nativeAd&&(_this4.nativeAd.handle("show")||(_this4.nativeAd.container.style.visibility="visible"),_this4.nativeAd.handle("shown"))},onInterstitialStart:function(e){var t,n,i;null!==(t=_this4.nativeAd)&&void 0!==t&&t.handle("interstitialStart",{duration:e})||(null===(i=_this4.nativeAd)||void 0===i||i.hide(),setTimeout((function(){var e,t,n;(null===(e=_this4.nativeAd)||void 0===e?void 0:e.handle("interstitialStop"))||null===(t=_this4.nativeAd)||void 0===t||t.show(),null===(n=_this4.nativeAd)||void 0===n||n.handle("interstitialStopped")}),1e3*+e)),null===(n=_this4.nativeAd)||void 0===n||n.handle("interstitialStarted")}},this.nativeAd.handle("initialized",{adConfig})}}},{key:"loadEmbedItem",value:function(e){var t,n;this.iframe&&e&&(this.data.id=e.element_id,e.id&&(this.data.fallback_id=e.id),e.element_id&&(this.data.autoplayedElementId=e.element_id),e.custom_design_id&&(this.data.design=e.custom_design_id),null===(t=this.nativeAd)||void 0===t||t.hide(),this.id=generateId(this.data),this.url=buildUrl(this.data,this.id),null===(n=this.iframe)||void 0===n||n.setAttribute("id",this.id),this.iframe.src=this.url)}},{key:"setEmbedHeight",value:function(e){if(e&&parseFloat(e)){var t=document.getElementById(this.id);t&&(t.setAttribute("height",e),t.setAttribute("style","display:block;height:".concat(parseFloat(e),"px!important;")))}}},{key:"activateRecaptcha",value:function(e,t){var n=this,i=function(e){var i,o,a,r,l,s=document.createElement("div"),d=document.createElement("div");window.grecaptcha.render(d,{sitekey:t,callback:function(e){var t,i;null===(t=n.iframe)||void 0===t||null===(i=t.contentWindow)||void 0===i||i.postMessage({action:"recaptcha:success",response:e},n.targetWindow),s.style.opacity="0",s.style.transform="translateY(20px)",window.setTimeout((function(){var e;null==s||null===(e=s.parentNode)||void 0===e||e.removeChild(s)}),400)}}),s.appendChild(d),s.setAttribute("style","-webkit-transition:opacity .4s,-webkit-transform .4s;transition:opacity .4s,-webkit-transform .4s;transition:opacity .4s,transform .4s;transition:opacity .4s,transform .4s,-webkit-transform .4s;-webkit-transform:translateY(20px);transform:translateY(20px)"),s.style.position="absolute",s.style.width="".concat(null===(i=n.iframe)||void 0===i?void 0:i.offsetWidth,"px"),s.style.left="".concat(null===(o=n.iframe)||void 0===o?void 0:o.offsetLeft,"px"),s.style.top="".concat((null===(a=n.iframe)||void 0===a?void 0:a.offsetTop)||0+e,"px"),s.style["text-align"]="answer"!=n.type?"center":"left",d.style.display="inline-block",d.style.margin="answer"!=n.type?"0 0 0 12%":"0 0 0 8em",s.style.opacity="0",window.setTimeout((function(){s.style.opacity="1",s.setAttribute("style",s.getAttribute("style").replace("translateY(20px)","translateY(0)"))}),1),null===(r=n.iframe)||void 0===r||null===(l=r.parentNode)||void 0===l||l.insertBefore(s,n.iframe.nextSibling)};if(window.grecaptcha)i(e);
5455else{var o="recaptcha_".concat(this.id),a=document.createElement("script");a.src="https://www.google.com/recaptcha/api.js?onload=".concat(o,"&render=explicit"),a.async=!0,a.defer=!0,window[o]=function(){i(e)},document.head.appendChild(a)}}},{key:"postMessage",value:function(e){var t,n;this.loadDataSet?null===(t=this.iframe)||void 0===t||null===(n=t.contentWindow)||void 0===n||n.postMessage(e,this.targetWindow):this.pendingPostMessages.push(e)}},{key:"initPreload",value:function(){(0,_module__WEBPACK_IMPORTED_MODULE_0__.oW)(this.data,this.element);var e=this.instance;if(e)e.dispatch("poll:initPreload",e);else{var t=_objectSpread(_objectSpread({},this.data),{},{fallbackElementsPromise:void 0});this.postMessage({action:"preload:init",data:t})}"preload"===this.data.loading&&(this.data.loading="eager")}},{key:"reload",value:function(){this.iframe&&(this.iframe.src=buildUrl(this.data,this.id))}},{key:"loadAutoplayedElements",value:function(e){var t=this;this.autoplay&&(this.autoplay.loadPromise=_async((function(){return _invokeIgnored((function(){if(t.autoplay)return _await(loadAutoplayList(t.data,t.autoplay.elementId,e||t.autoplay.limit,t.iframe),(function(e){t.autoplay.nextAutoplayedElements=e,t.data.id||t.loadNextEmbed()}))}))}))())}},{key:"initAutoplay",value:function(){this.autoplay||void 0===this.data.autoplay||(this.autoplay={nextAutoplayedElements:void 0,limit:this.data.autoplay,elementId:this.data.id},this.loadAutoplayedElements())}}]),Embed}();function generateId(e){return"pinpoll_".concat(e.type,"_").concat(e.id,"_").concat(e.mode)}function buildIframe(e,t){var n;switch(e.type){case"quiz":n=500;break;case"answer":n=50;break;default:n=0}var i=document.createElement("iframe");i.setAttribute("title","Pinpoll Widget"),i.setAttribute("frameborder","0"),i.setAttribute("scrolling","no"),i.setAttribute("width","100%"),i.setAttribute("id",t),i.setAttribute("name",window.location.toString()),i.setAttribute("style","display:block; height:"+e.height||0);var o=e.height||n;return o&&i.setAttribute("height",o.toString()),i}function buildUrl(e,t){var n,i=!1,o="";e.styles&&(o+=e.styles),e.height&&(o+="".concat(o.length>0?"&":"","height=").concat(e.height)),e.trackmode&&"preview"===e.trackmode&&(o+="".concat(o.length>0?"&":"","previewMode=1")),e.simulate&&"on"===e.simulate&&(o+="".concat(o.length>0?"&":"","simulate=1")),e.editmode&&"on"===e.editmode&&(o+="".concat(o.length>0?"&":"","editMode=1"),i=!0),e.randomQuestions&&(o+="".concat(o.length>0?"&":"","randomQuestions=1")),e.randomAnswers&&(o+="".concat(o.length>0?"&":"","randomAnswers=1")),"preload"===e.loading&&(o+="".concat(o.length>0?"&":"","preloadMode=1")),e.blockAds&&(o+="".concat(o.length>0?"&":"","blockAds=1")),e.info&&Object.keys(e.info).length&&(o+="".concat(o.length>0?"&":"","info=").concat(encodeURIComponent(JSON.stringify(e.info)))),t&&(o+="".concat(o.length>0?"&":"","parentID=").concat(encodeURIComponent(t)));var a="";if(e.version)return"".concat(e.location,"/embed/").concat(e.version,"?id=").concat(e.id).concat(o?"&".concat(o):"");switch(e.type){case"answer":n="".concat(e.location,"/embed/answer/").concat(e.id).concat(o?"?".concat(o):"");break;default:"result"===e.mode&&(a+="/result"),n="".concat(e.location||"","/").concat(i?"direct/":"","embed/").concat("aipoll"===e.mode?"inspire/":"").concat(e.id).concat(a),e.design&&(n+="/cd/"+e.design),n+=o?"?".concat(o):""}return n}},631:(e,t,n)=>{"use strict";n.d(t,{ZP:()=>g,oW:()=>v});var i=n(768);function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function r(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var l=["served","loads","renders","impressions"],s=new Set(["url","ppid","class","consent","style","opointdata","rect_data","bis_style"]),d=["target-ads-","_","font-"],c=function(){function e(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:500;o(this,e),r(this,"endpoint",void 0),r(this,"flushDelayMs",void 0),r(this,"url",void 0),r(this,"embedcode",void 0),r(this,"stage",-1),r(this,"sentStage",-1),r(this,"flushTimer",null),r(this,"flushing",!1),r(this,"impressionObserver",void 0),this.endpoint=this.resolveEndpoint(),this.flushDelayMs=i,this.url=n,this.embedcode=this.buildEmbedcode(t),this.registerLifecycleFlush()}var t,n;return t=e,(n=[{key:"markServed",value:function(){this.mark("served")}},{key:"markLoad",value:function(){this.mark("loads")}},{key:"markRender",value:function(){this.mark("renders")}},{key:"markImpression",value:function(){var e=this.stage;this.mark("impressions",!1),this.stage>e&&(null!==this.flushTimer&&(window.clearTimeout(this.flushTimer),this.flushTimer=null),this.flush(!1))}},{key:"observeImpression",value:function(e){var t=this;this.stage>=l.indexOf("impressions")||("IntersectionObserver"in window?(this.impressionObserver||(this.impressionObserver=new IntersectionObserver((function(e){e.forEach((function(e){var n;e.isIntersecting&&e.intersectionRatio>=.5&&(t.markImpression(),null===(n=t.impressionObserver)||void 0===n||n.disconnect())}
5455))}),{threshold:[.5]})),this.impressionObserver.observe(e)):this.markImpression())}},{key:"resolveEndpoint",value:function(){var e="https://api.embed.pinpoll.com";return"".concat(e.replace(/\/+$/,""),"/v3/widget")}},{key:"buildEmbedcode",value:function(e){var t=this,n={};Array.from(e.attributes).sort((function(e,t){return e.name.localeCompare(t.name)})).forEach((function(e){var i=t.normalizeAttrName(e.name);!i||s.has(i)||d.some((function(e){return i.startsWith(e)}))||void 0!==n[i]||(n[i]=e.value)}));var i={};return Object.keys(n).sort().forEach((function(e){i[e]=n[e]})),JSON.stringify(i)}},{key:"normalizeAttrName",value:function(e){return e.startsWith("data-pinpoll-")?e.substring(13):e.startsWith("data-")?e.substring(5):e}},{key:"advance",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=l.indexOf(e);if(!(n<=this.stage)){if(n>this.stage+1)for(var i=this.stage+1;i<n;i++){var o=l[i];console.warn('Pinpoll: automatically marked skipped stage "'.concat(o,'" for embed ').concat(this.embedcode))}this.stage=n,t&&this.scheduleFlush()}}},{key:"scheduleFlush",value:function(){var e=this;this.endpoint&&(null!==this.flushTimer&&window.clearTimeout(this.flushTimer),this.flushTimer=window.setTimeout((function(){e.flushTimer=null,e.flush(!1)}),this.flushDelayMs))}},{key:"hasPending",value:function(){return this.stage>this.sentStage}},{key:"buildPayloadRow",value:function(e,t){var n=function(n){var i=l.indexOf(n);return i>e&&i<=t?1:0};return{url:this.url,embedcode:this.embedcode,served:n("served"),loads:n("loads"),renders:n("renders"),impressions:n("impressions")}}},{key:"flush",value:function(e){var t=this;if(this.endpoint&&this.hasPending()&&!this.flushing){var n=this.stage,i=this.buildPayloadRow(this.sentStage,n);if(i.served+i.loads+i.renders+i.impressions!==0){var o=i;e&&navigator.sendBeacon?navigator.sendBeacon(this.endpoint,new Blob([JSON.stringify(o)],{type:"application/json"}))&&(this.sentStage=Math.max(this.sentStage,n)):(this.flushing=!0,fetch(this.endpoint,{method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},credentials:"include",keepalive:e,body:JSON.stringify(o)}).then((function(){t.sentStage=Math.max(t.sentStage,n)})).catch((function(){})).finally((function(){t.flushing=!1,t.hasPending()&&t.scheduleFlush()})))}}}},{key:"mark",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];this.advance(e,t)}},{key:"registerLifecycleFlush",value:function(){var e=this;window.addEventListener("pagehide",(function(){return e.flush(!0)})),document.addEventListener("visibilitychange",(function(){"hidden"===document.visibilityState&&e.flush(!0)}))}}])&&a(t.prototype,n),e}();function u(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=p(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,r=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return r=e.done,e},e:function(e){l=!0,a=e},f:function(){try{r||null==n.return||n.return()}finally{if(l)throw a}}}}function p(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}var m={1:"poll",2:"quiz",6:"personality_test"};function h(e){var t,n,i=e.getAttribute("data-pinpoll-location")||e.getAttribute("data-location")||"https://embed.pinpoll.com",o=e.getAttribute("data-design");return{type:e.getAttribute("data-pinpoll-type")||e.getAttribute("data-type")||"poll",aiPollMode:"aipoll"===e.getAttribute("data-mode"),version:e.getAttribute("data-version"),native:null!==e.getAttribute("data-native")||"v2"===e.getAttribute("data-version"),mode:e.getAttribute("data-pinpoll-mode")||e.getAttribute("data-mode")||"poll",location:i,trackmode:e.getAttribute("data-pinpoll-trackmode")||e.getAttribute("data-trackmode")||"default",editmode:e.getAttribute("data-pinpoll-editmode")||e.getAttribute("data-editmode")||"default",simulate:e.getAttribute("data-pinpoll-simulate")||e.getAttribute("data-simulate")||"default",id:parseInt(e.getAttribute("data-pinpoll-id")||e.getAttribute("data-id"),10)||0,height:parseInt(e.getAttribute("data-pinpoll-height")||e.getAttribute("data-height"),10)||0,label:e.getAttribute("data-pinpoll-label")||e.getAttribute("data-label")||"",bgcolor:e.getAttribute("data-pinpoll-bgcolor")||e.getAttribute("data-bgcolor")||"#2395a6",styles:function(){var t,n=/data(?:-pinpoll)?-style-(.+)/,i=[],o=u(e.attributes);try{for(o.s();!(t=o.n()).done;){var a=t.value,r=a.name.match(n);r&&i.push("".concat(encodeURIComponent(r[1]),"=").concat(encodeURIComponent(a.value)))}}catch(e){o.e(e)}finally{o.f()}return!!i.length&&i.join("&")}(),loading:e.getAttribute("data-loading")||!1,design:o?+o:null,randomQuestions:null!==e.getAttribute("random-questions"),randomAnswers:null!==e.getAttribute("random-answers"),forceLoad:null!==e.getAttribute("force-load"),cssClass:null===(t=e.getAttribute("data-css-class"))||void 0===t?void 0:t.trim(),customURL:null===(n=e.getAttribute("data-url"))||void 0===n?void 0:n.trim(),url:e.getAttribute("data-url")||(window.location.origin||"unknown_origin")+window.location.pathname,info:e.getAttributeNames().reduce((function(t,n){return n.startsWith("data-info-")&&(t[n.substring(10)]=e.getAttribute(n)),t}),{}),targetAds:e.getAttributeNames().reduce((function(t,n){return n.startsWith("data-target-a
5455ds-")&&(t[n.substring(16)]=e.getAttribute(n)),t}),{}),autoplay:[null,"false"].includes(e.getAttribute("data-autoplay"))?void 0:+(e.getAttribute("data-autoplay")||0),autoplayDelay:[null,""].includes(e.getAttribute("data-autoplay-delay"))?void 0:+(e.getAttribute("data-autoplay-delay")||0),mqeDelay:[null,""].includes(e.getAttribute("data-mqe-delay"))?void 0:+(e.getAttribute("data-mqe-delay")||0),blockAds:![null,"false","0"].includes(e.getAttribute("data-block-ads")),topic:e.getAttribute("data-topic"),ppId:e.getAttribute("data-ppid"),consent:e.getAttribute("data-consent"),muteVoted:![null,"false","0"].includes(e.getAttribute("data-mute-voted"))}}function v(e,t){var n,i=h(t);Object.assign(e,i,{id:i.id||e.id,design:null!==(n=i.design)&&void 0!==n?n:e.design})}const g=function(){return{embeds:[],initedEmbeds:0,fallbackElementsPromise:{},isElementAlreadyEmbedded:function(e,t,n){var i=t?m[t]:null;try{var o=['[data-pinpoll-id="'.concat(e,'"]'),'script[data-location*="'.concat(n||"pinpoll.com",'"][data-id="').concat(e,'"]')],a=i?o.map((function(e){return"".concat(e,":not([data-type]), ").concat(e,'[data-type="').concat(i,'"]')})).join(", "):o.join(", ");return!!document.body.querySelector(a)||!!this.embeds.find((function(t){var n,i,o;return(null===(n=t.data)||void 0===n?void 0:n.id)===e&&("poll"===(null===(i=t.data)||void 0===i?void 0:i.type)||"aipoll"===(null===(o=t.data)||void 0===o?void 0:o.type))}))}catch(e){return!1}},isAnyElementEmbedded:function(){return!!this.embeds.find((function(e){return"aipoll"!==e.mode}))||!!document.body.querySelector('[data-pinpoll-id]:not([data-mode="aipoll"]), script[data-location*="'.concat("pinpoll.com",'"][data-id]'))},getElementVotedStatus:function(e){var t,n,i=e.questions,o=e.multiple_vote_interval,a=null===(t=window.Pinpoll)||void 0===t||null===(n=t.storage)||void 0===n?void 0:n.votes;if(i&&a){var r=a.filter((function(e){return i.includes(e.question_id)}));if(null!=r&&r.length)return!o||r.find((function(e){return e.voted_at+o>(new Date).getTime()}))?2:1}return 0},sortPreferredAutoEmbeddedElements:function(e,t,n){var i=this,o=t.location,a=t.muteVoted,r=t.height,l=[];if(e){var s,d;if(l=e.filter((function(e){return!i.isElementAlreadyEmbedded(e.element_id,e.type_id,o)})),null!==(s=window.Pinpoll)&&void 0!==s&&s.appName&&(l=l.filter((function(e){return 1===e.type_id&&2===e.max_answers}))),null!==(d=window.Pinpoll)&&void 0!==d&&d.heightFilterActive&&r){var c=n&&n.parentNode!==document.getElementsByTagName("head")[0]&&n.parentElement?n.clientWidth:document.body.clientWidth;l=l.filter((function(e){try{var t=JSON.parse(e.height),n=Math.max.apply(Math,function(e){if(Array.isArray(e))return f(e)}(i=Object.keys(t).map(Number).filter((function(e){return e<=c})))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(i)||p(i)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());if(t[n])return parseInt(t[n])<=r}catch(e){return!1}var i}))}a?l=l.filter((function(e){return 2!==i.getElementVotedStatus(e)})):l.length&&void 0===l[0].sort&&(l=l.sort((function(e,t){var n=i.getElementVotedStatus(e),o=i.getElementVotedStatus(t);return n===o?0:n<o?-1:1})))}return l},getFallbackElements:function(e,t){var n=t+e;if(!this.fallbackElementsPromise[n]){var i={url:e};t&&(i.topic=t),this.fallbackElementsPromise[n]=fetch("https://api.embed.pinpoll.com/aipolls/search?"+new URLSearchParams(i),{method:"GET"}).then((function(e){return e.json()})).then((function(e){return e})).catch((function(e){console.log("Pinpoll: error during fetching aipolls",e)}))}return this.fallbackElementsPromise[n]},initEmbed:function(e){var t=this;if(!this.embeds.find((function(t){return t.element===e}))){var n=h(e),o=new c(e,n.url);e.classList.add("loaded"),o.markServed(),n.id&&!n.native?this.embeds.push(new i.Z(n,e,o)):new Promise((function(t){"eager"!==n.loading&&"preload"!==n.loading?(e.classList.add("lazyload"),new Promise((function(t){document.addEventListener("lazybeforeunveil",(function(n){n.target===e&&t()}))})).finally((function(){t()}))):t()})).then((function(){v(n,e),n.native?t.embeds.push(new i.Z(n,e,o)):n.aiPollMode||n.topic?n.forceLoad||!t.isAnyElementEmbedded()?new Promise((function(e){n.aiPollMode?(o.markLoad(),fetch("https://api.embed.pinpoll.com/aipolls/first?"+new URLSearchParams({url:n.url}),{method:"GET"}).then((function(e){return e.json()})).then((function(t){n.id=t.id,e()})).catch((function(t){console.log("Pinpoll: error during fetching aipoll",t),e()}))):e()})).finally((function(){n.id?t.embeds.push(new i.Z(n,e,o)):(n.aiPollMode&&!n.topic||!n.aiPollMode&&n.topic)&&(o.markLoad(),n.fallbackElementsPromise=t.getFallbackElements(n.url,n.topic).then((function(a){var r,l=a.elements;n.fallbackElements=t.sortPreferredAutoEmbeddedElements(l,n,e);var s=null===(r=n.fallbackElements)||void 0===r?void 0:r.shift();s?(n.id=s.element_id,!n.design&&s.custom_design_id&&(n.design=s.custom_design_id),n.fallback_id=s.id,t.embeds.push(new i.Z(n,e,o))):console.log("Pinpoll: no suitable element found for",e)})))})):console.log("Pinpoll: not embedding as another element is already embedded",e):console.log("Pinpoll: no id or data specified for element",e)}))}},start:function(){var e=this;window.MutationObserver=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;var t=function(){var t,n=u(document.querySelectorAll("div[data-pinpoll-id]:not(.loaded), div.pinpoll:not(.loaded)"));try{for(n.s();!(t=n.n()).done;){var i=t.value;e.initEmbed(i)}}catch(e){n.e(e)}finally{n.f()}};t();var n=window.setInterval((function(){t()}),500);window.MutationObserver&&(window.setTimeout((function(){window.clearInterval(n)}),1e4),new window.MutationObserver((function(t){t.forEach((function(t){var n,i=u(t.addedNodes);try{for(i.s();!(n=i.n()).done;){var o=n.value;o.matches&&o.matches("div[data-pinpoll-id]:not(.loaded), div.pinpoll:not(.loaded)")&&e.initEmbed(o)}}catch(e){i.e(e)}finally{i.f()}}))})).observe(document,{childList:!0,subtree:!0}))},broadcast:function(e){var t,n=u(this.embeds);try{for(n.s();!(t=n.n()).done;)t.value.postMessage(e)}catch(e){n.e(e)}finally{n.f()}}}}},726:()=>{function e(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function t(t){for(var i=1;i<arguments.length;i++){var o=null!=arguments[i]?arguments[i]:{};
5455i%2?e(Object(o),!0).forEach((function(e){n(t,e,o[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):e(Object(o)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(o,e))}))}return t}function n(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e){var t=window.Pinpoll.storage.votes;t||(t=[]),-1===t.findIndex((function(t){return t.answer_id===e.answer_id&&t.voted_at===e.voted_at}))&&t.push(e),window.Pinpoll.storage.votes=t}window.addEventListener("message",(function(e){var n=e.data;try{if("string"==typeof n){if(!n.startsWith("{"))return!1;n=JSON.parse(n)}}catch(e){console.warn(e)}var a=function(t){e.source&&e.source.postMessage(t,e.origin)};if(n&&"object"===i(n)&&n.action)switch(n.action){case"get:visitor-votes":a({action:"return:visitor-votes",data:window.Pinpoll.storage.votes.map((function(e){return t(t({},e),{},{justVoted:!!window.Pinpoll.votelinkVotes.find((function(t){return t.answer_id===e.answer_id&&t.voted_at===e.voted_at}))})}))});break;case"add:visitor-vote":o(n.data);break;case"remove:visitor-vote":var r=window.Pinpoll.storage.votes,l=n.data,s=l.questionId,d=l.answerId;if(r){var c=r.filter((function(e){return(e.question_id||e.poll_id)!==s||e.answer_id!==d}));window.Pinpoll.storage.votes=c}break;case"remove:visitor-vote-element":var u=window.Pinpoll.storage.votes,p=n.data.questionIds;if(u){var f=u.filter((function(e){return!p.some((function(t){return t===e.question_id}))}));window.Pinpoll.storage.votes=f}break;case"add":var m=n.key;if(!m)break;var h=window.Pinpoll.storage[m];if(!h)break;if(!(h instanceof Array))break;h.push(n.value),window.Pinpoll.storage[m]=h;break;case"get":var v=n.key;if(!v)break;a({action:"return:"+v,data:{key:v,value:window.Pinpoll.storage[v]}})}return null})),function(){var e=new URL(window.location.href),t=e.searchParams.get("pinpoll_votes");if(t){var n;try{n=JSON.parse(t)}catch(e){console.warn("Pinpoll: Failed parsing pinpoll_votes GET parameter")}n&&n instanceof Array&&n.forEach((function(e){o(e),window.Pinpoll.votelinkVotes.push(e)}));try{e.searchParams.delete("pinpoll_votes"),window.history.pushState({},document.title,e.toString())}catch(e){}}}()},558:(e,t,n)=>{"use strict";n.d(t,{Z:()=>d});var i=n(38),o=n(58),a=n(173);function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const d=function(e,t){var n=t||{},d=n.widgetIndex,c=n.originPage,u=n.widgetLocation,p={},f=(0,i.G)({BASE_DOMAIN:"pinpoll.com",CDN_ENDPOINT:"https://static.pinpoll.com",API_ENDPOINT:"https://pa.pinpoll.com/v1",cookiesEnabled:function(){if(navigator.cookieEnabled)return!0;document.cookie="cookietest=1";var e=-1!==document.cookie.indexOf("cookietest=");return document.cookie="cookietest=1; expires=Thu, 01-Jan-1970 00:00:01 GMT",e}(),thirdPartyCookiesEnabled:!1,tcfApi:{},requestSent:!1,requestDone:!1,start:function(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",m):m(),e&&(p=e)}});function m(){window.setTimeout((function(){Promise.all([(0,a.I)(),window.location.hostname.match(f.BASE_DOMAIN)?Promise.resolve():new Promise((function(e){try{var t=document.createElement("iframe");t.style.display="none",t.title="Pinpoll Third Party Cookie Test",t.src="".concat(f.CDN_ENDPOINT,"/static/start.html"),window.addEventListener("message",(function(t){"MM:3PCunsupported"===t.data?f.thirdPartyCookiesEnabled=!1:"MM:3PCsupported"===t.data&&(f.thirdPartyCookiesEnabled=!0),e()}),!1),document.body.appendChild(t),window.setTimeout((function(){t.remove(),e()}),5e3)}catch(t){f.log("Could not check ThirdPartyCookiesEnabled",t),e()}})),window.ppTcString?(f.tcfApi.tcString=window.ppTcString,f.tcfApi.available=!!window.__tcfapi,Promise.resolve()):window.__tcfapi?(f.tcfApi.available=!0,new Promise((function(e){var t=(new Date).getTime();window.__tcfapi("addEventListener",2,(function(n,i){f.tcfApi.responseTime=(new Date).getTime()-t,i?f.tcfApi.tcString=n.tcString:f.log("tcf api responded with error",n),f.tcfApi.timeout||(f.tcfApi.timeout=!1),f.tcfApi.checkFinished=!0,e()})),window.setTimeout((function(){f.tcfApi.checkFinished||(f.tcfApi.timeout=!0,e())}),1e3)}))):(f.tcfApi.available=!1,Promise.resolve())]).then((function(){var t,n;t=u?function(){try{return new URL(u)}catch(e){return f.log("Could not parse widget location",e),document.location}}():document.location,n=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};
5455t%2?l(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({timezone:(new Date).getTimezoneOffset(),adblock:window.Pinpoll.userHasAdblock?1:0,dnt:window.navigator.doNotTrack,cookiesEnabled:f.cookiesEnabled?1:0,localStorageEnabled:v(),thirdPartyCookiesEnabled:f.thirdPartyCookiesEnabled?1:0,referrer:c||document.referrer,title:document.title,tcString:f.tcfApi.tcString,tcfApiAvailable:f.tcfApi.available,location:{hash:t.hash,hostname:t.hostname,pathname:t.pathname,protocol:t.protocol,search:t.search},screen:{width:window.screen.width,height:window.screen.height,colorDepth:window.screen.colorDepth,orientation:window.screen.orientation?window.screen.orientation.type:null},metaTags:h(),widgetIndex:d||""},p),(0,o.w)(f.API_ENDPOINT,n,e).then((function(t){var n,i,o=t.headers.get("PP-Visitor");o&&(e.visitor=o,null===(n=window.Pinpoll)||void 0===n||null===(i=n.embed)||void 0===i||i.broadcast({action:"global:trackingDone",visitor:o}))})).catch((function(e){var t,n;f.log("fetch request failed",e),null===(t=window.Pinpoll)||void 0===t||null===(n=t.embed)||void 0===n||n.broadcast({action:"global:trackingDone"})})).finally((function(){f.requestDone=!0}))}))}))}function h(){var e,t={},n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return r(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,o=function(){};return{s:o,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,a=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw a}}}}(document.getElementsByTagName("meta"));try{for(n.s();!(e=n.n()).done;){var i=e.value,o=i.getAttribute("name")||i.getAttribute("property"),a=i.getAttribute("content");if(o&&a&&o.replace(/\s/g,"").length>0){var l=o.trim().toLowerCase(),s=t[l];s?s instanceof Array?t[l].push(a):t[l]=[s,a]:t[l]=a}}}catch(e){n.e(e)}finally{n.f()}return t}function v(){var e="test";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}return f}},38:(e,t,n)=>{"use strict";function i(e){var t=e;return t.logs=[],t.log=function(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];t.logs.push([new Date,n])},t}n.d(t,{G:()=>i})},173:(e,t,n)=>{"use strict";function i(){var e;return void 0!==(null===(e=window.Pinpoll)||void 0===e?void 0:e.userHasAdblock)?Promise.resolve(window.Pinpoll.userHasAdblock):new Promise((function(e){var t=window.setTimeout((function(){var e;null!==(e=window.Pinpoll)&&void 0!==e&&e.userHasAdblock||n(!1)}),1e3),n=function(n){clearTimeout(t),window.Pinpoll=window.Pinpoll||{},window.Pinpoll.userHasAdblock=n,e(n)},i=document.createElement("div");i.innerHTML=" ",i.style.position="absolute",i.className="native-ad-container mobile-ad js-ad_iframe";try{document.body.appendChild(i)}catch(e){console.log("Could not check Adblock",e),n(!1)}window.setTimeout((function(){n(0===i.offsetHeight),i.remove()}),100)}))}n.d(t,{I:()=>i})},58:(e,t,n)=>{"use strict";function i(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"post",o={Accept:"application/json","Content-Type":"application/json"},a=n.visitor;return a&&(o["PP-Visitor"]=a),fetch(e,{method:i,headers:o,credentials:"include",body:JSON.stringify(t)})}n.d(t,{w:()=>i})},90:e=>{!function(t,n){var i=function(e,t,n){"use strict";var i,o;if(function(){var t,n={lazyClass:"lazyload",loadedClass:"lazyloaded",loadingClass:"lazyloading",preloadClass:"lazypreload",errorClass:"lazyerror",autosizesClass:"lazyautosizes",fastLoadedClass:"ls-is-cached",iframeLoadMode:0,srcAttr:"data-src",srcsetAttr:"data-srcset",sizesAttr:"data-sizes",minSize:40,customMedia:{},init:!0,expFactor:1.5,hFac:.8,loadMode:2,loadHidden:!0,ricTimeout:0,throttleDelay:125};for(t in o=e.lazySizesConfig||e.lazysizesConfig||{},n)t in o||(o[t]=n[t])}(),!t||!t.getElementsByClassName)return{init:function(){},cfg:o,noSupport:!0};var a,r,l,s,d,c,u,p,f,m,h,v,g,b,w,y,_,k,P,A,E,O,S,I,C,T,x,M,N,D,j,z,L,q,R,W,B,U,G,F,V,J,H,K,$=t.documentElement,Z=e.HTMLPictureElement,Y="addEventListener",X=e.addEventListener.bind(e),Q=e.setTimeout,ee=e.requestAnimationFrame||Q,te=e.requestIdleCallback,ne=/^picture$/i,ie=["load","error","lazyincluded","_lazyloaded"],oe={},ae=Array.prototype.forEach,re=function(e,t){return oe[t]||(oe[t]=new RegExp("(\\s|^)"+t+"(\\s|$)")),oe[t].test(e.getAttribute("class")||"")&&oe[t]},le=function(e,t){re(e,t)||e.setAttribute("class",(e.getAttribute("class")||"").trim()+" "+t)},se=function(e,t){var n;(n=re(e,t))&&e.setAttribute("class",(e.getAttribute("class")||"").replace(n," "))},de=function(e,t,n){var i=n?Y:"removeEventListener";n&&de(e,t),ie.forEach((function(n){e[i](n,t)}))},ce=function(e,n,o,a,r){var l=t.createEvent("Event");return o||(o={}),o.instance=i,l.initEvent(n,!a,!r),l.detail=o,e.dispatchEvent(l),l},ue=function(t,n){var i;!Z&&(i=e.picturefill||o.pf)?(n&&n.src&&!t.getAttribute("srcset")&&t.setAttribute("srcset",n.src),i({reevaluate:!0,elements:[t]})):n&&n.src&&(t.src=n.src)},pe=function(e,t){return(getComputedStyle(e,null)||{})[t]},fe=function(e,t,n){for(n=n||e.offsetWidth;n<o.minSize&&t&&!e._lazysizesWidth;)n=t.offsetWidth,t=t.parentNode;return n},me=(V=[],J=F=[],(K=function(e,n){U&&!n?e.apply(this,arguments):(J.push(e),G||(G=!0,(t.hidden?Q:ee)(H)))})._lsFlush=H=function(){var e=J;for(J=F.length?V:F,U=!0,G=!1;e.length;)e.shift()();U=!1},K),he=function(e,t){return t?function(){me(e)}:function(){var t=this,n=arguments;me((function(){e.apply(t,n)}))}},ve=function(e){var t,i,o=function(){t=null,e()},a=function(){var e=n.now()-i;e<99?Q(a,99-e):(te||o)(o)};return function(){i=n.now(),t||(t=Q(a,99))}},ge=(_=/^img$/i,k=/^iframe$/i,P="onscroll"in e&&!/(gle|ing)bot/.test(navigator.userAgent),0,A=0,E=0,O=-1,S=function(e){E--,(!e||E<0||!e.target)&&(E=0)},I=function(e){return null==y&&(y="hidden"==pe(t.body,"visibility")),y||!("hidden"==pe(e.parentNode,"visibility")&&"hidden"==pe(e,"visibility"))},C=function(e,n){var i,o=e,a=I(e);for(v-=n,w+=n,g-=n,b+=n;a&&(o=o.offsetParent)&&o!=t.body&&o!=$;)(a=(pe(o,"opacity")||1)>0)&&"visible"!=pe(o,"overflow")&&(i=o.getBoundingClientRect(),a=b>i.left&&g<i.right&&w>i.top-1&&v<i.bottom+1);return a},x=function(e){var t,i=0,a=o.throttleDelay,r=o.ricTimeout,l=function(){t=!1,i=n.now(),e()},s=te&&r>49?function(){te(l,{timeout:r}),r!==o.ricTimeout&&(r=o.ricTimeout)}:he((function(){Q(l)}),!0);return function(e){var o;(e=!0===e)&&(r=33),t||(t=!0,(o=a-(n.now()-i))<0&&(o=0),e||o<9?s():Q(s,o))}}(T=function(){var e,n,a,r,l,s,u,f,_,k,S,T,x=i.elements;if((p=o.loadMode)&&E<8&&(e=x.length)){for(n=0,O++;n<e;n++)if(x[n]&&!x[n]._lazyRace)if(!P||i.prematureUnveil&&i.prematureUnveil(x[n]))q(x[n]);else if((f=x[n].getAttribute("data-expand"))&&(s=1*f)||(s=A),k||(k=!o.expand||o.expand<1?$.clientHeight>500&&$.clientWidth>500?500:370:o.expand,i._defEx=k,S=k*o.expFactor,T=o.hFac,y=null,A<S&&E<1&&O>2&&p>2&&!t.hidden?(A=S,O=0):A=p>1&&O>1&&E<6?k:0),_!==s&&(m=innerWidth+s*T,h=innerHeight+s,u=-1*s,_=s),a=x[n].getBoundingClientRect(),(w=a.bottom)>=u&&(v=a.top)<=h&&(b=a.right)>=u*T&&(g=a.left)<=m&&(w||b||g||v)&&(o.loadHidden||I(x[n]))&&(c&&E<3&&!f&&(p<3||O<4)||C(x[n],s))){if(q(x[n]),l=!0,E>9)break}else!l&&c&&!r&&E<4&&O<4&&p>
54552&&(d[0]||o.preloadAfterLoad)&&(d[0]||!f&&(w||b||g||v||"auto"!=x[n].getAttribute(o.sizesAttr)))&&(r=d[0]||x[n]);r&&!l&&q(r)}}),N=he(M=function(e){var t=e.target;t._lazyCache?delete t._lazyCache:(S(e),le(t,o.loadedClass),se(t,o.loadingClass),de(t,D),ce(t,"lazyloaded"))}),D=function(e){N({target:e.target})},j=function(e,t){var n=e.getAttribute("data-load-mode")||o.iframeLoadMode;0==n?e.contentWindow.location.replace(t):1==n&&(e.src=t)},z=function(e){var t,n=e.getAttribute(o.srcsetAttr);(t=o.customMedia[e.getAttribute("data-media")||e.getAttribute("media")])&&e.setAttribute("media",t),n&&e.setAttribute("srcset",n)},L=he((function(e,t,n,i,a){var r,l,s,d,c,p;(c=ce(e,"lazybeforeunveil",t)).defaultPrevented||(i&&(n?le(e,o.autosizesClass):e.setAttribute("sizes",i)),l=e.getAttribute(o.srcsetAttr),r=e.getAttribute(o.srcAttr),a&&(d=(s=e.parentNode)&&ne.test(s.nodeName||"")),p=t.firesLoad||"src"in e&&(l||r||d),c={target:e},le(e,o.loadingClass),p&&(clearTimeout(u),u=Q(S,2500),de(e,D,!0)),d&&ae.call(s.getElementsByTagName("source"),z),l?e.setAttribute("srcset",l):r&&!d&&(k.test(e.nodeName)?j(e,r):e.src=r),a&&(l||d)&&ue(e,{src:r})),e._lazyRace&&delete e._lazyRace,se(e,o.lazyClass),me((function(){var t=e.complete&&e.naturalWidth>1;p&&!t||(t&&le(e,o.fastLoadedClass),M(c),e._lazyCache=!0,Q((function(){"_lazyCache"in e&&delete e._lazyCache}),9)),"lazy"==e.loading&&E--}),!0)})),q=function(e){if(!e._lazyRace){var t,n=_.test(e.nodeName),i=n&&(e.getAttribute(o.sizesAttr)||e.getAttribute("sizes")),a="auto"==i;(!a&&c||!n||!e.getAttribute("src")&&!e.srcset||e.complete||re(e,o.errorClass)||!re(e,o.lazyClass))&&(t=ce(e,"lazyunveilread").detail,a&&be.updateElem(e,!0,e.offsetWidth),e._lazyRace=!0,E++,L(e,t,a,i,n))}},R=ve((function(){o.loadMode=3,x()})),B=function(){c||(n.now()-f<999?Q(B,999):(c=!0,o.loadMode=3,x(),X("scroll",W,!0)))},{_:function(){f=n.now(),i.elements=t.getElementsByClassName(o.lazyClass),d=t.getElementsByClassName(o.lazyClass+" "+o.preloadClass),X("scroll",x,!0),X("resize",x,!0),X("pageshow",(function(e){if(e.persisted){var n=t.querySelectorAll("."+o.loadingClass);n.length&&n.forEach&&ee((function(){n.forEach((function(e){e.complete&&q(e)}))}))}})),e.MutationObserver?new MutationObserver(x).observe($,{childList:!0,subtree:!0,attributes:!0}):($.addEventListener("DOMNodeInserted",x,!0),$.addEventListener("DOMAttrModified",x,!0),setInterval(x,999)),X("hashchange",x,!0),["focus","mouseover","click","load","transitionend","animationend"].forEach((function(e){t.addEventListener(e,x,!0)})),/d$|^c/.test(t.readyState)?B():(X("load",B),t.addEventListener("DOMContentLoaded",x),Q(B,2e4)),i.elements.length?(T(),me._lsFlush()):x()},checkElems:x,unveil:q,_aLSL:W=function(){3==o.loadMode&&(o.loadMode=2),R()}}),be=(r=he((function(e,t,n,i){var o,a,r;if(e._lazysizesWidth=i,i+="px",e.setAttribute("sizes",i),ne.test(t.nodeName||""))for(a=0,r=(o=t.getElementsByTagName("source")).length;a<r;a++)o[a].setAttribute("sizes",i);n.detail.dataAttr||ue(e,n.detail)})),l=function(e,t,n){var i,o=e.parentNode;o&&(n=fe(e,o,n),(i=ce(e,"lazybeforesizes",{width:n,dataAttr:!!t})).defaultPrevented||(n=i.detail.width)&&n!==e._lazysizesWidth&&r(e,o,i,n))},{_:function(){a=t.getElementsByClassName(o.autosizesClass),X("resize",s)},checkElems:s=ve((function(){var e,t=a.length;if(t)for(e=0;e<t;e++)l(a[e])})),updateElem:l}),we=function(){!we.i&&t.getElementsByClassName&&(we.i=!0,be._(),ge._())};return Q((function(){o.init&&we()})),i={cfg:o,autoSizer:be,loader:ge,init:we,uP:ue,aC:le,rC:se,hC:re,fire:ce,gW:fe,rAF:me}}(t,t.document,Date);t.lazySizes=i,e.exports&&(e.exports=i)}("undefined"!=typeof window?window:{})}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var n in t)__webpack_require__.o(t,n)&&!__webpack_require__.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var __webpack_exports__={};(()=>{"use strict";const e={embed:null,tracking:null,retargeting:null,remarketing:null,storage:function(){var e={};Object.defineProperty(e,"visitor",{set:function(e){if(window.Pinpoll.embed){var t;try{t=JSON.parse(localStorage.PP_visitor).value}catch(e){t=null}t!==e&&setTimeout((function(){window.Pinpoll.embed.broadcast({action:"set:visitor",visitor:e})}))}try{localStorage.PP_visitor=e&&"null"!==e?JSON.stringify({value:e,expires:(new Date).setDate((new Date).getDate()+30)}):JSON.stringify({value:e,expires:0})}catch(e){console.warn(e)}},get:function(){try{if(!localStorage.PP_visitor)return null;var e=JSON.parse(localStorage.PP_visitor);return e.expires&&e.expires<Date.now()?(delete localStorage.PP_visitor,null):(e.expires=(new Date).setDate((new Date).getDate()+30),localStorage.PP_visitor=JSON.stringify(e),e.value)}catch(e){return console.warn(e),null}}});for(var t=function(){var t=i[n];Object.defineProperty(e,t.id,{set:function(e){try{localStorage[t.key]=JSON.stringify(e)}catch(e){console.warn(e)}},get:function(){try{var e=localStorage[t.key];return e?JSON.parse(e):t.d}catch(e){return console.warn(e),t.d}}})},n=0,i=[{id:"votes",key:"PP_votes",d:[]},{id:"leadForms",key:"PP_forms",d:[]},{id:"lastTriggered",key:"PP_marketing",d:null}];n<i.length;n++)t();try{localStorage.pinpoll_allVisitorVotes&&(localStorage.PP_votes=localStorage.pinpoll_allVisitorVotes,delete localStorage.pinpoll_allVisitorVotes)}catch(e){}return e}(),heightFilterActive:!1,nativeLoader:void 0,votelinkVotes:[],init:function(){var e=document.querySelector("script[src*='pinpoll.com/global.js'][data-app]");e&&(this.appName=e.getAttribute("data-app"))}};window.Pinpoll&&Object.keys(window.Pinpoll).length>0||(window.Pinpoll=e,e.init())})(),(()=>{"use strict";var e=__webpack_require__(558);window.Pinpoll.tracking||(window.Pinpoll.tracking=(0,e.Z)(window.Pinpoll.storage,{widgetIndex:"global"}),window.Pinpoll.tracking.start(window.Pinpoll.appName?{app:window.Pinpoll.appName}:void 0))})(),(()=>{"use strict";var e=__webpack_require__(38),t=__webpack_require__(58);function n(){var e;if(null!==(e=window.Pinpoll)&&void 0!==e&&e.appName)return!0;var t=window.navigator,n=t.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(n)&&!window.MSStream?!t.standalone&&!/safari/.test(n):n.includes("wv")}var i=eval;window.Pinpoll.retargeting||(window.Pinpoll.retargeting=function(o,a){var r,l,s=(0,e.G)({RETARGETING_ENDPOINT:"https://api2.dmp.pinpoll.com",pixelsLoaded:!1,pixels:[],isMobileDevice:(l=!1,r=navigator.userAgent||navigator.vendor||window.opera,(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(r)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|
5455sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(r.substr(0,4)))&&(l=!0),l),isApp:n(),googleLoaded:!1,trackEmbedEvent:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;if(s.pixelsLoaded)d(e,n);else{var o=window.location!==window.parent.location?document.referrer:document.location.href;p({referrer:o,questionId:t,leadFormId:i}).then((function(t){s.pixelsLoaded=!0,t&&"success"===t.status&&t.data.length>0&&(s.pixels=t.data),d(e,n)})).catch((function(e){s.log("Retargeting Endpoint not reachable:",e)}))}},triggerPixels:function(e){c(e,!1)}});function d(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=s.pixels.filter((function(n){if(("vote"===e||"vote_click"===e)&&n.answer_id&&(!t.length||!t.includes(n.answer_id)))return!1;if("all"!==n.device_type){if(a&&n.device_type!==a)return!1;if(s.isApp&&"app"!==n.device_type)return!1;if(s.isMobileDevice&&"desktop"===n.device_type)return!1;if(!s.isMobileDevice&&"mobile"===n.device_type)return!1}return n.event===e}));(n=n.filter((function(e,t,n){return t===n.findIndex((function(t){return t.id===e.id}))}))).length&&c(n,!0)}function c(e,n){var a;e&&e.length>0&&(e.forEach((function(e){!function(e){switch(e.type){case"javascript":!function(e,t){e.externalcode?u({src:e.externalcode,async:!0},(function(){e.staticcode&&u({text:e.staticcode}),e.loaded=!0,t()})):e.staticcode?(u({text:e.staticcode}),e.loaded=!0,t()):t()}(e,(function(){e.trigger_code&&i(e.trigger_code)}));break;case"google":!function(e,t,n){if(window.google_trackConversion)window.google_trackConversion&&window.google_trackConversion({google_conversion_id:e,google_conversion_label:t,google_custom_value:n,google_custom_params:window.google_tag_params,google_remarketing_only:!0});else{var i=document.createElement("script");i.src="https://www.googleadservices.com/pagead/conversion_async.js",i.async=!0,i.addEventListener("load",(function(){s.googleLoaded=!0,window.google_trackConversion&&window.google_trackConversion({google_conversion_id:e,google_conversion_label:t,google_custom_value:n,google_custom_params:window.google_tag_params,google_remarketing_only:!0})}),!1),document.body.appendChild(i)}}(e.conversion_id,e.conversion_label,e.custom_value);break;case"facebook":e.event&&(e.group_title=e.event),function(e,t,n){if(function(e,t,n,i,o,a,r){e.fbq||(o=e.fbq=function(){o.callMethod?o.callMethod.apply(o,arguments):o.queue.push(arguments)},e._fbq||(e._fbq=o),o.push=o,o.loaded=!0,o.version="2.0",o.queue=[],(a=t.createElement(n)).async=!0,a.src="https://connect.facebook.net/en_US/fbevents.js",(r=t.getElementsByTagName(n)[0]).parentNode.insertBefore(a,r))}(window,document,"script"),window.fbq){window.fbq("init",e),window.fbq("track","PageView");var i="string"==typeof n&&n.length>0?{customValue:n}:{};window.fbq("trackCustom",t,i)}}(e.facebook_id,e.group_title,e.custom_value);break;case"image":t=e.source,(n=new Image).onload=function(){n.naturalHeight+n.naturalWidth!==0?document.body.appendChild(n):s.log("Error on loadImage: natural height and width === 0")},n.onerror=function(e){s.log(e)},t&&(n.src=t);break;default:s.log("Pixel execution error: no type specified!")}var t,n}(e)})),n&&(a={triggeredPixels:e.map((function(e){return{pixel_id:e.id,campaign_id:e.campaign_id}}))},(0,t.w)(s.RETARGETING_ENDPOINT+"/public/triggered",a,o).then((function(e){return e.json()})).then((function(e){"success"!==e.status&&s.log("Return type of triggered data did not success!",e.data)})).catch((function(e){s.log("Failed to send triggered data!",e)}))))}function u(e,t){var n=document.createElement("script");Object.keys(e).forEach((function(t){n[t]=e[t]})),t&&"function"==typeof t&&n.addEventListener("load",(function(e){t(null,e)}),!1),document.body.appendChild(n)}function p(e){return(0,t.w)(s.RETARGETING_ENDPOINT+"/public/tr",e,o).then((function(e){return e.json()}))}return s}(window.Pinpoll.storage),window.Pinpoll.remarketing=function(n,i){var o=(0,e.G)({RETARGETING_ENDPOINT:"https://api2.dmp.pinpoll.com",REMARKETING_MAX_TRIGGER_TIME:parseInt("MISSING_ENV_VAR".MIX_REMARKETING_MAX_TRIGGER_TIME||"",10)||36e5,start:function(){window.requestIdleCallback?window.requestIdleCallback((function(){a()}),{timeout:3e3}):window.setTimeout((function(){a()}),3e3)}});function a(){var e,a;!(a=i.lastTriggered)||Date.now()-a>o.REMARKETING_MAX_TRIGGER_TIME?(e={referrer:window.location.origin||window.location.hostname},(0,t.w)(o.RETARGETING_ENDPOINT+"/public/remarketing",e,i).then((function(e){return e.json()}))).then((function(e){i.lastTriggered=Date.now(),e.data.length&&n.triggerPixels(e.data)})).catch((function(e){o.log("Failed to send getRemarketingPixels",e)})):o.log("Checked Remarketing; last triggered happened within max trigger time, last triggered at:",i.lastTriggered)}return o.start(),o}(window.Pinpoll.retargeting,window.Pinpoll.storage))})(),(()=>{"use strict";var e=__webpack_require__(631);__webpack_require__(90),__webpack_require__(726),window.Pinpoll.embed||(window.Pinpoll.embed=(0,e.ZP)(),window.Pinpoll.embed.start())})()})(); 5456 5457/* Event-Listener Adition iframe */ 5458window.addEventListener('message',function(event) { 5459 const origin = window.location.origin; 5460 if(event.origin !== origin) return; 5461 5462 let currentUrl = window.location.href; 5463 5464 let be_domainsInsertAdvTextDiv = [ 5465 'iz.de', 5466 'handelextra.pl', 5467 'how-green-works.de', 5468 'foodservice24.pl', 5469 'horizont.net', 5470 'mmponline.pl', 5471 'lebensmittelzeitung.net', 5472 'tw-media.com', 5473 'pebbles.dfv-is.de', 5474 'fibers-in-process.de', 5475 'umweltwirtschaft.com', 5476 'wwt-online.de', 5477 'changement-magazin.de', 5478 'zoe-online.org' 5479 ]; 5480 5481 let be_domainsAddSliderControl = ['ahgz.at', 'lebensmittelzeitung.net']; 5482 5483 let be_domainsContainerClass = { 5484 'default': 'PageFrame', 5485 'the-spin-off.com' : 'container', 5486 'horizont.net' : 'SiteHeader', 5487 'dfv-is.de' : 'SiteHeader', 5488 'fibers-in-process.de' : 'SiteHeader', 5489 'umweltwirtschaft.com' : 'SiteHeader', 5490 'wwt-online.de' : 'SiteHeader', 5491 'changement-magazin.de' : 'SiteHeader', 5492 'zoe-online.org' : 'SiteHeader' 5493 }; 5494 5495 let be_domainsWideLayout = [ 5496 'horizont.net', 5497 'mmponline.pl', 5498 'dfv-is.de', 5499 'fibers-in-process.de', 5500 'umweltwirtschaft.com', 5501 'wwt-online.de', 5502 'changement-magazin.de', 5503 'zoe-online.org' 5504 ]; 5505 5506 function be_isDomainInUrl(domainsArray, currentUrl) { 5507 return domainsArray.some(domain => currentUrl.includes(domain)); 5508 } 5509 5510 let wideLayout = false;
5511 if (be_isDomainInUrl(be_domainsWideLayout, currentUrl)) { 5512 wideLayout = true; 5513 } 5514 5515 let be_containerClass; 5516 const matchingKey = Object.keys(be_domainsContainerClass).find(key => currentUrl.includes(key)); 5517 5518 if (matchingKey) { 5519 be_containerClass = be_domainsContainerClass[matchingKey]; 5520 } else { 5521 be_containerClass = be_domainsContainerClass['default']; 5522 } 5523 5524 switch(event.data) { 5525 case 'text_ad': $(document).trigger('textAd'); 5526 break; 5527 case 'teadsResize': 5528 $(document).trigger('teadsResize'); 5529 break; 5530 case 'parallax': 5531 if (be_isDomainInUrl(be_domainsInsertAdvTextDiv, currentUrl)) { 5532 $(document).trigger('insertAdvTextDiv'); 5533 } 5534 $(document).trigger('parallax'); 5535 break; 5536 case 'bannerinit': 5537 $(document).trigger('sticky_initialize'); 5538 $(document).trigger('resizeIframe'); 5539 $(document).trigger('advertOnImage'); 5540 $(document).trigger('clsAlignSuperbanner'); 5541 $(document).trigger('clsAlignBillboard'); 5542 $(document).trigger('BillboardHeight'); 5543 $(document).trigger('alignSkyscraperLeft'); 5544 if (be_isDomainInUrl(be_domainsAddSliderControl,currentUrl)) { 5545 $(document).trigger('adSliderControl'); 5546 } 5547 if (be_isDomainInUrl(be_domainsInsertAdvTextDiv, currentUrl)) { 5548 $(document).trigger('insertAdvTextDiv'); 5549 } 5550 break; 5551 case 'singlebanner': 5552 $(document).trigger('sticky_initialize'); 5553 $(document).trigger('resizeIframe'); 5554 $(document).trigger('clsAlignSuperbanner'); 5555 $(document).trigger('clsAlignBillboard'); 5556 break; 5557 case 'halfpage': 5558 $(document).trigger('halfpage', [be_containerClass]); 5559 break; 5560 case 'floorAd': 5561 $(document).trigger('floorAd'); 5562 $(document).trigger('resizeIframe'); 5563 break; 5564 case 'html5floorAd': 5565 $(document).trigger('html5floorAd'); 5566 $(document).trigger('resizeIframe'); 5567 break; 5568 case 'HTML5sitebar': 5569 $(document).trigger('html5sitebar'); 5570 break; 5571 case 'layerAd': 5572 $(document).trigger('layerAd'); 5573 $(document).trigger('resizeIframe'); 5574 break; 5575 case 'bridgeAd': 5576 $(document).trigger('bridgeAd'); 5577 break; 5578 case 'bridgeAdSticky': 5579 $(document).trigger('bridgeAdSticky'); 5580 $(document).trigger('billboardSticky'); 5581 break; 5582 case 'fullWidthBillboard': 5583 $(document).trigger('fullWidthBillboard'); 5584 $(document).trigger('resizeIframe'); 5585 break; 5586 case 'exitintent': 5587 $(document).trigger('exitintent'); 5588 break; 5589 case 'background': 5590 $(document).trigger('changeBackgroundColor'); 5591 break; 5592 case 'backgroundclick': 5593 $(document).trigger('isBackgroundClick'); 5594 break; 5595 case 'counterAd': 5596 $(document).trigger('counterAd'); 5597 break; 5598 case 'centerFrame': $(document).trigger('centerIframe'); 5599 break; 5600 case 'blockadvertisement': 5601 $(document).trigger('blockadvertisement'); 5602 break; 5603 case 'wallpapercolor': 5604 $(document).trigger('wallpapercolor'); 5605 break; 5606 case 'sitebar': 5607 case 'sitebarHTML5': 5608 $(document).trigger('sitebar', [wideLayout]); 5609 break; 5610 case 'sitebar-switch': 5611 $(document).trigger('sitebar-switch', [be_domainsContainerClass, wideLayout]); 5612 $(document).trigger('resizeIframe'); 5613 break; 5614 case 'sitebarLeft': 5615 $(document).trigger('sitebarLeft', [wideLayout]); 5616 break; 5617 case 'pushdown': 5618 case 'pushdown2': 5619 case 'pushdown3': 5620 case 'pushdown4': 5621 case 'pushdown5': 5622 case 'pushdown6': 5623 case 'pushdown7': 5624 const elementclass = event.data; 5625 $(document).trigger('pushdown', [elementclass]); 5626 break; 5627 case 'parallax_outstream': 5628 $(document).trigger('parallax_outstream'); 5629 break; 5630 case 'dynamic_sitebar': 5631 $(document).trigger('dynamic_sitebar'); 5632 break; 5633 case 'billboardSticky': 5634 $(document).trigger('billboardSticky'); 5635 break; 5636 case 'dfvSolutionAd': 5637 $(document).trigger('dfvSolutionAd'); 5638 break; 5639 case 'welcomeVideo': 5640 $(document).trigger('resizeIframe'); 5641 $(document).trigger('welcomeAdVideo'); break; 5642 case 'welcomeVideoMobil': 5643 $(document).trigger('resizeIframe'); 5644 $(document).trigger('welcomeAdVideoMobil'); break; 5645 case 'welcomeImage': 5646 $(document).trigger('resizeIframe'); 5647 $(document).trigger('welcomeAdImage'); break; 5648 case 'welcomeImageMobil': 5649 $(document).trigger('resizeIframe'); 5650 $(document).trigger('welcomeAdImageMobil'); break; 5651 case 'understitial': 5652 $(document).trigger('understitial'); 5653 break; 5654 case 'bbreminder': 5655 $(document).trigger('resizeIframe'); 5656 $(document).trigger('bbReminder'); 5657 break; 5658 case 'fadeoutadvertisement': 5659 $(document).trigger('fadeoutadvertisement'); 5660 break; 5661 default: 5662 return; 5663 } 5664 5665},false); 5666 5667/** 5668 * billboardHeight 5669 * billboard pushdown - margin bottom / overflow hidden 5670 */ 5671$(document).one('billboardHeight', function() {
5672 const slots = document.querySelectorAll('#renderSlot_Billboard, #renderSlot_Mobil-Billboard'); 5673 5674 slots.forEach(slot => { 5675 let banner_div = slot.querySelector('div'); 5676 if (banner_div) { 5677 const checkStyleInterval = setInterval(() => { 5678 if (banner_div.getAttribute('style')) { 5679 banner_div.style.marginBottom = '20px'; 5680 if (slot.offsetHeight < 290) { /* CLS */ 5681 slot.style.marginBottom = '20px'; 5682 } 5683 slot.style.overflow = 'hidden'; 5684 clearInterval(checkStyleInterval); 5685 } 5686 }, 100); 5687 } else { 5688 const observer = new MutationObserver((mutationsList, observer) => { 5689 mutationsList.forEach(mutation => { 5690 if (mutation.type === 'childList') { 5691 banner_div = slot.querySelector('div'); 5692 if (banner_div) { 5693 const checkStyleInterval = setInterval(() => { 5694 if (banner_div.getAttribute('style')) { 5695 banner_div.style.marginBottom = '20px'; 5696 if (slot.offsetHeight < 290) { /* CLS */ 5697 slot.style.marginBottom = '20px'; 5698 } 5699 slot.style.overflow = 'hidden'; 5700 clearInterval(checkStyleInterval); 5701 } 5702 }, 100); 5703 observer.disconnect(); 5704 } 5705 } 5706 }); 5707 }); 5708 observer.observe(slot, { childList: true, subtree: true }); 5709 } 5710 }); 5711}); 5712 5713/** 5714 * billboardSticky 5715 */ 5716$(document).on('billboardSticky', function(){ 5717 const slot = $('#renderSlot_Billboard, #renderSlot_Mobil-Billboard'); 5718 const billboardAdIframe = $('.billboardSticky'); 5719 const stickyHeaderHeight = $('.SiteHeaderSticky').height(); 5720 5721 const billboardPositionTop = slot.offset().top; 5722 const billboardMarginTop = parseFloat(billboardAdIframe.parent().css('margin-top')); 5723 let billboardStickyOffsetTop = stickyHeaderHeight + 5; 5724 let sTimer = 0; 5725 if (Math.sign(billboardMarginTop) === -1) { 5726 billboardStickyOffsetTop = billboardStickyOffsetTop + Math.abs(billboardMarginTop); 5727 } else { 5728 billboardStickyOffsetTop = billboardStickyOffsetTop - Math.abs(billboardMarginTop); 5729 } 5730 5731 const bId = String(billboardAdIframe.data('bannerid')); 5732 const lsKey = 'stickyBillboard_' + bId; 5733 const lsValue = localStorage.getItem(lsKey); 5734 5735 if (lsValue !== null) { 5736 const expireDate = JSON.parse(lsValue).expireAt; 5737 if (expireDate < new Date().getTime()) { 5738 localStorage.removeItem(lsKey); 5739 } else { 5740 return false; 5741 } 5742 } 5743 5744 if ($('.PageFrame').height() > 2000) { 5745 $(window).scroll(function () { 5746 if ($(window).scrollTop() > billboardPositionTop) { 5747 if (localStorage.getItem(lsKey) === null && !sTimer && !slot.hasClass('isStickyBillboard')) { 5748 slot.css({top: billboardStickyOffsetTop + 'px'}); 5749 slot.addClass('isStickyBillboard'); 5750 5751 sTimer = setTimeout(function () { 5752 slot.css({'zIndex': 998}); 5753 slot.animate({'top': -600}, 3000, function () { 5754 }); 5755 sTimer = 0; 5756 const expireAt = new Date(new Date().getTime() + (60000 * 1440)).getTime(); 5757 localStorage.setItem(lsKey, JSON.stringify({expireAt: expireAt})); 5758 }, 2000); 5759 } 5760 } else { 5761 if (sTimer) { 5762 clearTimeout(sTimer); 5763 sTimer = 0; 5764 } 5765 slot.css({top: '0px'}); 5766 slot.removeClass('isStickyBillboard'); 5767 } 5768 }); 5769 } 5770}); 5771 5772/** 5773 * parallax 5774 */ 5775$(document).on("parallax", function(event){ 5776 'use strict'; 5777 const htmlTag = document.getElementsByTagName('html')[0]; 5778 const peephole = $(".parallax").parent().parent(); 5779 const parallax_div = $(".parallax").parent(); 5780 const parallax_iframe = $(".parallax"); 5781 5782 const peephole_width = peephole.width(); 5783 const peephole_height = peephole.height(); 5784 5785 const bgcolor = parallax_iframe.data("bgcolor"); 5786 const parallax_ratio = parallax_iframe.data("height") / parallax_iframe.data("width"); 5787 5788 htmlTag.classList.add('Ad_setZindex'); /* Workaround für Safari < v15 */ 5789 5790 let viewportHeight = window.innerHeight - $(".SiteHeaderSticky").outerHeight(true); 5791 if (window.innerWidth < 768) {
5792 viewportHeight = window.innerHeight; 5793 } 5794 if (parallax_iframe.data("width") >= parallax_div.width()){ 5795 parallax_iframe.height( parallax_div.width() * parallax_ratio); 5796 } 5797 5798 let ad_top = parseInt(viewportHeight - parallax_iframe.height()) / 2; 5799 const parallax_height_diff = Math.abs(viewportHeight - parallax_iframe.height()) * parallax_ratio; 5800 const parallax_width_diff = Math.floor(parallax_height_diff); 5801 5802 if ((parallax_iframe.data("height") >= viewportHeight) || (ad_top < parseInt($(".SiteHeaderSticky").outerHeight(true)))) { 5803 ad_top = $(".SiteHeaderSticky").outerHeight(true) +"px"; 5804 } 5805 5806 peephole.height(viewportHeight); 5807 peephole.css("position","relative"); 5808 peephole.prepend('<span class=\"Ad_parallax-borderTop\" style=\"width: ' + peephole_width + 'px;\"></span>'); /*Chrome-Render-Fix*/ 5809 5810 parallax_div.css('width', peephole_width + 'px'); 5811 parallax_div.css("height",viewportHeight); 5812 if (bgcolor) { 5813 parallax_div.css("background-color", bgcolor); 5814 } 5815 parallax_div.addClass('Ad_parallax-innerWrapper'); 5816 parallax_div.css('margin', '0 auto'); 5817 parallax_iframe.height(viewportHeight); 5818 const parallax_width = parallax_div.height() / parallax_ratio; 5819 5820 if ((peephole_height > viewportHeight) && (window.innerWidth < 768)) { 5821 parallax_iframe.width(parallax_width-parallax_width_diff); 5822 } else { 5823 parallax_iframe.width(parallax_width); 5824 } 5825 5826 if (parallax_width > peephole_width) { 5827 parallax_iframe.width(peephole_width); 5828 } 5829 5830 if (parallax_div.width() - parallax_iframe.width() > 48 ){ 5831 parallax_iframe.css("margin-left", ((parallax_div.width() - parallax_iframe.width()) / 2) + "px"); 5832 } else { 5833 parallax_iframe.css("margin-left", "0px"); 5834 } 5835 parallax_iframe.css("position","fixed"); 5836 parallax_iframe.css("bottom",ad_top); 5837 parallax_iframe.css("top",ad_top); 5838 5839}); 5840 5841/** 5842 * textAd 5843 */ 5844$(document).one("textAd", function(event){ 5845 /* Finde alle iframes mit der class .textAd */ 5846 const $iframes = $("iframe.textAd"); 5847 5848 /* Resize the iframes when the window is resized */ 5849 $( window ).resize( function() { 5850 $iframes.each( function() { 5851 if ($(this).data("width") >= $(this).width()) { 5852 $(this).height( $(this).data("height") + 20 + (($(this).data("width")-$(this).width())/2)); 5853 } 5854 }); 5855 /* Resize to fix all iframes on page load. */ 5856 }).resize(); 5857}); 5858 5859/** 5860 * resizeIframe 5861 */ 5862$(document).one("resizeIframe", function(event){ 5863 /* Finde alle iframes mit der class .responsiveFrame */ 5864 const $iframes = $("iframe.responsiveFrame"); 5865 5866 /* Find and save the aspect ratio for all iframes */ 5867 $iframes.each(function () { 5868 $( this ).data( "ratio", $(this).data("height") / $(this).data("width") ); 5869 let slot = $(this).parent().parent(); 5870 if (slot.parent().length && slot.parent().hasClass() ){ 5871 if (slot.parent().attr('class').match(/slick-track/)) { 5872 /* SliderBannerArticleDetail_dots nur einblenden, wenn auch was geschaltet ist */ 5873 $('.SliderBannerArticleDetail_dots').css('display','block'); 5874 } 5875 } 5876 }); 5877 5878 /* Resize the iframes when the window is resized */ 5879 $( window ).resize( function() { 5880 $iframes.each( function() { 5881 if($(this).data("width") >= $(this).width()){ 5882 $( this ).height( $(this).width() * $( this ).data( "ratio" )); 5883 } 5884 }); 5885 /* Resize to fix all iframes on page load. */ 5886 }).resize(); 5887 5888}); 5889 5890/** 5891 * adSliderControl 5892 */ 5893$(document).one("adSliderControl", function(event) { 5894 /** 5895 * Nur geschaltete Banner in Banner-Slider auf Artikelseite zeigen. 5896 * Wenn es nur einen geschalteten Banner gibt, dann wird Auto-Slide deaktiviert 5897 * und zum Slide mit dem Banner gesprungen. Sind beide Banner vorhanden, 5898 * wird der Auto-Slide des Sliders wieder aktiviert. 5899 * 5900 * Eine Umsetzung mit sowohl "unslick" als auch "slickRemove" funktionierte nicht, 5901 * da dann alle Werbemittel nicht mehr sichtbar waren. Auch vornherein den Slider nur 5902 * anzuwenden, wenn es mehr als einen Banner gibt, hatte nicht funktioniert, da das Banner-JS bereits 5903 * verarbeitet war. 5904 */ 5905 'use strict'; 5906 const bannerSlider = '.SliderBannerArticleDetail'; 5907 const bannerSliderDots = bannerSlider + '_dots'; 5908 const slideSelectors = ['slick-slide00', 'slick-slide01']; 5909 const slideState = []; 5910 5911 $(bannerSliderDots).css('display', 'none'); 5912 $(bannerSlider).slick('slickPause'); 5913 $(bannerSlider).slick('slickGoTo', 0); /* Slider refreshen, damit Slides aufrufbar sind */ 5914 5915 const waitForEl = function (slideSelectors, callback) { 5916 const startTimeInMs = Date.now(); 5917 5918 for (let i = 0; i < slideSelectors.length; i++) { 5919 const selectorObj = document.getElementById(slideSelectors[i]); 5920 if (selectorObj && selectorObj.children.length && selectorObj.children[0].tagName === 'DIV') { 5921 slideState[i] = 1; 5922 } else { 5923 slideState[i] = 0; 5924 } 5925 } 5926 5927 if (slideState[0] === 1 && slideState[1] === 0) { 5928 $(bannerSlider).slick('slickGoTo', 0); 5929 callback(); 5930 return; 5931 } else if (slideState[0] === 0 && slideState[1] === 1) { 5932 $(bannerSlider).slick('slickGoTo', 1); 5933 callback(); 5934 return; 5935 } else if (slideState[0] === 1 && slideState[1] === 1) { 5936 $(bannerSlider).slick('slickPlay'); 5937 $(bannerSliderDots + ' li').css('padding-left', '0'); 5938 $(bannerSliderDots).css('display', 'block'); 5939 callback(); 5940 return; 5941 } else { 5942 setTimeout(function () { 5943 if (Date.now() - startTimeInMs > 10000) { 5944 /*Callback spätestens nach 10 Sekunden abbrechen */ 5945 return; 5946 } 5947 waitForEl(slideSelectors, callback); 5948 }, 10); 5949 } 5950 }; 5951 5952 waitForEl(slideSelectors, function() {}); 5953 5954}); 5955 5956/** 5957 * halfpage 5958 */ 5959$(document).on("halfpage", function(event, be_containerClass){ 5960 5961 /* 5962 const $iframes = $("iframe.halfpage"); 5963 5964 $iframes.each(function(){ 5965 const slot = $(this).parent().parent(); 5966 slot.css("width","300px"); 5967 }); 5968 */ 5969 5970 function halfpageResize() { 5971 /* Class-Name für sitebarContainer und .page-footer entsprechend einsetzen */ 5972 const halfpageContainer = '.Ad-skyscraper-right'; 5973 5974 const stageWidth = $("." + be_containerClass).width(); 5975 let halfpageSpace = ($(this).width() - stageWidth) / 2; 5976 halfpageSpace = Math.floor(halfpageSpace) -15; 5977 5978 if ($(halfpageContainer + ' iframe.responsiveFrame').data("width") > halfpageSpace ) { 5979 $(halfpageContainer + ' iframe.responsiveFrame').width(halfpageSpace); 5980 } 5981 5982 const halfpageAd = $('.halfpage').parent().parent(); 5983 const halfpage = $('.halfpage'); 5984 const halfpage_width = halfpage.data('width'); 5985 5986 if (halfpage_width > halfpageSpace ) { 5987 halfpage.width(halfpageSpace); 5988 halfpageAd.css("width",halfpageSpace+"px"); 5989 halfpage.css("width",halfpageSpace+"px"); 5990 5991 $(document).ready(function(){ 5992 const halfpageDOM = halfpage.contents(); 5993 halfpageDOM.find("iframe").css("width", halfpageSpace+"px"); 5994 const currWinHeight = $(window).height(); 5995 halfpageDOM.find("iframe").css("max-height", currWinHeight+"px"); 5996 }); 5997 } 5998 } 5999 6000 const halfpageAd = $('.halfpage').parent().parent(); 6001 const halfpage = $('.halfpage'); 6002 6003 const halfpage_width = halfpage.data('width'); 6004 halfpageAd.css("width",halfpage_width+'px'); 6005 halfpageAd.css("max-width",halfpage_width+'px'); 6006 6007 const halfpage_fixed = halfpage.data('fixed'); 6008 if (halfpage_fixed != 'false') { 6009 halfpageAd.css("position","fixed"); 6010 } 6011 6012 /* Resize halfpage when the window is resized */ 6013 $( window ).resize( function() { 6014 halfpageResize(); 6015 /* Resize to fix halfpage on page load. */ 6016 }).resize(); 6017 6018}
6018); 6019 6020 6021/** 6022 * floorAd 6023 */ 6024$(document).on('floorAd', function(event) { 6025 const floorAd = $('.floorAd').parent().parent(); 6026 const floorAdIframe = $('.floorAd'); 6027 const floorAdIframeContent = $('.floorAd').contents(); 6028 const scroll_pos = floorAdIframe.data('display-at-pixel'); 6029 const set_pos = floorAdIframe.data('align'); 6030 const display_on_scroll = floorAdIframe.data('display-on-scroll'); 6031 const center_ad = floorAdIframe.data('center-ad'); 6032 let isHidden = false; 6033 6034 floorAd.css('z-index', floorAdIframe.data('zindex')); 6035 if (display_on_scroll) { 6036 floorAd.css('display', 'none'); 6037 } 6038 if (center_ad) { 6039 floorAd.css('text-align', 'center'); 6040 } 6041 6042 if (set_pos) { 6043 floorAd.css('position', 'fixed'); 6044 floorAd.css(floorAdIframe.data('vertical-pos'),floorAdIframe.data('vertical-px-offset')); 6045 floorAd.css(floorAdIframe.data('horizontal-pos'),floorAdIframe.data('horizontal-px-offset')); 6046 } 6047 6048 window.onscroll = function() { 6049 if( window && !isHidden) { 6050 if (document.documentElement.scrollTop > scroll_pos || self.pageYOffset > scroll_pos) { 6051 $(floorAd).fadeIn("slow"); 6052 } else if (document.documentElement.scrollTop < scroll_pos || self.pageYOffset < scroll_pos) { 6053 $(floorAd).fadeOut("slow"); 6054 } 6055 } 6056 }; 6057 6058 floorAdIframeContent.find('.CloseAd').click(function() { 6059 $(floorAd).fadeOut('slow'); 6060 isHidden = true; 6061 }); 6062 6063}); 6064 6065 6066/** 6067 * layerAd 6068 */ 6069$(document).on('layerAd', function(event) { 6070 const layerAd = $('.layerAd').parent().parent(); 6071 const layerAdWrapper = $('.layerAd').parent(); 6072 const layerAdIframe = $('.layerAd'); 6073 const ad_close_time = layerAdIframe.data('ad-close-time'); 6074 6075 const bg_color = layerAdIframe.data('bgcolor'); 6076 const bg_opacity = layerAdIframe.data('bgopacity'); 6077 6078 const align_banner = layerAdIframe.data('align'); 6079 const vertical_px_offset = layerAdIframe.data('vertical-px-offset'); 6080 const vertical_pos = layerAdIframe.data('vertical-pos'); 6081 const horizontal_px_offset = layerAdIframe.data('horizontal-px-offset'); 6082 const horizontal_pos = layerAdIframe.data('horizontal-pos'); 6083 6084 function convertHex(hex,opacity){ 6085 hex = hex.replace('#',''); 6086 r = parseInt(hex.substring(0,2), 16); 6087 g = parseInt(hex.substring(2,4), 16); 6088 b = parseInt(hex.substring(4,6), 16); 6089 6090 return 'rgba(' + r + ',' + g + ',' + b + ',' + opacity / 100 + ')'; 6091 } 6092 6093 const bgColor_rgb = convertHex(bg_color, bg_opacity); 6094 6095 layerAd.css('width', '100%'); 6096 layerAd.css('height', '100%'); 6097 layerAd.css('background', bgColor_rgb); 6098 layerAd.css('position', 'fixed'); 6099 layerAd.css('top', '0'); 6100 layerAd.css('left', '0'); 6101 layerAd.css('z-index', '12000'); 6102 6103 layerAd.css('display', 'flex'); 6104 layerAd.css('display', '-webkit-box'); 6105 layerAd.css('display', '-webkit-flex'); 6106 layerAd.css('display', '-ms-flexbox'); 6107 6108 layerAd.css('-webkit-box-align', 'center'); 6109 layerAd.css('-webkit-align-items', 'center'); 6110 layerAd.css('-ms-flex-align', 'center'); 6111 layerAd.css('align-items', 'center'); 6112 6113 layerAd.css('-webkit-box-pack', 'center'); 6114 layerAd.css('-webkit-justify-content', 'center'); 6115 layerAd.css('-ms-flex-pack', 'center'); 6116 layerAd.css('justify-content', 'center'); 6117 6118 6119 layerAd.css('z-index', '12000'); 6120 6121 layerAdWrapper.css('position', 'absolute'); 6122 layerAdWrapper.prepend("<div class='layer_close' style='z-index: 13000; position:absolute; color: #ffffff; top:0; right:0;'><i title =\"schlieÃen\" class=\"fa fa-close fa-2x\"></i></div>"); 6123 6124 layerAdWrapper.css('margin', 'auto'); 6125 6126 if (align_banner == 1) { 6127 if (vertical_pos == 'bottom') { 6128 layerAdWrapper.css('margin-bottom', vertical_px_offset+'px'); 6129 } else { 6130 layerAdWrapper.css('margin-top', vertical_px_offset+'px'); 6131 } 6132 if (horizontal_pos == 'left') { 6133 layerAdWrapper.css('margin-left', horizontal_px_offset+'px'); 6134 } else { 6135 layerAdWrapper.css('margin-right', horizontal_px_offset+'px'); 6136 } 6137 } 6138 6139 function showLayerAd() { 6140 layerAd.show(); 6141 } 6142 6143 function closeLayerAd() { 6144 layerAd.hide(); 6145 } 6146 6147 if (ad_close_time > 0){ 6148 setTimeout(function(){closeLayerAd();}, ad_close_time*1000); 6149 } 6150
6151 $( ".layer_close" ).click(function() { 6152 layerAd.hide(); 6153 }); 6154}); 6155 6156/** 6157 * exitintent 6158 */ 6159$(document).one("exitintent", function(event){ 6160 $( "html" ).one( "mouseleave", function() { 6161 $("#LayerModal").addClass("show"); 6162 }); 6163}); 6164 6165/** 6166 * changeBackgroundColor 6167 */ 6168$(document).on('changeBackgroundColor',function(event){ 6169 const iframe = $('.fireplace'), 6170 bg_color = iframe.data('bgcolor'); 6171 $(".Body").css('background-color', bg_color); 6172}); 6173 6174/** 6175 * isBackgroundClick 6176 * On Background click go to clickurl 6177 */ 6178$(document).on('isBackgroundClick',function(event){ 6179 6180 $("#usercentrics-root").click(function(event ) { 6181 event.stopPropagation(); 6182 }); 6183 6184 $(".PageFrame").click(function(event ) { 6185 event.stopPropagation(); 6186 }); 6187 6188 $("#uc-center-container").click(function(event ) { 6189 event.stopPropagation(); 6190 }); 6191 6192 $(".Body").click(function() { 6193 const iframe = $('.bgclickplace'); 6194 const clickurl = iframe.data('clickurl'); 6195 window.open(clickurl, '_blank'); 6196 }); 6197}); 6198 6199/** 6200 * counterAd 6201 */ 6202$(document).one('counterAd', function(event) { 6203 const counterAd = $('.counterAd').parent().parent(); 6204 const counterAdIframe = $('.counterAd'); 6205 6206 const pl_id = counterAdIframe.data('contentunit'); 6207 const clickurl = counterAdIframe.data('clickurl'); 6208 const enddatum = counterAdIframe.data('enddatum'); 6209 const counterimage = counterAdIframe.data('counterimage'); 6210 const layout = counterAdIframe.data('layout'); 6211 6212 let countertext = ''; 6213 6214 countertext = countertext + '<div id=\"'+pl_id+'\" class="noanzeige" width=\"300\" height=\"300\">\n'; 6215 countertext = countertext + ' <div>\n' ; 6216 countertext = countertext + ' <a target=\"_blank\" href=\"'+clickurl+'\">\n'; 6217 if(typeof layout !== 'undefined' && layout === 'image') { 6218 countertext = countertext + ' <img src=\"' + counterimage + '\" title=\"\" alt=\"\" border=\"0\" width=\"300\" height=\"150\"/>\n'; 6219 } 6220 countertext = countertext + ' </a>\n'; 6221 countertext = countertext + ' <div class=\"banner_counter\" border=\"0\" width=\"300\" height=\"150\" style=\"max-width: 300px !important;\"> \n'; 6222 countertext = countertext + ' <span id=\"clockline\"></span>\n'; 6223 countertext = countertext + ' <div id=\"banner_counter\"></div>\n'; 6224 countertext = countertext + ' <div id=\"name_time_block\">\n'; 6225 countertext = countertext + ' <span class=\"name_time\">Tage</span>\n'; 6226 countertext = countertext + ' <span class=\"name_time\">Stunden</span>\n'; 6227 countertext = countertext + ' <span class=\"name_time\">Minuten</span>\n'; 6228 countertext = countertext + ' </div>\n'; 6229 countertext = countertext + ' </div> \n'; 6230 countertext = countertext + ' \n'; 6231 countertext = countertext + ' </div>\n'; 6232 countertext = countertext + '\n'; 6233 countertext = countertext + '</div>\n'; 6234 counterAd.append(countertext); 6235 if(typeof layout !== 'undefined' && layout === 'image'){ 6236 counterAdIframe.css("display","none"); 6237 } 6238 counterAd.css('margin-top', '10px'); 6239 $('.noanzeige').not(':first').remove(); 6240 if(typeof jQuery == "function"){ 6241 $(function() { 6242 $(document).trigger( "counter", enddatum); 6243 }); 6244 } 6245 6246 $( counterAd ).closest('div').next().find('.line').removeClass("line"); 6247}); 6248 6249/** 6250 * counter 6251 */ 6252$(document).on("counter", function(event, endtime){ 6253 6254 /* Datum mit Punkt */ 6255 let iso_end_date; 6256 if (endtime.match(/\./) ) { 6257 let iso_end_dateArr = endtime.split("."); 6258 6259 /* Umwandlung in Iso-Format */ 6260 if (iso_end_dateArr[2] < 100) iso_end_dateArr[2] = "20" + iso_end_dateArr[2]; 6261 iso_end_date = iso_end_dateArr[2] + "-" + iso_end_dateArr[0] + "-" +iso_end_dateArr[1]; 6262 6263 /* Datum im Iso-Format, z.B. 2020-11-09 */ 6264 } else { 6265 iso_end_date = endtime; 6266 } 6267 6268 const end = new Date(iso_end_date); 6269 6270 const _second = 1000; 6271 const _minute = _second * 60; 6272 const _hour = _minute * 60; 6273 const _day = _hour * 24; 6274 let timer; 6275 6276 function showRemaining() { 6277 const now = new Date(); 6278 now.setHours(now.getHours() +1); 6279 6280 const distance = end - now; 6281 if (distance < 0) { 6282 6283 clearInterval(timer); 6284 document.getElementById('banner_counter').innerHTML = '<span class="time">0</span> '; 6285 document.getElementById('banner_counter').innerHTML += '<span class="time">0</span> '; 6286 document.getElementById('banner_counter').innerHTML += '<span class="time">0</span> '; 6287 return; 6288 } 6289 const days = Math.floor(distance / _day); 6290 const hours = Math.floor((distance % _day) / _hour); 6291 const minutes = Math.floor((distance % _hour) / _minute); 6292 6293 document.getElementById('banner_counter').innerHTML = '<span class="time">' + days + '</span> '; 6294 document.getElementById('banner_counter').innerHTML += '<span class="time">' + hours + '</span> '; 6295 document.getElementById('banner_counter').innerHTML += '<span class="time">' + minutes + '</span> '; 6296 6297 } 6298 timer = setInterval(showRemaining, 1000); 6299 6300}); 6301 6302/** 6303 * centerIframe 6304 */ 6305$(document).on('centerIframe', function(event){ 6306 const iframe = $('.centeredFrame'), 6307 container = iframe.parent(); 6308 6309 container.css('display', 'flex'); 6310 container.css('flex-flow','column'); 6311 iframe.css('align-self','center'); 6312}); 6313 6314/** 6315 * blockadvertisement 6316 */ 6317$(document).on("blockadvertisement", function(event){ 6318 6319 const iframe = $('.blockadvertisement'); 6320 let container = iframe.parent(); 6321 container.css("display","none"); 6322}); 6323 6324/** 6325 * wallpapercolor 6326 * Einfärben des body für Wallpaper 6327 */ 6328$(document).on("wallpapercolor", function(event){ 6329 6330 const iframe = $('.wallpaper_banner'); 6331 const wallpapercolor = iframe.data("wallpapercolor"); 6332 $('body').css("background-color",wallpapercolor); 6333 6334}); 6335 6336/** 6337 * advertOnImage 6338 */ 6339$(document).one("advertOnImage", function(event){ 6340 const slot = $('[id^="renderSlot_Rectangle-Online-Specials"]'); 6341 if (slot.hasClass("Ad-mediumRectangleStageTeaserAdvert")) { 6342 if (slot.children('div').length > 0) { 6343 slot.parent().css('padding', '5px'); 6344 slot.parent().css('background-color', '#fff'); 6345 } 6346 6347 } 6348 6349}); 6350 6351/** 6352 * be_sitebarResize 6353 */ 6354function be_sitebarResize(wideLayout, sitebarBid) { 6355 const browser_scrollbar_width = 0; 6356 let offsetLeft = 460; 6357 let outerWidth = 980; 6358 const sitebarContainer = '.Ad-skyscraper-right'; 6359 if (($('.SiteFooter').length) && (!wideLayout)) { 6360 offsetLeft = $('.SiteFooter').offset().left + browser_scrollbar_width; 6361 outerWidth = $('.SiteFooter').outerWidth(); 6362 } else if (($('.PageGallery').length) && (!wideLayout)) { 6363 offsetLeft = $('.PageGallery').offset().left + browser_scrollbar_width; 6364 outerWidth = $('.PageGallery').outerWidth(); 6365 } 6366 if (wideLayout === true) { 6367 let siteHeader = document.querySelector('.SiteHeader') || document.querySelector('.SiteHeaderSticky_firstLine-inner'); 6368 if (siteHeader) { 6369 let rect = siteHeader.getBoundingClientRect(); 6370 offsetLeft = rect.left + browser_scrollbar_width; 6371 6372 let siteHeaderStyles = window.getComputedStyle(siteHeader); 6373 outerWidth = parseFloat(siteHeaderStyles.getPropertyValue('width')); 6374 } 6375 } 6376 6377 let rightOffset = $(this).width() - (offsetLeft + outerWidth); 6378 rightOffset = Math.floor(rightOffset); 6379 6380 if ($(sitebarContainer + ' iframe.responsiveFrame').data("width") > rightOffset ) { 6381 $(sitebarContainer + ' iframe.responsiveFrame').width(rightOffset); 6382 } 6383 6384 const iframeEl = document.querySelector('iframe.sitebar'); 6385 let iFrameElDocument = iframeEl.contentDocument || iframeEl.contentWindow.document; 6386 let imgSitebar = iFrameElDocument.getElementById("sitebar"+sitebarBid); 6387 let imgSky = iFrameElDocument.getElementById("sky"+sitebarBid); 6388 const offsetLowLmt = 135; 6389 const offsetUpLmt = 215; 6390 6391 if (imgSky && imgSitebar) { 6392 if ((offsetLeft >= offsetLowLmt) && (offsetLeft < offsetUpLmt)) { 6393 imgSitebar.style.display = "none"; 6394 imgSky.style.display = "inline"; 6395 } else if (offsetLeft >= offsetUpLmt) { 6396 imgSitebar.style.display = "inline"; 6397 imgSky.style.display = "none"; 6398 } 6399 else if (offsetLeft < offsetLowLmt) { 6400 imgSitebar.style.display = "none"; 6401 imgSky.style.display = "none"; 6402 } 6403 } 6404 6405 6406 const sitebarAd = $('.sitebar').parent().parent(); 6407 const sitebar = $('.sitebar'); 6408 const sitebar_width = sitebar.data('width'); 6409 const hideWidth = (sitebar.data('hidewidth') !== undefined ? sitebar.data('hidewidth') : 0); 6410 6411 if (rightOffset <= hideWidth) { 6412 sitebarAd.css('display', 'none'); 6413 return; 6414 } else { 6415 sitebarAd.css('display', 'block'); 6416 } 6417 6418 6419 if (sitebar_width > rightOffset ) { 6420 sitebar.width(rightOffset); 6421 sitebarAd.css("width",rightOffset+"px"); 6422 sitebar.css("width",rightOffset+"px"); 6423 6424 $(document).ready(function(){ 6425 const sitebarDOM = sitebar.contents(); 6426 sitebarDOM.find("iframe").css("width", rightOffset+"px"); 6427 const currWinHeight = $(window).height(); 6428 sitebarDOM.find("iframe").css("max-height", currWinHeight+"px"); 6429 }); 6430 } 6431} 6432 6433/** 6434 * sitebar 6435 */ 6436$(document).on('sitebar',function(event, wideLayout) { 6437 const sitebarAd = $('.sitebar').parent().parent(); 6438 const sitebar = $('.sitebar'); 6439 const sitebarBid = sitebar[0].getAttribute("data-bid"); 6440 const sbAdMarginTop = sitebar[0].getAttribute("data-margintop"); 6441 if (sbAdMarginTop !== "0" && sbAdMarginTop !== "NULL") { 6442 sitebarAd.css("margin-top",sbAdMarginTop+'px'); 6443 } 6444 6445 if ( sitebar.data('bgcolor') ) { 6446 const bg_color = sitebar.data('bgcolor'); 6447 if (bg_color.startsWith("#")) { 6448 document.getElementsByTagName('body')[0].style.backgroundColor = bg_color; 6449 } 6450 } 6451 6452 const sitebar_width = sitebar.data('width'); 6453 sitebarAd.css("width",sitebar_width+'px'); 6454 sitebarAd.css("max-width",sitebar_width+'px'); 6455 sitebar.css("max-height",'100vh'); 6456 6457 const sitebar_fixed = sitebar.data('fixed'); 6458 if (sitebar_fixed != 'false') { 6459 sitebarAd.css("position","fixed"); 6460 } 6461 6462 /* Resize sitebar when the window is resized */ 6463 $( window ).resize( function() { 6464 be_sitebarResize(wideLayout, sitebarBid); 6465 /* Resize to fix sitebar on page load. */ 6466 }).resize(); 6467 6468}
6468); 6469 6470/** 6471 * be_sitebarLeftResize 6472 */ 6473function be_sitebarLeftResize(wideLayout, sitebarBid) { 6474 const browser_scrollbar_width = 15; 6475 let offsetLeft = 460; 6476 let outerWidth = 980; 6477 const sitebarLeftContainer = '.Ad-skyscraper-left'; 6478 if (($('.SiteFooter').length) && (!wideLayout)) { 6479 offsetLeft = $('.SiteFooter').offset().left + browser_scrollbar_width; 6480 outerWidth = $('.SiteFooter').outerWidth(); 6481 } else if (($('.PageGallery').length) && (!wideLayout)) { 6482 offsetLeft = $('.PageGallery').offset().left + browser_scrollbar_width; 6483 outerWidth = $('.PageGallery').outerWidth(); 6484 } 6485 if (wideLayout === true) { 6486 let siteHeader = document.querySelector('.SiteHeader') || document.querySelector('.SiteHeaderSticky_firstLine-inner'); 6487 if (siteHeader) { 6488 let rect = siteHeader.getBoundingClientRect(); 6489 offsetLeft = rect.left + browser_scrollbar_width; 6490 6491 let siteHeaderStyles = window.getComputedStyle(siteHeader); 6492 outerWidth = parseFloat(siteHeaderStyles.getPropertyValue('width')); 6493 } 6494 } 6495 6496 let leftOffset = offsetLeft; 6497 leftOffset = Math.round(leftOffset); 6498 6499 if ($(sitebarLeftContainer + ' iframe.responsiveFrame').data("width") > leftOffset ) { 6500 $(sitebarLeftContainer + ' iframe.responsiveFrame').width(leftOffset); 6501 } 6502 6503 const iframeElLeft = document.querySelector('iframe.sitebarLeft'); 6504 let iFrameElLeftDocument = iframeElLeft.contentDocument || iframeElLeft.contentWindow.document; 6505 let imgSitebar = iFrameElLeftDocument.getElementById("sitebar"+sitebarBid); 6506 let imgSky = iFrameElLeftDocument.getElementById("sky"+sitebarBid); 6507 const offsetLowLmt = 140; 6508 const offsetUpLmt = 320; 6509 6510 if (imgSky && imgSitebar) { 6511 if ((offsetLeft >= offsetLowLmt) && (offsetLeft < offsetUpLmt)) { 6512 imgSitebar.style.display = "none"; 6513 imgSky.style.display = "inline"; 6514 } else if (offsetLeft >= offsetUpLmt) { 6515 imgSitebar.style.display = "inline"; 6516 imgSky.style.display = "none"; 6517 } 6518 else if (offsetLeft < offsetLowLmt) { 6519 imgSitebar.style.display = "none"; 6520 imgSky.style.display = "none"; 6521 } 6522 } 6523 6524 6525 const sitebarAd = $('.sitebarLeft').parent().parent(); 6526 const sitebar = $('.sitebarLeft'); 6527 const sitebar_width = sitebar.data('width'); 6528 const hideWidth = (sitebar.data('hidewidth') !== undefined ? sitebar.data('hidewidth') : 0) + 15; 6529 6530 if (leftOffset <= hideWidth) { 6531 sitebarAd.css('display', 'none'); 6532 return; 6533 } else { 6534 sitebarAd.css('display', 'block'); 6535 } 6536 6537 6538 let sidebarLeftMargin = Math.round(leftOffset); 6539 sitebarAd.css("margin-left","0px"); 6540 let currSitebar_width = sitebarAd[0].offsetWidth; 6541 6542 if (sitebar_width >= leftOffset ) { 6543 leftOffset = leftOffset-browser_scrollbar_width; 6544 6545 sitebar.width(leftOffset); 6546 sitebarAd.css("width",leftOffset+"px"); 6547 sitebar.css("width",leftOffset+"px"); 6548 6549 $(document).ready(function(){ 6550 const sitebarDOM = sitebar.contents(); 6551 sitebarDOM.find("iframe").css("width", leftOffset+"px"); 6552 const currWinHeight = $(window).height(); 6553 sitebarDOM.find("iframe").css("max-height", currWinHeight+"px"); 6554 }); 6555 } else if (sitebar_width < leftOffset) { 6556 let sbMarginLeft = leftOffset - browser_scrollbar_width - sitebar_width; 6557 6558 sitebarAd.css("width",sitebar_width+"px"); 6559 sitebar.css("width",sitebar_width+"px"); 6560 sitebarAd.css("margin-left",sbMarginLeft+"px"); 6561 } 6562} 6563 6564/** 6565 * sitebarLeft 6566 */ 6567$(document).on('sitebarLeft',function(event, wideLayout) { 6568 const sitebarLeftAd = $('.sitebarLeft').parent().parent(); 6569 const sitebarLeft = $('.sitebarLeft'); 6570 const sitebarLeftBid = sitebarLeft[0].getAttribute("data-bid"); 6571 const leftSitebarSlot = document.getElementById("renderSlot_Skyscraper-links"); 6572 leftSitebarSlot.classList.add("leftSitebarSlot"); 6573 6574 const sitebarLeft_width = sitebarLeft.data('width'); 6575 sitebarLeftAd.css("width",sitebarLeft_width+'px'); 6576 sitebarLeftAd.css("max-width",sitebarLeft_width+'px'); 6577 6578 const sitebarLeft_fixed = sitebarLeft.data('fixed'); 6579 if (sitebarLeft_fixed != 'false') { 6580 sitebarLeftAd.css("position","fixed"); 6581 } 6582 6583 const sbAdLeftMarginTop = sitebarLeft[0].getAttribute("data-margintop"); 6584 if (sbAdLeftMarginTop !== "0" && sbAdLeftMarginTop !== "NULL") { 6585 sitebarLeftAd.css("margin-top",sbAdLeftMarginTop+'px'); 6586 } 6587 6588 /* Resize sitebarLeft when the window is resized */ 6589 $( window ).resize( function() { 6590 be_sitebarLeftResize(wideLayout, sitebarLeftBid); 6591 /* Resize to fix sitebar on page load. */ 6592 }).resize(); 6593 6594 window.addEventListener('load', function() { 6595 be_sitebarLeftResize(wideLayout, sitebarLeftBid); 6596 }); 6597 6598 window.onload = function() { 6599 be_sitebarLeftResize(wideLayout, sitebarLeftBid); 6600 }; 6601 6602 6603}); 6604 6605/** 6606 * teadsResize 6607 * teads Videos 6608 */ 6609$(document).on('teadsResize',function(event){ 6610 const iframe = $('.video_ad'), 6611 aspect_ratio = 1.7, 6612 wrapper = iframe.parent(); 6613 6614 iframe.height(iframe.width()/aspect_ratio); 6615 6616 wrapper.css('display', 'flex'); 6617 wrapper.css('flex-flow','column'); 6618 iframe.css('align-self','center'); 6619}); 6620 6621/** 6622 * pushdown 6623 */ 6624$(document).on("pushdown", function(event, elementclass){ 6625 6626 const pushdown_iframe = $("." + elementclass); 6627 const pushdown_container = pushdown_iframe.parent(); 6628 6629 const ad_height = pushdown_iframe.data("height"); 6630 const ad_width = pushdown_iframe.data("width"); 6631 const ad_margin_bottom = parseInt(pushdown_container.css("height")) - ad_height; 6632 const pushdownheight = pushdown_iframe.data("pushdownheight") + ad_margin_bottom; 6633 const pushdowntime = pushdown_iframe.data("pushdowntime"); /* Dauer der Animation */ 6634 const closingtime = pushdown_iframe.data("closingtime") * 1000; /* Initiales Einfahren */ 6635 const pushdown_center_ad = pushdown_iframe.data("center_ad"); 6636 const pushdown_func = pushdown_iframe.data("pushdown-func") ? 1 : 0; 6637 const no_initialpushdown = pushdown_iframe.data("no_initialpushdown") ? 1 : 0; 6638 6639 /* Werbemittel zentrieren */ 6640 if(pushdown_center_ad == 1){ 6641 pushdown_container.css("text-align","center"); 6642 } 6643 6644 if(pushdown_func == 0){ 6645 6646 /* prevent too large iFrame-height on smaller stage */ 6647 let pushdown_iframeWidth = pushdown_iframe[0].clientWidth; 6648 let pushdownRatio = ad_height / ad_width;
6649 let pushdownHeight = Math.ceil(pushdown_iframeWidth * pushdownRatio); 6650 pushdown_iframe.css("height",pushdownHeight + "px"); 6651 6652 return; 6653 } 6654 6655 /* Nutzer-Handling */ 6656 pushdown_iframe.on("mouseover", function(event){ 6657 clearTimeout(waiting_for_closing); 6658 $(document).trigger('pushdown-animation', [pushdown_container, pushdown_iframe, '1', pushdownheight]); 6659 6660 pushdown_iframe.one("mouseout", function(event){ 6661 $(document).trigger('pushdown-animation', [pushdown_container, pushdown_iframe, '1', ad_height]); 6662 }); 6663 }); 6664 6665 /* Initiales Ausfahren */ 6666 if(no_initialpushdown != 1) { 6667 $(document).trigger('pushdown-animation', [pushdown_container, pushdown_iframe, pushdowntime, pushdownheight]); 6668 } 6669 6670 /* Einfahren nach initialem Ausfahren */ 6671 let waiting_for_closing = window.setTimeout(function(){ 6672 $(document).trigger('pushdown-animation', [pushdown_container, pushdown_iframe, pushdowntime, ad_height]); 6673 }, closingtime); 6674 6675}); 6676 6677/** 6678 * pushdown-animation 6679 */ 6680$(document).on("pushdown-animation", function(event, pushdown_container, pushdown_iframe, movingtime, newheight){ 6681 6682 pushdown_container.css({ 6683 height : newheight, 6684 WebkitTransition : 'height ' + movingtime + 's ease-in-out', 6685 MozTransition : 'height ' + movingtime + 's ease-in-out', 6686 MsTransition : 'height ' + movingtime + 's ease-in-out', 6687 OTransition : 'height ' + movingtime + 's ease-in-out', 6688 transition : 'height ' + movingtime + 's ease-in-out' 6689 }); 6690 pushdown_iframe.css({ 6691 height : newheight, 6692 WebkitTransition : 'height ' + movingtime + 's ease-in-out', 6693 MozTransition : 'height ' + movingtime + 's ease-in-out', 6694 MsTransition : 'height ' + movingtime + 's ease-in-out', 6695 OTransition : 'height ' + movingtime + 's ease-in-out', 6696 transition : 'height ' + movingtime + 's ease-in-out' 6697 }); 6698}); 6699 6700/** 6701 * parallax_outstream 6702 */ 6703$(document).on("parallax_outstream", function(event){ 6704 const iframe = $('.parallax_outstream'); 6705 const container = iframe.parent(); 6706 container.attr("id","parallax_outstream"); 6707 iframe.css("height","0px"); 6708 iframe.css("width","0px"); 6709}); 6710 6711/** 6712 * dynamic_sitebar 6713 */ 6714$(document).on("dynamic_sitebar", function(event){ 6715 const iframe = $('.dynamic_sitebar'); 6716 const container = iframe.parent(); 6717 const dynamic_space = ($('.PageFrame').outerWidth(true) - $('.PageFrame').outerWidth()) / 2; 6718 container.css("width", dynamic_space +"px"); 6719 container.css("position","fixed"); 6720}); 6721 6722/** 6723 * insertAdvTextDiv 6724 * 6725 * "Anzeige"-Position und Border an Werbemittelgroesse positionieren/anpassen 6726 */ 6727$(document).on("insertAdvTextDiv", function(event) { 6728 const $iframes = $('[id^="renderSlot_"] iframe'); 6729 let el = $('<div class="Ad_text"></div>'); 6730 6731 $iframes.each(function () { 6732 if ($(this).data("width") == '1') { 6733 $(this).parent('div').css('height', '0'); 6734 return; 6735 } 6736 6737 const slot = $(this).parent().parent(); 6738 if ($(this).parent().parent().length) { 6739 if (slot.attr('id').match(/renderSlot_(Super*|Sky*|Rectangle-Gal|Mobil-Rectangle-Gal)/)) { 6740 return; 6741 } 6742 } else { 6743 return; 6744 } 6745 if (slot.parent().length && slot.parent().hasClass() ){ 6746 if(slot.parent().attr('class').match(/slick-track/)){ 6747 /* SliderBannerArticleDetail_dots nur einblenden, wenn auch was geschaltet ist */ 6748 $('.SliderBannerArticleDetail_dots').css('display', 'block'); 6749 } 6750 } 6751 6752 const ad_text_div = $(this).parent().find($(".Ad_text")); 6753 const ad_text_parallax_div = $(this).parent().parent().find($(".Ad_text")); 6754 6755 ad_text_div.css('margin', ''); 6756 if ($(this).hasClass('parallax')) { 6757 6758 if(!ad_text_parallax_div.length > 0){ 6759 $(this).parent().parent('div').prepend(el); 6760 } 6761 ad_text_parallax_div.css("margin", "0 auto"); 6762 ad_text_parallax_div.css("width", '100%'); 6763 if ($(this).data("ad_text_bgc")) { 6764 ad_text_parallax_div.css("background-color", $(this).data("ad_text_bgc")); 6765 } 6766 if ($(this).data("ad_text_margintop")) { 6767 ad_text_parallax_div.css("margin-top", $(this).data("ad_text_margintop")); 6768 } 6769 if ($(this).data("ad_text_maxheight")) { 6770 ad_text_parallax_div.css("max-height", $(this).data("ad_text_maxheight")); 6771 } 6772 if ($(this).data("ad_text_noborder")) { 6773 ad_text_parallax_div.addClass('html5BannerBefore'); 6774 } 6775 ad_text_parallax_div.css("z-index", '10'); 6776 } else { 6777 if (!ad_text_div.length > 0) { 6778 $(this).parent('div').prepend(el); 6779 } 6780 if (slot.attr('id').match(/renderSlot_(Rectangle-Aufmacher)/)) { 6781 ad_text_div.css("width", '100%'); 6782 } else { 6783 ad_text_div.css("width", $(this).data("width")); 6784 ad_text_div.css("margin", "0 auto"); 6785 } 6786 6787 } 6788 6789 if (/[^-]?width\s?:\s?100%/.test($(this).attr('style'))) { 6790 ad_text_div.css("margin", "0 auto"); 6791 } 6792 el = el.clone(); 6793 }); 6794}); 6795 6796/** 6797 * fadeoutadvertisement 6798 * Hierüber kann eine Platzierung animiert ausgeblendet werden 6799 */ 6800$(document).on("fadeoutadvertisement", function(event){ 6801 6802 const iframe = $('.fadeoutadvertisement'); 6803 let container = iframe.parent(); 6804 container.animate({ 6805 height: "0px" 6806 }, 2000, function() { 6807 container.css("display","none"); 6808 }); 6809 6810}); 6811 6812/**
6813 * be_reduceBackgroundOpacity 6814 * @param element 6815 * @param opacity 6816 */ 6817function be_reduceBackgroundOpacity(element, opacity) { 6818 let backgroundColor = element.style.backgroundColor; 6819 if (backgroundColor.substring(0, 4) === "rgba") { 6820 /* if rgba format is already used, just update the alpha value */ 6821 backgroundColor = backgroundColor.replace(/[^,]+(?=\))/, opacity); 6822 } else { 6823 /* convert hexadecimal or RGB format to rgba format and add alpha value */ 6824 let r = 0, g = 0, b = 0; 6825 if (backgroundColor.substring(0, 1) === "#") { 6826 /* convert hexadecimal to RGB */ 6827 const hex = backgroundColor.substring(1); 6828 r = parseInt(hex.substring(0, 2), 16); 6829 g = parseInt(hex.substring(2, 4), 16); 6830 b = parseInt(hex.substring(4, 6), 16); 6831 } else if (backgroundColor.substring(0, 3) === "rgb") { 6832 /* extract RGB values from comma-separated string */ 6833 const values = backgroundColor.match(/\d+/g); 6834 r = parseInt(values[0]); 6835 g = parseInt(values[1]); 6836 b = parseInt(values[2]); 6837 } 6838 /* convert RGB to rgba */ 6839 backgroundColor = "rgba(" + r + ", " + g + ", " + b + ", " + opacity + ")"; 6840 } 6841 element.style.backgroundColor = backgroundColor; 6842} 6843 6844/** 6845 * be_changeBGColor 6846 * @param element 6847 * @param color1 6848 * @param color2 6849 * @param mixVal 6850 */ 6851function be_changeBGColor(element, color1, color2, mixVal) { 6852 const hexToRgb = function (hex) { 6853 const r = parseInt(hex.slice(1, 3), 16); 6854 const g = parseInt(hex.slice(3, 5), 16); 6855 const b = parseInt(hex.slice(5, 7), 16); 6856 6857 return [r, g, b]; 6858 }; 6859 6860 const rgbToHex = function (rgb) { 6861 const componentToHex = function (component) { 6862 const hex = component.toString(); 6863 return hex.length == 1 ? "0" + hex : hex; 6864 }; 6865 6866 const r = componentToHex(rgb[0]); 6867 const g = componentToHex(rgb[1]); 6868 const b = componentToHex(rgb[2]); 6869 6870 return "#" + r + g + b; 6871 }; 6872 6873 const color1Rgb = hexToRgb(color1); 6874 const color2Rgb = hexToRgb(color2); 6875 6876 const r = Math.round((1 - mixVal) * color1Rgb[0] + mixVal * color2Rgb[0]); 6877 const g = Math.round((1 - mixVal) * color1Rgb[1] + mixVal * color2Rgb[1]); 6878 const b = Math.round((1 - mixVal) * color1Rgb[2] + mixVal * color2Rgb[2]); 6879 6880 element.style.backgroundColor = rgbToHex([r, g, b]); 6881} 6882 6883/** 6884 * be_rgbToHex 6885 * @param rgb 6886 * @returns {string} 6887 */ 6888function be_rgbToHex(rgb) { 6889 /* Liefert nur die Ziffern 0-9 und a-f */ 6890 function hex(x) { 6891 return ("0" + parseInt(x).toString(16)).slice(-2); 6892 } 6893 6894 /* Konvertiere den RGB-String in eine Array */ 6895 const rgbArray = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/); 6896 /* Wandle die RGB-Werte in Hexadezimalwerte um */ 6897 return "#" + hex(rgbArray[1]) + hex(rgbArray[2]) + hex(rgbArray[3]); 6898} 6899 6900/** 6901 * welcomeAdVideo 6902 * WelcomeAd mit Video-URL, wird beim Scrollen ausgeblendet, hat Close-Button 6903 */ 6904$(document).on('welcomeAdVideo', function(event) { 6905 6906 let welcomeAdIframe = $('.welcomeFrame'); 6907 let wcVideoSrc = welcomeAdIframe.data('videosrc'); 6908 let wcVideoCodecs = welcomeAdIframe.data('videocodecs'); 6909 let wcBgColor = welcomeAdIframe.data('bgcolor'); 6910 let wcClickUrl = welcomeAdIframe.data('clickurl'); 6911 let wcStageMarginTop = welcomeAdIframe.data('stagemargintop'); 6912 let wcMuteButton = welcomeAdIframe.data('mutebutton'); 6913 let bodyEl = document.getElementsByTagName("BODY")[0]; 6914 let superbannerAd = document.getElementById('renderSlot_Superbanner'); 6915 let defaultBgColor = window.getComputedStyle(document.body).getPropertyValue('background-color'); 6916 defaultBgColor = be_rgbToHex(defaultBgColor); 6917 if(wcBgColor != 'default') { 6918 bodyEl.style.backgroundColor = wcBgColor; 6919 } 6920 let bgEl = document.createElement("div"); 6921 const stageEl = document.querySelector('.PageFrame'); 6922 bgEl.classList.add("wcVideo"); 6923 let videoEl = document.createElement("video"); 6924 videoEl.setAttribute("preload", "auto"); 6925 videoEl.setAttribute("loop", ""); 6926 //videoEl.setAttribute("autoplay", ""); 6927 videoEl.setAttribute("muted", ""); 6928 videoEl.classList.add("wcVideoTag"); 6929 6930 let wcCloseButton = document.createElement("button"); 6931 let closeBtnTxt = welcomeAdIframe.data('closebtntxt'); 6932 let wcCloseButtonText = closeBtnTxt != 'default' ? closeBtnTxt : 'schlieÃen'; 6933 wcCloseButton.classList.add("wcCloseButton"); 6934 wcCloseButton.prepend(wcCloseButtonText); 6935 6936 let playBtnTxt = welcomeAdIframe.data('playbtntxt'); 6937 let pauseBtnTxt = welcomeAdIframe.data('pausebtntxt'); 6938
6939 bgEl.prepend(videoEl); 6940 bodyEl.prepend(wcCloseButton); 6941 6942 if (playBtnTxt != 'default') { 6943 let wcPlayButton = document.createElement("button"); 6944 let wcPlayButtonText = welcomeAdIframe.data('playbtntxt'); 6945 let wcPauseButtonText = welcomeAdIframe.data('pausebtntxt'); 6946 wcPlayButton.classList.add("wcPlayButton"); 6947 wcPlayButton.prepend(wcPlayButtonText); 6948 bodyEl.prepend(wcPlayButton); 6949 } 6950 6951 if (wcMuteButton) { 6952 let wcMuteButtonEl = document.createElement("button"); 6953 wcMuteButtonEl.classList.add("wcMuteButton"); 6954 let wcMuteButtonElText = "<i class='fa fa-volume-off fa-2x'> </i>"; 6955 wcMuteButtonEl.innerHTML = wcMuteButtonElText; 6956 bodyEl.prepend(wcMuteButtonEl); 6957 6958 } 6959 6960 let sourceEl = document.createElement("source"); 6961 sourceEl.setAttribute("src", wcVideoSrc); 6962 sourceEl.setAttribute("type", "video/mp4"); 6963 sourceEl.setAttribute("codecs", wcVideoCodecs); 6964 6965 videoEl.prepend(sourceEl); 6966 bodyEl.prepend(bgEl); 6967 6968 function playWcVideo() { 6969 videoEl.play(); 6970 } 6971 6972 function pauseWcVideo() { 6973 videoEl.pause(); 6974 } 6975 6976 function toggleWcVideo() { 6977 if(wcVideo.paused){ 6978 wcVideo.play(); 6979 if (wcPlayButton) { 6980 wcPlayButton.className = "wcPauseButton"; 6981 if (playBtnTxt != 'default') { 6982 let wcPauseButtonText = welcomeAdIframe.data('pausebtntxt'); 6983 wcPlayButton.innerText = wcPauseButtonText; 6984 } 6985 6986 } 6987 }else{ 6988 wcVideo.pause(); 6989 if (wcPlayButton) { 6990 wcPlayButton.className = "wcPlayButton"; 6991 if (playBtnTxt != 'default') { 6992 let wcPlayButtonText = welcomeAdIframe.data('playbtntxt'); 6993 wcPlayButton.innerText = wcPlayButtonText; 6994 } 6995 } 6996 } 6997 6998 /* 6999 if(wcVideo.muted){ 7000 wcVideo.muted = false; 7001 }else{ 7002 wcVideo.muted = true; 7003 } 7004 */ 7005 } 7006 7007 function toggleMuteButton() { 7008 if (wcVideo.muted) { 7009 wcVideo.muted = false; 7010 wcMuteButtonEl.classList.add("wcMuteOn"); 7011 wcMuteButtonEl.classList.remove("wcMuteOff"); 7012 wcMuteButtonEl.innerHTML = "<i class='fa fa-volume-up fa-2x'> </i>"; 7013 } else { 7014 wcVideo.muted = true; 7015 wcMuteButtonEl.classList.add("wcMuteOff"); 7016 wcMuteButtonEl.classList.remove("wcMuteOn"); 7017 wcMuteButtonEl.innerHTML = "<i class='fa fa-volume-off fa-2x'> </i>"; 7018 } 7019 } 7020 7021 let wcVideo = document.getElementsByClassName("wcVideoTag")[0]; 7022 wcVideo.addEventListener("click", toggleWcVideo); 7023 wcVideo.muted = true; 7024 wcVideo.autoplay = true; 7025 7026 7027 let wcPlayButton = document.querySelector(".wcPlayButton"); 7028 wcPlayButton.innerText = pauseBtnTxt; 7029 7030 if (wcPlayButton) { 7031 wcPlayButton.addEventListener("click", toggleWcVideo); 7032 } 7033 7034 let wcPauseButton = document.querySelector(".wcPauseButton"); 7035 if (wcPauseButton) { 7036 wcPauseButton.addEventListener("click", toggleWcVideo); 7037 } 7038 7039 let wcMuteButtonEl = document.querySelector(".wcMuteButton"); 7040 if (wcMuteButtonEl) { 7041 wcMuteButtonEl.addEventListener("click", toggleMuteButton); 7042 } 7043 7044 /* clickable background -> */ 7045 const wcMouseOverHandler = function (event) { 7046 if (event.target === document.body) { 7047 document.body.style.cursor = 'pointer'; 7048 } 7049 }; 7050 document.addEventListener('mouseover', wcMouseOverHandler); 7051 7052 const wcMouseOutHandler = function (event) { 7053 if (event.target === document.body) { 7054 document.body.style.cursor = 'auto'; 7055 } 7056 }; 7057 document.addEventListener('mouseout', wcMouseOutHandler); 7058 7059 const clickHandler = function (event) { 7060 if (event.target === document.body) { 7061 window.open(wcClickUrl, '_blank'); 7062 } 7063 }; 7064 document.addEventListener('click', clickHandler); 7065 /* <- clickable background */ 7066 7067 function fadeOutOnScroll(element, stageEl) { 7068 if (!element || !stageEl) { 7069 return; 7070 } 7071 7072 let distanceToTop = window.pageYOffset + element.getBoundingClientRect().top; 7073 const elementHeight = element.offsetHeight; 7074 const scrollTop = document.documentElement.scrollTop; 7075 7076 let opacity = 1; 7077 distanceToTop = 0; 7078 element.style.position = 'fixed'; 7079 7080 if (scrollTop > distanceToTop) { 7081 opacity = 1 - (scrollTop - distanceToTop) / elementHeight; 7082 opacity = (opacity < 0) ? 0 : opacity; 7083 opacity = (opacity > 0.95) ? 1 : opacity; 7084 } 7085 7086 if (opacity >= 0) { 7087 element.style.opacity = opacity;
7088 /* be_reduceBackgroundOpacity(superbannerAd, opacity); */ 7089 if(wcBgColor != 'default') { 7090 be_changeBGColor(bodyEl, defaultBgColor, wcBgColor, opacity); 7091 } 7092 } 7093 } 7094 7095 function scrollHandler() { 7096 fadeOutOnScroll(wcVideo, bgEl); 7097 } 7098 7099 window.addEventListener('scroll', scrollHandler, {passive: true}); 7100 7101 /** 7102 * Close Button 7103 */ 7104 function closeWcVideo() { 7105 wcVideo.remove(); 7106 bodyEl.style.backgroundColor = defaultBgColor; 7107 superbannerAd.firstElementChild.remove(); 7108 wcCloseButton.remove(); 7109 if (wcPlayButton) { 7110 wcPlayButton.remove(); 7111 } 7112 if (wcMuteButtonEl) { 7113 wcMuteButtonEl.remove(); 7114 } 7115 window.removeEventListener('scroll', scrollHandler, {passive: true}); 7116 document.removeEventListener('click', clickHandler); 7117 document.removeEventListener('mouseover', wcMouseOverHandler); 7118 document.removeEventListener('mouseout', wcMouseOutHandler); 7119 stageEl.style.transition = 'margin 1s'; 7120 stageEl.style.marginTop = '0px'; 7121 } 7122 7123 wcCloseButton.addEventListener("click", closeWcVideo); 7124 7125 /* wait until bg-video is available */ 7126 let wcInterval = setInterval(function() { 7127 document.getElementById("renderSlot_Superbanner").style.height = "0"; 7128 if (videoEl) { 7129 clearInterval(wcInterval); 7130 let OriginalStageMarginTop = wcStageMarginTop; 7131 let videoElStyle = getComputedStyle(videoEl); 7132 let videoElHeight = parseInt(videoElStyle.height); 7133 let videoElOrigHeight = videoEl.naturalHeight; 7134 videoElOrigHeight = videoElOrigHeight || welcomeAdIframe.data('height'); 7135 if (videoElHeight > videoElOrigHeight) { 7136 7137 videoElHeight = videoElOrigHeight; 7138 } 7139 7140 let videoElRatio = (videoElHeight / videoElOrigHeight).toFixed(2); 7141 let StageMarginTop = Math.round(OriginalStageMarginTop * videoElRatio); 7142 7143 stageEl.style.marginTop = StageMarginTop+'px'; 7144 } 7145 clearInterval(wcInterval); 7146 }, 200); 7147 7148}); 7149 7150/** 7151 * welcomeAdImage 7152 * WelcomeAd mit Hintergrund-Image, wird beim Scrollen ausgeblendet, hat Close-Button 7153 */ 7154$(document).on('welcomeAdImage', function(event) { 7155 7156 let welcomeAd = $('.welcomeFrame').parent().parent(); 7157 let welcomeAdIframe = $('.welcomeFrame'); 7158 let wcBgColor = welcomeAdIframe.data('bgcolor'); 7159 let wcClickUrl = welcomeAdIframe.data('clickurl'); 7160 let bodyEl = document.getElementsByTagName("BODY")[0]; 7161 let superbannerAd = document.getElementById('renderSlot_Superbanner'); 7162 let defaultBgColor = window.getComputedStyle(document.body).getPropertyValue('background-color'); 7163 defaultBgColor = be_rgbToHex(defaultBgColor); 7164 7165 if(wcBgColor != 'default') { 7166 bodyEl.style.backgroundColor = wcBgColor; 7167 } 7168 let bgEl = document.createElement("div"); 7169 const stageEl = document.querySelector('.PageFrame'); 7170 7171 bgEl.classList.add("wcBgImage"); 7172 let imgEl = document.createElement("img"); 7173 imgEl.classList.add("wcBgImageTag"); 7174 7175 let wcCloseButton = document.createElement("button"); 7176 let closeBtnTxt = welcomeAdIframe.data('closebtntxt'); 7177 let wcCloseButtonText = closeBtnTxt != 'default' ? closeBtnTxt : 'schlieÃen'; 7178 7179 wcCloseButton.classList.add("wcCloseButton"); 7180 wcCloseButton.prepend(wcCloseButtonText); 7181 7182 bgEl.prepend(imgEl); 7183 bodyEl.prepend(wcCloseButton); 7184 7185 let bgImgSource = welcomeAdIframe.data('bgimagesrc'); 7186 7187 imgEl.setAttribute('src',bgImgSource); 7188 bodyEl.prepend(bgEl); 7189 7190 /* clickable background -> */ 7191 const wcMouseOverHandler = function (event) { 7192 if (event.target === document.body) { 7193 document.body.style.cursor = 'pointer'; 7194 } 7195 }; 7196 document.addEventListener('mouseover', wcMouseOverHandler); 7197 7198 const wcMouseOutHandler = function (event) { 7199 if (event.target === document.body) { 7200 document.body.style.cursor = 'auto'; 7201 } 7202 }; 7203 document.addEventListener('mouseout', wcMouseOutHandler); 7204 7205 const clickHandler = function (event) { 7206 if (event.target === document.body) { 7207 window.open(wcClickUrl, '_blank'); 7208 } 7209 }; 7210 document.addEventListener('click', clickHandler); 7211 /* <- clickable background */ 7212 7213 /* Superbanner in Hintergrund und sticky -> */ 7214 superbannerAd.classList.add("wcfixedSuperbanner"); 7215 const stageElStyles = window.getComputedStyle(stageEl); 7216 const stageElMarginTop = stageElStyles.getPropertyValue('margin-top'); 7217 stageEl.style.marginTop = superbannerAd.offsetHeight+'px'; 7218 /* 7219 * Calculation of the distance from the stage to the top of the screen 7220 * in a fixed ratio of 1080 (width of background image) to 520 (original distance from stage to top of screen) 7221 */ 7222 let wcInterval2 = setInterval(function() { 7223 7224 if (imgEl) { 7225 clearInterval(wcInterval2); 7226 7227 let imgElStyle = getComputedStyle(imgEl); 7228 let imgElCurrHeight = parseInt(imgElStyle.height); 7229 7230 let imgHeight = 520; 7231 /* let imgElOrigHeight = 1080; */ 7232 let imgElOrigHeight = 720; 7233 let imgElRatio = (imgHeight / imgElOrigHeight).toFixed(2); 7234 let StageMarginTop = Math.round(imgElCurrHeight * imgElRatio); 7235 7236 stageEl.style.marginTop = StageMarginTop+'px'; 7237 } 7238 clearInterval(wcInterval2); 7239 }, 200); 7240 7241 7242 /* <- Superbanner in Hintergrund und sticky */ 7243 7244 /* clickable superbanner -> */ 7245 7246 superbannerAd.addEventListener('mouseover', function() { 7247 superbannerAd.style.cursor = 'pointer'; 7248 }); 7249 7250 superbannerAd.addEventListener('mouseout', function() { 7251 superbannerAd.style.cursor = 'auto'; 7252 }); 7253 7254 superbannerAd.addEventListener('click', function() { 7255 window.open(wcClickUrl, '_blank'); 7256 }); 7257 /* <- clickable superbanner */ 7258 7259 function fadeOutOnScroll(element, stageEl) { 7260 if (!element || !stageEl) { 7261 return; 7262 } 7263 7264 let distanceToTop = window.pageYOffset + element.getBoundingClientRect().top; 7265 const elementHeight = element.offsetHeight; 7266 const scrollTop = document.documentElement.scrollTop; 7267 7268 let opacity = 1; 7269 distanceToTop = 0; 7270 element.style.position = 'fixed'; 7271 7272 if (scrollTop > distanceToTop) { 7273 opacity = 1 - (scrollTop - distanceToTop) / elementHeight; 7274 opacity = (opacity < 0) ? 0 : opacity; 7275 opacity = (opacity > 0.95) ? 1 : opacity; 7276 } 7277 7278 if (opacity >= 0) { 7279 element.style.opacity = opacity;
7280 /* be_reduceBackgroundOpacity(superbannerAd, opacity); */ 7281 if(wcBgColor != 'default') { 7282 be_changeBGColor(bodyEl, defaultBgColor, wcBgColor, opacity); 7283 } 7284 } 7285 } 7286 7287 function scrollHandler() { 7288 fadeOutOnScroll(bgEl, stageEl); 7289 } 7290 7291 window.addEventListener('scroll', scrollHandler, {passive: true}); 7292 7293 /* 7294 * Close Button 7295 */ 7296 function closewcBgImage() { 7297 bgEl.remove(); 7298 bodyEl.style.backgroundColor = defaultBgColor; 7299 superbannerAd.firstElementChild.remove(); 7300 wcCloseButton.remove(); 7301 window.removeEventListener('scroll', scrollHandler, {passive: true}); 7302 document.removeEventListener('click', clickHandler); 7303 document.removeEventListener('mouseover', wcMouseOverHandler); 7304 document.removeEventListener('mouseout', wcMouseOutHandler); 7305 stageEl.style.transition = "margin-top 0.5s ease"; 7306 stageEl.style.marginTop = stageElMarginTop; 7307 } 7308 7309 wcCloseButton.addEventListener("click", closewcBgImage); 7310 7311}); 7312 7313/** 7314 * welcomeAdVideoMobil 7315 * WelcomeAd mit Video-URL für Mobil, hat Close-Button 7316 */ 7317$(document).on('welcomeAdVideoMobil', function(event) { 7318 7319 let welcomeAdIframe = document.getElementById('welcomeFrameMobil'); 7320 7321 let bodyEl = document.getElementsByTagName("BODY")[0]; 7322 let superbannerAd = document.getElementById('renderSlot_Mobil-Superbanner'); 7323 7324 let wcCloseButton = document.createElement("button"); 7325 let closeBtnTxt = welcomeAdIframe.getAttribute('data-closebtntxt'); 7326 let wcCloseButtonText = closeBtnTxt != 'default' ? closeBtnTxt : 'schlieÃen'; 7327 wcCloseButton.classList.add("wcCloseButtonMobil"); 7328 wcCloseButton.prepend(wcCloseButtonText); 7329 7330 bodyEl.prepend(wcCloseButton); 7331 7332 let adHeight = superbannerAd.clientHeight; 7333 7334 welcomeAdIframe.style.position = "fixed"; 7335 welcomeAdIframe.style.zIndex = "-1"; 7336 superbannerAd.style.height = adHeight+"px"; 7337 7338 wcCloseButton.style.top = adHeight-35+"px"; 7339 7340 7341 /* 7342 * Create Video Tag 7343 */ 7344 let bgEl = document.createElement("div"); 7345 bgEl.classList.add("wcVideo"); 7346 bgEl.classList.add("wcMobil"); 7347 7348 let videoEl = document.createElement("video"); 7349 videoEl.setAttribute("preload", "auto"); 7350 videoEl.setAttribute("loop", ""); 7351 videoEl.setAttribute("muted", ""); 7352 videoEl.setAttribute("id", "wcVideoTag"); 7353 videoEl.classList.add("wcVideoTag"); 7354 7355 let wcVideoSrc = welcomeAdIframe.getAttribute('data-videosrc'); 7356 let wcVideoCodecs = welcomeAdIframe.getAttribute('data-videocodecs'); 7357 let sourceEl = document.createElement("source"); 7358 sourceEl.setAttribute("src", wcVideoSrc); 7359 sourceEl.setAttribute("type", "video/mp4"); 7360 sourceEl.setAttribute("codecs", wcVideoCodecs); 7361 7362 videoEl.prepend(sourceEl); 7363 bgEl.prepend(videoEl); 7364 bodyEl.prepend(bgEl); 7365 7366 7367 7368 /* 7369 * Close Button 7370 */ 7371 function closeWcVideo() { 7372 superbannerAd.remove(); 7373 wcCloseButton.remove(); 7374 wcPlayButton.remove(); 7375 } 7376 7377 wcCloseButton.addEventListener("click", closeWcVideo); 7378 7379 7380 /* 7381 * Play/Stop Button 7382 */ 7383 let wcPlayBtnTxt = welcomeAdIframe.getAttribute('data-playbtntxt'); 7384 let wcPauseBtnTxt = welcomeAdIframe.getAttribute('data-pausebtntxt'); 7385 7386 let wcPlayButton = document.createElement("button"); 7387 wcPlayButton.classList.add("wcPlayButtonMobil"); 7388 wcPlayButton.prepend(wcPlayBtnTxt); 7389 bodyEl.prepend(wcPlayButton); 7390 7391 wcPlayButton.style.top = adHeight-35+"px"; 7392 7393 wcPlayButton.addEventListener("click", toggleWcVideo); 7394 7395 let wcVideo = document.getElementById('wcVideo'); 7396 wcVideo = videoEl; 7397 7398 function toggleWcVideo() { 7399 if(wcVideo.paused){ 7400 wcVideo.play(); 7401 if (wcPlayButton) { 7402 wcPlayButton.className = "wcPauseButtonMobil"; 7403 if (wcPlayBtnTxt != 'default') { 7404 wcPlayButton.innerText = wcPauseBtnTxt; 7405 } 7406 7407 } 7408 }else{ 7409 wcVideo.pause(); 7410 if (wcPlayButton) { 7411 wcPlayButton.className = "wcPlayButtonMobil"; 7412 if (wcPlayBtnTxt != 'default') { 7413 wcPlayButton.innerText = wcPlayBtnTxt; 7414 } 7415 } 7416 } 7417 7418 /* 7419 if(wcVideo.muted){ 7420 wcVideo.muted = false; 7421 }else{ 7422 wcVideo.muted = true; 7423 } 7424 */ 7425 } 7426 7427}); 7428 7429/** 7430 * dfvSolutionAd 7431 * Hierüber werden Funktionalitäten der dfv solution arena angestoÃen 7432 */ 7433$(document).on("dfvSolutionAd", function(event){ 7434 7435 const dfv_sol_arena_ad_div = document.getElementById('div_dfvSolutionAd'); 7436 const dfv_sol_arena_ad_iframe = document.getElementById('frame_dfvSolutionAd'); 7437 7438 const dfv_sol_arena_ad_iframe_width = dfv_sol_arena_ad_iframe.getAttribute('data-width'); 7439 const dfv_sol_arena_ad_iframe_height = dfv_sol_arena_ad_iframe.getAttribute('data-height'); 7440
7441 dfv_sol_arena_ad_iframe.setAttribute('height',dfv_sol_arena_ad_iframe_height); 7442 dfv_sol_arena_ad_iframe.setAttribute('width',dfv_sol_arena_ad_iframe_width); 7443 7444 dfv_sol_arena_ad_div.classList.remove('noAdHint'); 7445 7446}); 7447 7448/** 7449 * welcomeAdImageMobil 7450 * WelcomeAd mit Grafik für Mobil, hat Close-Button 7451 */ 7452$(document).on('welcomeAdImageMobil', function(event) { 7453 7454 let welcomeAdIframe = document.getElementById('welcomeFrameMobil'); 7455 7456 let bodyEl = document.getElementsByTagName("BODY")[0]; 7457 let superbannerAd = document.getElementById('renderSlot_Mobil-Superbanner'); 7458 7459 let wcCloseButton = document.createElement("button"); 7460 let closeBtnTxt = welcomeAdIframe.getAttribute('data-closebtntxt'); 7461 let wcCloseButtonText = closeBtnTxt != 'default' ? closeBtnTxt : 'schlieÃen'; 7462 wcCloseButton.classList.add("wcCloseButtonMobil"); 7463 wcCloseButton.prepend(wcCloseButtonText); 7464 7465 bodyEl.prepend(wcCloseButton); 7466 7467 let adHeight = superbannerAd.clientHeight; 7468 7469 welcomeAdIframe.style.position = "fixed"; 7470 welcomeAdIframe.style.zIndex = "-1"; 7471 superbannerAd.style.height = adHeight+"px"; 7472 7473 wcCloseButton.style.top = adHeight-50+"px"; 7474 7475 /* 7476 * Close Button 7477 */ 7478 function closeWcVideo() { 7479 superbannerAd.remove(); 7480 wcCloseButton.remove(); 7481 } 7482 7483 wcCloseButton.addEventListener("click", closeWcVideo); 7484 7485}); 7486 7487/** 7488 * be_isClassSet 7489 * @param el 7490 * @param className 7491 * @returns {boolean} 7492 */ 7493function be_isClassSet(el,className) { 7494 const element = document.querySelector(el); 7495 if(element.classList.contains(className)) { 7496 return true; 7497 } 7498} 7499 7500/** 7501 * be_html5sitebarResize 7502 * @param sbWidth 7503 * @param sbHeight 7504 */ 7505function be_html5sitebarResize(sbWidth, sbHeight) { 7506 const browser_scrollbar_width = 15; 7507 let offsetLeft = 460; 7508 let outerWidth = 980; 7509 const sitebarContainer = '.Ad-skyscraper-right'; 7510 if ($('.SiteFooter').length) { 7511 offsetLeft = $('.SiteFooter').offset().left + browser_scrollbar_width; 7512 outerWidth = $('.SiteFooter').outerWidth(); 7513 } else if ($('.PageGallery').length) { 7514 offsetLeft = $('.PageGallery').offset().left + browser_scrollbar_width; 7515 outerWidth = $('.PageGallery').outerWidth(); 7516 } 7517 7518 let rightOffset = $(this).width() - (offsetLeft + outerWidth); 7519 rightOffset = Math.floor(rightOffset); 7520 7521 if ($(sitebarContainer + ' iframe.responsiveFrame').data("width") > rightOffset ) { 7522 $(sitebarContainer + ' iframe.responsiveFrame').width(rightOffset); 7523 7524 const bannerFrame = document.getElementById("sitebar"); 7525 const innerBannerFrame = bannerFrame.contentWindow.document.getElementsByTagName("iframe")[0]; 7526 7527 const imgRatio = sbHeight / sbWidth; 7528 const imgHeight = rightOffset * imgRatio; 7529 7530 const bannerImg = innerBannerFrame.contentWindow.document.getElementsByTagName("img")[1]; 7531 bannerImg.style.width = rightOffset+"px"; 7532 bannerImg.style.height = imgHeight+"px"; 7533 7534 } 7535 7536 const sitebarAd = $('.sitebar').parent().parent(); 7537 const sitebar = $('.sitebar'); 7538 const sitebar_width = sitebar.data('width'); 7539 7540 7541 if (sitebar_width > rightOffset ) { 7542 sitebar.width(rightOffset); 7543 sitebarAd.css("width",rightOffset+"px"); 7544 sitebar.css("width",rightOffset+"px"); 7545 7546 $(document).ready(function(){ 7547 const sitebarDOM = sitebar.contents(); 7548 sitebarDOM.find("iframe").css("width", rightOffset+"px"); 7549 const currWinHeight = $(window).height(); 7550 sitebarDOM.find("iframe").css("max-height", currWinHeight+"px"); 7551 }); 7552 } 7553} 7554 7555$(document).on('html5sitebar',function(event) { 7556 7557 const sitebarAd = $('.sitebar').parent().parent(); 7558 const sitebar = $('.sitebar'); 7559 7560 if ( sitebar.data('bgcolor') ) { 7561 const bg_color = sitebar.data('bgcolor'); 7562 if ( bg_color.startsWith("#") ) { 7563 document.getElementsByTagName('body')[0].style.backgroundColor = bgcolor; 7564 } 7565 } 7566 7567 const sitebar_width = sitebar.data('width'); 7568 const sitebar_height = sitebar.data('height'); 7569 7570 sitebarAd.css("width",sitebar_width+'px'); 7571 sitebarAd.css("max-width",sitebar_width+'px'); 7572 7573 const sitebar_fixed = sitebar.data('fixed'); 7574 if (sitebar_fixed != 'false') { 7575 sitebarAd.css("position","fixed"); 7576 } 7577 7578 setTimeout(function(){ 7579 /* Resize sitebar when the window is resized */ 7580 $( window ).resize( function() { 7581 be_html5sitebarResize(sitebar_width, sitebar_height); 7582 /* Resize to fix sitebar on page load. */ 7583 }).resize(); 7584 },1000); 7585 7586}); 7587 7588function be_sitebarSwitchResize(wideLayout, sitebarBid, switchPointSky, switchPointSitebar) { 7589 const browser_scrollbar_width = 0; 7590 let offsetLeft = 460; 7591 let outerWidth = 980; 7592 const sitebarContainer = '.Ad-skyscraper-right'; 7593 if (($('.SiteFooter').length) && (!wideLayout)) { 7594 offsetLeft = $('.SiteFooter').offset().left + browser_scrollbar_width; 7595 outerWidth = $('.SiteFooter').outerWidth(); 7596 } else if (($('.PageGallery').length) && (!wideLayout)) { 7597 offsetLeft = $('.PageGallery').offset().left + browser_scrollbar_width; 7598 outerWidth = $('.PageGallery').outerWidth(); 7599 } 7600 7601 if (wideLayout === true) { 7602 let siteHeader = document.querySelector('.SiteHeader'); 7603 if (siteHeader) { 7604 let rect = siteHeader.getBoundingClientRect(); 7605 offsetLeft = rect.left + browser_scrollbar_width; 7606 let siteHeaderStyles = window.getComputedStyle(siteHeader); 7607 outerWidth = parseFloat(siteHeaderStyles.getPropertyValue('width')); 7608 } 7609 } 7610 7611 let rightOffset = $(this).width() - (offsetLeft + outerWidth); 7612 rightOffset = Math.floor(rightOffset); 7613 const sbContainer = $(sitebarContainer + ' iframe.responsiveFrame'); 7614 const sbContainerWidth = sbContainer[0].clientWidth; 7615 7616 if (rightOffset >= switchPointSky ) { 7617 sbContainer.width(switchPointSky); 7618 } 7619 7620 if (rightOffset > switchPointSitebar ) { 7621 sbContainer.width(rightOffset); 7622 } 7623 7624 const sitebarAd = $('.sitebar').parent().parent(); 7625 const sitebar = $('.sitebar'); 7626 const sitebar_width = sitebar.data('width'); 7627 7628 7629 if (sitebar_width > rightOffset ) { 7630 sitebar.width(rightOffset); 7631 sitebarAd.css("width",rightOffset+"px"); 7632 sitebar.css("width",rightOffset+"px"); 7633 7634 $(document).ready(function(){ 7635 const sitebarDOM = sitebar.contents(); 7636 sitebarDOM.find("iframe").css("width", rightOffset+"px"); 7637 const currWinHeight = $(window).height(); 7638 sitebarDOM.find("iframe").css("max-height", currWinHeight+"px"); 7639 }); 7640 } 7641} 7642 7643/** 7644 * sitebar-switch 7645 */ 7646$(document).on('sitebar-switch', function(event, be_domainsContainerClass, wideLayout) { 7647 function selectSkyAd() { 7648 7649 const sitebarSwitch = document.getElementById("sitebarSwitch"); 7650 7651 if (sitebarSwitch) { 7652 const viewtagSkyOrig = sitebarSwitch.getAttribute('data-viewtag_sky'); 7653 const clicktagSky = sitebarSwitch.getAttribute('data-clicktag_sky'); 7654 const viewtagSitebarOrig = sitebarSwitch.getAttribute('data-viewtag_sb'); 7655 const clicktagSitebar = sitebarSwitch.getAttribute('data-clicktag_sb'); 7656 const switchPointSky = sitebarSwitch.getAttribute('data-sp_sky'); 7657 const switchPointSitebar = sitebarSwitch.getAttribute('data-sp_sb'); 7658 const bid = sitebarSwitch.getAttribute('data-bid'); 7659 const viewtagSky = removeWptParam(viewtagSkyOrig); 7660 const viewtagSitebar = removeWptParam(viewtagSitebarOrig); 7661 7662 function getContainerClassForHostname(hostname, domainConfig) { 7663 hostname = hostname.toLowerCase(); 7664 /* exakte Ãbereinstimmung? */ 7665 if (Object.prototype.hasOwnProperty.call(domainConfig, hostname)) { 7666 return domainConfig[hostname]; 7667 } 7668 /* partielle Ãbereinstimmungen? */ 7669 for (const domain of Object.keys(domainConfig)) { 7670 if (hostname.endsWith(domain.toLowerCase())) { 7671 return domainConfig[domain]; 7672 } 7673 } 7674 /* default bei keiner Ãbereinstimmung */ 7675 return domainConfig['default']; 7676 } 7677 7678 const currentHostname = window.location.hostname; 7679 const containerClass = getContainerClassForHostname(currentHostname, be_domainsContainerClass); 7680 /* console.log(`Container class für ${currentHostname}: ${containerClass}`); */ 7681 7682 const pageFrame = document.querySelector('.' + containerClass); 7683 const skyRight = document.querySelector('.Ad-skyscraper-right'); 7684 7685 if (pageFrame && skyRight) { 7686 7687 /* Abstand Bühne zu rechten Rand */ 7688 7689 const rect = pageFrame.getBoundingClientRect(); 7690 const distanceToRight = window.innerWidth - rect.right; 7691 7692 /* img suchen und src ersetzen */ 7693 const sbSwitchDocument = sitebarSwitch.contentDocument || sitebarSwitch.contentWindow.document; 7694 const imgElement = sbSwitchDocument.getElementById('banner-'+bid); 7695 7696 if (distanceToRight >= switchPointSitebar) { 7697 if (imgElement) { 7698 imgElement.src = viewtagSitebar; 7699 console.log('viewtagSitebar in src eingefügt'); 7700 7701 skyRight.style.width = 'inherit'; 7702 7703 const anchorElement = imgElement.closest('a'); 7704 if (anchorElement) { 7705 anchorElement.href = clicktagSitebar; 7706 } 7707 } else { 7708 console.log('Bild nicht gefunden.'); 7709 } 7710 7711 } else if (distanceToRight >= switchPointSky && distanceToRight < switchPointSitebar) { 7712 if (imgElement) { 7713 imgElement.src = viewtagSky; 7714 console.log('viewtagSky in src eingefügt'); 7715 const anchorElement = imgElement.closest('a'); 7716 if (anchorElement) { 7717 anchorElement.href = clicktagSky; 7718 } 7719 } else { 7720 console.log('kein img-Tag gefunden!'); 7721 } 7722 } 7723 7724 /* Resize sitebar when the window is resized */ 7725 $( window ).resize( function() { 7726 be_sitebarSwitchResize(wideLayout, bid, switchPointSky, switchPointSitebar); 7727 /* Resize to fix sitebar on page load. */ 7728 }).resize(); 7729 7730 } 7731 7732 } 7733 } 7734 7735 function removeWptParam(imgTag) { 7736 7737 const srcMatch = imgTag.match(/src="([^"]+)"/); 7738 7739 if (!srcMatch) return null; 7740 7741 let src = srcMatch[1]; 7742 let [base, query] = src.split('?'); 7743 if (!query) return src; 7744 7745 let filteredParams = query.split('&').filter(param => param !== 'wpt=C'); 7746 let newSrc = `${base}?${filteredParams.join('&')}`; 7747 return newSrc; 7748 } 7749 7750 const switchObserver = new MutationObserver((mutationsList, observer) => { 7751 if (sitebarSwitch) { 7752 selectSkyAd(); 7753 switchObserver.disconnect(); 7754 } 7755 }); 7756 switchObserver.observe(document.body, { childList: true, subtree: true }); 7757 7758}); 7759 7760 7761/** 7762 * clsAlignBillboard 7763 */ 7764$(document).one("clsAlignBillboard", function(event){ 7765 if (be_isClassSet('body','variableSlotHeight')) { 7766 let bannerElm = document.getElementById("renderSlot_Billboard"); 7767 if (!bannerElm) { return; } 7768 bannerElm.classList.add("variableSlotHeight"); 7769 return; 7770 }
7771 if ($("#renderSlot_Billboard > div > iframe").length){ 7772 let bannerFrame = $("#renderSlot_Billboard > div > iframe"); 7773 let bannerFrameHeight = bannerFrame.height(); 7774 if (bannerFrameHeight < 250) { 7775 let bannerMargin = 250 - Math.round(bannerFrameHeight); 7776 bannerFrame.css('marginTop',bannerMargin); 7777 } 7778 } 7779 if ($("#renderSlot_Mobil-Rectangle-1 > div > iframe").length){ 7780 if (be_isClassSet('body','variableSlotHeight')) { 7781 let bannerElm = document.getElementById("renderSlot_Mobil-Billboard"); 7782 bannerElm.classList.add("variableSlotHeight"); 7783 return; 7784 } 7785 let bannerFrame = $("#renderSlot_Mobil-Rectangle-1 > div > iframe"); 7786 let bannerFrameHeight = bannerFrame.height(); 7787 if (bannerFrameHeight < 93) { 7788 let bannerMargin = 93 - Math.round(bannerFrameHeight); 7789 bannerFrame.css('marginTop',bannerMargin); 7790 } 7791 7792 } 7793}); 7794 7795/** 7796 * ClsAlignSuperbanner 7797 */ 7798$(document).one("clsAlignSuperbanner", function(event){ 7799 if ($("#renderSlot_Mobil-Superbanner > div > iframe").length) { 7800 if (be_isClassSet('body','variableSlotHeight')) { 7801 let bannerElm = document.getElementById("renderSlot_Mobil-Superbanner"); 7802 bannerElm.classList.add("variableSlotHeight"); 7803 return; 7804 } 7805 const bannerFrame = $("#renderSlot_Mobil-Superbanner > div > iframe"); 7806 const bannerFrameHeight = bannerFrame.height(); 7807 if (bannerFrameHeight < 93) { 7808 const bannerMargin = 93 - Math.round(bannerFrameHeight); 7809 bannerFrame.css('marginTop',bannerMargin); 7810 } 7811 } 7812}); 7813 7814/** 7815 * alignSkyscraperLeft 7816 */ 7817$(document).one("alignSkyscraperLeft", function(event){ 7818 if ($("#renderSlot_Skyscraper-links > div > iframe").length) { 7819 7820 let leftSkyEl = document.getElementById("renderSlot_Skyscraper-links"); 7821 if (leftSkyEl.classList.contains("leftSitebarSlot")) { 7822 return; 7823 } 7824 7825 let elementSkyLeft = document.querySelector('.Ad-skyscraper-left'); 7826 let style = window.getComputedStyle(elementSkyLeft); 7827 let marginLeftSkyLeft = parseFloat(style.getPropertyValue('margin-left')); 7828 7829 const bannerFrame = $("#renderSlot_Skyscraper-links > div > iframe"); 7830 let bannerFrameWidth = bannerFrame.data("width"); 7831 if (bannerFrameWidth) { 7832 let offset = bannerFrameWidth - Math.abs(marginLeftSkyLeft); 7833 offset = Math.abs(offset); 7834 if (offset <= 20) { /* wenn versucht wurde durch css Abstand zur Bühne herzustellen */ 7835 bannerFrameWidth = bannerFrameWidth + offset; 7836 } 7837 $("#renderSlot_Skyscraper-links").css("margin-left","-" + bannerFrameWidth + "px"); 7838 $("#renderSlot_Skyscraper-links").css("width", bannerFrameWidth + "px"); 7839 } 7840 } 7841}); 7842 7843/** 7844 * bbReminder 7845 * Billboard 7846 */ 7847$(document).one("bbReminder", function(event){ 7848 7849 /* Billboard-Element auswählen */ 7850 const billboard = document.getElementById("renderSlot_Billboard"); 7851 const billboardIFrame = document.querySelector("#renderSlot_Billboard > div > iframe"); 7852 const bBInitialHeight = billboardIFrame.getAttribute('data-height'); 7853 let reminderTime = billboardIFrame.getAttribute('data-remtime')*1000; 7854 let reminderImg = billboardIFrame.getAttribute('data-remurl'); 7855 let isFirstScroll = true; 7856 7857 window.addEventListener("scroll", function() { 7858 if (isFirstScroll){ 7859 /* Billboard-Element fixieren */ 7860 billboard.style.position = "fixed"; 7861 billboard.style.top = "0"; 7862 billboard.style.marginTop = "0"; 7863 billboard.style.zIndex = "1100"; 7864 billboard.style.left = "50%"; 7865 billboard.style.transform = "translateX(-50%)"; 7866 7867 /* Billboard für n Sekunden sichtbar machen */ 7868 setTimeout(function(){ 7869 7870 const bBiframe = billboard.querySelector("iframe"); 7871 const bBiframeHeight = bBiframe.offsetHeight; 7872 const startHeight = billboard.offsetHeight; 7873 const endHeight = 0; 7874 7875 /* Animationsschleife starten */ 7876 let currentHeight = startHeight; 7877 const animationDuration = 500; /* Dauer der Animation in Millisekunden */ 7878 const frameRate = 60; /* Bildwiederholrate in Frames pro Sekunde */ 7879 const frameDuration = 1000 / frameRate; /* Dauer eines Frames in Millisekunden */ 7880 7881 const animate = () => { 7882 /* Neue Höhe berechnen */ 7883 const deltaHeight = (endHeight - startHeight) / (animationDuration / frameDuration); 7884 currentHeight += deltaHeight; 7885 7886 /* Höhe des DIV-Elements und des iFrames aktualisieren */ 7887 billboard.style.height = `${currentHeight}px`; 7888 bBiframe.style.height = `${currentHeight}px`; 7889 billboard.style.top = "0"; 7890 billboard.style.top = "0"; 7891 7892 /* Animation fortsetzen, bis die Endhöhe erreicht ist */ 7893 if(currentHeight > endHeight){ 7894 requestAnimationFrame(animate); 7895 } 7896 }; 7897 7898 animate(); 7899 7900 /* Reminder-Element erstellen und fixieren */ 7901 const reminder = document.createElement("div"); 7902 reminder.id = "bBreminder"; 7903 reminder.style.position = "fixed"; 7904 reminder.style.top = "0"; 7905 reminder.style.left = "50%"; 7906 reminder.style.transform = "translateX(-50%)"; 7907 reminder.style.width = bBiframe.offsetWidth+"px"; 7908 reminder.innerHTML = "<img src='"+ reminderImg +"' alt='Reminder'/>"; 7909 reminder.style.zIndex = "1100"; 7910 document.body.appendChild(reminder); 7911 7912 /* Close-Button erstellen */ 7913 const closeButton = document.createElement("button"); 7914 closeButton.innerHTML = "<i class=\"far fa-times-circle fa-lg\"></i>"; 7915 reminder.appendChild(closeButton); 7916 closeButton.setAttribute("id","closeReminder"); 7917 const reopen = () => { 7918 /* Neue Höhe berechnen */ 7919 const deltaHeight = (endHeight - startHeight) / (animationDuration / frameDuration); 7920 currentHeight -= deltaHeight; /* Hier wird die Höhe verringert, um das Element zu öffnen */ 7921 7922 /* Höhe des DIV-Elements und des iFrames aktualisieren */ 7923 billboard.style.height = `${currentHeight}px`; 7924 bBiframe.style.height = `${currentHeight}px`; 7925 7926 /* Animation fortsetzen, bis die Start-Höhe erreicht ist */ 7927 if(currentHeight < startHeight){ 7928 requestAnimationFrame(reopen); 7929 } 7930 }; 7931 7932 let bBopen = false;
7933 7934 function reminderClickHandler() { 7935 if (bBopen) { 7936 animate(); 7937 bBopen = false; 7938 } else { 7939 reopen(); 7940 bBopen = true; 7941 } 7942 } 7943 /* Klick-Event für den Reminder hinzufügen */ 7944 reminder.addEventListener("click", reminderClickHandler); 7945 7946 /* Klick-Event für den CoseButton hinzufügen */ 7947 closeButton.addEventListener("click", function(){ 7948 /* Billboard-Element zurücksetzen */ 7949 reminder.removeEventListener("click", reminderClickHandler); 7950 resizeObserver.disconnect(); 7951 billboard.style.height = startHeight+"px"; 7952 bBiframe.style.height = bBiframeHeight+"px"; 7953 billboard.style.top = "revert"; 7954 billboard.style.marginTop = "revert"; 7955 billboard.style.zIndex = "revert"; 7956 billboard.style.left = "revert"; 7957 billboard.style.transform = "revert"; 7958 billboard.style.position = "revert"; 7959 reminder.style.display = "none"; 7960 }); 7961 7962 /* Funktion zum Aktualisieren der Position von reminder-div */ 7963 function updateReminderPosition() { 7964 /* var billboardHeight = billboard.offsetHeight; */ 7965 let billboardHeight = bBiframe.offsetHeight; 7966 const billboardWidth = bBiframe.clientWidth; 7967 7968 if (billboardHeight < 12) { 7969 billboardHeight = 0; 7970 } 7971 if (billboardHeight > bBInitialHeight) { 7972 billboardHeight = bBInitialHeight; 7973 } 7974 reminder.style.top = billboardHeight + "px"; 7975 reminder.style.width = billboardWidth + "px"; 7976 } 7977 7978 const resizeObserver = new ResizeObserver(updateReminderPosition); 7979 resizeObserver.observe(billboard); 7980 7981 }, reminderTime); 7982 7983 isFirstScroll = false; 7984 } 7985 7986 }); 7987 7988}); 7989 7990/** 7991 * bridgeAd 7992 */ 7993$(document).on("bridgeAd", function(event){ 7994 const bA_iframe = document.querySelector('.bridgeAdFrame'); 7995 const bA_renderSlot = document.querySelector('.Ad-billboard'); 7996 bA_renderSlot.classList.add('bridgeAdSlot'); 7997}); 7998 7999/** 8000 * bridgeAdSticky 8001 */ 8002$(document).on("bridgeAdSticky", function(event){ 8003 const bA_iframe = document.querySelector('.bridgeAdFrame'); 8004 const bA_renderSlot = document.querySelector('.Ad-billboard'); 8005 bA_renderSlot.classList.add('bridgeAdSlot'); 8006 bA_iframe.classList.add('billboardSticky'); 8007}); 8008 8009/** 8010 * fullWidthBillboard 8011 */ 8012$(document).on("fullWidthBillboard", function(event){ 8013 const fw_renderSlot = document.querySelector('#renderSlot_Billboard'); 8014 fw_renderSlot.classList.add('fullWidthBillboard'); 8015}); 8016 8017 8018/** 8019 * Events auch ohne trigger aus template 8020 */ 8021window.addEventListener('load', function() { 8022 const billboardHeightEvent = new CustomEvent('billboardHeight'); 8023 document.dispatchEvent(billboardHeightEvent); 8024}); 8025 8026 8027/** 8028 * Understitial 8029 */ 8030$(document).on('understitial',function(event) { 8031 8032 $(document).ready(function() { 8033 let understitialAd = document.querySelector('.understitial').parentNode.parentNode; 8034 let understitialAdWrapper = document.querySelector('.understitial').parentNode; 8035 let understitial = document.getElementsByClassName('understitial')[0]; 8036 let us_height = understitial.getAttribute("data-height"); 8037 let us_width = understitial.getAttribute("data-width"); 8038 let setAdText = understitial.getAttribute("data-setadtext"); 8039 let us_btype = 'image'; 8040 if (understitial.hasAttribute("data-btype")){ 8041 us_btype = understitial.getAttribute("data-btype"); 8042 } 8043 8044 function positioniereDiv(firstElm, seconElm) { 8045 8046 let firstElmWidth = firstElm.offsetWidth; 8047 let secondElmWidth = seconElm.offsetWidth; 8048 let firstElmPosition = firstElm.getBoundingClientRect(); 8049 let firstElmDistanceLeft = firstElmPosition.left; 8050 let positionLeft = firstElmDistanceLeft + (firstElmWidth - secondElmWidth) / 2; 8051 positionLeft = positionLeft + (secondElmWidth / 2); 8052 seconElm.style.left = positionLeft + 'px'; 8053 } 8054 8055 positioniereDiv(understitialAd, understitialAdWrapper); 8056 8057 understitialAd.classList.add("understitialAd"); 8058 8059 understitialAdWrapper.style.position = "fixed"; 8060 understitialAdWrapper.style.top = '50%'; 8061 understitialAdWrapper.style.transform = "translate(-50%, -50%)"; 8062 understitialAdWrapper.style.clipPath = "polygon(0 0, 100% 0, 100% 100%, 0 100%)"; 8063 understitialAdWrapper.style.overflow = "auto"; 8064 understitialAdWrapper.style.textAlign = "center"; 8065 if(setAdText) { 8066 understitialAdWrapper.classList.add('Ad_text'); 8067 } 8068 8069 8070 if (us_btype == 'stream' || us_btype == 'html5' || us_btype == 'image' || window.innerWidth < 768) { 8071 let outerIframe = document.getElementsByClassName('understitial')[0]; 8072 let innerIframe = outerIframe.contentWindow.document.getElementById("usInnerIframe"); 8073 8074 8075 /* adjust inner iFrame height and width */ 8076 function adjustInnerIframeHeight() { 8077 8078 let understitialAdWidth = understitialAd.offsetWidth; 8079 8080 8081 /* consider possible lateral padding */ 8082 let stylesUnderstitialAd = window.getComputedStyle(understitialAd); 8083 let uaPaddingLeft = parseInt(stylesUnderstitialAd.getPropertyValue('padding-left'), 10); 8084 let uaPaddingRight = parseInt(stylesUnderstitialAd.getPropertyValue('padding-right'), 10); 8085 let usMargin = 0; 8086 if (!isNaN(uaPaddingLeft) || !isNaN(uaPaddingRight)) { 8087 usMargin = uaPaddingLeft + uaPaddingRight; 8088 } 8089 8090 understitialAdWrapper.style.width = understitialAdWidth-usMargin + "px"; 8091 8092 outerIframe = document.getElementsByClassName('understitial')[0]; 8093 let innerIframe = outerIframe.contentWindow.document.getElementById("usInnerIframe"); 8094 if (innerIframe !== null) { 8095 let outerIframeHeight = outerIframe.offsetHeight; 8096 innerIframe.style.height = outerIframeHeight + "px"; 8097 } 8098 8099 /* adjust Banner Image TBD */
8100 let understitialHeight = understitial.offsetHeight; 8101 let screenWidth = window.innerWidth || document.documentElement.clientWidth || document.body.clientWidth; 8102 let screenHeight = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight; 8103 8104 if ((understitialHeight >= (screenHeight - 70)) && (window.innerWidth > 768)) { 8105 const headerEl = document.querySelector('.SiteHeaderSticky'); 8106 let heightDiff = understitialHeight - screenHeight; 8107 8108 if (headerEl) { 8109 const headerElHeight = 70; 8110 let smallerheight = understitialHeight - headerElHeight*2 - heightDiff -35; 8111 let centerImage = understitial.contentDocument.querySelector('#understitialImage'); 8112 understitial.style.height = Math.round(smallerheight) + "px"; 8113 centerImage.style.height = Math.round(smallerheight) + "px"; 8114 } 8115 } else { 8116 let centerImage = understitial.contentDocument.querySelector('#understitialImage'); 8117 if (centerImage) { 8118 understitial.style.height = centerImage.offsetHeight + "px"; 8119 } 8120 } 8121 8122 /* center understitial */ 8123 understitialAdWrapper.style.textAlign = "center"; 8124 8125 if (us_btype == 'html5') { 8126 innerIframe = outerIframe.contentDocument.querySelector('iframe'); 8127 let innerIframeHeight = innerIframe.offsetHeight; 8128 let innerIframeWidth = innerIframe.offsetWidth; 8129 8130 /* get Height of pseudoelement before */ 8131 let understitialAdWrapperBeforeStyle = window.getComputedStyle(understitialAdWrapper, '::before'); 8132 let understitialAdWrapperHeight = parseInt(understitialAdWrapperBeforeStyle.getPropertyValue('height'), 10); 8133 8134 /* smaller width and height for iOS */ 8135 const userAgent = navigator.userAgent; 8136 8137 if (userAgent.includes("iPhone")) { 8138 let smallerWidth = innerIframeWidth - (innerIframeWidth * 0.15); 8139 innerIframe.style.width = Math.round(smallerWidth) + "px"; 8140 8141 } 8142 8143 /* set height again and center content */ 8144 understitialAdWrapper.style.height = innerIframeHeight + understitialAdWrapperHeight + "px"; 8145 innerIframe.style.margin = "0 auto"; 8146 understitialAdWrapper.style.overflow = "hidden"; 8147 } 8148 8149 } 8150 adjustInnerIframeHeight(); 8151 outerIframe.addEventListener("load", adjustInnerIframeHeight); 8152 } 8153 8154 }); 8155}); 8156 8157/* if BTA-Homepage-Aufmacher is empty then display= none */ 8158document.addEventListener('DOMContentLoaded', function() { 8159 setTimeout(() => { 8160 const btaHomepageSlot = document.getElementById('renderSlot_BTA-Homepage-Aufmacher'); 8161 const btaSubstitute = document.querySelector('article.btaSubstitute'); 8162 8163 if (btaHomepageSlot) { 8164 const firstChild = btaHomepageSlot.firstElementChild; 8165 8166 if (!firstChild || firstChild.tagName !== 'DIV') { 8167 const btaArticle = document.querySelector('article.BTA-Homepage-Aufmacher'); 8168 if (btaArticle) { 8169 btaArticle.style.display = 'none'; 8170 } 8171 if (btaSubstitute) { 8172 btaSubstitute.style.display = 'block'; 8173 } 8174 } 8175 } 8176 }, 1500); 8177}); 8178 8179/* if BTA-Homepage-Nachrichten is empty then display= none */ 8180document.addEventListener('DOMContentLoaded', function() { 8181 setTimeout(() => { 8182 const btaHomepageNachrichtenSlot = document.getElementById('renderSlot_BTA-Homepage-Nachrichten'); 8183 const btaArticle = document.querySelector('.BTA-Homepage-Nachrichten'); 8184 8185 if (btaHomepageNachrichtenSlot) { 8186 const firstChild = btaHomepageNachrichtenSlot.firstElementChild; 8187 8188 if (!firstChild || firstChild.tagName !== 'DIV') { 8189 if (btaArticle) { 8190 btaArticle.style.display = 'none'; 8191 } 8192 8193 } else { 8194 8195 const section = document.querySelector('section.StageNewsAutoManualMostread'); 8196 if (section) { 8197 const itemsContainer = section.querySelector('.StageNewsAutoManualMostread_items'); 8198 if (itemsContainer) { 8199 const items = itemsContainer.querySelectorAll('.StageNewsAutoManualMostread_item'); 8200 if (items.length >= 6) { 8201 /* selektiere 6. Element */ 8202 const btaSubstitute = items[5]; 8203 btaSubstitute.style.display = 'none'; 8204 console.log('Das 6. Element:', btaSubstitute); 8205 } else { 8206 /* console.log('weniger als 6 Elemente mit Klasse "StageNewsAutoManualMostread_item".'); */ 8207 } 8208 } else { 8209 /* console.log('Element mit Klasse "StageNewsAutoManualMostread_items" nicht gefunden.'); */ 8210 } 8211 } else { 8212 /* console.log('<section>-Element mit Klasse "StageNewsAutoManualMostread" nicht gefunden.'); */ 8213 } 8214 8215 } 8216 } 8217 }, 1500); 8218}); 8219
8220/* if both BTA-asides are empty then display= none */ 8221document.addEventListener('DOMContentLoaded', function() { 8222 setTimeout(() => { 8223 const btaasideSlot1 = document.getElementById('BTA-Artikeldetail-aSide-1'); 8224 const btaasideSlot2 = document.getElementById('BTA-Artikeldetail-aSide-2'); 8225 8226 function isValidDiv(child) { 8227 return ( 8228 child && 8229 child.tagName === 'DIV' && 8230 child.innerHTML.trim() !== '' 8231 ); 8232 } 8233 8234 let isSlot1Valid = false; 8235 let isSlot2Valid = false; 8236 8237 if (btaasideSlot1) { 8238 const firstChild1 = btaasideSlot1.firstElementChild; 8239 isSlot1Valid = isValidDiv(firstChild1); 8240 } 8241 8242 if (btaasideSlot2) { 8243 const firstChild2 = btaasideSlot2.firstElementChild; 8244 isSlot2Valid = isValidDiv(firstChild2); 8245 } 8246 8247 if (!isSlot1Valid && !isSlot2Valid) { 8248 const asideContainer = document.querySelector('.btaAsideContainer'); 8249 if (asideContainer) { 8250 asideContainer.style.display = 'none'; 8251 } 8252 } 8253 8254 }, 1500); 8255}); 8256 8257var adition = adition || {}; 8258adition.srq = adition.srq || []; 8259 8260$(document).ready( function() { 8261 $('.FormField_togglePassword').on('click', function(event) { 8262 if ($('#i_password').attr('type') === 'password') { 8263 $('#i_password').attr('type', 'text'); 8264 if ($('.FormField_togglePassword').text() === 'Show password') { 8265 $('.FormField_togglePassword').text('Hide password'); 8266 } else if ($('.FormField_togglePassword').text() === 'Pokaż hasÅo') { 8267 $('.FormField_togglePassword').text('Ukryj hasÅo'); 8268 } else { 8269 $('.FormField_togglePassword').text('Passwort ausblenden'); 8270 } 8271 } else { 8272 $('#i_password').attr('type', 'password'); 8273 if ($('.FormField_togglePassword').text() === 'Hide password') { 8274 $('.FormField_togglePassword').text('Show password'); 8275 } else if ($('.FormField_togglePassword').text() === 'Ukryj hasÅo') { 8276 $('.FormField_togglePassword').text('Pokaż hasÅo'); 8277 } else { 8278 $('.FormField_togglePassword').text('Passwort einblenden'); 8279 } 8280 } 8281 }); 8282 8283 8284 $('.FormField_togglePassword_en').on('click', function(event) { 8285 if ($('#i_password').attr('type') === 'password') { 8286 $('#i_password').attr('type', 'text'); 8287 $('.FormField_togglePassword_en').text('Hide password'); 8288 } else { 8289 $('#i_password').attr('type', 'password'); 8290 $('.FormField_togglePassword_en').text('Show password'); 8291 } 8292 }); 8293 8294}); 8295 8296 8297 8298/* ----- DOCUMENT READY FUNCTION ------ */ 8299 8300$(function() { 8301 8302 if (!$("Body.BodyGallery").length ) { 8303 // Sticky Header nicht in Galerie-Detailseiten 8304 8305 $(window).on('scroll resize touchmove',function(){ 8306 stickybegins = $(".SiteHeader").offset().top + $(".SiteHeader").height(); 8307 8308 if($(this).scrollTop()>stickybegins && window.innerWidth>768){ 8309 $('.SiteHeaderSticky').fadeIn(); 8310 }else{ 8311 $('.SiteHeaderSticky').fadeOut(); 8312 } 8313 }); 8314 8315 8316 } 8317 8318 8319} ); 8320 8321
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.