This commit is contained in:
2026-02-03 15:31:29 +05:00
commit 326c677e8d
2800 changed files with 1489388 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
.px-1\.5 {
padding-left: 0.375rem;
padding-right: 0.375rem;
}
.text-green-800 {
color: rgb(22 101 52);
}
.text-red-800 {
color: rgb(153 27 27);
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,7 @@
/*!
* Pusher JavaScript Library v7.6.0
* https://pusher.com/
*
* Copyright 2020, Pusher
* Released under the MIT licence.
*/

View File

@@ -0,0 +1,181 @@
function Sim(sldrId) {
let id = document.getElementById(sldrId);
if (id) {
this.sldrRoot = id
} else {
this.sldrRoot = document.querySelector('.sim-slider')
};
// Carousel objects
this.sldrList = this.sldrRoot.querySelector('.sim-slider-list');
this.sldrElements = this.sldrList.querySelectorAll('.sim-slider-element');
this.sldrElemFirst = this.sldrList.querySelector('.sim-slider-element');
this.leftArrow = this.sldrRoot.querySelector('div.sim-slider-arrow-left');
this.rightArrow = this.sldrRoot.querySelector('div.sim-slider-arrow-right');
this.indicatorDots = this.sldrRoot.querySelector('div.sim-slider-dots');
// Initialization
this.options = Sim.defaults;
Sim.initialize(this)
};
Sim.defaults = {
loop: true,
auto: true,
interval: 10000,
arrows: true,
dots: true,
perPage: 2,
};
Sim.prototype.elemPrev = function(num) {
num = num || 1;
let prevElement = this.currentElement;
this.currentElement -= num;
if (this.currentElement < 0) this.currentElement = this.elemCount - 1;
if (!this.options.loop) {
if (this.currentElement == 0) {
this.leftArrow.style.display = 'none'
};
this.rightArrow.style.display = 'block'
};
this.sldrElements[this.currentElement].style.opacity = '1';
this.sldrElements[prevElement].style.opacity = '0';
if (this.options.dots) {
this.dotOn(prevElement);
this.dotOff(this.currentElement)
}
};
Sim.prototype.elemNext = function(num) {
num = num || 1;
let prevElement = this.currentElement;
this.currentElement += num;
if (this.currentElement >= this.elemCount) this.currentElement = 0;
if (!this.options.loop) {
if (this.currentElement == this.elemCount - 1) {
this.rightArrow.style.display = 'none'
};
this.leftArrow.style.display = 'block'
};
this.sldrElements[this.currentElement].style.opacity = '1';
this.sldrElements[prevElement].style.opacity = '0';
if (this.options.dots) {
this.dotOn(prevElement);
this.dotOff(this.currentElement)
}
};
Sim.prototype.dotOn = function(num) {
this.indicatorDotsAll[num].style.cssText = 'background-color:#BBB; cursor:pointer;'
};
Sim.prototype.dotOff = function(num) {
this.indicatorDotsAll[num].style.cssText = 'background-color:#556; cursor:default;'
};
Sim.initialize = function(that) {
// Constants
that.elemCount = that.sldrElements.length; // Количество элементов
// Variables
that.currentElement = 0;
let bgTime = getTime();
// Functions
function getTime() {
return new Date().getTime();
};
function setAutoScroll() {
that.autoScroll = setInterval(function() {
let fnTime = getTime();
if (fnTime - bgTime + 10 > that.options.interval) {
bgTime = fnTime;
that.elemNext()
}
}, that.options.interval)
};
// Start initialization
if (that.elemCount <= 1) { // Отключить навигацию
that.options.auto = false;
that.options.arrows = false;
that.options.dots = false;
that.leftArrow.style.display = 'none';
that.rightArrow.style.display = 'none'
};
if (that.elemCount >= 1) { // показать первый элемент
that.sldrElemFirst.style.opacity = '1';
};
if (!that.options.loop) {
that.leftArrow.style.display = 'none'; // отключить левую стрелку
that.options.auto = false; // отключить автопркрутку
} else if (that.options.auto) { // инициализация автопрокруки
setAutoScroll();
// Остановка прокрутки при наведении мыши на элемент
that.sldrList.addEventListener('mouseenter', function() { clearInterval(that.autoScroll) }, false);
that.sldrList.addEventListener('mouseleave', setAutoScroll, false)
};
if (that.options.arrows) { // инициализация стрелок
that.leftArrow.addEventListener('click', function() {
let fnTime = getTime();
if (fnTime - bgTime > 1000) {
bgTime = fnTime;
that.elemPrev()
}
}, false);
that.rightArrow.addEventListener('click', function() {
let fnTime = getTime();
if (fnTime - bgTime > 1000) {
bgTime = fnTime;
that.elemNext()
}
}, false)
} else {
that.leftArrow.style.display = 'none';
that.rightArrow.style.display = 'none'
};
if (that.options.dots) { // инициализация индикаторных точек
let sum = '',
diffNum;
for (let i = 0; i < that.elemCount; i++) {
sum += '<span class="sim-dot"></span>'
};
that.indicatorDots.innerHTML = sum;
that.indicatorDotsAll = that.sldrRoot.querySelectorAll('span.sim-dot');
// Назначаем точкам обработчик события 'click'
for (let n = 0; n < that.elemCount; n++) {
that.indicatorDotsAll[n].addEventListener('click', function() {
diffNum = Math.abs(n - that.currentElement);
if (n < that.currentElement) {
bgTime = getTime();
that.elemPrev(diffNum)
} else if (n > that.currentElement) {
bgTime = getTime();
that.elemNext(diffNum)
}
// Если n == that.currentElement ничего не делаем
}, false)
};
that.dotOff(0); // точка[0] выключена, остальные включены
for (let i = 1; i < that.elemCount; i++) {
that.dotOn(i)
}
}
};
new Sim();

10881
public/web/scripts/jquery-3.6.0.js vendored Normal file

File diff suppressed because it is too large Load Diff

150
public/web/scripts/order.js Normal file
View File

@@ -0,0 +1,150 @@
async function openOrderModal() {
let orderTime = window.Lara.orderTime;
let todaysOptions = '';
let tomorrowsOptions = '';
orderTime['hours']['today'].forEach(time => {
todaysOptions += `<option value="${time.hour}, ${time.date}">${time.hour}</option>`;
});
orderTime['hours']['tomorrow'].forEach(time => {
tomorrowsOptions += `<option value="${time.hour}, ${time.date}">${time.hour}</option>`;
});
formTemplate = `
<form action="">
<p class="text-left mb-1">Adyňyz</p>
<input id="order-client-name" class="swal2-input m-0 mb-1 w-100 placeholder-black focus:box-shadow-none" type="text" name="name" placeholder="Adyňyz" required>
<p class="text-left mb-1">Telefon belgi (+993 6*******)</p>
<input id="order-client-phone" class="swal2-input m-0 mb-1 w-100 placeholder-black focus:box-shadow-none" type="tel" placeholder="" required>
<p class="text-left mb-1">Salgy</p>
<input id="order-client-address" class="swal2-input m-0 mb-1 w-100 placeholder-black focus:box-shadow-none" type="text" name="adress" required>
<p class="text-left mt-1 mb-1">Wagty saýlaň</p>
<select class="swal2-select m-0 mb-1 rounded w-100" id="order-client-time">
<optgroup label="${ orderTime['dates']['today'] }">
${todaysOptions}
</optgroup>
<optgroup label="${ orderTime['dates']['tomorrow'] }">
${tomorrowsOptions}
</optgroup>
</select>
<p class="text-left mt-1 mb-1">Töleg görnüşi</p>
<select class="swal2-select m-0 mb-1 rounded w-100" id="order-client-payment-method">
<optgroup label="Onlaýn däl töleg">
<option value="cash">Nagt töleg</option>
<option value="atm">Terminal töleg</option>
</optgroup>
<optgroup label="Onlaýn töleg">
<option value="halk_bank">Altyn Asyr</option>
</optgroup>
</select>
</form>
`;
const { value: formValues } = await Swal.fire({
title: 'Sargaw',
confirmButtonText: 'Sarga',
html: formTemplate,
preConfirm: () => {
let order_client_name = document.getElementById('order-client-name').value;
let order_client_phone = document.getElementById('order-client-phone').value;
let order_client_address = document.getElementById('order-client-address').value;
let order_client_payment_method = document.getElementById('order-client-payment-method').value;
let order_client_time = document.getElementById('order-client-time').value;
if (order_client_name == '' || order_client_phone == '' || order_client_address == '' || order_client_payment_method == '' || order_client_time == '') {
Swal.showValidationMessage('Maglumatlary giriziň');
}
return {
name: order_client_name,
phone: order_client_phone,
address: order_client_address,
payment_type: order_client_payment_method,
time: order_client_time
};
},
allowOutsideClick: () => !Swal.isLoading()
});
if (formValues) {
let token = document.querySelector('input[name=_token]').value;
let formData = {
...formValues,
_token: token
};
$.ajax({
method: 'POST',
url: '/orders-checkout',
data: formData,
success: (response) => {
if (formData.payment_type == 'halk_bank') {
window.location.href = response.data.url;
return;
}
Swal.fire('Siziň sargydyňyzyň kabul edildi!', 'Sargydy tassyklamak üçin siziň bilen operator habarlaşar.', 'success');
Livewire.emit('cartUpdated');
Livewire.emit('ordersUpdated');
},
error: (exception) => {
console.log({exception});
}
});
}
}
function orderDetails(id) {
let formData = {
id: id,
_token: document.querySelector('input[name=_token]').value,
};
$.ajax({
method: 'POST',
url: '/orders-detail',
data: formData,
success: (response) => {
console.log({response});
window.a = response;
let orderItemTemplate = '';
response.order.items.forEach(item => {
orderItemTemplate += `
<div class="col-md-4">
<img src="${response.products.filter(product => product.id == item.product_id)[0].image}" class="mw-100" />
<span>Ady: <strong>${ item.name }</strong></span>
<span>Sany: <strong>${ item.quantity }</strong></span>
<span>Bahasy: <strong>${ item.unit_price_amount }</strong></span>
</div>
`;
});
let orderDetailTemplate = `<div class="row"> ${orderItemTemplate} </div>`;
Swal.fire({
title: 'Harytlar',
// confirmButtonText: 'Sarga',
html: orderDetailTemplate,
allowOutsideClick: () => !Swal.isLoading()
});
},
error: (exception) => {
console.log({exception});
}
});
}

193
public/web/scripts/owl.carousel.min.js vendored Normal file
View File

@@ -0,0 +1,193 @@
/**
* Owl Carousel v2.3.4
* Copyright 2013-2018 David Deutsch
* Licensed under: SEE LICENSE IN https://github.com/OwlCarousel2/OwlCarousel2/blob/master/LICENSE
*/
! function(a, b, c, d) {
function e(b, c) { this.settings = null, this.options = a.extend({}, e.Defaults, c), this.$element = a(b), this._handlers = {}, this._plugins = {}, this._supress = {}, this._current = null, this._speed = null, this._coordinates = [], this._breakpoint = null, this._width = null, this._items = [], this._clones = [], this._mergers = [], this._widths = [], this._invalidated = {}, this._pipe = [], this._drag = { time: null, target: null, pointer: null, stage: { start: null, current: null }, direction: null }, this._states = { current: {}, tags: { initializing: ["busy"], animating: ["busy"], dragging: ["interacting"] } }, a.each(["onResize", "onThrottledResize"], a.proxy(function(b, c) { this._handlers[c] = a.proxy(this[c], this) }, this)), a.each(e.Plugins, a.proxy(function(a, b) { this._plugins[a.charAt(0).toLowerCase() + a.slice(1)] = new b(this) }, this)), a.each(e.Workers, a.proxy(function(b, c) { this._pipe.push({ filter: c.filter, run: a.proxy(c.run, this) }) }, this)), this.setup(), this.initialize() }
e.Defaults = { items: 3, loop: !1, center: !1, rewind: !1, checkVisibility: !0, mouseDrag: !0, touchDrag: !0, pullDrag: !0, freeDrag: !1, margin: 0, stagePadding: 0, merge: !1, mergeFit: !0, autoWidth: !1, startPosition: 0, rtl: !1, smartSpeed: 250, fluidSpeed: !1, dragEndSpeed: !1, responsive: {}, responsiveRefreshRate: 200, responsiveBaseElement: b, fallbackEasing: "swing", slideTransition: "", info: !1, nestedItemSelector: !1, itemElement: "div", stageElement: "div", refreshClass: "owl-refresh", loadedClass: "owl-loaded", loadingClass: "owl-loading", rtlClass: "owl-rtl", responsiveClass: "owl-responsive", dragClass: "owl-drag", itemClass: "owl-item", stageClass: "owl-stage", stageOuterClass: "owl-stage-outer", grabClass: "owl-grab" }, e.Width = { Default: "default", Inner: "inner", Outer: "outer" }, e.Type = { Event: "event", State: "state" }, e.Plugins = {}, e.Workers = [{ filter: ["width", "settings"], run: function() { this._width = this.$element.width() } }, { filter: ["width", "items", "settings"], run: function(a) { a.current = this._items && this._items[this.relative(this._current)] } }, { filter: ["items", "settings"], run: function() { this.$stage.children(".cloned").remove() } }, { filter: ["width", "items", "settings"], run: function(a) { var b = this.settings.margin || "",
c = !this.settings.autoWidth,
d = this.settings.rtl,
e = { width: "auto", "margin-left": d ? b : "", "margin-right": d ? "" : b };!c && this.$stage.children().css(e), a.css = e } }, { filter: ["width", "items", "settings"], run: function(a) { var b = (this.width() / this.settings.items).toFixed(3) - this.settings.margin,
c = null,
d = this._items.length,
e = !this.settings.autoWidth,
f = []; for (a.items = { merge: !1, width: b }; d--;) c = this._mergers[d], c = this.settings.mergeFit && Math.min(c, this.settings.items) || c, a.items.merge = c > 1 || a.items.merge, f[d] = e ? b * c : this._items[d].width();
this._widths = f } }, { filter: ["items", "settings"], run: function() { var b = [],
c = this._items,
d = this.settings,
e = Math.max(2 * d.items, 4),
f = 2 * Math.ceil(c.length / 2),
g = d.loop && c.length ? d.rewind ? e : Math.max(e, f) : 0,
h = "",
i = ""; for (g /= 2; g > 0;) b.push(this.normalize(b.length / 2, !0)), h += c[b[b.length - 1]][0].outerHTML, b.push(this.normalize(c.length - 1 - (b.length - 1) / 2, !0)), i = c[b[b.length - 1]][0].outerHTML + i, g -= 1;
this._clones = b, a(h).addClass("cloned").appendTo(this.$stage), a(i).addClass("cloned").prependTo(this.$stage) } }, { filter: ["width", "items", "settings"], run: function() { for (var a = this.settings.rtl ? 1 : -1, b = this._clones.length + this._items.length, c = -1, d = 0, e = 0, f = []; ++c < b;) d = f[c - 1] || 0, e = this._widths[this.relative(c)] + this.settings.margin, f.push(d + e * a);
this._coordinates = f } }, { filter: ["width", "items", "settings"], run: function() { var a = this.settings.stagePadding,
b = this._coordinates,
c = { width: Math.ceil(Math.abs(b[b.length - 1])) + 2 * a, "padding-left": a || "", "padding-right": a || "" };
this.$stage.css(c) } }, { filter: ["width", "items", "settings"], run: function(a) { var b = this._coordinates.length,
c = !this.settings.autoWidth,
d = this.$stage.children(); if (c && a.items.merge)
for (; b--;) a.css.width = this._widths[this.relative(b)], d.eq(b).css(a.css);
else c && (a.css.width = a.items.width, d.css(a.css)) } }, { filter: ["items"], run: function() { this._coordinates.length < 1 && this.$stage.removeAttr("style") } }, { filter: ["width", "items", "settings"], run: function(a) { a.current = a.current ? this.$stage.children().index(a.current) : 0, a.current = Math.max(this.minimum(), Math.min(this.maximum(), a.current)), this.reset(a.current) } }, { filter: ["position"], run: function() { this.animate(this.coordinates(this._current)) } }, { filter: ["width", "position", "items", "settings"], run: function() { var a, b, c, d, e = this.settings.rtl ? 1 : -1,
f = 2 * this.settings.stagePadding,
g = this.coordinates(this.current()) + f,
h = g + this.width() * e,
i = []; for (c = 0, d = this._coordinates.length; c < d; c++) a = this._coordinates[c - 1] || 0, b = Math.abs(this._coordinates[c]) + f * e, (this.op(a, "<=", g) && this.op(a, ">", h) || this.op(b, "<", g) && this.op(b, ">", h)) && i.push(c);
this.$stage.children(".active").removeClass("active"), this.$stage.children(":eq(" + i.join("), :eq(") + ")").addClass("active"), this.$stage.children(".center").removeClass("center"), this.settings.center && this.$stage.children().eq(this.current()).addClass("center") } }], e.prototype.initializeStage = function() { this.$stage = this.$element.find("." + this.settings.stageClass), this.$stage.length || (this.$element.addClass(this.options.loadingClass), this.$stage = a("<" + this.settings.stageElement + ">", { class: this.settings.stageClass }).wrap(a("<div/>", { class: this.settings.stageOuterClass })), this.$element.append(this.$stage.parent())) }, e.prototype.initializeItems = function() { var b = this.$element.find(".owl-item"); if (b.length) return this._items = b.get().map(function(b) { return a(b) }), this._mergers = this._items.map(function() { return 1 }), void this.refresh();
this.replace(this.$element.children().not(this.$stage.parent())), this.isVisible() ? this.refresh() : this.invalidate("width"), this.$element.removeClass(this.options.loadingClass).addClass(this.options.loadedClass) }, e.prototype.initialize = function() { if (this.enter("initializing"), this.trigger("initialize"), this.$element.toggleClass(this.settings.rtlClass, this.settings.rtl), this.settings.autoWidth && !this.is("pre-loading")) { var a, b, c;
a = this.$element.find("img"), b = this.settings.nestedItemSelector ? "." + this.settings.nestedItemSelector : d, c = this.$element.children(b).width(), a.length && c <= 0 && this.preloadAutoWidthImages(a) }
this.initializeStage(), this.initializeItems(), this.registerEventHandlers(), this.leave("initializing"), this.trigger("initialized") }, e.prototype.isVisible = function() { return !this.settings.checkVisibility || this.$element.is(":visible") }, e.prototype.setup = function() { var b = this.viewport(),
c = this.options.responsive,
d = -1,
e = null;
c ? (a.each(c, function(a) { a <= b && a > d && (d = Number(a)) }), e = a.extend({}, this.options, c[d]), "function" == typeof e.stagePadding && (e.stagePadding = e.stagePadding()), delete e.responsive, e.responsiveClass && this.$element.attr("class", this.$element.attr("class").replace(new RegExp("(" + this.options.responsiveClass + "-)\\S+\\s", "g"), "$1" + d))) : e = a.extend({}, this.options), this.trigger("change", { property: { name: "settings", value: e } }), this._breakpoint = d, this.settings = e, this.invalidate("settings"), this.trigger("changed", { property: { name: "settings", value: this.settings } }) }, e.prototype.optionsLogic = function() { this.settings.autoWidth && (this.settings.stagePadding = !1, this.settings.merge = !1) }, e.prototype.prepare = function(b) { var c = this.trigger("prepare", { content: b }); return c.data || (c.data = a("<" + this.settings.itemElement + "/>").addClass(this.options.itemClass).append(b)), this.trigger("prepared", { content: c.data }), c.data }, e.prototype.update = function() { for (var b = 0, c = this._pipe.length, d = a.proxy(function(a) { return this[a] }, this._invalidated), e = {}; b < c;)(this._invalidated.all || a.grep(this._pipe[b].filter, d).length > 0) && this._pipe[b].run(e), b++;
this._invalidated = {}, !this.is("valid") && this.enter("valid") }, e.prototype.width = function(a) { switch (a = a || e.Width.Default) {
case e.Width.Inner:
case e.Width.Outer:
return this._width;
default:
return this._width - 2 * this.settings.stagePadding + this.settings.margin } }, e.prototype.refresh = function() { this.enter("refreshing"), this.trigger("refresh"), this.setup(), this.optionsLogic(), this.$element.addClass(this.options.refreshClass), this.update(), this.$element.removeClass(this.options.refreshClass), this.leave("refreshing"), this.trigger("refreshed") }, e.prototype.onThrottledResize = function() { b.clearTimeout(this.resizeTimer), this.resizeTimer = b.setTimeout(this._handlers.onResize, this.settings.responsiveRefreshRate) }, e.prototype.onResize = function() { return !!this._items.length && (this._width !== this.$element.width() && (!!this.isVisible() && (this.enter("resizing"), this.trigger("resize").isDefaultPrevented() ? (this.leave("resizing"), !1) : (this.invalidate("width"), this.refresh(), this.leave("resizing"), void this.trigger("resized"))))) }, e.prototype.registerEventHandlers = function() { a.support.transition && this.$stage.on(a.support.transition.end + ".owl.core", a.proxy(this.onTransitionEnd, this)), !1 !== this.settings.responsive && this.on(b, "resize", this._handlers.onThrottledResize), this.settings.mouseDrag && (this.$element.addClass(this.options.dragClass), this.$stage.on("mousedown.owl.core", a.proxy(this.onDragStart, this)), this.$stage.on("dragstart.owl.core selectstart.owl.core", function() { return !1 })), this.settings.touchDrag && (this.$stage.on("touchstart.owl.core", a.proxy(this.onDragStart, this)), this.$stage.on("touchcancel.owl.core", a.proxy(this.onDragEnd, this))) }, e.prototype.onDragStart = function(b) { var d = null;
3 !== b.which && (a.support.transform ? (d = this.$stage.css("transform").replace(/.*\(|\)| /g, "").split(","), d = { x: d[16 === d.length ? 12 : 4], y: d[16 === d.length ? 13 : 5] }) : (d = this.$stage.position(), d = { x: this.settings.rtl ? d.left + this.$stage.width() - this.width() + this.settings.margin : d.left, y: d.top }), this.is("animating") && (a.support.transform ? this.animate(d.x) : this.$stage.stop(), this.invalidate("position")), this.$element.toggleClass(this.options.grabClass, "mousedown" === b.type), this.speed(0), this._drag.time = (new Date).getTime(), this._drag.target = a(b.target), this._drag.stage.start = d, this._drag.stage.current = d, this._drag.pointer = this.pointer(b), a(c).on("mouseup.owl.core touchend.owl.core", a.proxy(this.onDragEnd, this)), a(c).one("mousemove.owl.core touchmove.owl.core", a.proxy(function(b) { var d = this.difference(this._drag.pointer, this.pointer(b));
a(c).on("mousemove.owl.core touchmove.owl.core", a.proxy(this.onDragMove, this)), Math.abs(d.x) < Math.abs(d.y) && this.is("valid") || (b.preventDefault(), this.enter("dragging"), this.trigger("drag")) }, this))) }, e.prototype.onDragMove = function(a) { var b = null,
c = null,
d = null,
e = this.difference(this._drag.pointer, this.pointer(a)),
f = this.difference(this._drag.stage.start, e);
this.is("dragging") && (a.preventDefault(), this.settings.loop ? (b = this.coordinates(this.minimum()), c = this.coordinates(this.maximum() + 1) - b, f.x = ((f.x - b) % c + c) % c + b) : (b = this.settings.rtl ? this.coordinates(this.maximum()) : this.coordinates(this.minimum()), c = this.settings.rtl ? this.coordinates(this.minimum()) : this.coordinates(this.maximum()), d = this.settings.pullDrag ? -1 * e.x / 5 : 0, f.x = Math.max(Math.min(f.x, b + d), c + d)), this._drag.stage.current = f, this.animate(f.x)) }, e.prototype.onDragEnd = function(b) { var d = this.difference(this._drag.pointer, this.pointer(b)),
e = this._drag.stage.current,
f = d.x > 0 ^ this.settings.rtl ? "left" : "right";
a(c).off(".owl.core"), this.$element.removeClass(this.options.grabClass), (0 !== d.x && this.is("dragging") || !this.is("valid")) && (this.speed(this.settings.dragEndSpeed || this.settings.smartSpeed), this.current(this.closest(e.x, 0 !== d.x ? f : this._drag.direction)), this.invalidate("position"), this.update(), this._drag.direction = f, (Math.abs(d.x) > 3 || (new Date).getTime() - this._drag.time > 300) && this._drag.target.one("click.owl.core", function() { return !1 })), this.is("dragging") && (this.leave("dragging"), this.trigger("dragged")) }, e.prototype.closest = function(b, c) { var e = -1,
f = 30,
g = this.width(),
h = this.coordinates(); return this.settings.freeDrag || a.each(h, a.proxy(function(a, i) { return "left" === c && b > i - f && b < i + f ? e = a : "right" === c && b > i - g - f && b < i - g + f ? e = a + 1 : this.op(b, "<", i) && this.op(b, ">", h[a + 1] !== d ? h[a + 1] : i - g) && (e = "left" === c ? a + 1 : a), -1 === e }, this)), this.settings.loop || (this.op(b, ">", h[this.minimum()]) ? e = b = this.minimum() : this.op(b, "<", h[this.maximum()]) && (e = b = this.maximum())), e }, e.prototype.animate = function(b) { var c = this.speed() > 0;
this.is("animating") && this.onTransitionEnd(), c && (this.enter("animating"), this.trigger("translate")), a.support.transform3d && a.support.transition ? this.$stage.css({ transform: "translate3d(" + b + "px,0px,0px)", transition: this.speed() / 1e3 + "s" + (this.settings.slideTransition ? " " + this.settings.slideTransition : "") }) : c ? this.$stage.animate({ left: b + "px" }, this.speed(), this.settings.fallbackEasing, a.proxy(this.onTransitionEnd, this)) : this.$stage.css({ left: b + "px" }) }, e.prototype.is = function(a) { return this._states.current[a] && this._states.current[a] > 0 }, e.prototype.current = function(a) { if (a === d) return this._current; if (0 === this._items.length) return d; if (a = this.normalize(a), this._current !== a) { var b = this.trigger("change", { property: { name: "position", value: a } });
b.data !== d && (a = this.normalize(b.data)), this._current = a, this.invalidate("position"), this.trigger("changed", { property: { name: "position", value: this._current } }) } return this._current }, e.prototype.invalidate = function(b) { return "string" === a.type(b) && (this._invalidated[b] = !0, this.is("valid") && this.leave("valid")), a.map(this._invalidated, function(a, b) { return b }) }, e.prototype.reset = function(a) {
(a = this.normalize(a)) !== d && (this._speed = 0, this._current = a, this.suppress(["translate", "translated"]), this.animate(this.coordinates(a)), this.release(["translate", "translated"])) }, e.prototype.normalize = function(a, b) { var c = this._items.length,
e = b ? 0 : this._clones.length; return !this.isNumeric(a) || c < 1 ? a = d : (a < 0 || a >= c + e) && (a = ((a - e / 2) % c + c) % c + e / 2), a }, e.prototype.relative = function(a) { return a -= this._clones.length / 2, this.normalize(a, !0) }, e.prototype.maximum = function(a) { var b, c, d, e = this.settings,
f = this._coordinates.length; if (e.loop) f = this._clones.length / 2 + this._items.length - 1;
else if (e.autoWidth || e.merge) { if (b = this._items.length)
for (c = this._items[--b].width(), d = this.$element.width(); b-- && !((c += this._items[b].width() + this.settings.margin) > d););
f = b + 1 } else f = e.center ? this._items.length - 1 : this._items.length - e.items; return a && (f -= this._clones.length / 2), Math.max(f, 0) }, e.prototype.minimum = function(a) { return a ? 0 : this._clones.length / 2 }, e.prototype.items = function(a) { return a === d ? this._items.slice() : (a = this.normalize(a, !0), this._items[a]) }, e.prototype.mergers = function(a) { return a === d ? this._mergers.slice() : (a = this.normalize(a, !0), this._mergers[a]) }, e.prototype.clones = function(b) { var c = this._clones.length / 2,
e = c + this._items.length,
f = function(a) { return a % 2 == 0 ? e + a / 2 : c - (a + 1) / 2 }; return b === d ? a.map(this._clones, function(a, b) { return f(b) }) : a.map(this._clones, function(a, c) { return a === b ? f(c) : null }) }, e.prototype.speed = function(a) { return a !== d && (this._speed = a), this._speed }, e.prototype.coordinates = function(b) { var c, e = 1,
f = b - 1; return b === d ? a.map(this._coordinates, a.proxy(function(a, b) { return this.coordinates(b) }, this)) : (this.settings.center ? (this.settings.rtl && (e = -1, f = b + 1), c = this._coordinates[b], c += (this.width() - c + (this._coordinates[f] || 0)) / 2 * e) : c = this._coordinates[f] || 0, c = Math.ceil(c)) }, e.prototype.duration = function(a, b, c) { return 0 === c ? 0 : Math.min(Math.max(Math.abs(b - a), 1), 6) * Math.abs(c || this.settings.smartSpeed) }, e.prototype.to = function(a, b) { var c = this.current(),
d = null,
e = a - this.relative(c),
f = (e > 0) - (e < 0),
g = this._items.length,
h = this.minimum(),
i = this.maximum();
this.settings.loop ? (!this.settings.rewind && Math.abs(e) > g / 2 && (e += -1 * f * g), a = c + e, (d = ((a - h) % g + g) % g + h) !== a && d - e <= i && d - e > 0 && (c = d - e, a = d, this.reset(c))) : this.settings.rewind ? (i += 1, a = (a % i + i) % i) : a = Math.max(h, Math.min(i, a)), this.speed(this.duration(c, a, b)), this.current(a), this.isVisible() && this.update() }, e.prototype.next = function(a) { a = a || !1, this.to(this.relative(this.current()) + 1, a) }, e.prototype.prev = function(a) { a = a || !1, this.to(this.relative(this.current()) - 1, a) }, e.prototype.onTransitionEnd = function(a) { if (a !== d && (a.stopPropagation(), (a.target || a.srcElement || a.originalTarget) !== this.$stage.get(0))) return !1;
this.leave("animating"), this.trigger("translated") }, e.prototype.viewport = function() { var d; return this.options.responsiveBaseElement !== b ? d = a(this.options.responsiveBaseElement).width() : b.innerWidth ? d = b.innerWidth : c.documentElement && c.documentElement.clientWidth ? d = c.documentElement.clientWidth : console.warn("Can not detect viewport width."), d }, e.prototype.replace = function(b) { this.$stage.empty(), this._items = [], b && (b = b instanceof jQuery ? b : a(b)), this.settings.nestedItemSelector && (b = b.find("." + this.settings.nestedItemSelector)), b.filter(function() { return 1 === this.nodeType }).each(a.proxy(function(a, b) { b = this.prepare(b), this.$stage.append(b), this._items.push(b), this._mergers.push(1 * b.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1) }, this)), this.reset(this.isNumeric(this.settings.startPosition) ? this.settings.startPosition : 0), this.invalidate("items") }, e.prototype.add = function(b, c) { var e = this.relative(this._current);
c = c === d ? this._items.length : this.normalize(c, !0), b = b instanceof jQuery ? b : a(b), this.trigger("add", { content: b, position: c }), b = this.prepare(b), 0 === this._items.length || c === this._items.length ? (0 === this._items.length && this.$stage.append(b), 0 !== this._items.length && this._items[c - 1].after(b), this._items.push(b), this._mergers.push(1 * b.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)) : (this._items[c].before(b), this._items.splice(c, 0, b), this._mergers.splice(c, 0, 1 * b.find("[data-merge]").addBack("[data-merge]").attr("data-merge") || 1)), this._items[e] && this.reset(this._items[e].index()), this.invalidate("items"), this.trigger("added", { content: b, position: c }) }, e.prototype.remove = function(a) {
(a = this.normalize(a, !0)) !== d && (this.trigger("remove", { content: this._items[a], position: a }), this._items[a].remove(), this._items.splice(a, 1), this._mergers.splice(a, 1), this.invalidate("items"), this.trigger("removed", { content: null, position: a })) }, e.prototype.preloadAutoWidthImages = function(b) { b.each(a.proxy(function(b, c) { this.enter("pre-loading"), c = a(c), a(new Image).one("load", a.proxy(function(a) { c.attr("src", a.target.src), c.css("opacity", 1), this.leave("pre-loading"), !this.is("pre-loading") && !this.is("initializing") && this.refresh() }, this)).attr("src", c.attr("src") || c.attr("data-src") || c.attr("data-src-retina")) }, this)) }, e.prototype.destroy = function() { this.$element.off(".owl.core"), this.$stage.off(".owl.core"), a(c).off(".owl.core"), !1 !== this.settings.responsive && (b.clearTimeout(this.resizeTimer), this.off(b, "resize", this._handlers.onThrottledResize)); for (var d in this._plugins) this._plugins[d].destroy();
this.$stage.children(".cloned").remove(), this.$stage.unwrap(), this.$stage.children().contents().unwrap(), this.$stage.children().unwrap(), this.$stage.remove(), this.$element.removeClass(this.options.refreshClass).removeClass(this.options.loadingClass).removeClass(this.options.loadedClass).removeClass(this.options.rtlClass).removeClass(this.options.dragClass).removeClass(this.options.grabClass).attr("class", this.$element.attr("class").replace(new RegExp(this.options.responsiveClass + "-\\S+\\s", "g"), "")).removeData("owl.carousel") }, e.prototype.op = function(a, b, c) { var d = this.settings.rtl; switch (b) {
case "<":
return d ? a > c : a < c;
case ">":
return d ? a < c : a > c;
case ">=":
return d ? a <= c : a >= c;
case "<=":
return d ? a >= c : a <= c } }, e.prototype.on = function(a, b, c, d) { a.addEventListener ? a.addEventListener(b, c, d) : a.attachEvent && a.attachEvent("on" + b, c) }, e.prototype.off = function(a, b, c, d) { a.removeEventListener ? a.removeEventListener(b, c, d) : a.detachEvent && a.detachEvent("on" + b, c) }, e.prototype.trigger = function(b, c, d, f, g) { var h = { item: { count: this._items.length, index: this.current() } },
i = a.camelCase(a.grep(["on", b, d], function(a) { return a }).join("-").toLowerCase()),
j = a.Event([b, "owl", d || "carousel"].join(".").toLowerCase(), a.extend({ relatedTarget: this }, h, c)); return this._supress[b] || (a.each(this._plugins, function(a, b) { b.onTrigger && b.onTrigger(j) }), this.register({ type: e.Type.Event, name: b }), this.$element.trigger(j), this.settings && "function" == typeof this.settings[i] && this.settings[i].call(this, j)), j }, e.prototype.enter = function(b) { a.each([b].concat(this._states.tags[b] || []), a.proxy(function(a, b) { this._states.current[b] === d && (this._states.current[b] = 0), this._states.current[b]++ }, this)) }, e.prototype.leave = function(b) { a.each([b].concat(this._states.tags[b] || []), a.proxy(function(a, b) { this._states.current[b]-- }, this)) }, e.prototype.register = function(b) { if (b.type === e.Type.Event) { if (a.event.special[b.name] || (a.event.special[b.name] = {}), !a.event.special[b.name].owl) { var c = a.event.special[b.name]._default;
a.event.special[b.name]._default = function(a) { return !c || !c.apply || a.namespace && -1 !== a.namespace.indexOf("owl") ? a.namespace && a.namespace.indexOf("owl") > -1 : c.apply(this, arguments) }, a.event.special[b.name].owl = !0 } } else b.type === e.Type.State && (this._states.tags[b.name] ? this._states.tags[b.name] = this._states.tags[b.name].concat(b.tags) : this._states.tags[b.name] = b.tags, this._states.tags[b.name] = a.grep(this._states.tags[b.name], a.proxy(function(c, d) { return a.inArray(c, this._states.tags[b.name]) === d }, this))) }, e.prototype.suppress = function(b) { a.each(b, a.proxy(function(a, b) { this._supress[b] = !0 }, this)) }, e.prototype.release = function(b) { a.each(b, a.proxy(function(a, b) { delete this._supress[b] }, this)) }, e.prototype.pointer = function(a) { var c = { x: null, y: null }; return a = a.originalEvent || a || b.event, a = a.touches && a.touches.length ? a.touches[0] : a.changedTouches && a.changedTouches.length ? a.changedTouches[0] : a, a.pageX ? (c.x = a.pageX, c.y = a.pageY) : (c.x = a.clientX, c.y = a.clientY), c }, e.prototype.isNumeric = function(a) { return !isNaN(parseFloat(a)) }, e.prototype.difference = function(a, b) { return { x: a.x - b.x, y: a.y - b.y } }, a.fn.owlCarousel = function(b) { var c = Array.prototype.slice.call(arguments, 1); return this.each(function() { var d = a(this),
f = d.data("owl.carousel");
f || (f = new e(this, "object" == typeof b && b), d.data("owl.carousel", f), a.each(["next", "prev", "to", "destroy", "refresh", "replace", "add", "remove"], function(b, c) { f.register({ type: e.Type.Event, name: c }), f.$element.on(c + ".owl.carousel.core", a.proxy(function(a) { a.namespace && a.relatedTarget !== this && (this.suppress([c]), f[c].apply(this, [].slice.call(arguments, 1)), this.release([c])) }, f)) })), "string" == typeof b && "_" !== b.charAt(0) && f[b].apply(f, c) }) }, a.fn.owlCarousel.Constructor = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { var e = function(b) { this._core = b, this._interval = null, this._visible = null, this._handlers = { "initialized.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.autoRefresh && this.watch() }, this) }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers) };
e.Defaults = { autoRefresh: !0, autoRefreshInterval: 500 }, e.prototype.watch = function() { this._interval || (this._visible = this._core.isVisible(), this._interval = b.setInterval(a.proxy(this.refresh, this), this._core.settings.autoRefreshInterval)) }, e.prototype.refresh = function() { this._core.isVisible() !== this._visible && (this._visible = !this._visible, this._core.$element.toggleClass("owl-hidden", !this._visible), this._visible && this._core.invalidate("width") && this._core.refresh()) }, e.prototype.destroy = function() { var a, c;
b.clearInterval(this._interval); for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); for (c in Object.getOwnPropertyNames(this)) "function" != typeof this[c] && (this[c] = null) }, a.fn.owlCarousel.Constructor.Plugins.AutoRefresh = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { var e = function(b) { this._core = b, this._loaded = [], this._handlers = { "initialized.owl.carousel change.owl.carousel resized.owl.carousel": a.proxy(function(b) { if (b.namespace && this._core.settings && this._core.settings.lazyLoad && (b.property && "position" == b.property.name || "initialized" == b.type)) { var c = this._core.settings,
e = c.center && Math.ceil(c.items / 2) || c.items,
f = c.center && -1 * e || 0,
g = (b.property && b.property.value !== d ? b.property.value : this._core.current()) + f,
h = this._core.clones().length,
i = a.proxy(function(a, b) { this.load(b) }, this); for (c.lazyLoadEager > 0 && (e += c.lazyLoadEager, c.loop && (g -= c.lazyLoadEager, e++)); f++ < e;) this.load(h / 2 + this._core.relative(g)), h && a.each(this._core.clones(this._core.relative(g)), i), g++ } }, this) }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers) };
e.Defaults = { lazyLoad: !1, lazyLoadEager: 0 }, e.prototype.load = function(c) { var d = this._core.$stage.children().eq(c),
e = d && d.find(".owl-lazy");!e || a.inArray(d.get(0), this._loaded) > -1 || (e.each(a.proxy(function(c, d) { var e, f = a(d),
g = b.devicePixelRatio > 1 && f.attr("data-src-retina") || f.attr("data-src") || f.attr("data-srcset");
this._core.trigger("load", { element: f, url: g }, "lazy"), f.is("img") ? f.one("load.owl.lazy", a.proxy(function() { f.css("opacity", 1), this._core.trigger("loaded", { element: f, url: g }, "lazy") }, this)).attr("src", g) : f.is("source") ? f.one("load.owl.lazy", a.proxy(function() { this._core.trigger("loaded", { element: f, url: g }, "lazy") }, this)).attr("srcset", g) : (e = new Image, e.onload = a.proxy(function() { f.css({ "background-image": 'url("' + g + '")', opacity: "1" }), this._core.trigger("loaded", { element: f, url: g }, "lazy") }, this), e.src = g) }, this)), this._loaded.push(d.get(0))) }, e.prototype.destroy = function() { var a, b; for (a in this.handlers) this._core.$element.off(a, this.handlers[a]); for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) }, a.fn.owlCarousel.Constructor.Plugins.Lazy = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { var e = function(c) { this._core = c, this._previousHeight = null, this._handlers = { "initialized.owl.carousel refreshed.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.autoHeight && this.update() }, this), "changed.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.autoHeight && "position" === a.property.name && this.update() }, this), "loaded.owl.lazy": a.proxy(function(a) { a.namespace && this._core.settings.autoHeight && a.element.closest("." + this._core.settings.itemClass).index() === this._core.current() && this.update() }, this) }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers), this._intervalId = null; var d = this;
a(b).on("load", function() { d._core.settings.autoHeight && d.update() }), a(b).resize(function() { d._core.settings.autoHeight && (null != d._intervalId && clearTimeout(d._intervalId), d._intervalId = setTimeout(function() { d.update() }, 250)) }) };
e.Defaults = { autoHeight: !1, autoHeightClass: "owl-height" }, e.prototype.update = function() { var b = this._core._current,
c = b + this._core.settings.items,
d = this._core.settings.lazyLoad,
e = this._core.$stage.children().toArray().slice(b, c),
f = [],
g = 0;
a.each(e, function(b, c) { f.push(a(c).height()) }), g = Math.max.apply(null, f), g <= 1 && d && this._previousHeight && (g = this._previousHeight), this._previousHeight = g, this._core.$stage.parent().height(g).addClass(this._core.settings.autoHeightClass) }, e.prototype.destroy = function() { var a, b; for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) }, a.fn.owlCarousel.Constructor.Plugins.AutoHeight = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { var e = function(b) { this._core = b, this._videos = {}, this._playing = null, this._handlers = { "initialized.owl.carousel": a.proxy(function(a) { a.namespace && this._core.register({ type: "state", name: "playing", tags: ["interacting"] }) }, this), "resize.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.video && this.isInFullScreen() && a.preventDefault() }, this), "refreshed.owl.carousel": a.proxy(function(a) { a.namespace && this._core.is("resizing") && this._core.$stage.find(".cloned .owl-video-frame").remove() }, this), "changed.owl.carousel": a.proxy(function(a) { a.namespace && "position" === a.property.name && this._playing && this.stop() }, this), "prepared.owl.carousel": a.proxy(function(b) { if (b.namespace) { var c = a(b.content).find(".owl-video");
c.length && (c.css("display", "none"), this.fetch(c, a(b.content))) } }, this) }, this._core.options = a.extend({}, e.Defaults, this._core.options), this._core.$element.on(this._handlers), this._core.$element.on("click.owl.video", ".owl-video-play-icon", a.proxy(function(a) { this.play(a) }, this)) };
e.Defaults = { video: !1, videoHeight: !1, videoWidth: !1 }, e.prototype.fetch = function(a, b) { var c = function() { return a.attr("data-vimeo-id") ? "vimeo" : a.attr("data-vzaar-id") ? "vzaar" : "youtube" }(),
d = a.attr("data-vimeo-id") || a.attr("data-youtube-id") || a.attr("data-vzaar-id"),
e = a.attr("data-width") || this._core.settings.videoWidth,
f = a.attr("data-height") || this._core.settings.videoHeight,
g = a.attr("href"); if (!g) throw new Error("Missing video URL."); if (d = g.match(/(http:|https:|)\/\/(player.|www.|app.)?(vimeo\.com|youtu(be\.com|\.be|be\.googleapis\.com|be\-nocookie\.com)|vzaar\.com)\/(video\/|videos\/|embed\/|channels\/.+\/|groups\/.+\/|watch\?v=|v\/)?([A-Za-z0-9._%-]*)(\&\S+)?/), d[3].indexOf("youtu") > -1) c = "youtube";
else if (d[3].indexOf("vimeo") > -1) c = "vimeo";
else { if (!(d[3].indexOf("vzaar") > -1)) throw new Error("Video URL not supported.");
c = "vzaar" }
d = d[6], this._videos[g] = { type: c, id: d, width: e, height: f }, b.attr("data-video", g), this.thumbnail(a, this._videos[g]) }, e.prototype.thumbnail = function(b, c) { var d, e, f, g = c.width && c.height ? "width:" + c.width + "px;height:" + c.height + "px;" : "",
h = b.find("img"),
i = "src",
j = "",
k = this._core.settings,
l = function(c) { e = '<div class="owl-video-play-icon"></div>', d = k.lazyLoad ? a("<div/>", { class: "owl-video-tn " + j, srcType: c }) : a("<div/>", { class: "owl-video-tn", style: "opacity:1;background-image:url(" + c + ")" }), b.after(d), b.after(e) }; if (b.wrap(a("<div/>", { class: "owl-video-wrapper", style: g })), this._core.settings.lazyLoad && (i = "data-src", j = "owl-lazy"), h.length) return l(h.attr(i)), h.remove(), !1; "youtube" === c.type ? (f = "//img.youtube.com/vi/" + c.id + "/hqdefault.jpg", l(f)) : "vimeo" === c.type ? a.ajax({ type: "GET", url: "//vimeo.com/api/v2/video/" + c.id + ".json", jsonp: "callback", dataType: "jsonp", success: function(a) { f = a[0].thumbnail_large, l(f) } }) : "vzaar" === c.type && a.ajax({ type: "GET", url: "//vzaar.com/api/videos/" + c.id + ".json", jsonp: "callback", dataType: "jsonp", success: function(a) { f = a.framegrab_url, l(f) } }) }, e.prototype.stop = function() { this._core.trigger("stop", null, "video"), this._playing.find(".owl-video-frame").remove(), this._playing.removeClass("owl-video-playing"), this._playing = null, this._core.leave("playing"), this._core.trigger("stopped", null, "video") }, e.prototype.play = function(b) { var c, d = a(b.target),
e = d.closest("." + this._core.settings.itemClass),
f = this._videos[e.attr("data-video")],
g = f.width || "100%",
h = f.height || this._core.$stage.height();
this._playing || (this._core.enter("playing"), this._core.trigger("play", null, "video"), e = this._core.items(this._core.relative(e.index())), this._core.reset(e.index()), c = a('<iframe frameborder="0" allowfullscreen mozallowfullscreen webkitAllowFullScreen ></iframe>'), c.attr("height", h), c.attr("width", g), "youtube" === f.type ? c.attr("src", "//www.youtube.com/embed/" + f.id + "?autoplay=1&rel=0&v=" + f.id) : "vimeo" === f.type ? c.attr("src", "//player.vimeo.com/video/" + f.id + "?autoplay=1") : "vzaar" === f.type && c.attr("src", "//view.vzaar.com/" + f.id + "/player?autoplay=true"), a(c).wrap('<div class="owl-video-frame" />').insertAfter(e.find(".owl-video")), this._playing = e.addClass("owl-video-playing")) }, e.prototype.isInFullScreen = function() { var b = c.fullscreenElement || c.mozFullScreenElement || c.webkitFullscreenElement; return b && a(b).parent().hasClass("owl-video-frame") }, e.prototype.destroy = function() { var a, b;
this._core.$element.off("click.owl.video"); for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) }, a.fn.owlCarousel.Constructor.Plugins.Video = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) {
var e = function(b) { this.core = b, this.core.options = a.extend({}, e.Defaults, this.core.options), this.swapping = !0, this.previous = d, this.next = d, this.handlers = { "change.owl.carousel": a.proxy(function(a) { a.namespace && "position" == a.property.name && (this.previous = this.core.current(), this.next = a.property.value) }, this), "drag.owl.carousel dragged.owl.carousel translated.owl.carousel": a.proxy(function(a) { a.namespace && (this.swapping = "translated" == a.type) }, this), "translate.owl.carousel": a.proxy(function(a) { a.namespace && this.swapping && (this.core.options.animateOut || this.core.options.animateIn) && this.swap() }, this) }, this.core.$element.on(this.handlers) };
e.Defaults = {
animateOut: !1,
animateIn: !1
}, e.prototype.swap = function() { if (1 === this.core.settings.items && a.support.animation && a.support.transition) { this.core.speed(0); var b, c = a.proxy(this.clear, this),
d = this.core.$stage.children().eq(this.previous),
e = this.core.$stage.children().eq(this.next),
f = this.core.settings.animateIn,
g = this.core.settings.animateOut;
this.core.current() !== this.previous && (g && (b = this.core.coordinates(this.previous) - this.core.coordinates(this.next), d.one(a.support.animation.end, c).css({ left: b + "px" }).addClass("animated owl-animated-out").addClass(g)), f && e.one(a.support.animation.end, c).addClass("animated owl-animated-in").addClass(f)) } }, e.prototype.clear = function(b) { a(b.target).css({ left: "" }).removeClass("animated owl-animated-out owl-animated-in").removeClass(this.core.settings.animateIn).removeClass(this.core.settings.animateOut), this.core.onTransitionEnd() }, e.prototype.destroy = function() { var a, b; for (a in this.handlers) this.core.$element.off(a, this.handlers[a]); for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) }, a.fn.owlCarousel.Constructor.Plugins.Animate = e
}(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { var e = function(b) { this._core = b, this._call = null, this._time = 0, this._timeout = 0, this._paused = !0, this._handlers = { "changed.owl.carousel": a.proxy(function(a) { a.namespace && "settings" === a.property.name ? this._core.settings.autoplay ? this.play() : this.stop() : a.namespace && "position" === a.property.name && this._paused && (this._time = 0) }, this), "initialized.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.autoplay && this.play() }, this), "play.owl.autoplay": a.proxy(function(a, b, c) { a.namespace && this.play(b, c) }, this), "stop.owl.autoplay": a.proxy(function(a) { a.namespace && this.stop() }, this), "mouseover.owl.autoplay": a.proxy(function() { this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() }, this), "mouseleave.owl.autoplay": a.proxy(function() { this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.play() }, this), "touchstart.owl.core": a.proxy(function() { this._core.settings.autoplayHoverPause && this._core.is("rotating") && this.pause() }, this), "touchend.owl.core": a.proxy(function() { this._core.settings.autoplayHoverPause && this.play() }, this) }, this._core.$element.on(this._handlers), this._core.options = a.extend({}, e.Defaults, this._core.options) };
e.Defaults = { autoplay: !1, autoplayTimeout: 5e3, autoplayHoverPause: !1, autoplaySpeed: !1 }, e.prototype._next = function(d) { this._call = b.setTimeout(a.proxy(this._next, this, d), this._timeout * (Math.round(this.read() / this._timeout) + 1) - this.read()), this._core.is("interacting") || c.hidden || this._core.next(d || this._core.settings.autoplaySpeed) }, e.prototype.read = function() { return (new Date).getTime() - this._time }, e.prototype.play = function(c, d) { var e;
this._core.is("rotating") || this._core.enter("rotating"), c = c || this._core.settings.autoplayTimeout, e = Math.min(this._time % (this._timeout || c), c), this._paused ? (this._time = this.read(), this._paused = !1) : b.clearTimeout(this._call), this._time += this.read() % c - e, this._timeout = c, this._call = b.setTimeout(a.proxy(this._next, this, d), c - e) }, e.prototype.stop = function() { this._core.is("rotating") && (this._time = 0, this._paused = !0, b.clearTimeout(this._call), this._core.leave("rotating")) }, e.prototype.pause = function() { this._core.is("rotating") && !this._paused && (this._time = this.read(), this._paused = !0, b.clearTimeout(this._call)) }, e.prototype.destroy = function() { var a, b;
this.stop(); for (a in this._handlers) this._core.$element.off(a, this._handlers[a]); for (b in Object.getOwnPropertyNames(this)) "function" != typeof this[b] && (this[b] = null) }, a.fn.owlCarousel.Constructor.Plugins.autoplay = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { "use strict"; var e = function(b) { this._core = b, this._initialized = !1, this._pages = [], this._controls = {}, this._templates = [], this.$element = this._core.$element, this._overrides = { next: this._core.next, prev: this._core.prev, to: this._core.to }, this._handlers = { "prepared.owl.carousel": a.proxy(function(b) { b.namespace && this._core.settings.dotsData && this._templates.push('<div class="' + this._core.settings.dotClass + '">' + a(b.content).find("[data-dot]").addBack("[data-dot]").attr("data-dot") + "</div>") }, this), "added.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.dotsData && this._templates.splice(a.position, 0, this._templates.pop()) }, this), "remove.owl.carousel": a.proxy(function(a) { a.namespace && this._core.settings.dotsData && this._templates.splice(a.position, 1) }, this), "changed.owl.carousel": a.proxy(function(a) { a.namespace && "position" == a.property.name && this.draw() }, this), "initialized.owl.carousel": a.proxy(function(a) { a.namespace && !this._initialized && (this._core.trigger("initialize", null, "navigation"), this.initialize(), this.update(), this.draw(), this._initialized = !0, this._core.trigger("initialized", null, "navigation")) }, this), "refreshed.owl.carousel": a.proxy(function(a) { a.namespace && this._initialized && (this._core.trigger("refresh", null, "navigation"), this.update(), this.draw(), this._core.trigger("refreshed", null, "navigation")) }, this) }, this._core.options = a.extend({}, e.Defaults, this._core.options), this.$element.on(this._handlers) };
e.Defaults = { nav: !1, navText: ['<span aria-label="Previous">&#x2039;</span>', '<span aria-label="Next">&#x203a;</span>'], navSpeed: !1, navElement: 'button type="button" role="presentation"', navContainer: !1, navContainerClass: "owl-nav", navClass: ["owl-prev", "owl-next"], slideBy: 1, dotClass: "owl-dot", dotsClass: "owl-dots", dots: !0, dotsEach: !1, dotsData: !1, dotsSpeed: !1, dotsContainer: !1 }, e.prototype.initialize = function() { var b, c = this._core.settings;
this._controls.$relative = (c.navContainer ? a(c.navContainer) : a("<div>").addClass(c.navContainerClass).appendTo(this.$element)).addClass("disabled"), this._controls.$previous = a("<" + c.navElement + ">").addClass(c.navClass[0]).html(c.navText[0]).prependTo(this._controls.$relative).on("click", a.proxy(function(a) { this.prev(c.navSpeed) }, this)), this._controls.$next = a("<" + c.navElement + ">").addClass(c.navClass[1]).html(c.navText[1]).appendTo(this._controls.$relative).on("click", a.proxy(function(a) { this.next(c.navSpeed) }, this)), c.dotsData || (this._templates = [a('<button role="button">').addClass(c.dotClass).append(a("<span>")).prop("outerHTML")]), this._controls.$absolute = (c.dotsContainer ? a(c.dotsContainer) : a("<div>").addClass(c.dotsClass).appendTo(this.$element)).addClass("disabled"), this._controls.$absolute.on("click", "button", a.proxy(function(b) { var d = a(b.target).parent().is(this._controls.$absolute) ? a(b.target).index() : a(b.target).parent().index();
b.preventDefault(), this.to(d, c.dotsSpeed) }, this)); for (b in this._overrides) this._core[b] = a.proxy(this[b], this) }, e.prototype.destroy = function() { var a, b, c, d, e;
e = this._core.settings; for (a in this._handlers) this.$element.off(a, this._handlers[a]); for (b in this._controls) "$relative" === b && e.navContainer ? this._controls[b].html("") : this._controls[b].remove(); for (d in this.overides) this._core[d] = this._overrides[d]; for (c in Object.getOwnPropertyNames(this)) "function" != typeof this[c] && (this[c] = null) }, e.prototype.update = function() { var a, b, c, d = this._core.clones().length / 2,
e = d + this._core.items().length,
f = this._core.maximum(!0),
g = this._core.settings,
h = g.center || g.autoWidth || g.dotsData ? 1 : g.dotsEach || g.items; if ("page" !== g.slideBy && (g.slideBy = Math.min(g.slideBy, g.items)), g.dots || "page" == g.slideBy)
for (this._pages = [], a = d, b = 0, c = 0; a < e; a++) { if (b >= h || 0 === b) { if (this._pages.push({ start: Math.min(f, a - d), end: a - d + h - 1 }), Math.min(f, a - d) === f) break;
b = 0, ++c }
b += this._core.mergers(this._core.relative(a)) } }, e.prototype.draw = function() { var b, c = this._core.settings,
d = this._core.items().length <= c.items,
e = this._core.relative(this._core.current()),
f = c.loop || c.rewind;
this._controls.$relative.toggleClass("disabled", !c.nav || d), c.nav && (this._controls.$previous.toggleClass("disabled", !f && e <= this._core.minimum(!0)), this._controls.$next.toggleClass("disabled", !f && e >= this._core.maximum(!0))), this._controls.$absolute.toggleClass("disabled", !c.dots || d), c.dots && (b = this._pages.length - this._controls.$absolute.children().length, c.dotsData && 0 !== b ? this._controls.$absolute.html(this._templates.join("")) : b > 0 ? this._controls.$absolute.append(new Array(b + 1).join(this._templates[0])) : b < 0 && this._controls.$absolute.children().slice(b).remove(), this._controls.$absolute.find(".active").removeClass("active"), this._controls.$absolute.children().eq(a.inArray(this.current(), this._pages)).addClass("active")) }, e.prototype.onTrigger = function(b) { var c = this._core.settings;
b.page = { index: a.inArray(this.current(), this._pages), count: this._pages.length, size: c && (c.center || c.autoWidth || c.dotsData ? 1 : c.dotsEach || c.items) } }, e.prototype.current = function() { var b = this._core.relative(this._core.current()); return a.grep(this._pages, a.proxy(function(a, c) { return a.start <= b && a.end >= b }, this)).pop() }, e.prototype.getPosition = function(b) { var c, d, e = this._core.settings; return "page" == e.slideBy ? (c = a.inArray(this.current(), this._pages), d = this._pages.length, b ? ++c : --c, c = this._pages[(c % d + d) % d].start) : (c = this._core.relative(this._core.current()), d = this._core.items().length, b ? c += e.slideBy : c -= e.slideBy), c }, e.prototype.next = function(b) { a.proxy(this._overrides.to, this._core)(this.getPosition(!0), b) }, e.prototype.prev = function(b) { a.proxy(this._overrides.to, this._core)(this.getPosition(!1), b) }, e.prototype.to = function(b, c, d) { var e;!d && this._pages.length ? (e = this._pages.length, a.proxy(this._overrides.to, this._core)(this._pages[(b % e + e) % e].start, c)) : a.proxy(this._overrides.to, this._core)(b, c) }, a.fn.owlCarousel.Constructor.Plugins.Navigation = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) { "use strict"; var e = function(c) { this._core = c, this._hashes = {}, this.$element = this._core.$element, this._handlers = { "initialized.owl.carousel": a.proxy(function(c) { c.namespace && "URLHash" === this._core.settings.startPosition && a(b).trigger("hashchange.owl.navigation") }, this), "prepared.owl.carousel": a.proxy(function(b) { if (b.namespace) { var c = a(b.content).find("[data-hash]").addBack("[data-hash]").attr("data-hash"); if (!c) return;
this._hashes[c] = b.content } }, this), "changed.owl.carousel": a.proxy(function(c) { if (c.namespace && "position" === c.property.name) { var d = this._core.items(this._core.relative(this._core.current())),
e = a.map(this._hashes, function(a, b) { return a === d ? b : null }).join(); if (!e || b.location.hash.slice(1) === e) return;
b.location.hash = e } }, this) }, this._core.options = a.extend({}, e.Defaults, this._core.options), this.$element.on(this._handlers), a(b).on("hashchange.owl.navigation", a.proxy(function(a) { var c = b.location.hash.substring(1),
e = this._core.$stage.children(),
f = this._hashes[c] && e.index(this._hashes[c]);
f !== d && f !== this._core.current() && this._core.to(this._core.relative(f), !1, !0) }, this)) };
e.Defaults = { URLhashListener: !1 }, e.prototype.destroy = function() { var c, d;
a(b).off("hashchange.owl.navigation"); for (c in this._handlers) this._core.$element.off(c, this._handlers[c]); for (d in Object.getOwnPropertyNames(this)) "function" != typeof this[d] && (this[d] = null) }, a.fn.owlCarousel.Constructor.Plugins.Hash = e }(window.Zepto || window.jQuery, window, document),
function(a, b, c, d) {
function e(b, c) { var e = !1,
f = b.charAt(0).toUpperCase() + b.slice(1); return a.each((b + " " + h.join(f + " ") + f).split(" "), function(a, b) { if (g[b] !== d) return e = !c || b, !1 }), e }
function f(a) { return e(a, !0) } var g = a("<support>").get(0).style,
h = "Webkit Moz O ms".split(" "),
i = { transition: { end: { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd", transition: "transitionend" } }, animation: { end: { WebkitAnimation: "webkitAnimationEnd", MozAnimation: "animationend", OAnimation: "oAnimationEnd", animation: "animationend" } } },
j = { csstransforms: function() { return !!e("transform") }, csstransforms3d: function() { return !!e("perspective") }, csstransitions: function() { return !!e("transition") }, cssanimations: function() { return !!e("animation") } };
j.csstransitions() && (a.support.transition = new String(f("transition")), a.support.transition.end = i.transition.end[a.support.transition]), j.cssanimations() && (a.support.animation = new String(f("animation")), a.support.animation.end = i.animation.end[a.support.animation]), j.csstransforms() && (a.support.transform = new String(f("transform")), a.support.transform3d = j.csstransforms3d()) }(window.Zepto || window.jQuery, window, document);

View File

@@ -0,0 +1,443 @@
function maxLengthCheck(object) {
if (object.value.length > object.max.length)
object.value = object.value.slice(0, object.max.length)
}
function isNumeric(evt) {
let theEvent = evt || window.event;
let key = theEvent.keyCode || theEvent.which;
key = String.fromCharCode(key);
let regex = /[0-9]|\./;
if (!regex.test(key)) {
theEvent.returnValue = false;
if (theEvent.preventDefault) theEvent.preventDefault();
}
}
//
//
let heart = document.querySelectorAll('#product-heart-id');
for (let i = 0; i < heart.length; i++) {
heart[i].addEventListener('click', function() {
heart[i].classList.toggle('bxs-heart')
})
}
let search_category_btn = document.querySelector('#search-category');
let fe_search_popup = document.querySelector('.fe-search-popup');
let close_popup_btn = document.querySelector('#close-popup');
let popup_category = document.querySelectorAll('#popup-category');
let arrow = document.querySelector('#search-arrow');
let popup_category_all = document.querySelector('#popup-category-all');
search_category_btn.addEventListener('click', () => {
fe_search_popup.style.display = 'block';
document.querySelector('body').style.overflow = 'hidden';
});
close_popup_btn.addEventListener('click', () => {
fe_search_popup.style.display = 'none';
document.querySelector('body').style.overflow = 'auto';
});
arrow.addEventListener('click', () => {
if (arrow.classList.contains('bxs-down-arrow')) {
fe_search_popup.style.display = 'block';
document.querySelector('body').style.overflow = 'hidden';
}
})
window.addEventListener('click', f => {
const target = f.target;
if (target.closest('.fe-search-popup')) {
fe_search_popup.style.display = 'none'
document.querySelector('body').style.overflow = 'auto';
}
})
for (let i = 0; i < popup_category.length; i++) {
popup_category[i].addEventListener('click', () => {
search_category_btn.innerText = popup_category[i].innerText;
fe_search_popup.style.display = 'none';
arrow.classList.remove('bxs-down-arrow');
arrow.classList.add('bx-x');
arrow.style.color = '#157DEC';
arrow.style.fontSize = '1.4rem';
arrow.style.background = 'white';
arrow.style.borderRadius = '50%';
arrow.style.cursor = 'pointer'
});
popup_category_all.addEventListener('click', () => {
search_category_btn.innerText = popup_category_all.innerText;
arrow.classList.add('bxs-down-arrow');
arrow.classList.remove('bx-x');
arrow.style.color = '#fff';
arrow.style.fontSize = '1rem';
arrow.style.background = 'none';
arrow.style.borderRadius = 'none';
})
arrow.addEventListener('click', () => {
arrow.classList.add('bxs-down-arrow');
arrow.classList.remove('bx-x');
search_category_btn.innerText = popup_category_all.innerText
arrow.style.color = '#fff';
arrow.style.fontSize = '1rem';
arrow.style.background = 'none';
arrow.style.borderRadius = 'none';
})
};
//
//
//
//
//
//
//
//
let cat_link = document.querySelectorAll('.fe-categories-link');
let fe_cat = document.querySelectorAll('.fe-dropdown-cat')
let cat_box = document.querySelectorAll('fe-catalog-list-box')
let gray_bg = document.querySelector('.gray-bg')
let hd = document.querySelector('.header');
let back_page = document.querySelectorAll('.back-page-btn')
cat_link.forEach(catlink => {
fe_cat.forEach(fecat => {
catlink.addEventListener('click', (event) => {
let target = event.target
gray_bg.style.display = 'block'
document.querySelector('body').style.overflow = 'hidden'
if (target.id == catlink.id && catlink.id == fecat.id) {
fecat.style.display = 'block'
} else {
fecat.style.display = 'none'
}
})
back_page.forEach(back => {
back.addEventListener('click', () => {
fecat.style.display = 'none'
})
})
gray_bg.addEventListener('click', () => {
gray_bg.style.display = 'none'
fecat.style.display = 'none'
document.querySelector('body').style.overflow = 'auto'
catlink.classList.remove('active-border')
})
hd.addEventListener('click', () => {
gray_bg.style.display = 'none'
fecat.style.display = 'none'
catlink.classList.remove('active-border')
})
});
})
//
//
//
//
//
//
//
//
let log = document.querySelector('.log');
let fe_login_reg = document.querySelector('.fe-login-reg');
let close_lore_popup = document.querySelector('#close-lore-popup');
let code_send_btn = document.querySelector('#code-send-btn');
let fe_popup_code = document.querySelector('.fe-popup-code');
let back_page_btn = document.querySelector('#back-page-btn');
let input_tel = document.querySelector('#input-tel');
let fe_popup_confirm = document.querySelector('.fe-popup-confirm');
let change_num_btn = document.querySelector('#change-num-btn');
let open_login = document.querySelectorAll('#open-login');
change_num_btn.addEventListener('click', () => {
fe_popup_code.classList.add('active')
fe_popup_confirm.classList.remove('active')
})
let lit_cat_text = document.querySelectorAll('.fe-lit-cat-text');
let lit_cat_items = document.querySelectorAll('.fe-lit-cat-items');
let bxs_down_arrow = document.querySelectorAll('.bx-down-arrow');
lit_cat_text.forEach(text => {
lit_cat_items.forEach(items => {
bxs_down_arrow.forEach(darrow => {
text.addEventListener('click', () => {
if (text.id == items.id && text.id == darrow.id) {
items.classList.toggle('lit-sub-menu')
darrow.classList.toggle('bx-up-arrow')
}
})
})
})
})
let prod_size = document.querySelectorAll('.fe-prod-size')
let prod_act = document.getElementsByClassName('prod-active')
let prod_num = document.querySelector('#prod-size')
for (let x = 0; prod_size.length > x; x++) {
prod_size[x].onclick = (event) => {
let target = event.target
let cur_prod = prod_act[0]
if (prod_size[x].classList.contains('prod-none')) {
return
}
if (prod_size[x].classList.contains('prod-active')) {
return
}
if (cur_prod) {
cur_prod.classList.remove('prod-active');
}
if (cur_prod !== target) {
target.classList.add('prod-active')
}
prod_num.innerText = target.innerText
}
}
open_login.forEach(oplog => {
oplog.addEventListener('click', () => {
fe_login_reg.classList.add('active');
document.querySelector('body').style.overflow = 'hidden'
});
})
let info = document.querySelectorAll('.fe-prod-detail');
let bx_plus = document.querySelectorAll('.pr-pl');
let prod_detail = document.querySelectorAll('.prod-detail');
info.forEach(more => {
prod_detail.forEach(detail => {
bx_plus.forEach(plus => {
more.addEventListener('click', () => {
if (more.id == detail.id && more.id == plus.id) {
plus.innerText = plus.innerText === '+' ? '-' : '+';
detail.style.display = detail.style.display === 'block' ? 'none' : 'block';
}
})
})
})
})
let ant_clr = document.querySelectorAll('.anthracite-pic')
let anth_act = document.getElementsByClassName('anth-act')
for (let x = 0; ant_clr.length > x; x++) {
ant_clr[x].onclick = (event) => {
let target = event.target
let cur_prod = anth_act[0]
if (ant_clr[x].classList.contains('anth-act')) {
return
}
if (cur_prod) {
cur_prod.classList.remove('anth-act');
cur_prod.classList.add('anth-dct');
}
if (cur_prod !== target) {
target.classList.add('anth-act')
target.classList.remove('anth-dct')
}
}
}
//
//
//
//
let fav_ord = document.querySelectorAll('#fav-to-ord')
fav_ord.forEach(basket => {
basket.addEventListener('click', function() {
basket.classList.toggle('basket-act')
})
});
let cn = document.querySelectorAll('.counter')
let counterVal = 1
function increment() {
updateDisplay(++counterVal)
}
function dicrement() {
if (counterVal < 1) {
return
}
updateDisplay(--counterVal)
}
function updateDisplay(val) {
for (let i = 0; i < cn.length; i++) {
cn[i].innerHTML = val;
}
}
//
//
//
//
let side = window.matchMedia("(max-width: 1350px)")
let closeSide = window.matchMedia("(min-width: 1350px)")
let main = document.querySelector('.fe-top-header-categories')
let open_sb = document.querySelector('#open-side-bar');
let close_sb = document.querySelector('#close-side-bar');
let list_li = document.querySelectorAll('.fe-header-category-list')
let list_text = document.querySelectorAll('#fe-header-category-list-text');
let cat_list_text = document.querySelectorAll('.category-list-text')
function sidFc(side) {
if (side.matches) {
open_sb.addEventListener('click', () => {
main.classList.add('activated')
gray_bg.classList.add('activated')
})
close_sb.addEventListener('click', () => {
main.classList.remove('activated')
gray_bg.classList.remove('activated')
})
gray_bg.addEventListener('click', () => {
main.classList.remove('activated')
gray_bg.classList.remove('activated')
})
for (let j = 0; j < list_text.length; j++) {
list_text[j].addEventListener('click', event => {
let target = event.target
if (!target) {
list_text[j].classList.add('diactivated')
}
if (target) {
cat_list_text[i].classList.remove('diactivated')
}
});
}
}
}
function clsSD(closeSide) {
if (closeSide.matches) {
main.classList.remove('activated')
gray_bg.classList.remove('activated')
}
}
sidFc(side)
side.addListener(sidFc)
clsSD(closeSide)
closeSide.addListener(clsSD)
//
//
//
//
let like_btn = document.querySelector('#like-btn')
// let like_btn_child = like_btn.querySelector('.bx-heart')
// like_btn.addEventListener('click', () => {
// like_btn_child.classList.toggle('bxs-heart')
// })
//
//
//
//
let stars = document.querySelectorAll('#rate-star');
let rate_count = document.querySelector('#rate-count');
for (let i = 0; i < stars.length; i++) {
stars[i].addEventListener('click', (e) => {
let target = e.target
if (target == stars[0]) {
stars[0].classList.remove('bx-star')
stars[0].classList.add('bxs-star')
stars[1].classList.remove('bxs-star')
stars[1].classList.add('bx-star')
stars[2].classList.remove('bxs-star')
stars[2].classList.add('bx-star')
stars[3].classList.remove('bxs-star')
stars[3].classList.add('bx-star')
stars[4].classList.remove('bxs-star')
stars[4].classList.add('bx-star')
rate_count.innerText = '1'
}
if (target == stars[1]) {
stars[0].classList.add('bxs-star')
stars[1].classList.remove('bx-star')
stars[1].classList.add('bxs-star')
stars[2].classList.remove('bxs-star')
stars[2].classList.add('bx-star')
stars[3].classList.remove('bxs-star')
stars[3].classList.add('bx-star')
stars[4].classList.remove('bxs-star')
stars[4].classList.add('bx-star')
rate_count.innerText = '2'
}
if (target == stars[2]) {
stars[0].classList.add('bxs-star')
stars[1].classList.add('bxs-star')
stars[2].classList.remove('bx-star')
stars[2].classList.add('bxs-star')
stars[3].classList.remove('bxs-star')
stars[3].classList.add('bx-star')
stars[4].classList.remove('bxs-star')
stars[4].classList.add('bx-star')
rate_count.innerText = '3'
}
if (target == stars[3]) {
stars[0].classList.add('bxs-star')
stars[1].classList.add('bxs-star')
stars[2].classList.add('bxs-star')
stars[3].classList.remove('bx-star')
stars[3].classList.add('bxs-star')
stars[4].classList.remove('bxs-star')
stars[4].classList.add('bx-star')
rate_count.innerText = '4'
}
if (target == stars[4]) {
stars[0].classList.add('bxs-star')
stars[1].classList.add('bxs-star')
stars[2].classList.add('bxs-star')
stars[3].classList.add('bxs-star')
stars[4].classList.remove('bx-star')
stars[4].classList.add('bxs-star')
rate_count.innerText = '5'
}
})
}
//
//
//
//
back_page_btn.addEventListener('click', () => {
fe_popup_code.classList.add('active')
})

View File

@@ -0,0 +1,144 @@
$(document).ready(function() {
$(".slide-two").owlCarousel({
loop: true,
margin: 0,
nav: false,
autoplay: true,
smartSpeed: 1000,
autoplayTimeout: 4000,
responsive: {
0: {
items: 1
},
401: {
items: 2
},
650: {
items: 2
},
1120: {
items: 5
},
1350: {
items: 6
}
}
});
$(".slide-slow").owlCarousel({
loop: true,
margin: 10,
nav: false,
autoplay: true,
smartSpeed: 1500,
autoplayTimeout: 5000,
responsive: {
0: {
items: 1
},
401: {
items: 2
},
600: {
items: 3
},
1000: {
items: 4
},
1350: {
items: 5
}
}
});
$(".slide-slow-prod").owlCarousel({
loop: true,
margin: 10,
nav: false,
autoplay: true,
smartSpeed: 3000,
autoplayTimeout: 5000,
responsive: {
0: {
items: 1
},
600: {
items: 1
},
1000: {
items: 1
}
}
});
$(".slide-prod1").owlCarousel({
loop: true,
margin: 10,
nav: false,
autoplay: true,
smartSpeed: 3000,
autoplayTimeout: 4000,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});
$(".slide-prod2").owlCarousel({
loop: true,
margin: 10,
nav: false,
autoplay: true,
smartSpeed: 1000,
autoplayTimeout: 4000,
responsive: {
0: {
items: 1
},
600: {
items: 2
},
1000: {
items: 4
}
}
});
$(".brand-slim").owlCarousel({
loop: true,
margin: 10,
nav: false,
autoplay: true,
smartSpeed: 800,
autoplayTimeout: 2000,
responsive: {
0: {
items: 0
},
385: {
items: 3
},
600: {
items: 6
},
950: {
items: 8
},
1180: {
items: 10
},
1425: {
items: 12
}
}
});
});

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
function addToWishlist(button, id) {
let formData = {
id: id,
_token: document.querySelector('input[name=_token]').value,
};
$.ajax({
method: 'POST',
url: '/like/product',
data: formData,
success: (response) => {
Livewire.emit('favoritesUpdated');
Swal.fire('Ýerine ýetirldi', '', 'success');
button.children[0].classList.toggle('bxs-heart');
},
error: (exception) => {
console.log({exception});
}
});
setTimeout(function() {
button.children[0].classList.toggle('bxs-heart');
}, 1000);
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.4 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@@ -0,0 +1 @@
<svg width="80" height="80" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" preserveAspectRatio="xMidYMid" class="lds-infinity" style="background:0 0"><path fill="none" d="M24.3 30C11.4 30 5 43.3 5 50s6.4 20 19.3 20c19.3 0 32.1-40 51.4-40C88.6 30 95 43.3 95 50s-6.4 20-19.3 20c-19.3 0-32.1-40-51.4-40z" stroke="#333" stroke-width="2" stroke-dasharray="2.5658892822265624 2.5658892822265624"><animate attributeName="stroke-dashoffset" calcMode="linear" values="0;256.58892822265625" keyTimes="0;1" dur="1" begin="0s" repeatCount="indefinite"/></path></svg>

After

Width:  |  Height:  |  Size: 564 B

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */

View File

@@ -0,0 +1,3 @@
$(function () {
})();

View File

@@ -0,0 +1,362 @@
const Toast = Swal.mixin({
toast: true,
position: 'top-end',
showConfirmButton: false,
timer: 3000,
timerProgressBar: true,
didOpen: (toast) => {
toast.addEventListener('mouseenter', Swal.stopTimer)
toast.addEventListener('mouseleave', Swal.resumeTimer)
}
});
document.addEventListener('DOMContentLoaded', function(e) {
Event.listen('cartsUpdatedFromSidebar', event => {
showProductShowButton();
})
let pageURL = new URL(location);
if (pageURL.searchParams.has('sorting')) {
document.getElementById('SortBy').value = pageURL.searchParams.get('sorting');
}
let productPerPageSelect = document.getElementById('show-product-count-select');
if (pageURL.searchParams.has('perPage')) {
productPerPageSelect.value = pageURL.searchParams.get('perPage');
} else {
if (productPerPageSelect) {
productPerPageSelect.value = 32;
}
}
});
function subscribeUserToNewsletter(event) {
event.preventDefault();
$.ajax({
method: event.target.method,
url: event.target.action,
data: Object.fromEntries(new FormData(event.target).entries()),
success: (response) => {
Swal.fire('Üstünlikli goşuldy', '', 'success');
},
error: (exception) => {
Swal.fire('Üstünlikli goşuldy', '', 'success') ;
}
});
}
function loginAction(event) {
event.preventDefault();
// let phoneINPUT = document.getElementById('PopupCustomerPhoneContainer');
let verificationINPUT = document.getElementById('PopupCustomerVerificationCodeContainer');
$.ajax({
method: event.target.method,
url: window.Lara.routes.auth.twoFactor,
data: Object.fromEntries(new FormData(event.target).entries()),
success(response) {
console.log({response});
if (response.message == 'Login') {
window.location.reload(true);
}
if (response.message != 'success') {
return;
}
verificationINPUT.classList.remove('d-none');
verificationINPUT.setAttribute('required', 'required');
},
error(exception) {
console.log({exception});
// Swal.fire('Üstünlikli goşuldy', '', 'success') ;
},
done(data) {
console.log({a: data});
}
});
}
function updateLikeCount() {
let wishlistCount = document.getElementById('wishlist-count');
// let sidebarWishlistCount = document.getElementById('sidebar-wishlist-count');
$.ajax({
method: 'POST',
url: window.Lara.routes.products.likeCount,
data: {_token: document.querySelector('meta[name=csrf-token]').getAttribute('value')},
success: (response) => {
wishlistCount.innerText = response.count;
},
error: (exception) => {
console.log({exception});
}
});
}
function toggleProductLike(event, elem, id) {
event.preventDefault();
if (! window.Lara.auth.status) {
return;
}
let formData = {
id: id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
};
$.ajax({
method: 'POST',
url: window.Lara.routes.products.like,
data: formData,
success: (response) => {
if (response.attached) {
document.getElementById(id + '-favourite-icon-dislike')?.classList.add('d-none');
document.getElementById(id + '-favourite-icon-like')?.classList.remove('d-none');
Toast.fire({
icon: 'success',
title: window.Lara.translations.favouries.liked
})
} else {
document.getElementById(id + '-favourite-icon-dislike')?.classList.remove('d-none');
document.getElementById(id + '-favourite-icon-like')?.classList.add('d-none');
Toast.fire({
icon: 'info',
title: window.Lara.translations.favouries.unliked
})
}
Event.fire('likesUpdated');
},
error: (exception) => {
console.log({exception});
}
});
}
function toggleLikeProductShowButton(event, product_id) {
let addToLikeButtonMessage = document.getElementById('add-to-like-button-message');
let addedToLikeButtonMessage = document.getElementById('added-to-like-button-message');
toggleProductLike(event, event.target, product_id);
if (addToLikeButtonMessage.classList.contains('d-none')) {
addToLikeButtonMessage.classList.remove('d-none');
addToLikeButtonMessage.classList.add('d-flex');
addedToLikeButtonMessage.classList.remove('d-flex');
addedToLikeButtonMessage.classList.add('d-none');
} else {
addToLikeButtonMessage.classList.add('d-none');
addToLikeButtonMessage.classList.remove('d-flex');
addedToLikeButtonMessage.classList.add('d-flex');
addedToLikeButtonMessage.classList.remove('d-none');
}
}
function addToCart(product_id, with_count) {
if (! window.Lara.auth.status) {
return;
}
let quantity = with_count ? document.getElementById('product-quantity')?.value : null;
product_id = window.Lara.productOnCart ? window.Lara.productOnCart : product_id;
let formData = {
product_id: product_id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
quantity: quantity
};
$.ajax({
method: 'POST',
url: window.Lara.routes.carts.add,
data: formData,
success: (response) => {
Event.fire('cartsUpdated');
},
error: (exception) => {
if (exception.status == 422) {
if (validationMessage = exception.responseJSON.data.validations['product_out_of_stock_count']) {
alert(validationMessage);
}
}
}
});
}
function removeCartItem(product_id) {
if (! window.Lara.auth.status) {
return;
}
let formData = {
product_id: product_id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
};
fetch(window.Lara.routes.carts.remove, {
method: 'POST',
headers: {
'Accept': 'application/json, text/plain, */*',
'Content-Type': 'application/json'
},
credentials: 'same-origin',
body: JSON.stringify(formData)
}).then(response => response.json())
.then(data => {
Event.fire('cartsUpdated');
});
}
function updateCart(product_id, increment_by_one) {
if (! window.Lara.auth.status) {
return;
}
let quantity = new Number(document.getElementById('product-quantity')?.value);
if (increment_by_one || quantity == 0) {
quantity += 1;
}
let formData = {
product_id: product_id,
_token: document.querySelector('meta[name=csrf-token]').getAttribute('value'),
quantity: quantity
};
$.ajax({
method: 'POST',
url: window.Lara.routes.carts.update,
data: formData,
success: (response) => {
Event.fire('cartsUpdated');
},
error: (exception) => {
console.log({exception});
}
});
}
function updateProductShowButton() {
let addToCartMessage = document.getElementById('add-to-cart-button-message');
let removeFromCartMessage = document.getElementById('remove-from-cart-button-message');
let removeTrashIcon = document.getElementById('remove-from-cart-trash');
addToCartMessage.classList.remove('d-flex');
addToCartMessage.classList.add('d-none');
removeFromCartMessage.classList.remove('d-none');
removeFromCartMessage.classList.add('d-flex');
removeTrashIcon.classList.remove('d-none');
}
function showProductShowButton() {
let addToCartMessage = document.getElementById('add-to-cart-button-message');
let removeFromCartMessage = document.getElementById('remove-from-cart-button-message');
let removeTrashIcon = document.getElementById('remove-from-cart-trash');
let productQuantity = document.getElementById('product-quantity');
addToCartMessage.classList.remove('d-none');
addToCartMessage.classList.add('d-flex');
removeFromCartMessage.classList.remove('d-flex');
removeFromCartMessage.classList.add('d-none');
removeTrashIcon.classList.add('d-none');
productQuantity.value = 1;
}
function productShowCounterChanged(product_id, event) {
let addToCartMessage = document.getElementById('add-to-cart-button-message');
if (! addToCartMessage.classList.contains('d-flex')) {
updateCart(product_id, event.type == 'click');
}
}
async function postData(url = '', data = {}) {
const response = await fetch(url, {
method: 'POST',
mode: 'cors',
cache: 'no-cache',
credentials: 'same-origin',
headers: {
'Content-Type': 'application/json'
},
referrerPolicy: 'no-referrer',
body: JSON.stringify(data)
});
return response.json();
}
async function globalSearch(q) {
let response = await fetch(window.Lara.routes.app.globalSearch + '?q=' + q);
return response.json();
}
function addSorting(value) {
addUrlParam('sorting', value);
}
function addUrlParam(key, value, update = true) {
let pageURL = new URL(location);
pageURL.searchParams.delete(key)
pageURL.searchParams.append(key, value);
if (update) {
location.href = pageURL.href;
}
}
function sideScroll(element,direction,speed,distance,step){
scrollAmount = 0;
var slideTimer = setInterval(function(){
if (direction == 'left'){
element.scrollLeft -= step;
} else {
element.scrollLeft += step;
}
scrollAmount += step;
if (scrollAmount >= distance) {
window.clearInterval(slideTimer);
}
}, speed);
}
function scrollToClosest(position, elem, selector, points = 1000) {
if (position == 'left') {
let box = $(elem).parent().find(selector);
let x = ((box.width() / 2)) + box.scrollLeft();
box.animate({
scrollLeft: x,
});
// $(elem).parent().find(selector).scrollLeft(-points);
} else {
// $(elem).parent().find(selector).scrollLeft(+points);
}
}
// function orderDeliveryTimeChanged(event) {
// let clientTime = document.getElementById('order-client-time-container');
// if (event.target.value == 'standart') {
// clientTime.classList.remove('d-none');
// } else {
// clientTime.classList.add('d-none');
// }
// }

View File

@@ -0,0 +1 @@
createApp({data:function(){return{locale:window.Lara.locale,routes:window.Lara.routes,likedProducts:[],wishlist_count:0}},methods:{routeFor:function(t){return this.routes.products.show.replace("slug",t)},imageFor:function(t){return t+" 1x, "+t+" 2x"},getLikedProducts:function(){var t=this;fetch(this.routes.user.likesCount).then((function(t){return t.json()})).then((function(e){t.wishlist_count=e.count,document.getElementById("wishlist-count").innerText=e.count,Array.from(document.getElementsByClassName("favourites-icon-count")).forEach((function(t){t.innerText=e.count}))})),fetch(this.routes.user.likes).then((function(t){return t.json()})).then((function(e){t.likedProducts=e.data}))},clearWishlist:function(){this.likedProducts=[],this.wishlist_count=0,postData(this.routes.likes.clear,{_token:document.querySelector("meta[name=csrf-token]").getAttribute("value")}).then((function(t){return"success"==t.message?location.reload(!0):""}))}},mounted:function(){var t=this;window.Lara.auth.status&&this.getLikedProducts(),Event.listen("likesUpdated",(function(e){t.getLikedProducts()})),Event.listen("clearWishlist",(function(e){t.clearWishlist()}))}}).mount("#likes-sidebar");

View File

@@ -0,0 +1 @@
createApp({data:function(){return{routes:window.Lara.routes,locale:window.Lara.locale,all_categories:window.Lara.navigation.categories,categories_dropdown_hidden:!0,categories_to_show:new Object,activeLinks:[]}},methods:{hideCategoryDropdown:function(){this.categories_dropdown_hidden=!0},showCategoriesDropdown:function(){this.categories_dropdown_hidden=!1},showCategoriesFor:function(o){var t=this;this.categories_to_show=this.all_categories.find((function(t){return t.id==o})),this.all_categories.forEach((function(o){return t.activeLinks[o.slug]=!1})),this.activeLinks[this.categories_to_show.slug]=!0},categoryShowRouteFor:function(o){return this.routes.categories.products.replace("slug",o)}},mounted:function(){var o=this;this.all_categories.forEach((function(t,e){0==e?(o.categories_to_show=t,o.activeLinks[t.slug]=!0):o.activeLinks[t.slug]=!1})),Event.listen("showCategoriesDropdownEvent",(function(){o.showCategoriesDropdown()}))}}).mount("#categories-navigation");

View File

@@ -0,0 +1 @@
document.addEventListener("DOMContentLoaded",(function(){var e=document.getElementById("pagination-next"),a=document.querySelector('div[data-widget="carousel-container"]');if(e){var n=!1,t=!1;elementAppeared(e,(function(){if(!n&&!t){n=!0,e.innerText="Ýüklenilýär";var r=new URL(location.href);r.searchParams.set("page",new URL(e.href).searchParams.get("page")),r.searchParams.has("sorting")&&r.searchParams.set("sorting",r.searchParams.get("sorting")),history.pushState({},"",r.href),$.ajax(location.href,{success:function(r){r.pagination.next_page_url||(e.style.display="none",t=!0),e.href=r.pagination.next_page_url,a.insertAdjacentHTML("beforeend",r.products),n=!1,new LazyLoad({elements_selector:".lazyload",threshold:100})}})}}))}}));

View File

@@ -0,0 +1,9 @@
$(document).ready(function () {
$('#PopupCustomerPhone').inputmask("+(\\9\\93)-69-99-99-99");
$('#ContactFormPhone').inputmask("+(\\9\\93)-69-99-99-99");
})
function maskMe(el) {
$(el).inputmask("+(\\9\\93)-69-99-99-99")
}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,50 @@
theme.ButtonsBlocksVisibility = function() {
function ButtonsBlocksVisibility() {
this.selectors = {
buttons: '.js-button-block-visibility'
};
this.load();
};
ButtonsBlocksVisibility.prototype = $.extend({}, ButtonsBlocksVisibility.prototype, {
load: function() {
$('[data-block-visibility]').each(function () {
var $this = $(this),
name = $this.attr('data-block-visibility');
if(window.location.href.indexOf(name) != -1) {
$this.removeClass('d-none-important');
$this.find('[data-block-visibility-focus]').focus();
}
});
$body.on('click', this.selectors.buttons, function (e) {
var $this = $(this),
name = $this.attr('data-block-link'),
$block = $('[data-block-visibility="' + name + '"]');
if($block.length) {
var close_popup = $this.attr('data-action-close-popup');
$block[$this.attr('data-action') === 'close' ? 'addClass' : $this.attr('data-action') === 'open' ? 'removeClass' : 'toggleClass']('d-none-important');
if(close_popup) theme.Popups.closeByName(close_popup);
if(!$block.hasClass('d-none-important')) $block.find('[data-block-visibility-focus]').focus();
e.preventDefault();
return false;
}
});
}
});
theme.ButtonsBlocksVisibility = new ButtonsBlocksVisibility;
};
$(function() {
theme.ButtonsBlocksVisibility();
});

View File

@@ -0,0 +1 @@
theme.ButtonsBlocksVisibility=function(){function t(){this.selectors={buttons:".js-button-block-visibility"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){$("[data-block-visibility]").each(function(){var t=$(this),i=t.attr("data-block-visibility");-1!=window.location.href.indexOf(i)&&(t.removeClass("d-none-important"),t.find("[data-block-visibility-focus]").focus())}),$body.on("click",this.selectors.buttons,function(t){var i=$(this),o=i.attr("data-block-link"),s=$('[data-block-visibility="'+o+'"]');if(s.length){var a=i.attr("data-action-close-popup");return s["close"===i.attr("data-action")?"addClass":"open"===i.attr("data-action")?"removeClass":"toggleClass"]("d-none-important"),a&&theme.Popups.closeByName(a),s.hasClass("d-none-important")||s.find("[data-block-visibility-focus]").focus(),t.preventDefault(),!1}})}}),theme.ButtonsBlocksVisibility=new t},$(function(){theme.ButtonsBlocksVisibility()});

View File

@@ -0,0 +1,24 @@
theme.Collections = function() {
function Collections() {
this.dom = {
$collections: $('.js-collections')
};
if(this.dom.$collections.length) {
this.load();
}
};
Collections.prototype = $.extend({}, Collections.prototype, {
load: function () {
}
});
theme.Collections = new Collections;
};
$(function() {
theme.Collections();
});

View File

@@ -0,0 +1 @@
theme.Collections=function(){function o(){this.dom={$collections:$(".js-collections")},this.dom.$collections.length&&this.load()}o.prototype=$.extend({},o.prototype,{load:function(){}}),theme.Collections=new o},$(function(){theme.Collections()});

View File

@@ -0,0 +1,28 @@
theme.DynamicCheckout = function() {
function DynamicCheckout() {
this.load();
};
DynamicCheckout.prototype = $.extend({}, DynamicCheckout.prototype, {
load: function() {
function update() {
var $this = $(this),
$dynamic_checkout = $this.parents('.js-dynamic-checkout'),
$button_wrapper = $dynamic_checkout.find('[data-js-dynamic-checkout-button-wrapper]');
$button_wrapper[$this.is(':checked') ? 'removeClass' : 'addClass']('disabled');
};
$body.on('change', '.js-dynamic-checkout [data-js-dynamic-checkout-confirmation]', update);
$('.js-dynamic-checkout [data-js-dynamic-checkout-confirmation]').each(update);
}
});
theme.DynamicCheckout = new DynamicCheckout;
};
$(function() {
theme.DynamicCheckout();
});

View File

@@ -0,0 +1 @@
theme.DynamicCheckout=function(){function c(){this.load()}c.prototype=$.extend({},c.prototype,{load:function(){function c(){var c=$(this);c.parents(".js-dynamic-checkout").find("[data-js-dynamic-checkout-button-wrapper]")[c.is(":checked")?"removeClass":"addClass"]("disabled")}$body.on("change",".js-dynamic-checkout [data-js-dynamic-checkout-confirmation]",c),$(".js-dynamic-checkout [data-js-dynamic-checkout-confirmation]").each(c)}}),theme.DynamicCheckout=new c},$(function(){theme.DynamicCheckout()});

View File

@@ -0,0 +1,55 @@
theme.Masonry = function() {
function Masonry() {
jQueryBridget('masonry', window.Masonry, $);
this.load();
};
Masonry.prototype = $.extend({}, Masonry.prototype, {
load: function() {
this.init();
},
init: function (is_first) {
var _ = this,
$masonry = $('.masonry'),
params = {
itemSelector: '[class*="col-"]'
};
this.$masonry = $masonry;
function load() {
$masonry.masonry(params).removeClass('invisible');
setTimeout(function () {
_.update();
}, 100);
};
if(is_first) {
load();
} else {
$(function () {
load();
$(window).on('load', function () {
_.update();
});
});
}
},
update: function () {
this.$masonry.masonry('layout');
},
destroy: function () {
this.$masonry.masonry('destroy');
}
});
theme.Masonry = new Masonry;
};
$(function() {
theme.Masonry();
});

View File

@@ -0,0 +1 @@
theme.Masonry=function(){function n(){jQueryBridget("masonry",window.Masonry,$),this.load()}n.prototype=$.extend({},n.prototype,{load:function(){this.init()},init:function(n){var o=this,t=$(".masonry"),i={itemSelector:'[class*="col-"]'};function e(){t.masonry(i).removeClass("invisible"),setTimeout(function(){o.update()},100)}this.$masonry=t,n?e():$(function(){e(),$(window).on("load",function(){o.update()})})},update:function(){this.$masonry.masonry("layout")},destroy:function(){this.$masonry.masonry("destroy")}}),theme.Masonry=new n},$(function(){theme.Masonry()});

View File

@@ -0,0 +1,301 @@
theme.Notifications = function() {
function Notifications() {
this.selectors = {
elems: '.js-notification'
};
this.settings = {
close_limit: 40,
translate_limit: 50,
opacity_limit: 0.4
};
this.load();
};
Notifications.prototype = $.extend({}, Notifications.prototype, {
load: function() {
var _ = this,
dif;
$body.on('mousedown', this.selectors.elems, function(e) {
if(e.target.tagName === 'A' || $(e.target).parents('[data-js-action]').length) {
return;
}
_.is_holded = true;
var $this = $(this),
start_posX = e.screenX;
dif = 0;
$this.addClass('animate');
setTimeout(function () {
$this.addClass('pressed');
}, 0);
$body.on('mousemove.notification', function(e) {
var posX = e.screenX,
set_posX = Math.min(start_posX + _.settings.translate_limit, Math.max(start_posX - _.settings.translate_limit, posX));
dif = set_posX - start_posX;
$this.removeClass('animate');
setTimeout(function () {
$this.css({
transform: 'translateX(' + dif + 'px) scale(0.95)',
opacity: Math.max((_.settings.translate_limit - Math.abs(dif)) / _.settings.translate_limit, _.settings.opacity_limit)
});
}, 0);
setTimeout(function () {
$this.addClass('animate');
}, 0);
});
$body.one('mouseup.notification', function() {
$this.trigger('mouseup');
});
e.preventDefault();
return false;
});
$body.on('mouseup', this.selectors.elems, function() {
var $this = $(this);
_.is_holded = false;
$body.unbind('mousemove.notification mouseup.notification');
setTimeout(function () {
if(Math.abs(dif) > _.settings.close_limit) {
var $notification = $this.find('[data-js-notification-inner]'),
$btn_close = $notification.find('[data-js-action="close"]').first();
if($notification.hasClass('d-none')) {
return;
}
$this.one('transitionend', function() {
dif = 0;
$this.trigger('mouseup').trigger('transitionend');
$btn_close.trigger('click');
$notification.trigger('transitionend');
$this.trigger('onpressedend');
});
$this.css({
transform: 'translateX(' + (dif + 20) + 'px) scale(0.95)',
opacity: 0
});
} else {
$this.removeClass('pressed');
$this.one('transitionend' ,function () {
$this.removeClass('animate');
$this.trigger('onpressedend');
});
$this.css({
transform: '',
opacity: ''
});
}
if($this.css('transition-duration') === '0s') {
$this.trigger('transitionend');
}
}, 0);
});
$body.on('close', this.selectors.elems, function() {
var $this = $(this);
$body.unbind('mousemove.notification');
$this.trigger('mouseup').trigger('transitionend');
});
},
_cookies: function($container) {
var _ = this,
$notification = $container.find('.js-notification-cookies');
if($notification.length) {
var $btn_close = $notification.find('[data-js-action="close"]'),
cookie = $.cookie('notification-cookies'),
show_once = $notification.attr('data-js-show-once'),
delay = +$notification.attr('data-js-delay'),
cookies_life = +$notification.attr('data-js-cookies-life');
if(cookie !== 'off') {
setTimeout(function () {
_._show($notification, function () {
$btn_close.one('click', function() {
if(show_once === 'true') {
var date = new Date(),
timer = 24 * 60 * 60 * 1000 * cookies_life;
date.setTime(date.getTime() + timer);
$.cookie('notification-cookies', 'off', {
expires: date,
path: '/'
});
}
$(this).off();
_._hide($notification, function () {
$notification.remove();
});
});
});
}, delay * 1000);
}
return $btn_close;
}
},
_products: function($container) {
var _ = this,
$notification = $container.find('.js-notification-products');
if(!$notification.length) {
return;
}
var $btns_close = $notification.find('[data-js-action="close"]'),
$items = $notification.find('[data-js-notification-products-item]'),
delay = +$notification.attr('data-js-delay'),
interval_min = +$notification.attr('data-js-interval-min'),
interval_max = +$notification.attr('data-js-interval-max'),
max_time_life = +$notification.attr('data-js-max-time-life'),
$current_item,
interval_random,
max_time_life_interval;
function randomInteger(min, max) {
return Math.round(min - 0.5 + Math.random() * (max - min + 1));
};
function hide() {
_._hide($notification, function () {
autoplay();
});
};
function autoplay() {
clearInterval(max_time_life_interval);
if(!$notification.hasClass('d-none') || _.is_holded) {
if(_.is_holded) {
$notification.parents('.js-notification').one('onpressedend', function() {
hide();
});
} else if($notification.is(':hover')) {
$notification.one('mouseleave', function() {
hide();
});
} else {
hide();
}
} else {
$current_item = $items.eq(randomInteger(0, $items.length - 1));
interval_random = randomInteger(interval_min, interval_max);
$items.addClass('d-none');
$current_item.removeClass('d-none');
_._show($notification, function () {
setTimeout(function () {
autoplay();
}, interval_random * 1000);
if(max_time_life !== 0) {
max_time_life_interval = setTimeout(function () {
_._hide($notification);
}, max_time_life * 1000);
}
}, function(onVisible) {
onVisible();
});
}
};
setTimeout(function () {
autoplay();
}, delay * 1000);
$btns_close.on('click', function() {
_._hide($notification);
});
return $btns_close;
},
_show: function ($notification, callback, beforeShow) {
$notification.unbind('transitionend');
if(callback) {
$notification.one('transitionend', function () {
callback();
});
}
$notification.removeClass('d-none');
$notification.addClass('animate');
function onVisible() {
setTimeout(function () {
$notification.addClass('visible');
}, 0);
if($notification.css('transition-duration') === '0s') {
$notification.trigger('transitionend');
}
};
if(beforeShow) {
beforeShow(onVisible);
} else {
onVisible();
}
},
_hide: function ($notification, callback) {
$notification.unbind('transitionend');
$notification.one('transitionend', function () {
$notification.addClass('d-none').removeClass('animate').removeAttr('style');
$notification.parents('.js-notification').trigger('close');
if(callback) {
callback();
}
});
$notification.removeClass('visible');
if($notification.css('transition-duration') === '0s') {
$notification.trigger('transitionend');
}
},
init: function ($container) {
this._products($container);
this._cookies($container);
},
destroy: function ($container) {
$container.find('.js-notification-cookies, .js-notification-products').find('[data-js-action="close"]').off();
}
});
theme.Notifications = new Notifications;
};
$(function() {
theme.Notifications();
});

View File

@@ -0,0 +1 @@
theme.Notifications=function(){function t(){this.selectors={elems:".js-notification"},this.settings={close_limit:40,translate_limit:50,opacity_limit:.4},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var s,a=this;$body.on("mousedown",this.selectors.elems,function(t){if("A"!==t.target.tagName&&!$(t.target).parents("[data-js-action]").length){a.is_holded=!0;var e=$(this),o=t.screenX;return s=0,e.addClass("animate"),setTimeout(function(){e.addClass("pressed")},0),$body.on("mousemove.notification",function(t){var i=t.screenX,n=Math.min(o+a.settings.translate_limit,Math.max(o-a.settings.translate_limit,i));s=n-o,e.removeClass("animate"),setTimeout(function(){e.css({transform:"translateX("+s+"px) scale(0.95)",opacity:Math.max((a.settings.translate_limit-Math.abs(s))/a.settings.translate_limit,a.settings.opacity_limit)})},0),setTimeout(function(){e.addClass("animate")},0)}),$body.one("mouseup.notification",function(){e.trigger("mouseup")}),t.preventDefault(),!1}}),$body.on("mouseup",this.selectors.elems,function(){var n=$(this);a.is_holded=!1,$body.unbind("mousemove.notification mouseup.notification"),setTimeout(function(){if(Math.abs(s)>a.settings.close_limit){var t=n.find("[data-js-notification-inner]"),i=t.find('[data-js-action="close"]').first();if(t.hasClass("d-none"))return;n.one("transitionend",function(){s=0,n.trigger("mouseup").trigger("transitionend"),i.trigger("click"),t.trigger("transitionend"),n.trigger("onpressedend")}),n.css({transform:"translateX("+(s+20)+"px) scale(0.95)",opacity:0})}else n.removeClass("pressed"),n.one("transitionend",function(){n.removeClass("animate"),n.trigger("onpressedend")}),n.css({transform:"",opacity:""});"0s"===n.css("transition-duration")&&n.trigger("transitionend")},0)}),$body.on("close",this.selectors.elems,function(){var t=$(this);$body.unbind("mousemove.notification"),t.trigger("mouseup").trigger("transitionend")})},_cookies:function(t){var n=this,e=t.find(".js-notification-cookies");if(e.length){var i=e.find('[data-js-action="close"]'),o=$.cookie("notification-cookies"),s=e.attr("data-js-show-once"),a=+e.attr("data-js-delay"),r=+e.attr("data-js-cookies-life");return"off"!==o&&setTimeout(function(){n._show(e,function(){i.one("click",function(){if("true"===s){var t=new Date,i=864e5*r;t.setTime(t.getTime()+i),$.cookie("notification-cookies","off",{expires:t,path:"/"})}$(this).off(),n._hide(e,function(){e.remove()})})})},1e3*a),i}},_products:function(t){var i=this,n=t.find(".js-notification-products");if(n.length){var e,o,s,a=n.find('[data-js-action="close"]'),r=n.find("[data-js-notification-products-item]"),c=+n.attr("data-js-delay"),d=+n.attr("data-js-interval-min"),f=+n.attr("data-js-interval-max"),u=+n.attr("data-js-max-time-life");return setTimeout(function(){h()},1e3*c),a.on("click",function(){i._hide(n)}),a}function l(t,i){return Math.round(t-.5+Math.random()*(i-t+1))}function m(){i._hide(n,function(){h()})}function h(){clearInterval(s),!n.hasClass("d-none")||i.is_holded?i.is_holded?n.parents(".js-notification").one("onpressedend",function(){m()}):n.is(":hover")?n.one("mouseleave",function(){m()}):m():(e=r.eq(l(0,r.length-1)),o=l(d,f),r.addClass("d-none"),e.removeClass("d-none"),i._show(n,function(){setTimeout(function(){h()},1e3*o),0!==u&&(s=setTimeout(function(){i._hide(n)},1e3*u))},function(t){t()}))}},_show:function(t,i,n){function e(){setTimeout(function(){t.addClass("visible")},0),"0s"===t.css("transition-duration")&&t.trigger("transitionend")}t.unbind("transitionend"),i&&t.one("transitionend",function(){i()}),t.removeClass("d-none"),t.addClass("animate"),n?n(e):e()},_hide:function(t,i){t.unbind("transitionend"),t.one("transitionend",function(){t.addClass("d-none").removeClass("animate").removeAttr("style"),t.parents(".js-notification").trigger("close"),i&&i()}),t.removeClass("visible"),"0s"===t.css("transition-duration")&&t.trigger("transitionend")},init:function(t){this._products(t),this._cookies(t)},destroy:function(t){t.find(".js-notification-cookies, .js-notification-products").find('[data-js-action="close"]').off()}}),theme.Notifications=new t},$(function(){theme.Notifications()});

View File

@@ -0,0 +1,137 @@
theme.Parallax = function() {
function Parallax() {
this.load();
};
Parallax.prototype = $.extend({}, Parallax.prototype, {
load: function () {
$.widget( 'ui.parallax', {
options: {
ratio: 1.2
},
params: {},
_create: function() {
var _ = this;
this.params.start_width = this.element.width();
this.params.start_height = this.element.height();
this.params.start_ratio_height = this.params.start_height / this.params.start_width;
this._setOption('ratio', this.element.data('ratio'), true);
this._setOption('height', this.element.data('height'), true);
this._setOption('minHeight', this.element.data('min-height'), true);
if(this.options.height) {
var height_arr = this.options.height.split(',');
this.options.height = {
xs: height_arr[4],
sm: height_arr[3],
md: height_arr[2],
lg: height_arr[1],
xl: height_arr[0]
};
} else {
this.element.css({
paddingTop: _.params.start_ratio_height * 100 + '%'
});
}
if(this.options.minHeight) {
this.element.css({
minHeight: this.options.minHeight + 'px'
});
}
this.$content = this.element.children().first();
this._calculateSize();
this._calculatePosition();
this.element.css({
overflow: 'hidden',
position: 'relative'
});
this.$content.css({
position: 'absolute',
top: '0',
left: '50%',
transform: 'translateX(-50%)'
});
$window.on('theme.resize.parallax', function () {
_._calculateSize();
_._calculatePosition();
});
$window.on('scroll.parallax', function () {
_._calculatePosition();
});
this.element.addClass('parallax--init');
},
_calculateSize: function() {
this.params.current_width = this.element.width();
if(this.options.height) {
this.element.css({
paddingTop: this.options.height[theme.current.bp]
});
}
this.params.current_height = this.element.height();
this.params.current_scale_width = this.params.current_width * this.options.ratio;
this.params.current_scale_height = this.params.current_height * this.options.ratio;
this.params.stroke_scroll = this.params.current_height + window.innerHeight;
this.params.stroke_content = this.params.current_scale_height - this.params.current_height;
this.params.stroke_ratio = this.params.stroke_scroll / this.params.stroke_content;
this.$content.width(this.params.current_scale_width);
},
_calculatePosition: function() {
this.params.stroke_current = this.params.stroke_scroll - this.element[0].getBoundingClientRect().bottom;
this.params.stroke_current = Math.max(this.params.stroke_current, 0);
this.params.stroke_current = Math.min(this.params.stroke_current, this.params.stroke_scroll);
this.params.current_top = this.params.stroke_content * -1 + (this.params.stroke_current / this.params.stroke_ratio);
this.$content.css({
transform: 'translate(-50%, ' + this.params.current_top + 'px)'
});
},
_init: function () {
},
_setOption: function(key, value) {
$.Widget.prototype._setOption.apply(this, arguments);
},
destroy: function() {
$window.unbind('theme.resize.parallax scroll.parallax');
$.Widget.prototype.destroy.call(this);
}
});
},
init: function($parallax) {
if(!$parallax.hasClass('parallax--init')) {
$parallax.parallax();
}
},
destroy: function ($parallax) {
if($parallax.hasClass('parallax--init')) {
$parallax.parallax('destroy');
}
}
});
theme.Parallax = new Parallax;
};
$(function() {
theme.Parallax();
});

View File

@@ -0,0 +1 @@
theme.Parallax=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){$.widget("ui.parallax",{options:{ratio:1.2},params:{},_create:function(){var t=this;if(this.params.start_width=this.element.width(),this.params.start_height=this.element.height(),this.params.start_ratio_height=this.params.start_height/this.params.start_width,this._setOption("ratio",this.element.data("ratio"),!0),this._setOption("height",this.element.data("height"),!0),this._setOption("minHeight",this.element.data("min-height"),!0),this.options.height){var i=this.options.height.split(",");this.options.height={xs:i[4],sm:i[3],md:i[2],lg:i[1],xl:i[0]}}else this.element.css({paddingTop:100*t.params.start_ratio_height+"%"});this.options.minHeight&&this.element.css({minHeight:this.options.minHeight+"px"}),this.$content=this.element.children().first(),this._calculateSize(),this._calculatePosition(),this.element.css({overflow:"hidden",position:"relative"}),this.$content.css({position:"absolute",top:"0",left:"50%",transform:"translateX(-50%)"}),$window.on("theme.resize.parallax",function(){t._calculateSize(),t._calculatePosition()}),$window.on("scroll.parallax",function(){t._calculatePosition()}),this.element.addClass("parallax--init")},_calculateSize:function(){this.params.current_width=this.element.width(),this.options.height&&this.element.css({paddingTop:this.options.height[theme.current.bp]}),this.params.current_height=this.element.height(),this.params.current_scale_width=this.params.current_width*this.options.ratio,this.params.current_scale_height=this.params.current_height*this.options.ratio,this.params.stroke_scroll=this.params.current_height+window.innerHeight,this.params.stroke_content=this.params.current_scale_height-this.params.current_height,this.params.stroke_ratio=this.params.stroke_scroll/this.params.stroke_content,this.$content.width(this.params.current_scale_width)},_calculatePosition:function(){this.params.stroke_current=this.params.stroke_scroll-this.element[0].getBoundingClientRect().bottom,this.params.stroke_current=Math.max(this.params.stroke_current,0),this.params.stroke_current=Math.min(this.params.stroke_current,this.params.stroke_scroll),this.params.current_top=-1*this.params.stroke_content+this.params.stroke_current/this.params.stroke_ratio,this.$content.css({transform:"translate(-50%, "+this.params.current_top+"px)"})},_init:function(){},_setOption:function(t,i){$.Widget.prototype._setOption.apply(this,arguments)},destroy:function(){$window.unbind("theme.resize.parallax scroll.parallax"),$.Widget.prototype.destroy.call(this)}})},init:function(t){t.hasClass("parallax--init")||t.parallax()},destroy:function(t){t.hasClass("parallax--init")&&t.parallax("destroy")}}),theme.Parallax=new t},$(function(){theme.Parallax()});

View File

@@ -0,0 +1,60 @@
theme.PopupSubscription = function() {
function PopupSubscription() {
this.settings = {
popup_name: 'subscription'
};
this.selectors = {
popup: '.popup-subscription'
};
this.load();
};
PopupSubscription.prototype = $.extend({}, PopupSubscription.prototype, {
load: function() {
var $popup = theme.Popups.getByName(this.settings.popup_name);
if($body.attr('id') !== 'index') {
return;
}
if($popup.length) {
var $subscription = $(this.selectors.popup),
cookie = $.cookie('subscription');
if(cookie !== 'off') {
var $dont_show = $subscription.find('[data-js-popup-subscription-dont-show]'),
show_once = $subscription.attr('data-js-show-once') || false,
delay = +$subscription.attr('data-js-delay') || 3,
cookies_life = +$subscription.attr('data-js-cookies-life') || 1;
theme.Popups.addHandler(this.settings.popup_name, 'close.after', function() {
if(show_once === 'true' || $dont_show.is(':checked')) {
var date = new Date(),
timer = 24 * 60 * 60 * 1000 * cookies_life;
date.setTime(date.getTime() + timer);
$.cookie('subscription', 'off', {
expires: date,
path: '/'
});
}
});
setTimeout(function () {
theme.Popups.callByName('subscription');
}, delay * 1000);
}
}
}
});
theme.PopupSubscription = new PopupSubscription;
};
$(function() {
theme.PopupSubscription();
});

View File

@@ -0,0 +1 @@
theme.PopupSubscription=function(){function t(){this.settings={popup_name:"subscription"},this.selectors={popup:".popup-subscription"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=theme.Popups.getByName(this.settings.popup_name);if("index"===$body.attr("id")&&t.length){var e=$(this.selectors.popup);if("off"!==$.cookie("subscription")){var o=e.find("[data-js-popup-subscription-dont-show]"),i=e.attr("data-js-show-once")||!1,p=+e.attr("data-js-delay")||3,s=+e.attr("data-js-cookies-life")||1;theme.Popups.addHandler(this.settings.popup_name,"close.after",function(){if("true"===i||o.is(":checked")){var t=new Date,e=864e5*s;t.setTime(t.getTime()+e),$.cookie("subscription","off",{expires:t,path:"/"})}}),setTimeout(function(){theme.Popups.callByName("subscription")},1e3*p)}}}}),theme.PopupSubscription=new t},$(function(){theme.PopupSubscription()});

View File

@@ -0,0 +1,169 @@
theme.Presentation = function() {
function Presentation() {
this.settings = {
sections_control_container: [
'header',
'gallery',
'home-builder',
'information-line',
'footer'
],
actions: ['container', 'rtl', 'animation']
};
this.dom = {
$presentation: $('.js-presentation')
};
this.load();
};
Presentation.prototype = $.extend({}, Presentation.prototype, {
load: function() {
var _ = this,
animations = {};
for(var key in theme.animations) {
animations[key] = {};
for(var k in theme.animations[key]) {
animations[key][k] = theme.animations[key][k];
}
}
function toggleState(action, enable) {
if(action === 'container') {
$.each(_.settings.sections_control_container, function() {
$('[data-section-type="' + this + '"]').each(function () {
var $this = $(this);
if(enable) {
if($this.hasClass('container')) {
$this.attr('data-has-container', true);
}
$this.addClass('container presentation-container-enabled');
if($this.attr('data-boxed-without-paddings') === 'true') {
$this.addClass('px-0');
}
} else {
if(!$this[0].hasAttribute('data-has-container')) {
$this.removeClass();
} else {
$this.removeAttr('data-has-container');
}
if($this.attr('data-boxed-without-paddings') === 'true') {
$this.removeClass('px-0');
}
$this.removeClass('presentation-container-enabled');
}
});
});
$window.trigger('resize');
if(theme.Masonry) {
theme.Masonry.update();
}
} else if(action === 'rtl') {
$html.attr('dir', enable ? 'rtl' : 'ltr');
theme.rtl = enable;
$('.slick-slider.slick-initialized').not('.slick-vertical').each(function () {
var $this = $(this),
options = $this.slick('getSlick').originalSettings;
options.rtl = theme.rtl;
$this.slick('unslick');
$this.slick(options);
});
$window.trigger('resize');
} else if(action === 'animation') {
$body[enable ? 'addClass' : 'removeClass']('theme-css-animate');
if(enable) {
for(var key in animations) {
for(var k in animations[key]) {
theme.animations[key][k] = animations[key][k];
}
}
} else {
theme.animations.tooltip.show_duration = 0;
theme.animations.tooltip.hide_duration = 0;
theme.animations.sticky_header.duration = 0;
theme.animations.header_tape.duration = 0;
theme.animations.menu.duration = 0;
theme.animations.dropdown.duration = 0;
theme.animations.accordion.duration = 0;
theme.animations.tabs.duration = 0;
theme.animations.tabs.scroll_duration = 0;
theme.animations.backtotop.scroll_duration = 0;
}
}
};
$.each(this.settings.actions, function(i, v) {
var $button = _.dom.$presentation.find('[data-js-action="' + this + '"]');
if($.cookie('presentation-' + this) === 'enabled' && $button.attr('data-invert') !== 'true' && !$button.is(':checked')) {
toggleState(v, true);
$button.prop('checked', 'checked');
} else if($.cookie('presentation-' + this) === 'enabled' && $button.attr('data-invert') === 'true' && $button.is(':checked')) {
toggleState(v, false);
$button.removeAttr('checked');
}
});
this.dom.$presentation.on('change', '[data-js-action]', function() {
var $this = $(this),
action = $this.attr('data-js-action'),
enable = $this.is(':checked'),
state = enable;
if($this.attr('data-invert') === 'true') {
state = !state;
}
$.cookie('presentation-' + action, state ? 'enabled' : null, {
expires: 60 * 60 * 1000,
path: '/'
});
setTimeout(function() {
toggleState(action, enable);
}, theme.animations.css.duration * 1000);
});
this.dom.$presentation.on('click', '[data-js-presentation-close]', function() {
if(_.dom.$presentation.hasClass('open')) {
_.dom.$presentation.removeClass('open');
} else {
_.dom.$presentation.addClass('open');
}
});
theme.Global.responsiveHandler({
namespace: '.presentation',
element: this.dom.$presentation,
on_desktop: true,
events: {
'mouseenter mouseleave': function(e) {
_.dom.$presentation[e.type === 'mouseenter' ? 'addClass' : 'removeClass']('open');
}
}
});
}
});
theme.Presentation = new Presentation;
};
$(function() {
theme.Presentation();
});

View File

@@ -0,0 +1 @@
theme.Presentation=function(){function t(){this.settings={sections_control_container:["header","gallery","home-builder","information-line","footer"],actions:["container","rtl","animation"]},this.dom={$presentation:$(".js-presentation")},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var i=this,o={};for(var t in theme.animations)for(var e in o[t]={},theme.animations[t])o[t][e]=theme.animations[t][e];function s(t,e){if("container"===t)$.each(i.settings.sections_control_container,function(){$('[data-section-type="'+this+'"]').each(function(){var t=$(this);e?(t.hasClass("container")&&t.attr("data-has-container",!0),t.addClass("container presentation-container-enabled"),"true"===t.attr("data-boxed-without-paddings")&&t.addClass("px-0")):(t[0].hasAttribute("data-has-container")?t.removeAttr("data-has-container"):t.removeClass(),"true"===t.attr("data-boxed-without-paddings")&&t.removeClass("px-0"),t.removeClass("presentation-container-enabled"))})}),$window.trigger("resize"),theme.Masonry&&theme.Masonry.update();else if("rtl"===t)$html.attr("dir",e?"rtl":"ltr"),theme.rtl=e,$(".slick-slider.slick-initialized").not(".slick-vertical").each(function(){var t=$(this),e=t.slick("getSlick").originalSettings;e.rtl=theme.rtl,t.slick("unslick"),t.slick(e)}),$window.trigger("resize");else if("animation"===t)if($body[e?"addClass":"removeClass"]("theme-css-animate"),e)for(var n in o)for(var a in o[n])theme.animations[n][a]=o[n][a];else theme.animations.tooltip.show_duration=0,theme.animations.tooltip.hide_duration=0,theme.animations.sticky_header.duration=0,theme.animations.header_tape.duration=0,theme.animations.menu.duration=0,theme.animations.dropdown.duration=0,theme.animations.accordion.duration=0,theme.animations.tabs.duration=0,theme.animations.tabs.scroll_duration=0,theme.animations.backtotop.scroll_duration=0}$.each(this.settings.actions,function(t,e){var n=i.dom.$presentation.find('[data-js-action="'+this+'"]');"enabled"!==$.cookie("presentation-"+this)||"true"===n.attr("data-invert")||n.is(":checked")?"enabled"===$.cookie("presentation-"+this)&&"true"===n.attr("data-invert")&&n.is(":checked")&&(s(e,!1),n.removeAttr("checked")):(s(e,!0),n.prop("checked","checked"))}),this.dom.$presentation.on("change","[data-js-action]",function(){var t=$(this),e=t.attr("data-js-action"),n=t.is(":checked"),a=n;"true"===t.attr("data-invert")&&(a=!a),$.cookie("presentation-"+e,a?"enabled":null,{expires:36e5,path:"/"}),setTimeout(function(){s(e,n)},1e3*theme.animations.css.duration)}),this.dom.$presentation.on("click","[data-js-presentation-close]",function(){i.dom.$presentation.hasClass("open")?i.dom.$presentation.removeClass("open"):i.dom.$presentation.addClass("open")}),theme.Global.responsiveHandler({namespace:".presentation",element:this.dom.$presentation,on_desktop:!0,events:{"mouseenter mouseleave":function(t){i.dom.$presentation["mouseenter"===t.type?"addClass":"removeClass"]("open")}}})}}),theme.Presentation=new t},$(function(){theme.Presentation()});

View File

@@ -0,0 +1,68 @@
theme.ProductFootbar = function() {
function ProductFootbar() {
};
ProductFootbar.prototype = $.extend({}, ProductFootbar.prototype, {
duration: function () {
return theme.animations.footbar_product.duration * 1000;
},
init: function($container) {
var _ = this,
$footbar = $container.find('.js-footbar-product'),
$limit = $('[data-js-footbar-product-limit]');
if($footbar.length && $limit.length) {
$window.on('theme.resize.productFootbar scroll.productFootbar', function () {
_._update($footbar, $limit);
});
this._update($footbar, $limit);
}
},
_update: function ($footbar, $limit) {
var limit = $limit[0].getBoundingClientRect(),
topSpacing = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0;
if(limit.top < topSpacing && !$footbar.hasClass('show')) {
$footbar.addClass('show animate');
$footbar.velocity('stop', true);
$footbar.velocity('slideDown', {
duration: this.duration(),
begin: function () {
setTimeout(function () {
$footbar.addClass('visible');
}, 0);
},
complete: function () {
$footbar.removeAttr('style');
}
});
} else if(limit.top >= topSpacing && $footbar.hasClass('visible')) {
$footbar.velocity('stop', true);
$footbar.velocity('slideUp', {
duration: this.duration(),
begin: function () {
$footbar.removeClass('visible');
},
complete: function () {
$footbar.removeClass('show animate').removeAttr('style');
}
});
}
},
destroy: function () {
$window.unbind('theme.resize.productFootbar scroll.productFootbar');
}
});
theme.ProductFootbar = new ProductFootbar;
};
$(function() {
theme.ProductFootbar();
});

View File

@@ -0,0 +1 @@
theme.ProductFootbar=function(){function t(){}t.prototype=$.extend({},t.prototype,{duration:function(){return 1e3*theme.animations.footbar_product.duration},init:function(t){var o=this,e=t.find(".js-footbar-product"),i=$("[data-js-footbar-product-limit]");e.length&&i.length&&($window.on("theme.resize.productFootbar scroll.productFootbar",function(){o._update(e,i)}),this._update(e,i))},_update:function(t,o){var e=o[0].getBoundingClientRect(),i=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;e.top<i&&!t.hasClass("show")?(t.addClass("show animate"),t.velocity("stop",!0),t.velocity("slideDown",{duration:this.duration(),begin:function(){setTimeout(function(){t.addClass("visible")},0)},complete:function(){t.removeAttr("style")}})):e.top>=i&&t.hasClass("visible")&&(t.velocity("stop",!0),t.velocity("slideUp",{duration:this.duration(),begin:function(){t.removeClass("visible")},complete:function(){t.removeClass("show animate").removeAttr("style")}}))},destroy:function(){$window.unbind("theme.resize.productFootbar scroll.productFootbar")}}),theme.ProductFootbar=new t},$(function(){theme.ProductFootbar()});

View File

@@ -0,0 +1,108 @@
theme.ProductsView = function() {
function ProductsView() {
this.selectors = {
view: '.js-products-view'
};
this.init();
};
ProductsView.prototype = $.extend({}, ProductsView.prototype, {
init: function() {
var _ = this,
obj_view = localStorage.getItem('products-view');
if(window.location.href.indexOf('products-view=reset') !== -1) {
obj_view = null;
localStorage.setItem('products-view', null);
}
if(obj_view) {
var $wrappers = $(this.selectors.view + ' [data-js-products-grid-buttons]');
obj_view = JSON.parse(obj_view);
$wrappers.each(function () {
var $wrapper = $(this),
is_default = true;
$.each(obj_view, function (k, v) {
if($wrapper.attr('data-value-' + k) !== v) {
var active_attr = 'data-active-' + k;
$wrapper.attr('data-value-' + k, v);
$wrapper.find('[data-value]').removeAttr(active_attr);
$wrapper.find('[data-value="' + v + '"]').attr(active_attr, true);
is_default = false;
}
});
if(!is_default) {
_.update($wrapper);
}
});
}
$body.on('click', this.selectors.view + ' [data-js-products-grid-buttons] [data-value]', function() {
var $this = $(this),
$wrapper = $this.parents('[data-js-products-grid-buttons]'),
value = $this.attr('data-value'),
bp = theme.current.bp,
active_attr = 'data-active-' + bp;
if(!$this[0].hasAttribute(active_attr)) {
var obj_values = {};
$wrapper.find('[data-value]').removeAttr(active_attr);
$this.attr(active_attr, true);
$wrapper.attr('data-value-' + bp, value);
_.update($wrapper);
$.each(theme.breakpoints.values, function (k, v) {
obj_values[k] = $wrapper.attr('data-value-' + k);
});
localStorage.setItem('products-view', JSON.stringify(obj_values));
}
});
},
update: function ($wrapper) {
var $products = $wrapper.parents(this.selectors.view).find('[data-js-products]'),
$buttons = $('[data-js-products-grid-buttons]'),
grid_class = '';
if(!$buttons.length) {
return;
}
$.each(theme.breakpoints.values, function(k) {
var grid_value = $buttons.attr('data-value-' + k),
column_size = (grid_value === 'list' ? 12 : 12 / +grid_value);
$products[+grid_value === 1 ? 'addClass' : 'removeClass']('products-view-centered-' + k);
$products[grid_value === 'list' ? 'addClass' : 'removeClass']('products-view-list-' + k);
grid_class += ' col-';
if(k !== 'xs') {
grid_class += k + '-';
}
grid_class += column_size;
});
$products.find('[data-js-product]').parent().attr('class', grid_class);
$window.trigger('checkImages');
}
});
theme.ProductsView = new ProductsView;
};
$(function() {
theme.ProductsView();
});

View File

@@ -0,0 +1 @@
theme.ProductsView=function(){function t(){this.selectors={view:".js-products-view"},this.init()}t.prototype=$.extend({},t.prototype,{init:function(){var o=this,t=localStorage.getItem("products-view");if(-1!==window.location.href.indexOf("products-view=reset")&&(t=null,localStorage.setItem("products-view",null)),t){var a=$(this.selectors.view+" [data-js-products-grid-buttons]");t=JSON.parse(t),a.each(function(){var s=$(this),r=!0;$.each(t,function(t,a){if(s.attr("data-value-"+t)!==a){var e="data-active-"+t;s.attr("data-value-"+t,a),s.find("[data-value]").removeAttr(e),s.find('[data-value="'+a+'"]').attr(e,!0),r=!1}}),r||o.update(s)})}$body.on("click",this.selectors.view+" [data-js-products-grid-buttons] [data-value]",function(){var t=$(this),e=t.parents("[data-js-products-grid-buttons]"),a=t.attr("data-value"),s=theme.current.bp,r="data-active-"+s;if(!t[0].hasAttribute(r)){var i={};e.find("[data-value]").removeAttr(r),t.attr(r,!0),e.attr("data-value-"+s,a),o.update(e),$.each(theme.breakpoints.values,function(t,a){i[t]=e.attr("data-value-"+t)}),localStorage.setItem("products-view",JSON.stringify(i))}})},update:function(t){var s=t.parents(this.selectors.view).find("[data-js-products]"),r=$("[data-js-products-grid-buttons]"),i="";r.length&&($.each(theme.breakpoints.values,function(t){var a=r.attr("data-value-"+t),e="list"===a?12:12/+a;s[1==+a?"addClass":"removeClass"]("products-view-centered-"+t),s["list"===a?"addClass":"removeClass"]("products-view-list-"+t),i+=" col-","xs"!==t&&(i+=t+"-"),i+=e}),s.find("[data-js-product]").parent().attr("class",i),$window.trigger("checkImages"))}}),theme.ProductsView=new t},$(function(){theme.ProductsView()});

View File

@@ -0,0 +1,73 @@
theme.RangeOfPrice = function() {
function RangeOfPrice() {
this.dom = {};
};
RangeOfPrice.prototype = $.extend({}, RangeOfPrice.prototype, {
init: function() {
this.dom.$range = $('.js-range-of-price');
if(this.dom.$range.length) {
var params = {
type: "double",
force_edges: true,
prettify: function (data) {
return data;
}
};
if (Currency) {
this.dom.$range.on('change', function () {
theme.ProductCurrency.update();
});
$.extend(params, {
onStart: function () {
setTimeout(function () {
theme.ProductCurrency.update();
}, 0);
},
onFinish: function () {
theme.ProductCurrency.update();
}
});
}
this.dom.$range.ionRangeSlider(params);
}
},
destroy: function () {
if(this.dom.$range && this.dom.$range.data('ionRangeSlider')) {
this.dom.$range.ionRangeSlider('destroy');
delete this.dom;
}
},
update: function(from, to) {
if(this.dom.$range) {
var api = this.dom.$range.data('ionRangeSlider');
api.update({
from: from,
to: to
});
}
},
reset: function() {
if(this.dom.$range.length) {
var api = this.dom.$range.data('ionRangeSlider');
api.update({
from: api.result.min,
to: api.result.max
});
}
}
});
theme.RangeOfPrice = new RangeOfPrice;
};
$(function() {
theme.RangeOfPrice();
});

View File

@@ -0,0 +1 @@
theme.RangeOfPrice=function(){function e(){this.dom={}}e.prototype=$.extend({},e.prototype,{init:function(){if(this.dom.$range=$(".js-range-of-price"),this.dom.$range.length){var e={type:"double",force_edges:!0,prettify:function(e){return e}};Currency&&(this.dom.$range.on("change",function(){theme.ProductCurrency.update()}),$.extend(e,{onStart:function(){setTimeout(function(){theme.ProductCurrency.update()},0)},onFinish:function(){theme.ProductCurrency.update()}})),this.dom.$range.ionRangeSlider(e)}},destroy:function(){this.dom.$range&&this.dom.$range.data("ionRangeSlider")&&(this.dom.$range.ionRangeSlider("destroy"),delete this.dom)},update:function(e,t){this.dom.$range&&this.dom.$range.data("ionRangeSlider").update({from:e,to:t})},reset:function(){if(this.dom.$range.length){var e=this.dom.$range.data("ionRangeSlider");e.update({from:e.result.min,to:e.result.max})}}}),theme.RangeOfPrice=new e},$(function(){theme.RangeOfPrice()});

View File

@@ -0,0 +1,69 @@
theme.ShippingRatesCalculation = function() {
function ShippingRatesCalculation() {
this.load();
};
ShippingRatesCalculation.prototype = $.extend({}, ShippingRatesCalculation.prototype, {
load: function() {
var $calculator = $('#shipping-calculator');
if($calculator.length) {
var $info = $('.shipping-calculator-info');
Shopify.Cart.ShippingCalculator.show({
submitButton: theme.strings.shippingCalcSubmitButton,
submitButtonDisabled: theme.strings.shippingCalcSubmitButtonDisabled,
customerIsLoggedIn: theme.strings.shippingCalcCustomerIsLoggedIn,
moneyFormat: theme.strings.shippingCalcMoneyFormat
});
$calculator.on('updated', function () {
setTimeout(function () {
var $result = $('#shipping-rates-feedback.success'),
html = $result.text(),
data = {
zip: $('#address_zip').val(),
province: $('#address_province').val(),
country: $('#address_country').val()
},
info = '';
$result.html(html);
var $price = $('<span>').addClass('price'),
$money = $result.find('span');
$money.replaceWith($price);
$price.append($money);
theme.ProductCurrency.update();
if($('#shipping-rates-feedback.success').length) {
$.each(data, function () {
if(this) {
if(info) info += ', ';
info += this;
}
});
$info.text(theme.strings.cart.general.shipping_calculator_data_info.replace('{{ data }}', info)).fadeIn({
complete: function () {
$info.removeAttr('style');
}
}).removeClass('d-none');
} else {
$info.text('').addClass('d-none');
}
}, 100);
});
}
}
});
theme.ShippingRatesCalculation = new ShippingRatesCalculation;
};
$(function() {
theme.ShippingRatesCalculation();
});

View File

@@ -0,0 +1 @@
theme.ShippingRatesCalculation=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=$("#shipping-calculator");if(t.length){var o=$(".shipping-calculator-info");Shopify.Cart.ShippingCalculator.show({submitButton:theme.strings.shippingCalcSubmitButton,submitButtonDisabled:theme.strings.shippingCalcSubmitButtonDisabled,customerIsLoggedIn:theme.strings.shippingCalcCustomerIsLoggedIn,moneyFormat:theme.strings.shippingCalcMoneyFormat}),t.on("updated",function(){setTimeout(function(){var t=$("#shipping-rates-feedback.success"),e=t.text(),n={zip:$("#address_zip").val(),province:$("#address_province").val(),country:$("#address_country").val()},i="";t.html(e);var a=$("<span>").addClass("price"),s=t.find("span");s.replaceWith(a),a.append(s),theme.ProductCurrency.update(),$("#shipping-rates-feedback.success").length?($.each(n,function(){this&&(i&&(i+=", "),i+=this)}),o.text(theme.strings.cart.general.shipping_calculator_data_info.replace("{{ data }}",i)).fadeIn({complete:function(){o.removeAttr("style")}}).removeClass("d-none")):o.text("").addClass("d-none")},100)})}}}),theme.ShippingRatesCalculation=new t},$(function(){theme.ShippingRatesCalculation()});

View File

@@ -0,0 +1,221 @@
theme.StickyHeader = function() {
function StickyHeader() {
};
StickyHeader.prototype = $.extend({}, StickyHeader.prototype, {
init: function($sticky, params) {
var effect = $sticky.attr('data-sticky-effect') || 1;
if ($sticky.length) {
var stickyHeader = {
_create: function() {
var _ = this,
$elem = this.bindings,
$sticky_m = $elem.find(this.options.mobile && this.options.mobile.sticky ? this.options.mobile.sticky : ''),
$sticky_d = $elem.find(this.options.desktop && this.options.desktop.sticky ? this.options.desktop.sticky : ''),
$spacer_m = $('<div>').addClass('header__spacer header__spacer--m').insertBefore($sticky_m),
$spacer_d = $('<div>').addClass('header__spacer header__spacer--d').insertBefore($sticky_d);
this.sticky_class = 'header__content--sticky';
function fix() {
_._fix(_.$sticky, _.$spacer);
_._move(_.options[_.bp]);
};
function unfix() {
_._unfix(_.$sticky, _.$spacer);
_._return(_.options[_.bp]);
};
function on_resize() {
var is_desktop = theme.current.is_desktop;
_.bp = is_desktop ? 'desktop' : 'mobile';
_.$sticky = is_desktop ? $sticky_d : $sticky_m;
_.$spacer = is_desktop ? $spacer_d : $spacer_m;
if(!_.$sticky.length) return;
if (is_desktop) {
$spacer_m.removeClass('header__spacer--visible');
$spacer_d.addClass('header__spacer--visible');
if ($sticky_m.hasClass(_.sticky_class)) {
_._unfix($sticky_m, $spacer_m);
_._return(_.options.mobile);
}
} else {
$spacer_d.removeClass('header__spacer--visible');
$spacer_m.addClass('header__spacer--visible');
if ($sticky_d.hasClass(_.sticky_class)) {
_._unfix($sticky_d, $spacer_d);
_._return(_.options.desktop);
}
}
};
function on_scroll() {
if(!_.$sticky.length) return;
var limit = _.options[_.bp].limit ? _.options[_.bp].limit : 0,
spacer_pos = _.$spacer[0].getBoundingClientRect();
if (limit === 'bottom') {
limit = _.$sticky.hasClass(_.sticky_class) ? _.$spacer.innerHeight() : _.$sticky.innerHeight();
}
limit *= -1;
if (spacer_pos.top < limit) {
if (!_.$sticky.hasClass(_.sticky_class)) {
fix();
}
if(!ie) {
_._check_height(_.$sticky, _.options[_.bp]);
}
} else {
if (_.$sticky.hasClass(_.sticky_class)) {
unfix();
}
}
};
on_resize();
on_scroll();
$window.on({
'theme.resize.stickyHeader': function() {
on_resize();
on_scroll();
},
'scroll.stickyHeader': on_scroll
});
},
_fix: function($sticky, $spacer) {
var height = $sticky.innerHeight();
$spacer.height(height);
if(this.options[this.bp].fade) {
$sticky.css({ 'opacity': 0 }).velocity({ 'opacity': theme.animations.sticky_header.opacity }, this.options[this.bp].duration());
}
$sticky.addClass(this.sticky_class);
},
_unfix: function($sticky, $spacer) {
$spacer.removeAttr('style');
if(this.options[this.bp].fade) {
$sticky.velocity('stop', true);
}
$sticky.removeAttr('style').removeClass(this.sticky_class);
},
_move: function(obj) {
if (!obj.move) return;
$.each(obj.move, function() {
var $elem = $(this.elem),
$to = $(this.to),
method = this.method || 'append';
this.$elem = $elem;
this.$parent = $elem.parent();
$to[method]($elem);
});
},
_return: function(obj) {
if (!obj.move) return;
$.each(obj.move, function() {
var method = this.method || 'append';
this.$parent[method](this.$elem);
this.$elem = null;
this.$parent = null;
});
},
_check_height: function($sticky, obj) {
if(!obj.height) return;
var spacer_pos = this.$spacer[0].getBoundingClientRect(),
height = spacer_pos.bottom <= obj.height ? obj.height : spacer_pos.bottom;
$sticky.css({ 'min-height': height });
},
getStickyHeight: function() {
return this.options[this.bp] ? (this.options[this.bp].height || $(this.options[this.bp].sticky).innerHeight()) : 0;
},
destroy: function() {
$(window).unbind('resize.stickyHeader scroll.stickyHeader');
$.Widget.prototype.destroy.call(this);
}
};
$.widget('ui.stickyHeader', stickyHeader);
$sticky.stickyHeader(params);
this.$sticky = $sticky;
return {
destroy: function() {
$sticky.stickyHeader('destroy');
}
};
}
}
});
theme.StickyHeader = new StickyHeader;
};
$(function() {
theme.StickyHeader();
});
/*DOCUMENTATION*/
//params example
/*
{
bp: 1024,
mobile: {
sticky: '.tt-header__nav',
limit: 400,
fade: true,
duration: 400
},
desktop: {
sticky: '.tt-header__menu',
height: 60,
move: [
{
elem: '.tt-header__sidebar',
to: '.tt-header__menu',
method: 'append'
}
]
}
}
//params info
bp - responsive breakpoint (number)
mobile, desktop - breakpoint params (object)
bp.sticky - sticky element (selector)
bp.limit - breakpoint to start sticky (number, 'bottom')
bp.height - change sticky element height (number)
bp.fade - fade effect (bool)
bp.duration - effects duration (number)
bp.move - move elements inside sticky (array of objects)
bp.move.elem - items that are moved (selector)
bp.move.to - element to which to move (selector)
bp.move.method - jquery method move (string)
*/

View File

@@ -0,0 +1 @@
theme.StickyHeader=function(){function t(){}t.prototype=$.extend({},t.prototype,{init:function(t,i){t.attr("data-sticky-effect");if(t.length){var e={_create:function(){var e=this,t=this.bindings,i=t.find(this.options.mobile&&this.options.mobile.sticky?this.options.mobile.sticky:""),s=t.find(this.options.desktop&&this.options.desktop.sticky?this.options.desktop.sticky:""),o=$("<div>").addClass("header__spacer header__spacer--m").insertBefore(i),n=$("<div>").addClass("header__spacer header__spacer--d").insertBefore(s);function c(){var t=theme.current.is_desktop;e.bp=t?"desktop":"mobile",e.$sticky=t?s:i,e.$spacer=t?n:o,e.$sticky.length&&(t?(o.removeClass("header__spacer--visible"),n.addClass("header__spacer--visible"),i.hasClass(e.sticky_class)&&(e._unfix(i,o),e._return(e.options.mobile))):(n.removeClass("header__spacer--visible"),o.addClass("header__spacer--visible"),s.hasClass(e.sticky_class)&&(e._unfix(s,n),e._return(e.options.desktop))))}function a(){if(e.$sticky.length){var t=e.options[e.bp].limit?e.options[e.bp].limit:0,i=e.$spacer[0].getBoundingClientRect();"bottom"===t&&(t=e.$sticky.hasClass(e.sticky_class)?e.$spacer.innerHeight():e.$sticky.innerHeight()),t*=-1,i.top<t?(e.$sticky.hasClass(e.sticky_class)||(e._fix(e.$sticky,e.$spacer),e._move(e.options[e.bp])),ie||e._check_height(e.$sticky,e.options[e.bp])):e.$sticky.hasClass(e.sticky_class)&&(e._unfix(e.$sticky,e.$spacer),e._return(e.options[e.bp]))}}this.sticky_class="header__content--sticky",c(),a(),$window.on({"theme.resize.stickyHeader":function(){c(),a()},"scroll.stickyHeader":a})},_fix:function(t,i){var e=t.innerHeight();i.height(e),this.options[this.bp].fade&&t.css({opacity:0}).velocity({opacity:theme.animations.sticky_header.opacity},this.options[this.bp].duration()),t.addClass(this.sticky_class)},_unfix:function(t,i){i.removeAttr("style"),this.options[this.bp].fade&&t.velocity("stop",!0),t.removeAttr("style").removeClass(this.sticky_class)},_move:function(t){t.move&&$.each(t.move,function(){var t=$(this.elem),i=$(this.to),e=this.method||"append";this.$elem=t,this.$parent=t.parent(),i[e](t)})},_return:function(t){t.move&&$.each(t.move,function(){var t=this.method||"append";this.$parent[t](this.$elem),this.$elem=null,this.$parent=null})},_check_height:function(t,i){if(i.height){var e=this.$spacer[0].getBoundingClientRect(),s=e.bottom<=i.height?i.height:e.bottom;t.css({"min-height":s})}},getStickyHeight:function(){return this.options[this.bp]?this.options[this.bp].height||$(this.options[this.bp].sticky).innerHeight():0},destroy:function(){$(window).unbind("resize.stickyHeader scroll.stickyHeader"),$.Widget.prototype.destroy.call(this)}};return $.widget("ui.stickyHeader",e),t.stickyHeader(i),this.$sticky=t,{destroy:function(){t.stickyHeader("destroy")}}}}}),theme.StickyHeader=new t},$(function(){theme.StickyHeader()});

View File

@@ -0,0 +1,112 @@
theme.StickySidebar = function() {
function StickySidebar() {
this.selectors = {
elements: '.js-sticky-sidebar'
};
};
StickySidebar.prototype = $.extend({}, StickySidebar.prototype, {
init: function ($container, is_parent) {
if(edge || ie) {
return;
}
var $sticky = $container[is_parent ? 'parents' : 'find'](this.selectors.elements);
if($sticky.length) {
if(moz && $sticky[0].hasAttribute('data-disable-moz')) {
return;
}
function calculate($sticky) {
$sticky.each(function () {
var $this = $(this),
$inner = $this.find('[data-sticky-sidebar-inner]');
if(theme.current.is_desktop) {
if(!$this.hasClass('initialize')) {
var $parent = $this.parents('[data-sticky-sidebar-parent]'),
topSpacing = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0,
bottomSpacing = 0,
own_topSpacing = $this.attr('data-top-spacing'),
own_bottomSpacing = $this.attr('data-bottom-spacing');
if(own_topSpacing !== undefined) {
topSpacing += +own_topSpacing;
}
if(own_bottomSpacing !== undefined) {
bottomSpacing += +own_bottomSpacing;
}
$this.stickySidebar({
containerSelector: $parent,
innerWrapperSelector: $inner,
topSpacing: topSpacing,
bottomSpacing: bottomSpacing
}).addClass('initialize active');
} else if(!$this.hasClass('active')) {
$this.stickySidebar('updateSticky');
$this.addClass('active');
}
} else {
if($this.hasClass('initialize active')) {
$this.stickySidebar('destroy');
$this.removeClass('initialize active');
$this.removeAttr('style');
$inner.removeAttr('style');
}
}
});
};
$window.on('theme.changed.breakpoint.sticky-sidebar', function () {
calculate($sticky);
});
calculate($sticky);
}
},
update: function ($sticky) {
if(edge || ie) {
return;
}
if($sticky.length && theme.current.is_desktop) {
if(moz && $sticky[0].hasAttribute('data-disable-moz')) {
return;
}
$sticky.each(function() {
var $this = $(this);
if($this.hasClass('initialize active')) {
$this.stickySidebar('updateSticky');
}
});
}
},
destroy: function ($container, is_parent) {
if(edge || ie) {
return;
}
var $sticky = $container[is_parent ? 'parents' : 'find'](this.selectors.elements);
if($sticky.length && $sticky.hasClass('initialize')) {
if(moz && $sticky[0].hasAttribute('data-disable-moz')) {
return;
}
$window.unbind('theme.changed.breakpoint.sticky-sidebar');
$sticky.stickySidebar('destroy');
}
}
});
theme.StickySidebar = new StickySidebar;
};
$(function() {
theme.StickySidebar();
});

View File

@@ -0,0 +1 @@
theme.StickySidebar=function(){function e(){this.selectors={elements:".js-sticky-sidebar"}}e.prototype=$.extend({},e.prototype,{init:function(e,t){if(!edge&&!ie){var i=e[t?"parents":"find"](this.selectors.elements);if(i.length){if(moz&&i[0].hasAttribute("data-disable-moz"))return;function a(e){e.each(function(){var e=$(this),t=e.find("[data-sticky-sidebar-inner]");if(theme.current.is_desktop)if(e.hasClass("initialize"))e.hasClass("active")||(e.stickySidebar("updateSticky"),e.addClass("active"));else{var i=e.parents("[data-sticky-sidebar-parent]"),a=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0,s=0,n=e.attr("data-top-spacing"),r=e.attr("data-bottom-spacing");void 0!==n&&(a+=+n),void 0!==r&&(s+=+r),e.stickySidebar({containerSelector:i,innerWrapperSelector:t,topSpacing:a,bottomSpacing:s}).addClass("initialize active")}else e.hasClass("initialize active")&&(e.stickySidebar("destroy"),e.removeClass("initialize active"),e.removeAttr("style"),t.removeAttr("style"))})}$window.on("theme.changed.breakpoint.sticky-sidebar",function(){a(i)}),a(i)}}},update:function(e){if(!edge&&!ie&&e.length&&theme.current.is_desktop){if(moz&&e[0].hasAttribute("data-disable-moz"))return;e.each(function(){var e=$(this);e.hasClass("initialize active")&&e.stickySidebar("updateSticky")})}},destroy:function(e,t){if(!edge&&!ie){var i=e[t?"parents":"find"](this.selectors.elements);if(i.length&&i.hasClass("initialize")){if(moz&&i[0].hasAttribute("data-disable-moz"))return;$window.unbind("theme.changed.breakpoint.sticky-sidebar"),i.stickySidebar("destroy")}}}}),theme.StickySidebar=new e},$(function(){theme.StickySidebar()});

View File

@@ -0,0 +1,361 @@
theme.Tabs = function() {
function Tabs() {
this.selectors = {
elements: '[data-js-tabs]'
};
this.load();
};
Tabs.prototype = $.extend({}, Tabs.prototype, {
init: function ($tabs) {
var $tabs = $tabs || $('.js-tabs').not('.tabs--init');
var tabsObj = {
singleOpen: true,
anim_tab_duration: function () {
return theme.animations.tabs.duration * 1000;
},
anim_scroll_duration: function () {
return theme.animations.tabs.scroll_duration * 1000;
},
toggleOnDesktop: true,
scrollToOpenMobile: true,
effect: 'slide',
offsetTop: '.header__content.header__content--sticky'
};
if($tabs.hasClass('product-tabs')) {
tabsObj = $.extend(tabsObj, {
goToTab: [
{
elem: '.spr-badge-caption',
tab: 'reviews'
}
]
});
}
$tabs.ttTabs(tabsObj);
},
load: function() {
$.fn.ttTabs = function (options) {
function ttTabs(tabs) {
var $tabs = $(tabs),
$head = $tabs.find('[data-js-tabs-head]'),
$slider = $tabs.find('[data-js-tabs-slider]'),
$head_btns = $tabs.find('[data-js-tabs-btn]'),
$body_btns = $tabs.find('[data-js-tabs-btn-mobile]'),
$body_tabs = $tabs.find('[data-js-tabs-tab]'),
$btn_prev = $tabs.find('[data-js-tabs-nav-prev]'),
$btn_next = $tabs.find('[data-js-tabs-nav-next]'),
breakpoint = 1024,
type = $tabs.attr('data-type'),
scrollToOpenMobile = (options.scrollToOpenMobile !== undefined) ? options.scrollToOpenMobile : true,
singleOpen = (options.singleOpen !== undefined) ? options.singleOpen : true,
toggleOnDesktop = (options.toggleOnDesktop !== undefined) ? options.toggleOnDesktop : true,
effect = (options.effect !== undefined) ? options.effect : 'slide',
goToTab = options.goToTab;
function _closeTab($btn, data) {
var $animElem,
this_effect = data.effect || effect,
anim_obj = {
duration: options.anim_tab_duration(),
complete: function () {
$(this).removeAttr('style');
}
};
function _anim_func($animElem) {
switch(this_effect) {
case 'toggle':
$animElem.hide().removeAttr('style');
break;
case 'slide':
$animElem.velocity('slideUp', anim_obj);
break;
default:
$animElem.velocity('slideUp', anim_obj);
}
};
if(data.desktop || singleOpen) {
$head_btns.removeClass('active');
$animElem = $body_tabs.filter('.active').removeClass('active').find('[data-js-tabs-content]').stop();
_anim_func($animElem);
} else {
var index = $head_btns.index($btn);
$btn.removeClass('active');
$animElem = $body_tabs.eq(index).removeClass('active').find('[data-js-tabs-content]').stop();
_anim_func($animElem);
}
};
function _openTab($btn, data) {
var index = $head_btns.index($btn),
$body_tab_act = $body_tabs.eq(index),
$animElem,
$sticky = $('.js-sticky-sidebar'),
this_effect = data.effect || effect,
anim_obj = {
duration: options.anim_tab_duration(),
progress: function () {
if(theme.StickySidebar) {
theme.StickySidebar.update($sticky);
}
},
complete: function () {
if(data.after) {
data.after($body_tab_act);
}
if(theme.StickySidebar) {
theme.StickySidebar.update($sticky);
}
}
};
function _anim_func($animElem) {
if($slider.hasClass('slick-initialized')) {
var btn_l = $btn.last().get(0).getBoundingClientRect().left,
btn_r = $btn.last().get(0).getBoundingClientRect().right,
slider_l = $slider.get(0).getBoundingClientRect().left,
slider_r = $slider.get(0).getBoundingClientRect().right;
if(btn_r > slider_r) $slider.slick('slickNext');
else if(btn_l < slider_l) $slider.slick('slickPrev');
}
switch(this_effect) {
case 'toggle':
$animElem.show();
if(data.after) {
data.after($body_tab_act);
}
break;
case 'slide':
$animElem.velocity('slideDown', anim_obj);
break;
default:
$animElem.velocity('slideDown', anim_obj);
}
};
$btn.addClass('active');
$animElem = $body_tab_act.addClass('active').find('> div').stop();
_anim_func($animElem);
};
function _toTab(tab) {
var wind_w = window.innerWidth,
desktop = wind_w > breakpoint,
$btn = $head_btns.filter('[data-tab="' + tab + '"]');
function afterOpen() {
var tob_t = type === 'horizontal' && desktop ? $tabs.offset().top : $body_btns.eq($head_btns.index($btn)).offset().top,
header_h = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0;
$('html, body').velocity( 'scroll' , {
offset: tob_t - header_h,
duration: options.anim_scroll_duration()
});
};
if(!$btn.hasClass('active')) {
_closeTab($btn, {
desktop: desktop,
effect: 'toggle'
});
_openTab($btn, {
desktop: desktop,
effect: 'toggle',
after: function () {
afterOpen();
}
});
} else {
afterOpen();
}
};
function _btn_disabled(currentSlide) {
var btn_last_r = $head_btns.last().get(0).getBoundingClientRect().right,
slider_r = $slider.get(0).getBoundingClientRect().right;
if(currentSlide === 0) $btn_prev.addClass('disabled');
else $btn_prev.removeClass('disabled');
if(btn_last_r <= slider_r) $btn_next.addClass('disabled');
else $btn_next.removeClass('disabled');
};
function _slider_init() {
if($slider.hasClass('slick-initialized')) return;
$head.addClass('tabs__head--slider');
$slider.slick({
infinite: false,
slidesToShow: 1,
variableWidth: true,
draggable: false,
dots: false,
arrows: false
});
$btn_prev.addClass('disabled');
$slider.on('afterChange', function(e, slick, currentSlide) {
_btn_disabled(currentSlide);
});
$btn_prev.on('click', function() {
if($(this).hasClass('disabled')) return;
$slider.slick('slickPrev');
});
$btn_next.on('click', function() {
if($(this).hasClass('disabled')) return;
$slider.slick('slickNext');
});
};
function _slider_destroy() {
if(!$slider.hasClass('slick-initialized')) return;
$($slider, $btn_prev, $btn_next).off();
$slider.slick('unslick');
$head.removeClass('tabs__head--slider');
};
$head_btns.on('click', function (e, trigger) {
var $this = $(this),
wind_w = window.innerWidth,
desktop = wind_w > breakpoint,
trigger = (trigger === 'trigger') ? true : false;
if($this.hasClass('active')) {
if(desktop && !toggleOnDesktop) return;
_closeTab($this, {
desktop: desktop
});
} else {
_closeTab($this, {
desktop: desktop
});
_openTab($this, {
desktop: desktop,
after: function ($body_tab_act) {
if (!desktop && !trigger && scrollToOpenMobile) {
var tob_t = $body_tab_act.find('[data-js-tabs-btn-mobile]').offset().top,
header_h = theme.StickyHeader && theme.StickyHeader.$sticky ? theme.StickyHeader.$sticky.stickyHeader('getStickyHeight') : 0;
$('html, body').velocity('stop').velocity('scroll', {
offset: tob_t - header_h,
duration: options.anim_scroll_duration()
});
}
}
});
}
});
$body_btns.on('click', function () {
var $this = $(this),
$parent = $this.parent(),
index = $body_tabs.index($parent);
$head_btns.eq(index).trigger('click');
});
if($.isArray(goToTab) && goToTab.length) {
$(goToTab).each(function () {
var _ = this;
$body.on('click', this.elem, function (e) {
_toTab(_.tab, _.scrollTo, _.focus);
e.preventDefault();
return false;
});
});
}
if(type === 'horizontal') {
$(window).on('theme.resize updateTabs', function () {
var wind_w = window.innerWidth,
desktop = wind_w > breakpoint,
head_w = $slider.innerWidth(),
btns_w = 0;
$head_btns.each(function () {
btns_w += $(this).innerWidth();
});
if(desktop) {
var $btn_act = $head_btns.filter('.active');
if(!singleOpen && $btn_act.length > 1) {
var $save_active = $btn_act.first();
_closeTab('', {
desktop: desktop
});
_openTab($save_active, {
desktop: desktop
});
}
if(btns_w > head_w) {
_slider_init();
if($slider.hasClass('slick-initialized')) {
setTimeout(function() {
_btn_disabled($head_btns.index($('[data-js-tabs-btn].slick-current')));
}, 0);
}
} else {
_slider_destroy();
}
} else {
_slider_destroy();
}
});
}
$head_btns.filter('[data-active="true"]').trigger('click', ['trigger']);
$(window).trigger('updateTabs');
$tabs.addClass('tabs--init');
return $tabs;
};
$(this).each(function() {
new ttTabs(this);
});
};
this.init();
}
});
theme.Tabs = new Tabs;
};
$(function() {
theme.Tabs();
});

View File

@@ -0,0 +1 @@
theme.Tabs=function(){function t(){this.selectors={elements:"[data-js-tabs]"},this.load()}t.prototype=$.extend({},t.prototype,{init:function(t){var e={singleOpen:!0,anim_tab_duration:function(){return 1e3*theme.animations.tabs.duration},anim_scroll_duration:function(){return 1e3*theme.animations.tabs.scroll_duration},toggleOnDesktop:!0,scrollToOpenMobile:!0,effect:"slide",offsetTop:".header__content.header__content--sticky"};(t=t||$(".js-tabs").not(".tabs--init")).hasClass("product-tabs")&&(e=$.extend(e,{goToTab:[{elem:".spr-badge-caption",tab:"reviews"}]})),t.ttTabs(e)},load:function(){$.fn.ttTabs=function(w){function t(t){var n=$(t),o=n.find("[data-js-tabs-head]"),c=n.find("[data-js-tabs-slider]"),r=n.find("[data-js-tabs-btn]"),d=n.find("[data-js-tabs-btn-mobile]"),f=n.find("[data-js-tabs-tab]"),l=n.find("[data-js-tabs-nav-prev]"),h=n.find("[data-js-tabs-nav-next]"),u=1024,b=n.attr("data-type"),g=void 0===w.scrollToOpenMobile||w.scrollToOpenMobile,k=void 0===w.singleOpen||w.singleOpen,v=void 0===w.toggleOnDesktop||w.toggleOnDesktop,p=void 0!==w.effect?w.effect:"slide",e=w.goToTab;function m(t,e){var i=e.effect||p,a={duration:w.anim_tab_duration(),complete:function(){$(this).removeAttr("style")}};function s(t){switch(i){case"toggle":t.hide().removeAttr("style");break;case"slide":t.velocity("slideUp",a);break;default:t.velocity("slideUp",a)}}if(e.desktop||k)r.removeClass("active"),s(f.filter(".active").removeClass("active").find("[data-js-tabs-content]").stop());else{var n=r.index(t);t.removeClass("active"),s(f.eq(n).removeClass("active").find("[data-js-tabs-content]").stop())}}function y(s,n){var t=r.index(s),o=f.eq(t),e=$(".js-sticky-sidebar"),d=n.effect||p,l={duration:w.anim_tab_duration(),progress:function(){theme.StickySidebar&&theme.StickySidebar.update(e)},complete:function(){n.after&&n.after(o),theme.StickySidebar&&theme.StickySidebar.update(e)}};s.addClass("active"),function(t){if(c.hasClass("slick-initialized")){var e=s.last().get(0).getBoundingClientRect().left,i=s.last().get(0).getBoundingClientRect().right,a=c.get(0).getBoundingClientRect().left;c.get(0).getBoundingClientRect().right<i?c.slick("slickNext"):e<a&&c.slick("slickPrev")}switch(d){case"toggle":t.show(),n.after&&n.after(o);break;case"slide":t.velocity("slideDown",l);break;default:t.velocity("slideDown",l)}}(o.addClass("active").find("> div").stop())}function C(t){var e=r.last().get(0).getBoundingClientRect().right,i=c.get(0).getBoundingClientRect().right;0===t?l.addClass("disabled"):l.removeClass("disabled"),e<=i?h.addClass("disabled"):h.removeClass("disabled")}function _(){c.hasClass("slick-initialized")&&($(c,l,h).off(),c.slick("unslick"),o.removeClass("tabs__head--slider"))}return r.on("click",function(t,a){var e=$(this),i=window.innerWidth,s=u<i;a="trigger"===a;if(e.hasClass("active")){if(s&&!v)return;m(e,{desktop:s})}else m(e,{desktop:s}),y(e,{desktop:s,after:function(t){if(!s&&!a&&g){var e=t.find("[data-js-tabs-btn-mobile]").offset().top,i=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;$("html, body").velocity("stop").velocity("scroll",{offset:e-i,duration:w.anim_scroll_duration()})}}})}),d.on("click",function(){var t=$(this).parent(),e=f.index(t);r.eq(e).trigger("click")}),$.isArray(e)&&e.length&&$(e).each(function(){var e=this;$body.on("click",this.elem,function(t){return function(t){var e=window.innerWidth,i=u<e,a=r.filter('[data-tab="'+t+'"]');function s(){var t="horizontal"===b&&i?n.offset().top:d.eq(r.index(a)).offset().top,e=theme.StickyHeader&&theme.StickyHeader.$sticky?theme.StickyHeader.$sticky.stickyHeader("getStickyHeight"):0;$("html, body").velocity("scroll",{offset:t-e,duration:w.anim_scroll_duration()})}a.hasClass("active")?s():(m(a,{desktop:i,effect:"toggle"}),y(a,{desktop:i,effect:"toggle",after:function(){s()}}))}(e.tab,e.scrollTo,e.focus),t.preventDefault(),!1})}),"horizontal"===b&&$(window).on("theme.resize updateTabs",function(){var t=window.innerWidth,e=u<t,i=c.innerWidth(),a=0;if(r.each(function(){a+=$(this).innerWidth()}),e){var s=r.filter(".active");if(!k&&1<s.length){var n=s.first();m("",{desktop:e}),y(n,{desktop:e})}i<a?(c.hasClass("slick-initialized")||(o.addClass("tabs__head--slider"),c.slick({infinite:!1,slidesToShow:1,variableWidth:!0,draggable:!1,dots:!1,arrows:!1}),l.addClass("disabled"),c.on("afterChange",function(t,e,i){C(i)}),l.on("click",function(){$(this).hasClass("disabled")||c.slick("slickPrev")}),h.on("click",function(){$(this).hasClass("disabled")||c.slick("slickNext")})),c.hasClass("slick-initialized")&&setTimeout(function(){C(r.index($("[data-js-tabs-btn].slick-current")))},0)):_()}else _()}),r.filter('[data-active="true"]').trigger("click",["trigger"]),$(window).trigger("updateTabs"),n.addClass("tabs--init"),n}$(this).each(function(){new t(this)})},this.init()}}),theme.Tabs=new t},$(function(){theme.Tabs()});

View File

@@ -0,0 +1,55 @@
theme.Tooltip = function() {
function Tooltip() {
this.params = {
size: 'small',
arrow: true,
animation: 'fade',
inertia: false,
duration: [200, 0],
delay: 0,
theme: 'shella'
};
this.load();
};
Tooltip.prototype = $.extend({}, Tooltip.prototype, {
load: function () {
this.params = $.extend(this.params, {
animation: window.theme.animations.tooltip.type,
inertia: window.theme.animations.tooltip.inertia,
touch: false
});
this.init();
},
init: function (obj) {
this.params = $.extend(this.params, {
duration: [window.theme.animations.tooltip.show_duration * 1000, window.theme.animations.tooltip.hide_duration * 1000]
});
if(obj) {
this.params = $.extend(this.params, obj);
}
this.api = tippy('[data-js-tooltip]', this.params);
},
reinit: function (obj) {
this.destroy();
this.init(obj);
},
destroy: function () {
if(this.api) {
this.api.destroyAll();
this.api = null;
}
}
});
theme.Tooltip = new Tooltip;
};
$(function() {
theme.Tooltip();
});

View File

@@ -0,0 +1 @@
theme.Tooltip=function(){function t(){this.params={size:"small",arrow:!0,animation:"fade",inertia:!1,duration:[200,0],delay:0,theme:"shella"},this.load()}t.prototype=$.extend({},t.prototype,{load:function(){this.params=$.extend(this.params,{animation:window.theme.animations.tooltip.type,inertia:window.theme.animations.tooltip.inertia,touch:!1}),this.init()},init:function(t){this.params=$.extend(this.params,{duration:[1e3*window.theme.animations.tooltip.show_duration,1e3*window.theme.animations.tooltip.hide_duration]}),t&&(this.params=$.extend(this.params,t)),this.api=tippy("[data-js-tooltip]",this.params)},reinit:function(t){this.destroy(),this.init(t)},destroy:function(){this.api&&(this.api.destroyAll(),this.api=null)}}),theme.Tooltip=new t},$(function(){theme.Tooltip()});

View File

@@ -0,0 +1,27 @@
theme.Trigger = function() {
function Trigger() {
this.load();
};
Trigger.prototype = $.extend({}, Trigger.prototype, {
load: function () {
var _ = this;
$body.on('click', '[data-js-trigger]', function () {
_.process($(this).attr('data-js-trigger'));
});
},
process: function (id, event) {
event = event || 'click';
$('[data-js-trigger-id="' + id + '"]').trigger(event);
}
});
theme.Trigger = new Trigger;
};
$(function() {
theme.Trigger();
});

View File

@@ -0,0 +1 @@
theme.Trigger=function(){function t(){this.load()}t.prototype=$.extend({},t.prototype,{load:function(){var t=this;$body.on("click","[data-js-trigger]",function(){t.process($(this).attr("data-js-trigger"))})},process:function(t,e){e=e||"click",$('[data-js-trigger-id="'+t+'"]').trigger(e)}}),theme.Trigger=new t},$(function(){theme.Trigger()});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,76 @@
// Ion.RangeSlider | version 2.1.4 | https://github.com/IonDen/ion.rangeSlider
;(function(g){"function"===typeof define&&define.amd?define(["jquery"],function(q){g(q,document,window,navigator)}):g(jQuery,document,window,navigator)})(function(g,q,h,t,v){var u=0,p=function(){var a=t.userAgent,b=/msie\s\d+/i;return 0<a.search(b)&&(a=b.exec(a).toString(),a=a.split(" ")[1],9>a)?(g("html").addClass("lt-ie9"),!0):!1}();Function.prototype.bind||(Function.prototype.bind=function(a){var b=this,d=[].slice;if("function"!=typeof b)throw new TypeError;var c=d.call(arguments,1),e=function(){if(this instanceof
e){var f=function(){};f.prototype=b.prototype;var f=new f,l=b.apply(f,c.concat(d.call(arguments)));return Object(l)===l?l:f}return b.apply(a,c.concat(d.call(arguments)))};return e});Array.prototype.indexOf||(Array.prototype.indexOf=function(a,b){var d;if(null==this)throw new TypeError('"this" is null or not defined');var c=Object(this),e=c.length>>>0;if(0===e)return-1;d=+b||0;Infinity===Math.abs(d)&&(d=0);if(d>=e)return-1;for(d=Math.max(0<=d?d:e-Math.abs(d),0);d<e;){if(d in c&&c[d]===a)return d;d++}return-1});
var r=function(a,b,d){this.VERSION="2.1.4";this.input=a;this.plugin_count=d;this.old_to=this.old_from=this.update_tm=this.calc_count=this.current_plugin=0;this.raf_id=this.old_min_interval=null;this.is_update=this.is_key=this.no_diapason=this.force_redraw=this.dragging=!1;this.is_start=!0;this.is_click=this.is_resize=this.is_active=this.is_finish=!1;this.$cache={win:g(h),body:g(q.body),input:g(a),cont:null,rs:null,min:null,max:null,from:null,to:null,single:null,bar:null,line:null,s_single:null,s_from:null,
s_to:null,shad_single:null,shad_from:null,shad_to:null,edge:null,grid:null,grid_labels:[]};this.coords={x_gap:0,x_pointer:0,w_rs:0,w_rs_old:0,w_handle:0,p_gap:0,p_gap_left:0,p_gap_right:0,p_step:0,p_pointer:0,p_handle:0,p_single_fake:0,p_single_real:0,p_from_fake:0,p_from_real:0,p_to_fake:0,p_to_real:0,p_bar_x:0,p_bar_w:0,grid_gap:0,big_num:0,big:[],big_w:[],big_p:[],big_x:[]};this.labels={w_min:0,w_max:0,w_from:0,w_to:0,w_single:0,p_min:0,p_max:0,p_from_fake:0,p_from_left:0,p_to_fake:0,p_to_left:0,
p_single_fake:0,p_single_left:0};var c=this.$cache.input;a=c.prop("value");var e;d={type:"single",min:10,max:100,from:null,to:null,step:1,min_interval:0,max_interval:0,drag_interval:!1,values:[],p_values:[],from_fixed:!1,from_min:null,from_max:null,from_shadow:!1,to_fixed:!1,to_min:null,to_max:null,to_shadow:!1,prettify_enabled:!0,prettify_separator:" ",prettify:null,force_edges:!1,keyboard:!1,keyboard_step:5,grid:!1,grid_margin:!0,grid_num:4,grid_snap:!1,hide_min_max:!1,hide_from_to:!1,prefix:"",
postfix:"",max_postfix:"",decorate_both:!0,values_separator:" \u2014 ",input_values_separator:";",disable:!1,onStart:null,onChange:null,onFinish:null,onUpdate:null};c={type:c.data("type"),min:c.data("min"),max:c.data("max"),from:c.data("from"),to:c.data("to"),step:c.data("step"),min_interval:c.data("minInterval"),max_interval:c.data("maxInterval"),drag_interval:c.data("dragInterval"),values:c.data("values"),from_fixed:c.data("fromFixed"),from_min:c.data("fromMin"),from_max:c.data("fromMax"),from_shadow:c.data("fromShadow"),
to_fixed:c.data("toFixed"),to_min:c.data("toMin"),to_max:c.data("toMax"),to_shadow:c.data("toShadow"),prettify_enabled:c.data("prettifyEnabled"),prettify_separator:c.data("prettifySeparator"),force_edges:c.data("forceEdges"),keyboard:c.data("keyboard"),keyboard_step:c.data("keyboardStep"),grid:c.data("grid"),grid_margin:c.data("gridMargin"),grid_num:c.data("gridNum"),grid_snap:c.data("gridSnap"),hide_min_max:c.data("hideMinMax"),hide_from_to:c.data("hideFromTo"),prefix:c.data("prefix"),postfix:c.data("postfix"),
max_postfix:c.data("maxPostfix"),decorate_both:c.data("decorateBoth"),values_separator:c.data("valuesSeparator"),input_values_separator:c.data("inputValuesSeparator"),disable:c.data("disable")};c.values=c.values&&c.values.split(",");for(e in c)c.hasOwnProperty(e)&&(c[e]||0===c[e]||delete c[e]);a&&(a=a.split(c.input_values_separator||b.input_values_separator||";"),a[0]&&a[0]==+a[0]&&(a[0]=+a[0]),a[1]&&a[1]==+a[1]&&(a[1]=+a[1]),b&&b.values&&b.values.length?(d.from=a[0]&&b.values.indexOf(a[0]),d.to=
a[1]&&b.values.indexOf(a[1])):(d.from=a[0]&&+a[0],d.to=a[1]&&+a[1]));g.extend(d,b);g.extend(d,c);this.options=d;this.validate();this.result={input:this.$cache.input,slider:null,min:this.options.min,max:this.options.max,from:this.options.from,from_percent:0,from_value:null,to:this.options.to,to_percent:0,to_value:null};this.init()};r.prototype={init:function(a){this.no_diapason=!1;this.coords.p_step=this.convertToPercent(this.options.step,!0);this.target="base";this.toggleInput();this.append();this.setMinMax();
a?(this.force_redraw=!0,this.calc(!0),this.callOnUpdate()):(this.force_redraw=!0,this.calc(!0),this.callOnStart());this.updateScene()},append:function(){this.$cache.input.before('<span class="irs js-irs-'+this.plugin_count+'"></span>');this.$cache.input.prop("readonly",!0);this.$cache.cont=this.$cache.input.prev();this.result.slider=this.$cache.cont;this.$cache.cont.html('<span class="irs"><span class="irs-line" tabindex="-1"><span class="irs-line-left"></span><span class="irs-line-mid"></span><span class="irs-line-right"></span></span><span class="irs-min">0</span><span class="irs-max">1</span><span class="irs-from">0</span><span class="irs-to">0</span><span class="irs-single">0</span></span><span class="irs-grid"></span><span class="irs-bar"></span>');
this.$cache.rs=this.$cache.cont.find(".irs");this.$cache.min=this.$cache.cont.find(".irs-min");this.$cache.max=this.$cache.cont.find(".irs-max");this.$cache.from=this.$cache.cont.find(".irs-from");this.$cache.to=this.$cache.cont.find(".irs-to");this.$cache.single=this.$cache.cont.find(".irs-single");this.$cache.bar=this.$cache.cont.find(".irs-bar");this.$cache.line=this.$cache.cont.find(".irs-line");this.$cache.grid=this.$cache.cont.find(".irs-grid");"single"===this.options.type?(this.$cache.cont.append('<span class="irs-bar-edge"></span><span class="irs-shadow shadow-single"></span><span class="irs-slider single"></span>'),
this.$cache.edge=this.$cache.cont.find(".irs-bar-edge"),this.$cache.s_single=this.$cache.cont.find(".single"),this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.shad_single=this.$cache.cont.find(".shadow-single")):(this.$cache.cont.append('<span class="irs-shadow shadow-from"></span><span class="irs-shadow shadow-to"></span><span class="irs-slider from"></span><span class="irs-slider to"></span>'),this.$cache.s_from=this.$cache.cont.find(".from"),
this.$cache.s_to=this.$cache.cont.find(".to"),this.$cache.shad_from=this.$cache.cont.find(".shadow-from"),this.$cache.shad_to=this.$cache.cont.find(".shadow-to"),this.setTopHandler());this.options.hide_from_to&&(this.$cache.from[0].style.display="none",this.$cache.to[0].style.display="none",this.$cache.single[0].style.display="none");this.appendGrid();this.options.disable?(this.appendDisableMask(),this.$cache.input[0].disabled=!0):(this.$cache.cont.removeClass("irs-disabled"),this.$cache.input[0].disabled=
!1,this.bindEvents());this.options.drag_interval&&(this.$cache.bar[0].style.cursor="ew-resize")},setTopHandler:function(){var a=this.options.max,b=this.options.to;this.options.from>this.options.min&&b===a?this.$cache.s_from.addClass("type_last"):b<a&&this.$cache.s_to.addClass("type_last")},changeLevel:function(a){switch(a){case "single":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_single_fake);break;case "from":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake);
this.$cache.s_from.addClass("state_hover");this.$cache.s_from.addClass("type_last");this.$cache.s_to.removeClass("type_last");break;case "to":this.coords.p_gap=this.toFixed(this.coords.p_pointer-this.coords.p_to_fake);this.$cache.s_to.addClass("state_hover");this.$cache.s_to.addClass("type_last");this.$cache.s_from.removeClass("type_last");break;case "both":this.coords.p_gap_left=this.toFixed(this.coords.p_pointer-this.coords.p_from_fake),this.coords.p_gap_right=this.toFixed(this.coords.p_to_fake-
this.coords.p_pointer),this.$cache.s_to.removeClass("type_last"),this.$cache.s_from.removeClass("type_last")}},appendDisableMask:function(){this.$cache.cont.append('<span class="irs-disable-mask"></span>');this.$cache.cont.addClass("irs-disabled")},remove:function(){this.$cache.cont.remove();this.$cache.cont=null;this.$cache.line.off("keydown.irs_"+this.plugin_count);this.$cache.body.off("touchmove.irs_"+this.plugin_count);this.$cache.body.off("mousemove.irs_"+this.plugin_count);this.$cache.win.off("touchend.irs_"+
this.plugin_count);this.$cache.win.off("mouseup.irs_"+this.plugin_count);p&&(this.$cache.body.off("mouseup.irs_"+this.plugin_count),this.$cache.body.off("mouseleave.irs_"+this.plugin_count));this.$cache.grid_labels=[];this.coords.big=[];this.coords.big_w=[];this.coords.big_p=[];this.coords.big_x=[];cancelAnimationFrame(this.raf_id)},bindEvents:function(){if(!this.no_diapason){this.$cache.body.on("touchmove.irs_"+this.plugin_count,this.pointerMove.bind(this));this.$cache.body.on("mousemove.irs_"+this.plugin_count,
this.pointerMove.bind(this));this.$cache.win.on("touchend.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.win.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this));this.$cache.line.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.$cache.line.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"));this.options.drag_interval&&"double"===this.options.type?(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,
"both")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"both"))):(this.$cache.bar.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.bar.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));"single"===this.options.type?(this.$cache.single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),
this.$cache.shad_single.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.s_single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"single")),this.$cache.edge.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_single.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click"))):(this.$cache.single.on("touchstart.irs_"+
this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.single.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,null)),this.$cache.from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("touchstart.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),
this.$cache.shad_from.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("touchstart.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.s_from.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"from")),this.$cache.to.on("mousedown.irs_"+this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.s_to.on("mousedown.irs_"+
this.plugin_count,this.pointerDown.bind(this,"to")),this.$cache.shad_from.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")),this.$cache.shad_to.on("mousedown.irs_"+this.plugin_count,this.pointerClick.bind(this,"click")));if(this.options.keyboard)this.$cache.line.on("keydown.irs_"+this.plugin_count,this.key.bind(this,"keyboard"));p&&(this.$cache.body.on("mouseup.irs_"+this.plugin_count,this.pointerUp.bind(this)),this.$cache.body.on("mouseleave.irs_"+this.plugin_count,this.pointerUp.bind(this)))}},
pointerMove:function(a){this.dragging&&(this.coords.x_pointer=(a.pageX||a.originalEvent.touches&&a.originalEvent.touches[0].pageX)-this.coords.x_gap,this.calc())},pointerUp:function(a){if(this.current_plugin===this.plugin_count&&this.is_active){this.is_active=!1;this.$cache.cont.find(".state_hover").removeClass("state_hover");this.force_redraw=!0;p&&g("*").prop("unselectable",!1);this.updateScene();this.restoreOriginalMinInterval();if(g.contains(this.$cache.cont[0],a.target)||this.dragging)this.is_finish=
!0,this.callOnFinish();this.dragging=!1}},pointerDown:function(a,b){b.preventDefault();var d=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&("both"===a&&this.setTempMinInterval(),a||(a=this.target),this.current_plugin=this.plugin_count,this.target=a,this.dragging=this.is_active=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=d-this.coords.x_gap,this.calcPointerPercent(),this.changeLevel(a),p&&g("*").prop("unselectable",!0),this.$cache.line.trigger("focus"),
this.updateScene())},pointerClick:function(a,b){b.preventDefault();var d=b.pageX||b.originalEvent.touches&&b.originalEvent.touches[0].pageX;2!==b.button&&(this.current_plugin=this.plugin_count,this.target=a,this.is_click=!0,this.coords.x_gap=this.$cache.rs.offset().left,this.coords.x_pointer=+(d-this.coords.x_gap).toFixed(),this.force_redraw=!0,this.calc(),this.$cache.line.trigger("focus"))},key:function(a,b){if(!(this.current_plugin!==this.plugin_count||b.altKey||b.ctrlKey||b.shiftKey||b.metaKey)){switch(b.which){case 83:case 65:case 40:case 37:b.preventDefault();
this.moveByKey(!1);break;case 87:case 68:case 38:case 39:b.preventDefault(),this.moveByKey(!0)}return!0}},moveByKey:function(a){var b=this.coords.p_pointer,b=a?b+this.options.keyboard_step:b-this.options.keyboard_step;this.coords.x_pointer=this.toFixed(this.coords.w_rs/100*b);this.is_key=!0;this.calc()},setMinMax:function(){this.options&&(this.options.hide_min_max?(this.$cache.min[0].style.display="none",this.$cache.max[0].style.display="none"):(this.options.values.length?(this.$cache.min.html(this.decorate(this.options.p_values[this.options.min])),
this.$cache.max.html(this.decorate(this.options.p_values[this.options.max]))):(this.$cache.min.html(this.decorate(this._prettify(this.options.min),this.options.min)),this.$cache.max.html(this.decorate(this._prettify(this.options.max),this.options.max))),this.labels.w_min=this.$cache.min.outerWidth(!1),this.labels.w_max=this.$cache.max.outerWidth(!1)))},setTempMinInterval:function(){var a=this.result.to-this.result.from;null===this.old_min_interval&&(this.old_min_interval=this.options.min_interval);
this.options.min_interval=a},restoreOriginalMinInterval:function(){null!==this.old_min_interval&&(this.options.min_interval=this.old_min_interval,this.old_min_interval=null)},calc:function(a){if(this.options){this.calc_count++;if(10===this.calc_count||a)this.calc_count=0,this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.calcHandlePercent();if(this.coords.w_rs){this.calcPointerPercent();a=this.getHandleX();"click"===this.target&&(this.coords.p_gap=this.coords.p_handle/2,a=this.getHandleX(),this.target=
this.options.drag_interval?"both_one":this.chooseHandle(a));switch(this.target){case "base":var b=(this.options.max-this.options.min)/100;a=(this.result.from-this.options.min)/b;b=(this.result.to-this.options.min)/b;this.coords.p_single_real=this.toFixed(a);this.coords.p_from_real=this.toFixed(a);this.coords.p_to_real=this.toFixed(b);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,
this.options.from_min,this.options.from_max);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);this.target=null;break;case "single":if(this.options.from_fixed)break;this.coords.p_single_real=this.convertToRealPercent(a);this.coords.p_single_real=
this.calcWithStep(this.coords.p_single_real);this.coords.p_single_real=this.checkDiapason(this.coords.p_single_real,this.options.from_min,this.options.from_max);this.coords.p_single_fake=this.convertToFakePercent(this.coords.p_single_real);break;case "from":if(this.options.from_fixed)break;this.coords.p_from_real=this.convertToRealPercent(a);this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real);this.coords.p_from_real>this.coords.p_to_real&&(this.coords.p_from_real=this.coords.p_to_real);
this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_real=this.checkMaxInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);break;case "to":if(this.options.to_fixed)break;this.coords.p_to_real=this.convertToRealPercent(a);this.coords.p_to_real=
this.calcWithStep(this.coords.p_to_real);this.coords.p_to_real<this.coords.p_from_real&&(this.coords.p_to_real=this.coords.p_from_real);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to");this.coords.p_to_real=this.checkMaxInterval(this.coords.p_to_real,this.coords.p_from_real,"to");this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);
break;case "both":if(this.options.from_fixed||this.options.to_fixed)break;a=this.toFixed(a+.1*this.coords.p_handle);this.coords.p_from_real=this.convertToRealPercent(a)-this.coords.p_gap_left;this.coords.p_from_real=this.calcWithStep(this.coords.p_from_real);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_real=this.checkMinInterval(this.coords.p_from_real,this.coords.p_to_real,"from");this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);
this.coords.p_to_real=this.convertToRealPercent(a)+this.coords.p_gap_right;this.coords.p_to_real=this.calcWithStep(this.coords.p_to_real);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_real=this.checkMinInterval(this.coords.p_to_real,this.coords.p_from_real,"to");this.coords.p_to_fake=this.convertToFakePercent(this.coords.p_to_real);break;case "both_one":if(!this.options.from_fixed&&!this.options.to_fixed){var d=this.convertToRealPercent(a);
a=this.result.to_percent-this.result.from_percent;var c=a/2,b=d-c,d=d+c;0>b&&(b=0,d=b+a);100<d&&(d=100,b=d-a);this.coords.p_from_real=this.calcWithStep(b);this.coords.p_from_real=this.checkDiapason(this.coords.p_from_real,this.options.from_min,this.options.from_max);this.coords.p_from_fake=this.convertToFakePercent(this.coords.p_from_real);this.coords.p_to_real=this.calcWithStep(d);this.coords.p_to_real=this.checkDiapason(this.coords.p_to_real,this.options.to_min,this.options.to_max);this.coords.p_to_fake=
this.convertToFakePercent(this.coords.p_to_real)}}"single"===this.options.type?(this.coords.p_bar_x=this.coords.p_handle/2,this.coords.p_bar_w=this.coords.p_single_fake,this.result.from_percent=this.coords.p_single_real,this.result.from=this.convertToValue(this.coords.p_single_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from])):(this.coords.p_bar_x=this.toFixed(this.coords.p_from_fake+this.coords.p_handle/2),this.coords.p_bar_w=this.toFixed(this.coords.p_to_fake-
this.coords.p_from_fake),this.result.from_percent=this.coords.p_from_real,this.result.from=this.convertToValue(this.coords.p_from_real),this.result.to_percent=this.coords.p_to_real,this.result.to=this.convertToValue(this.coords.p_to_real),this.options.values.length&&(this.result.from_value=this.options.values[this.result.from],this.result.to_value=this.options.values[this.result.to]));this.calcMinMax();this.calcLabels()}}},calcPointerPercent:function(){this.coords.w_rs?(0>this.coords.x_pointer||isNaN(this.coords.x_pointer)?
this.coords.x_pointer=0:this.coords.x_pointer>this.coords.w_rs&&(this.coords.x_pointer=this.coords.w_rs),this.coords.p_pointer=this.toFixed(this.coords.x_pointer/this.coords.w_rs*100)):this.coords.p_pointer=0},convertToRealPercent:function(a){return a/(100-this.coords.p_handle)*100},convertToFakePercent:function(a){return a/100*(100-this.coords.p_handle)},getHandleX:function(){var a=100-this.coords.p_handle,b=this.toFixed(this.coords.p_pointer-this.coords.p_gap);0>b?b=0:b>a&&(b=a);return b},calcHandlePercent:function(){this.coords.w_handle=
"single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1);this.coords.p_handle=this.toFixed(this.coords.w_handle/this.coords.w_rs*100)},chooseHandle:function(a){return"single"===this.options.type?"single":a>=this.coords.p_from_real+(this.coords.p_to_real-this.coords.p_from_real)/2?this.options.to_fixed?"from":"to":this.options.from_fixed?"to":"from"},calcMinMax:function(){this.coords.w_rs&&(this.labels.p_min=this.labels.w_min/this.coords.w_rs*100,this.labels.p_max=
this.labels.w_max/this.coords.w_rs*100)},calcLabels:function(){this.coords.w_rs&&!this.options.hide_from_to&&("single"===this.options.type?(this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=this.coords.p_single_fake+this.coords.p_handle/2-this.labels.p_single_fake/2):(this.labels.w_from=this.$cache.from.outerWidth(!1),this.labels.p_from_fake=this.labels.w_from/this.coords.w_rs*100,this.labels.p_from_left=
this.coords.p_from_fake+this.coords.p_handle/2-this.labels.p_from_fake/2,this.labels.p_from_left=this.toFixed(this.labels.p_from_left),this.labels.p_from_left=this.checkEdges(this.labels.p_from_left,this.labels.p_from_fake),this.labels.w_to=this.$cache.to.outerWidth(!1),this.labels.p_to_fake=this.labels.w_to/this.coords.w_rs*100,this.labels.p_to_left=this.coords.p_to_fake+this.coords.p_handle/2-this.labels.p_to_fake/2,this.labels.p_to_left=this.toFixed(this.labels.p_to_left),this.labels.p_to_left=
this.checkEdges(this.labels.p_to_left,this.labels.p_to_fake),this.labels.w_single=this.$cache.single.outerWidth(!1),this.labels.p_single_fake=this.labels.w_single/this.coords.w_rs*100,this.labels.p_single_left=(this.labels.p_from_left+this.labels.p_to_left+this.labels.p_to_fake)/2-this.labels.p_single_fake/2,this.labels.p_single_left=this.toFixed(this.labels.p_single_left)),this.labels.p_single_left=this.checkEdges(this.labels.p_single_left,this.labels.p_single_fake))},updateScene:function(){this.raf_id&&
(cancelAnimationFrame(this.raf_id),this.raf_id=null);clearTimeout(this.update_tm);this.update_tm=null;this.options&&(this.drawHandles(),this.is_active?this.raf_id=requestAnimationFrame(this.updateScene.bind(this)):this.update_tm=setTimeout(this.updateScene.bind(this),300))},drawHandles:function(){this.coords.w_rs=this.$cache.rs.outerWidth(!1);if(this.coords.w_rs){this.coords.w_rs!==this.coords.w_rs_old&&(this.target="base",this.is_resize=!0);if(this.coords.w_rs!==this.coords.w_rs_old||this.force_redraw)this.setMinMax(),
this.calc(!0),this.drawLabels(),this.options.grid&&(this.calcGridMargin(),this.calcGridLabels()),this.force_redraw=!0,this.coords.w_rs_old=this.coords.w_rs,this.drawShadow();if(this.coords.w_rs&&(this.dragging||this.force_redraw||this.is_key)){if(this.old_from!==this.result.from||this.old_to!==this.result.to||this.force_redraw||this.is_key){this.drawLabels();this.$cache.bar[0].style.left=this.coords.p_bar_x+"%";this.$cache.bar[0].style.width=this.coords.p_bar_w+"%";if("single"===this.options.type)this.$cache.s_single[0].style.left=
this.coords.p_single_fake+"%",this.$cache.single[0].style.left=this.labels.p_single_left+"%",this.options.values.length?this.$cache.input.prop("value",this.result.from_value):this.$cache.input.prop("value",this.result.from),this.$cache.input.data("from",this.result.from);else{this.$cache.s_from[0].style.left=this.coords.p_from_fake+"%";this.$cache.s_to[0].style.left=this.coords.p_to_fake+"%";if(this.old_from!==this.result.from||this.force_redraw)this.$cache.from[0].style.left=this.labels.p_from_left+
"%";if(this.old_to!==this.result.to||this.force_redraw)this.$cache.to[0].style.left=this.labels.p_to_left+"%";this.$cache.single[0].style.left=this.labels.p_single_left+"%";this.options.values.length?this.$cache.input.prop("value",this.result.from_value+this.options.input_values_separator+this.result.to_value):this.$cache.input.prop("value",this.result.from+this.options.input_values_separator+this.result.to);this.$cache.input.data("from",this.result.from);this.$cache.input.data("to",this.result.to)}this.old_from===
this.result.from&&this.old_to===this.result.to||this.is_start||this.$cache.input.trigger("change");this.old_from=this.result.from;this.old_to=this.result.to;this.is_resize||this.is_update||this.is_start||this.is_finish||this.callOnChange();if(this.is_key||this.is_click)this.is_click=this.is_key=!1,this.callOnFinish();this.is_finish=this.is_resize=this.is_update=!1}this.force_redraw=this.is_click=this.is_key=this.is_start=!1}}},drawLabels:function(){if(this.options){var a=this.options.values.length,
b=this.options.p_values,d;if(!this.options.hide_from_to)if("single"===this.options.type)a=a?this.decorate(b[this.result.from]):this.decorate(this._prettify(this.result.from),this.result.from),this.$cache.single.html(a),this.calcLabels(),this.$cache.min[0].style.visibility=this.labels.p_single_left<this.labels.p_min+1?"hidden":"visible",this.$cache.max[0].style.visibility=this.labels.p_single_left+this.labels.p_single_fake>100-this.labels.p_max-1?"hidden":"visible";else{a?(this.options.decorate_both?
(a=this.decorate(b[this.result.from]),a+=this.options.values_separator,a+=this.decorate(b[this.result.to])):a=this.decorate(b[this.result.from]+this.options.values_separator+b[this.result.to]),d=this.decorate(b[this.result.from]),b=this.decorate(b[this.result.to])):(this.options.decorate_both?(a=this.decorate(this._prettify(this.result.from),this.result.from),a+=this.options.values_separator,a+=this.decorate(this._prettify(this.result.to),this.result.to)):a=this.decorate(this._prettify(this.result.from)+
this.options.values_separator+this._prettify(this.result.to),this.result.to),d=this.decorate(this._prettify(this.result.from),this.result.from),b=this.decorate(this._prettify(this.result.to),this.result.to));this.$cache.single.html(a);this.$cache.from.html(d);this.$cache.to.html(b);this.calcLabels();b=Math.min(this.labels.p_single_left,this.labels.p_from_left);a=this.labels.p_single_left+this.labels.p_single_fake;d=this.labels.p_to_left+this.labels.p_to_fake;var c=Math.max(a,d);this.labels.p_from_left+
this.labels.p_from_fake>=this.labels.p_to_left?(this.$cache.from[0].style.visibility="hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",this.result.from===this.result.to?("from"===this.target?this.$cache.from[0].style.visibility="visible":"to"===this.target?this.$cache.to[0].style.visibility="visible":this.target||(this.$cache.from[0].style.visibility="visible"),this.$cache.single[0].style.visibility="hidden",c=d):(this.$cache.from[0].style.visibility=
"hidden",this.$cache.to[0].style.visibility="hidden",this.$cache.single[0].style.visibility="visible",c=Math.max(a,d))):(this.$cache.from[0].style.visibility="visible",this.$cache.to[0].style.visibility="visible",this.$cache.single[0].style.visibility="hidden");this.$cache.min[0].style.visibility=b<this.labels.p_min+1?"hidden":"visible";this.$cache.max[0].style.visibility=c>100-this.labels.p_max-1?"hidden":"visible"}}},drawShadow:function(){var a=this.options,b=this.$cache,d="number"===typeof a.from_min&&
!isNaN(a.from_min),c="number"===typeof a.from_max&&!isNaN(a.from_max),e="number"===typeof a.to_min&&!isNaN(a.to_min),f="number"===typeof a.to_max&&!isNaN(a.to_max);"single"===a.type?a.from_shadow&&(d||c)?(d=this.convertToPercent(d?a.from_min:a.min),c=this.convertToPercent(c?a.from_max:a.max)-d,d=this.toFixed(d-this.coords.p_handle/100*d),c=this.toFixed(c-this.coords.p_handle/100*c),d+=this.coords.p_handle/2,b.shad_single[0].style.display="block",b.shad_single[0].style.left=d+"%",b.shad_single[0].style.width=
c+"%"):b.shad_single[0].style.display="none":(a.from_shadow&&(d||c)?(d=this.convertToPercent(d?a.from_min:a.min),c=this.convertToPercent(c?a.from_max:a.max)-d,d=this.toFixed(d-this.coords.p_handle/100*d),c=this.toFixed(c-this.coords.p_handle/100*c),d+=this.coords.p_handle/2,b.shad_from[0].style.display="block",b.shad_from[0].style.left=d+"%",b.shad_from[0].style.width=c+"%"):b.shad_from[0].style.display="none",a.to_shadow&&(e||f)?(e=this.convertToPercent(e?a.to_min:a.min),a=this.convertToPercent(f?
a.to_max:a.max)-e,e=this.toFixed(e-this.coords.p_handle/100*e),a=this.toFixed(a-this.coords.p_handle/100*a),e+=this.coords.p_handle/2,b.shad_to[0].style.display="block",b.shad_to[0].style.left=e+"%",b.shad_to[0].style.width=a+"%"):b.shad_to[0].style.display="none")},callOnStart:function(){if(this.options.onStart&&"function"===typeof this.options.onStart)this.options.onStart(this.result)},callOnChange:function(){if(this.options.onChange&&"function"===typeof this.options.onChange)this.options.onChange(this.result)},
callOnFinish:function(){if(this.options.onFinish&&"function"===typeof this.options.onFinish)this.options.onFinish(this.result)},callOnUpdate:function(){if(this.options.onUpdate&&"function"===typeof this.options.onUpdate)this.options.onUpdate(this.result)},toggleInput:function(){this.$cache.input.toggleClass("irs-hidden-input")},convertToPercent:function(a,b){var d=this.options.max-this.options.min;return d?this.toFixed((b?a:a-this.options.min)/(d/100)):(this.no_diapason=!0,0)},convertToValue:function(a){var b=
this.options.min,d=this.options.max,c=b.toString().split(".")[1],e=d.toString().split(".")[1],f,l,g=0,k=0;if(0===a)return this.options.min;if(100===a)return this.options.max;c&&(g=f=c.length);e&&(g=l=e.length);f&&l&&(g=f>=l?f:l);0>b&&(k=Math.abs(b),b=+(b+k).toFixed(g),d=+(d+k).toFixed(g));a=(d-b)/100*a+b;(b=this.options.step.toString().split(".")[1])?a=+a.toFixed(b.length):(a/=this.options.step,a*=this.options.step,a=+a.toFixed(0));k&&(a-=k);k=b?+a.toFixed(b.length):this.toFixed(a);k<this.options.min?
k=this.options.min:k>this.options.max&&(k=this.options.max);return k},calcWithStep:function(a){var b=Math.round(a/this.coords.p_step)*this.coords.p_step;100<b&&(b=100);100===a&&(b=100);return this.toFixed(b)},checkMinInterval:function(a,b,d){var c=this.options;if(!c.min_interval)return a;a=this.convertToValue(a);b=this.convertToValue(b);"from"===d?b-a<c.min_interval&&(a=b-c.min_interval):a-b<c.min_interval&&(a=b+c.min_interval);return this.convertToPercent(a)},checkMaxInterval:function(a,b,d){var c=
this.options;if(!c.max_interval)return a;a=this.convertToValue(a);b=this.convertToValue(b);"from"===d?b-a>c.max_interval&&(a=b-c.max_interval):a-b>c.max_interval&&(a=b+c.max_interval);return this.convertToPercent(a)},checkDiapason:function(a,b,d){a=this.convertToValue(a);var c=this.options;"number"!==typeof b&&(b=c.min);"number"!==typeof d&&(d=c.max);a<b&&(a=b);a>d&&(a=d);return this.convertToPercent(a)},toFixed:function(a){a=a.toFixed(9);return+a},_prettify:function(a){return this.options.prettify_enabled?
this.options.prettify&&"function"===typeof this.options.prettify?this.options.prettify(a):this.prettify(a):a},prettify:function(a){return a.toString().replace(/(\d{1,3}(?=(?:\d\d\d)+(?!\d)))/g,"$1"+this.options.prettify_separator)},checkEdges:function(a,b){if(!this.options.force_edges)return this.toFixed(a);0>a?a=0:a>100-b&&(a=100-b);return this.toFixed(a)},validate:function(){var a=this.options,b=this.result,d=a.values,c=d.length,e,f;"string"===typeof a.min&&(a.min=+a.min);"string"===typeof a.max&&
(a.max=+a.max);"string"===typeof a.from&&(a.from=+a.from);"string"===typeof a.to&&(a.to=+a.to);"string"===typeof a.step&&(a.step=+a.step);"string"===typeof a.from_min&&(a.from_min=+a.from_min);"string"===typeof a.from_max&&(a.from_max=+a.from_max);"string"===typeof a.to_min&&(a.to_min=+a.to_min);"string"===typeof a.to_max&&(a.to_max=+a.to_max);"string"===typeof a.keyboard_step&&(a.keyboard_step=+a.keyboard_step);"string"===typeof a.grid_num&&(a.grid_num=+a.grid_num);a.max<a.min&&(a.max=a.min);if(c)for(a.p_values=
[],a.min=0,a.max=c-1,a.step=1,a.grid_num=a.max,a.grid_snap=!0,f=0;f<c;f++)e=+d[f],isNaN(e)?e=d[f]:(d[f]=e,e=this._prettify(e)),a.p_values.push(e);if("number"!==typeof a.from||isNaN(a.from))a.from=a.min;if("number"!==typeof a.to||isNaN(a.from))a.to=a.max;if("single"===a.type)a.from<a.min&&(a.from=a.min),a.from>a.max&&(a.from=a.max);else{if(a.from<a.min||a.from>a.max)a.from=a.min;if(a.to>a.max||a.to<a.min)a.to=a.max;a.from>a.to&&(a.from=a.to)}if("number"!==typeof a.step||isNaN(a.step)||!a.step||0>a.step)a.step=
1;if("number"!==typeof a.keyboard_step||isNaN(a.keyboard_step)||!a.keyboard_step||0>a.keyboard_step)a.keyboard_step=5;"number"===typeof a.from_min&&a.from<a.from_min&&(a.from=a.from_min);"number"===typeof a.from_max&&a.from>a.from_max&&(a.from=a.from_max);"number"===typeof a.to_min&&a.to<a.to_min&&(a.to=a.to_min);"number"===typeof a.to_max&&a.from>a.to_max&&(a.to=a.to_max);if(b){b.min!==a.min&&(b.min=a.min);b.max!==a.max&&(b.max=a.max);if(b.from<b.min||b.from>b.max)b.from=a.from;if(b.to<b.min||b.to>
b.max)b.to=a.to}if("number"!==typeof a.min_interval||isNaN(a.min_interval)||!a.min_interval||0>a.min_interval)a.min_interval=0;if("number"!==typeof a.max_interval||isNaN(a.max_interval)||!a.max_interval||0>a.max_interval)a.max_interval=0;a.min_interval&&a.min_interval>a.max-a.min&&(a.min_interval=a.max-a.min);a.max_interval&&a.max_interval>a.max-a.min&&(a.max_interval=a.max-a.min)},decorate:function(a,b){var d="",c=this.options;c.prefix&&(d+=c.prefix);d+=a;c.max_postfix&&(c.values.length&&a===c.p_values[c.max]?
(d+=c.max_postfix,c.postfix&&(d+=" ")):b===c.max&&(d+=c.max_postfix,c.postfix&&(d+=" ")));c.postfix&&(d+=c.postfix);return d},updateFrom:function(){this.result.from=this.options.from;this.result.from_percent=this.convertToPercent(this.result.from);this.options.values&&(this.result.from_value=this.options.values[this.result.from])},updateTo:function(){this.result.to=this.options.to;this.result.to_percent=this.convertToPercent(this.result.to);this.options.values&&(this.result.to_value=this.options.values[this.result.to])},
updateResult:function(){this.result.min=this.options.min;this.result.max=this.options.max;this.updateFrom();this.updateTo()},appendGrid:function(){if(this.options.grid){var a=this.options,b,d;b=a.max-a.min;var c=a.grid_num,e=0,f=0,g=4,h,k,m=0,n="";this.calcGridMargin();a.grid_snap?(c=b/a.step,e=this.toFixed(a.step/(b/100))):e=this.toFixed(100/c);4<c&&(g=3);7<c&&(g=2);14<c&&(g=1);28<c&&(g=0);for(b=0;b<c+1;b++){h=g;f=this.toFixed(e*b);100<f&&(f=100,h-=2,0>h&&(h=0));this.coords.big[b]=f;k=(f-e*(b-1))/
(h+1);for(d=1;d<=h&&0!==f;d++)m=this.toFixed(f-k*d),n+='<span class="irs-grid-pol small" style="left: '+m+'%"></span>';n+='<span class="irs-grid-pol" style="left: '+f+'%"></span>';m=this.convertToValue(f);m=a.values.length?a.p_values[m]:this._prettify(m);n+='<span class="irs-grid-text js-grid-text-'+b+'" style="left: '+f+'%">'+m+"</span>"}this.coords.big_num=Math.ceil(c+1);this.$cache.cont.addClass("irs-with-grid");this.$cache.grid.html(n);this.cacheGridLabels()}},cacheGridLabels:function(){var a,
b,d=this.coords.big_num;for(b=0;b<d;b++)a=this.$cache.grid.find(".js-grid-text-"+b),this.$cache.grid_labels.push(a);this.calcGridLabels()},calcGridLabels:function(){var a,b;b=[];var d=[],c=this.coords.big_num;for(a=0;a<c;a++)this.coords.big_w[a]=this.$cache.grid_labels[a].outerWidth(!1),this.coords.big_p[a]=this.toFixed(this.coords.big_w[a]/this.coords.w_rs*100),this.coords.big_x[a]=this.toFixed(this.coords.big_p[a]/2),b[a]=this.toFixed(this.coords.big[a]-this.coords.big_x[a]),d[a]=this.toFixed(b[a]+
this.coords.big_p[a]);this.options.force_edges&&(b[0]<-this.coords.grid_gap&&(b[0]=-this.coords.grid_gap,d[0]=this.toFixed(b[0]+this.coords.big_p[0]),this.coords.big_x[0]=this.coords.grid_gap),d[c-1]>100+this.coords.grid_gap&&(d[c-1]=100+this.coords.grid_gap,b[c-1]=this.toFixed(d[c-1]-this.coords.big_p[c-1]),this.coords.big_x[c-1]=this.toFixed(this.coords.big_p[c-1]-this.coords.grid_gap)));this.calcGridCollision(2,b,d);this.calcGridCollision(4,b,d);for(a=0;a<c;a++)b=this.$cache.grid_labels[a][0],
b.style.marginLeft=-this.coords.big_x[a]+"%"},calcGridCollision:function(a,b,d){var c,e,f,g=this.coords.big_num;for(c=0;c<g;c+=a){e=c+a/2;if(e>=g)break;f=this.$cache.grid_labels[e][0];f.style.visibility=d[c]<=b[e]?"visible":"hidden"}},calcGridMargin:function(){this.options.grid_margin&&(this.coords.w_rs=this.$cache.rs.outerWidth(!1),this.coords.w_rs&&(this.coords.w_handle="single"===this.options.type?this.$cache.s_single.outerWidth(!1):this.$cache.s_from.outerWidth(!1),this.coords.p_handle=this.toFixed(this.coords.w_handle/
this.coords.w_rs*100),this.coords.grid_gap=this.toFixed(this.coords.p_handle/2-.1),this.$cache.grid[0].style.width=this.toFixed(100-this.coords.p_handle)+"%",this.$cache.grid[0].style.left=this.coords.grid_gap+"%"))},update:function(a){this.input&&(this.is_update=!0,this.options.from=this.result.from,this.options.to=this.result.to,this.options=g.extend(this.options,a),this.validate(),this.updateResult(a),this.toggleInput(),this.remove(),this.init(!0))},reset:function(){this.input&&(this.updateResult(),
this.update())},destroy:function(){this.input&&(this.toggleInput(),this.$cache.input.prop("readonly",!1),g.data(this.input,"ionRangeSlider",null),this.remove(),this.options=this.input=null)}};g.fn.ionRangeSlider=function(a){return this.each(function(){g.data(this,"ionRangeSlider")||g.data(this,"ionRangeSlider",new r(this,a,u++))})};(function(){for(var a=0,b=["ms","moz","webkit","o"],d=0;d<b.length&&!h.requestAnimationFrame;++d)h.requestAnimationFrame=h[b[d]+"RequestAnimationFrame"],h.cancelAnimationFrame=
h[b[d]+"CancelAnimationFrame"]||h[b[d]+"CancelRequestAnimationFrame"];h.requestAnimationFrame||(h.requestAnimationFrame=function(b,d){var f=(new Date).getTime(),g=Math.max(0,16-(f-a)),p=h.setTimeout(function(){b(f+g)},g);a=f+g;return p});h.cancelAnimationFrame||(h.cancelAnimationFrame=function(a){clearTimeout(a)})})()});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
"object"==typeof Countries&&(Countries.updateProvinceLabel=function(e,t){if("string"==typeof e&&Countries[e]&&Countries[e].provinces){if("object"!=typeof t&&(t=document.getElementById("address_province_label"),null===t))return;t.innerHTML=Countries[e].label;var r=jQuery(t).parent();r.find("select");r.find(".custom-style-select-box-inner").html(Countries[e].provinces[0])}}),"undefined"==typeof Shopify.Cart&&(Shopify.Cart={}),Shopify.Cart.ShippingCalculator=function(){var _config={submitButton:"Calculate shipping",submitButtonDisabled:"Calculating...",templateId:"shipping-calculator-response-template",wrapperId:"wrapper-response",customerIsLoggedIn:!1,moneyFormat:"${{amount}}"},_render=function(e){var t=jQuery("#"+_config.templateId),r=jQuery("#"+_config.wrapperId);if(t.length&&r.length){var templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var n=Handlebars.compile(jQuery.trim(t.text())),a=n(e);if(jQuery(a).appendTo(r),"undefined"!=typeof Currency&&"function"==typeof Currency.convertAll){var i="";jQuery("[name=currencies]").size()?i=jQuery("[name=currencies]").val():jQuery("#currencies span.selected").size()&&(i=jQuery("#currencies span.selected").attr("data-currency")),""!==i&&Currency.convertAll(shopCurrency,i,"#wrapper-response span.money, #estimated-shipping span.money")}}},_enableButtons=function(){jQuery(".get-rates").removeAttr("disabled").removeClass("disabled").val(_config.submitButton);jQuery("#shipping-calculator").trigger("updated")},_disableButtons=function(){jQuery(".get-rates").val(_config.submitButtonDisabled).attr("disabled","disabled").addClass("disabled")},_getCartShippingRatesForDestination=function(e){var t={type:"POST",url:"/cart/prepare_shipping_rates",data:jQuery.param({shipping_address:e}),success:_pollForCartShippingRatesForDestination(e),error:_onError};jQuery.ajax(t)},_pollForCartShippingRatesForDestination=function(e){var t=function(){jQuery.ajax("/cart/async_shipping_rates",{dataType:"json",success:function(r,n,a){200===a.status?_onCartShippingRatesUpdate(r.shipping_rates,e):setTimeout(t,500)},error:_onError})};return t},_fullMessagesFromErrors=function(e){var t=[];return jQuery.each(e,function(e,r){jQuery.each(r,function(r,n){t.push(e+" "+n)})}),t},_onError=function(XMLHttpRequest,textStatus){jQuery("#estimated-shipping").hide(),jQuery("#estimated-shipping em").empty(),_enableButtons();var feedback="",data=eval("("+XMLHttpRequest.responseText+")");feedback=data.message?data.message+"("+data.status+"): "+data.description:"Error : "+_fullMessagesFromErrors(data).join("; ")+".","Error : country is not supported."===feedback&&(feedback="We do not ship to this destination."),_render({rates:[],errorFeedback:feedback,success:!1}),jQuery("#"+_config.wrapperId).show()},_onCartShippingRatesUpdate=function(e,t){_enableButtons();var r="";if(t.zip&&(r+=t.zip+", "),t.province&&(r+=t.province+", "),r+=t.country,e.length){"0.00"==e[0].price?jQuery("#estimated-shipping em").html("FREE"):jQuery("#estimated-shipping em").html(_formatRate(e[0].price));for(var n=0;n<e.length;n++)e[n].price=_formatRate(e[n].price)}_render({rates:e,address:r,success:!0}),jQuery("#"+_config.wrapperId+", #estimated-shipping").fadeIn()},_formatRate=function(e){function t(e,t){return"undefined"==typeof e?t:e}function r(e,r,n,a){if(r=t(r,2),n=t(n,","),a=t(a,"."),isNaN(e)||null==e)return 0;e=(e/100).toFixed(r);var i=e.split("."),o=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n),s=i[1]?a+i[1]:"";return o+s}if("function"==typeof Shopify.formatMoney)return Shopify.formatMoney(e,_config.moneyFormat);"string"==typeof e&&(e=e.replace(".",""));var n="",a=/\{\{\s*(\w+)\s*\}\}/,i=_config.moneyFormat;switch(i.match(a)[1]){case"amount":n=r(e,2);break;case"amount_no_decimals":n=r(e,0);break;case"amount_with_comma_separator":n=r(e,2,".",",");break;case"amount_no_decimals_with_comma_separator":n=r(e,0,".",",")}return i.replace(a,n)};return _init=function(){new Shopify.CountryProvinceSelector("address_country","address_province",{hideElement:"address_province_container"});var e=jQuery("#address_country"),t=jQuery("#address_province_label").get(0);"undefined"!=typeof Countries&&(Countries.updateProvinceLabel(e.val(),t),e.change(function(){Countries.updateProvinceLabel(e.val(),t)})),jQuery(".get-rates").click(function(){_disableButtons(),jQuery("#"+_config.wrapperId).empty().hide();var e={};e.zip=jQuery("#address_zip").val()||"",e.country=jQuery("#address_country").val()||"",e.province=jQuery("#address_province").val()||"",_getCartShippingRatesForDestination(e)}),_config.customerIsLoggedIn&&jQuery(".get-rates:eq(0)").trigger("click")},{show:function(e){e=e||{},jQuery.extend(_config,e),jQuery(function(){_init()})},getConfig:function(){return _config},formatRate:function(e){return _formatRate(e)}}}();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,76 @@
theme.ArticleBody = (function() {
function ArticleBody(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.article-body';
this.onLoad();
};
ArticleBody.prototype = $.extend({}, Section.prototype, ArticleBody.prototype, {
slider: {
init: function ($container) {
var $slider = $container.find('.article-slider'),
$insert = $('#article-slider');
if($insert.length && $slider.length) {
$insert.append($slider);
var $slick = $slider.find('.article-slider__slick'),
$dots = $slider.find('.article-slider__dots'),
autoplay = $slick.attr('data-autoplay') === 'true' ? true : false,
speed = +$slick.attr('data-speed'),
infinite = $slick.attr('data-infinite') === 'true' ? true : false;
$slider.removeClass('d-none');
$slick.slick({
prevArrow: '<div class="slick-prev d-none d-md-flex flex-center position-absolute left-0 ml-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative mr-2">' + theme.Global.getIcon('006', true) + '</i></div>',
nextArrow: '<div class="slick-next d-none d-md-flex flex-center position-absolute right-0 mr-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative ml-3">' + theme.Global.getIcon('007', true) + '</i></div>',
dots: true,
appendDots: $dots,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled m-0 my-15',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
rtl: theme.rtl
});
$slider.removeClass('invisible');
this.$dom = $slick;
}
},
destroy: function () {
if(this.$dom) {
this.$dom.slick('destroy');
this.$dom = null;
}
}
},
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
this.slider.init(this.$container);
},
onUnload: function() {
this.$container.off(this.namespace);
this.slider.destroy();
}
});
return ArticleBody;
})();
$(function() {
theme.sections.register('article-body', theme.ArticleBody);
});

View File

@@ -0,0 +1 @@
theme.ArticleBody=function(){function e(e){this.$container=$(e),this.namespace=".article-body",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{slider:{init:function(e){var t=e.find(".article-slider"),i=$("#article-slider");if(i.length&&t.length){i.append(t);var o=t.find(".article-slider__slick"),n=t.find(".article-slider__dots"),r="true"===o.attr("data-autoplay"),s=+o.attr("data-speed"),l="true"===o.attr("data-infinite");t.removeClass("d-none"),o.slick({prevArrow:'<div class="slick-prev d-none d-md-flex flex-center position-absolute left-0 ml-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative mr-2">'+theme.Global.getIcon("006",!0)+"</i></div>",nextArrow:'<div class="slick-next d-none d-md-flex flex-center position-absolute right-0 mr-10 rounded-circle overflow-hidden cursor-pointer"><i class="position-relative ml-3">'+theme.Global.getIcon("007",!0)+"</i></div>",dots:!0,appendDots:n,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled m-0 my-15",adaptiveHeight:!0,autoplay:r,autoplaySpeed:s,infinite:l,rtl:theme.rtl}),t.removeClass("invisible"),this.$dom=o}},destroy:function(){this.$dom&&(this.$dom.slick("destroy"),this.$dom=null)}},onLoad:function(){theme.is_loaded&&theme.ImagesLazyLoad.update(),this.slider.init(this.$container)},onUnload:function(){this.$container.off(this.namespace),this.slider.destroy()}}),e}(),$(function(){theme.sections.register("article-body",theme.ArticleBody)});

View File

@@ -0,0 +1,38 @@
theme.BlogBody = (function() {
function BlogBody(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.blog-body';
this.onLoad();
};
BlogBody.prototype = $.extend({}, Section.prototype, BlogBody.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Masonry) {
theme.Masonry.init(true);
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Masonry) {
theme.Masonry.destroy();
}
}
});
return BlogBody;
})();
$(function() {
theme.sections.register('blog-body', theme.BlogBody);
});

View File

@@ -0,0 +1 @@
theme.BlogBody=function(){function e(e){this.$container=$(e),this.namespace=".blog-body",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Masonry&&theme.Masonry.init(!0))},onUnload:function(){this.$container.off(this.namespace),theme.Masonry&&theme.Masonry.destroy()}}),e}(),$(function(){theme.sections.register("blog-body",theme.BlogBody)});

View File

@@ -0,0 +1,37 @@
theme.BlogSidebar = (function() {
function BlogSidebar(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.blog-sidebar';
this.onLoad();
};
BlogSidebar.prototype = $.extend({}, Section.prototype, BlogSidebar.prototype, {
onLoad: function() {
if(theme.StickySidebar) {
theme.StickySidebar.init(this.$container);
}
if(theme.is_loaded) theme.ImagesLazyLoad.update();
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.StickySidebar) {
theme.StickySidebar.destroy(this.$container);
}
}
});
return BlogSidebar;
})();
$(function() {
theme.sections.register('blog-sidebar', theme.BlogSidebar);
});

View File

@@ -0,0 +1 @@
theme.BlogSidebar=function(){function e(e){this.$container=$(e),this.namespace=".blog-sidebar",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.StickySidebar&&theme.StickySidebar.init(this.$container),theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace),theme.StickySidebar&&theme.StickySidebar.destroy(this.$container)}}),e}(),$(function(){theme.sections.register("blog-sidebar",theme.BlogSidebar)});

View File

@@ -0,0 +1,118 @@
theme.CarouselArticles = (function() {
function CarouselArticles(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.carousel-articles';
this.onLoad();
};
CarouselArticles.prototype = $.extend({}, Section.prototype, CarouselArticles.prototype, {
onLoad: function() {
var $carousel = this.$container.find('[data-js-carousel]'),
$slick = $carousel.find('[data-js-carousel-slick]');
if($slick.length) {
var $prev = $carousel.find('[data-js-carousel-prev]'),
$next = $carousel.find('[data-js-carousel-next]'),
$arrows = $prev.add($next),
count = +$carousel.attr('data-count'),
autoplay = $carousel.attr('data-autoplay') === 'true' ? true : false,
speed = +$carousel.attr('data-speed'),
infinite = $carousel.attr('data-infinite') === 'true' ? true : false,
arrows = $carousel.attr('data-arrows') === 'true' ? true : false,
bullets = $carousel.attr('data-bullets') === 'true' ? true : false;
this.$slick = $slick;
if(arrows) {
function arrowsPosition() {
var max_height = 0;
$slick.find('.carousel__item img').each(function () {
max_height = Math.max(max_height, $(this).innerHeight());
});
$arrows.css({ top: max_height/2 });
};
$window.on('theme.resize.carousel-articles', arrowsPosition);
}
$slick.on('init', function() {
if(arrows) {
arrowsPosition();
}
$carousel.removeClass('invisible');
theme.Loader.unset($carousel.parent());
});
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled mt-35',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
slidesToShow: count,
slidesToScroll: count,
rtl: theme.rtl,
responsive: [
{
breakpoint: theme.breakpoints.values.xl,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: theme.breakpoints.values.lg,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: theme.breakpoints.values.sm,
settings: {
slidesToShow: 1,
slidesToScroll: 1
}
}
]
});
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
$window.unbind('theme.resize.carousel-articles');
}
}
});
return CarouselArticles;
})();
$(function() {
theme.sections.register('carousel-articles', theme.CarouselArticles);
});

View File

@@ -0,0 +1 @@
theme.CarouselArticles=function(){function e(e){this.$container=$(e),this.namespace=".carousel-articles",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){var e=this.$container.find("[data-js-carousel]"),t=e.find("[data-js-carousel-slick]");if(t.length){var s=e.find("[data-js-carousel-prev]"),a=e.find("[data-js-carousel-next]"),i=s.add(a),o=+e.attr("data-count"),r="true"===e.attr("data-autoplay"),n=+e.attr("data-speed"),l="true"===e.attr("data-infinite"),d="true"===e.attr("data-arrows"),c="true"===e.attr("data-bullets");if(this.$slick=t,d){function u(){var e=0;t.find(".carousel__item img").each(function(){e=Math.max(e,$(this).innerHeight())}),i.css({top:e/2})}$window.on("theme.resize.carousel-articles",u)}t.on("init",function(){d&&u(),e.removeClass("invisible"),theme.Loader.unset(e.parent())}),t.slick({lazyLoad:!1,arrows:d,prevArrow:s,nextArrow:a,dots:c,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled mt-35",adaptiveHeight:!0,autoplay:r,autoplaySpeed:n,infinite:l,slidesToShow:o,slidesToScroll:o,rtl:theme.rtl,responsive:[{breakpoint:theme.breakpoints.values.xl,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:theme.breakpoints.values.lg,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:theme.breakpoints.values.sm,settings:{slidesToShow:1,slidesToScroll:1}}]}),theme.is_loaded&&theme.ImagesLazyLoad.update()}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-articles"))}}),e}(),$(function(){theme.sections.register("carousel-articles",theme.CarouselArticles)});

View File

@@ -0,0 +1,125 @@
theme.CarouselBrands = (function() {
function CarouselBrands(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.carousel-brands';
this.onLoad();
};
CarouselBrands.prototype = $.extend({}, Section.prototype, CarouselBrands.prototype, {
onLoad: function() {
var $carousel = this.$container.find('[data-js-carousel]'),
$slick = $carousel.find('[data-js-carousel-slick]');
if($slick.length) {
var $prev = $carousel.find('[data-js-carousel-prev]'),
$next = $carousel.find('[data-js-carousel-next]'),
$arrows = $prev.add($next),
count = +$carousel.attr('data-count'),
autoplay = $carousel.attr('data-autoplay') === 'true' ? true : false,
speed = +$carousel.attr('data-speed'),
infinite = $carousel.attr('data-infinite') === 'true' ? true : false,
arrows = $carousel.attr('data-arrows') === 'true' ? true : false,
bullets = $carousel.attr('data-bullets') === 'true' ? true : false;
this.$slick = $slick;
if(arrows) {
function arrowsPosition() {
var max_height = 0;
$slick.find('.carousel__item').each(function () {
max_height = Math.max(max_height, $(this).innerHeight());
});
$arrows.css({ top: max_height/2 });
};
$window.on('theme.resize.carousel-brands', arrowsPosition);
}
$slick.on('init', function() {
if(arrows) {
arrowsPosition();
}
$carousel.removeClass('invisible');
theme.Loader.unset($carousel.parent());
});
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled mt-40',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
slidesToShow: count,
slidesToScroll: count,
rtl: theme.rtl,
responsive: [
{
breakpoint: theme.breakpoints.values.xl,
settings: {
slidesToShow: 5,
slidesToScroll: 5
}
},
{
breakpoint: theme.breakpoints.values.lg,
settings: {
slidesToShow: 4,
slidesToScroll: 4
}
},
{
breakpoint: theme.breakpoints.values.md,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}
},
{
breakpoint: theme.breakpoints.values.sm,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
]
});
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
$window.unbind('theme.resize.carousel-brands');
}
}
});
return CarouselBrands;
})();
$(function() {
theme.sections.register('carousel-brands', theme.CarouselBrands);
});

View File

@@ -0,0 +1 @@
theme.CarouselBrands=function(){function e(e){this.$container=$(e),this.namespace=".carousel-brands",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){var e=this.$container.find("[data-js-carousel]"),t=e.find("[data-js-carousel-slick]");if(t.length){var s=e.find("[data-js-carousel-prev]"),a=e.find("[data-js-carousel-next]"),o=s.add(a),i=+e.attr("data-count"),n="true"===e.attr("data-autoplay"),r=+e.attr("data-speed"),l="true"===e.attr("data-infinite"),d="true"===e.attr("data-arrows"),c="true"===e.attr("data-bullets");if(this.$slick=t,d){function u(){var e=0;t.find(".carousel__item").each(function(){e=Math.max(e,$(this).innerHeight())}),o.css({top:e/2})}$window.on("theme.resize.carousel-brands",u)}t.on("init",function(){d&&u(),e.removeClass("invisible"),theme.Loader.unset(e.parent())}),t.slick({lazyLoad:!1,arrows:d,prevArrow:s,nextArrow:a,dots:c,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled mt-40",adaptiveHeight:!0,autoplay:n,autoplaySpeed:r,infinite:l,slidesToShow:i,slidesToScroll:i,rtl:theme.rtl,responsive:[{breakpoint:theme.breakpoints.values.xl,settings:{slidesToShow:5,slidesToScroll:5}},{breakpoint:theme.breakpoints.values.lg,settings:{slidesToShow:4,slidesToScroll:4}},{breakpoint:theme.breakpoints.values.md,settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:theme.breakpoints.values.sm,settings:{slidesToShow:2,slidesToScroll:2}}]}),theme.is_loaded&&theme.ImagesLazyLoad.update()}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-brands"))}}),e}(),$(function(){theme.sections.register("carousel-brands",theme.CarouselBrands)});

View File

@@ -0,0 +1,257 @@
theme.CarouselProducts = (function() {
function CarouselProducts(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.carousel-products';
this.onLoad();
};
CarouselProducts.prototype = $.extend({}, Section.prototype, CarouselProducts.prototype, {
_checkProduct: function ($slide, beforeAjax) {
var _ = this,
handle = $slide.attr('data-handle');
if(handle) {
if(beforeAjax) {
beforeAjax($slide);
}
$.ajax({
type: 'GET',
url: 'https://' + window.location.hostname + '/products/' + handle,
data: {
view: 'collection'
},
cache: false,
dataType: 'html',
success: function (data) {
var $data = $(data).clone();
$data.find('img').one('load', function () {
$slide.add(_.$slick.find('.slick-cloned[data-handle="' + handle + '"]')).html($data).removeAttr('data-handle');
});
$slide.trigger('loaded');
}
});
return true;
} else {
return false;
}
},
onLoad: function() {
var _ = this,
$carousel = this.$container.find('[data-js-carousel]'),
$slick = this.$container.find('[data-js-carousel-slick]'),
$control = this.$container.find('[data-carousel-control]'),
$products = this.$container.find('[data-carousel-items]'),
xhr = null;
this.$control = $control;
if($slick.length) {
var $slides = $slick.find('> *'),
$prev = $carousel.find('[data-js-carousel-prev]'),
$next = $carousel.find('[data-js-carousel-next]'),
$arrows = $prev.add($next),
count = +$carousel.attr('data-count'),
autoplay = $carousel.attr('data-autoplay') === 'true' ? true : false,
speed = +$carousel.attr('data-speed'),
infinite = $carousel.attr('data-infinite') === 'true' ? true : false,
arrows = $carousel.attr('data-arrows') === 'true' ? true : false,
bullets = $carousel.attr('data-bullets') === 'true' ? true : false;
this.$slick = $slick;
if(arrows) {
function arrowsPosition() {
var max_height = 0;
$slick.find('.carousel__item img').each(function () {
max_height = Math.max(max_height, $(this).innerHeight());
});
$arrows.css({top: max_height / 2});
};
$window.on('theme.resize.carousel-products', arrowsPosition);
}
function initSlick() {
$slick.one('init', function() {
if(arrows) {
arrowsPosition();
}
$carousel.removeClass('invisible');
theme.Loader.unset($carousel.parent());
});
$slick.on('beforeChange', function (event, slick, currentSlide, nextSlide) {
var check_before = nextSlide - 1,
check_after = nextSlide + count;
function beforeAjax($slide) {
$slides.unbind('loaded');
$slide.one('loaded', function () {
theme.ProductReview.update();
});
};
_._checkProduct($slick.find('[data-slick-index="' + check_before + '"]'), beforeAjax);
for(var i = check_after; i > currentSlide + 1; i--) {
_._checkProduct($slick.find('[data-slick-index="' + i + '"]'), beforeAjax);
}
});
if(theme.Tooltip) {
$slick.on('afterChange', function () {
theme.Tooltip.init();
});
}
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-flex flex-wrap flex-center list-unstyled mt-7',
adaptiveHeight: true,
autoplay: autoplay,
autoplaySpeed: speed,
infinite: infinite,
slidesToShow: count,
slidesToScroll: count,
rtl: theme.rtl,
responsive: [
{
breakpoint: theme.breakpoints.values.xl,
settings: {
slidesToShow: 3,
slidesToScroll: 3
}
},
{
breakpoint: theme.breakpoints.values.md,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
},
{
breakpoint: theme.breakpoints.values.sm,
settings: {
slidesToShow: 2,
slidesToScroll: 2
}
}
]
});
};
initSlick();
$control.on('click', 'a', function (e) {
var $this = $(this);
if(!$this.hasClass('active')) {
if(xhr) {
xhr.abort();
}
theme.Loader.set($carousel);
$carousel.css({
'min-height': $products.innerHeight()
});
var collection = $this.attr('data-collection');
xhr = $.ajax({
type: 'GET',
url: '/collections/' + collection,
cache: false,
data: {
view: 'carousel',
constraint: 'max_count=' + $products.attr('data-max-count') + '+products_pre_row=' + $products.attr('data-products-pre-row') + '+async_ajax_loading=' + $products.attr('data-async-ajax-loading')
},
dataType: 'html',
success: function (data) {
$carousel.addClass('invisible');
$slick.slick('destroy').off();
$slick.one('init', function () {
$carousel.removeAttr('style');
theme.Loader.unset($carousel);
});
$products.html(data);
$slides = $slick.find('> *');
initSlick();
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
$control.find('a').removeClass('active');
$this.addClass('active');
xhr = null;
}
});
}
e.preventDefault();
return false;
});
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
$window.unbind('theme.resize.carousel-products');
}
this.$control.off();
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return CarouselProducts;
})();
$(function() {
theme.sections.register('carousel-products', theme.CarouselProducts);
});

View File

@@ -0,0 +1 @@
theme.CarouselProducts=function(){function t(t){this.$container=$(t),this.namespace=".carousel-products",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_checkProduct:function(a,t){var o=this,i=a.attr("data-handle");return!!i&&(t&&t(a),$.ajax({type:"GET",url:"https://"+window.location.hostname+"/products/"+i,data:{view:"collection"},cache:!1,dataType:"html",success:function(t){var e=$(t).clone();e.find("img").one("load",function(){a.add(o.$slick.find('.slick-cloned[data-handle="'+i+'"]')).html(e).removeAttr("data-handle")}),a.trigger("loaded")}}),!0)},onLoad:function(){var d=this,o=this.$container.find("[data-js-carousel]"),l=this.$container.find("[data-js-carousel-slick]"),i=this.$container.find("[data-carousel-control]"),n=this.$container.find("[data-carousel-items]"),s=null;if(this.$control=i,l.length){var c=l.find("> *"),t=o.find("[data-js-carousel-prev]"),e=o.find("[data-js-carousel-next]"),a=t.add(e),u=+o.attr("data-count"),r="true"===o.attr("data-autoplay"),h=+o.attr("data-speed"),p="true"===o.attr("data-infinite"),f="true"===o.attr("data-arrows"),m="true"===o.attr("data-bullets");if(this.$slick=l,f){function v(){var t=0;l.find(".carousel__item img").each(function(){t=Math.max(t,$(this).innerHeight())}),a.css({top:t/2})}$window.on("theme.resize.carousel-products",v)}function k(){l.one("init",function(){f&&v(),o.removeClass("invisible"),theme.Loader.unset(o.parent())}),l.on("beforeChange",function(t,e,a,o){var i=o-1,n=o+u;function s(t){c.unbind("loaded"),t.one("loaded",function(){theme.ProductReview.update()})}d._checkProduct(l.find('[data-slick-index="'+i+'"]'),s);for(var r=n;a+1<r;r--)d._checkProduct(l.find('[data-slick-index="'+r+'"]'),s)}),theme.Tooltip&&l.on("afterChange",function(){theme.Tooltip.init()}),l.slick({lazyLoad:!1,arrows:f,prevArrow:t,nextArrow:e,dots:m,dotsClass:"slick-dots d-flex flex-wrap flex-center list-unstyled mt-7",adaptiveHeight:!0,autoplay:r,autoplaySpeed:h,infinite:p,slidesToShow:u,slidesToScroll:u,rtl:theme.rtl,responsive:[{breakpoint:theme.breakpoints.values.xl,settings:{slidesToShow:3,slidesToScroll:3}},{breakpoint:theme.breakpoints.values.md,settings:{slidesToShow:2,slidesToScroll:2}},{breakpoint:theme.breakpoints.values.sm,settings:{slidesToShow:2,slidesToScroll:2}}]})}k(),i.on("click","a",function(t){var e=$(this);if(!e.hasClass("active")){s&&s.abort(),theme.Loader.set(o),o.css({"min-height":n.innerHeight()});var a=e.attr("data-collection");s=$.ajax({type:"GET",url:"/collections/"+a,cache:!1,data:{view:"carousel",constraint:"max_count="+n.attr("data-max-count")+"+products_pre_row="+n.attr("data-products-pre-row")+"+async_ajax_loading="+n.attr("data-async-ajax-loading")},dataType:"html",success:function(t){o.addClass("invisible"),l.slick("destroy").off(),l.one("init",function(){o.removeAttr("style"),theme.Loader.unset(o)}),n.html(t),c=l.find("> *"),k(),theme.ImagesLazyLoad.update(),theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init(),i.find("a").removeClass("active"),e.addClass("active"),s=null}})}return t.preventDefault(),!1}),theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init())}},onUnload:function(){this.$container.off(this.namespace),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null,$window.unbind("theme.resize.carousel-products")),this.$control.off(),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("carousel-products",theme.CarouselProducts)});

View File

@@ -0,0 +1,38 @@
theme.CollectionBody = (function() {
function CollectionBody(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.collection-body';
this.onLoad();
};
CollectionBody.prototype = $.extend({}, Section.prototype, CollectionBody.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return CollectionBody;
})();
$(function() {
theme.sections.register('collection-body', theme.CollectionBody);
});

View File

@@ -0,0 +1 @@
theme.CollectionBody=function(){function o(o){this.$container=$(o),this.namespace=".collection-body",this.onLoad()}return o.prototype=$.extend({},Section.prototype,o.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Tooltip&&theme.Tooltip.init())},onUnload:function(){this.$container.off(this.namespace),theme.Tooltip&&theme.Tooltip.destroy()}}),o}(),$(function(){theme.sections.register("collection-body",theme.CollectionBody)});

View File

@@ -0,0 +1,31 @@
theme.CollectionHead = (function() {
function CollectionHead(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.collection-head';
this.onLoad();
};
CollectionHead.prototype = $.extend({}, Section.prototype, CollectionHead.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
}
});
return CollectionHead;
})();
$(function() {
theme.sections.register('collection-head', theme.CollectionHead);
});

View File

@@ -0,0 +1 @@
theme.CollectionHead=function(){function e(e){this.$container=$(e),this.namespace=".collection-head",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&theme.ImagesLazyLoad.update()},onUnload:function(){this.$container.off(this.namespace)}}),e}(),$(function(){theme.sections.register("collection-head",theme.CollectionHead)});

View File

@@ -0,0 +1,56 @@
theme.CollectionSidebar = (function() {
function CollectionSidebar(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.collection-sidebar';
this.onLoad();
};
CollectionSidebar.prototype = $.extend({}, Section.prototype, CollectionSidebar.prototype, {
_rangePrice: {
init: function() {
if(theme.RangeOfPrice) {
theme.RangeOfPrice.init();
}
},
destroy: function() {
if(theme.RangeOfPrice) {
theme.RangeOfPrice.destroy();
}
}
},
onLoad: function() {
if(theme.StickySidebar) {
theme.StickySidebar.init(this.$container, true);
}
this._rangePrice.init();
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
theme.ProductReview.update();
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.StickySidebar) {
theme.StickySidebar.destroy(this.$container, true);
}
this._rangePrice.destroy();
}
});
return CollectionSidebar;
})();
$(function() {
theme.sections.register('collection-sidebar', theme.CollectionSidebar);
});

View File

@@ -0,0 +1 @@
theme.CollectionSidebar=function(){function e(e){this.$container=$(e),this.namespace=".collection-sidebar",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{_rangePrice:{init:function(){theme.RangeOfPrice&&theme.RangeOfPrice.init()},destroy:function(){theme.RangeOfPrice&&theme.RangeOfPrice.destroy()}},onLoad:function(){theme.StickySidebar&&theme.StickySidebar.init(this.$container,!0),this._rangePrice.init(),theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.ProductReview.update())},onUnload:function(){this.$container.off(this.namespace),theme.StickySidebar&&theme.StickySidebar.destroy(this.$container,!0),this._rangePrice.destroy()}}),e}(),$(function(){theme.sections.register("collection-sidebar",theme.CollectionSidebar)});

View File

@@ -0,0 +1,43 @@
theme.Footbar = (function() {
function Footbar(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.footbar';
this.onLoad();
};
Footbar.prototype = $.extend({}, Section.prototype, Footbar.prototype, {
onLoad: function() {
if(theme.Notifications) {
theme.Notifications.init(this.$container);
}
if(theme.ProductFootbar) {
theme.ProductFootbar.init(this.$container);
}
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Notifications) {
theme.Notifications.destroy(this.$container);
}
if(theme.ProductFootbar) {
theme.ProductFootbar.destroy();
}
}
});
return Footbar;
})();
$(function() {
theme.sections.register('footbar', theme.Footbar);
});

View File

@@ -0,0 +1 @@
theme.Footbar=function(){function t(t){this.$container=$(t),this.namespace=".footbar",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{onLoad:function(){theme.Notifications&&theme.Notifications.init(this.$container),theme.ProductFootbar&&theme.ProductFootbar.init(this.$container)},onUnload:function(){this.$container.off(this.namespace),theme.Notifications&&theme.Notifications.destroy(this.$container),theme.ProductFootbar&&theme.ProductFootbar.destroy()}}),t}(),$(function(){theme.sections.register("footbar",theme.Footbar)});

View File

@@ -0,0 +1,153 @@
theme.Footer = (function() {
function Footer(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.footer';
this.onLoad();
};
Footer.prototype = $.extend({}, Section.prototype, Footer.prototype, {
_back_to_top: {
init: function(namespace) {
var _ = this,
$button = $('[data-js-button-back-to-top]'),
namespace = namespace + '.buttonToTop';
if($button.length) {
var bp = $button.attr('data-js-button-back-to-top') || 1000,
duration = function () {
return theme.animations.backtotop.scroll_duration * 1000;
},
is_animate = false,
unbind = true;
$(window).on('scroll' + namespace + ' resize' + namespace, function () {
var scroll_t = pageYOffset || Math.max($('body').scrollTop(), $('html').scrollTop());
if(!$button.attr('data-bind')) {
$button[scroll_t > bp ? 'addClass' : 'removeClass']('show');
}
if(scroll_t > bp && unbind) {
$button.removeAttr('data-bind');
}
});
$button.on('click', function(e) {
if(!is_animate) {
is_animate = true;
var bind = $button.attr('data-bind');
if(bind) {
$('html, body').velocity('stop').velocity( 'scroll' , {
offset: bind,
duration: duration(),
complete: function () {
$button.removeAttr('data-bind');
is_animate = false;
}
});
} else {
var scroll_t = pageYOffset || Math.max($('body').scrollTop(), $('html').scrollTop());
unbind = false;
$button.attr('data-bind', scroll_t);
$('html, body').velocity('stop').velocity( 'scroll' , {
offset: 0,
duration: duration(),
complete: function () {
is_animate = false;
unbind = true;
}
});
}
}
e.preventDefault();
e.stopPropagation();
return false;
});
this.destroy = function() {
$(window).unbind('scroll' + namespace + ' resize' + namespace);
$button.off();
delete _.destroy;
};
}
},
destroy: function() {
if(this.destroy) {
this.destroy();
}
}
},
_fixed: {
init: function ($footer, namespace) {
if($footer.length && $footer[0].hasAttribute('data-js-footer-fixed')) {
var $parent = $footer.parent(),
$main = $('#MainContent');
function calculate() {
var footer_height = $footer.innerHeight(),
can_fix = $main.innerHeight() > footer_height + window.innerHeight;
$footer[can_fix && theme.current.is_desktop ? 'addClass' : 'removeClass']('footer--fixed');
$footer.css({
width: theme.current.is_desktop && $parent.hasClass('container') ? $parent.width() + 'px' : ''
});
$main.css({
marginBottom: can_fix && theme.current.is_desktop ? footer_height + parseInt($footer.css('margin-top')) : ''
});
};
$window.on('theme.resize' + namespace, calculate);
calculate();
}
},
destroy: function (namespace) {
$window.unbind('theme.resize' + namespace);
}
},
onLoad: function() {
var $footer = $('.js-footer');
this._fixed.init($footer, this.namespace);
this._back_to_top.init(this.namespace);
if(theme.is_loaded) {
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
this._fixed.destroy(this.namespace);
this._back_to_top.destroy(this.namespace);
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return Footer;
})();
$(function() {
theme.sections.register('footer', theme.Footer);
});

View File

@@ -0,0 +1 @@
theme.Footer=function(){function t(t){this.$container=$(t),this.namespace=".footer",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_back_to_top:{init:function(t){var o=this,i=$("[data-js-button-back-to-top]");t+=".buttonToTop";if(i.length){var e=i.attr("data-js-button-back-to-top")||1e3,n=function(){return 1e3*theme.animations.backtotop.scroll_duration},s=!1,a=!0;$(window).on("scroll"+t+" resize"+t,function(){var t=pageYOffset||Math.max($("body").scrollTop(),$("html").scrollTop());i.attr("data-bind")||i[e<t?"addClass":"removeClass"]("show"),e<t&&a&&i.removeAttr("data-bind")}),i.on("click",function(t){if(!s){s=!0;var o=i.attr("data-bind");if(o)$("html, body").velocity("stop").velocity("scroll",{offset:o,duration:n(),complete:function(){i.removeAttr("data-bind"),s=!1}});else{var e=pageYOffset||Math.max($("body").scrollTop(),$("html").scrollTop());a=!1,i.attr("data-bind",e),$("html, body").velocity("stop").velocity("scroll",{offset:0,duration:n(),complete:function(){a=!(s=!1)}})}}return t.preventDefault(),t.stopPropagation(),!1}),this.destroy=function(){$(window).unbind("scroll"+t+" resize"+t),i.off(),delete o.destroy}}},destroy:function(){this.destroy&&this.destroy()}},_fixed:{init:function(e,t){if(e.length&&e[0].hasAttribute("data-js-footer-fixed")){var i=e.parent(),n=$("#MainContent");function o(){var t=e.innerHeight(),o=n.innerHeight()>t+window.innerHeight;e[o&&theme.current.is_desktop?"addClass":"removeClass"]("footer--fixed"),e.css({width:theme.current.is_desktop&&i.hasClass("container")?i.width()+"px":""}),n.css({marginBottom:o&&theme.current.is_desktop?t+parseInt(e.css("margin-top")):""})}$window.on("theme.resize"+t,o),o()}},destroy:function(t){$window.unbind("theme.resize"+t)}},onLoad:function(){var t=$(".js-footer");this._fixed.init(t,this.namespace),this._back_to_top.init(this.namespace),theme.is_loaded&&theme.Tooltip&&theme.Tooltip.init()},onUnload:function(){this.$container.off(this.namespace),this._fixed.destroy(this.namespace),this._back_to_top.destroy(this.namespace),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("footer",theme.Footer)});

View File

@@ -0,0 +1,78 @@
theme.Gallery = (function() {
function Gallery(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.gallery';
this.onLoad();
};
Gallery.prototype = $.extend({}, Section.prototype, Gallery.prototype, {
onLoad: function() {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
if(theme.Masonry) {
theme.Masonry.init(true);
}
}
var $gallery = $('.gallery'),
$fotorama = $gallery.find('.gallery__fotorama');
var fotorama = $fotorama.fotorama({
thumbmargin: 0,
thumbborderwidth: 0
}).data('fotorama');
$fotorama.addClass('d-none-important');
this.fotorama = fotorama;
$('.fotorama__arr--prev').append($('<i>').append(theme.Global.getIcon('006')));
$('.fotorama__arr--next').append($('<i>').append(theme.Global.getIcon('007')));
$('.fotorama__fullscreen-icon').append($('<i>').append(theme.Global.getIcon('164')));
$gallery.on('click', '.gallery__item', function () {
var index = $(this).attr('data-index'),
scroll_t = Math.max($html.scrollTop(), $body.scrollTop());
fotorama.show({
index: index,
time: 0
});
$fotorama.removeClass('d-none-important invisible position-absolute');
fotorama.requestFullScreen();
$html.scrollTop(scroll_t);
});
$fotorama.on('fotorama:fullscreenexit', function () {
$fotorama.addClass('d-none-important invisible position-absolute');
});
},
onUnload: function() {
this.$container.off(this.namespace);
if(theme.Masonry) {
theme.Masonry.destroy();
}
if(this.fotorama) {
this.fotorama.destroy();
this.fotorama = null;
}
}
});
return Gallery;
})();
$(function() {
theme.sections.register('gallery', theme.Gallery);
});

View File

@@ -0,0 +1 @@
theme.Gallery=function(){function e(e){this.$container=$(e),this.namespace=".gallery",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){theme.is_loaded&&(theme.ImagesLazyLoad.update(),theme.Masonry&&theme.Masonry.init(!0));var e=$(".gallery"),t=e.find(".gallery__fotorama"),a=t.fotorama({thumbmargin:0,thumbborderwidth:0}).data("fotorama");t.addClass("d-none-important"),this.fotorama=a,$(".fotorama__arr--prev").append($("<i>").append(theme.Global.getIcon("006"))),$(".fotorama__arr--next").append($("<i>").append(theme.Global.getIcon("007"))),$(".fotorama__fullscreen-icon").append($("<i>").append(theme.Global.getIcon("164"))),e.on("click",".gallery__item",function(){var e=$(this).attr("data-index"),o=Math.max($html.scrollTop(),$body.scrollTop());a.show({index:e,time:0}),t.removeClass("d-none-important invisible position-absolute"),a.requestFullScreen(),$html.scrollTop(o)}),t.on("fotorama:fullscreenexit",function(){t.addClass("d-none-important invisible position-absolute")})},onUnload:function(){this.$container.off(this.namespace),theme.Masonry&&theme.Masonry.destroy(),this.fotorama&&(this.fotorama.destroy(),this.fotorama=null)}}),e}(),$(function(){theme.sections.register("gallery",theme.Gallery)});

View File

@@ -0,0 +1,345 @@
theme.Header = (function() {
var selectors = {
menu: '.js-menu'
};
function Header(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.header';
this.onLoad();
};
Header.prototype = $.extend({}, Section.prototype, Header.prototype, {
_tape: function () {
var $tape = this.$container.find('.js-header-tape'),
duration = function () {
return theme.animations.header_tape.duration * 1000;
};
if($tape.length) {
var $btn_close = $tape.find('[data-js-action="close"]'),
cookie = $.cookie('header-tape'),
show_once = $tape.attr('data-js-show-once'),
delay = +$tape.attr('data-js-delay'),
cookies_life = +$tape.attr('data-js-cookies-life');
if(cookie !== 'off') {
setTimeout(function () {
$tape.removeClass('d-none');
$tape.velocity('slideDown', {
duration: duration(),
complete: function () {
$tape.removeAttr('style');
}
});
}, delay * 1000);
$btn_close.on('click', function() {
if(show_once === 'true') {
var date = new Date(),
timer = 24 * 60 * 60 * 1000 * cookies_life;
date.setTime(date.getTime() + timer);
$.cookie('header-tape', 'off', {
expires: date,
path: '/'
});
}
$(this).off();
$tape.velocity('slideUp', {
duration: duration(),
complete: function () {
$tape.remove();
}
});
});
}
this._registerHansler($btn_close);
}
},
_menu: {
init: function(namespace) {
var $menu = $(selectors.menu);
if($menu.length) {
this.$menu = $menu;
this.api = theme.Menu.init($menu, {
namespace: namespace
});
}
},
destroy: function() {
if(this.api) {
this.$menu.unbind('mouseenter');
this.api.destroy();
this.api = null;
}
if(this.handler) {
this.handler.destroy();
}
}
},
_sticky: {
init: function() {
var $sticky = $('.js-header-sticky'),
sticky = $sticky.attr('data-js-sticky'),
need_sidebar = $sticky.attr('data-js-desktop-sticky-sidebar');
if($sticky.length) {
var params = {
bp: 1024
};
if(sticky === 'desktop_and_mobile' || sticky === 'desktop') {
$.extend(params, {
desktop: {
sticky: '[data-js-desktop-sticky]',
limit: 'bottom',
fade: true,
duration: function () {
return theme.animations.sticky_header.duration * 1000;
}
}
});
if(need_sidebar === 'true') {
$.extend(params.desktop, {
move: [
{
elem: '[data-js-sticky-replace-element="logo"]',
to: '[data-js-sticky-replace-here="logo"]'
},
{
elem: '[data-js-sticky-replace-element="cart"]',
to: '[data-js-sticky-replace-here="cart"]'
},
{
elem: '[data-js-sticky-replace-element="wishlist"]',
to: '[data-js-sticky-replace-here="wishlist"]'
},
{
elem: '[data-js-sticky-replace-element="compare"]',
to: '[data-js-sticky-replace-here="compare"]'
}
]
});
}
}
if(sticky === 'desktop_and_mobile' || sticky === 'mobile') {
$.extend(params, {
mobile: {
sticky: '[data-js-mobile-sticky]',
limit: 'bottom',
fade: false
}
});
}
if(theme.StickyHeader) {
this.api = theme.StickyHeader.init($sticky, params);
}
}
},
destroy: function() {
if(this.api) {
this.api.destroy();
this.api = null;
}
}
},
_languages: {
init: function() {
var _ = this;
$(window).on('load', function() {
var $languages = $('.js-languages-list'),
$weglot = $('.weglot-container').eq(0);
if($languages.length && $weglot.length) {
var $weglot_current = $weglot.find('.wgcurrent'),
$weglot_list = $weglot.find('ul'),
$header_current = $languages.find('.header__btn-language span'),
$header_list = $languages.find('ul');
_.$header_list = $header_list;
function insert() {
var current_html = $weglot_current.find('a').html(),
$span = $('<span>').html(current_html),
$li = $('<li>').addClass('active').attr('data-l', $weglot_current.attr('data-l')).append($span);
$header_current.html(current_html);
$header_list.html('').append($li);
$weglot_list.find('li').each(function() {
var $this = $(this),
$span = $('<span>').html($this.find('a').html()),
$li = $('<li>').attr('data-l', $this.attr('data-l')).append($span);
$header_list.append($li);
});
};
function update() {
var current_code = $weglot_current.attr('data-l'),
current_html = $weglot_current.find('a').html();
$header_current.html(current_html);
$header_list.find('li').removeClass('active').filter('[data-l="' + current_code + '"]').addClass('active');
};
insert();
$languages.removeClass('d-none-important');
$header_list.on('click', 'li:not(.active)', function() {
var $this = $(this);
$weglot_list.find('li[data-l="' + $this.attr('data-l') + '"] a').trigger('click');
update();
$this.parents('[data-js-dropdown]').trigger('hide');
});
}
});
},
destroy: function() {
if(this.api) {
this.api.destroy();
this.api = null;
}
if(this.$header_list) {
this.$header_list.off();
}
}
},
_currency: {
init: function(namespace) {
var $currencies = $('.js-currencies-list');
if($currencies.length && theme.ProductCurrency) {
var namespace = namespace + '.currencies',
$current_currency = $currencies.find('[data-current-currency]'),
cookieCurrency;
try {
cookieCurrency = Currency.cookie.read();
} catch(err) {}
function cheackList(currentCurrency) {
var active_button_name;
$currencies.find('li').each(function () {
var $this = $(this);
if ($this.data('currency-code') == currentCurrency) {
$this.addClass('active');
active_button_name = $this.attr('data-button-name') || currentCurrency;
} else {
$this.removeClass('active');
}
});
return active_button_name;
};
if(cookieCurrency != null && cookieCurrency !== Currency.shopCurrency) {
var button_name = cheackList(cookieCurrency);
$current_currency.html(button_name);
}
$currencies.on('click' + namespace, 'li', function (e) {
var $this = $(this);
if(!$this.hasClass('active')) {
var newCurrency = $this.data('currency-code'),
button_name = $this.attr('data-button-name') || newCurrency;
theme.ProductCurrency.setCurrency(newCurrency);
cheackList(newCurrency);
$current_currency.html(button_name);
if(theme.current.is_desktop) {
$this.parents('[data-js-dropdown]').trigger('hide');
} else {
theme.Popups.closeByName('navigation');
}
}
e.preventDefault();
return false;
});
this.api = {
destroy: function() {
$body.unbind('click' + namespace);
}
};
}
},
destroy: function() {
if(this.api) {
this.api.destroy();
this.api = null;
}
}
},
onLoad: function() {
if(theme.is_loaded) {
theme.Position.update('menu');
theme.Position.update('currency');
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
theme.StoreLists.updateHeaderCount();
this._menu.init(this.namespace);
this._sticky.init();
this._tape();
this._languages.init();
this._currency.init(this.namespace);
},
onUnload: function() {
this.$container.off(this.namespace);
this._offHanslers();
this._menu.destroy();
this._sticky.destroy();
this._languages.init();
this._currency.destroy();
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
}
});
return Header;
})();
$(function() {
theme.sections.register('header', theme.Header);
});

View File

@@ -0,0 +1 @@
theme.Header=function(){var i=".js-menu";function t(t){this.$container=$(t),this.namespace=".header",this.onLoad()}return t.prototype=$.extend({},Section.prototype,t.prototype,{_tape:function(){var i=this.$container.find(".js-header-tape"),a=function(){return 1e3*theme.animations.header_tape.duration};if(i.length){var t=i.find('[data-js-action="close"]'),e=$.cookie("header-tape"),n=i.attr("data-js-show-once"),s=+i.attr("data-js-delay"),r=+i.attr("data-js-cookies-life");"off"!==e&&(setTimeout(function(){i.removeClass("d-none"),i.velocity("slideDown",{duration:a(),complete:function(){i.removeAttr("style")}})},1e3*s),t.on("click",function(){if("true"===n){var t=new Date,e=864e5*r;t.setTime(t.getTime()+e),$.cookie("header-tape","off",{expires:t,path:"/"})}$(this).off(),i.velocity("slideUp",{duration:a(),complete:function(){i.remove()}})})),this._registerHansler(t)}},_menu:{init:function(t){var e=$(i);e.length&&(this.$menu=e,this.api=theme.Menu.init(e,{namespace:t}))},destroy:function(){this.api&&(this.$menu.unbind("mouseenter"),this.api.destroy(),this.api=null),this.handler&&this.handler.destroy()}},_sticky:{init:function(){var t=$(".js-header-sticky"),e=t.attr("data-js-sticky"),i=t.attr("data-js-desktop-sticky-sidebar");if(t.length){var a={bp:1024};"desktop_and_mobile"!==e&&"desktop"!==e||($.extend(a,{desktop:{sticky:"[data-js-desktop-sticky]",limit:"bottom",fade:!0,duration:function(){return 1e3*theme.animations.sticky_header.duration}}}),"true"===i&&$.extend(a.desktop,{move:[{elem:'[data-js-sticky-replace-element="logo"]',to:'[data-js-sticky-replace-here="logo"]'},{elem:'[data-js-sticky-replace-element="cart"]',to:'[data-js-sticky-replace-here="cart"]'},{elem:'[data-js-sticky-replace-element="wishlist"]',to:'[data-js-sticky-replace-here="wishlist"]'},{elem:'[data-js-sticky-replace-element="compare"]',to:'[data-js-sticky-replace-here="compare"]'}]})),"desktop_and_mobile"!==e&&"mobile"!==e||$.extend(a,{mobile:{sticky:"[data-js-mobile-sticky]",limit:"bottom",fade:!1}}),theme.StickyHeader&&(this.api=theme.StickyHeader.init(t,a))}},destroy:function(){this.api&&(this.api.destroy(),this.api=null)}},_languages:{init:function(){var c=this;$(window).on("load",function(){var t,e,i,a=$(".js-languages-list"),n=$(".weglot-container").eq(0);if(a.length&&n.length){var s=n.find(".wgcurrent"),r=n.find("ul"),o=a.find(".header__btn-language span"),d=a.find("ul");c.$header_list=d,t=s.find("a").html(),e=$("<span>").html(t),i=$("<li>").addClass("active").attr("data-l",s.attr("data-l")).append(e),o.html(t),d.html("").append(i),r.find("li").each(function(){var t=$(this),e=$("<span>").html(t.find("a").html()),i=$("<li>").attr("data-l",t.attr("data-l")).append(e);d.append(i)}),a.removeClass("d-none-important"),d.on("click","li:not(.active)",function(){var t,e,i=$(this);r.find('li[data-l="'+i.attr("data-l")+'"] a').trigger("click"),t=s.attr("data-l"),e=s.find("a").html(),o.html(e),d.find("li").removeClass("active").filter('[data-l="'+t+'"]').addClass("active"),i.parents("[data-js-dropdown]").trigger("hide")})}})},destroy:function(){this.api&&(this.api.destroy(),this.api=null),this.$header_list&&this.$header_list.off()}},_currency:{init:function(t){var a=$(".js-currencies-list");if(a.length&&theme.ProductCurrency){t=t+".currencies";var e,n=a.find("[data-current-currency]");try{e=Currency.cookie.read()}catch(t){}function s(e){var i;return a.find("li").each(function(){var t=$(this);t.data("currency-code")==e?(t.addClass("active"),i=t.attr("data-button-name")||e):t.removeClass("active")}),i}if(null!=e&&e!==Currency.shopCurrency){var i=s(e);n.html(i)}a.on("click"+t,"li",function(t){var e=$(this);if(!e.hasClass("active")){var i=e.data("currency-code"),a=e.attr("data-button-name")||i;theme.ProductCurrency.setCurrency(i),s(i),n.html(a),theme.current.is_desktop?e.parents("[data-js-dropdown]").trigger("hide"):theme.Popups.closeByName("navigation")}return t.preventDefault(),!1}),this.api={destroy:function(){$body.unbind("click"+t)}}}},destroy:function(){this.api&&(this.api.destroy(),this.api=null)}},onLoad:function(){theme.is_loaded&&(theme.Position.update("menu"),theme.Position.update("currency"),theme.Tooltip&&theme.Tooltip.init()),theme.StoreLists.updateHeaderCount(),this._menu.init(this.namespace),this._sticky.init(),this._tape(),this._languages.init(),this._currency.init(this.namespace)},onUnload:function(){this.$container.off(this.namespace),this._offHanslers(),this._menu.destroy(),this._sticky.destroy(),this._languages.init(),this._currency.destroy(),theme.Tooltip&&theme.Tooltip.destroy()}}),t}(),$(function(){theme.sections.register("header",theme.Header)});

View File

@@ -0,0 +1,176 @@
theme.HomeBuilder = (function() {
function HomeBuilder(container) {
this.$container = $(container);
//var sectionId = this.$container.attr('data-section-id');
//this.settings = {};
this.namespace = '.home-builder';
this.onLoad();
};
HomeBuilder.prototype = $.extend({}, Section.prototype, HomeBuilder.prototype, {
onLoad: function() {
var _ = this,
$slider = this.$container.find('.rev_slider'),
$slider_02 = this.$container.find('.slider'),
$instafeed = this.$container.find('#instafeed'),
$promobox = this.$container.find('.promobox'),
$products = $('.product-featured');
$slider.each(function () {
var $this = $(this),
gridwidth = $this.data('gridwidth').split(','),
gridheight = $this.data('gridheight').split(','),
minheight = $this.data('minheight');
var revapi = $this.show().revolution({
sliderLayout: 'auto',
responsiveLevels: [1259, 1024, 777, 540],
gridwidth: [+gridwidth[0], +gridwidth[1], +gridwidth[2], +gridwidth[3]],
gridheight: [+gridheight[0], +gridheight[1], +gridheight[2], +gridheight[3]],
minHeight: minheight !== undefined ? minheight : false,
visibilityLevels:[1259, 1024, 777, 540],
delay: $this.data('delay') * 1000,
disableProgressBar: 'on',
lazyType: 'single',
spinner: 'none',
navigation: {
arrows: {
enable: $this.data('arrows'),
style: 'uranus',
hide_onleave: false
},
bullets: {
enable: $this.data('bullets'),
h_align: 'center',
v_align: 'bottom',
h_offset: 0,
v_offset: 74,
space: 24,
hide_onleave: false,
tmp: ''
},
touch: {
touchenabled: 'on'
}
},
parallax: {
type: 'mouse',
origo: 'slidercenter',
speed: 400,
levels: [2,4,6,8,10,12,14,16,18,20,25,30,35,40,45,50],
disable_onmobile: 'on'
}
});
_.$container.one('section.unload', function () {
revapi.revkill();
});
});
$slider_02.each(function() {
var $this = $(this),
$slick = $this.find('[data-js-slider-slick]'),
$prev = $this.find('[data-js-slider-prev]'),
$next = $this.find('[data-js-slider-next]'),
speed = +$slick.attr('data-speed') * 1000,
arrows = $slick.attr('data-arrows') === 'true' ? true : false,
bullets = $slick.attr('data-bullets') === 'true' ? true : false;
_.$slick = $slick;
$slick.on('init', function() {
$slick.removeClass('invisible');
theme.Loader.unset($slick.parent());
});
$slick.slick({
lazyLoad: false,
arrows: arrows,
prevArrow: $prev,
nextArrow: $next,
dots: bullets,
dotsClass: 'slick-dots d-none d-lg-flex flex-wrap flex-center position-absolute list-unstyled mt-35',
adaptiveHeight: true,
autoplay: true,
autoplaySpeed: speed,
fade: true,
infinite: true,
slidesToShow: 1,
slidesToScroll: 1,
rtl: theme.rtl
});
});
if($instafeed.length) {
var template = $($instafeed.find('template')[0].content).children().html();
var feed = new Instafeed({
get: 'user',
sortBy: 'most-liked',
resolution: "standard_resolution",
userId: $instafeed.data('userid'),
clientId: $instafeed.data('clientid'),
accessToken: $instafeed.data('accesstoken'),
limit: $instafeed.data('limit'),
template: template.replace(/{\\{/g, '{{').replace(/post-link/g, '{{link}}').replace(/post-image/g, '{{image}}'),
after: function () {
theme.ImagesLazyLoad.update();
}
});
$instafeed.html('').removeClass('d-none');
feed.run();
}
if(theme.Parallax && $promobox.length) {
theme.Parallax.init(_.$container.find('.js-parallax'));
}
if($promobox.length || $products.length) {
if(theme.is_loaded) {
theme.ImagesLazyLoad.update();
}
}
if($products.length) {
if(theme.is_loaded) {
theme.ProductReview.update();
if(theme.Tooltip) {
theme.Tooltip.init();
}
}
}
},
onUnload: function() {
this.$container.off(this.namespace);
this.$container.trigger('section.unload');
if(this.$slick) {
this.$slick.slick('destroy').off();
this.$slick = null;
}
if(theme.Tooltip) {
theme.Tooltip.destroy();
}
if(theme.Parallax) {
theme.Parallax.destroy(this.$container.find('.js-parallax'));
}
}
});
return HomeBuilder;
})();
$(function() {
theme.sections.register('home-builder', theme.HomeBuilder);
});

View File

@@ -0,0 +1 @@
theme.HomeBuilder=function(){function e(e){this.$container=$(e),this.namespace=".home-builder",this.onLoad()}return e.prototype=$.extend({},Section.prototype,e.prototype,{onLoad:function(){var s=this,e=this.$container.find(".rev_slider"),t=this.$container.find(".slider"),i=this.$container.find("#instafeed"),a=this.$container.find(".promobox"),n=$(".product-featured");if(e.each(function(){var e=$(this),t=e.data("gridwidth").split(","),i=e.data("gridheight").split(","),a=e.data("minheight"),n=e.show().revolution({sliderLayout:"auto",responsiveLevels:[1259,1024,777,540],gridwidth:[+t[0],+t[1],+t[2],+t[3]],gridheight:[+i[0],+i[1],+i[2],+i[3]],minHeight:void 0!==a&&a,visibilityLevels:[1259,1024,777,540],delay:1e3*e.data("delay"),disableProgressBar:"on",lazyType:"single",spinner:"none",navigation:{arrows:{enable:e.data("arrows"),style:"uranus",hide_onleave:!1},bullets:{enable:e.data("bullets"),h_align:"center",v_align:"bottom",h_offset:0,v_offset:74,space:24,hide_onleave:!1,tmp:""},touch:{touchenabled:"on"}},parallax:{type:"mouse",origo:"slidercenter",speed:400,levels:[2,4,6,8,10,12,14,16,18,20,25,30,35,40,45,50],disable_onmobile:"on"}});s.$container.one("section.unload",function(){n.revkill()})}),t.each(function(){var e=$(this),t=e.find("[data-js-slider-slick]"),i=e.find("[data-js-slider-prev]"),a=e.find("[data-js-slider-next]"),n=1e3*+t.attr("data-speed"),o="true"===t.attr("data-arrows"),l="true"===t.attr("data-bullets");(s.$slick=t).on("init",function(){t.removeClass("invisible"),theme.Loader.unset(t.parent())}),t.slick({lazyLoad:!1,arrows:o,prevArrow:i,nextArrow:a,dots:l,dotsClass:"slick-dots d-none d-lg-flex flex-wrap flex-center position-absolute list-unstyled mt-35",adaptiveHeight:!0,autoplay:!0,autoplaySpeed:n,fade:!0,infinite:!0,slidesToShow:1,slidesToScroll:1,rtl:theme.rtl})}),i.length){var o=$(i.find("template")[0].content).children().html(),l=new Instafeed({get:"user",sortBy:"most-liked",resolution:"standard_resolution",userId:i.data("userid"),clientId:i.data("clientid"),accessToken:i.data("accesstoken"),limit:i.data("limit"),template:o.replace(/{\\{/g,"{{").replace(/post-link/g,"{{link}}").replace(/post-image/g,"{{image}}"),after:function(){theme.ImagesLazyLoad.update()}});i.html("").removeClass("d-none"),l.run()}theme.Parallax&&a.length&&theme.Parallax.init(s.$container.find(".js-parallax")),(a.length||n.length)&&theme.is_loaded&&theme.ImagesLazyLoad.update(),n.length&&theme.is_loaded&&(theme.ProductReview.update(),theme.Tooltip&&theme.Tooltip.init())},onUnload:function(){this.$container.off(this.namespace),this.$container.trigger("section.unload"),this.$slick&&(this.$slick.slick("destroy").off(),this.$slick=null),theme.Tooltip&&theme.Tooltip.destroy(),theme.Parallax&&theme.Parallax.destroy(this.$container.find(".js-parallax"))}}),e}(),$(function(){theme.sections.register("home-builder",theme.HomeBuilder)});

Some files were not shown because too many files have changed in this diff Show More