'), (s.innerHTML = ''), (o.innerHTML = ''), e.appendChild(r), e.appendChild(s), e.appendChild(o), e.appendChild(t), e.appendChild(i), t.appendChild(n), t.appendChild(a), (this.holder = t), e ); }, }, ]), c), a = (_createClass(l, [ { key: "autoPlay", get: function () { return this.element.getAttribute("data-auto-play"); }, }, { key: "isPlaying", get: function () { return this.timer; }, }, { key: "active", get: function () { return parseInt(this.element.getAttribute("data-active"), 10); }, set: function (e) { this.element.setAttribute("data-active", e), this.element.dispatchEvent(new CustomEvent("activeChanged")); }, }, ]), _createClass(l, [ { key: "initStyles", value: function (e) { this.slides.forEach(function (t, i) { return (t.style.left = "".concat(i * e, "px")); }), (this.ribbon.style.width = "".concat(this.slides.length * e, "px")); }, }, { key: "next", value: function () { this.active = this.active + 1 >= this.slides.length ? 0 : this.active + 1; }, }, { key: "previous", value: function () { this.active = this.active - 1 < 0 ? this.slides.length - 1 : this.active - 1; }, }, { key: "play", value: function () { var e = this; (this.timer = window.setInterval(function () { e.next(); }, this.interval)), this.playButton.setAttribute("hidden", ""), this.pauseButton.removeAttribute("hidden"); }, }, { key: "pause", value: function () { window.clearInterval(this.timer), this.playButton.removeAttribute("hidden"), this.pauseButton.setAttribute("hidden", ""); }, }, { key: "paginationClick", value: function (e) { this.active = e; }, }, { key: "activeChanged", value: function () { var e = this; (this.ribbon.style.transform = "translate3d(-".concat(this.active * this.element.offsetWidth, "px, 0, 0)")), window.setTimeout(function () { e.slides.forEach(function (e) { return e.removeAttribute("_active"); }), e.slides[e.active].setAttribute("_active", ""), e.paginationButtons.forEach(function (e) { return e.removeAttribute("_active"); }), e.paginationButtons[e.active].setAttribute("_active", ""); }, 500); }, }, ]), l), r = (_createClass(o, [ { key: "onElementClick", value: function (e) { e.preventDefault(); var t = e.target.closest(".icon-button"); (e = e.target.closest(".img")), (t = t.getAttribute("data-video-id")); e.querySelector(".img__inner").innerHTML = ''); }, }, ]), o), s = ((a = (new i(t.querySelector(".cookie")), new a(t.querySelector(".slideshow")), new (function e(i) { var n, a; _classCallCheck(this, e), i && ((n = i.querySelector(".gallery")), (a = i.querySelector(".image")), n && a && ((i = t.createElement("a")).classList.add("chip"), i.setAttribute("href", "#".concat(n.id)), (i.innerHTML = 'Galéria'), a.appendChild(i))); })(t.querySelector("article.single")), new r(t.querySelector("button[data-video-id]")), [].concat(_toConsumableArray(t.querySelectorAll("select.filter")), _toConsumableArray(t.querySelectorAll("select.sort"))))), (r = t.getElementById("menu-button")), t.querySelector(".nav-items")); function o(e) { _classCallCheck(this, o), e && e.addEventListener("click", this.onElementClick.bind(this)); } function l(e) { var t = this; _classCallCheck(this, l), e && ((this.interval = 6e3), (this.element = e), (this.timer = null), this.element.hasAttribute("data-active") || this.element.setAttribute("data-active", 0), (this.slides = _toConsumableArray(this.element.querySelectorAll(".slide"))), (this.ribbon = this.element.querySelector(".ribbon")), (this.playButton = this.element.querySelector(".button--play")), (this.pauseButton = this.element.querySelector(".button--pause")), (this.paginationButtons = this.element.querySelectorAll(".button--pagination")), this.initStyles(this.element.offsetWidth), this.autoPlay && this.play(), this.element.querySelector(".button--previous").addEventListener("click", function () { t.pause(), t.previous(); }), this.element.querySelector(".button--next").addEventListener("click", function () { t.pause(), t.next(); }), this.playButton.addEventListener("click", this.play.bind(this)), this.pauseButton.addEventListener("click", this.pause.bind(this)), this.paginationButtons.forEach(function (e) { return e.addEventListener("click", function () { t.paginationClick(e.getAttribute("data-slide")); }); }), this.element.addEventListener("activeChanged", this.activeChanged.bind(this))); } function c(e) { var t = this; _classCallCheck(this, c), (this.imageElement = null), (this.holder = null), e && ((this.element = e), (this.items = _toConsumableArray(e.querySelectorAll("a"))), (this.modal = this.renderModal()), document.body.appendChild(this.modal), this.active || (this.active = 0), this.items.forEach(function (e) { (e = e.querySelector("img")).removeAttribute("width"), e.removeAttribute("height"); }), this.items.forEach(function (e, i) { return e.addEventListener("click", function (e) { e.preventDefault(), (t.active = i); }); }), this.element.addEventListener("activeChange", function () { t.changeImage().then(function () { t.show(); }); })); } function h(e) { _classCallCheck(this, h), e && ((this.element = e).querySelector(".close").addEventListener("click", this.close.bind(this)), this.cookie ? this.remove() : e.removeAttribute("hidden")); } function u() { var e = t.getElementById("st"), i = t.createElement("div"); (i.innerHTML = e.textContent), t.body.appendChild(i), e.parentElement.removeChild(e); } r.addEventListener("click", function () { s.hasAttribute("open") ? s.removeAttribute("open") : s.setAttribute("open", ""); }), a.length && a.forEach(function (e) { return e.addEventListener("change", function (e) { var i = (n = e.target).value, n = ((e = n.name), t.location); t.location = n.origin + n.pathname + ("-" === i ? "" : "?".concat(e, "=").concat(i)); }); }), e.requestAnimationFrame(function () { e.setTimeout(u, 0); });})(window, document);