(()=>{"use strict";function t(t,e,s){return(e=function(t){var e=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var s=e.call(t,"string");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==typeof e?e:e+""}(e))in t?Object.defineProperty(t,e,{value:s,enumerable:!0,configurable:!0,writable:!0}):t[e]=s,t}const e=class{constructor(e){t(this,"timeOut",null),t(this,"masonGrid",!1),t(this,"flicKity",!1),this.elem=e,this.styleUpdate(),this.applyLayout(),this.events()}events(){this.elem.parentElement,window.addEventListener("resize",this.onResize.bind(this)),this.masonGrid&&window.addEventListener("load",function(){this.masonGrid.setup()}.bind(this))}styleUpdate(){const{paddingLeft:t,paddingRight:e}=getComputedStyle(this.elem),s=this.elem.clientWidth-(this.getStyleSize(t)+this.getStyleSize(e));this.elem.classList.remove("wide-wrap","tab-wrap","mob-wrap"),s>768?this.elem.classList.add("wide-wrap"):s>640?this.elem.classList.add("tab-wrap"):s>450&&this.elem.classList.add("mob-wrap")}getStyleSize(t){const e=parseFloat(t);return-1!=t.indexOf("%")||isNaN(e)?0:e}onResize(){this.timeout=setTimeout(()=>{this.styleUpdate(),this.timeout=null})}applyLayout(){if(this.elem.classList.contains("dpt-mag1")){const t=document.createElement("div"),e=document.createElement("div");t.classList.add("dpt-featured-wrap"),e.classList.add("dpt-normal-wrap"),Array.prototype.slice.call(this.elem.querySelectorAll(".dpt-entry")).forEach((s,i)=>{0===i?t.appendChild(s):e.appendChild(s)}),this.elem.appendChild(t),this.elem.appendChild(e)}if(this.addImageAttrs(this.elem),this.elem.classList.contains("dpt-mason-wrap"))this.masonGrid=new brickLayer({container:this.elem,gutter:0,waitForImages:!1,dynamicContent:!0,useTransform:!1,callAfter:this.addLoadedClass.bind(this,this.elem)}),this.masonGrid.init();else if(this.elem.classList.contains("dpt-slider")){const t=parseInt(this.elem.getAttribute("data-autotime")),e={cellAlign:"left",contain:!0,wrapAround:!0,prevNextButtons:!0,imagesLoaded:!0,cellSelector:".dpt-entry"};t&&(e.autoPlay=t),this.elem.classList.contains("dpt-pro-slider1")&&(e.adaptiveHeight=!0),this.flicKity=new Flickity(this.elem,e)}if(this.elem.classList.contains("dpt-mag1")&&!this.elem.classList.contains("mob-wrap")){const t=this.elem.querySelector(".dpt-featured-wrap"),e=this.elem.querySelector(".dpt-normal-wrap"),s=t.offsetHeight;e.offsetHeight>s&&(e.style.maxHeight=s+"px",e.style.overflowY="scroll")}}addImageAttrs(t){Array.prototype.slice.call(t.querySelectorAll(".dpt-thumbnail")).forEach(t=>{const e=t.querySelector("img");if(!e)return;const s=e.getAttribute("data-dpt-src"),i=e.getAttribute("data-dpt-srcset");if(!s||!i)return;const a=t.offsetWidth;e.setAttribute("sizes","".concat(a+100,"px")),e.setAttribute("src",s),e.setAttribute("srcset",i)})}addLoadedClass(t){t.classList.add("dpt-loaded")}};new class{constructor(){const t=this;this.elems=Array.prototype.slice.call(document.querySelectorAll(".dpt-wrapper")),this.elems.forEach(t=>{this.createdpt(t)}),document.addEventListener("animationstart",function(e){if("dptAdded"!==e.animationName)return;const s=e.target;s.classList.contains("dpt-wrapper")&&(s.classList.contains("dpt-added")||t.createdpt(s))},!1)}createdpt(t){t.classList.add("dpt-added"),new e(t)}}})();