/* after changes */
// if(typeof ws_top_selling_products_20 === "undefined") {
// }
// ws_top_selling_products_20 = "";
var evmwiseHost="https://wiser.expertvillagemedia.com/";
var wiser_phandle = wiser_shopID = pId= ShopId=PageName=PopPageName=CollecId=ProductCollecId=wiser_settings_array=evm_general_settings=other_settings_array=popup_other_settings=ws_data_evmemail="";
var ShopId = document.currentScript.getAttribute("data-shop-id");
var fbt_main_product_id = 0;
var __wsChkCdWdgtInit = 0;
var wsCurtLang  = Shopify.locale;
var wsContryCode = Shopify.country;
var wsLangTrans  = '';
var wsCrtDate   = '';
var wsCurrSybl   = '';
if (typeof ShopifyWsObj !== "undefined") {
	wsCurrSybl = ShopifyWsObj.wsGetMnyFrmt();
}
if(ShopId==null)ShopId=Shopify.shop;
if(Shopify.shop.includes('d2csympli') || Shopify.shop.includes('402e73-2a')){ShopId=Shopify.shop;}
var evmwiser_settings = (typeof evmWSSettings !== 'undefined')  ? JSON.stringify(evmWSSettings) : "";
var wiser_shop_domain = location.protocol + '//' + location.hostname;
(document.currentScript.getAttribute("data-productid")!=null) ? pId=document.currentScript.getAttribute("data-productid") : pId='';

(document.currentScript.getAttribute("data-page")!=null)? PageName=document.currentScript.getAttribute("data-page") : PageName='';
(document.currentScript.getAttribute("data-maincollection-id")!=null) ? CollecId=document.currentScript.getAttribute("data-maincollection-id") : CollecId='';
(document.currentScript.getAttribute("ws-data-evmpopup")!=null) ? evmWSpopup=document.currentScript.getAttribute("ws-data-evmpopup") : evmWSpopup='';
(document.currentScript.getAttribute("data-phandle")!=null) ? wiser_phandle=document.currentScript.getAttribute("data-phandle") : wiser_phandle='';
(document.currentScript.getAttribute("evm-ws-shop-id")!=null) ? wiser_shopID=document.currentScript.getAttribute("evm-ws-shop-id"):wiser_shopID='';
(document.currentScript.getAttribute("evm-ws-lang-code")!=null) ? wiser_LangCode=document.currentScript.getAttribute("evm-ws-lang-code") : wiser_LangCode='';
(document.currentScript.getAttribute("ws-data-evmemail")!=null) ? ws_data_evmemail=document.currentScript.getAttribute("ws-data-evmemail") : ws_data_evmemail='';
(document.currentScript.getAttribute("ws-blog-tags")!=null) ? wiser_blog_tags=document.currentScript.getAttribute("ws-blog-tags") : wiser_blog_tags='';
var __chk_cart = 0;
var wsChkCurrAndLang = ['8607989841','24038187','22846393','26164330573','57946374317','6794543171','11159765056','33960132652','85090828562','15383241','9225304'];
var wsRootLocl  = '';
if(PageName!='thank_you' && ShopId != 'iti-bookstore.myshopify.com') wsRootLocl  = window.Shopify.routes.root;
wsProdRoot       = wsRootLocl+'products/';

var evm_ws_cdn_url="https://d3emlu4sl5epij.cloudfront.net/evmshopifyapps/wiser/";
switch(true){
case (PageName.indexOf('product') != -1):
	PageName="product" ;
	break;

case (PageName.indexOf('collection') != -1):
	PageName="collection";
	break;
case (PageName.indexOf('customers') != -1):
	PageName="myaccount" ;
	break;
case (PageName.indexOf('page') != -1):
	if (ShopId == 'avant-gardiste-prod.myshopify.com' && PageName.indexOf('page') == 0) {
		PageName="other_plateform" ;
	}else if(PageName.indexOf('page') == 0 || PageName.indexOf('page.') == 0 || PageName.indexOf('page.pf') == 0 || PageName.indexOf('page.app') == 0 || PageName.indexOf('page.full') == 0 || PageName.indexOf('page.shogun') == 0 || PageName.indexOf('page.true') == 0 ){ 
		PageName="other_plateform" ;
	}else{
		PageName="collection" ;
	}
	break;
}
PopPageName = PageName = (PageName=="index" || PageName=="collection" || PageName=="product" || PageName=="cart" || PageName=="thank_you" || PageName=="404" || PageName=="search" || PageName=="checkout" || PageName=="other_plateform" || PageName=="myaccount" ) ? PageName : "other";
var wi_related_browse  = "";
var wi_recent_products = "";
var wsRltdBrseKey      = "wi_related_browse";
var wsRcntProdsKey     = "wi_recent_products";
var wsRltdBrseDataKey  = "wi_colbrowse_data";
var wsLtstLclStrg      = "latest_data_lcl_strg";
var wsScndLastId       = "__wsScndLast";
var wsCartStatus       = "__wsCartStatus";
if (wsChkCurrAndLang.includes(wiser_shopID) || wiser_shopID == "56915623983") {
// if (wiser_shopID == "26164330573" || wiser_shopID == "57946374317" || wiser_shopID == "6794543171" || wiser_shopID == "56915623983") {
	wsRltdBrseKey     = wsRltdBrseKey+"_"+wsCurtLang+"_"+wsContryCode;
	wsRcntProdsKey    = wsRcntProdsKey+"_"+wsCurtLang+"_"+wsContryCode;
	wsRltdBrseDataKey = wsRltdBrseDataKey+"_"+wsCurtLang+"_"+wsContryCode;
	wsLtstLclStrg     = wsLtstLclStrg+"_"+wsCurtLang+"_"+wsContryCode;
	wsScndLastId      = wsScndLastId+"_"+wsCurtLang+"_"+wsContryCode;
	// wsCartStatus      = wsCartStatus+"_"+wsCurtLang+"_"+wsContryCode;
}

if (window.localStorage.getItem(wsRltdBrseKey) !== null) {
	wi_related_browse = (window.localStorage.getItem(wsRltdBrseKey) !=  undefined) ? window.localStorage.getItem(wsRltdBrseKey) : "";
}
if (window.localStorage.getItem(wsRcntProdsKey) !== null) {
	wi_recent_products = (window.localStorage.getItem(wsRcntProdsKey) !=  undefined) ? window.localStorage.getItem(wsRcntProdsKey) : "";
}
var wi_colbrowse_data = (window.localStorage.getItem(wsRltdBrseDataKey) != undefined) ? window.localStorage.getItem(wsRltdBrseDataKey) : "";
var wi_customer_data = (window.localStorage.getItem("wi_customer") != undefined) ? window.localStorage.getItem("wi_customer") : "";
var wi_purchased_product = (window.localStorage.getItem("wi_purchased_product") != undefined) ? window.localStorage.getItem("wi_purchased_product") : "";
var wi_purchased_product_detail = (window.localStorage.getItem("wi_purchased_product_detail") != undefined) ? window.localStorage.getItem("wi_purchased_product_detail") : "";
var wsCnvtToArr  = [];
var wsAiProdsArr = [];
if(wi_related_browse != "") wsCnvtToArr  = JSON.parse(wi_related_browse);
if(wi_colbrowse_data != "") wsAiProdsArr = JSON.parse(wi_colbrowse_data);
// if (wi_colbrowse_data !== null) window.localStorage.removeItem("wi_colbrowse_data");
// if(wsAiProdsArr !== null && wsAiProdsArr.length > 0) {
// 	for (let aIdx = 0; aIdx < wsAiProdsArr.length; aIdx++) {
// 		var wsAiVariObj = wsAiProdsArr[aIdx]['variants'];
// 		if(typeof wsAiVariObj[0].node !== "undefined") {
// 			window.localStorage.removeItem("wi_colbrowse_data");
// 			break;
// 		}
// 	}
// }
if (pId && wiser_phandle) {
	function __wsCrtRecntViewLclStrg(wsKey, wsProdId) {
		let wsGetRcntLclStrg = JSON.parse(localStorage.getItem(wsKey)) || [];
		wsGetRcntLclStrg = wsGetRcntLclStrg.filter(item => item !== wsProdId);
		wsGetRcntLclStrg.unshift(wsProdId);
		wsGetRcntLclStrg = wsGetRcntLclStrg.slice(0, 20);
		localStorage.setItem(wsKey, JSON.stringify(wsGetRcntLclStrg));
	}
  	__wsCrtRecntViewLclStrg('__wsRcntViewProdsId', pId+","+wiser_phandle);
  	/* end set localstorage recently view product ids  */
}
/* end set recently view local storage */
function __wsRmvDuplProds(wsArr, wsKey) {
    const wsMapProds = new Map();
    wsArr.forEach(item => {
        if (!wsMapProds.has(item[wsKey])) {
            wsMapProds.set(item[wsKey], item);
        }
    });
    return Array.from(wsMapProds.values());
}
function __wsSetNdChkLclStrg(wsProdsArr = '') {
	var wsGetScndLastLclVal = localStorage.getItem(wsScndLastId);
	var wsAiRtnLclData = "";
	if (wsCnvtToArr.length >= 2 || wsCnvtToArr.length >= "2") {
	    let wsScndLast = wsCnvtToArr[wsCnvtToArr.length - 2];
	    if (wsScndLast != wsGetScndLastLclVal && wsGetScndLastLclVal != null) {
			var ltstDataLclStrg = localStorage.getItem(wsLtstLclStrg);
			/* ltstDataLclStrg name not recognize to other app developer */
			localStorage.setItem(wsRltdBrseDataKey, ltstDataLclStrg);
	    	localStorage.setItem(wsScndLastId, wsScndLast);
	    } else {
		    if(wsProdsArr != "") localStorage.setItem(wsLtstLclStrg, JSON.stringify(wsProdsArr));
		    localStorage.setItem(wsScndLastId, wsScndLast);
	    }
	}
	wsAiRtnLclData = (window.localStorage.getItem(wsRltdBrseDataKey) != undefined) ? window.localStorage.getItem(wsRltdBrseDataKey) : "";
	if (wsProdsArr != "" && (wsCnvtToArr.length == 1 || wsCnvtToArr.length == 2) && (wsAiRtnLclData == "" || wsAiRtnLclData == "null")) localStorage.setItem(wsRltdBrseDataKey, JSON.stringify(wsProdsArr));
	if (wsProdsArr != "" && wsAiRtnLclData == "null" && wsAiRtnLclData == "") localStorage.setItem(wsRltdBrseDataKey, JSON.stringify(wsProdsArr));
	return wsAiRtnLclData;
}
/* Async function to fetch data */
async function __wsGetProds(wsUrl) {
    try {
        let wsResponse = await fetch(wsUrl);
        if (!wsResponse.ok) {
            throw new Error('Network response was not ok ' + wsResponse.statusText);
        }
        let data = await wsResponse.json();
        return data;
    } catch (error) {
        console.error('There was a problem with the fetch operation:', error);
    }
}

/* get cart product id */
// var cartItemsVal = [];
// $.getJSON('/cart.js', function(cart) {
// 	for ($i = 0; $i < cart.items.length; $i++) {
// 		var cartItems =cart.items[$i];
// 		cartItemsVal.push(cartItems.product_id);
// 	}
// });
let cartItemsVal = [];

fetch('/cart.js')
.then(response => response.json())
.then(cart => {
	for (let i = 0; i < cart.items.length; i++) {
	  let cartItem = cart.items[i];
	  cartItemsVal.push(cartItem.product_id);
	}
})
.catch(error => console.error('Error fetching cart data:', error));


function __wsFrmtObjData(wsUniquProdsArr, wsNoOfProd, wsHideOos) {
	var wsProdsArr = [];
    var wsCnt      = 1;
	for (let idx = 0; idx < wsUniquProdsArr.length; idx++) {
		var wsRtnVal   = 0;
		if(wsHideOos == "true") wsRtnVal = 1;
		var wsProdElmt = wsUniquProdsArr[idx];
		var wsvariData = wsProdElmt.variants.slice(0, 50);
		var wsVariArr  = [];
		let wsImgCnt   = 0
		var wsImgDtls  = [];
		wsvariData.forEach(function(variElmt, idx) {
			if (variElmt.available == true || variElmt.available == 1) wsRtnVal = 1;
			var wsFeatMedia = variElmt.featured_media;
			var wsFeatImg   = variElmt.featured_image;
			wsVariArr[idx] = {
				id: variElmt.id,
				title: variElmt.title,
				available: variElmt.available,
				price: variElmt.price/100,
				compare_at_price: variElmt.compare_at_price/100,
				option1: variElmt.option1,
				option2: variElmt.option2,
				inventory_quantity: (variElmt.available) ? 1 : 0,
				image: (wsFeatMedia && wsFeatMedia.preview_image) ? wsFeatMedia.preview_image.src : "",
				featured_image: (wsFeatImg && wsFeatImg.src) ? wsFeatImg.src : ''
			};
		});

		for (let idxImg = 0; idxImg < wsProdElmt.images.length; idxImg++) {
	        (wsImgCnt < 4) ? wsImgDtls.push({ src: (wsProdElmt.images[idxImg]) ? wsProdElmt.images[idxImg] : wsProdElmt.images[0] }) : '';
	        wsImgCnt++;
      	}
		if(wsRtnVal == 1 && wsNoOfProd > wsCnt) {
			wsProdsArr[idx] = {
				id: wsProdElmt.id,
				title: wsProdElmt.title,
				handle: wsProdElmt.handle,
				tags: wsProdElmt.tags,
				product_type: wsProdElmt.type,
				published_at: wsProdElmt.published_at,
				vendor: wsProdElmt.vendor,
				price: (wsProdElmt.variants[0].price) ? wsProdElmt.variants[0].price/100 : null,
				compare_at_price: (wsProdElmt.variants[0].compare_at_price) ? wsProdElmt.variants[0].compare_at_price/100 : null,
				variants: wsVariArr,
				image: wsProdElmt.featured_image,
				images:wsImgDtls
			}
			wsCnt++;
		} else {
			break;
		}
	}
	return wsProdsArr;
}
/* get products recommendations */
async function __wsGetRecommProds(wsNoOfProd, wsHideOos) {
	if (wsCnvtToArr.length > 0) {
		var wsRecommArr        = [];
		for (var relBrwsIdx = wsCnvtToArr.length - 1; relBrwsIdx >= 0; relBrwsIdx--) {
			let wsRecommProdId = wsCnvtToArr[relBrwsIdx];
			let wsComplData = await __wsGetProds(wsRootLocl + "recommendations/products.json?product_id="+wsRecommProdId+"&limit="+wsNoOfProd+"&intent=complementary");
			if((wsComplData.products).length == 0 || (wsComplData.products).length < wsNoOfProd) {
				wsNoOfProd = wsNoOfProd - wsComplData.products.length;
				let wsRelData = await __wsGetProds(wsRootLocl + "recommendations/products.json?product_id="+wsRecommProdId+"&limit="+wsNoOfProd+"&intent=related");
				var wsMrgdArrScndIter = '';
				var wsAiMrgdData      = '';
				if (wsComplData.products.length > 0 && wsRelData.products.length > 0) {
					wsMrgdArrScndIter = [...wsComplData.products, ...wsRelData.products];
				} else if (wsComplData.products.length > 0 && wsRelData.products.length == 0) {
					wsMrgdArrScndIter = wsComplData.products;
				} else if (wsRelData.products.length > 0 && wsComplData.products.length == 0) {
					wsMrgdArrScndIter = wsRelData.products;
				}
				wsRecommArr = [ ...wsMrgdArrScndIter, ...wsRecommArr ];
				if(wsRecommArr.length >= wsNoOfProd) break;
			} else {
				wsRecommArr = wsComplData;
				if((wsCompData.products).length >= wsNoOfProd) break;
			}
		}
		const wsUniquProdsArr = __wsRmvDuplProds(wsRecommArr, 'id');
		if (wsUniquProdsArr.length > 0) {
			let wsFrmtData = __wsFrmtObjData(wsUniquProdsArr, wsNoOfProd, wsHideOos);
			if (wsFrmtData != '') __wsSetNdChkLclStrg(wsFrmtData);
		}
	}
}

/* create localstorage for checking */
async function __wsGetRcntViewProds(wsNoOfProd, wsHideOos) {
	var wsRcntViewProdIds = localStorage.getItem("__wsRcntViewProdsId");
	if (wsRcntViewProdIds != null) {
		var wsRcntProdsObjArr = [];
	    var wsProductDetails  = {};
        let wsRcntViewProdsIdArr = JSON.parse(wsRcntViewProdIds);
		for (let wsIn = 0; wsIn < wsRcntViewProdsIdArr.length; wsIn++) {
			let wsProdHndl = wsRcntViewProdsIdArr[wsIn].split(',');
			let wsRcntProds = await __wsGetProds(wsRootLocl + "products/" + wsProdHndl[1] + ".js");
			wsRcntProdsObjArr.push(wsRcntProds);
		}
		if (wsRcntProdsObjArr.length > 0) {
			let wsFrmtRcntData = __wsFrmtObjData(wsRcntProdsObjArr, wsNoOfProd, wsHideOos);
			wsProductDetails.pdetails = wsFrmtRcntData;
			localStorage.setItem(wsRcntProdsKey, JSON.stringify(wsProductDetails));
		}

	}
}
/* update cart drawer automatic if user click add to cart in wiser widget */
/* Check if any element related to the cart drawer exists */
__wsIsCartDrwrExts = (__wsElmtSltr) => {
  /* Check if any element representing the cart drawer is present in the DOM */
	const wsElmtExtsOrNot = document.querySelectorAll(__wsElmtSltr);
  /* Return true if any cart drawer element is found, otherwise return false */
	return wsElmtExtsOrNot.length > 0;
}
/* update header cart count and cart drawer in dawn theme */
__wsUpdDawnThmCartDrwrNdCnt = (__wsCartObj) => {
	if (__wsCartObj.item_count == 1) {
		$(".cart-count-bubble").remove();
		$("#cart-icon-bubble").append(`<div class="cart-count-bubble"><span aria-hidden="true">${__wsCartObj.item_count}</span><span class="visually-hidden">${__wsCartObj.item_count > 1 ? 'items' : 'item'} </span></div>`);
	}
	$(".drawer").load(location.href + " .drawer>*", "");
	setTimeout(function() {
		$(".drawer").addClass("active");
		$(".drawer").removeClass("is-empty");
	}, 500);
	$(document).on("click", "#CartDrawer-Overlay", function(e) {
		e.preventDefault();
		$("#CartDrawer").parent().removeClass("active");
	});
}
/* get cart.js object */
__wsGetCartObj = async () => {
	const wsResult = await fetch("/cart.json");
	if (wsResult.status === 200) {
		return wsResult.json();
	}
	throw new Error(`Failed to get request, Shopify returned ${wsResult.status} ${wsResult.statusText}`);
}
/* update cart drawer line items if user click add to cart in wiser */
__wsUpdLineItemsInCartDrwr = async () => {
	if(__chk_cart == 0) {
		__chk_cart = 1;
		setTimeout(function() {
			__chk_cart = 0;
		}, 3000);
    	/* check cart drawer exist or not in theme */
		let __wsOrigThmNm = window.BOOMR.themeName;
		if(__wsIsCartDrwrExts('.cart-drawer, .drawer-container, .drawer, .drawer--cart, #slide-cart')) {
			switch (__wsOrigThmNm) {
			case "Dawn":
				let __wsCartObj = await __wsGetCartObj();
				__wsUpdDawnThmCartDrwrNdCnt(__wsCartObj);
				break;
			case "Impulse":
				new theme.CartDrawer().open();
				break;
			case "Motion":
				new theme.CartDrawer();
				document.querySelector(".js-drawer-open-cart").click();
				break;
			case "Symmetry":
				document.documentElement.dispatchEvent(new CustomEvent('theme:cartchanged', { bubbles: true, cancelable: false, detail: { openDrawer: true } }));
				break;
			case "Prestige":
				document.documentElement.dispatchEvent(new CustomEvent('cart:refresh', {bubbles: true}));
				if($("#cart-drawer").attr("open") !== "open" ) $("body a[aria-controls=cart-drawer] span ").trigger("click");
				break;
			case "Stiletto":
				$(".quick-cart__container").load(location.href + " .quick-cart__container>*", "");
				setTimeout(function() { $('body header a .icon-button.icon-button-header-shopping-cart').trigger('click'); }, 1500);
				break;
			case "Gecko":
			case "Kalles":
				window.T4SThemeSP.Cart.getToFetch();
				$(".t4s-site-nav__cart svg").trigger("click");
				break;
			case "Flex":
				window.PXUTheme.jsAjaxCart.showDrawer();
				window.PXUTheme.jsAjaxCart.updateView();
				break;
			case "Ira":
				$("#slide-cart").load(location.href + " #slide-cart>*", "");
				break;
			case "Pipeline":
				document.documentElement.dispatchEvent(new CustomEvent('theme:cart:init', { bubbles: true }));
				document.dispatchEvent(new CustomEvent('theme:cart:reload', { bubbles: true }));
				if (!$(".drawer.cart__drawer").hasClass("drawer--visible")) {
					setTimeout(function() { $(".navlink.navlink--cart span.visually-hidden").trigger("click"); }, 1000);
				}
				break;
			default:
				console.log('default switch case call !!!');
				break;
			}
		}
	}
}

var wi_screen_width = (screen.width != undefined) ? screen.width : "";
var getWiserJSON = function(url, callback) {
	var xhr = new XMLHttpRequest();
	xhr.open('GET', url, true);
	xhr.responseType = 'json';
	xhr.onload = function() {
		var status = xhr.status;
		if (status === 200) {callback(null, xhr.response);} 
		else { callback(status, xhr.response);}
	};xhr.send();
}; 
var pageNameArr = new Array('index','collection','product','cart','thank_you','other','myaccount','404','search','checkout','other_plateform');
if(pageNameArr.includes(PageName)){
	if(wiser_shopID == '47486599330' || wiser_shopID == '213418043' || wiser_shopID == '8607989841' || wiser_shopID == '22846393' || wiser_shopID == '4071522377') {
		if( document.readyState !== 'loading' ) {
			window.WISER_INIT(PopPageName);
		} else {
			document.addEventListener('DOMContentLoaded', function() {
				window.WISER_INIT(PopPageName);
			}, false);
		}	
	} else {
		if( document.readyState !== 'loading' ) {
			window.WISER_INIT(PopPageName, "", 1);
			window.WISER_INIT(PopPageName, "", 2);
		}else{
			document.addEventListener('DOMContentLoaded', function() {
				window.WISER_INIT(PopPageName, "", 1);
				window.WISER_INIT(PopPageName, "", 2);
			}, false);
		}
	}

	var shopIdsArr = new Array('5080957','58813808845','62419370222','26164330573','84613431578', '6794543171','27536490561','25251971119','27936478','3654123631','57713688771','64259719381','3111190574','25995098','8596750398','11544260','26595328052','4473225334','50706186405','10832284','45965639834','4590781','25501564962','55448797236','24996511832','5439553610','56572412100','57490571461','55534747822', '55584620716', '26642481210', '54997024927', '1123418172');
	if((shopIdsArr.includes(wiser_shopID)) && (PageName!="thank_you")) {
		var wsdrawertime = 2000;
		switch (wiser_shopID){
		default:	
			setTimeout(function(){
				window.WISER_INIT('cart',1);
				$( ".evm_wiser_click_drawer" ).on( "click", function(event) {
					setTimeout(function(){
						window.WISER_INIT('cart',1);  				
					},400);
				});
			},wsdrawertime);
			break;
		}	
	}
}

/* Start remove discount localstorage after 24 hours */
var fbt_disc_apld_chk = JSON.parse(window.localStorage.getItem("fbt_disc_apld_chk"));
if (fbt_disc_apld_chk != null) {
	const ws_now_date       = new Date();
	if (ws_now_date.getTime() > fbt_disc_apld_chk.expiry) {
		window.localStorage.removeItem("fbt_disc_apld_msg");
		window.localStorage.removeItem("ws_disc_res");
		window.localStorage.removeItem("fbt_manu_bndl_disc");
		window.localStorage.removeItem("fbt_global_discount");
		window.localStorage.removeItem("fbt_disc_apld_chk");
	}
}
/* End remove discount localstorage after 24 hours */

function wsGetTime() {
	var wsCurrTime = new Date();
	return wsCurrTime.getHours() + "." + wsCurrTime.getMinutes() + "." + wsCurrTime.getSeconds();
}
function WISER_INIT(evmws_pagename="",ws_is_drawer=0, chk_request = ""){
	var evmws_is_drawer = ws_is_drawer ? ws_is_drawer : 0;
	var ifWiserInstalled = document.getElementsByTagName('head')[0].innerHTML;
	if ( ifWiserInstalled.indexOf('wiser_script.js')==-1)
	{
		ifWiserInstalled = document.getElementsByTagName('body')[0].innerHTML;
	}
	if ((ifWiserInstalled.indexOf('wiser_script.js') > -1) || (evmws_pagename == 'other_plateform') || wiser_shopID == '25608618029') {
		switch (evmws_pagename){
		case 'cart':
			getWiserJSON('/cart.js',function(err, cart) {
				var evm_wise_array = [];
				var evm_wiser_pid="";
				var flag=0;
				for (key = 0, len = cart.items.length; key < len; ++key) {
					if(wiser_shopID =='858947642' && flag==0 && (cart.items[key]['product_id']!='7696337797318' || cart.items[key]['product_id']!='2477460815930' || cart.items[key]['product_id']!='7665964646598') ){
						flag= 1;
						evm_wiser_pid = cart.items[key]['product_id'];
					}else {
						if(key == 0){
							evm_wiser_pid = cart.items[key]['product_id'];
						}	
					}			        	
					evm_wise_array.push(cart.items[key]['product_id']);          
				}
				if(wiser_shopID != '14972550'){
					if (evm_wiser_pid == "") {
						var wsChkLclPid = window.localStorage.getItem("evm_added_cart_pid");
						if(wsChkLclPid !== null) {
							evm_wiser_pid =window.localStorage.getItem("evm_added_cart_pid");
						}
					}
					if (evm_wiser_pid == "") evm_wiser_pid = pId;
					window.WISER_UPDATECALL(evm_wiser_pid,evm_wise_array,evmws_is_drawer,evmws_pagename, chk_request);
				}
			});
			break;
		default:
			window.WISER_UPDATECALL(pId,"",evmws_is_drawer,evmws_pagename, chk_request);
			break;
		}

	}
}

/* appensd html data */
function __wsApndHtmlWgtData(wsDataDtls) {
	const [wsSltrName, wsClassName, wshtmlData] = wsDataDtls;
	if(wshtmlData != "" && document.getElementsByClassName(wsSltrName)[0] && wshtmlData!= undefined) {
		var wsElmts = document.getElementsByClassName(wsSltrName);
		for (wsItems in wsElmts) {
			wsElmts[wsItems].innerHTML = `<div class="${wsClassName}" style="display:none;">${wshtmlData}</div>`;
		}
	}
}
function evmWiserJsonCallback(data,evmws_is_drawer) {
	if(data!=""){
		if(data['status']!="false"){
			var review_status = data['review_status'];
			var other_settings = data['other_widget_details'];
			other_settings_array = JSON.parse(other_settings);
			if(data['widget_version'] == '2' && PageName == 'product'){
				/*var wiser_token = other_settings_array['wiser_token'];*/
				var wiser_no_pro = other_settings_array['no_of_products'];
				var enable_browsing_history =other_settings_array['enable_browsing_history'];
			}
			if(data['widget_version'] == '2' && data['template']!= ''){
				var wiser_custom_css =other_settings_array['wiser_custom_css'];
				if (wiser_shopID != '78557086013') {
					var x = document.createElement("LINK");
					x.setAttribute("rel", "stylesheet");x.setAttribute("type", "text/css");
					x.setAttribute("href", evm_ws_cdn_url+'compressedver1.0/widget_'+data['template']+'_ver1.0.min.css');
					document.head.appendChild(x);
				}
				if(wiser_custom_css){
					var wiser_style = document.createElement('style');
					wiser_style.type = 'text/css';wiser_style.innerHTML = wiser_custom_css;
					document.getElementsByTagName('head')[0].appendChild(wiser_style);
				}
			}	

			if(evmws_is_drawer) {
				if(data["recentlyviewed"]=="true" && document.getElementsByClassName("evm-drawer-recently-viewed")[0] != undefined && wi_related_browse != "")
					__wsApndHtmlWgtData(['evm-drawer-recently-viewed', 'evm_visible_text ws_inr_cd_main', data["evmrecents"]]);

				__wsApndHtmlWgtData(['evm-drawer-recommended-products', 'evm_visible_text ws_inr_cd_main', data["recommended_products"]]);
				__wsApndHtmlWgtData(['evm-drawer-arrivals-product', 'evm_visible_text ws_inr_cd_main', data["newarrivals"]]);
				__wsApndHtmlWgtData(['evm-drawer-featured-product', 'evm_visible_text ws_inr_cd_main', data["featuredcollections"]]);
				__wsApndHtmlWgtData(['evm-drawer-popular-products', 'evm_visible_text ws_inr_cd_main', data["mostpopular"]]);
				__wsApndHtmlWgtData(['evm-drawer-trending-products', 'evm_visible_text ws_inr_cd_main', data["trendingproducts"]]);
				__wsApndHtmlWgtData(['evm-drawer-related-product', 'evm_visible_text ws_inr_cd_main', data["relatedproduct"]]);
				if(wiser_shopID == '26164330573'){
					__wsApndHtmlWgtData(['evm-search-related-viewed-browsing', 'evm_visible_text ws_inr_cd_main', data["evmrelated_browse"]]);
				} else {
					__wsApndHtmlWgtData(['evm-drawer-related-viewed-browsing', 'evm_visible_text ws_inr_cd_main', data["evmrelated_browse"]]);
				}
			} else {
				if(data["recentlyviewed"]=="true" && document.getElementsByClassName("recently-viewed")[0] != undefined && wi_related_browse != "") {
					var elems= document.getElementsByClassName("recently-viewed")[0].style.display = 'block';
					if(data['widget_version'] == '2' || (data['widget_version'] == '1' && PageName == 'thank_you' ) || (data['widget_version'] == '1' && data['wiser_snippet_version'] == '2' )) {
						__wsApndHtmlWgtData(['recently-viewed', 'evm_visible_text ws_inr_main', data["evmrecents"]]);
					}
				}
				// else if (document.getElementsByClassName("recently-viewed")[0] != undefined) {
				// 	var elems= document.getElementsByClassName("recently-viewed")[0].style.display = 'none';
				// }


				if(data["TopSellingProductsByCollection"].length>0)
				{
					for (var i = 0,j=0; i < data["TopSellingProductsByCollection"].length; i++) {										
					__wsApndHtmlWgtData(['ws_best_seller_'+data["TopSellingCollection"][i], 'evm_visible_text ws_inr_main', data["TopSellingProductsByCollection"][i]]);
					}
				}
				else
				{
					__wsApndHtmlWgtData(['evm-featured-collections-product', 'evm_visible_text ws_inr_main', data["featuredcollections"]]);
				}

				__wsApndHtmlWgtData(['evm-recommended-products', 'evm_visible_text ws_inr_main', data["recommended_products"]]);
				__wsApndHtmlWgtData(['evm-new-arrivals-product', 'evm_visible_text ws_inr_main', data["newarrivals"]]);
				//__wsApndHtmlWgtData(['evm-featured-collections-product', 'evm_visible_text ws_inr_main', data["featuredcollections"]]);
				__wsApndHtmlWgtData(['evm-recent_purchased-product', 'evm_visible_text ws_inr_main', data["recent_purchased_item"]]);
				__wsApndHtmlWgtData(['evm-recent_purchased_recomm-product', 'evm_visible_text ws_inr_main', data["recent_purchased_recomm_item"]]);
				__wsApndHtmlWgtData(['evm-most-popular-products', 'evm_visible_text ws_inr_main', data["mostpopular"]]);
				__wsApndHtmlWgtData(['trending-products', 'evm_visible_text ws_inr_main', data["trendingproducts"]]);
				__wsApndHtmlWgtData(['evm-related-product', 'evm_visible_text ws_inr_main', data["relatedproduct"]]);
				__wsApndHtmlWgtData(['evm-related-viewed-browsing', 'evm_visible_text ws_inr_main', data["evmrelated_browse"]]);
				__wsApndHtmlWgtData(['evm-related-product', 'evm_visible_text ws_inr_main', data["evm_related_by_title"]]);
				if(data["alsobought"]!=""){
					var x = document.createElement("LINK");
					if(data['alsobought_template'] != 'widget_design'){
						x.setAttribute("rel", "stylesheet");
						x.setAttribute("type", "text/css");
						// x.setAttribute("href", "https://wiser.expertvillagemedia.com/assets/evm_backend/css/compressed/widget_alsobought_template2_ver1.0.min.css");
						x.setAttribute("href", evm_ws_cdn_url+'compressedver1.0/widget_'+data['alsobought_template']+'_ver1.0.min.css');
						
						document.head.appendChild(x);
						var alsobought_selector = other_settings_array['alsobought_selector']; 
						if(data['create_date']>='2024-05-01')
						{
							if(document.getElementsByClassName("evm-also-bought-products")[0])
							{
								var wiserelems = document.getElementsByClassName('evm-also-bought-products'), wiserwid;
								for (wiserwid in wiserelems){
									wiserelems[wiserwid].innerHTML = "<div class='evm_visible_text ws_fbt_inr_main' style='display:none;'>"+data["alsobought"]+"</div>";
								}
							}
							else if(alsobought_selector == 'shopify-section-product-template'){
							//	var alsobought_array = [".product-single", ".section.product_section", ".product-single__content", "#productHead", "#ProductSection--product-template", "#shopify-section-product-template",".product--template",".evm-also-bought-products"];
								var alsobought_array = [".product", ".product-single", ".section.product_section", ".product-single__content", "#productHead", "#ProductSection--product-template", "#shopify-section-product-template",".product--template",".evm-also-bought-products",".Product__Wrapper",".product__page",".product-detail",".grid--product-images--partial",".product__section-container",".product-grid__container"];
								for (i = 0; i < alsobought_array.length; i++) {
									var html_also = $(alsobought_array[i]).html();
									if(html_also != undefined && html_also !=""){

										$(alsobought_array[i]).eq(0).after("<div class='evm-also-bought evm_visible_text ws_fbt_inr_main' style='display:none;'>"+data["alsobought"]+"</div>");
										break;
									}
								}
							}else if(document.getElementById(alsobought_selector)){
								document.getElementById(alsobought_selector).insertAdjacentHTML('afterend', "<div class='evm-also-bought evm_visible_text ws_fbt_inr_main' style='display:none;'>"+data["alsobought"]+"</div>");
							}
						} else {
							if(alsobought_selector == 'shopify-section-product-template'){
							//	var alsobought_array = [".product-single", ".section.product_section", ".product-single__content", "#productHead", "#ProductSection--product-template", "#shopify-section-product-template",".product--template",".evm-also-bought-products"];
								var alsobought_array = [".product", ".product-single", ".section.product_section", ".product-single__content", "#productHead", "#ProductSection--product-template", "#shopify-section-product-template",".product--template",".evm-also-bought-products",".Product__Wrapper",".product__page",".product-detail",".grid--product-images--partial",".product__section-container",".product-grid__container"];
								for (i = 0; i < alsobought_array.length; i++) {
									var html_also = $(alsobought_array[i]).html();
									if(html_also != undefined && html_also !=""){

										$(alsobought_array[i]).eq(0).after("<div class='evm-also-bought evm_visible_text ws_fbt_inr_main' style='display:none;'>"+data["alsobought"]+"</div>");
										break;
									}
								}
							}else if(document.getElementById(alsobought_selector)){
								document.getElementById(alsobought_selector).insertAdjacentHTML('afterend', "<div class='evm-also-bought evm_visible_text ws_fbt_inr_main' style='display:none;'>"+data["alsobought"]+"</div>");
							}else if(document.getElementsByClassName(alsobought_selector)[0]){
								$('.'+alsobought_selector).after("<div class='evm-also-bought evm_visible_text ws_fbt_inr_main' style='display:none;'>"+data["alsobought"]+"</div>");
							}
						}

					}else if(document.getElementsByClassName("evm-also-bought-products")[0]){
						var wiserelems = document.getElementsByClassName('evm-also-bought-products'), wiserwid;
						for (wiserwid in wiserelems){
							wiserelems[wiserwid].innerHTML = "<div class='evm_visible_text ws_inr_main' style='display:none;'>"+data["alsobought"]+"</div>";
						}
					}
				}
			}
			/**Shopify review **/
			if(review_status == "true") {
				var jqcall=document.createElement('script');
				jqcall.src= "https://productreviews.shopifycdn.com/assets/v4/spr.js?shop="+ ShopId;
				document.getElementsByTagName('head')[0].appendChild(jqcall); 
			}

			if(review_status == "stampedio_review"){
				setTimeout(function(){
					StampedFn.loadBadges();				
				},400);				
			}

			if(review_status == "judgeme_review"){
				var evm_review_key = data['evm_review_key'];
				evmJudgemeWidget(ShopId,evm_review_key);
			}	
			/**Shopify review **/
			switch (data["product_view"]){
			case 'owl-carousel':
			case 'wiser-carousel':
			case 'slider':				
				var widget_version = data['widget_version'];
				var products_per_slider = data['widget_version'] == "2" ? data['products_per_slider'] : "";
				var mobile_products_per_slider = data['mobile_products_per_slider'];
				var ipad_products_per_slider = data['ipad_products_per_slider'];
					var slidecall = document.createElement('script');
					// slidecall.src=evm_ws_cdn_url+"slider.js";
					slidecall.src = evmwiseHost+"assets/js/slider.js?v="+wsGetTime();
					// slidecall.src=evmwiseHost+"assets/js/slider_unminified.js?v="+wsGetTime();
					slidecall.setAttribute("products_per_slider", products_per_slider);
					slidecall.setAttribute("mobile_products_per_slider", mobile_products_per_slider);
					slidecall.setAttribute("ipad_products_per_slider", ipad_products_per_slider);
					slidecall.setAttribute("slider_template", data['template']);
					slidecall.setAttribute("evm_sid", wiser_shopID);
					slidecall.setAttribute("evm_shopname", ShopId);
					slidecall.setAttribute("widget_version", widget_version);
					slidecall.setAttribute("page_name", PageName);
					document.getElementsByTagName('head')[0].appendChild(slidecall);
					if(review_status == "yotpo_review"){
						var yotpoApiKey = data['evm_review_key'];
						evmYotpoWidget(wiser_shopID,yotpoApiKey);
					}
					evmWiserOnloadCall(other_settings);
				setTimeout(function() {
					$(".evm_wiser_heading, .evm_visible_text").show();
				},400);
				break;
			default:
				// setTimeout(function(){
					if(wiser_shopID == '25217433647' || wiser_shopID == '4071522377') {
						$=jQuery.noConflict();
					}
					$(".evm_wiser_heading ,.evm_visible_text").show();
					if(review_status == "yotpo_review"){
						var yotpoApiKey = data['evm_review_key'];
							evmYotpoWidget(wiser_shopID,yotpoApiKey);
						}
					evmWiserOnloadCall(other_settings);					
				// },500);
				setTimeout(function() {
					$(".evm_wiser_heading, .evm_visible_text").show();
				},400);
				break;
			}

			/* create recently view and generate_browsing_related */
			if(data['widget_version'] == '2' && PageName == 'product') {

				var wsNoOfProds   = parseInt(other_settings_array['no_of_products'])+5;
				var wsHideOos     = other_settings_array['hide_ofs'];
				var wsRltdBrwsSts = other_settings_array['enable_browsing_history'];
				var wsRcntViewSts = other_settings_array['recently_viewed_status'];
			}
			if(data['widget_version'] == '2' && PageName == 'product' && (wsRltdBrwsSts || wsRcntViewSts == 'true')) {
				switch(other_settings_array['wiser_is_quickview']) {
				case 1:
					// var evmbrowseurl = evmwiseHost+"wisercustom/generate_browsing_related";
					if (wsRltdBrwsSts == "true" || wsRltdBrwsSts == 1)
					__wsGetRecommProds(wsNoOfProds, wsHideOos);
					if(wsRcntViewSts == 'true')
					__wsGetRcntViewProds(wsNoOfProds, wsHideOos);
					break;
				default:
					if (wsRltdBrwsSts == "true" || wsRltdBrwsSts == 1)
					__wsGetRecommProds(wsNoOfProds, wsHideOos);
					if(wsRcntViewSts == 'true')
					__wsGetRcntViewProds(wsNoOfProds, wsHideOos);
					break;
				}
			}
		}
	}
}

function evmWiserProductClick(){
	$(".checkurl").click(function(event) {
		event.preventDefault();
		var widget   = $(this).attr("wiser-widget");
		var template = $(this).attr("wiser-template");
		var wspage   = $(this).attr("wiser-page");
		wspage       = (wspage == undefined) ? PageName : wspage;

		var addtocart = $(this).attr("wiser-addcart");
		addtocart = addtocart == undefined ? 0 : 1;
		if ($(this).attr("data_id")) {
			var pid = $(this).attr("data_id");
		} else if ($(this).attr("data_prod_id")) {
			var pid = $(this).attr("data_prod_id");
		} else {
			var pid = $(this).attr("data-id");
		}

		pid = parseInt(pid);
		var siteurl= $(this).attr("href")
		evmProductClickProcess(pid,'yes', siteurl, "", widget, template, addtocart, wspage);
	});
}
function evmProductClickProcess(proid,is_redirect,siteurl="",multiple="",widget="",template="",addtocart=0,wspagename=""){	
	if(multiple == "yes"){var parray = proid;}else{var parray = new Array();parray[0] = proid;}	
	var i;
	var clickwspagename = wspagename ? wspagename : PageName;
	for (i = 0; i < parray.length; i++) {
		var pid=parray[i];
		if(window.localStorage.getItem("evm_wiser_productids")==undefined){
			var productIds = [];
			var evm_wiser_page = [];
			var evm_wiser_template = [];
			var evm_wiser_widget = [];
			var evm_add_to_cart = [];
			productIds.push(pid);
			evm_wiser_page.push(clickwspagename);
			evm_wiser_template.push(template);
			evm_wiser_widget.push(widget);
			evm_add_to_cart.push(addtocart);
		}else{
			var productIds = window.localStorage.getItem("evm_wiser_productids");
			productIds = JSON.parse(productIds);
			var evm_wiser_page = window.localStorage.getItem("evm_wiser_page");
			evm_wiser_page = JSON.parse(evm_wiser_page);
			var evm_wiser_template = window.localStorage.getItem("evm_wiser_template");
			evm_wiser_template = JSON.parse(evm_wiser_template);
			var evm_wiser_widget = window.localStorage.getItem("evm_wiser_widget");
			evm_wiser_widget = JSON.parse(evm_wiser_widget);
			var evm_add_to_cart = window.localStorage.getItem("evm_add_to_cart");
			evm_add_to_cart = JSON.parse(evm_add_to_cart);	    	
			var ws_idex = productIds.indexOf(pid);
			if(ws_idex == -1) {
				productIds.push(pid);
				evm_wiser_page.push(clickwspagename);
				evm_wiser_template.push(template);
				evm_wiser_widget.push(widget);
				evm_add_to_cart.push(addtocart);
			} else {
				productIds[ws_idex] = pid;
				evm_wiser_page[ws_idex] = clickwspagename;
				evm_wiser_template[ws_idex] =  template;
				evm_wiser_widget[ws_idex] = widget;
				if (evm_add_to_cart == null) evm_add_to_cart = [];
				evm_add_to_cart[ws_idex] = addtocart;
			}
		}
		if(productIds.length > 0){
			window.localStorage.setItem("evm_wiser_productids",JSON.stringify(productIds));
			window.localStorage.setItem("evm_wiser_page",JSON.stringify(evm_wiser_page));
			window.localStorage.setItem("evm_wiser_template",JSON.stringify(evm_wiser_template));
			window.localStorage.setItem("evm_wiser_widget",JSON.stringify(evm_wiser_widget));
			window.localStorage.setItem("evm_add_to_cart",JSON.stringify(evm_add_to_cart));			
		}
	}    
	var url=evmwiseHost+"app_lang/embed_clicks?shop="+ShopId+"&clicks=1&pagename="+clickwspagename+"&addtocart="+addtocart+"&evm_widget="+widget+"&evm_template="+template;
	var clickscall=document.createElement('script');
	clickscall.src=url
	document.getElementsByTagName('body')[0].appendChild(clickscall);
	if(is_redirect == 'yes'){
		if(wiser_shopID=='30626807940'){window.open(siteurl, '_blank');}
		else
			{window.location.href=siteurl;}		
	}		
}
function evmPopupClickProcess(evm_ws_popup_id,proid,multiple="",widget="",template="",addtocart=0,is_redirect,siteurl=""){
	var evm_ws_popup_id = parseInt(evm_ws_popup_id);	
	if(multiple == "yes"){var parray = proid;}else{var parray = new Array();parray[0] = proid;}	
	var i;
	for (i = 0; i < parray.length; i++) {
		var pid=parray[i];
		if(window.localStorage.getItem("evm_popup_ws_productids")==undefined){
			var productIds = [];
			var evm_wiser_page = [];
			var evm_wiser_template = [];
			var evm_wiser_widget = [];
			var evm_add_to_cart = [];
			var evm_popupid = [];
			productIds.push(pid);
			evm_wiser_page.push(PopPageName);
			evm_wiser_template.push(template);
			evm_wiser_widget.push(widget);
			evm_add_to_cart.push(addtocart);
			evm_popupid.push(evm_ws_popup_id);
		}else{
			var productIds = window.localStorage.getItem("evm_popup_ws_productids");
			productIds = JSON.parse(productIds);
			var evm_wiser_page = window.localStorage.getItem("evm_popup_ws_page");
			evm_wiser_page = JSON.parse(evm_wiser_page);
			var evm_wiser_template = window.localStorage.getItem("evm_popup_ws_template");
			evm_wiser_template = JSON.parse(evm_wiser_template);
			var evm_wiser_widget = window.localStorage.getItem("evm_popup_ws_widget");
			evm_wiser_widget = JSON.parse(evm_wiser_widget);
			var evm_add_to_cart = window.localStorage.getItem("evm_popup_ws_addtocart");
			evm_add_to_cart = JSON.parse(evm_add_to_cart);	 
			var evm_popupid = window.localStorage.getItem("evm_popup_ws_popupids");
			evm_popupid = JSON.parse(evm_popupid);	   	
			var ws_idex = productIds.indexOf(pid);
			if(ws_idex == -1)
			{
				productIds.push(pid);
				evm_wiser_page.push(PopPageName);
				evm_wiser_template.push(template);
				evm_wiser_widget.push(widget);
				evm_add_to_cart.push(addtocart);
				evm_popupid.push(evm_ws_popup_id);
			}else{
				productIds[ws_idex] = pid ;
				evm_wiser_page[ws_idex] = PopPageName ;
				evm_wiser_template[ws_idex] =  template;
				evm_wiser_widget[ws_idex] = widget ;
				evm_add_to_cart[ws_idex] = addtocart;
				evm_popupid[ws_idex] = evm_ws_popup_id;
			}    
		}
		if(productIds.length > 0){
			window.localStorage.setItem("evm_popup_ws_productids",JSON.stringify(productIds));
			window.localStorage.setItem("evm_popup_ws_page",JSON.stringify(evm_wiser_page));
			window.localStorage.setItem("evm_popup_ws_template",JSON.stringify(evm_wiser_template));
			window.localStorage.setItem("evm_popup_ws_widget",JSON.stringify(evm_wiser_widget));
			window.localStorage.setItem("evm_popup_ws_addtocart",JSON.stringify(evm_add_to_cart));	
			window.localStorage.setItem("evm_popup_ws_popupids",JSON.stringify(evm_popupid));	

		}
	}    
	var url=evmwiseHost+"popup/generateClicks?shop="+ShopId+"&clicks=1&pagename="+PopPageName+"&addtocart="+addtocart+"&evm_popup_id="+evm_ws_popup_id;
	var clickscall=document.createElement('script');
	clickscall.src=url
	document.getElementsByTagName('body')[0].appendChild(clickscall);
	if(is_redirect == 'yes'){window.location.href=siteurl;}	
}


function evm_addtocart(redirect,product_id,random,event,widget,template,wspage="",product_handle="") {
	var addtocart=1;
	var qty = $(".evm_wiser_qty_"+product_id+"_"+random).val();
	var varnameid = $(".evm_wiser_product_"+product_id+"_"+random).val();
	var varid= $(".evm_wiser_product_"+product_id+"_"+random).val();
	if (typeof qty === 'undefined') qty = 1;
	if (varid == null || varid == 'undefined') varid= $(".evm_wiser_product_"+product_id+"_"+random+' option').val();
	var vardetails = [];
	jQuery.getJSON('/products/'+ product_handle +'.js', function(product) {
		vardetailsdata = product.variants;
		jQuery.each(vardetailsdata, function (key, val) {
			if(val['id'] == varid)
			{
				vardetails =val;
			}
		});
	});
	var slide_cart_integrate = wiser_settings_array.slide_cart_integrate;
	evmProductClickProcess(product_id,'no',"","",widget,template,addtocart,wspage);
	var ws_shop_arr = ['78374109475','56570937418','6256381','51394281658','25028738','75788517659','1352794214','82141315355','48328081570','22599949','67684892891','62122098848'];
	if (ws_shop_arr.includes(wiser_shopID)) {
		window.open(wiser_shop_domain+"/products/"+product_handle,"_self");
		return false;
	}

	if (wiser_shopID == '54929686759') {
		setTimeout(function(){
					if(wiser_settings_array.after_ATC_activity != undefined && wiser_settings_array.after_ATC_activity != ""){
						var afterATCACT = wiser_settings_array.after_ATC_activity;
						eval(afterATCACT);									
					}
				}, 100);
		return false;
	}

		

		var evm_jqxhr = jQuery.post('/cart/add.js',{quantity: qty,  id: varid });  
		evm_jqxhr.always(function(data) {
		var res = (data.responseText == undefined) ? "" : JSON.parse(data.responseText) ;
		if(res == "" || res.status== undefined){
			if(PageName == 'cart' && wiser_shopID != '54997024927' && wiser_shopID != '26642481210' && wiser_shopID != '55584620716' && wiser_shopID != '60382118139' && wiser_shopID != '5080957' &&  wiser_shopID != '55056498731' && wiser_shopID != '2304865' && wiser_shopID !='56570937418' &&  wiser_shopID != '43025170587' && wiser_shopID != '58813808845' && wiser_shopID != '62419370222' && wiser_shopID != '27536490561' && wiser_shopID != '25251971119' && wiser_shopID != '27936478' && wiser_shopID != '3654123631' && wiser_shopID != '64259719381' && wiser_shopID != '57713688771' && wiser_shopID != '3111190574' && wiser_shopID != '25995098' && wiser_shopID != '8596750398' && wiser_shopID != '11544260' &&  wiser_shopID != '4473225334' && wiser_shopID != '50706186405' && wiser_shopID !='55448797236' && wiser_shopID != '10832284' && wiser_shopID !='22455667' && wiser_shopID != '45965639834' && wiser_shopID !='25501564962' && wiser_shopID !='56572412100' && wiser_shopID != '14972550' && wiser_shopID != '26595328052' && wiser_shopID != '10832284' && wiser_shopID != '57490571461' && wiser_shopID != '55534747822' && wiser_shopID != '53956214984' && wiser_shopID != '26164330573' && wiser_shopID != '84613431578' && wiser_shopID != '6794543171' && wiser_shopID != '1123418172' && wiser_shopID != '59407499364'){location.reload();}
			if(redirect == "true"){window.location.href = wiser_shop_domain+"/cart";}else{
				//SET LOCAL STORAGE FOR CART PAGE PID
				window.localStorage.setItem("evm_added_cart_pid",product_id);
				getWiserJSON('/cart.js',function(err, cart) {
					var newCount = cart.item_count;
					evm_cart_count(newCount);
				});	

				$(".evm_side_cart_wiser").trigger("click");          			
				if(slide_cart_integrate == "true"){ 
					setTimeout(function() {
						$(".slidecart-container").trigger("open");         
					},1000);
				}

				if(other_settings_array['is_ATC_msg_show'] == "true"){
					if(other_settings_array['addcart_confirmation_msg']==undefined || other_settings_array['addcart_confirmation_msg']=='undefined')
					{
						var ws_atcct = (wsLangTrans != null && wsLangTrans.ws_atcct != '' && wsLangTrans.ws_atcct != 'undefined' && wsLangTrans.ws_atcct != undefined) ? wsLangTrans.ws_atcct : 'Added to cart!';
						var ws_vc    = (wsLangTrans != null && wsLangTrans.ws_vc != '' && wsLangTrans.ws_vc != 'undefined' && wsLangTrans.ws_vc != undefined) ? wsLangTrans.ws_vc : 'View cart';
						var ws_or    = (wsLangTrans != null && wsLangTrans.ws_or != '' && wsLangTrans.ws_or != 'undefined' && wsLangTrans.ws_or != undefined) ? wsLangTrans.ws_or : 'or';
						var ws_csh   = (wsLangTrans != null && wsLangTrans.ws_csh != '' && wsLangTrans.ws_csh != 'undefined' && wsLangTrans.ws_csh != undefined) ? wsLangTrans.ws_csh : 'Continue shopping';
						$(".ws-card_success_"+random).html('<i class="fa fa-check"></i>'+ ws_atcct +'</br><a href="/cart">'+ws_vc+'</a> '+ws_or+' <a style="cursor:pointer;" onclick="evmWiserHideContinue('+random+')">'+ws_csh+'</a>.');
					}	
					else
					{
						var ws_atcct = (wsLangTrans != null && wsLangTrans.ws_atcct != '' && wsLangTrans.ws_atcct != 'undefined' && wsLangTrans.ws_atcct != undefined) ? wsLangTrans.ws_atcct : other_settings_array['addcart_confirmation_msg'];
						var ws_vc    = (wsLangTrans != null && wsLangTrans.ws_vc != '' && wsLangTrans.ws_vc != 'undefined' && wsLangTrans.ws_vc != undefined) ? wsLangTrans.ws_vc :other_settings_array['viewcart_confirmation_msg'];
						var ws_or    = (wsLangTrans != null && wsLangTrans.ws_or != '' && wsLangTrans.ws_or != 'undefined' && wsLangTrans.ws_or != undefined) ? wsLangTrans.ws_or : other_settings_array['or_confirmation_msg'];
						var ws_csh   = (wsLangTrans != null && wsLangTrans.ws_csh != '' && wsLangTrans.ws_csh != 'undefined' && wsLangTrans.ws_csh != undefined) ? wsLangTrans.ws_csh : other_settings_array['countinue_confirmation_msg'];

						$(".ws-card_success_"+random).html('<i class="fa fa-check"></i> '+ws_atcct+'</br><a href="/cart">'+ws_vc+'</a> '+ws_or+' <a style="cursor:pointer;" onclick="evmWiserHideContinue('+random+')">'+ws_csh+'</a>');

					}
				}
				setTimeout(function() {
					if(wiser_settings_array.after_ATC_activity != undefined && wiser_settings_array.after_ATC_activity != ""){
						var afterATCACT = wiser_settings_array.after_ATC_activity;
						eval(afterATCACT);									
					}
				}, 100);


				setTimeout(function(){ $(".ws-card_success_"+random).html(""); }, 3000);
			}
			/* this code use if wiser cart drawer enabled no any issue created by this code */
			let __wsCartStatus = localStorage.getItem(wsCartStatus);
			if (__wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 1 && __wsChkCdWdgtInit == 0) {
				__wsUpdCartDrawer(); /* call this function when prouct added to cart if you got success */
				__wsChkCdWdgtInit = 1;
				setTimeout(function() { __wsChkCdWdgtInit = 0; }, 3000);
			}
			__wsAttrGetCartData('calling from wiser widgets at the time of Add to Cart');/* call this function for attributes when prouct added to cart if you got success */
			/* end this code use if wiser cart drawer enabled no any issue created by this code */
			if(wsCrtDate > "2024-06-24" && __wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 0) __wsUpdLineItemsInCartDrwr();
		}	
	});
	evm_jqxhr.fail(function(data) {
		var responsetext = data.responseText;
		var res = (responsetext == undefined) ? "" : JSON.parse(responsetext);
		if(res == "" || res.status=='422'){
			var prod_out_of_stock = (wsLangTrans != null && wsLangTrans.ws_poofs != '') ? wsLangTrans.ws_poofs : other_settings_array['CTA_outofstockmsg'];
			if(wsLangTrans.ws_poofs == undefined || wsLangTrans.ws_poofs == 'undefined'){
				prod_out_of_stock = other_settings_array['CTA_outofstockmsg'];
			}
			$(".ws-card_success_"+random).html('<i class="fa fa-close"></i> '+prod_out_of_stock);
			setTimeout(function(){ $(".ws-card_success_"+random).html(""); }, 3000);
		}	
	});
}


function evmWSPopupAddtocart(redirect,product_id,product_handle='',random,event,widget,template,evm_ws_popup_id){
	var addtocart=1;
	var qty = $(".evm_wiser_qty_"+product_id+"_"+random).val();
	var varid = $(".evm_wiser_product_"+product_id+"_"+random).val();
	var slide_cart_integrate = wiser_settings_array.slide_cart_integrate;
	evmPopupClickProcess(evm_ws_popup_id,product_id,"",widget,template,addtocart,'no',"");
	var evm_jqxhr = $.post('/cart/add.js',
		{  quantity: qty,  id: varid });  
	evm_jqxhr.always(function(data) {
		var responsetext = data.responseText;
		var res = (responsetext == undefined) ? "" : JSON.parse(responsetext);			
		if(res == "" || res.status== undefined){
			if(popup_other_settings['popup_after_atc_js'] != undefined && popup_other_settings['popup_after_atc_js'] != ""){
				var afterATCACT = popup_other_settings['popup_after_atc_js'];
				eval(afterATCACT);
			}	

			if(redirect == "true"){window.location.href = wiser_shop_domain+"/cart";}else{
				window.localStorage.setItem("evm_added_cart_pid",product_id);
				evm_cart_count(1);
				$(".evm_side_cart_wiser").trigger("click");          			

// if(slide_cart_integrate == "true"){  window.SLIDECART_UPDATE(function() {window.SLIDECART_OPEN()});}	
				if(slide_cart_integrate == "true"){  setTimeout(function() {
					$(".slidecart-container").trigger("open");         
				},1000);}

					var ws_atcct = (wsLangTrans != null && wsLangTrans.ws_atcct != '' && wsLangTrans.ws_atcct != 'undefined' && wsLangTrans.ws_atcct != undefined) ? wsLangTrans.ws_atcct :other_settings_array['addcart_confirmation_msg'];
					var ws_vc    = (wsLangTrans != null && wsLangTrans.ws_vc != '' && wsLangTrans.ws_vc != 'undefined' && wsLangTrans.ws_vc != undefined) ? wsLangTrans.ws_vc :other_settings_array['viewcart_confirmation_msg'];
					var ws_or    = (wsLangTrans != null && wsLangTrans.ws_or != '' && wsLangTrans.ws_or != 'undefined' && wsLangTrans.ws_or != undefined) ? wsLangTrans.ws_or : other_settings_array['or_confirmation_msg'];
					var ws_csh   = (wsLangTrans != null && wsLangTrans.ws_csh != '' && wsLangTrans.ws_csh != 'undefined' && wsLangTrans.ws_csh != undefined) ? wsLangTrans.ws_csh : other_settings_array['countinue_confirmation_msg'];

					$(".ws-card_success_"+random).html('<i class="fa fa-check"></i> '+ws_atcct+'</br><a href="/cart">'+ws_vc+'</a> '+ws_or+' <a style="cursor:pointer;" onclick="evmWiserHideContinue('+random+')">'+ws_csh+'</a>');


					setTimeout(function(){ 
						if(wiser_settings_array.after_ATC_activity != undefined && wiser_settings_array.after_ATC_activity != ""){
							var afterATCACT = wiser_settings_array.after_ATC_activity;
							eval(afterATCACT);

						}

					}, 100);
					setTimeout(function(){ $(".ws-card_success_"+random).html(""); }, 3000);
				}
				/* this code use if wiser cart drawer enabled no any issue created by this code */
				let __wsCartStatus = localStorage.getItem(wsCartStatus);
				if (__wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 1 && __wsChkCdWdgtInit == 0) {
					__wsUpdCartDrawer(); /* call this function when prouct added to cart if you got success */
					__wsChkCdWdgtInit = 1;
					setTimeout(function() { __wsChkCdWdgtInit = 0; }, 3000);
				}
				__wsAttrGetCartData('calling from wiser widgets at the time of Add to Cart');/* call this function for attributes when prouct added to cart if you got success */
				/* end this code use if wiser cart drawer enabled no any issue created by this code */


				if(wsCrtDate > "2024-06-24" && __wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 0) __wsUpdLineItemsInCartDrwr();
			}
		});
	evm_jqxhr.fail(function(data) {
		var responsetext = data.responseText;
		var res = (responsetext == undefined) ? "" : JSON.parse(responsetext);
		if(res == "" || res.status=='422'){
			var prod_out_of_stock = (wsLangTrans != null && wsLangTrans.ws_poofs != '') ? wsLangTrans.ws_poofs : other_settings_array['CTA_outofstockmsg'];
			if(wsLangTrans.ws_poofs == undefined || wsLangTrans.ws_poofs == 'undefined'){
				prod_out_of_stock = other_settings_array['CTA_outofstockmsg'];
			}
			$(".ws-card_success_"+random).html('<i class="fa fa-close"></i>'+prod_out_of_stock);
			setTimeout(function(){ $(".ws-card_success_"+random).html(""); }, 3000);
		}	
	});
}

function evm_cart_count(qty){
/**** Supply,Debut,Minimal,Blockshop theme****/
	var value_count = parseInt(qty);
	$("#CartCount span:first, .header__cart-count span:first, #Cartcount, .cart-counter, .cart-count, .cart-count-bubble span:first, .number-wrapper .number,  .header-cart__count, .cart-link .cartCountN, .cart-button span:first, #cartCount, .cart_count, .evm_wiser_count").text(value_count);
	/**** Supply,Debut theme****/
	$(".cart-count").removeClass("hidden-count"); //Minimal
	$(".number-wrapper,#CartCount").removeClass("hide"); //Blockshop
	$(".cartCount").removeClass("cartEmpty"); //Impulse
	$(".header__cart-count").addClass('visible'); //Ira	
}


function evm_alsobought_addtocart(event,widget,template,wspage="") {
	var string="";	
	var addtocart=1;	
	var i=0, product_id = 0;
	var slide_cart_integrate = wiser_settings_array.slide_cart_integrate;
	var enable_atc_redirect = wiser_settings_array.enable_atc_redirect;
	$(".evm-wi-fbt-atc").attr('disabled', 'disabled');
	getWiserJSON('/cart.js',function(err, cart) {
		var exist_count = cart.item_count;
		var newArr = {};
		for (key = 0, len = cart.items.length; key < len; ++key) {
			var pid =  cart.items[key]['variant_id'];
			var quantity = cart.items[key]['quantity'];
			newArr[pid] = quantity;           
		}
		var product_array = [];
		$(".evm_alsobought_wiser_product,select.avl").each(function() {
			var pid = $(this).attr("bought_product");
			pid = parseInt(pid);
			var varid = $(this).val();
			var qunt = 1;
			if((wiser_shopID == '26705231943') && (i == 0) && (newArr[varid])){
			}else{
				if(varid in newArr) {    qunt = 1+newArr[varid]; 	}
				if(i > 0){		string += "&";	}
				string += 'updates['+varid+']='+qunt;
				product_array.push(pid);	
			}			
			i++;
		});
		evmProductClickProcess(product_array,'no',"","yes",widget,template,addtocart,wspage);
		var evm_jqxhr = jQuery.post('/cart/update.js',
			string
			);
		evm_jqxhr.always(function(evm_data) {
			var res = "";
			if(evm_data){
				res = evm_data.responseText ? JSON.parse(evm_data.responseText) : JSON.parse(evm_data);
			}
			if(res.token != undefined){
				if(enable_atc_redirect == "true"){
					__wsAttrGetCartData('calling from wiser widgets at the time of Add to Cart');/* call this function for attributes when prouct added to cart if you got success */
					window.location.href = wiser_shop_domain+"/cart";
				}else{	
					var newCount = exist_count+i;
					evm_cart_count(newCount);

					if(slide_cart_integrate == "true") {
						setTimeout(function() {
							$(".slidecart-container").trigger("open");         
						},1000);
					}
					var fbt_p_ids_active = {};
					if (template == "alsobought_template1") {
						fbt_p_ids_active[fbt_main_product_id] = "on";
						$(".evm-also-bought .evm-ws-card .ws-card__header input:checked, .evm-also-bought-products .evm-ws-card .ws-card__header input:checked").each(function() {
							product_id = $(this).attr("bought_product");
							fbt_p_ids_active[product_id] = $(this).val();
						});
					}  else if (template == "alsobought_template2") {
						$(".evm-also-bought .evm-ws-body-section .ws-card__header input:checked, .evm-also-bought-products .evm-ws-body-section .ws-card__header input:checked").each(function() {
							product_id = $(this).attr("bought_product");
							fbt_p_ids_active[product_id] = $(this).val();
						});
					}

					if(other_settings_array['is_ATC_msg_show'] == "true") {
						var ws_atcct = (wsLangTrans != null && wsLangTrans.ws_atcct != '' && wsLangTrans.ws_atcct != 'undefined' && wsLangTrans.ws_atcct != undefined) ? wsLangTrans.ws_atcct :other_settings_array['addcart_confirmation_msg'];
						var ws_or    = (wsLangTrans != null && wsLangTrans.ws_or != '' && wsLangTrans.ws_or != 'undefined' && wsLangTrans.ws_or != undefined) ? wsLangTrans.ws_or : other_settings_array['or_confirmation_msg'];
						var ws_vc    = (wsLangTrans != null && wsLangTrans.ws_vc != '' && wsLangTrans.ws_vc != 'undefined' && wsLangTrans.ws_vc != undefined) ? wsLangTrans.ws_vc :other_settings_array['viewcart_confirmation_msg'];
						var ws_csh   = (wsLangTrans != null && wsLangTrans.ws_csh != '' && wsLangTrans.ws_csh != 'undefined' && wsLangTrans.ws_csh != undefined) ? wsLangTrans.ws_csh : other_settings_array['countinue_confirmation_msg'];
						var ws_msg = '<i class="fa fa-check"></i> '+ ws_atcct +'</br><a href="/cart">'+ ws_vc +'</a> '+ ws_or +' <a href="javascript:void(0)">'+ ws_csh +'</a>.';
						$(".ws-card_success-also-bought").html(ws_msg);
					}

					setTimeout(function(){ 
						if(wiser_settings_array.after_ATC_activity != undefined && wiser_settings_array.after_ATC_activity != ""){
							var afterATCACT = wiser_settings_array.after_ATC_activity;
							eval(afterATCACT);
						}
					}, 100);
					setTimeout(function(){ 
						$(".evm-wi-fbt-atc").removeAttr('disabled');
						$(".ws-card_success-also-bought").html(""); 
					}, 3000); 
				}
				/* this code use if wiser cart drawer enabled no any issue created by this code */

				let __wsCartStatus = localStorage.getItem(wsCartStatus);
				if (__wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 1 && __wsChkCdWdgtInit == 0) {
					__wsUpdCartDrawer(); /* call this function when prouct added to cart if you got success */
					__wsChkCdWdgtInit = 1;
					setTimeout(function() { __wsChkCdWdgtInit = 0; }, 3000);
				}
				__wsAttrGetCartData('calling from wiser widgets at the time of Add to Cart');/* call this function for attributes when prouct added to cart if you got success */
				/* end this code use if wiser cart drawer enabled no any issue created by this code */
				if(wsCrtDate > "2024-06-24" && __wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 0) __wsUpdLineItemsInCartDrwr();
				
				/* check discount create or not */
				var fbt_disc_ttl = $(".fbt_ttl").text();
				var fbt_orig_ttl = $("#evm-ws-alsobought-amount").text();
				if (fbt_disc_ttl != "" && fbt_orig_ttl !="") {
					fbt_disc_ttl = parseFloat(fbt_disc_ttl.replace(/[^\d]/g, ''));
					fbt_orig_ttl = parseFloat(fbt_orig_ttl.replace(/[^\d]/g, ''));
					/* ws_bundle_disc_auto function call */
					ws_bundle_disc_auto(fbt_disc_ttl, fbt_orig_ttl, wiser_settings_array, template);
				}
				/* end check discount create or not */
			}
		});
		evm_jqxhr.fail(function(evm_data) {
			var res = "";
			$(".evm-wi-fbt-atc").removeAttr('disabled');
			if(evm_data){
				res = evm_data.responseText ? JSON.parse(evm_data.responseText) : JSON.parse(evm_data);
			}	
			if(res.status=='422' || res.status=='404'){
				$(".ws-card_success-also-bought").html('<i class="fa fa-close"></i> Product is out of stock.');
				setTimeout(function(){ $(".ws-card_success-also-bought").html(""); }, 3000);
			}	
		});
	});   
}

function evmJudgemeWidget(shop,key){
	if (shop != '' ) {
		var data;
		data = $.map($('.jdgm-badge-placeholder'), function(element) {
			var hash = {};
			var $element = $(element);
			hash['productHandle'] = $element.data('handle');    
			hash['badgePlaceholder'] ='.jdgm-badge-placeholder[data-handle="' + $element.data('handle') + '"]';
			return hash;
		});
		setTimeout( function(){
			jdgm.batchRenderBadges(data);
		}, 5000);
	}
}

function evmYotpoWidget(wsShopID,$yotpoApiKey) {
	var slidecall=document.createElement('script');
	slidecall.src="https://cdn-widgetsrepository.yotpo.com/v1/loader/"+$yotpoApiKey; 
	document.getElementsByTagName('head')[0].appendChild(slidecall);
	if (typeof yotpoWidgetsContainer !== 'undefined') {
    	yotpoWidgetsContainer.initWidgets();
    }
}
function evmAlsoBoughtSelection(){
	var alsobought_template_name = wiser_settings_array.alsobought_template;
	$( ".ws-card-ab-checkbox" ).on( "click", function(event) {
		var alsobought_template_name = $(this).attr("bought_template");
		var product=$(this).attr("bought_product");
		if($(this).is(":checked")){
			if(alsobought_template_name == 'alsobought_template2'){
				$('.ws-body-box-wrapper_'+product).css({'opacity':'2'}); 
				$('.ws-image-box-wrapper_'+product).delay(100).fadeIn();
				$('.ws-image-box-wrapper_'+product).removeClass("evm-invisible");
				$('.ws-image-box-wrapper_'+product).addClass("evm-visible");
			}
			else if(alsobought_template_name == 'alsobought_template3'){
				var tem3Pro = $('.ws-card-ab-checkbox_'+product).prop("checked", true);
				$('.ws-body-box-wrapper_'+product).css({'opacity':'2'}); 
				$('.ws-image-box-wrapper_'+product).removeClass("evm-invisible");
				$('.ws-image-box-wrapper_'+product).addClass("evm-visible");
			}
			$("#evm_alsobought_product_"+product).addClass("evm_alsobought_wiser_product");
		}else{
			if(alsobought_template_name == 'alsobought_template2'){
				$('.ws-body-box-wrapper_'+product).css({'opacity':'0.5'})
				$('.ws-image-box-wrapper_'+product).delay(100).fadeOut();
				$('.ws-image-box-wrapper_'+product).removeClass("evm-visible");
				$('.ws-image-box-wrapper_'+product).addClass("evm-invisible");
			}else if(alsobought_template_name == 'alsobought_template3'){
				var tem3Pro = $('.ws-card-ab-checkbox_'+product).prop("checked", false);
				$('.ws-body-box-wrapper_'+product).css({'opacity':'0.5'});
				$('.ws-image-box-wrapper_'+product).removeClass("evm-visible");
				$('.ws-image-box-wrapper_'+product).addClass("evm-invisible");
			}
			$("#evm_alsobought_product_"+product).removeClass("evm_alsobought_wiser_product");
		}

		if(alsobought_template_name == 'alsobought_template2'){
			$(".ws-plus-sign").remove();
			var evmcount_i=0;
			var evmcount = $('.evm-visible').length;
			if(evmcount > 0){
				$(".evm-visible").each(function() {
					if(evmcount_i <= evmcount && evmcount_i > 0){
						$(this).before('<div class="ws-plus-sign">+</div>');
					}
					evmcount_i++;
				});	
				$('.evm-alsobought-action').show();
			}else{
				$('.evm-alsobought-action').hide();
			}
			evmAlsoBoughtTotalCal();
		}
		if(alsobought_template_name == 'alsobought_template1') {
			evmAlsoBoughtTotalCalN();
		}
	}); 
	
	if(alsobought_template_name == 'alsobought_template1'){
		$( ".evm_alsobought_wiser_product" ).on('change', function() {
			var current_variant = $(this).val();
			var moneyformat = wiser_settings_array.moneyformat;
			var money_format = wiser_settings_array.money_format; 
			var show_compare_price = wiser_settings_array.show_compare_price;
			var ori_price_font_color = wiser_settings_array.ori_price_font_color;
			var price_font_color = wiser_settings_array.price_font_color;
			//var price = oriprice = parseFloat($(this).find('option:selected').attr('data-price'));
			//price = Number(price).toFixed(2); 
			var price = oriprice = $(this).find('option:selected').attr('data-price');
			var ori_value= money_format+price+moneyformat;
			ori_value = '<span style="color:#'+price_font_color+'" class=" ws-original-price">'+ ori_value +'</span>';

			//var compare_at_price = parseFloat($(this).find('option:selected').attr('data-compare-at-price'));
			var compare_at_price = $(this).find('option:selected').attr('data-compare-at-price');

			var bought_product = $(this).attr('bought_product');
			var datasrc = $(this).find('option:selected').attr('data-src');
			var dataoutofstock = $(this).find('option:selected').attr('data-out');
			var datasrc1 = $(this).find('option:selected').attr('data-src2');
			if(datasrc && datasrc != undefined){
				$(".ws-card__background-image-"+bought_product).css('background-image', 'url(' + datasrc + ')');
			}

			if(datasrc1 && datasrc1 != undefined){
				$(".ws-card__background-image2-"+bought_product).css('background-image', 'url(' + datasrc1 + ')');
			}
			var comp_value="";
			var comp_class="evm-no-compare-price";
			if(show_compare_price == "true" && (oriprice < compare_at_price)){
				comp_class=""; 
				compare_at_price = compare_at_price; 
				comp_value= compare_at_price ? "<span class='ws-compare-original-price' style='color: #"+ori_price_font_color+";'>"+money_format+compare_at_price+moneyformat+"</span>"+' &nbsp;' : "";
			}  
//var html_price = ori_value+comp_value;
			var html_price = comp_value+ori_value;
			$("#alsobought-product-price_"+bought_product).html(html_price);

			evmAlsoBoughtTotalCalN();
//Wishlist change current variant
			$(".ws-image-box-wrapper_"+bought_product+" .ws-wishlist-icon").attr("data-variant",current_variant);
		});
		if(ShopId == "elevateaparrel.myshopify.com") {
			getComparePrice(wsComparePrice);
		}
	}

	if(alsobought_template_name == 'alsobought_template2') {
		$( ".evm_alsobought_wiser_product" ).on('change', function() {
			var current_variant = $(this).val();
			var moneyformat = wiser_settings_array.moneyformat;
			var money_format = wiser_settings_array.money_format; 
			var show_compare_price = wiser_settings_array.show_compare_price;
			var ori_price_font_color = wiser_settings_array.ori_price_font_color;
			var price_font_color = wiser_settings_array.price_font_color;
			//var price = oriprice = parseFloat($(this).find('option:selected').attr('data-price'));
			//price = Number(price).toFixed(2); 
			var price = oriprice = $(this).find('option:selected').attr('data-price');

			if (notAllowDecimal == "true" && allowCommaInPrice == "true") {
		    	price = Number(price).toLocaleString();
			}
			var oriprice_value= money_format+price+moneyformat;
			if (wiser_shopID != "15383241") {
				if (wsChkCurrAndLang.includes(wiser_shopID)) {
					oriprice_value = $(this).find('option:selected').attr('ws-data-price');
				}
			}

			ori_value = '<span style="color:#'+ori_price_font_color+'" class="ws-original-price-both variPrice">'+ oriprice_value +'</span>';
			//var compare_at_price = parseFloat($(this).find('option:selected').attr('data-compare-at-price'));
			var compare_at_price = $(this).find('option:selected').attr('data-compare-at-price');

			var bought_product = $(this).attr('bought_product');
			var datasrc = $(this).find('option:selected').attr('data-src');
			var dataoutofstock = $(this).find('option:selected').attr('data-out');
			var datasrc1 = $(this).find('option:selected').attr('data-src2');
			if(datasrc && datasrc != undefined){
				$(".ws-card__background-image-"+bought_product).css('background-image', 'url(' + datasrc + ')');
			}

			if(datasrc1 && datasrc1 != undefined){
				$(".ws-card__background-image2-"+bought_product).css('background-image', 'url(' + datasrc1 + ')');
			}
			var comp_value="";
			var comp_class="evm-no-compare-price";
			if(show_compare_price == "true" && (oriprice < compare_at_price)){
				comp_class=""; 
				if (notAllowDecimal == "true" && allowCommaInPrice == "true") {
					compare_at_price = Number(compare_at_price).toLocaleString();
				}
				compare_at_price = money_format+compare_at_price+moneyformat;
				if (wsChkCurrAndLang.includes(wiser_shopID)) {
					compare_at_price = $(this).find('option:selected').attr('ws-data-compare-at-price');
				}

				comp_value= compare_at_price ? "<span class='ws-compare-original-price' style='color: #"+ori_price_font_color+";'>"+compare_at_price+"</span>"+' &nbsp;' : "";
				ori_value = '<span style="color:#'+price_font_color+'" class="ws-original-price-both vPrice">'+ oriprice_value +'</span>';
			}    
			//var html_price = ori_value+comp_value;
			var html_price = comp_value+ori_value;
			$("#alsobought-product-price_"+bought_product).html(html_price);

			evmAlsoBoughtTotalCal();
			//Wishlist change current variant
			$(".ws-image-box-wrapper_"+bought_product+" .ws-wishlist-icon").attr("data-variant",current_variant);
		});
	}
}

function evmAlsoBoughtTotalCal(){
	var moneyformat = wiser_settings_array.moneyformat;
	var money_format = wiser_settings_array.money_format;
	var evmtotalprice=0;
	var $evmtotalprice=0;
	var evmtotalcomprice=0;	
	
	$(".evm_alsobought_wiser_product, .evm-wscontainer select.avl").each(function() {
		var prodvid = parseFloat($(this).find('option:selected').attr('pro_p_id'));
		checkBox = document.querySelectorAll('.ws-card-ab-checkbox');
		if(checkBox.length > 1){
			if(document.querySelector('.ws-card-ab-checkbox_'+prodvid).checked == true){
				var price = parseFloat($(this).find('option:selected').attr('data-newprice'));
				evmtotalprice += price;
				if (wsChkCurrAndLang.includes(wiser_shopID)) {
					var $wsPrice = $(this).find('option:selected').attr('ws-data-price').replace(/[^0-9]/gi, '');
					$evmtotalprice += parseInt($wsPrice);
				}
			}

			// if(document.querySelector('.ws-card-ab-checkbox_'+prodvid).checked == true){
			// 	var price = parseFloat($(this).find('option:selected').attr('data-newprice'));
						
			// 	// var $wsPrice = $(this).find('option:selected').attr('ws-data-price').replace(/[^0-9]/gi, '');		
			// 	evmtotalprice += price;		
			// 	// $evmtotalprice += parseInt($wsPrice);
			// }
		} else {
			var price = parseFloat($(this).find('option:selected').attr('data-newprice'));
			evmtotalprice += price;
			if (wsChkCurrAndLang.includes(wiser_shopID)) {
				var $wsPrice = $(this).find('option:selected').attr('ws-data-price').replace(/[^0-9]/gi, '');
				$evmtotalprice += parseInt($wsPrice);
			}

			// var price = parseFloat($(this).find('option:selected').attr('data-newprice'));
			// evmtotalprice += price;		
			// $evmtotalprice += parseInt($wsPrice);
		}
	});

	if (notAllowDecimal == "true" && allowCommaInPrice == "true") {
    	evmtotalprice = Number(evmtotalprice).toLocaleString();
	} else {		
    	evmtotalprice = Number(evmtotalprice).toFixed(2);
	}
    if(wiser_shopID == '54924247201'){
    	evmtotalprice =  evmtotalprice.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
   		evmtotalprice = evmtotalprice.replace('.00', "");
    }
    if (wsChkCurrAndLang.includes(wiser_shopID)) {
	    var html_price = money_format+evmtotalprice+moneyformat;
	    var wsChkNonDiscArr = ["15383241", "71992312020"]
	    if (!wsChkNonDiscArr.includes(wiser_shopID)) {
    		var html_price = ShopifyWsObj.wsGetMnyFrmt($evmtotalprice);
    	} 
    } else {
	    var html_price = money_format+evmtotalprice+moneyformat;
    }
	// var $wsHtmlPrice = __wsCurrPriceWithSybl($evmtotalprice);

    if(ShopId == "elevateaparrel.myshopify.com") {
		getComparePrice(wsComparePrice);
	}
	$("#evm-ws-alsobought-amount").html(html_price);

	// if(wiser_shopID == "54924247201" || wiser_shopID == "43025170587") {
	// 	$("#evm-ws-alsobought-amount").html(html_price);
	// } else {
	// }

	/* call this function to update total discounted price */
	if (window.localStorage.getItem("__fbtDiscChk") !== null && window.localStorage.getItem("__fbtDiscChk") == "active") {
		if (wiser_shopID == '7227785') {
			setTimeout(function() {	ws_fbt_update_disc("","",1);}, 1000);
		} else {
			ws_fbt_update_disc("","",1); /* call this function to update total discounted price */;
		}
	}
}

function evmAlsoBoughtTotalCalN(){
	var moneyformat = wiser_settings_array.moneyformat;
	var money_format = wiser_settings_array.money_format;
	var evmtotalprice=0;
	var $evmtotalprice=0;
	var evmtotalcomprice=0;	
	$(".evm_alsobought_wiser_product, .evm-wscontainer select.avl").each(function() {
		var price = parseFloat($(this).find('option:selected').attr('data-newprice'));
		// var $wsPrice = $(this).find('option:selected').attr('ws-data-price').replace(/[^0-9]/gi, '');
		if(isNaN(price)) {
	      var price = parseFloat($(this).find('option').attr('data-newprice'));
	    }
		evmtotalprice += price;
		// $evmtotalprice += parseInt(evmtotalprice);
	});

	if (notAllowDecimal == "true" && allowCommaInPrice == "true") {
    	evmtotalprice = Number(evmtotalprice).toLocaleString();
    }
	var html_price   =  money_format+evmtotalprice+moneyformat;
    if(ShopId == "elevateaparrel.myshopify.com") {
		getComparePrice(wsComparePrice);
	}


	$("#evm-ws-alsobought-amount").html(html_price);	

	/* call this function to update total discounted price */
	if (window.localStorage.getItem("__fbtDiscChk") !== null && window.localStorage.getItem("__fbtDiscChk") == "active") {
		if (wiser_shopID == '7227785') {
			setTimeout(function() {	ws_fbt_update_disc("","",1);}, 1000);
		} else {
			ws_fbt_update_disc("","",1); /* call this function to update total discounted price */;
		}
	}
}

function evmWiserOnloadCall(other_settings_json){
	wiser_settings_array = JSON.parse(other_settings_json);
	
	if (wiser_shopID == '5439553610' && PageName != "cart") {
		wiser_settings_array.widget_product_view = "slider"; 
	}		
	if(((wiser_shopID == '47486599330' || wiser_shopID == '47271182499') && (screen.width < 500)) || ((screen.width < 500) && (wiser_settings_array.widget_product_view == "grid")) || ((PageName == 'thank_you') && (wiser_settings_array.thankyou_viewstyle == "grid"))){

		var wsarr = ['evm-recommended-products','recently-viewed','evm-new-arrivals-product','evm-featured-collections-product','evm-most-popular-products','trending-products','evm-related-product','evm-related-viewed-browsing'];
		for (var i = 0; i < wsarr.length; i++) {
			$("."+wsarr[i]+" .ws-box-wrapper").hide();
		}
		evmWsPaginationMobile(); 
	}
	if(wiser_settings_array.wiser_isenable_popup == 1){
		window.localStorage.setItem("evm_wiser_popup_enable","1");
	}
	
	if(wiser_settings_array.wiser_is_quickview == 1){		
		evmWiserQuickviewOnClick();
	}
	evmWiserProductClick();	evmAlsoBoughtSelection();	evmWiserGetWidgetPrice(); 
        //Template4 function 

	

	
	evmbuttonTemplate4click();
	

	if(wiser_settings_array.wiser_wishlist != "false"){
		evmWiserWishlist(wiser_settings_array.wiser_wishlist);
	}	
	if(wiser_settings_array.wiser_customjs != undefined && wiser_settings_array.wiser_customjs != ""){
		$("body").append("<script evm-data-id='evm-cs-js-element'>"+wiser_settings_array.wiser_customjs+"<\/script>");
	}
	
}

/** Once click on Subscription Option */
function evmbuttonSubscriptionclick(){
	var evm_ws_theme_name = (window.BOOMR && window.BOOMR.themeName && typeof window.BOOMR.themeName !== undefined) ? window.BOOMR.themeName : "";	
	$( ".evm-ws-addtocart" ).click(function() {
		if(wiser_shopID == '22599949'){
			$(".evm-ws-popup-variants-main").hide();
			var product_handle=$(this).attr('data-handle');
			window.open(wiser_shop_domain+"/products/"+product_handle,"_self");
		}
	});
	$( ".evm-add-to-cart-popup-inner" ).click(function() {
		
		var product_id=$(this).attr('data-pid');
		var random_id=$(this).attr('data-random');
		//$(".evm-wscontainer .owl-stage").css('transform','none');
		// $(".evm-wiser-owl-carousel").parent().addClass('evm-wi--popup-open-layout4');	
		$(".evm-ws-popup-variants-main").hide();
		$(".evm-ws-popup-variants-main_"+product_id+"_"+random_id).toggle();
	});
	$( ".evm-ws-popup-close" ).click(function() {
		var product_id=$(this).attr('data-pid');
		var random_id=$(this).attr('data-random');
		// $(".evm-wiser-owl-carousel").parent().removeClass('evm-wi--popup-open-layout4');	
		// $(".evm-wscontainer .owl-stage").css('transform','translate3d(0px, 0px, 0px)');
		$(".evm-ws-popup-variants-main_"+product_id+"_"+random_id).hide();
	});

	/* JAVASCRIPT CODE FOR SUBSCRIPTION FEATURE  */
	$( ".evm-add-variant-call" ).click(function(e) {
		e.preventDefault();			
		evmbuttonTemplate4click();		
	});
}

/** UPDATE CART ITEM */
function updateCartDisplay() {
	$.getJSON('/cart.js', function(cart) {
		let itemsHtml = '';
		cart.items.forEach(item => {			
			const originalPrice = item.original_price;
			const discountPrice = item.final_line_price;
			itemsHtml += "<div class='cart-item'><p>${item.product_title}</p><p>Discounted Price: ${(discountPrice / 100).toFixed(2)}</p></div>";
		});
		$('#cart-contents').html(itemsHtml); // Update the cart DOM element
	});
}

var wschkQuickView = 0;
function evmWiserQuickviewOnClick(){
	if (wschkQuickView == 0) {
		wschkQuickView = 1;
		$(".evm-wi-quick-product-btn").on( "click", function(event) {
			var qsphandle= $(this).attr("data-product-handle");
			evmWSQuickView(qsphandle);
		});
	}
};

function evmWiserGetWidgetPrice(){
	$( ".evm-wiser-variants" ).on('change', function() { 
		var current_variant = $(this).val();
		var show_compare_price = wiser_settings_array.show_compare_price;
		var moneyformat = wiser_settings_array.moneyformat;
		var money_format = wiser_settings_array.money_format;
		var ori_price_font_color = wiser_settings_array.ori_price_font_color;
		var price_font_color = wiser_settings_array.price_font_color;
		var random_id = $(this).attr("data-random");
		if(wiser_shopID ==  '56106221718') {
			var price = oriprice = $(this).find('option:selected').attr('data-price');
			price     = Number(price);
			price     = price.toLocaleString();
			var compare_at_price = cmp = $(this).find('option:selected').attr('data-compare-at-price');
			compare_at_price     = Number(compare_at_price);
			compare_at_price     =compare_at_price.toLocaleString(); 
		}
		else
		{
			if (wsChkCurrAndLang.includes(wiser_shopID)) {
				var price = oriprice = $(this).find('option:selected').attr('ws-data-price').replace(/[^0-9]/gi, '');
	        	price = __wsCurrPriceWithSybl(Number(price));
	        	var ws_data_compare_at_price = $(this).find('option:selected').attr('ws-data-compare-at-price')
	        	if(typeof ws_data_compare_at_price !== "undefined") {
		    		var compare_at_price = cmp = $(this).find('option:selected').attr('ws-data-compare-at-price').replace(/[^0-9]/gi, '');
		    		compare_at_price = __wsCurrPriceWithSybl(Number(compare_at_price));
	        	}
	        } else {
	        	var price = oriprice = parseFloat($(this).find('option:selected').attr('data-price'));			
	        	var compare_at_price = cmp = parseFloat($(this).find('option:selected').attr('data-compare-at-price'));
	        	if(wiser_shopID == "4284973") {
	        		price = Number(price).toFixed();
	        		compare_at_price = Number(compare_at_price).toFixed();
    			} else {
		        	price = Number(price).toFixed(2);
		        	compare_at_price = Number(compare_at_price).toFixed(2);
    			}
	        }
		}

		var datasrc = $(this).find('option:selected').attr('data-src');
		var dataoutofstock = $(this).find('option:selected').attr('data-out');

		var datasrc1 = $(this).find('option:selected').attr('data-src2');
		var dataid= $(this).attr('data-id');
		


		if (wsChkCurrAndLang.includes(wiser_shopID)) {
			var ori_value= "<span class='ws-original-price-both' style='color: #"+price_font_color+";'>"+price+"</span>";
		} else {
			var ori_value= "<span class='ws-original-price-both' style='color: #"+price_font_color+";'>"+money_format+price+moneyformat+"</span>";
		}


		var comp_value="";
		var comp_class="evm-no-compare-price";

		if(show_compare_price == "true" && (parseInt(oriprice) < parseInt(cmp))){
			comp_class="";
			if (wsChkCurrAndLang.includes(wiser_shopID)) {
				comp_value= compare_at_price ? "<span class='ws-compare-original-price' style='color: #"+ori_price_font_color+";'>"+compare_at_price+"</span>"+' &nbsp;' : "";
			} else {
				comp_value= compare_at_price ? "<span class='ws-compare-original-price' style='color: #"+ori_price_font_color+";'>"+money_format+compare_at_price+moneyformat+"</span>"+' &nbsp;' : "";
			}

		} 

		if(show_compare_price == "true" && (parseInt(oriprice) > parseInt(cmp))){
			if (wsChkCurrAndLang.includes(wiser_shopID)) {
				var ori_value= "<span class='ws-original-price-single money' style='color: #"+ori_price_font_color+";'>"+price+"</span>";
			} else {
				var ori_value= "<span class='ws-original-price-single' style='color: #"+ori_price_font_color+";'>"+money_format+price+moneyformat+"</span>";
			}


		} 
		if(wiser_shopID ==  '56106221718')
		{
			var html_price = comp_value+" &nbsp;"+ori_value;
		}
		else
		{
			var html_price = ori_value+" &nbsp;"+comp_value;
		}   

		$("#wiser-product-price_"+dataid).html(html_price);
		if(datasrc && datasrc != undefined){
			$(".ws-card__background-image-"+dataid).css('background-image', 'url(' + datasrc + ')');
		}

		if(datasrc1 && datasrc1 != undefined){
			$(".ws-card__background-image2-"+dataid).css('background-image', 'url(' + datasrc1 + ')');
		}

		if(dataoutofstock != undefined && dataoutofstock == '1'){
			$(".ws-card_success_"+random_id).html('<i class="fa fa-close"></i> Product is out of stock.');
			setTimeout(function(){ $(".ws-card_success_"+random_id).html(""); }, 3000);
		}else{
			$(".ws-card_success_"+random_id).html('');
		}
		//Wishlist change current variant
		$(".ws-box-wrapper_"+dataid+" .ws-wishlist-icon").attr('data-variant',current_variant);
    });
}
function evmWiserGetPopupPrice(){
	$( ".evm-wiser-variants-popup" ).on('change', function() {
		var show_compare_price = popup_other_settings.show_compare_price;
		var moneyformat = popup_other_settings.moneyformat;
		var money_format = popup_other_settings.money_format;
		var ori_price_font_color = popup_other_settings.ori_price_font_color;
		var random_id = $(this).attr("data-random");

		var price = oriprice = parseFloat($(this).find('option:selected').attr('data-price'));
		price = Number(price).toFixed(2); 
		var compare_at_price = parseFloat($(this).find('option:selected').attr('data-compare-at-price'));
		var datasrc = $(this).find('option:selected').attr('data-src');
		var dataoutofstock = $(this).find('option:selected').attr('data-out');

		var datasrc1 = $(this).find('option:selected').attr('data-src2');
		var dataid= $(this).attr('data-id');
		var ori_value= money_format+price+moneyformat;
		var comp_value="";
		var comp_class="evm-no-compare-price";
		if(show_compare_price == "true" && (oriprice < compare_at_price)){
			comp_class=""; 
			compare_at_price = Number(compare_at_price).toFixed(2); 
			comp_value= compare_at_price ? "<span class='ws-compare-original-price' style='color: #"+ori_price_font_color+";'>"+money_format+compare_at_price+moneyformat+"</span>"+' &nbsp;' : "";
		}    
		var html_price = comp_value+ori_value;
		$("#wiser-product-price_"+dataid).html(html_price);
		if(datasrc && datasrc != undefined){
			$(".ws-card__background-image-"+dataid).css('background-image', 'url(' + datasrc + ')');
		}

		if(datasrc1 && datasrc1 != undefined){
			$(".ws-card__background-image2-"+dataid).css('background-image', 'url(' + datasrc1 + ')');
		}

		if(dataoutofstock != undefined && dataoutofstock == '1'){
			$(".ws-card_success_"+random_id).html('<i class="fa fa-close"></i> Product is out of stock.');
			setTimeout(function(){ $(".ws-card_success_"+random_id).html(""); }, 3000);
		}else{
			$(".ws-card_success_"+random_id).html('');
		}
		
    });
}

function evmWiserCartUpdate(){
	$('body').on('click', '.evm-ws__cart-submit,.evm-add-to-cart-inner', function() {
		let self = this;
		setTimeout(function(){
			theme.cart.getCart().then(function(cart) {
				self.buildCart(cart, true);
			}.bind(this));
		}, 300);
	}.bind(this));
}
function evmWiserHideContinue(randomid){$(".ws-card_success_"+randomid).html("");}
var wsChkPopup = 0;
function WISER_UPDATECALL(wiser_pid="",wiser_pids_collection="",evmws_is_drawer,PageName, chk_request = "") {
	var http   = new XMLHttpRequest();
	var evmurl = evmwiseHost+"App_lang/embed_recentpro";
	var data   = new FormData();
	var wsAiLclStrgData = __wsSetNdChkLclStrg();
	data.append('pId', wiser_pid);
	data.append('ShopId', ShopId);
	data.append('chk_request', chk_request);
	data.append('PageName', PageName);
	// data.append('ws_top_selling', JSON.stringify(ws_top_selling_products_20)); /* top selling product for hardmen store only */
	data.append('PageHandle', wiser_phandle);
	data.append('wsContryCode', wsContryCode);
	data.append('wsCurrSybl', wsCurrSybl);
	data.append('BlogTags',wiser_blog_tags);
	data.append('CollecId', CollecId);
	data.append('langval', wsCurtLang);
	data.append('wsRootLocl', wsRootLocl);
	data.append('wiser_related_browse', wi_related_browse); /* AI based recommendation Ids */
	data.append('wiser_settings', evmwiser_settings);
	data.append('wiser_purchased_product', wi_purchased_product);   
	data.append('wiser_purchased_product_detail', wi_purchased_product_detail);
	data.append('ws_screen_width', wi_screen_width);
	data.append('wiser_shop_domain',wiser_shop_domain);

	/* send recently view and related_browsing */
	data.append('wiser_browse_products', wsAiLclStrgData); /* this data is coming from generate_browsing_related_newlogic2 this function first set local storage and get */
	data.append('wiser_recent_products', wi_recent_products);
	/* end */
	http.open('POST', evmurl, true);
	http.onreadystatechange = function() { //Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		var data          = JSON.parse(http.responseText);
		wsLangTrans       = data.wsLangTrans;
		notAllowDecimal   = data.notAllowDecimal;
		allowCommaInPrice = data.allowCommaInPrice;
		wsCrtDate         = data['create_date'];
		/* set local storage for wiser_cart_status */
		localStorage.setItem(wsCartStatus, data['wiser_cart_status']);
		var $wsChkCartJs = document.querySelector('script[ws-cart-locale]');
	    if ($wsChkCartJs == null) {
			localStorage.setItem(wsCartStatus, 0);
	    }
		var widget_version        = data['widget_version'];
		var wise_popup_on_page    = data['wise_popup_on_page'];
		var wiser_snippet_version = data['wiser_snippet_version'];
		if(widget_version == "1"){
			/****WIser style.css ***/
			var x = document.createElement("LINK");
			x.setAttribute("rel", "stylesheet");
			x.setAttribute("type", "text/css");
			x.setAttribute("href", evm_ws_cdn_url+"compressedver1.0/wiser_style.css"); 	
			document.head.appendChild(x);
			/****WIser style.css ***/
		}
		if(PageName == 'thank_you' || wiser_snippet_version == '2'){
			var x = document.createElement("LINK");
			x.setAttribute("rel", "stylesheet");
			x.setAttribute("type", "text/css");
			x.setAttribute("href", "https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css");    	
			document.head.appendChild(x);
			if(data["product_view"]=="owl-carousel" || data["product_view"]=="wiser-carousel" || data["product_view"]=="slider"){
				var slider_css_url = (widget_version == "2") ? (evm_ws_cdn_url+"compressedver1.0/wiser.slider.min.css") : (evm_ws_cdn_url+"compressedver1.0/wiser.sliderver1.min.css");
				var x = document.createElement("LINK");
				x.setAttribute("rel", "stylesheet");
				x.setAttribute("type", "text/css");
				x.setAttribute("href", slider_css_url);
				document.head.appendChild(x);
				if(wiser_shopID == '26595328052' || wiser_shopID == '3111190574' || wiser_shopID == '4473225334' || wiser_shopID == '50706186405' || wiser_shopID == '10832284' || wiser_shopID=='22455667'  || wiser_shopID == '45965639834' || wiser_shopID == '4590781' || wiser_shopID == '25501564962' || wiser_shopID == '10832284' || wiser_shopID == '57490571461' || wiser_shopID == '64259719381' || wiser_shopID == '55534747822' || wiser_shopID == '53956214984' || wiser_shopID == '26164330573' || wiser_shopID == '84613431578' || wiser_shopID == '6794543171'){
					if(data['template'] == 'template4')
					{
						var x = document.createElement("LINK");
						x.setAttribute("rel", "stylesheet");
						x.setAttribute("type", "text/css");
						x.setAttribute("href", evm_ws_cdn_url+'compressedver1.0/widget_'+data['template']+'_ver1.0.min.css');
						document.head.appendChild(x);
					}
					var x = document.createElement("LINK");
					x.setAttribute("rel", "stylesheet");
					x.setAttribute("type", "text/css");
					x.setAttribute("href", evm_ws_cdn_url+"compressedver1.0/wiser.slider.drawer.min.css");
					document.head.appendChild(x);
				}
				var slider_arrow_css = data['slider_arrow_css'];
				if(slider_arrow_css !='')
				{
					$('<style>'+slider_arrow_css+'</style>').appendTo('head');
				}


			}
			if(PageName == 'thank_you'){
				var wiser_thankyou_details = (typeof data['wiser_thankyou_details'] !== "undefined") ? data['wiser_thankyou_details'] : "";
				var divs=data['display_main_divs'];
				if(divs != ""){
					divs = divs.split(",");
					for (var i = 0; i < divs.length; i++) {
						var thankyouappendclass= wiser_thankyou_details ?  wiser_thankyou_details : "main__content";
						document.getElementsByClassName(thankyouappendclass)[0].insertAdjacentHTML("afterend","<div class='"+divs[i]+" snippetsHTML'></div>"); 
					} 
				}
			}		
		}

		evmWiserJsonCallback(data,evmws_is_drawer);
		if(wise_popup_on_page==1 && wsChkPopup == 0){
			wsChkPopup = 1;
			if(PageName == 'cart') {
				window.WISER_POPUPRENDER(wiser_pid,wiser_pids_collection);
			} else {
				window.WISER_POPUPRENDER(wiser_pid);
			}
		}

		/* ******************* bundle discount code ******************* */
		if (wiser_shopID == '71992312020') {
			if(PageName == 'product') {
				if (wiser_shopID == '7227785') {
					setTimeout(function() { ws_fbt_update_disc(wiser_pid, data); }, 1000);
				} else {
					ws_fbt_update_disc(wiser_pid, data);
				}
			}
		} else {
			if(PageName == 'product' || PageName == 'cart') {
				if (wiser_shopID == '7227785') {
					setTimeout(function() { ws_fbt_update_disc(wiser_pid, data); }, 1000);
				} else {
					ws_fbt_update_disc(wiser_pid, data);
				}
			}
		}
		/* ******************* end bundle discount code ******************* */
		/* call currency and language translation code */
		if (wsChkCurrAndLang.includes(wiser_shopID)) {
			__wsChgCurrAndLang(data);
		}

	}
} 
http.send(data);
if((ws_data_evmemail == '1') && (PageName == 'product'))
{
	var evmemailgen = evmwiseHost+"emailrecommendations/generate_email_recommendations";
	$.post( evmemailgen, { wiser_related_browse: wi_related_browse, wiser_recent_products: wi_recent_products,wiser_settings:evmwiser_settings,shop:ShopId,shopid:wiser_shopID,wiser_browse_products:wi_colbrowse_data} );
} 
}
function WISER_POPUPRENDER(wiser_pid="",wiser_pids_collection="") {
// var is_evm_ws_enabled = (window.localStorage.getItem("evm_wiser_popup_enable")!=undefined) ? 1:0;
//if(evmWSpopup == '1' || is_evm_ws_enabled == '1'){
	window.localStorage.removeItem("evm_close_popup_forpage");
	var ws_screen_width = $(window).width();
//$('.evm-wiser-popup-mainsection').hide();
	var http = new XMLHttpRequest();
	var evmurl = evmwiseHost+"popup/EvmWisePopupAction";
	var data = new FormData();
	data.append('pId', wiser_pid);
	data.append('ShopId', ShopId);
	data.append('PageName', PopPageName);
	data.append('wiser_pids_collection', wiser_pids_collection);
	data.append('CollecId', CollecId);
	data.append('evm_related_browse', evm_related_browse);
	data.append('evm_screen_width', ws_screen_width);
	data.append('wiser_related_browse', wi_related_browse);
	data.append('ws_lang_locale', wsCurtLang);
    data.append('wsRootLocl', wsRootLocl);
	data.append('wiser_recent_products', wi_recent_products);
	data.append('wiser_settings', evmwiser_settings);
	data.append('cartItemsVal', cartItemsVal);
	http.open('POST', evmurl, true);
	http.onreadystatechange = function() {//Call a function when the state changes.
	if(http.readyState == 4 && http.status == 200) {
		var popup_data = JSON.parse(http.responseText);
		var popup_found = popup_data.popup_found;
		var wspopup_id = popup_data.wspopup_id;
		var popup_cookie = EVMgetCookie('evm-ws-popup-cookie_'+wspopup_id);

		if(popup_found == 1){
			if(PageName == 'thank_you'){
				$("body").append("<div class='evm-wiser-popup-mainsection'></div>");
			}
			var popup_per_row = popup_data.popup_per_row;
			if(popup_per_row){
				var x = document.createElement("LINK");
				x.setAttribute("rel", "stylesheet");
				x.setAttribute("type", "text/css");
				x.setAttribute("href", evm_ws_cdn_url+"storepopupfront/wiser_popup_slider.css");    	
				document.head.appendChild(x);
			}		
			var x = document.createElement("LINK");
			x.setAttribute("rel", "stylesheet");
			x.setAttribute("type", "text/css");
			x.setAttribute("href", evm_ws_cdn_url+"storepopupfront/wiser_popup_module.css"); 	
			document.head.appendChild(x);

			var evmpopuptimeout=1000;
			popup_other_settings = popup_data['other_widget_details'];
			popup_other_settings = JSON.parse(popup_other_settings);
			var wiser_custom_css =popup_other_settings['wiser_custom_css'];
			if(wiser_custom_css){
				var wiser_style = document.createElement('style');
				wiser_style.type = 'text/css';wiser_style.innerHTML = wiser_custom_css;
				document.getElementsByTagName('head')[0].appendChild(wiser_style);
			}
			var wspopup_html = popup_data['popup_html'];
			if(wspopup_html){
				var review_status = popup_other_settings['review_status'];
				var popup_trigger_condition= popup_other_settings['trigger_condition'];
				$(".evm-wiser-popup-mainsection").html(wspopup_html);
				if(popup_per_row){

					evmpopuptimeout = 2000;
					var slidecall=document.createElement('script');
					slidecall.src=evmwiseHost+"assets/js/popup_slider.js?v=3"; 
					slidecall.setAttribute("popproducts_per_slider", popup_per_row);
					document.getElementsByTagName('head')[0].appendChild(slidecall);
				}
				setTimeout(() => {
					if(popup_trigger_condition == '1' && (popup_cookie == null || popup_cookie =="" || popup_cookie == undefined)) {
						$('.evm-wiser-popup-mainsection,.evm-ws-popup-innerSection').delay(500).fadeIn();
					}else if(popup_trigger_condition == '2'){
						var popup_trigger_condition_selector= popup_other_settings['trigger_condition_selector'];
						if(popup_trigger_condition_selector){
							evmPopUpOnClick(popup_trigger_condition_selector, wspopup_id);
						}
					}else if(popup_trigger_condition == '3'){
						if(wi_screen_width < 500 ){
							if(wiser_shopID == '15944825')
							{
								$('.evm-wiser-popup-mainsection,.evm-ws-popup-innerSection').delay(60000).fadeIn();
							}
							else {$('.evm-wiser-popup-mainsection,.evm-ws-popup-innerSection').show();}									
						}else{
							evmPopUpOnExitIntent(wspopup_id);
						}	
					}
/**Shopify review **/
					if(review_status == "true"){
						var jqcall=document.createElement('script');
						jqcall.src= "https://productreviews.shopifycdn.com/assets/v4/spr.js?shop="+ ShopId;
						document.getElementsByTagName('head')[0].appendChild(jqcall); 
					}
					if(review_status == "opinew_review"){
						var jqcall=document.createElement('script');
						jqcall.src= "https://cdn.opinew.com/js/util/opwdynamic.js";
						jqcall.setAttribute("id", "opinew-dynamic-js");
						document.getElementsByTagName('head')[0].appendChild(jqcall); 
					}
					if(review_status == "judgeme_review"){
						var evm_review_key = popup_other_settings['evm_review_key'];
						evmJudgemeWidget(ShopId,evm_review_key);
					}	
					/*Yotpo review script added given by youtpo support added by Vinita */
					if(review_status == "yotpo_review"){
						var yotpoApiKey = popup_other_settings['evm_review_key'];
						evmYotpoWidget(wiser_shopID,yotpoApiKey);
					}
					evmWiserPopupClick();
					evmWiserGetPopupPrice();

				}, evmpopuptimeout);

			}
		}	
		if (wsChkCurrAndLang.includes(wiser_shopID)) {
			__wsChgCurrAndLang(data);
		}
	}
} 
http.send(data);
//}	
}
if(PageName == 'product'){
	var evm_related_browse=EVMgetCookie("evm_related_browse");
	if(pId){
		if(evm_related_browse == null){ EVMsetCookie("evm_related_browse",pId,3);  }
		var currentProducts = [];
		if(evm_related_browse != null){ currentProducts = evm_related_browse.split(","); }
		var ws_idex = currentProducts.indexOf(pId);
		if (ws_idex > -1) {  currentProducts.splice(ws_idex, 1);   } 
		if(currentProducts.indexOf(pId) == -1){ currentProducts.push(pId); }
		if(currentProducts.length > 0){ EVMsetCookie("evm_related_browse",currentProducts.join(","),3); }
	}  
}

function evmPopUpOnClick(popup_selector, wsPopupId) {
	if (popup_selector.startsWith(".")) {
		popup_selector = popup_selector;
	} else if (popup_selector.startsWith("#")) {
		popup_selector = popup_selector;
	} else {
		popup_selector = "."+popup_selector;
	}

	$(popup_selector).on( "click", function(event) {
		var wsPopupCookie = EVMgetCookie('evm-ws-popup-cookie_'+wsPopupId);
		if ((wsPopupCookie == null || wsPopupCookie =="" || wsPopupCookie == undefined)) {
	  		$(".evm-wiser-popup-mainsection,.evm-ws-popup-innerSection").delay(3000).show(0);
		}
	  		//$(".evm-wiser-popup-mainsection").addClass('evm-show');
	});
}
function evmPopUpOnExitIntent(wsPopupId){
	$(document).on('mouseleave', function(){
		var wsPopupCookie = EVMgetCookie('evm-ws-popup-cookie_'+wsPopupId);
    	// if(window.localStorage.getItem("evm_close_popup_forpage")==undefined){
		if ((wsPopupCookie == null || wsPopupCookie =="" || wsPopupCookie == undefined)) {
	  		$(".evm-wiser-popup-mainsection,.evm-ws-popup-innerSection").delay(100).fadeIn();
	  	}	
	  //$(".evm-wiser-popup-mainsection").addClass('evm-show');
	});
}

function leaveFromTop(e){
if( e.clientY < 0 ) // less than 60px is close enough to the top
	alert('y u leave from the top?');
}
function evmWiserClosePopup(days,type,popid){
	if(days){
		evmPopupSetCookie('evm-ws-popup-cookie_'+popid,'closed_popup',days,type);
		window.localStorage.setItem("evm_close_popup_forpage","1");
	}	
//$(".evm-wiser-popup-mainsection").hide();
/*if(wiser_shopID != '55534747822' && wiser_shopID != '53956214984'){
location.reload();
}else{*/
	$(".evm-wiser-popup-mainsection").hide();
// }
}
function evmPopupSetCookie(name,value,days,type) {
	var expires = "";
	if (days) {
		var date = new Date();
		if(type == 'minutes'){
			date.setTime(date.getTime()+(days*60*1000));
		}
		if(type == 'days') {   
			date.setTime(date.getTime() + (days*24*60*60*1000));
		}    

		expires = "; expires=" + date.toUTCString();
	}
	document.cookie = name + "=" + (value || "")  + expires + "; path=/";
}
function evmWiserPopupClick() {
	$(".wspopupurl").on("click", function(event) {
		event.preventDefault();
		var widget = $(this).attr("wiser-widget");
		var template = $(this).attr("wiser-template");
		var addtocart = $(this).attr("wiser-addcart");
		var evm_ws_popup_id = $(this).attr("wiser-popid");
		addtocart = addtocart == undefined ? 0 : 1;
		if ($(this).attr("data_id")) {
			var pid = $(this).attr("data_id");
		} else if ($(this).attr("data_prod_id")) {
			var pid = $(this).attr("data_prod_id");
		} else {
			var pid = $(this).attr("data-id");
		}
		pid = parseInt(pid);
		var siteurl = $(this).attr("href")
		evmPopupClickProcess(evm_ws_popup_id, pid, "", widget, template, addtocart, 'yes', siteurl);
	});
}


function evmWiserWishlist(wishlist_option){
	if(wishlist_option == 'wishlist@2'){
		jQuery(".ws-wishlist-icon").click(function() {
			var iWishvId = jQuery(this).attr("data-variant");
			if ($(this).hasClass("iwishAdded")){
				iwish_remove(jQuery(this),iWishvId,'')
				$(this).html('<i class="fa fa-heart-o" aria-hidden="true"></i>');
			}else{
				iwish_addCollection(jQuery(this),iWishvId);
				$(this).html('<i class="fa fa-heart" aria-hidden="true"></i>');
			}		        
			return false;
		});
	}	
	if(wishlist_option == 'wishlist_plus'){
		document.dispatchEvent(new CustomEvent("swym:collections-loaded"));
	}
}
function evmbuttonTemplate4click() {
	var evm_ws_theme_name = (window.BOOMR && window.BOOMR.themeName && typeof window.BOOMR.themeName !== undefined) ? window.BOOMR.themeName : "";	
	$( ".evm-ws-addtocart" ).click(function() {
		if(wiser_shopID == '22599949' || wiser_shopID == '26687963179'){
			$(".evm-ws-popup-variants-main").hide();
			var product_handle=$(this).attr('data-handle');
			window.open(wiser_shop_domain+"/products/"+product_handle,"_self");
		}
	});
	$( ".evm-add-to-cart-popup-inner" ).click(function() {
		
		var product_id=$(this).attr('data-pid');
		var random_id=$(this).attr('data-random');
		//$(".evm-wscontainer .owl-stage").css('transform','none');
		// $(".evm-wiser-owl-carousel").parent().addClass('evm-wi--popup-open-layout4');	
		$(".evm-ws-popup-variants-main").hide();
		$(".evm-ws-popup-variants-main_"+product_id+"_"+random_id).toggle();
	});
	$( ".evm-ws-popup-close" ).click(function() {
		var product_id=$(this).attr('data-pid');
		var random_id=$(this).attr('data-random');
		// $(".evm-wiser-owl-carousel").parent().removeClass('evm-wi--popup-open-layout4');	
		// $(".evm-wscontainer .owl-stage").css('transform','translate3d(0px, 0px, 0px)');
		$(".evm-ws-popup-variants-main_"+product_id+"_"+random_id).hide();
	});

	$( ".evm-add-variant-call" ).click(function(e) {
		e.preventDefault();
		$(".evm-add-variant-call").removeClass("active");
		//$(".evm-wscontainer .owl-stage").css('transform','translate3d(0px, 0px, 0px)');
		var product_id=$(this).attr('data-pid');
		var random=$(this).attr('data-random');
		var redirect = $(this).attr('data-redirect');
		var addtocart=1;
		var qty = 1;
		if(wiser_shopID == '8607989841') {
	  		qty = $(".wsnew-quantity-selector_"+product_id).html();
	  	}
		var template="template4";
		var widget = $(this).attr("data-widget");
		var PageName = $(this).attr("data-page");
		var current_object= $(this);
		current_object.addClass("active");
		var varid = $(this).attr('data-value');
		var slide_cart_integrate = wiser_settings_array.slide_cart_integrate;
		evmProductClickProcess(product_id,'no',"","",widget,template,addtocart,PageName);
		if(wiser_shopID != '33032994860') {
			/* code is not working for snowpeak store */
			var evm_jqxhr = jQuery.post('/cart/add.js', {
				quantity: qty,  id: varid
			});

			evm_jqxhr.always(function(data) {
				var res = (data.responseText == undefined) ? "" : JSON.parse(data.responseText);
				current_object.removeClass("active");
				if(res == "" || res.status== undefined) {
					$(".evm-ws-popup-variants-main_"+product_id+"_"+random).hide();
					if(PageName == 'cart' &&  wiser_shopID != '64259719381' && wiser_shopID != '2304865' &&  wiser_shopID != '25501564962' &&  wiser_shopID != '55448797236' &&  wiser_shopID != '5439553610' && wiser_shopID != '24996511832'){location.reload();}
					if(redirect == "true") {
						window.location.href = wiser_shop_domain+"/cart";
					} else {
						window.localStorage.setItem("evm_added_cart_pid",product_id);
						getWiserJSON('/cart.js',function(err, cart) {
							var newCount = cart.item_count;
							evm_cart_count(newCount);
						});
						$(".evm_side_cart_wiser").trigger("click");
						if(slide_cart_integrate == "true"){
							setTimeout(function() {
								$(".slidecart-container").trigger("open");
							},1000);
						}
						if(other_settings_array['is_ATC_msg_show'] == "true") {
							if(other_settings_array['addcart_confirmation_msg']==undefined || other_settings_array['addcart_confirmation_msg']=='undefined') {
								var ws_atcct = (wsLangTrans != null && wsLangTrans.ws_atcct != '' && wsLangTrans.ws_atcct != 'undefined' && wsLangTrans.ws_atcct != undefined) ? wsLangTrans.ws_atcct : 'Added to cart!';
								var ws_vc    = (wsLangTrans != null && wsLangTrans.ws_vc != '' && wsLangTrans.ws_vc != 'undefined' && wsLangTrans.ws_vc != undefined) ? wsLangTrans.ws_vc : 'View cart';
								var ws_or    = (wsLangTrans != null && wsLangTrans.ws_or != '' && wsLangTrans.ws_or != 'undefined' && wsLangTrans.ws_or != undefined) ? wsLangTrans.ws_or : 'or';
								var ws_csh   = (wsLangTrans != null && wsLangTrans.ws_csh != '' && wsLangTrans.ws_csh != 'undefined' && wsLangTrans.ws_csh != undefined) ? wsLangTrans.ws_csh : 'Continue shopping';
								$("#ws_card_success_"+random).html('<i class="fa fa-check"></i>'+ ws_atcct +'</br><a href="/cart">'+ws_vc+'</a> '+ws_or+' <a style="cursor:pointer;" onclick="evmWiserHideContinue('+random+')">'+ws_csh+'</a>.');
							} else {
								var ws_atcct = (wsLangTrans != null && wsLangTrans.ws_atcct != '' && wsLangTrans.ws_atcct != 'undefined' && wsLangTrans.ws_atcct != undefined) ? wsLangTrans.ws_atcct : other_settings_array['addcart_confirmation_msg'];
								var ws_vc    = (wsLangTrans != null && wsLangTrans.ws_vc != '' && wsLangTrans.ws_vc != 'undefined' && wsLangTrans.ws_vc != undefined) ? wsLangTrans.ws_vc :other_settings_array['viewcart_confirmation_msg'];
								var ws_or    = (wsLangTrans != null && wsLangTrans.ws_or != '' && wsLangTrans.ws_or != 'undefined' && wsLangTrans.ws_or != undefined) ? wsLangTrans.ws_or : other_settings_array['or_confirmation_msg'];
								var ws_csh   = (wsLangTrans != null && wsLangTrans.ws_csh != '' && wsLangTrans.ws_csh != 'undefined' && wsLangTrans.ws_csh != undefined) ? wsLangTrans.ws_csh : other_settings_array['countinue_confirmation_msg'];
								$("#ws_card_success_"+random).html('<i class="fa fa-check"></i>'+ws_atcct+'</br><a href="/cart">'+ws_vc+'</a>'+ws_or+'<a style="cursor:pointer;" onclick="evmWiserHideContinue('+random+')">'+ws_csh+'</a>');
							}
						}
						if(other_settings_array['is_ATC_msg_show'] == "true") {}
							setTimeout(function() {
								if(wiser_settings_array.after_ATC_activity != undefined && wiser_settings_array.after_ATC_activity != "") {
									var afterATCACT = wiser_settings_array.after_ATC_activity;
									eval(afterATCACT);
								}
							}, 100);
						setTimeout(function(){
							$("#ws_card_success_"+random).html("");
						}, 3000);
						if(evm_ws_theme_name == 'Prestige') {
							document.dispatchEvent(new CustomEvent('product:added', {
								bubbles: true,
								detail: {
									variant: varid,
									quantity: 1
								}
							}));
						}
					}
					/* this code use if wiser cart drawer enabled no any issue created by this code */
					let __wsCartStatus = localStorage.getItem(wsCartStatus);

					if (__wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 1 && __wsChkCdWdgtInit == 0) {
						__wsUpdCartDrawer();
						/* call this function when prouct added to cart if you got success */
						__wsChkCdWdgtInit = 1;
						setTimeout(function() { __wsChkCdWdgtInit = 0; }, 3000);
					}
					__wsAttrGetCartData('calling from wiser widgets at the time of Add to Cart'); /* call this function for attributes when prouct added to cart if you got success */
					/* end this code use if wiser cart drawer enabled no any issue created by this code */
					if(wsCrtDate > "2024-06-24" && __wsCartStatus !== "undefined" && __wsCartStatus !== null && __wsCartStatus == 0) __wsUpdLineItemsInCartDrwr();
				}
			});
			evm_jqxhr.fail(function(data) {
				var res = (data.responseText == undefined) ? "" : JSON.parse(data.responseText);
				if(res == "" || res.status=='422') {
					$(".evm-ws-popup-variants-main_"+product_id+"_"+random).hide();		
					var prod_out_of_stock = (wsLangTrans != null && wsLangTrans.ws_poofs != '') ? wsLangTrans.ws_poofs : other_settings_array['CTA_outofstockmsg'];
					if(wsLangTrans.ws_poofs == undefined || wsLangTrans.ws_poofs == 'undefined'){
						prod_out_of_stock = other_settings_array['CTA_outofstockmsg'];
					}
					$("#ws_card_success_"+random).html('<i class="ws-close"></i> '+prod_out_of_stock);		
					setTimeout(function(){ $("#ws_card_success_"+random).html(""); }, 3000);
				}	
			});
		}
	});
}
function evmWsPaginationMobile(){
	var wsarr = ['evm-recommended-products','recently-viewed','evm-new-arrivals-product','evm-featured-collections-product','evm-most-popular-products','trending-products','evm-related-product','evm-related-viewed-browsing'];
	for (var i = 0; i < wsarr.length; i++) {
		PaginationMobileNextItems(wsarr[i]);
	}

	$('.WSevmshowMore').on('click', function (e) {
		e.preventDefault();
		var pagination = (wiser_shopID == '47486599330') ? 5 : 2;
		var itemsvalue = $(this).attr("data-value");
		var itemsCount = $(this).attr("data-current");
		itemsCount = parseInt(itemsCount);
		var itemsMax = $('.'+itemsvalue+' .ws-box-wrapper').length;
		for (var i = itemsCount; i < (itemsCount + pagination); i++) {
			$('.'+itemsvalue+' .ws-box-wrapper:eq(' + i + ')').delay(100).fadeIn();
		}
		itemsCount += pagination;
		$(this).attr('data-current',itemsCount);
		if (itemsCount >= itemsMax) {
			$('.'+itemsvalue+' .evm-ws-pagination').delay(100).fadeOut();
		}
	});
}
function PaginationMobileNextItems(element) {
	var pagination = (wiser_shopID == '47486599330') ? 5 : 2;
	var itemsCount=0;
	var itemsMax = $('.'+element+' .ws-box-wrapper').length;
	for (var i = itemsCount; i < (itemsCount + pagination); i++) {
		$('.'+element+' .ws-box-wrapper:eq(' + i + ')').delay(100).fadeIn();
	}

	itemsCount += pagination;
	$('.'+element+' .WSevmshowMore').attr('data-current',itemsCount);

	if (itemsCount >= itemsMax) {
		$('.'+element+' .evm-ws-pagination').delay(100).fadeOut();
	}
};

function evmWSQuickView(qphandle) {
	jQuery.getJSON('/products/'+qphandle, function(productdetails) {
		$('body').addClass('evmscrollremove');
		var handle = productdetails.product.handle;
		var holder = document.getElementById('QuickShopHolder-' + productdetails.product.handle);
		var url = '/products/' + productdetails.product.handle + '?view=modal';
		url = url.replace('//', '/');  
		fetch(url).then(function(response) {
			return response.text();
		}).then(function(html) {
			var vQMHtml='<div id="QuickShopModal-'+productdetails.product.id+'" class="modal modal--square modal--quick-shop evm--quick-shop modal--is-active" data-product-id="'+productdetails.product.id+'" tabindex="-1">';
			vQMHtml+='<div class="modal__inner">';
			vQMHtml+='<button type="button" class="evm-wi-quick-close-btn">';
			vQMHtml+='<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close" viewBox="0 0 64 64">';
			vQMHtml+='<defs>';
			vQMHtml+='<style>.cls-1{fill:none;stroke:#000;stroke-miterlimit:10;stroke-width:2px}</style>';
			vQMHtml+='</defs>';
			vQMHtml+='<title>Close this</title>';
			vQMHtml+='<path class="cls-1" d="M19 17.61l27.12 27.13m0-27.12L19 44.74"></path>';
			vQMHtml+='</svg>';
			vQMHtml+='<span class="icon__fallback-text">"Close (esc)"</span>';
			vQMHtml+='</button>';
			vQMHtml+=' <div class="modal__centered">';
			vQMHtml+='<div class="modal__centered-content">';
			vQMHtml+='<div id="QuickShopHolder-'+productdetails.product.handle+'">';


			var texthtml = html;
			var myArray = texthtml.split("<div data-product-blocks>");
			var newhtml = myArray[0];
			vQMHtml+='<div id="shopify-section-template--14614738763863__main" class="shopify-section"><div id="ProductSection-template--14614738763863__main-'+productdetails.product.id+'" class="product-section" data-section-id="template--14614738763863__main" data-product-id="'+productdetails.product.id+'" data-section-type="product" data-product-handle="'+productdetails.product.handle+'" data-product-title="'+productdetails.product.title+'" data-product-url="/products/'+productdetails.product.handle+'" data-aspect-ratio="100.0" data-img-url="'+productdetails.product.image.src+'" data-modal="true">';
			vQMHtml+='<div class="page-content page-content--product">';
			vQMHtml+=' <div class="page-width">';
			vQMHtml+='<div class="grid grid--product-images--partial">';
			vQMHtml+='<div class="grid__item medium-up--one-half product-single__sticky">';

			var evmvimages = productdetails.product.images;
			vQMHtml+='<div class="row">';
			vQMHtml+='<div class="evmcol1">'; 
			if(evmvimages.length >1)  
			{
				vQMHtml+='<div class="carousel carousel-nav" data-flickity=\'{ "asNavFor": ".carousel-main","prevNextButtons": false, "draggable": true, "contain": true,  "pageDots": false }\'>';

				for (var i = 0; i < evmvimages.length; i++) {
					vQMHtml+='<div class="carousel-cell"><img src="'+evmvimages[i].src+'" /></div>';      
				}
				vQMHtml+='</div>';
			}
			vQMHtml+=' </div> ';

			vQMHtml+='<div class="evmcol11">'; 
			vQMHtml+='<div class="carousel carousel-main" data-flickity=\'{ "contain": true,"prevNextButtons": false, "pageDots": false }\'> ';
			for (var i = 0; i < evmvimages.length; i++) {
				vQMHtml+='<div class="carousel-cell"><img src="'+evmvimages[i].src+'" /></div>';      
			}
			vQMHtml+='  </div> ';
			vQMHtml+=' </div> ';
			vQMHtml+='</div> ';
			vQMHtml+=' </div>';



			vQMHtml+='<div class="grid__item medium-up--one-half">';
			vQMHtml+='<div class="product-single__meta"> <div class="product-block product-block--header"><div class="product-single__vendor"><a href="/collections/vendors?='+productdetails.product.vendor+'"> '+productdetails.product.vendor+' </a></div><p class="h2 product-single__title">'+productdetails.product.title+'</p></div>';
			vQMHtml+='<div data-blocks-holder="" data-url="/products/'+handle+'" data-template="" class="product-form-holder--loaded"><div data-product-blocks="">';
			vQMHtml+='<div class="product-block product-block--price">';
			vQMHtml+='<span data-a11y-price="" class="visually-hidden">Regular price</span>';

			if(productdetails.product.variants[0].compare_at_price>0)
			{
				vQMHtml+='<span data-product-price-wrap="" class="">';
				vQMHtml+='<span data-compare-price="" class="product__price product__price--compare">$'+productdetails.product.variants[0].compare_at_price+'';
				vQMHtml+='</span>';
				vQMHtml+='</span>';
			}
			vQMHtml+='<span data-product-price="" class="product__price">$'+productdetails.product.variants[0].price+'</span>';
			vQMHtml+='<div data-unit-price-wrapper="" class="product__unit-price product__unit-price--spacing  hide">';
			vQMHtml+='<span data-unit-price=""></span>/<span data-unit-base=""></span>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="product__policies rte small--text-center">';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="product-block"><hr></div>';
			vQMHtml+='<div class="product-block"></div>';
			vQMHtml+='<div class="product-block product-block--sales-point">';
			vQMHtml+='<ul class="sales-points">';

			vQMHtml+='<li data-incoming-inventory="" class="sales-point hide">';
			vQMHtml+='<span class="icon-and-text">';
			vQMHtml+='<span class="icon icon--inventory"></span>';
			vQMHtml+='<span class="js-incoming-text">Inventory on the way</span></span>';
			vQMHtml+='</li>';
			vQMHtml+='</ul>';
			vQMHtml+='</div>';

			vQMHtml+='<div data-product-id="'+productdetails.product.id+'" class="hide js-product-inventory-data" aria-hidden="true"><div class="js-variant-inventory-data" data-id="'+productdetails.product.id+'" data-quantity="999" data-policy="deny" data-incoming="false" data-date="">';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="product-block"><div class="product-block"><form method="post" action="/cart/add" id="AddToCartForm-template--14850517499991__main-'+productdetails.product.id+'-modal" accept-charset="UTF-8" class="product-single__form" enctype="multipart/form-data"><input type="hidden" name="form_type" value="product"><input type="hidden" name="utf8" value="✓"><div class="payment-buttons"><div style="clear:both;"></div>';
			vQMHtml+='<div class="product--cta-btns" style="min-height:45px;">';
			vQMHtml+='<button type="button" onclick="wiserOpenCartDrawer('+productdetails.product.variants[0].id+');" name="add" id="AddToCart--modal" class="btn btn--add-to-cart add-to-cart btn--secondary" style="width:100%;">';
			vQMHtml+='<span class="icon-my-bag-add-to-cart product__my-bag-icon"></span>';
			vQMHtml+='<span id="AddToCartText--modal">Add to cart</span>';
			vQMHtml+='</button>';
			vQMHtml+='</div>';
			vQMHtml+='<div data-shopify="payment-button" data-has-selling-plan="false" data-has-fixed-selling-plan="false" class="shopify-payment-button">';
			vQMHtml+='<div>';
			vQMHtml+='<div>';
			vQMHtml+='<div>';
			vQMHtml+='<div class="shopify-cleanslate">';
			vQMHtml+='<div id="shopify-svg-symbols" class="VoW3UuJKYxZJHMpUkDNUv" aria-hidden="true">';


			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div>';
			vQMHtml+='<div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="shopify-payment-terms product__policies"></div>';
			vQMHtml+='<select name="id" data-product-select="" class="product-single__variants no-js"><option selected="selected" value="'+productdetails.product.variants[0].id+'">Default Title - $24.00 USD';
			vQMHtml+='</option>';
			vQMHtml+='</select>';
			vQMHtml+='<textarea data-variant-json="" class="hide" aria-hidden="true" aria-label="Product JSON">    [{"id":'+productdetails.product.variants[0].id+',"title":"Default Title","option1":"Default Title","option2":null,"option3":null,"sku":"17229","requires_shipping":true,"taxable":true,"featured_image":null,"available":true,"name":"12\" Panda Plush with Party Hat","public_title":null,"options":["Default Title"],"price":2400,"weight":0,"compare_at_price":null,"inventory_quantity":999,"inventory_management":"shopify","inventory_policy":"deny","barcode":"843479169041","requires_selling_plan":false,"selling_plan_allocations":[]}]';
			vQMHtml+='</textarea>';
			vQMHtml+='</form>';
			vQMHtml+='</div>';

			vQMHtml+='</div>';
			vQMHtml+='<div id="StoreAvailabilityDrawer" class="drawer drawer--right text-left">';
			vQMHtml+='<div class="drawer__contents">';
			vQMHtml+='<div class="drawer__fixed-header">';
			vQMHtml+='<div class="drawer__header appear-animation appear-delay-1">';
			vQMHtml+='<div class="drawer__title">';
			vQMHtml+='<div data-availability-product-title="">12" Panda Plush with Party Hat</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="drawer__close">';
			vQMHtml+='<button type="button" class="drawer__close-button js-drawer-close">';
			vQMHtml+='<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close" viewBox="0 0 64 64"><path d="M19 17.61l27.12 27.13m0-27.12L19 44.74"></path></svg>';
			vQMHtml+='<span class="icon__fallback-text">Close cart</span>';
			vQMHtml+='</button>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="drawer__inner">';
			vQMHtml+='<div class="drawer__scrollable">';
			vQMHtml+='<div class="appear-animation appear-delay-2">';
			vQMHtml+='<div class="store-availability">';
			vQMHtml+='<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-in-stock" viewBox="0 0 12 10"><path fill-rule="evenodd" clip-rule="evenodd" d="M3.293 9.707l-3-3a.999.999 0 1 1 1.414-1.414l2.236 2.236 6.298-7.18a.999.999 0 1 1 1.518 1.3l-7 8a1 1 0 0 1-.72.35 1.017 1.017 0 0 1-.746-.292z" fill="#212B36"></path></svg>';
			vQMHtml+='<div class="store-availability__info">';
			vQMHtml+='<div><strong> FAO Schwarz Store</strong>';
			vQMHtml+='</div>';
			vQMHtml+='<p class="store-availability__small">Pickup available, usually ready in 8 hours';
			vQMHtml+='</p>';
			vQMHtml+='<div class="store-availability__small"><p>30 Rockefeller Plaza<br>New York NY 10111<br>United States</p><p>+18003268638</p>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>'
			vQMHtml+='<div id="shopify-block-b65fa47f-d634-425f-a192-0c8203dec5f5-modal" class="shopify-block shopify-app-block">';
			vQMHtml+='<div id="widget-fave-html-modal">';
			vQMHtml+='</div>';


			(function(e,i){if(typeof define=="function"&&define.amd){define("jquery-bridget/jquery-bridget",["jquery"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("jquery"))}else{e.jQueryBridget=i(e,e.jQuery)}})(window,function t(e,r){"use strict";var o=Array.prototype.slice;var i=e.console;var u=typeof i=="undefined"?function(){}:function(t){i.error(t)};function n(h,s,c){c=c||r||e.jQuery;if(!c){return}if(!s.prototype.option){s.prototype.option=function(t){if(!c.isPlainObject(t)){return}this.options=c.extend(true,this.options,t)}}c.fn[h]=function(t){if(typeof t=="string"){var e=o.call(arguments,1);return i(this,t,e)}n(this,t);return this};function i(t,r,o){var a;var l="$()."+h+'("'+r+'")';t.each(function(t,e){var i=c.data(e,h);if(!i){u(h+" not initialized. Cannot call methods, i.e. "+l);return}var n=i[r];if(!n||r.charAt(0)=="_"){u(l+" is not a valid method");return}var s=n.apply(i,o);a=a===undefined?s:a});return a!==undefined?a:t}function n(t,n){t.each(function(t,e){var i=c.data(e,h);if(i){i.option(n);i._init()}else{i=new s(e,n);c.data(e,h,i)}})}a(c)}function a(t){if(!t||t&&t.bridget){return}t.bridget=n}a(r||e.jQuery);return n});(function(t,e){if(typeof define=="function"&&define.amd){define("ev-emitter/ev-emitter",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.EvEmitter=e()}})(typeof window!="undefined"?window:this,function(){function t(){}var e=t.prototype;e.on=function(t,e){if(!t||!e){return}var i=this._events=this._events||{};var n=i[t]=i[t]||[];if(n.indexOf(e)==-1){n.push(e)}return this};e.once=function(t,e){if(!t||!e){return}this.on(t,e);var i=this._onceEvents=this._onceEvents||{};var n=i[t]=i[t]||{};n[e]=true;return this};e.off=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}var n=i.indexOf(e);if(n!=-1){i.splice(n,1)}return this};e.emitEvent=function(t,e){var i=this._events&&this._events[t];if(!i||!i.length){return}i=i.slice(0);e=e||[];var n=this._onceEvents&&this._onceEvents[t];for(var s=0;s<i.length;s++){var r=i[s];var o=n&&n[r];if(o){this.off(t,r);delete n[r]}r.apply(this,e)}return this};e.allOff=function(){delete this._events;delete this._onceEvents};return t});

			(function(t,e){if(typeof define=="function"&&define.amd){define("get-size/get-size",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.getSize=e()}})(window,function t(){"use strict";function m(t){var e=parseFloat(t);var i=t.indexOf("%")==-1&&!isNaN(e);return i&&e}function e(){}var i=typeof console=="undefined"?e:function(t){console.error(t)};var y=["paddingLeft","paddingRight","paddingTop","paddingBottom","marginLeft","marginRight","marginTop","marginBottom","borderLeftWidth","borderRightWidth","borderTopWidth","borderBottomWidth"];var b=y.length;function E(){var t={width:0,height:0,innerWidth:0,innerHeight:0,outerWidth:0,outerHeight:0};for(var e=0;e<b;e++){var i=y[e];t[i]=0}return t}function S(t){var e=getComputedStyle(t);if(!e){i("Style returned "+e+". Are you running this code in a hidden iframe on Firefox? "+"See https://bit.ly/getsizebug1")}return e}var n=false;var C;function x(){if(n){return}n=true;var t=document.createElement("div");t.style.width="200px";t.style.padding="1px 2px 3px 4px";t.style.borderStyle="solid";t.style.borderWidth="1px 2px 3px 4px";t.style.boxSizing="border-box";var e=document.body||document.documentElement;e.appendChild(t);var i=S(t);C=Math.round(m(i.width))==200;s.isBoxSizeOuter=C;e.removeChild(t)}function s(t){x();if(typeof t=="string"){t=document.querySelector(t)}if(!t||typeof t!="object"||!t.nodeType){return}var e=S(t);if(e.display=="none"){return E()}var i={};i.width=t.offsetWidth;i.height=t.offsetHeight;var n=i.isBorderBox=e.boxSizing=="border-box";for(var s=0;s<b;s++){var r=y[s];var o=e[r];var a=parseFloat(o);i[r]=!isNaN(a)?a:0}var l=i.paddingLeft+i.paddingRight;var h=i.paddingTop+i.paddingBottom;var c=i.marginLeft+i.marginRight;var u=i.marginTop+i.marginBottom;var d=i.borderLeftWidth+i.borderRightWidth;var f=i.borderTopWidth+i.borderBottomWidth;var p=n&&C;var v=m(e.width);if(v!==false){i.width=v+(p?0:l+d)}var g=m(e.height);if(g!==false){i.height=g+(p?0:h+f)}i.innerWidth=i.width-(l+d);i.innerHeight=i.height-(h+f);i.outerWidth=i.width+c;i.outerHeight=i.height+u;return i}return s});(function(t,e){"use strict";if(typeof define=="function"&&define.amd){define("desandro-matches-selector/matches-selector",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.matchesSelector=e()}})(window,function t(){"use strict";var n=function(){var t=window.Element.prototype;if(t.matches){return"matches"}if(t.matchesSelector){return"matchesSelector"}var e=["webkit","moz","ms","o"];for(var i=0;i<e.length;i++){var n=e[i];var s=n+"MatchesSelector";if(t[s]){return s}}}();return function t(e,i){return e[n](i)}});(function(e,i){if(typeof define=="function"&&define.amd){define("fizzy-ui-utils/utils",["desandro-matches-selector/matches-selector"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("desandro-matches-selector"))}else{e.fizzyUIUtils=i(e,e.matchesSelector)}})(window,function t(h,r){var c={};c.extend=function(t,e){for(var i in e){t[i]=e[i]}return t};c.modulo=function(t,e){return(t%e+e)%e};var i=Array.prototype.slice;c.makeArray=function(t){if(Array.isArray(t)){return t}if(t===null||t===undefined){return[]}var e=typeof t=="object"&&typeof t.length=="number";if(e){return i.call(t)}return[t]};c.removeFrom=function(t,e){var i=t.indexOf(e);if(i!=-1){t.splice(i,1)}};c.getParent=function(t,e){while(t.parentNode&&t!=document.body){t=t.parentNode;if(r(t,e)){return t}}};c.getQueryElement=function(t){if(typeof t=="string"){return document.querySelector(t)}return t};c.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.filterFindElements=function(t,n){t=c.makeArray(t);var s=[];t.forEach(function(t){if(!(t instanceof HTMLElement)){return}if(!n){s.push(t);return}if(r(t,n)){s.push(t)}var e=t.querySelectorAll(n);for(var i=0;i<e.length;i++){s.push(e[i])}});return s};c.debounceMethod=function(t,e,n){n=n||100;var s=t.prototype[e];var r=e+"Timeout";t.prototype[e]=function(){var t=this[r];clearTimeout(t);var e=arguments;var i=this;this[r]=setTimeout(function(){s.apply(i,e);delete i[r]},n)}};c.docReady=function(t){var e=document.readyState;if(e=="complete"||e=="interactive"){setTimeout(t)}else{document.addEventListener("DOMContentLoaded",t)}};c.toDashed=function(t){return t.replace(/(.)([A-Z])/g,function(t,e,i){return e+"-"+i}).toLowerCase()};var u=h.console;c.htmlInit=function(a,l){c.docReady(function(){var t=c.toDashed(l);var s="data-"+t;var e=document.querySelectorAll("["+s+"]");var i=document.querySelectorAll(".js-"+t);var n=c.makeArray(e).concat(c.makeArray(i));var r=s+"-options";var o=h.jQuery;n.forEach(function(e){var t=e.getAttribute(s)||e.getAttribute(r);var i;try{i=t&&JSON.parse(t)}catch(t){if(u){u.error("Error parsing "+s+" on "+e.className+": "+t)}return}var n=new a(e,i);if(o){o.data(e,l,n)}})})};return c});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/cell",["get-size/get-size"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("get-size"))}else{e.Flickity=e.Flickity||{};e.Flickity.Cell=i(e,e.getSize)}})(window,function t(e,i){function n(t,e){this.element=t;this.parent=e;this.create()}var s=n.prototype;s.create=function(){this.element.style.position="absolute";this.element.setAttribute("aria-hidden","true");this.x=0;this.shift=0;this.element.style[this.parent.originSide]=0};s.destroy=function(){this.unselect();this.element.style.position="";var t=this.parent.originSide;this.element.style[t]="";this.element.style.transform="";this.element.removeAttribute("aria-hidden")};s.getSize=function(){this.size=i(this.element)};s.setPosition=function(t){this.x=t;this.updateTarget();this.renderPosition(t)};s.updateTarget=s.setDefaultTarget=function(){var t=this.parent.originSide=="left"?"marginLeft":"marginRight";this.target=this.x+this.size[t]+this.size.width*this.parent.cellAlign};s.renderPosition=function(t){var e=this.parent.originSide==="left"?1:-1;var i=this.parent.options.percentPosition?t*e*(this.parent.size.innerWidth/this.size.width):t*e;this.element.style.transform="translateX("+this.parent.getPositionValue(i)+")"};s.select=function(){this.element.classList.add("is-selected");this.element.removeAttribute("aria-hidden")};s.unselect=function(){this.element.classList.remove("is-selected");this.element.setAttribute("aria-hidden","true")};s.wrapShift=function(t){this.shift=t;this.renderPosition(this.x+this.parent.slideableWidth*t)};s.remove=function(){this.element.parentNode.removeChild(this.element)};return n});(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/slide",e)}else if(typeof module=="object"&&module.exports){module.exports=e()}else{t.Flickity=t.Flickity||{};t.Flickity.Slide=e()}})(window,function t(){"use strict";function e(t){this.parent=t;this.isOriginLeft=t.originSide=="left";this.cells=[];this.outerWidth=0;this.height=0}var i=e.prototype;i.addCell=function(t){this.cells.push(t);this.outerWidth+=t.size.outerWidth;this.height=Math.max(t.size.outerHeight,this.height);if(this.cells.length==1){this.x=t.x;var e=this.isOriginLeft?"marginLeft":"marginRight";this.firstMargin=t.size[e]}};i.updateTarget=function(){var t=this.isOriginLeft?"marginRight":"marginLeft";var e=this.getLastCell();var i=e?e.size[t]:0;var n=this.outerWidth-(this.firstMargin+i);this.target=this.x+this.firstMargin+n*this.parent.cellAlign};i.getLastCell=function(){return this.cells[this.cells.length-1]};i.select=function(){this.cells.forEach(function(t){t.select()})};i.unselect=function(){this.cells.forEach(function(t){t.unselect()})};i.getCellElements=function(){return this.cells.map(function(t){return t.element})};return e});(function(e,i){if(typeof define=="function"&&define.amd){define("flickity/js/animate",["fizzy-ui-utils/utils"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("fizzy-ui-utils"))}else{e.Flickity=e.Flickity||{};e.Flickity.animatePrototype=i(e,e.fizzyUIUtils)}})(window,function t(e,i){var n={};n.startAnimation=function(){if(this.isAnimating){return}this.isAnimating=true;this.restingFrames=0;this.animate()};n.animate=function(){this.applyDragForce();this.applySelectedAttraction();var t=this.x;this.integratePhysics();this.positionSlider();this.settle(t);if(this.isAnimating){var e=this;requestAnimationFrame(function t(){e.animate()})}};n.positionSlider=function(){var t=this.x;if(this.options.wrapAround&&this.cells.length>1){t=i.modulo(t,this.slideableWidth);t-=this.slideableWidth;this.shiftWrapCells(t)}this.setTranslateX(t,this.isAnimating);this.dispatchScrollEvent()};n.setTranslateX=function(t,e){t+=this.cursorPosition;t=this.options.rightToLeft?-t:t;var i=this.getPositionValue(t);this.slider.style.transform=e?"translate3d("+i+",0,0)":"translateX("+i+")"};n.dispatchScrollEvent=function(){var t=this.slides[0];if(!t){return}var e=-this.x-t.target;var i=e/this.slidesWidth;this.dispatchEvent("scroll",null,[i,e])};n.positionSliderAtSelected=function(){if(!this.cells.length){return}this.x=-this.selectedSlide.target;this.velocity=0;this.positionSlider()};n.getPositionValue=function(t){if(this.options.percentPosition){return Math.round(t/this.size.innerWidth*1e4)*.01+"%"}else{return Math.round(t)+"px"}};n.settle=function(t){var e=!this.isPointerDown&&Math.round(this.x*100)==Math.round(t*100);if(e){this.restingFrames++}if(this.restingFrames>2){this.isAnimating=false;delete this.isFreeScrolling;this.positionSlider();this.dispatchEvent("settle",null,[this.selectedIndex])}};n.shiftWrapCells=function(t){var e=this.cursorPosition+t;this._shiftCells(this.beforeShiftCells,e,-1);var i=this.size.innerWidth-(t+this.slideableWidth+this.cursorPosition);this._shiftCells(this.afterShiftCells,i,1)};n._shiftCells=function(t,e,i){for(var n=0;n<t.length;n++){var s=t[n];var r=e>0?i:0;s.wrapShift(r);e-=s.size.outerWidth}};n._unshiftCells=function(t){if(!t||!t.length){return}for(var e=0;e<t.length;e++){t[e].wrapShift(0)}};n.integratePhysics=function(){this.x+=this.velocity;this.velocity*=this.getFrictionFactor()};n.applyForce=function(t){this.velocity+=t};n.getFrictionFactor=function(){return 1-this.options[this.isFreeScrolling?"freeScrollFriction":"friction"]};n.getRestingPosition=function(){return this.x+this.velocity/(1-this.getFrictionFactor())};n.applyDragForce=function(){if(!this.isDraggable||!this.isPointerDown){return}var t=this.dragX-this.x;var e=t-this.velocity;this.applyForce(e)};n.applySelectedAttraction=function(){var t=this.isDraggable&&this.isPointerDown;if(t||this.isFreeScrolling||!this.slides.length){return}var e=this.selectedSlide.target*-1-this.x;var i=e*this.options.selectedAttraction;this.applyForce(i)};return n});(function(o,a){if(typeof define=="function"&&define.amd){define("flickity/js/flickity",["ev-emitter/ev-emitter","get-size/get-size","fizzy-ui-utils/utils","./cell","./slide","./animate"],function(t,e,i,n,s,r){return a(o,t,e,i,n,s,r)})}else if(typeof module=="object"&&module.exports){module.exports=a(o,require("ev-emitter"),require("get-size"),require("fizzy-ui-utils"),require("./cell"),require("./slide"),require("./animate"))}else{var t=o.Flickity;o.Flickity=a(o,o.EvEmitter,o.getSize,o.fizzyUIUtils,t.Cell,t.Slide,t.animatePrototype)}})(window,function t(n,e,i,a,s,o,r){var l=n.jQuery;var h=n.getComputedStyle;var c=n.console;function u(t,e){t=a.makeArray(t);while(t.length){e.appendChild(t.shift())}}var d=0;var f={};function p(t,e){var i=a.getQueryElement(t);if(!i){if(c){c.error("Bad element for Flickity: "+(i||t))}return}this.element=i;if(this.element.flickityGUID){var n=f[this.element.flickityGUID];if(n)n.option(e);return n}if(l){this.$element=l(this.element)}this.options=a.extend({},this.constructor.defaults);this.option(e);this._create()}p.defaults={accessibility:true,cellAlign:"center",freeScrollFriction:.075,friction:.28,namespaceJQueryEvents:true,percentPosition:true,resize:true,selectedAttraction:.025,setGallerySize:true};p.createMethods=[];var v=p.prototype;a.extend(v,e.prototype);v._create=function(){var t=this.guid=++d;this.element.flickityGUID=t;f[t]=this;this.selectedIndex=0;this.restingFrames=0;this.x=0;this.velocity=0;this.originSide=this.options.rightToLeft?"right":"left";this.viewport=document.createElement("div");this.viewport.className="flickity-viewport";this._createSlider();if(this.options.resize||this.options.watchCSS){n.addEventListener("resize",this)}for(var e in this.options.on){var i=this.options.on[e];this.on(e,i)}p.createMethods.forEach(function(t){this[t]()},this);if(this.options.watchCSS){this.watchCSS()}else{this.activate()}};v.option=function(t){a.extend(this.options,t)};v.activate=function(){if(this.isActive){return}this.isActive=true;this.element.classList.add("flickity-enabled");if(this.options.rightToLeft){this.element.classList.add("flickity-rtl")}this.getSize();var t=this._filterFindCellElements(this.element.children);u(t,this.slider);this.viewport.appendChild(this.slider);this.element.appendChild(this.viewport);this.reloadCells();if(this.options.accessibility){this.element.tabIndex=0;this.element.addEventListener("keydown",this)}this.emitEvent("activate");this.selectInitialIndex();this.isInitActivated=true;this.dispatchEvent("ready")};v._createSlider=function(){var t=document.createElement("div");t.className="flickity-slider";t.style[this.originSide]=0;this.slider=t};v._filterFindCellElements=function(t){return a.filterFindElements(t,this.options.cellSelector)};v.reloadCells=function(){this.cells=this._makeCells(this.slider.children);this.positionCells();this._getWrapShiftCells();this.setGallerySize()};v._makeCells=function(t){var e=this._filterFindCellElements(t);var i=e.map(function(t){return new s(t,this)},this);return i};v.getLastCell=function(){return this.cells[this.cells.length-1]};v.getLastSlide=function(){return this.slides[this.slides.length-1]};v.positionCells=function(){this._sizeCells(this.cells);this._positionCells(0)};v._positionCells=function(t){t=t||0;this.maxCellHeight=t?this.maxCellHeight||0:0;var e=0;if(t>0){var i=this.cells[t-1];e=i.x+i.size.outerWidth}var n=this.cells.length;for(var s=t;s<n;s++){var r=this.cells[s];r.setPosition(e);e+=r.size.outerWidth;this.maxCellHeight=Math.max(r.size.outerHeight,this.maxCellHeight)}this.slideableWidth=e;this.updateSlides();this._containSlides();this.slidesWidth=n?this.getLastSlide().target-this.slides[0].target:0};v._sizeCells=function(t){t.forEach(function(t){t.getSize()})};v.updateSlides=function(){this.slides=[];if(!this.cells.length){return}var n=new o(this);this.slides.push(n);var t=this.originSide=="left";var s=t?"marginRight":"marginLeft";var r=this._getCanCellFit();this.cells.forEach(function(t,e){if(!n.cells.length){n.addCell(t);return}var i=n.outerWidth-n.firstMargin+(t.size.outerWidth-t.size[s]);if(r.call(this,e,i)){n.addCell(t)}else{n.updateTarget();n=new o(this);this.slides.push(n);n.addCell(t)}},this);n.updateTarget();this.updateSelectedSlide()};v._getCanCellFit=function(){var t=this.options.groupCells;if(!t){return function(){return false}}else if(typeof t=="number"){var e=parseInt(t,10);return function(t){return t%e!==0}}var i=typeof t=="string"&&t.match(/^(\d+)%$/);var n=i?parseInt(i[1],10)/100:1;return function(t,e){return e<=(this.size.innerWidth+1)*n}};v._init=v.reposition=function(){this.positionCells();this.positionSliderAtSelected()};v.getSize=function(){this.size=i(this.element);this.setCellAlign();this.cursorPosition=this.size.innerWidth*this.cellAlign};var g={center:{left:.5,right:.5},left:{left:0,right:1},right:{right:0,left:1}};v.setCellAlign=function(){var t=g[this.options.cellAlign];this.cellAlign=t?t[this.originSide]:this.options.cellAlign};v.setGallerySize=function(){if(this.options.setGallerySize){var t=this.options.adaptiveHeight&&this.selectedSlide?this.selectedSlide.height:this.maxCellHeight;this.viewport.style.height=t+"px"}};v._getWrapShiftCells=function(){if(!this.options.wrapAround){return}this._unshiftCells(this.beforeShiftCells);this._unshiftCells(this.afterShiftCells);var t=this.cursorPosition;var e=this.cells.length-1;this.beforeShiftCells=this._getGapCells(t,e,-1);t=this.size.innerWidth-this.cursorPosition;this.afterShiftCells=this._getGapCells(t,0,1)};v._getGapCells=function(t,e,i){var n=[];while(t>0){var s=this.cells[e];if(!s){break}n.push(s);e+=i;t-=s.size.outerWidth}return n};v._containSlides=function(){if(!this.options.contain||this.options.wrapAround||!this.cells.length){return}var t=this.options.rightToLeft;var e=t?"marginRight":"marginLeft";var i=t?"marginLeft":"marginRight";var n=this.slideableWidth-this.getLastCell().size[i];var s=n<this.size.innerWidth;var r=this.cursorPosition+this.cells[0].size[e];var o=n-this.size.innerWidth*(1-this.cellAlign);this.slides.forEach(function(t){if(s){t.target=n*this.cellAlign}else{t.target=Math.max(t.target,r);t.target=Math.min(t.target,o)}},this)};v.dispatchEvent=function(t,e,i){var n=e?[e].concat(i):i;this.emitEvent(t,n);if(l&&this.$element){t+=this.options.namespaceJQueryEvents?".flickity":"";var s=t;if(e){var r=new l.Event(e);r.type=t;s=r}this.$element.trigger(s,i)}};v.select=function(t,e,i){if(!this.isActive){return}t=parseInt(t,10);this._wrapSelect(t);if(this.options.wrapAround||e){t=a.modulo(t,this.slides.length)}if(!this.slides[t]){return}var n=this.selectedIndex;this.selectedIndex=t;this.updateSelectedSlide();if(i){this.positionSliderAtSelected()}else{this.startAnimation()}if(this.options.adaptiveHeight){this.setGallerySize()}this.dispatchEvent("select",null,[t]);if(t!=n){this.dispatchEvent("change",null,[t])}this.dispatchEvent("cellSelect")};v._wrapSelect=function(t){var e=this.slides.length;var i=this.options.wrapAround&&e>1;if(!i){return t}var n=a.modulo(t,e);var s=Math.abs(n-this.selectedIndex);var r=Math.abs(n+e-this.selectedIndex);var o=Math.abs(n-e-this.selectedIndex);if(!this.isDragSelect&&r<s){t+=e}else if(!this.isDragSelect&&o<s){t-=e}if(t<0){this.x-=this.slideableWidth}else if(t>=e){this.x+=this.slideableWidth}};v.previous=function(t,e){this.select(this.selectedIndex-1,t,e)};v.next=function(t,e){this.select(this.selectedIndex+1,t,e)};v.updateSelectedSlide=function(){var t=this.slides[this.selectedIndex];if(!t){return}this.unselectSelectedSlide();this.selectedSlide=t;t.select();this.selectedCells=t.cells;this.selectedElements=t.getCellElements();this.selectedCell=t.cells[0];this.selectedElement=this.selectedElements[0]};v.unselectSelectedSlide=function(){if(this.selectedSlide){this.selectedSlide.unselect()}};v.selectInitialIndex=function(){var t=this.options.initialIndex;if(this.isInitActivated){this.select(this.selectedIndex,false,true);return}if(t&&typeof t=="string"){var e=this.queryCell(t);if(e){this.selectCell(t,false,true);return}}var i=0;if(t&&this.slides[t]){i=t}this.select(i,false,true)};v.selectCell=function(t,e,i){var n=this.queryCell(t);if(!n){return}var s=this.getCellSlideIndex(n);this.select(s,e,i)};v.getCellSlideIndex=function(t){for(var e=0;e<this.slides.length;e++){var i=this.slides[e];var n=i.cells.indexOf(t);if(n!=-1){return e}}};v.getCell=function(t){for(var e=0;e<this.cells.length;e++){var i=this.cells[e];if(i.element==t){return i}}};v.getCells=function(t){t=a.makeArray(t);var i=[];t.forEach(function(t){var e=this.getCell(t);if(e){i.push(e)}},this);return i};v.getCellElements=function(){return this.cells.map(function(t){return t.element})};v.getParentCell=function(t){var e=this.getCell(t);if(e){return e}t=a.getParent(t,".flickity-slider > *");return this.getCell(t)};v.getAdjacentCellElements=function(t,e){if(!t){return this.selectedSlide.getCellElements()}e=e===undefined?this.selectedIndex:e;var i=this.slides.length;if(1+t*2>=i){return this.getCellElements()}var n=[];for(var s=e-t;s<=e+t;s++){var r=this.options.wrapAround?a.modulo(s,i):s;var o=this.slides[r];if(o){n=n.concat(o.getCellElements())}}return n};v.queryCell=function(t){if(typeof t=="number"){return this.cells[t]}if(typeof t=="string"){if(t.match(/^[#.]?[\d/]/)){return}t=this.element.querySelector(t)}return this.getCell(t)};v.uiChange=function(){this.emitEvent("uiChange")};v.childUIPointerDown=function(t){if(t.type!="touchstart"){t.preventDefault()}this.focus()};v.onresize=function(){this.watchCSS();this.resize()};a.debounceMethod(p,"onresize",150);v.resize=function(){if(!this.isActive||this.isAnimating||this.isDragging){return}this.getSize();if(this.options.wrapAround){this.x=a.modulo(this.x,this.slideableWidth)}this.positionCells();this._getWrapShiftCells();this.setGallerySize();this.emitEvent("resize");var t=this.selectedElements&&this.selectedElements[0];this.selectCell(t,false,true)};v.watchCSS=function(){var t=this.options.watchCSS;if(!t){return}var e=h(this.element,":after").content;if(e.indexOf("flickity")!=-1){this.activate()}else{this.deactivate()}};v.onkeydown=function(t){var e=document.activeElement&&document.activeElement!=this.element;if(!this.options.accessibility||e){return}var i=p.keyboardHandlers[t.keyCode];if(i){i.call(this)}};p.keyboardHandlers={37:function(){var t=this.options.rightToLeft?"next":"previous";this.uiChange();this[t]()},39:function(){var t=this.options.rightToLeft?"previous":"next";this.uiChange();this[t]()}};v.focus=function(){var t=n.pageYOffset;this.element.focus({preventScroll:true});if(n.pageYOffset!=t){n.scrollTo(n.pageXOffset,t)}};v.deactivate=function(){if(!this.isActive){return}this.element.classList.remove("flickity-enabled");this.element.classList.remove("flickity-rtl");this.unselectSelectedSlide();this.cells.forEach(function(t){t.destroy()});this.element.removeChild(this.viewport);u(this.slider.children,this.element);if(this.options.accessibility){this.element.removeAttribute("tabIndex");this.element.removeEventListener("keydown",this)}this.isActive=false;this.emitEvent("deactivate")};v.destroy=function(){this.deactivate();n.removeEventListener("resize",this);this.allOff();this.emitEvent("destroy");if(l&&this.$element){l.removeData(this.element,"flickity")}delete this.element.flickityGUID;delete f[this.guid]};a.extend(v,r);p.data=function(t){t=a.getQueryElement(t);var e=t&&t.flickityGUID;return e&&f[e]};a.htmlInit(p,"flickity");if(l&&l.bridget){l.bridget("flickity",p)}p.setJQuery=function(t){l=t};p.Cell=s;p.Slide=o;return p});

			(function(e,i){if(typeof define=="function"&&define.amd){define("unipointer/unipointer",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.Unipointer=i(e,e.EvEmitter)}})(window,function t(s,e){function i(){}function n(){}var r=n.prototype=Object.create(e.prototype);r.bindStartEvent=function(t){this._bindStartEvent(t,true)};r.unbindStartEvent=function(t){this._bindStartEvent(t,false)};r._bindStartEvent=function(t,e){e=e===undefined?true:e;var i=e?"addEventListener":"removeEventListener";var n="mousedown";if("ontouchstart"in s){n="touchstart"}else if(s.PointerEvent){n="pointerdown"}t[i](n,this)};r.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};r.getTouch=function(t){for(var e=0;e<t.length;e++){var i=t[e];if(i.identifier==this.pointerIdentifier){return i}}};r.onmousedown=function(t){var e=t.button;if(e&&(e!==0&&e!==1)){return}this._pointerDown(t,t)};r.ontouchstart=function(t){this._pointerDown(t,t.changedTouches[0])};r.onpointerdown=function(t){this._pointerDown(t,t)};r._pointerDown=function(t,e){if(t.button||this.isPointerDown){return}this.isPointerDown=true;this.pointerIdentifier=e.pointerId!==undefined?e.pointerId:e.identifier;this.pointerDown(t,e)};r.pointerDown=function(t,e){this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var o={mousedown:["mousemove","mouseup"],touchstart:["touchmove","touchend","touchcancel"],pointerdown:["pointermove","pointerup","pointercancel"]};r._bindPostStartEvents=function(t){if(!t){return}var e=o[t.type];e.forEach(function(t){s.addEventListener(t,this)},this);this._boundPointerEvents=e};r._unbindPostStartEvents=function(){if(!this._boundPointerEvents){return}this._boundPointerEvents.forEach(function(t){s.removeEventListener(t,this)},this);delete this._boundPointerEvents};r.onmousemove=function(t){this._pointerMove(t,t)};r.onpointermove=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerMove(t,t)}};r.ontouchmove=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerMove(t,e)}};r._pointerMove=function(t,e){this.pointerMove(t,e)};r.pointerMove=function(t,e){this.emitEvent("pointerMove",[t,e])};r.onmouseup=function(t){this._pointerUp(t,t)};r.onpointerup=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerUp(t,t)}};r.ontouchend=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerUp(t,e)}};r._pointerUp=function(t,e){this._pointerDone();this.pointerUp(t,e)};r.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e])};r._pointerDone=function(){this._pointerReset();this._unbindPostStartEvents();this.pointerDone()};r._pointerReset=function(){this.isPointerDown=false;delete this.pointerIdentifier};r.pointerDone=i;r.onpointercancel=function(t){if(t.pointerId==this.pointerIdentifier){this._pointerCancel(t,t)}};r.ontouchcancel=function(t){var e=this.getTouch(t.changedTouches);if(e){this._pointerCancel(t,e)}};r._pointerCancel=function(t,e){this._pointerDone();this.pointerCancel(t,e)};r.pointerCancel=function(t,e){this.emitEvent("pointerCancel",[t,e])};n.getPointerPoint=function(t){return{x:t.pageX,y:t.pageY}};return n});

			(function(e,i){if(typeof define=="function"&&define.amd){define("unidragger/unidragger",["unipointer/unipointer"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("unipointer"))}else{e.Unidragger=i(e,e.Unipointer)}})(window,function t(r,e){function i(){}var n=i.prototype=Object.create(e.prototype);n.bindHandles=function(){this._bindHandles(true)};n.unbindHandles=function(){this._bindHandles(false)};n._bindHandles=function(t){t=t===undefined?true:t;var e=t?"addEventListener":"removeEventListener";var i=t?this._touchActionValue:"";for(var n=0;n<this.handles.length;n++){var s=this.handles[n];this._bindStartEvent(s,t);s[e]("click",this);if(r.PointerEvent){s.style.touchAction=i}}};n._touchActionValue="none";n.pointerDown=function(t,e){var i=this.okayPointerDown(t);if(!i){return}this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};t.preventDefault();this.pointerDownBlur();this._bindPostStartEvents(t);this.emitEvent("pointerDown",[t,e])};var s={TEXTAREA:true,INPUT:true,SELECT:true,OPTION:true};var o={radio:true,checkbox:true,button:true,submit:true,image:true,file:true};n.okayPointerDown=function(t){var e=s[t.target.nodeName];var i=o[t.target.type];var n=!e||i;if(!n){this._pointerReset()}return n};n.pointerDownBlur=function(){var t=document.activeElement;var e=t&&t.blur&&t!=document.body;if(e){t.blur()}};n.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.emitEvent("pointerMove",[t,e,i]);this._dragMove(t,e,i)};n._dragPointerMove=function(t,e){var i={x:e.pageX-this.pointerDownPointer.pageX,y:e.pageY-this.pointerDownPointer.pageY};if(!this.isDragging&&this.hasDragStarted(i)){this._dragStart(t,e)}return i};n.hasDragStarted=function(t){return Math.abs(t.x)>3||Math.abs(t.y)>3};n.pointerUp=function(t,e){this.emitEvent("pointerUp",[t,e]);this._dragPointerUp(t,e)};n._dragPointerUp=function(t,e){if(this.isDragging){this._dragEnd(t,e)}else{this._staticClick(t,e)}};n._dragStart=function(t,e){this.isDragging=true;this.isPreventingClicks=true;this.dragStart(t,e)};n.dragStart=function(t,e){this.emitEvent("dragStart",[t,e])};n._dragMove=function(t,e,i){if(!this.isDragging){return}this.dragMove(t,e,i)};n.dragMove=function(t,e,i){t.preventDefault();this.emitEvent("dragMove",[t,e,i])};n._dragEnd=function(t,e){this.isDragging=false;setTimeout(function(){delete this.isPreventingClicks}.bind(this));this.dragEnd(t,e)};n.dragEnd=function(t,e){this.emitEvent("dragEnd",[t,e])};n.onclick=function(t){if(this.isPreventingClicks){t.preventDefault()}};n._staticClick=function(t,e){if(this.isIgnoringMouseUp&&t.type=="mouseup"){return}this.staticClick(t,e);if(t.type!="mouseup"){this.isIgnoringMouseUp=true;setTimeout(function(){delete this.isIgnoringMouseUp}.bind(this),400)}};n.staticClick=function(t,e){this.emitEvent("staticClick",[t,e])};i.getPointerPoint=e.getPointerPoint;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/drag",["./flickity","unidragger/unidragger","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unidragger"),require("fizzy-ui-utils"))}else{n.Flickity=s(n,n.Flickity,n.Unidragger,n.fizzyUIUtils)}})(window,function t(n,e,i,a){a.extend(e.defaults,{draggable:">1",dragThreshold:3});e.createMethods.push("_createDrag");var s=e.prototype;a.extend(s,i.prototype);s._touchActionValue="pan-y";s._createDrag=function(){this.on("activate",this.onActivateDrag);this.on("uiChange",this._uiChangeDrag);this.on("deactivate",this.onDeactivateDrag);this.on("cellChange",this.updateDraggable)};s.onActivateDrag=function(){this.handles=[this.viewport];this.bindHandles();this.updateDraggable()};s.onDeactivateDrag=function(){this.unbindHandles();this.element.classList.remove("is-draggable")};s.updateDraggable=function(){if(this.options.draggable==">1"){this.isDraggable=this.slides.length>1}else{this.isDraggable=this.options.draggable}if(this.isDraggable){this.element.classList.add("is-draggable")}else{this.element.classList.remove("is-draggable")}};s.bindDrag=function(){this.options.draggable=true;this.updateDraggable()};s.unbindDrag=function(){this.options.draggable=false;this.updateDraggable()};s._uiChangeDrag=function(){delete this.isFreeScrolling};s.pointerDown=function(t,e){if(!this.isDraggable){this._pointerDownDefault(t,e);return}var i=this.okayPointerDown(t);if(!i){return}this._pointerDownPreventDefault(t);this.pointerDownFocus(t);if(document.activeElement!=this.element){this.pointerDownBlur()}this.dragX=this.x;this.viewport.classList.add("is-pointer-down");this.pointerDownScroll=o();n.addEventListener("scroll",this);this._pointerDownDefault(t,e)};s._pointerDownDefault=function(t,e){this.pointerDownPointer={pageX:e.pageX,pageY:e.pageY};this._bindPostStartEvents(t);this.dispatchEvent("pointerDown",t,[e])};var r={INPUT:true,TEXTAREA:true,SELECT:true};s.pointerDownFocus=function(t){var e=r[t.target.nodeName];if(!e){this.focus()}};s._pointerDownPreventDefault=function(t){var e=t.type=="touchstart";var i=t.pointerType=="touch";var n=r[t.target.nodeName];if(!e&&!i&&!n){t.preventDefault()}};s.hasDragStarted=function(t){return Math.abs(t.x)>this.options.dragThreshold};s.pointerUp=function(t,e){delete this.isTouchScrolling;this.viewport.classList.remove("is-pointer-down");this.dispatchEvent("pointerUp",t,[e]);this._dragPointerUp(t,e)};s.pointerDone=function(){n.removeEventListener("scroll",this);delete this.pointerDownScroll};s.dragStart=function(t,e){if(!this.isDraggable){return}this.dragStartPosition=this.x;this.startAnimation();n.removeEventListener("scroll",this);this.dispatchEvent("dragStart",t,[e])};s.pointerMove=function(t,e){var i=this._dragPointerMove(t,e);this.dispatchEvent("pointerMove",t,[e,i]);this._dragMove(t,e,i)};s.dragMove=function(t,e,i){if(!this.isDraggable){return}t.preventDefault();this.previousDragX=this.dragX;var n=this.options.rightToLeft?-1:1;if(this.options.wrapAround){i.x%=this.slideableWidth}var s=this.dragStartPosition+i.x*n;if(!this.options.wrapAround&&this.slides.length){var r=Math.max(-this.slides[0].target,this.dragStartPosition);s=s>r?(s+r)*.5:s;var o=Math.min(-this.getLastSlide().target,this.dragStartPosition);s=s<o?(s+o)*.5:s}this.dragX=s;this.dragMoveTime=new Date;this.dispatchEvent("dragMove",t,[e,i])};s.dragEnd=function(t,e){if(!this.isDraggable){return}if(this.options.freeScroll){this.isFreeScrolling=true}var i=this.dragEndRestingSelect();if(this.options.freeScroll&&!this.options.wrapAround){var n=this.getRestingPosition();this.isFreeScrolling=-n>this.slides[0].target&&-n<this.getLastSlide().target}else if(!this.options.freeScroll&&i==this.selectedIndex){i+=this.dragEndBoostSelect()}delete this.previousDragX;this.isDragSelect=this.options.wrapAround;this.select(i);delete this.isDragSelect;this.dispatchEvent("dragEnd",t,[e])};s.dragEndRestingSelect=function(){var t=this.getRestingPosition();var e=Math.abs(this.getSlideDistance(-t,this.selectedIndex));var i=this._getClosestResting(t,e,1);var n=this._getClosestResting(t,e,-1);var s=i.distance<n.distance?i.index:n.index;return s};s._getClosestResting=function(t,e,i){var n=this.selectedIndex;var s=Infinity;var r=this.options.contain&&!this.options.wrapAround?function(t,e){return t<=e}:function(t,e){return t<e};while(r(e,s)){n+=i;s=e;e=this.getSlideDistance(-t,n);if(e===null){break}e=Math.abs(e)}return{distance:s,index:n-i}};s.getSlideDistance=function(t,e){var i=this.slides.length;var n=this.options.wrapAround&&i>1;var s=n?a.modulo(e,i):e;var r=this.slides[s];if(!r){return null}var o=n?this.slideableWidth*Math.floor(e/i):0;return t-(r.target+o)};s.dragEndBoostSelect=function(){if(this.previousDragX===undefined||!this.dragMoveTime||new Date-this.dragMoveTime>100){return 0}var t=this.getSlideDistance(-this.dragX,this.selectedIndex);var e=this.previousDragX-this.dragX;if(t>0&&e>0){return 1}else if(t<0&&e<0){return-1}return 0};s.staticClick=function(t,e){var i=this.getParentCell(t.target);var n=i&&i.element;var s=i&&this.cells.indexOf(i);this.dispatchEvent("staticClick",t,[e,n,s])};s.onscroll=function(){var t=o();var e=this.pointerDownScroll.x-t.x;var i=this.pointerDownScroll.y-t.y;if(Math.abs(e)>3||Math.abs(i)>3){this._pointerDone()}};function o(){return{x:n.pageXOffset,y:n.pageYOffset}}return e});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/prev-next-button",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){"use strict";var r="http://www.w3.org/2000/svg";function o(t,e){this.direction=t;this.parent=e;this._create()}o.prototype=Object.create(n.prototype);o.prototype._create=function(){this.isEnabled=true;this.isPrevious=this.direction==-1;var t=this.parent.options.rightToLeft?1:-1;this.isLeft=this.direction==t;var e=this.element=document.createElement("button");e.className="flickity-button flickity-prev-next-button";e.className+=this.isPrevious?" previous":" next";e.setAttribute("type","button");this.disable();e.setAttribute("aria-label",this.isPrevious?"Previous":"Next");var i=this.createSVG();e.appendChild(i);this.parent.on("select",this.update.bind(this));this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};o.prototype.activate=function(){this.bindStartEvent(this.element);this.element.addEventListener("click",this);this.parent.element.appendChild(this.element)};o.prototype.deactivate=function(){this.parent.element.removeChild(this.element);this.unbindStartEvent(this.element);this.element.removeEventListener("click",this)};o.prototype.createSVG=function(){var t=document.createElementNS(r,"svg");t.setAttribute("class","flickity-button-icon");t.setAttribute("viewBox","0 0 100 100");var e=document.createElementNS(r,"path");var i=a(this.parent.options.arrowShape);e.setAttribute("d",i);e.setAttribute("class","arrow");if(!this.isLeft){e.setAttribute("transform","translate(100, 100) rotate(180) ")}t.appendChild(e);return t};function a(t){if(typeof t=="string"){return t}return"M "+t.x0+",50"+" L "+t.x1+","+(t.y1+50)+" L "+t.x2+","+(t.y2+50)+" L "+t.x3+",50 "+" L "+t.x2+","+(50-t.y2)+" L "+t.x1+","+(50-t.y1)+" Z"}o.prototype.handleEvent=s.handleEvent;o.prototype.onclick=function(){if(!this.isEnabled){return}this.parent.uiChange();var t=this.isPrevious?"previous":"next";this.parent[t]()};o.prototype.enable=function(){if(this.isEnabled){return}this.element.disabled=false;this.isEnabled=true};o.prototype.disable=function(){if(!this.isEnabled){return}this.element.disabled=true;this.isEnabled=false};o.prototype.update=function(){var t=this.parent.slides;if(this.parent.options.wrapAround&&t.length>1){this.enable();return}var e=t.length?t.length-1:0;var i=this.isPrevious?0:e;var n=this.parent.selectedIndex==i?"disable":"enable";this[n]()};o.prototype.destroy=function(){this.deactivate();this.allOff()};s.extend(i.defaults,{prevNextButtons:true,arrowShape:{x0:10,x1:60,y1:50,x2:70,y2:40,x3:30}});i.createMethods.push("_createPrevNextButtons");var l=i.prototype;l._createPrevNextButtons=function(){if(!this.options.prevNextButtons){return}this.prevButton=new o(-1,this);this.nextButton=new o(1,this);this.on("activate",this.activatePrevNextButtons)};l.activatePrevNextButtons=function(){this.prevButton.activate();this.nextButton.activate();this.on("deactivate",this.deactivatePrevNextButtons)};l.deactivatePrevNextButtons=function(){this.prevButton.deactivate();this.nextButton.deactivate();this.off("deactivate",this.deactivatePrevNextButtons)};i.PrevNextButton=o;return i});(function(n,s){if(typeof define=="function"&&define.amd){define("flickity/js/page-dots",["./flickity","unipointer/unipointer","fizzy-ui-utils/utils"],function(t,e,i){return s(n,t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=s(n,require("./flickity"),require("unipointer"),require("fizzy-ui-utils"))}else{s(n,n.Flickity,n.Unipointer,n.fizzyUIUtils)}})(window,function t(e,i,n,s){function r(t){this.parent=t;this._create()}r.prototype=Object.create(n.prototype);r.prototype._create=function(){this.holder=document.createElement("ol");this.holder.className="flickity-page-dots";this.dots=[];this.handleClick=this.onClick.bind(this);this.on("pointerDown",this.parent.childUIPointerDown.bind(this.parent))};r.prototype.activate=function(){this.setDots();this.holder.addEventListener("click",this.handleClick);this.bindStartEvent(this.holder);this.parent.element.appendChild(this.holder)};r.prototype.deactivate=function(){this.holder.removeEventListener("click",this.handleClick);this.unbindStartEvent(this.holder);this.parent.element.removeChild(this.holder)};r.prototype.setDots=function(){var t=this.parent.slides.length-this.dots.length;if(t>0){this.addDots(t)}else if(t<0){this.removeDots(-t)}};r.prototype.addDots=function(t){var e=document.createDocumentFragment();var i=[];var n=this.dots.length;var s=n+t;for(var r=n;r<s;r++){var o=document.createElement("li");o.className="dot";o.setAttribute("aria-label","Page dot "+(r+1));e.appendChild(o);i.push(o)}this.holder.appendChild(e);this.dots=this.dots.concat(i)};r.prototype.removeDots=function(t){var e=this.dots.splice(this.dots.length-t,t);e.forEach(function(t){this.holder.removeChild(t)},this)};r.prototype.updateSelected=function(){if(this.selectedDot){this.selectedDot.className="dot";this.selectedDot.removeAttribute("aria-current")}if(!this.dots.length){return}this.selectedDot=this.dots[this.parent.selectedIndex];this.selectedDot.className="dot is-selected";this.selectedDot.setAttribute("aria-current","step")};r.prototype.onTap=r.prototype.onClick=function(t){var e=t.target;if(e.nodeName!="LI"){return}this.parent.uiChange();var i=this.dots.indexOf(e);this.parent.select(i)};r.prototype.destroy=function(){this.deactivate();this.allOff()};i.PageDots=r;s.extend(i.defaults,{pageDots:true});i.createMethods.push("_createPageDots");var o=i.prototype;o._createPageDots=function(){if(!this.options.pageDots){return}this.pageDots=new r(this);this.on("activate",this.activatePageDots);this.on("select",this.updateSelectedPageDots);this.on("cellChange",this.updatePageDots);this.on("resize",this.updatePageDots);this.on("deactivate",this.deactivatePageDots)};o.activatePageDots=function(){this.pageDots.activate()};o.updateSelectedPageDots=function(){this.pageDots.updateSelected()};o.updatePageDots=function(){this.pageDots.setDots()};o.deactivatePageDots=function(){this.pageDots.deactivate()};i.PageDots=r;return i});(function(t,n){if(typeof define=="function"&&define.amd){define("flickity/js/player",["ev-emitter/ev-emitter","fizzy-ui-utils/utils","./flickity"],function(t,e,i){return n(t,e,i)})}else if(typeof module=="object"&&module.exports){module.exports=n(require("ev-emitter"),require("fizzy-ui-utils"),require("./flickity"))}else{n(t.EvEmitter,t.fizzyUIUtils,t.Flickity)}})(window,function t(e,i,n){function s(t){this.parent=t;this.state="stopped";this.onVisibilityChange=this.visibilityChange.bind(this);this.onVisibilityPlay=this.visibilityPlay.bind(this)}s.prototype=Object.create(e.prototype);s.prototype.play=function(){if(this.state=="playing"){return}var t=document.hidden;if(t){document.addEventListener("visibilitychange",this.onVisibilityPlay);return}this.state="playing";document.addEventListener("visibilitychange",this.onVisibilityChange);this.tick()};s.prototype.tick=function(){if(this.state!="playing"){return}var t=this.parent.options.autoPlay;t=typeof t=="number"?t:3e3;var e=this;this.clear();this.timeout=setTimeout(function(){e.parent.next(true);e.tick()},t)};s.prototype.stop=function(){this.state="stopped";this.clear();document.removeEventListener("visibilitychange",this.onVisibilityChange)};s.prototype.clear=function(){clearTimeout(this.timeout)};s.prototype.pause=function(){if(this.state=="playing"){this.state="paused";this.clear()}};s.prototype.unpause=function(){if(this.state=="paused"){this.play()}};s.prototype.visibilityChange=function(){var t=document.hidden;this[t?"pause":"unpause"]()};s.prototype.visibilityPlay=function(){this.play();document.removeEventListener("visibilitychange",this.onVisibilityPlay)};i.extend(n.defaults,{pauseAutoPlayOnHover:true});n.createMethods.push("_createPlayer");var r=n.prototype;r._createPlayer=function(){this.player=new s(this);this.on("activate",this.activatePlayer);this.on("uiChange",this.stopPlayer);this.on("pointerDown",this.stopPlayer);this.on("deactivate",this.deactivatePlayer)};r.activatePlayer=function(){if(!this.options.autoPlay){return}this.player.play();this.element.addEventListener("mouseenter",this)};r.playPlayer=function(){this.player.play()};r.stopPlayer=function(){this.player.stop()};r.pausePlayer=function(){this.player.pause()};r.unpausePlayer=function(){this.player.unpause()};r.deactivatePlayer=function(){this.player.stop();this.element.removeEventListener("mouseenter",this)};r.onmouseenter=function(){if(!this.options.pauseAutoPlayOnHover){return}this.player.pause();this.element.addEventListener("mouseleave",this)};r.onmouseleave=function(){this.player.unpause();this.element.removeEventListener("mouseleave",this)};n.Player=s;return n});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/add-remove-cell",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,n){function l(t){var e=document.createDocumentFragment();t.forEach(function(t){e.appendChild(t.element)});return e}var s=i.prototype;s.insert=function(t,e){var i=this._makeCells(t);if(!i||!i.length){return}var n=this.cells.length;e=e===undefined?n:e;var s=l(i);var r=e==n;if(r){this.slider.appendChild(s)}else{var o=this.cells[e].element;this.slider.insertBefore(s,o)}if(e===0){this.cells=i.concat(this.cells)}else if(r){this.cells=this.cells.concat(i)}else{var a=this.cells.splice(e,n-e);this.cells=this.cells.concat(i).concat(a)}this._sizeCells(i);this.cellChange(e,true)};s.append=function(t){this.insert(t,this.cells.length)};s.prepend=function(t){this.insert(t,0)};s.remove=function(t){var e=this.getCells(t);if(!e||!e.length){return}var i=this.cells.length-1;e.forEach(function(t){t.remove();var e=this.cells.indexOf(t);i=Math.min(e,i);n.removeFrom(this.cells,t)},this);this.cellChange(i,true)};s.cellSizeChange=function(t){var e=this.getCell(t);if(!e){return}e.getSize();var i=this.cells.indexOf(e);this.cellChange(i)};s.cellChange=function(t,e){var i=this.selectedElement;this._positionCells(t);this._getWrapShiftCells();this.setGallerySize();var n=this.getCell(i);if(n){this.selectedIndex=this.getCellSlideIndex(n)}this.selectedIndex=Math.min(this.slides.length-1,this.selectedIndex);this.emitEvent("cellChange",[t]);this.select(this.selectedIndex);if(e){this.positionSliderAtSelected()}};return i});(function(i,n){if(typeof define=="function"&&define.amd){define("flickity/js/lazyload",["./flickity","fizzy-ui-utils/utils"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("./flickity"),require("fizzy-ui-utils"))}else{n(i,i.Flickity,i.fizzyUIUtils)}})(window,function t(e,i,o){"use strict";i.createMethods.push("_createLazyload");var n=i.prototype;n._createLazyload=function(){this.on("select",this.lazyLoad)};n.lazyLoad=function(){var t=this.options.lazyLoad;if(!t){return}var e=typeof t=="number"?t:0;var i=this.getAdjacentCellElements(e);var n=[];i.forEach(function(t){var e=s(t);n=n.concat(e)});n.forEach(function(t){new r(t,this)},this)};function s(t){if(t.nodeName=="IMG"){var e=t.getAttribute("data-flickity-lazyload");var i=t.getAttribute("data-flickity-lazyload-src");var n=t.getAttribute("data-flickity-lazyload-srcset");if(e||i||n){return[t]}}var s="img[data-flickity-lazyload], "+"img[data-flickity-lazyload-src], img[data-flickity-lazyload-srcset]";var r=t.querySelectorAll(s);return o.makeArray(r)}function r(t,e){this.img=t;this.flickity=e;this.load()}r.prototype.handleEvent=o.handleEvent;r.prototype.load=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);var t=this.img.getAttribute("data-flickity-lazyload")||this.img.getAttribute("data-flickity-lazyload-src");var e=this.img.getAttribute("data-flickity-lazyload-srcset");this.img.src=t;if(e){this.img.setAttribute("srcset",e)}this.img.removeAttribute("data-flickity-lazyload");this.img.removeAttribute("data-flickity-lazyload-src");this.img.removeAttribute("data-flickity-lazyload-srcset")};r.prototype.onload=function(t){this.complete(t,"flickity-lazyloaded")};r.prototype.onerror=function(t){this.complete(t,"flickity-lazyerror")};r.prototype.complete=function(t,e){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this);var i=this.flickity.getParentCell(this.img);var n=i&&i.element;this.flickity.cellSizeChange(n);this.img.classList.add(e);this.flickity.dispatchEvent("lazyLoad",t,n)};i.LazyLoader=r;return i});

			(function(t,e){if(typeof define=="function"&&define.amd){define("flickity/js/index",["./flickity","./drag","./prev-next-button","./page-dots","./player","./add-remove-cell","./lazyload"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("./flickity"),require("./drag"),require("./prev-next-button"),require("./page-dots"),require("./player"),require("./add-remove-cell"),require("./lazyload"))}})(window,function t(e){return e});

			(function(t,e){if(typeof define=="function"&&define.amd){define("flickity-as-nav-for/as-nav-for",["flickity/js/index","fizzy-ui-utils/utils"],e)}else if(typeof module=="object"&&module.exports){module.exports=e(require("flickity"),require("fizzy-ui-utils"))}else{t.Flickity=e(t.Flickity,t.fizzyUIUtils)}})(window,function t(n,s){n.createMethods.push("_createAsNavFor");var e=n.prototype;e._createAsNavFor=function(){this.on("activate",this.activateAsNavFor);this.on("deactivate",this.deactivateAsNavFor);this.on("destroy",this.destroyAsNavFor);var e=this.options.asNavFor;if(!e){return}var i=this;setTimeout(function t(){i.setNavCompanion(e)})};e.setNavCompanion=function(t){t=s.getQueryElement(t);var e=n.data(t);if(!e||e==this){return}this.navCompanion=e;var i=this;this.onNavCompanionSelect=function(){i.navCompanionSelect()};e.on("select",this.onNavCompanionSelect);this.on("staticClick",this.onNavStaticClick);this.navCompanionSelect(true)};e.navCompanionSelect=function(t){var e=this.navCompanion&&this.navCompanion.selectedCells;if(!e){return}var i=e[0];var n=this.navCompanion.cells.indexOf(i);var s=n+e.length-1;var r=Math.floor(a(n,s,this.navCompanion.cellAlign));this.selectCell(r,false,t);this.removeNavSelectedElements();if(r>=this.cells.length){return}var o=this.cells.slice(n,s+1);this.navSelectedElements=o.map(function(t){return t.element});this.changeNavSelectedClass("add")};function a(t,e,i){return(e-t)*i+t}e.changeNavSelectedClass=function(e){this.navSelectedElements.forEach(function(t){t.classList[e]("is-nav-selected")})};e.activateAsNavFor=function(){this.navCompanionSelect(true)};e.removeNavSelectedElements=function(){if(!this.navSelectedElements){return}this.changeNavSelectedClass("remove");delete this.navSelectedElements};e.onNavStaticClick=function(t,e,i,n){if(typeof n=="number"){this.navCompanion.selectCell(n)}};e.deactivateAsNavFor=function(){this.removeNavSelectedElements()};e.destroyAsNavFor=function(){if(!this.navCompanion){return}this.navCompanion.off("select",this.onNavCompanionSelect);this.off("staticClick",this.onNavStaticClick);delete this.navCompanion};return n});

			(function(e,i){"use strict";if(typeof define=="function"&&define.amd){define("imagesloaded/imagesloaded",["ev-emitter/ev-emitter"],function(t){return i(e,t)})}else if(typeof module=="object"&&module.exports){module.exports=i(e,require("ev-emitter"))}else{e.imagesLoaded=i(e,e.EvEmitter)}})(typeof window!=="undefined"?window:this,function t(e,i){var s=e.jQuery;var r=e.console;function o(t,e){for(var i in e){t[i]=e[i]}return t}var n=Array.prototype.slice;function a(t){if(Array.isArray(t)){return t}var e=typeof t=="object"&&typeof t.length=="number";if(e){return n.call(t)}return[t]}function l(t,e,i){if(!(this instanceof l)){return new l(t,e,i)}var n=t;if(typeof t=="string"){n=document.querySelectorAll(t)}if(!n){r.error("Bad element for imagesLoaded "+(n||t));return}this.elements=a(n);this.options=o({},this.options);if(typeof e=="function"){i=e}else{o(this.options,e)}if(i){this.on("always",i)}this.getImages();if(s){this.jqDeferred=new s.Deferred}setTimeout(this.check.bind(this))}l.prototype=Object.create(i.prototype);l.prototype.options={};l.prototype.getImages=function(){this.images=[];this.elements.forEach(this.addElementImages,this)};l.prototype.addElementImages=function(t){if(t.nodeName=="IMG"){this.addImage(t)}if(this.options.background===true){this.addElementBackgroundImages(t)}var e=t.nodeType;if(!e||!h[e]){return}var i=t.querySelectorAll("img");for(var n=0;n<i.length;n++){var s=i[n];this.addImage(s)}if(typeof this.options.background=="string"){var r=t.querySelectorAll(this.options.background);for(n=0;n<r.length;n++){var o=r[n];this.addElementBackgroundImages(o)}}};var h={1:true,9:true,11:true};l.prototype.addElementBackgroundImages=function(t){var e=getComputedStyle(t);if(!e){return}var i=/url\((['"])?(.*?)\1\)/gi;var n=i.exec(e.backgroundImage);while(n!==null){var s=n&&n[2];if(s){this.addBackground(s,t)}n=i.exec(e.backgroundImage)}};l.prototype.addImage=function(t){var e=new c(t);this.images.push(e)};l.prototype.addBackground=function(t,e){var i=new u(t,e);this.images.push(i)};l.prototype.check=function(){var n=this;this.progressedCount=0;this.hasAnyBroken=false;if(!this.images.length){this.complete();return}function e(t,e,i){setTimeout(function(){n.progress(t,e,i)})}this.images.forEach(function(t){t.once("progress",e);t.check()})};l.prototype.progress=function(t,e,i){this.progressedCount++;this.hasAnyBroken=this.hasAnyBroken||!t.isLoaded;this.emitEvent("progress",[this,t,e]);if(this.jqDeferred&&this.jqDeferred.notify){this.jqDeferred.notify(this,t)}if(this.progressedCount==this.images.length){this.complete()}if(this.options.debug&&r){r.log("progress: "+i,t,e)}};l.prototype.complete=function(){var t=this.hasAnyBroken?"fail":"done";this.isComplete=true;this.emitEvent(t,[this]);this.emitEvent("always",[this]);if(this.jqDeferred){var e=this.hasAnyBroken?"reject":"resolve";this.jqDeferred[e](this)}};function c(t){this.img=t}c.prototype=Object.create(i.prototype);c.prototype.check=function(){var t=this.getIsImageComplete();if(t){this.confirm(this.img.naturalWidth!==0,"naturalWidth");return}this.proxyImage=new Image;this.proxyImage.addEventListener("load",this);this.proxyImage.addEventListener("error",this);this.img.addEventListener("load",this);this.img.addEventListener("error",this);this.proxyImage.src=this.img.src};c.prototype.getIsImageComplete=function(){return this.img.complete&&this.img.naturalWidth};c.prototype.confirm=function(t,e){this.isLoaded=t;this.emitEvent("progress",[this,this.img,e])};c.prototype.handleEvent=function(t){var e="on"+t.type;if(this[e]){this[e](t)}};c.prototype.onload=function(){this.confirm(true,"onload");this.unbindEvents()};c.prototype.onerror=function(){this.confirm(false,"onerror");this.unbindEvents()};c.prototype.unbindEvents=function(){this.proxyImage.removeEventListener("load",this);this.proxyImage.removeEventListener("error",this);this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)};function u(t,e){this.url=t;this.element=e;this.img=new Image}u.prototype=Object.create(c.prototype);u.prototype.check=function(){this.img.addEventListener("load",this);this.img.addEventListener("error",this);this.img.src=this.url;var t=this.getIsImageComplete();if(t){this.confirm(this.img.naturalWidth!==0,"naturalWidth");this.unbindEvents()}};u.prototype.unbindEvents=function(){this.img.removeEventListener("load",this);this.img.removeEventListener("error",this)};u.prototype.confirm=function(t,e){this.isLoaded=t;this.emitEvent("progress",[this,this.element,e])};l.makeJQueryPlugin=function(t){t=t||e.jQuery;if(!t){return}s=t;s.fn.imagesLoaded=function(t,e){var i=new l(this,t,e);return i.jqDeferred.promise(s(this))}};l.makeJQueryPlugin();return l});

			(function(i,n){if(typeof define=="function"&&define.amd){define(["flickity/js/index","imagesloaded/imagesloaded"],function(t,e){return n(i,t,e)})}else if(typeof module=="object"&&module.exports){module.exports=n(i,require("flickity"),require("imagesloaded"))}else{i.Flickity=n(i,i.Flickity,i.imagesLoaded)}})(window,function t(e,i,s){"use strict";i.createMethods.push("_createImagesLoaded");var n=i.prototype;n._createImagesLoaded=function(){this.on("activate",this.imagesLoaded)};n.imagesLoaded=function(){if(!this.options.imagesLoaded){return}var n=this;function t(t,e){var i=n.getParentCell(e.img);n.cellSizeChange(i&&i.element);if(!n.options.freeScroll){n.positionSliderAtSelected()}}s(this.slider).on("progress",t)};return i});


			vQMHtml+='<style>hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5rem}p{margin-top:0;margin-bottom:1rem}abbr[data-original-title],abbr[title]{text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted;cursor:help;border-bottom:0}address{margin-bottom:1rem;font-style:normal;line-height:inherit}dl,ol,ul{margin-top:0;margin-bottom:1rem}ol ol,ol ul,ul ol,ul ul{margin-bottom:0}dt{font-weight:700}dd{margin-bottom:.5rem;margin-left:0}blockquote{margin:0 0 1rem}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}a{color:#007bff;text-decoration:none;background-color:transparent;-webkit-text-decoration-skip:objects}</style>';

			vQMHtml+='<style>a:hover{color:#0056b3;text-decoration:underline}a:not([href]):not([tabindex]){color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus,a:not([href]):not([tabindex]):hover{color:inherit;text-decoration:none}a:not([href]):not([tabindex]):focus{outline:0}code,kbd,pre,samp{font-family:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;font-size:1em}pre{margin-top:0;margin-bottom:1rem;overflow:auto;-ms-overflow-style:scrollbar}</script>';

			vQMHtml+='<style>figure{margin:0 0 1rem}img{vertical-align:middle;border-style:none}svg:not(:root){overflow:hidden;vertical-align:middle}table{border-collapse:collapse}caption{padding-top:.75rem;padding-bottom:.75rem;color:#6c757d;text-align:left;caption-side:bottom}th{text-align:inherit}label{display:inline-block;margin-bottom:.5rem}button{border-radius:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}button,input,optgroup,select,textarea{margin:0;font-family:inherit;font-size:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}[type=reset],[type=submit],button,html [type=button]{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{padding:0;border-style:none}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=date],input[type=datetime-local],input[type=month],input[type=time]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}</script>';


			vQMHtml+='<style>fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;max-width:100%;padding:0;margin-bottom:.5rem;font-size:1.5rem;line-height:inherit;color:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}</script>';
			vQMHtml+='<style>output{display:inline-block}summary{display:list-item;cursor:pointer}template{display:none}[hidden]{display:none!important}.h1,.h2,.h3,.h4,.h5,.h6,h1,h2,h3,h4,h5,h6{margin-bottom:.5rem;font-family:inherit;font-weight:500;line-height:1.2;color:inherit}.h1,h1{font-size:2.5rem}.h2,h2{font-size:2rem}.h3,h3{font-size:1.75rem}.h4,h4{font-size:1.5rem}.h5,h5{font-size:1.25rem}.h6,h6{font-size:1rem}.lead{font-size:1.25rem;font-weight:300}.display-1{font-size:6rem;font-weight:300;line-height:1.2}.display-2{font-size:5.5rem;font-weight:300;line-height:1.2}.display-3{font-size:4.5rem;font-weight:300;line-height:1.2}.display-4{font-size:3.5rem;font-weight:300;line-height:1.2}hr{margin-top:1rem;margin-bottom:1rem;border:0;border-top:1px solid rgba(0,0,0,.1)}.small,small{font-size:80%;font-weight:400}.mark,mark{padding:.2em;background-color:#fcf8e3}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;list-style:none}.list-inline-item{display:inline-block}.list-inline-item:not(:last-child){margin-right:.5rem}.initialism{font-size:90%;text-transform:uppercase}.blockquote{margin-bottom:1rem;font-size:1.25rem}.blockquote-footer{display:block;font-size:80%;color:#6c757d}</script>';
			vQMHtml+='<style>.img-fluid{max-width:100%;height:auto}.img-thumbnail{padding:.25rem;background-color:#fff;border:1px solid #dee2e6;border-radius:.25rem;max-width:100%;height:auto}</script>';


			vQMHtml+='<style>.figure{display:inline-block}.figure-img{margin-bottom:.5rem;line-height:1}.figure-caption{font-size:90%;color:#6c757d}code{font-size:87.5%;color:#e83e8c;word-break:break-word}a>code{color:inherit}kbd{padding:.2rem .4rem;font-size:87.5%;color:#fff;background-color:#212529;border-radius:.2rem}kbd kbd{padding:0;font-size:100%;font-weight:700}pre{display:block;font-size:87.5%;color:#212529}pre code{font-size:inherit;color:inherit;word-break:normal}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:576px){.container{max-width:540px}}@media (min-width:768px){.container{max-width:720px}}@media (min-width:992px){.container{max-width:960px}}@media (min-width:1200px){.container{max-width:1140px}}.container-fluid{width:100%;padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{display:-ms-flexbox;display:flex;-ms-flex-wrap:wrap;flex-wrap:wrap;margin-right:-15px;margin-left:-15px}.no-gutters{margin-right:0;margin-left:0}.no-gutters>.col,.no-gutters>[class*=col-]{padding-right:0;padding-left:0}.col,.col-1,.col-10,.col-11,.col-12,.col-2,.col-3,.col-4,.col-5,.col-6,.col-7,.col-8,.col-9,.col-auto,.col-lg,.col-lg-1,.col-lg-10,.col-lg-11,.col-lg-12,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-auto,.col-md,.col-md-1,.col-md-10,.col-md-11,.col-md-12,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-auto,.col-sm,.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-auto,.col-xl,.col-xl-1,.col-xl-10,.col-xl-11,.col-xl-12,.col-xl-2,.col-xl-3,.col-xl-4,.col-xl-5,.col-xl-6,.col-xl-7,.col-xl-8,.col-xl-9,.col-xl-auto{position:relative;width:100%;min-height:1px;padding-right:15px;padding-left:15px}.col{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-first{-ms-flex-order:-1;order:-1}.order-last{-ms-flex-order:13;order:13}.order-0{-ms-flex-order:0;order:0}.order-1{-ms-flex-order:1;order:1}.order-2{-ms-flex-order:2;order:2}.order-3{-ms-flex-order:3;order:3}.order-4{-ms-flex-order:4;order:4}.order-5{-ms-flex-order:5;order:5}.order-6{-ms-flex-order:6;order:6}.order-7{-ms-flex-order:7;order:7}.order-8{-ms-flex-order:8;order:8}.order-9{-ms-flex-order:9;order:9}.order-10{-ms-flex-order:10;order:10}.order-11{-ms-flex-order:11;order:11}.order-12{-ms-flex-order:12;order:12}.offset-1{margin-left:8.333333%}.offset-2{margin-left:16.666667%}.offset-3{margin-left:25%}.offset-4{margin-left:33.333333%}.offset-5{margin-left:41.666667%}.offset-6{margin-left:50%}.offset-7{margin-left:58.333333%}.offset-8{margin-left:66.666667%}.offset-9{margin-left:75%}.offset-10{margin-left:83.333333%}.offset-11{margin-left:91.666667%}@media (min-width:576px){.col-sm{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-sm-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-sm-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-sm-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-sm-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-sm-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-sm-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-sm-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-sm-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-sm-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-sm-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-sm-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-sm-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-sm-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-sm-first{-ms-flex-order:-1;order:-1}.order-sm-last{-ms-flex-order:13;order:13}.order-sm-0{-ms-flex-order:0;order:0}.order-sm-1{-ms-flex-order:1;order:1}.order-sm-2{-ms-flex-order:2;order:2}.order-sm-3{-ms-flex-order:3;order:3}.order-sm-4{-ms-flex-order:4;order:4}.order-sm-5{-ms-flex-order:5;order:5}.order-sm-6{-ms-flex-order:6;order:6}.order-sm-7{-ms-flex-order:7;order:7}.order-sm-8{-ms-flex-order:8;order:8}.order-sm-9{-ms-flex-order:9;order:9}.order-sm-10{-ms-flex-order:10;order:10}.order-sm-11{-ms-flex-order:11;order:11}.order-sm-12{-ms-flex-order:12;order:12}.offset-sm-0{margin-left:0}.offset-sm-1{margin-left:8.333333%}.offset-sm-2{margin-left:16.666667%}.offset-sm-3{margin-left:25%}.offset-sm-4{margin-left:33.333333%}.offset-sm-5{margin-left:41.666667%}.offset-sm-6{margin-left:50%}.offset-sm-7{margin-left:58.333333%}.offset-sm-8{margin-left:66.666667%}.offset-sm-9{margin-left:75%}.offset-sm-10{margin-left:83.333333%}.offset-sm-11{margin-left:91.666667%}}@media (min-width:768px){.col-md{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-md-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-md-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-md-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-md-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-md-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-md-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-md-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-md-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-md-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-md-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-md-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-md-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-md-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-md-first{-ms-flex-order:-1;order:-1}.order-md-last{-ms-flex-order:13;order:13}.order-md-0{-ms-flex-order:0;order:0}.order-md-1{-ms-flex-order:1;order:1}.order-md-2{-ms-flex-order:2;order:2}.order-md-3{-ms-flex-order:3;order:3}.order-md-4{-ms-flex-order:4;order:4}.order-md-5{-ms-flex-order:5;order:5}.order-md-6{-ms-flex-order:6;order:6}.order-md-7{-ms-flex-order:7;order:7}.order-md-8{-ms-flex-order:8;order:8}.order-md-9{-ms-flex-order:9;order:9}.order-md-10{-ms-flex-order:10;order:10}.order-md-11{-ms-flex-order:11;order:11}.order-md-12{-ms-flex-order:12;order:12}.offset-md-0{margin-left:0}.offset-md-1{margin-left:8.333333%}.offset-md-2{margin-left:16.666667%}.offset-md-3{margin-left:25%}.offset-md-4{margin-left:33.333333%}.offset-md-5{margin-left:41.666667%}.offset-md-6{margin-left:50%}.offset-md-7{margin-left:58.333333%}.offset-md-8{margin-left:66.666667%}.offset-md-9{margin-left:75%}.offset-md-10{margin-left:83.333333%}.offset-md-11{margin-left:91.666667%}}@media (min-width:992px){.col-lg{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-lg-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-lg-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-lg-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-lg-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-lg-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-lg-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-lg-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-lg-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-lg-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-lg-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-lg-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-lg-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-lg-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-lg-first{-ms-flex-order:-1;order:-1}.order-lg-last{-ms-flex-order:13;order:13}.order-lg-0{-ms-flex-order:0;order:0}.order-lg-1{-ms-flex-order:1;order:1}.order-lg-2{-ms-flex-order:2;order:2}.order-lg-3{-ms-flex-order:3;order:3}.order-lg-4{-ms-flex-order:4;order:4}.order-lg-5{-ms-flex-order:5;order:5}.order-lg-6{-ms-flex-order:6;order:6}.order-lg-7{-ms-flex-order:7;order:7}.order-lg-8{-ms-flex-order:8;order:8}.order-lg-9{-ms-flex-order:9;order:9}.order-lg-10{-ms-flex-order:10;order:10}.order-lg-11{-ms-flex-order:11;order:11}.order-lg-12{-ms-flex-order:12;order:12}.offset-lg-0{margin-left:0}.offset-lg-1{margin-left:8.333333%}.offset-lg-2{margin-left:16.666667%}.offset-lg-3{margin-left:25%}.offset-lg-4{margin-left:33.333333%}.offset-lg-5{margin-left:41.666667%}.offset-lg-6{margin-left:50%}.offset-lg-7{margin-left:58.333333%}.offset-lg-8{margin-left:66.666667%}.offset-lg-9{margin-left:75%}.offset-lg-10{margin-left:83.333333%}.offset-lg-11{margin-left:91.666667%}}@media (min-width:1200px){.col-xl{-ms-flex-preferred-size:0;flex-basis:0;-ms-flex-positive:1;flex-grow:1;max-width:100%}.col-xl-auto{-ms-flex:0 0 auto;flex:0 0 auto;width:auto;max-width:none}.col-xl-1{-ms-flex:0 0 8.333333%;flex:0 0 8.333333%;max-width:8.333333%}.col-xl-2{-ms-flex:0 0 16.666667%;flex:0 0 16.666667%;max-width:16.666667%}.col-xl-3{-ms-flex:0 0 25%;flex:0 0 25%;max-width:25%}.col-xl-4{-ms-flex:0 0 33.333333%;flex:0 0 33.333333%;max-width:33.333333%}.col-xl-5{-ms-flex:0 0 41.666667%;flex:0 0 41.666667%;max-width:41.666667%}.col-xl-6{-ms-flex:0 0 50%;flex:0 0 50%;max-width:50%}.col-xl-7{-ms-flex:0 0 58.333333%;flex:0 0 58.333333%;max-width:58.333333%}.col-xl-8{-ms-flex:0 0 66.666667%;flex:0 0 66.666667%;max-width:66.666667%}.col-xl-9{-ms-flex:0 0 75%;flex:0 0 75%;max-width:75%}.col-xl-10{-ms-flex:0 0 83.333333%;flex:0 0 83.333333%;max-width:83.333333%}.col-xl-11{-ms-flex:0 0 91.666667%;flex:0 0 91.666667%;max-width:91.666667%}.col-xl-12{-ms-flex:0 0 100%;flex:0 0 100%;max-width:100%}.order-xl-first{-ms-flex-order:-1;order:-1}</style>';

			vQMHtml+='<style>.flickity-enabled { position: relative; } .flickity-enabled:focus { outline: none; } .flickity-viewport { overflow: hidden; position: relative; height: 100%; } .flickity-slider { position: absolute; width: 100%; height: 100%; } /* draggable */ .flickity-enabled.is-draggable { -webkit-tap-highlight-color: transparent; tap-highlight-color: transparent; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .flickity-enabled.is-draggable .flickity-viewport { cursor: move; cursor: -webkit-grab; cursor: grab; } .flickity-enabled.is-draggable .flickity-viewport.is-pointer-down { cursor: -webkit-grabbing; cursor: grabbing; } /* ---- previous/next buttons ---- */ .flickity-prev-next-button { position: absolute; top: 50%; width: 44px; height: 44px; border: none; border-radius: 50%; background: white; background: hsla(0, 0%, 100%, 0.75); cursor: pointer; /* vertically center */ -webkit-transform: translateY(-50%); transform: translateY(-50%); } .flickity-prev-next-button:hover { background: white; } .flickity-prev-next-button:focus { outline: none; box-shadow: 0 0 0 5px #09F; } .flickity-prev-next-button:active { opacity: 0.6; } .flickity-prev-next-button.previous { left: 10px; } .flickity-prev-next-button.next { right: 10px; } /* right to left */ */ /* .flickity-rtl .flickity-prev-next-button.previous { */ /*   left: auto; */ /*   right: 10px; */ /* } */ /* .flickity-rtl .flickity-prev-next-button.next { */ /*   right: auto; */ /*   left: 10px; */ /* } */ .flickity-prev-next-button:disabled { opacity: 0.3; cursor: auto; } .flickity-prev-next-button svg { position: absolute; left: 20%; top: 20%; width: 60%; height: 60%; } .flickity-prev-next-button .arrow { fill: #333; } /* ---- page dots ---- */ /* .flickity-page-dots { */ /*   position: absolute; */ /*   width: 100%; */ /*   bottom: -25px; */ /*   padding: 0; */ /*   margin: 0; */ /*   list-style: none; */ /*   text-align: center; */ /*   line-height: 1; */ /* } */ /*  */ /* .flickity-rtl .flickity-page-dots { direction: rtl; } */ /*  */ /* .flickity-page-dots .dot { */ /*   display: inline-block; */ /*   width: 10px; */ /*   height: 10px; */ /*   margin: 0 8px; */ /*   background: #333; */ /*   border-radius: 50%; */ /*   opacity: 0.25; */ /*   cursor: pointer; */ /* } */ /*  */ /* .flickity-page-dots .dot.is-selected { */ /*   opacity: 1; */ /* } */ /* end external css: flickity.css */ /*! Flickity v2.0.4 https://flickity.metafizzy.co ---------------------------------------------- */ * { box-sizing: border-box; } body { font-family: sans-serif; } .carousel { background: #FAFAFA; } .carousel-main { margin-bottom: 8px; } .carousel-cell { width: 100%; height: 504px; margin-right: 8px; background: #8C8; border-radius: 5px; /* counter-increment: carousel-cell; */ } /* cell number */ /* .carousel-cell:before { */ /*   display: block; */ /*   text-align: center; */ /*   content: counter(carousel-cell); */ /*   line-height: 200px; */ /*   font-size: 80px; */ /*   color: white; */ /* } */ .carousel-nav .carousel-cell { height: 90px; width: 120px; } /* .carousel-nav .carousel-cell:before { */ /*   font-size: 50px; */ /*   line-height: 80px; */ /* } */ /* .carousel-nav .carousel-cell.is-nav-selected { */ /*   background: #ED2; */ /* } */ /* Atelierbram edit */ .carousel-main img { display: block; margin: 0 auto; } .container { max-width: 672px; margin: 0 auto; } h1 { text-align: center; } } .carousel-main{ .carousel-cell{ width: 100%; height: 360px; font-size: 5rem; } } .carousel-nav{ width: 300px; transform: rotate(90deg) translate(0px, -100%); transform-origin: left top; @media screen and (max-width: 1200px) { transform: rotate(90deg) translate(30px, -50%); } .carousel-cell { transform: rotate(-90deg); width: 80px; height: 80px; cursor: pointer; margin-right: 1rem; font-size: 1.4rem; /* selected cell */ &.is-nav-selected { background: #ED2; } } .flickity-prev-next-button { width: 40px; height: 40px; background: transparent; &.previous{ left: -40px; } &.next{ right: -40px; } } }</style>';
			vQMHtml+='<style> #widget-fave-html { margin: 0; width: 100%; }    #widget-fave-html .ssw-fave-btn { width: 100%; } #widget-fave-html .ssw-fave-btn[data-button-type="add_to_cart"] { padding: 0; } #widget-fave-html .ssw-fave-btn[data-button-type="default"] .ssw-fave-btn-content, #widget-fave-html .ssw-fave-btn[data-button-type="add_to_cart"], #widget-fave-html .ssw-fave-btn[data-button-type="wishlist_button"], #widget-fave-html .ssw-fave-link[data-button-type="link"] { width: 100%; padding: 13px 20px 13px 20px; } #widget-fave-html:hover .ssw-fave-btn[data-button-type="default"] .ssw-fave-btn-content, #widget-fave-html:hover .ssw-fave-btn[data-button-type="add_to_cart"], #widget-fave-html:hover .ssw-fave-btn[data-button-type="wishlist_button"], #widget-fave-html:hover .ssw-fave-link[data-button-type="link"], #widget-fave-html:hover .sw-fave-btn-counter { } #widget-fave-html .ssw-fave-btn[data-button-type="default"] .ssw-fave-btn-content, #widget-fave-html .ssw-fave-btn[data-button-type="add_to_cart"] .ssw-fave-btn-content, #widget-fave-html .ssw-fave-btn[data-button-type="wishlist_button"] .ssw-fave-btn-content { } #widget-fave-html .ssw-fave-btn:not([data-button-type="wishlist_button"]) .ssw-fave-btn-counter { } #widget-fave-html .ssw-fave-btn-default:not([data-button-type="wishlist_button"]) .ssw-fave-btn-counter:before { } #widget-fave-html .ssw-icon-heart:before { color: #a32f2f; } #widget-fave-html .ssw-icon-heart-o:before { color: #a32f2f; }</style>';
			vQMHtml+='</div>';
			vQMHtml+='<div class="product-block">DESCRIPTION</div>';
			vQMHtml+='<div class="product-block">';
			vQMHtml+='<div class="rte">'+productdetails.product.body_html+'';
			vQMHtml+='</div>';
			vQMHtml+='</div>';




			$(document).ready(function() {
				$('.head').click(function(){
					$(this).toggleClass('active');
					$(this).parent().find('.arrow').toggleClass('arrow-animate');
					$(this).parent().find('.content').slideToggle(280);
				});
			});


			vQMHtml+='<div class="product-block">';
			vQMHtml+='<div id="accordion-1">';
			vQMHtml+='<div class="head"> <span>Shipping information</span>';
			vQMHtml+='<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon--wide icon-chevron-down" viewBox="0 0 28 16"><path d="M1.57 1.59l12.76 12.77L27.1 1.59" stroke-width="2" stroke="#000" fill="none" fill-rule="evenodd"></path></svg>';
			vQMHtml+=' </div>';
			vQMHtml+=' <div class="content">';
			vQMHtml+='<meta charset="utf-8"><meta charset="utf-8"> <p>We currently offer free ground shipping on orders over $100.&nbsp;Oversize or additional shipping charges may apply to some items due to their size and weight, regardless of the purchase amount. The product page will denote if an item is excluded from the free shipping promotion.</p> <p class="p1">Brands with oversize or non-standard shipping rates include: 2MamaBees, Baghera, Banwood, Best Ride On Cars, ColorJeu, Hansa, John Deere, KHW, MillerGoodman, Playsam, PonyCycle, Rian Tricot, Sideshow.</p> <p class="p1">Some items from the following brands may also be excluded from free shipping: Barbie, Bunnies By The Bay, FAO Schwarz, Iron Studios, Kettler, Le Toy Van, Lucio Londero, Ruby Red Fashion Friends, Steiff, Tender Leaf, Wonder &amp; Wise, WS Game Company.&nbsp;</p> <p class="p1">Unfortunately, at this time we cannot ship to Alaska, Hawaii, U.S. Virgin Islands, Puerto Rico or APO/FPO/DPO addresses. We do not ship internationally.</p> <meta charset="utf-8"> <p class="p1"><span>**Please note that Saturday, Sunday and holidays are not considered business days for order processing and/or delivery.&nbsp;</span>&nbsp;</p> <p class="p1"><strong>Continental United States Shipping Options</strong></p> <table width="542"> <tbody> <tr> <td width="82"> <p>&nbsp;</p> </td> <td width="116">FedEx Ground</td> <td width="114">FedEx 2 Day</td> <td width="122">FedEx Overnight</td> <td width="108">Oversized Order</td> </tr> <tr> <td>Order Value</td> <td>3-10 Business Days</td> <td>2nd Business Day</td> <td>Next Business Day</td> <td>&nbsp;3-10 Business Days</td> </tr> <tr> <td>$25 + Under</td> <td>$9.99</td> <td>$18.99</td> <td>$29.99</td> <td>Varies</td> </tr> <tr> <td>$25.01 - $50</td> <td>$10.99</td> <td>$24.99</td> <td>$34.99</td> <td> <div><meta charset="utf-8"></div> <span>Varies</span> </td> </tr> <tr> <td>$50.01- $75</td> <td>$12.99</td> <td>$29.99</td> <td>$39.99</td> <td> <div><meta charset="utf-8"></div> <span>Varies</span> </td> </tr> <tr> <td>$75.01- $100</td> <td>$14.99</td> <td>$34.99</td> <td>$44.99</td> <td> <div><meta charset="utf-8"></div> <span>Varies</span> </td> </tr> <tr> <td>Over $100&nbsp;</td> <td>Free!&nbsp;</td> <td>$39.99</td> <td>$49.99</td> <td> <p>$250</p> </td> </tr> <tr> <td>Over $200</td> <td>Free!</td> <td>$74.99</td> <td>$99.99</td> <td> <p>&nbsp;</p> </td> </tr> </tbody> </table> <p>&nbsp;</p> <p>**Please note that Saturday, Sunday and holidays are not considered business days for order processing and/or delivery.&nbsp;</p> <p><strong>Express Shipping</strong></p> <p>We offer express shipping including FedEx 2 day and FedEx Overnight for customers. With expedited shipping, please note that any orders placed after 10am EST will be processed the next business day. Any express orders placed on Friday will likely not ship until Monday, next business day.</p> <p><strong>Oversized Items</strong></p> <p>Some of our fantastical items are oversized and will take some additional love to get to you. We charge a flat rate shipping fee, ranging from $200-$350 for each oversized item on order. These items do not qualify for free shipping.&nbsp;</p> <p>&nbsp;</p>';

			vQMHtml+=' </div>';
			vQMHtml+=' </div>';
			vQMHtml+='<div id="accordion-2">';
			vQMHtml+='<div class="head"> <span>Return Policy</span>';
			vQMHtml+='<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon--wide icon-chevron-down" viewBox="0 0 28 16"><path d="M1.57 1.59l12.76 12.77L27.1 1.59" stroke-width="2" stroke="#000" fill="none" fill-rule="evenodd"></path></svg>';
			vQMHtml+=' </div>';
			vQMHtml+=' <div class="content">';
			vQMHtml+=' <meta charset="utf-8"> <p>We pride ourselves in customer satisfaction and will work to ensure you are happy with your purchase!</p> <p><strong><u>Online Return Policy:</u></strong></p> <p>In case you are not entirely satisfied with your purchase, we are here to help.</p> <p>Initiate a return via our <a href="https://faoschwarz.com/pages/return-portal" title="Return Portal"><u>Return Portal</u></a> within 30 days of receiving your order ($15 fee applies).</p> <p>We will review the return inquiry and respond with a return label or additional instructions within 48 hours.</p> <p><strong>All products must be in their original packaging and not used or damaged. If your returned item arrives damaged at our warehouse, we will not be able to refund the purchase.</strong></p> <p><strong>All items from FAO Schwarz, Sharper Image and Discovery have a 90-day warranty period. If your item breaks or is damaged, we are happy to provide you with a replacement within 90 days of purchase.&nbsp;</strong></p> <p>Please note some items are final sale and do not qualify to be returned. Final sale status can be found on the website product listing page and includes clearance and food items.</p> <p>Some items that ship directly from our partners may have additional instructions, restocking and/or shipping fees. Contact us for assistance with these return at contactus@fao.com.</p> <p><strong><u>Refunds:</u></strong></p> <p>Refunds are processed in the form of original payment, less the original shipping fee. Please note an additional $15 fee is applied to cover the cost of the pre-paid shipping label and our restocking fee.</p> <meta charset="utf-8"> <p><strong>All products must be in their original packaging and not used or damaged. If your returned item arrives damaged at our warehouse, we will not be able to refund the purchase.</strong></p> <p>If you have any questions regarding a refund or status of return, please contact us at contactus@fao.com.</p> <p>&nbsp;</p> <iframe id="_pericles_content_iframe-modal" style="position: absolute; top: -99px; left: 0px; width: 50px; height: 26px; background: transparent; overflow: visible; margin-top: -30px; transition: top 2s ease-in-out 0s; z-index: 2147483647; border: none; padding: 0px;"></iframe> ';
			vQMHtml+=' </div>';
			vQMHtml+=' </div>';
			vQMHtml+=' </div>';



			vQMHtml+='<div class="product-block"><div class="social-sharing"><a target="_blank" rel="noopener" href="//www.facebook.com/sharer.php?u=https://faoschwarz.com/products/'+handle+'" class="social-sharing__link" title="Share on Facebook"> <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-facebook" viewBox="0 0 14222 14222"><path d="M14222 7112c0 3549.352-2600.418 6491.344-6000 7024.72V9168h1657l315-2056H8222V5778c0-562 275-1111 1159-1111h897V2917s-814-139-1592-139c-1624 0-2686 984-2686 2767v1567H4194v2056h1806v4968.72C2600.418 13603.344 0 10661.352 0 7112 0 3184.703 3183.703 1 7111 1s7111 3183.703 7111 7111zm-8222 7025c362 57 733 86 1111 86-377.945 0-749.003-29.485-1111-86.28zm2222 0v-.28a7107.458 7107.458 0 0 1-167.717 24.267A7407.158 7407.158 0 0 0 8222 14137zm-167.717 23.987C7745.664 14201.89 7430.797 14223 7111 14223c319.843 0 634.675-21.479 943.283-62.013z"></path></svg> <span class="social-sharing__title" aria-hidden="true">Share</span> <span class="visually-hidden">Share on Facebook</span> </a><a target="_blank" rel="noopener" href="//twitter.com/share?text=12%22%20Panda%20Plush%20with%20Party%20Hat&amp;url=https://faoschwarz.com/products/'+handle+'" class="social-sharing__link" title="Tweet on Twitter"> <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-twitter" viewBox="0 0 32 32"><path fill="#444" d="M31.281 6.733q-1.304 1.924-3.13 3.26 0 .13.033.408t.033.408q0 2.543-.75 5.086t-2.282 4.858-3.635 4.108-5.053 2.869-6.341 1.076q-5.282 0-9.65-2.836.913.065 1.5.065 4.401 0 7.857-2.673-2.054-.033-3.668-1.255t-2.266-3.146q.554.13 1.206.13.88 0 1.663-.261-2.184-.456-3.619-2.184t-1.435-3.977v-.065q1.239.652 2.836.717-1.271-.848-2.021-2.233t-.75-2.983q0-1.63.815-3.195 2.38 2.967 5.754 4.678t7.319 1.907q-.228-.815-.228-1.434 0-2.608 1.858-4.45t4.532-1.842q1.304 0 2.51.522t2.054 1.467q2.152-.424 4.01-1.532-.685 2.217-2.771 3.488 1.989-.261 3.619-.978z"></path></svg> <span class="social-sharing__title" aria-hidden="true">Tweet</span> <span class="visually-hidden">Tweet on Twitter</span> </a><a target="_blank" rel="noopener" href="//pinterest.com/pin/create/button/?url=https://faoschwarz.com/products/'+handle+'&amp;media=//cdn.shopify.com/s/files/1/2284/6393/products/fao-schwarz-plush-12-panda-plush-with-party-hat-29373147775063_1024x1024.png?v=1660527878&amp;description=12%22%20Panda%20Plush%20with%20Party%20Hat" class="social-sharing__link" title="Pin on Pinterest"> <svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-pinterest" viewBox="0 0 256 256"><path d="M0 128.002c0 52.414 31.518 97.442 76.619 117.239-.36-8.938-.064-19.668 2.228-29.393 2.461-10.391 16.47-69.748 16.47-69.748s-4.089-8.173-4.089-20.252c0-18.969 10.994-33.136 24.686-33.136 11.643 0 17.268 8.745 17.268 19.217 0 11.704-7.465 29.211-11.304 45.426-3.207 13.578 6.808 24.653 20.203 24.653 24.252 0 40.586-31.149 40.586-68.055 0-28.054-18.895-49.052-53.262-49.052-38.828 0-63.017 28.956-63.017 61.3 0 11.152 3.288 19.016 8.438 25.106 2.368 2.797 2.697 3.922 1.84 7.134-.614 2.355-2.024 8.025-2.608 10.272-.852 3.242-3.479 4.401-6.409 3.204-17.884-7.301-26.213-26.886-26.213-48.902 0-36.361 30.666-79.961 91.482-79.961 48.87 0 81.035 35.364 81.035 73.325 0 50.213-27.916 87.726-69.066 87.726-13.819 0-26.818-7.47-31.271-15.955 0 0-7.431 29.492-9.005 35.187-2.714 9.869-8.026 19.733-12.883 27.421a127.897 127.897 0 0 0 36.277 5.249c70.684 0 127.996-57.309 127.996-128.005C256.001 57.309 198.689 0 128.005 0 57.314 0 0 57.309 0 128.002z"></path></svg> <span class="social-sharing__title" aria-hidden="true">Pin it</span> <span class="visually-hidden">Pin on Pinterest</span> </a></div> </div></div></div></div> </div> </div></div> </div> </div> </div></div> </div>';

			vQMHtml+='</div>';
			vQMHtml+='</div>';
			vQMHtml+='</div>';

			vQMHtml+='<style> #accordion-1 .content{ background-color: #FFFFFF; display: none; padding: 20px 30px; color: #333333; }#accordion-2 .content{ background-color: #FFFFFF; display: none; padding: 30px; color: #333333; } </style>';
			vQMHtml+='<style>.image-wrap .animate-me, .image-wrap img:not([role=presentation]), .image-wrap svg { opacity: 1; }</style>';

			$("#evmQS").html(vQMHtml);


			$( ".evm-wi-quick-close-btn" ).on( "click", function(event) {
				$(".modal--square").fadeOut();
				$("#evmQS").html("");
				$('body').removeClass('evmscrollremove');
			});
		});

		$(".js-qty__adjust").on("click", function() {
			var $button = $(this),
			$input = $button.closest('.js-qty__wrapper').find("input.js-qty__num");
			var oldValue = $input.val(),
			newVal;

			if ($.trim($button.text()) == "+") {

				newVal = parseFloat(oldValue) + 1;
			} else {
				if (oldValue > 0) {
					newVal = parseFloat(oldValue) - 1;
				} else {
					newVal = 1;
				}
			}
			$input.val(newVal);
		});
	});
}

/* ******************* start bundle discount code ******************* */
function wsHandleCartRequests(wsUrl) {
	var wsIsCartRequestProcessed = true;
	if ((wsUrl.includes('/cart.js') || wsUrl.includes('/cart.json') || wsUrl.includes('/cart/add.js') || wsUrl.includes('/cart/update.js') || wsUrl.includes('/cart/change') || wsUrl.includes('/cart/clear.js') || wsUrl.endsWith('/cart') || wsUrl.includes('/cart?')) && !wsUrl.includes('/cart?view')) {
		if (wsUrl.includes('/cart/add.js') || wsUrl.endsWith('/cart') || wsUrl.includes('/cart?') ) {}
			else { wsIsCartRequestProcessed = false; }
	}
	return wsIsCartRequestProcessed;
}

function ws_cart_chk_disc(wsCartData) {
	var old_cart_cnt   = 0;
	var vari_match_cnt = 0;
	var cart_cnt_curr = wsCartData.items.length;
	if (old_cart_cnt != cart_cnt_curr) {
		old_cart_cnt = cart_cnt_curr;
		var ws_disc_res_localstorag = window.localStorage.getItem("ws_disc_res");
		if (ws_disc_res_localstorag != null && ws_disc_res_localstorag != "") {
			var ws_variant_ids_obj      = JSON.parse(ws_disc_res_localstorag);
			var variant_ids_obj         = ws_variant_ids_obj.ws_variant_ids;
			var vari_cnt_ids            = Object.keys(ws_variant_ids_obj.ws_variant_ids).length;
			jQuery.each(wsCartData.items, (index, item) => {
				jQuery.each(variant_ids_obj, (key, vari_id) => {
					if (item.variant_id == vari_id) {
						vari_match_cnt++;
					}
				});
			});
		}
		if ((vari_cnt_ids-1) == vari_match_cnt) {
			var fbt_exp_http     = new XMLHttpRequest();
			var fbt_exp_evmurl   = evmwiseHost+"app_lang/bundle_disc_auto_expire";
			var fbt_exp_data     = new FormData();
			fbt_exp_data.append('shop', ShopId);
			fbt_exp_data.append('ws_disc_res_localstorag', ws_disc_res_localstorag);
			fbt_exp_http.open('POST', fbt_exp_evmurl, true);
			fbt_exp_http.onreadystatechange = function() {
				if(fbt_exp_http.readyState == 4 && fbt_exp_http.status == 200) {
					console.log("!!*^*!! discount expire !!*^*!!");
					$(".ws_fbt_bundle_disc").removeClass("ws_fbt_bundle_disc");
					var expire_res = JSON.parse(fbt_exp_http.responseText);
					window.localStorage.removeItem("fbt_disc_apld_msg");
					window.localStorage.removeItem("ws_disc_res");
					window.localStorage.removeItem("fbt_manu_bndl_disc");
					window.localStorage.removeItem("fbt_global_discount");
					$(".fbt_ws_bundle_disc_msg").remove();
				}
			}
			fbt_exp_http.send(fbt_exp_data);
		}
	}
}

if (wiser_shopID == '71992312020') {
	document.querySelectorAll("body #CartDrawer .quantity__input, body main-cart .quantity__input").forEach(function(input) {
		input.addEventListener('change', function() {
			fetch('/cart.js')
			.then(response => response.json())
			.then(wsCartData => {
				ws_cart_chk_disc(wsCartData);
			})
			.catch(error => console.error('Error fetching cart data:', error));
		});
	});

	if (window.localStorage.getItem("__fbtDiscChk") !== null && window.localStorage.getItem("__fbtDiscChk") == "active") {
		setInterval(function() {
			$=jQuery.noConflict();
	    // var fbt_ws_bundle_disc_msg = $(".fbt_ws_bundle_disc_msg").text();
	    // var fbt_ws_bundle_disc_msg = document.querySelectorAll(".fbt_ws_msg_apld")[0];
	    // if(typeof fbt_ws_bundle_disc_msg !== 'undefined' && fbt_ws_bundle_disc_msg == "") {
			if(typeof $(".fbt_ws_msg_apld div").length !== 'undefined' && $(".fbt_ws_msg_apld div").length == '') {
	    	// fbt_ws_bundle_disc_msg = fbt_ws_bundle_disc_msg.innerText;
				var fbt_apld_msg_chk = window.localStorage.getItem("fbt_disc_apld_msg");
				switch(fbt_apld_msg_chk){
				case '1':
					var fbt_apld_msg = window.localStorage.getItem("fbt_manu_bndl_disc");
					if (fbt_apld_msg != "") {
						var ws_get_msg_obj = JSON.parse(fbt_apld_msg);
						if (ws_get_msg_obj != null) {
							$('body .fbt_ws_msg_apld').html("<div class='fbt_ws_bundle_disc_msg'>"+ws_get_msg_obj.fbt_disc_apld_msg+"</div>");
							// $.getJSON('/cart.js', function(wsCartData) {
							//     console.log(" sssssssss ", wsCartData);	
							//     ws_cart_chk_disc(wsCartData);
					        // });
							// $('body form[action="/cart"] button[type="submit"], body form[action="/cart"] button[type="button"], body form[action="/cart"] input[type="submit"], body form[action="/cart"] input[type="button"], body form[action="/cart"] .ws_fbt_bundle_disc').attr("type", "button");
						}
					}
					break;
				case '2':
					var fbt_apld_msg = window.localStorage.getItem("fbt_global_discount");
					if (fbt_apld_msg != "") {
						var ws_get_msg_obj = JSON.parse(fbt_apld_msg);
						if (ws_get_msg_obj != null) {
							$('body .fbt_ws_msg_apld').html("<div class='fbt_ws_bundle_disc_msg'>"+ws_get_msg_obj.fbt_disc_apld_msg+"</div>");
							// $.getJSON('/cart.js', function(wsCartData) {
							//     console.log(" dddddd ", wsCartData);	
							//     ws_cart_chk_disc(wsCartData);
					        // });
							// $('body form[action="/cart"] button[type="submit"], body form[action="/cart"] button[type="button"], body form[action="/cart"] input[type="submit"], body form[action="/cart"] input[type="button"], body form[action="/cart"] .ws_fbt_bundle_disc').attr("type", "button");
						}
					}
					break;
				}
			}
			if (localStorage.getItem("ws_disc_res") !== null) {
				if($('.ws_discount_check').length == 0) {
					var wsFbtDiscData = window.localStorage.getItem("ws_disc_res");
					var wsDiscArr = JSON.parse(wsFbtDiscData);
					var wsDiscCode = (wsDiscArr.ws_disc_code).split("").reverse().join("");
					$("#CartDrawer-Form").append('<input class="ws_discount_check" type="hidden" value="'+wsDiscCode+'" name="discount">');
				}
			}
		}, 1000);
	}
}

// function wsChkBndlDiscChkOutBtn() {
	var wsClassCartCheckout = ['ws_fbt_bundle_disc', 'checkout__button', 'checkout-btn'];
	document.addEventListener('click', function(event) {
		if (wsClassCartCheckout.some(className => event.target.matches('.' + className))) {
			event.preventDefault();
			// event.stopPropagation();
			/*var wsClassCartCheckout = 'body .ws_fbt_bundle_disc, body .Cart__Checkout, body .cart__checkout, body .checkout__button, body .checkout-btn';
			$(document).on("click", wsClassCartCheckout, function() {*/
			var fbt_disc_apld_msg = JSON.parse(window.localStorage.getItem("fbt_disc_apld_msg"));
			if (fbt_disc_apld_msg == 1 || fbt_disc_apld_msg == 2) {
				var qty_vari_obj = {};
				jQuery.getJSON('/cart.js', function(cart) {
					jQuery.each(cart.items, (index, item) => {
						qty_vari_obj[item.variant_id] = item.quantity;
					});
					if (qty_vari_obj) {
						var fbt_apld_http = new XMLHttpRequest();
						var fbt_evmurl    = evmwiseHost+"app_lang/bundle_disc_auto_checkout";
						var fbt_disc_data = window.localStorage.getItem("ws_disc_res");
						var fbt_data      = new FormData();
						fbt_data.append('shop', ShopId);
						fbt_data.append('fbt_disc_data', fbt_disc_data);
						fbt_data.append('fbt_disc_apld_type', fbt_disc_apld_msg);
						fbt_data.append('qty_vari_obj', JSON.stringify(qty_vari_obj));
						fbt_apld_http.open('POST', fbt_evmurl, true);
						fbt_apld_http.onreadystatechange = function() {

							if(fbt_apld_http.readyState == 4 && fbt_apld_http.status == 200) {
								var res_apld = JSON.parse(fbt_apld_http.responseText);
								if (res_apld.status == 200 && res_apld.web_url != "") {
									window.location.href = res_apld.web_url;
								} else {
									console.log("!!*^*!! discount not apply !!*^*!!");
								}
							}
						}
						fbt_apld_http.send(fbt_data);
					}
				});
			}
		}
	});
// }
// if (PageName == "cart" && wiser_shopID == "71992312020") {
	// wsChkBndlDiscChkOutBtn();
// }
/* run script when add to cart */
function ws_bundle_disc_auto(fbt_disc_ttl, fbt_orig_ttl, ws_sett_arr, fbt_template) {
	var alsobought_temp = ws_sett_arr.alsobought_template;
	if (alsobought_temp == "") alsobought_temp = fbt_template;
	if (alsobought_temp == "alsobought_template1" || alsobought_temp == "alsobought_template2") {
		if (fbt_main_product_id != 0 && fbt_disc_ttl != "" && fbt_orig_ttl != "") {
			var fbt_http   = new XMLHttpRequest();
			var fbt_evmurl = evmwiseHost+"app_lang/ws_bundle_disc_auto";
			var fbt_p_ids  = {};
			var fbt_v_ids  = {};
			switch (alsobought_temp){
			case 'alsobought_template1':
				fbt_p_ids[fbt_main_product_id] = "on";
				var vari_id = $("#evm_alsobought_product_"+fbt_main_product_id).val();
				fbt_v_ids[vari_id] = vari_id;
				$(".evm-also-bought .evm-ws-card .ws-card__header input:checked, .evm-also-bought-products .evm-ws-card .ws-card__header input:checked").each(function() {
					var bought_product = $(this).attr("bought_product");
					fbt_p_ids[bought_product] = $(this).val();
					var fbt_vari_id = $(this).parent().parent().parent().find('.ws-card__body').find("select").val();
					fbt_v_ids[fbt_vari_id] = fbt_vari_id;
				});
				break;
			case 'alsobought_template2':
				$(".evm-also-bought .evm-ws-body-section .ws-card__header input:checked, .evm-also-bought-products .evm-ws-body-section .ws-card__header input:checked").each(function() {
					var bought_product = $(this).attr("bought_product");
					fbt_p_ids[bought_product] = $(this).val();
					var fbt_vari_id = $(this).parent().parent().find('.ws-product-size').find("select").val();
					fbt_v_ids[fbt_vari_id] = fbt_vari_id;
				});
				break;
			}

			var ws_disc_res = window.localStorage.getItem("ws_disc_res");
			var fbt_data    = new FormData();
			fbt_data.append('fbt_main_product_id', fbt_main_product_id);
			fbt_data.append('shop', ShopId);
			fbt_data.append('fbt_p_ids', JSON.stringify(fbt_p_ids));
			fbt_data.append('fbt_v_ids', JSON.stringify(fbt_v_ids));
			fbt_data.append('ws_disc_res', ws_disc_res);
			fbt_http.open('POST', fbt_evmurl, true);
			fbt_http.onreadystatechange = function() {
				if(fbt_http.readyState == 4 && fbt_http.status == 200) {
					var response = JSON.parse(fbt_http.responseText);
					window.localStorage.setItem("fbt_disc_apld_chk", JSON.stringify({value : "check", expiry : new Date().getTime() + 60*60*24*1000})); /* set localStorage for 24 hours  */
					window.localStorage.setItem("fbt_disc_apld_msg", response.fbt_disc_apld_msg);
					if (response.status == 200) {
						if (typeof response.ws_disc_res != "undefined" && response.ws_disc_res !== null && response.ws_disc_res.ws_disc_code == 201) { /* if already discount created */}
						else {
							window.localStorage.setItem("ws_disc_res", JSON.stringify(response.ws_disc_res));
						}
						shopIdArr = ['55534747822','4978277','53956214984','25251971119','30113282','9529557088','4284973','15383241','71992312020']; /* add shop id if cart drawer in store if user on bundle discount */
						setTimeout(function() {
							if (!shopIdArr.includes(wiser_shopID)) {
								window.location.href = wiser_shop_domain+"/cart";
							}
						}, 500);
					}
				}
			}
			fbt_http.send(fbt_data);
		}
	}
}
/* end run script when add to cart */

/* run script onload */
function ws_fbt_update_disc(wiser_pid = "", data = "", wsCheck = "") {
	if (data.fbt_disc == "yes" || wsCheck == 1) {
		var ws_count_alsob_div = $(".evm-also-bought div, .evm-also-bought-products div").length;
		if (ws_count_alsob_div > 10) {
			var fbt_disc_apld_msg = JSON.parse(window.localStorage.getItem("fbt_disc_apld_msg"));
			if (fbt_disc_apld_msg != 1 || fbt_disc_apld_msg != 2) {

				if (wiser_pid != "" && data != "") {

				/* if condition worked only on load */
					fbt_main_product_id      = wiser_pid;
					if (typeof data.manu_bndl_disc != 'undefined' &&  data.manu_bndl_disc != "no discount" && data.manu_bndl_disc != "")
						var fbt_manu_bndl_disc = JSON.parse(data.manu_bndl_disc);
					if (typeof data.fbt_global_discount != 'undefined' && data.fbt_global_discount != "")
						var fbt_global_discount = JSON.parse(data.fbt_global_discount);
					if (data.manu_bndl_disc != "") {
						window.localStorage.setItem("fbt_manu_bndl_disc", data.manu_bndl_disc);
					}
					if (data.fbt_global_discount != "") {
						window.localStorage.setItem("fbt_global_discount", data.fbt_global_discount);
					}
					ws_price_disc(fbt_manu_bndl_disc, fbt_global_discount);
				} else {
				/* else condition worked when user cehck unchecked FBT product */
					var fbt_manu_bndl_disc  = window.localStorage.getItem("fbt_manu_bndl_disc");
					var fbt_global_discount = window.localStorage.getItem("fbt_global_discount");

					if (fbt_manu_bndl_disc != "no discount" && fbt_manu_bndl_disc != '' && fbt_manu_bndl_disc != null)
						fbt_manu_bndl_disc  = JSON.parse(window.localStorage.getItem("fbt_manu_bndl_disc"));
					if (fbt_global_discount != "no discount" && fbt_global_discount != '' && fbt_global_discount != null)
						fbt_global_discount = JSON.parse(window.localStorage.getItem("fbt_global_discount"));
					ws_price_disc(fbt_manu_bndl_disc, fbt_global_discount);
				}
			}
		}
	}
}

function ws_price_disc(fbt_manu_bndl_disc, fbt_global_discount) {
	if (fbt_manu_bndl_disc != null && fbt_manu_bndl_disc.fbt_disc_status == "active") {
		// wsChkBndlDiscChkOutBtn();
		window.localStorage.setItem("__fbtDiscChk", fbt_manu_bndl_disc.fbt_disc_status);
		ws_set_disc(fbt_manu_bndl_disc.fbt_min_bndl_price, fbt_manu_bndl_disc.fbt_disc_type, fbt_manu_bndl_disc.fbt_disc_amt_fix, fbt_manu_bndl_disc.fbt_disc_perc, fbt_manu_bndl_disc.fbt_disc_msg, fbt_manu_bndl_disc.fbt_partial_bundle, fbt_manu_bndl_disc.fbt_min_max_pdct);
	} else if (fbt_global_discount != null && fbt_global_discount.fbt_disc_status == "active") {
		// wsChkBndlDiscChkOutBtn();
		window.localStorage.setItem("__fbtDiscChk", fbt_global_discount.fbt_disc_status);
		ws_set_disc(fbt_global_discount.fbt_min_bndl_price, fbt_global_discount.fbt_disc_type, fbt_global_discount.fbt_disc_amt_fix, fbt_global_discount.fbt_disc_perc, fbt_global_discount.fbt_disc_msg, fbt_global_discount.fbt_partial_bundle, fbt_global_discount.fbt_min_max_pdct);
	}
}

function ws_set_disc(fbt_min_bndl_price, fbt_disc_type, fbt_disc_amt_fix, fbt_disc_perc, fbt_disc_msg, fbt_partial_bundle, fbt_min_max_pdct) {
	var fbt_money_sbl      = $("#evm-ws-alsobought-amount").text().slice(0,1);
	var fbt_ttl_prc        = parseFloat($("#evm-ws-alsobought-amount").text().match(/-?(?:\d+(?:\.\d*)?|\.\d+)/)[0]);
	if (wiser_shopID == "4284973") {
		var fbt_ttl_prc        = parseFloat($("#evm-ws-alsobought-amount").text().replace(/[^\d]/g, ''));
	}
	var get_temp_name = $('.evm-wsrow').attr('class').split(' ').pop();
	var fbt_p_ids_chk = {};
	var fbt_v_ids_chk = {};
	if(get_temp_name == "alsobought_template1") {
		fbt_p_ids_chk[fbt_main_product_id] = "on";
		var vari_id = $("#evm_alsobought_product_"+fbt_main_product_id).val();
		fbt_v_ids_chk[vari_id] = vari_id;
		$(".evm-also-bought .evm-ws-card .ws-card__header input:checked, .evm-also-bought-products .evm-ws-card .ws-card__header input:checked").each(function() {
			var bought_product = $(this).attr("bought_product");
			fbt_p_ids_chk[bought_product] = $(this).val();
			var fbt_vari_id = $(this).parent().parent().parent().find('.ws-card__body').find("select").val();
			fbt_v_ids_chk[fbt_vari_id] = fbt_vari_id;
		});
	} else if (get_temp_name == "alsobought_template2") {
		$(".evm-also-bought .evm-ws-body-section .ws-card__header input:checked, .evm-also-bought-products .evm-ws-card .ws-card__header input:checked").each(function() {
			var bought_product = $(this).attr("bought_product");
			fbt_p_ids_chk[bought_product] = $(this).val();
			var fbt_vari_id = $(this).parent().parent().find('.ws-product-size').find("select").val();
			fbt_v_ids_chk[fbt_vari_id] = fbt_vari_id;
		});
	}
	var fbt_v_ids_chk_cnt = Object.keys(fbt_v_ids_chk).length;
	if (fbt_partial_bundle == "yes") {
		if (fbt_min_bndl_price < fbt_ttl_prc && fbt_v_ids_chk_cnt >= fbt_min_max_pdct)
			wsBndlDiscApld(fbt_disc_type, fbt_ttl_prc, fbt_disc_amt_fix, fbt_disc_perc, fbt_money_sbl, fbt_disc_msg);
		else
			wsRemoveMsg();
	} else {
		if (fbt_min_bndl_price < fbt_ttl_prc) {
			wsBndlDiscApld(fbt_disc_type, fbt_ttl_prc, fbt_disc_amt_fix, fbt_disc_perc, fbt_money_sbl, fbt_disc_msg);
		} else {
			wsRemoveMsg();
		}
	}
}
function wsBndlDiscApld(fbt_disc_type, fbt_ttl_prc, fbt_disc_amt_fix, fbt_disc_perc, fbt_money_sbl, fbt_disc_msg) {
	switch(fbt_disc_type) {
	case 'fixed':
		$("#evm-ws-alsobought-amount").css('text-decoration','line-through');
		var fbt_ttl = fbt_ttl_prc - fbt_disc_amt_fix;
		if (wiser_shopID == "15383241" || wiser_shopID == "71992312020") {
			fbt_ttl = fbt_money_sbl+parseFloat(fbt_ttl).toFixed(2);
		} else {
			if (notAllowDecimal == "true" && allowCommaInPrice == "true") {
				fbt_ttl = fbt_ttl+"00";
			} else if (notAllowDecimal == "true") {
				fbt_ttl = fbt_ttl+"00";
			}
			fbt_ttl = ShopifyWsObj.wsGetMnyFrmt(fbt_ttl);
		}
		$(".fbt_ttl").remove();
		$(".fbt_disc_msg").remove();
		$("<span class='fbt_ttl' style='margin: 0 5px 0 0;'>"+fbt_ttl+"</span>").insertBefore("#evm-ws-alsobought-amount");
		$("#evm-ws-alsobought-total-text").html('<b>Total Price: </b>');
		$(".evm-also-bought p.evm_wiser_heading, .evm-also-bought-products .evm_wiser_heading").after("<p class='fbt_disc_msg' style='text-align: left; margin: 0;'>"+fbt_disc_msg+"</p>");
		break;
	case 'percentage':
		$("#evm-ws-alsobought-amount").css('text-decoration','line-through');
		var fbt_ttl = fbt_ttl_prc - (fbt_ttl_prc * fbt_disc_perc / 100);
		if (wiser_shopID == "15383241" || wiser_shopID == "71992312020") {
			fbt_ttl = fbt_money_sbl+parseFloat(fbt_ttl).toFixed(2);
		} else {
			if (notAllowDecimal == "true" && allowCommaInPrice == "true") {
				fbt_ttl = parseInt(fbt_ttl)+"00";
			} else if (notAllowDecimal == "true") {
				fbt_ttl = parseInt(fbt_ttl)+"00";
			}
			fbt_ttl = ShopifyWsObj.wsGetMnyFrmt(fbt_ttl);
		}
		$(".fbt_ttl").remove();
		$(".fbt_disc_msg").remove();
		$("<span class='fbt_ttl' style='margin: 0 5px 0 0;'>"+fbt_ttl+"</span>").insertBefore("#evm-ws-alsobought-amount");
		$("#evm-ws-alsobought-total-text").html('<b>Total Price: </b>');
		$(".evm-also-bought p.evm_wiser_heading, .evm-also-bought-products .evm_wiser_heading").after("<p class='fbt_disc_msg' style='text-align: left; margin: 0;'>"+fbt_disc_msg+"</p>");
		break;			
	}
}

function wsRemoveMsg() {
	$(".fbt_ttl").remove();
	$(".fbt_disc_msg").remove();
	$("#evm-ws-alsobought-amount").css('text-decoration','');
}

/* end run script onload */
/* ******************* end bundle discount code ******************* */
/** call in old snippet **/

function EVMsetCookie(name,value,days) {
	var expires = "";
	if (days) {
		var date = new Date();
		date.setTime(date.getTime() + (days*24*60*60*1000));
		expires = "; expires=" + date.toUTCString();
	}
	document.cookie = name + "=" + (value || "")  + expires + "; path=/";
}
function EVMgetCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}
/** call in old snippet **/

/* Toggel function for  the alsobougth temp 3 */
function alsoWidgest3(){	
	$(".also_temp3").toggleClass( "also_temp3_dd" );
	$(".evm-ws-body-section").toggle('slow');
}
var wsComparePrice = 0;
function getComparePrice(wsComparePrice) {
		var wsChk = 0;
		$(".evm-ws-alsobought-compare").remove();
		$(".evm_alsobought_wiser_product").each(function() {
		var wsCompPrice = parseFloat($(this).find('option:selected').attr('data-compare-at-price'));
		var wsNewPrice = parseFloat($(this).find('option:selected').attr('data-newprice'));
		if(wsCompPrice != "0" && parseInt(wsCompPrice) > parseInt(wsNewPrice)) {
			wsComparePrice = parseInt(wsComparePrice)+parseInt(wsCompPrice);
		} else {
			wsChk = 1;
		}
	});
	if(wsChk != 1) {
		var wsMoneySmbl = $("#evm-ws-alsobought-amount").text();
		$(`<span class="evm-ws-alsobought-compare">${wsMoneySmbl.charAt(0)}${wsComparePrice.toFixed(2)}</span>`).insertBefore("#evm-ws-alsobought-amount");
	}
}

/* ******************************** */
/* ******************************** */
/* ******************************** */

function __wsChgCurrAndLang(data) {
	var $wsTplName  = data['template'];
	var $wsAlsoTemp = data['alsobought_template'];

	if($wsTplName != 'template4') {
		if($wsAlsoTemp == "alsobought_template2" && data['alsobought'] != "" && wiser_shopID != '15383241') {
			__wsChgCurrNdLang(".ws_fbt_inr_main .ws_curr_lang", "fbt-data-handle", $wsAlsoTemp); /* for alsobought template 2 */
		}
		
		if($wsAlsoTemp == "alsobought_template1" && data['alsobought'] != "")
		__wsChgCurrNdLang(".ws_fbt_inr_main .ws_curr_lang", "fbt-data-handle", $wsAlsoTemp); /* for alsobought template 1 */

		__wsChgCurrNdLang(".ws_inr_main .ws_curr_lang, .ws_inr_cd_main .ws_curr_lang", "data-handle", ''); /* for all other template */
		// $(".evm-ws__cart-submit.ws_ls_lang .ws_ls_lang").text(wsLangTrans.ws_atcbt); /* change add to cart button text */
	}
	if($wsTplName == 'template4') {
		if($wsAlsoTemp == "alsobought_template2" && data['alsobought'] != "" && wiser_shopID != '15383241') {
			__wsChgCurrNdLang(".ws_fbt_inr_main .ws_curr_lang", "fbt-data-handle", $wsAlsoTemp); /* for alsobought template 2 */
		}

		if($wsAlsoTemp == "alsobought_template1" && data['alsobought'] != "")
		__wsChgCurrNdLang(".ws_fbt_inr_main .ws_curr_lang", "fbt-data-handle", $wsAlsoTemp); /* for alsobought template 1 */

		__wsChgCurrNdLangTplFour(".ws_inr_main .ws_curr_lang, .evm-drawer-main .ws_curr_lang, .ws_inr_popup_html .ws_curr_lang", "data-handle"); /* for template 4 */
		// $(".evm-ws__cart-submit.ws_ls_lang .ws_ls_lang").text(wsLangTrans.ws_atcbt); /* change add to cart button text */
	}
}
/* common code for currency and language */
function __wsCurrPriceWithSybl($wsCurrPrice) {
	if(wiser_shopID == '3025895522' || wiser_shopID == '60800204956' || wiser_shopID == '41975611553' || (wsChkCurrAndLang.includes(wiser_shopID)))  {
		if (typeof ShopifyWsObj !== "undefined") {
			return ShopifyWsObj.wsGetMnyFrmt($wsCurrPrice);
		}
	}
	if(window.localStorage.getItem("wsMoneyFormat") == 'undefined' || window.localStorage.getItem("wsMoneyFormat") == null) {
		window.localStorage.setItem("wsMoneyFormat", window.evmWSSettings.moneyFormat)
	}
	$('.wsCrcyFrmt').remove();
	if(typeof window.evmWSSettings == 'undefined') {
		var $wsCrMoneyFrmt = window.localStorage.getItem("wsMoneyFormat");
		$('body').append('<span class="wsCrcyFrmt" style="display:none">'+$wsCrMoneyFrmt+'</span>');
		var $wsCrMoneyFrmt = $('.wsCrcyFrmt').text();
	} else {
		var $wsCrMoneyFrmt = window.evmWSSettings.moneyFormat;
		$('body').append('<span class="wsCrcyFrmt" style="display:none">'+$wsCrMoneyFrmt+'</span>');
		var $wsCrMoneyFrmt = $('.wsCrcyFrmt').text();
	}

	const $wsHtmlTagPattern = /<[^>]+>/;
	const $wsIsHtmlString   =  $wsHtmlTagPattern.test($wsCrMoneyFrmt);

	if ($wsIsHtmlString) {
		const $wsCurrTempElmt     = document.createElement('div');
		$wsCurrTempElmt.innerHTML = $wsCrMoneyFrmt;
		$wsCrMoneyFrmt            = $wsCurrTempElmt.textContent || $wsCurrTempElmt.innerText;
	}
	return wsReturnPrice($wsCrMoneyFrmt, $wsCurrPrice);
}

function wsReturnPrice($wsCrMoneyFrmt, $wsCurrPrice) {
 	var $wsOrigPrice = '';
	$wsCurrSmblFrmt = $wsCrMoneyFrmt.split("{{");
	if($wsCurrSmblFrmt[0] == "") $wsCurrSmblFrmt = $wsCrMoneyFrmt.split("}}");
	$shopIdArray = ['7227785'];
	if(($wsCurrSmblFrmt[0].length) > 5) {
		if (notAllowDecimal == "true") {
			if (allowCommaInPrice == "true")
				$wsOrigPrice = ($wsCurrPrice/100).toLocaleString()+$wsCurrSmblFrmt[1];
			else
				$wsOrigPrice = ($wsCurrPrice/100)+$wsCurrSmblFrmt[1];
		} else {
			if(allowCommaInPrice == "true") {
				$wsOrigPrice = ($wsCurrPrice/100).toLocaleString();
				$wsOrigPrice = $wsOrigPrice+'.00'+$wsCurrSmblFrmt[1];
			} else {
				$wsOrigPrice = (($wsCurrPrice/100).toFixed(2))+$wsCurrSmblFrmt[1];
			}
		}
	} else {
		if($shopIdArray.includes(wiser_shopID) && allowCommaInPrice == "true") {
			$pWithSybl = $wsCurrSmblFrmt[0]+(($wsCurrPrice/100).toFixed(2));
			$pWithSybl = $pWithSybl.split('.');
			$pWithSybl = $pWithSybl[0]+'<sup>'+$pWithSybl[1]+'</sup>';
			$wsOrigPrice = $pWithSybl;
		}
		if (notAllowDecimal == "true") {
			if (allowCommaInPrice == "true") {
					$wsOrigPrice = $wsCurrSmblFrmt[0]+($wsCurrPrice/100).toLocaleString();
					$wsOrigPrice = $wsCurrSmblFrmt[0]+$wsOrigPrice+'.00';
			} else {
				$wsOrigPrice = $wsCurrSmblFrmt[0]+($wsCurrPrice/100);
			}
		} else {
			if(allowCommaInPrice == "true" && (wiser_shopID == '57653035180' || wiser_shopID == '31620235308' )) {
				$wsOrigPrice = $wsCurrSmblFrmt[0]+($wsCurrPrice/100).toLocaleString()+'.00';
			} else if(allowCommaInPrice == "true" && wiser_shopID == '24453873760') {
				$wsOrigPrice = $wsCurrSmblFrmt[0]+($wsCurrPrice/100).toLocaleString()+',00';
			} else if(allowCommaInPrice == "true" && (wiser_shopID == '33496793133' || wiser_shopID == '6750765129')) {
				$wsOrigPrice = $wsCurrSmblFrmt[0]+(($wsCurrPrice/100).toFixed(2));
				$wsOrigPrice = $wsOrigPrice.replace(".", ",");
			} else {
				$wsOrigPrice = $wsCurrSmblFrmt[0]+(($wsCurrPrice/100).toFixed(2));
			}
		}
	}

	if(wiser_shopID == '27444969506' ) $wsOrigPrice = $wsOrigPrice.toString().replace(/\,/g, '.');
	return $wsOrigPrice;
}

/* common code for currency and language */
var $wsFbtTtlPcTemp2  = 0;

function __wsVariChgCurr($wsProdJSON, $wsHtml, $wsTempName, $wsTruncTitle, $wsHndl) {
  let chkVariPrice      = 0;
  let $wsCnvtdProdTitle = $wsProdJSON.title;
  let $wsCnvtdProdHndle = $wsProdJSON.handle;
  let $wsCnvtdProdlink  = $wsProdJSON.url;
  let $wsOrigTxt        = '';
  if($wsCnvtdProdTitle.length > $wsTruncTitle[1] && $wsTruncTitle[0] == "true") {
    $wsCnvtdProdTitle = $wsCnvtdProdTitle.substr(0, $wsTruncTitle[1])+'...';
  }
  if($wsTempName != "") {
    $($wsHtml).closest('.alsobought_template2').find('.evm-ws-image-section').find('a[fbt-data-img-handle='+$wsCnvtdProdHndle+']').attr('href', $wsCnvtdProdlink);
    if (!$($wsHtml).find('a').hasClass('ws_hide')) $($wsHtml).find('a').attr('href', $wsCnvtdProdlink);
    if ($wsTempName == "alsobought_template1") $($wsHtml).find('a').find('h3').html($wsCnvtdProdTitle);
    $($wsHtml).find('a').find('h3').find('span').html($wsCnvtdProdTitle);
    $($wsHtml).find('a').attr('title', $wsProdJSON.title);
  } else {
  	if (wiser_shopID == "22846393") {
		var wsHref = $($wsHtml).find('a.checkurl').attr('href');
  		$wsCnvtdProdlink = wsHref.split("/products/")[0]+$wsCnvtdProdlink;
  	}
    if (!$($wsHtml).find('a').hasClass('ws_hide')) $($wsHtml).find('a.checkurl').attr('href', $wsCnvtdProdlink);
    $($wsHtml).find('.ws-card__header').find('a').find('h3.ws-card__title').html($wsCnvtdProdTitle);
    $($wsHtml).find('.ws-card__header').find('a').attr('title', $wsProdJSON.title);
  }
  let $wsVariCnt        = $wsProdJSON.variants.length;
  if($wsVariCnt > 0 && $wsProdJSON.variants != '') {
  	let $wsChkPc = 0;
  	var $variArr = $option_size_array =$newSizeArray =[];
  	var $option_size = '';
    var wsChkImg     = 0;
    var wsChkImg1    = 0;
    $($wsProdJSON.variants).each(function( $varIndex, $wsVari) {
  		var wsChkHtml = $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").html();
  		if(wsChkHtml != undefined) {
	    	if(wiser_shopID == '24038187') {
	    		if(wsChkHtml == "Select Your Size") {
	    			if(typeof $wsProdJSON.media !== "undefined") { $($wsHtml).find(".ws-card__background-image").css('background-image', 'url('+$wsVari.featured_image.src+')'); }
	                $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']:eq(0)").attr({"ws-data-price":__wsCurrPriceWithSybl($wsVari.price)});
	                $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']:eq(1)").attr({"ws-data-price":__wsCurrPriceWithSybl($wsVari.price)});
                } else {
	                $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").attr({"ws-data-price":__wsCurrPriceWithSybl($wsVari.price)});
            	}

    			$($wsProdJSON.media).each(function( $mediaIndex, $wsMedia) {
    				// if($wsVari.featured_media.id != $wsMedia.id && $wsVari.featured_media.alt == $wsMedia.alt && wsChkImg == 0) {
                    // if($wsProdJSON.title, $($wsHtml).find("select option:first").val() == $wsVari.id && $wsVari.featured_media.alt == $wsMedia.alt && wsChkImg == 0) {
    				// 	(typeof $wsProdJSON.media !== "undefined") ? $($wsHtml).find(".ws-card__background-image").css('background-image', `url(${$wsVari.featured_image.src})`) : "";
    				// 	wsChkImg = 1;
    				// }
    				if($wsVari.featured_media.id != $wsMedia.id && $wsVari.featured_media.alt == $wsMedia.alt && wsChkImg1 == 0) {
    					(typeof $wsVari.featured_image !== 'undefined') ? $($wsHtml).find(".ws-card__background-image2").css('background-image', `url(${$wsMedia.src})`).src : "";
    					wsChkImg1 = 1;
    				}
    			});
	    	} else {
	    		if(wiser_shopID == '67197468978') {
	    			let $wsOption1 =   $wsVari.option1;
	    			let $wsOption2 =   $wsVari.option2;
	    			if (!$variArr.includes($wsOption1)) { 
	    				if($wsOption2 !=null && $wsOption2 !='null') {
	    					$variArr.push($wsOption1);
	    					let $wsOptionData = $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").html($wsOption1);
	    				} else {
	    					$($wsHtml).find("select").hide();
	    				}
	    			} else {
	    				let $wsOptionData = $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").remove();
	    			}
	    		} else {
	    			let $wsOptionData = $($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").html($wsVari.title);
	    		}
	    		if($wsTempName == 'alsobought_template1' && $wsVari.available == true && $wsChkPc == 0) {
	    			$($wsHtml).find('.ws_orig_price').html(__wsCurrPriceWithSybl($wsVari.price));
	    			$wsFbtTtlPrice = parseInt($wsFbtTtlPrice) + parseInt(($wsVari.price));
	    			$("#evm-ws-alsobought-amount").html(__wsCurrPriceWithSybl($wsFbtTtlPrice));
	    			$wsChkPc = 1;

	    		}
	    		if(!$($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").is(':disabled') && chkVariPrice == 0 && $wsTempName == 'alsobought_template2') {
	    			chkVariPrice = 1;
	    			$($wsHtml).find('.ws_orig_price').html(__wsCurrPriceWithSybl($wsVari.price));
	    			$($wsHtml).find('.ws-compare-original-price').html(__wsCurrPriceWithSybl($wsVari.compare_at_price));
	    			$wsFbtTtlPcTemp2 = parseInt($wsFbtTtlPcTemp2) + parseInt(($wsVari.price));
	    			$("#evm-ws-alsobought-amount").html(__wsCurrPriceWithSybl($wsFbtTtlPcTemp2));
	    		}

	      // $wsOrigPrice = $wsVari.price;
	    		$($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").attr({"ws-data-price":__wsCurrPriceWithSybl($wsVari.price)});
	    		let $wsCompareAtPrice = $wsVari.compare_at_price
	      /*if($wsCompareAtPrice > $wsVari.price && $wsCompareAtPrice > 0) {*/
	    		$($wsHtml).find("select").find("option[value='"+$wsVari.id+"']").attr({"ws-data-compare-at-price":__wsCurrPriceWithSybl($wsVari.compare_at_price)});
	      /*}*/
	    	}
	    }
    });
  }
  // if ($wsTempName != 'alsobought_template2')
  //   $($wsHtml).find('.ws_orig_price').html(__wsCurrPriceWithSybl($wsOrigPrice));
  
  // if($wsHndl == "fbt-data-handle") {
  //   $wsFbtTtlPcTemp2 = parseInt($wsFbtTtlPcTemp2) + parseInt(($wsOrigPrice));
  //   $("#evm-ws-alsobought-amount").html(__wsCurrPriceWithSybl($wsFbtTtlPcTemp2));
  // }
}

/* template 1, 2, 3 and FBT template 1 & 2 */
var $wsFbtTtlPrice = 0;
function __wsChgCurrNdLang($wsClsNm, $wsHndl, $wsTempName = '') {
  $($wsClsNm).each(function($index, $wsHtml) {
    $wsProdHndl   = $($wsHtml).attr($wsHndl);
    $wsTruncTitle = $($wsHtml).attr("ws-data-truncate").split("__");
    if(typeof $wsProdHndl !== 'undefined') {
			var wsProdJsonUrl = wsRootLocl+'products/'+$wsProdHndl+'.js';	
      jQuery.getJSON(wsProdJsonUrl, function($wsProdJSON) {
        __wsVariChgCurr($wsProdJSON, $wsHtml, $wsTempName, $wsTruncTitle, $wsHndl);
        if($wsProdJSON.price != '') {
        	let $wsProdId = $wsProdJSON.id;
        	if ($wsTempName == 'alsobought_template2') {
        		let $wsFbtTempTwo = $($wsHtml).closest('.alsobought_template2');
        		(typeof $wsProdJSON.media[0] !== "undefined") ? $wsFbtTempTwo.find('.ws-card__background-image-'+$wsProdId).css('background-image', `url(${$wsProdJSON.media[0].src})`) : "";
        		(typeof $wsProdJSON.media[1] !== 'undefined') ? $wsFbtTempTwo.find('.ws-card__background-image2-'+$wsProdId).css('background-image', `url(${$wsProdJSON.media[1].src})`).src : "";
        	}
        	if ($wsTempName == '' && wiser_shopID != '24038187') {
        		(typeof $wsProdJSON.media[0] !== "undefined") ? $($wsHtml).find('.ws-card__background-image-'+$wsProdId).css('background-image', `url(${$wsProdJSON.media[0].src})`) : "";
        		(typeof $wsProdJSON.media[1] !== 'undefined') ? $($wsHtml).find(".ws-card__background-image2").css('background-image', `url(${$wsProdJSON.media[1].src})`).src : "";
        	}

          let $wsOrigPrice = $wsProdJSON.variants[0].price;
          let $wsCompPrice = $wsProdJSON.variants[0].compare_at_price;
          if ($wsTempName != 'alsobought_template2' && $wsTempName != 'alsobought_template1') {
            $($wsHtml).find('.ws_orig_price').html(__wsCurrPriceWithSybl($wsOrigPrice));
          }
          
          // else
          //   $($wsHtml).find('.ws_orig_price').html(__wsCurrPriceWithSybl($wsOrigPrice));
          
          // if($wsHndl == "fbt-data-handle" && $wsTempName != 'alsobought_template2') {
		  //   $wsFbtTtlPrice = parseInt($wsFbtTtlPrice) + parseInt(($wsOrigPrice));
		  //   $("#evm-ws-alsobought-amount").html(__wsCurrPriceWithSybl($wsFbtTtlPrice));
		  // }
          if($wsCompPrice > $wsOrigPrice && $wsCompPrice > 0 && $wsTempName != 'alsobought_template2') {
            let $wsCnvtdCurrCompPrice = __wsCurrPriceWithSybl($wsCompPrice);
            // if ($wsTempName != 'alsobought_template2')
            $('.ws-compare-original-price').addClass('money');
              $($wsHtml).find('.ws-compare-original-price').html($wsCnvtdCurrCompPrice);
            // else
            //   $($wsHtml).find('.ws-compare-original-price').html($wsCnvtdCurrCompPrice);
          }
        }
      });
    }
  });
}
/* end template 1, 2, 3 and FBT template 1 & 2 */
/* for template four only */
function __wsChgCurrNdLangTplFour($wsClsNm, $wsHndl) {
	let $wsFbtTtlPrice = 0;
	$($wsClsNm).each(function( $index, $wsHtml) {
		if(wiser_shopID == '8607989841') {
			if(evmcustomerId== ''){					
				$($wsHtml).find('.cuslogin').hide();
			}
			else
			{
				$($wsHtml).find('.cusloggout').hide();
			}
		}
		$wsProdHndl   = $($wsHtml).attr($wsHndl);
		$wsTruncTitle = $($wsHtml).attr("ws-data-truncate").split("__");
		var wsProdJsonUrl = wsRootLocl+'products/'+$wsProdHndl+'.js';
		jQuery.getJSON(wsProdJsonUrl, function($wsProdJSON) {
			if($wsProdJSON.price != '') {
				let $wsCnvtdProdTitle = $wsProdJSON.title
				let $wsCnvtdProdlink  = $wsProdJSON.url;
				if($wsCnvtdProdTitle.length > $wsTruncTitle[1] && $wsTruncTitle[0] == "true")
					$wsCnvtdProdTitle = $wsCnvtdProdTitle.substr(0, $wsTruncTitle[1])+'...';

				$($wsHtml).find('a.checkurl').attr('href', $wsCnvtdProdlink);
				$($wsHtml).find('.ws-card__footer').find('.checkurl').find('h3').html($wsCnvtdProdTitle);

        		(typeof $wsProdJSON.media[0] !== "undefined") ? $($wsHtml).find(".ws-card__background-image").css('background-image', `url(${$wsProdJSON.media[0].src})`) : "";
        		if(typeof $wsProdJSON.media[1] !== 'undefined') {
        			$($wsHtml).find(".ws-card__background-image2").css('background-image', `url(${$wsProdJSON.media[1].src})`);
        		} else {
        			$($wsHtml).find(".ws-card__background-image2").css('background-image', `url(${$wsProdJSON.media[0].src})`);
        		}

				$($wsHtml).find('.ws-card__footer').find('.checkurl').attr('title', $wsProdJSON.title);
				let $wsOrigPrice = $wsProdJSON.variants[0].price;
				let $wsCompPrice = $wsProdJSON.variants[0].compare_at_price;
				let $wsCnvtdCurrPrice = __wsCurrPriceWithSybl($wsOrigPrice);

				$($wsHtml).find('.ws-card__footer').find('.ws_orig_price').html($wsCnvtdCurrPrice);
				if($wsCompPrice > $wsOrigPrice && $wsCompPrice > 0) {
					let $wsCnvtdCurrCompPrice = __wsCurrPriceWithSybl($wsCompPrice);
					$($wsHtml).find('.ws-card__footer').find('.ws-compare-original-price').html($wsCnvtdCurrCompPrice);
				}
			}
			let $wsVariCnt = $wsProdJSON.variants.length;
			var $variArr = $option_size_array =$newSizeArray =[];
			if($wsVariCnt > 0 && $wsProdJSON.variants != '') {
				$($wsProdJSON.variants).each(function( $varIndex, $wsVari) {
					if(wiser_shopID == '67197468978') {
						let $wsOption1 =   $wsVari.option1;
						let $wsOption2 =   $wsVari.option2;
						if (!$variArr.includes($wsOption1)) { 
							if($wsOption2 !=null && $wsOption2 !='null' ){					
								$variArr.push($wsOption1);
								let $wsOptionData = $($wsHtml).find('.evm-ws-popup-variants-main').find("ul").find("li[data-value='"+$wsVari.id+"']").find('label').html($wsOption1);
							}
							else 
							{
								$($wsHtml).find('.evm-ws-popup-variants-main').hide();
							}
						}
						else 
						{
							let $wsOptionData = $($wsHtml).find('.evm-ws-popup-variants-main').find("ul").find("li[data-value='"+$wsVari.id+"']").find('label').remove();
						}
					}
					else {
						let $wsOptionData = $($wsHtml).find('.evm-ws-popup-variants-main').find("ul").find("li[data-value='"+$wsVari.id+"']").find('label').html($wsVari.title);
					}

					$($wsHtml).find('.evm-ws-popup-variants-main').find("ul").find("li[data-value='"+$wsVari.id+"']").attr({"ws-data-price":__wsCurrPriceWithSybl($wsVari.price)});
					let $wsCompareAtPrice = $wsVari.compare_at_price
					$($wsHtml).find('.evm-ws-popup-variants-main').find("ul").find("li[data-value='"+$wsVari.id+"']").attr({"ws-data-compare-at-price":__wsCurrPriceWithSybl($wsVari.compare_at_price)});
				});
			}
		});
	});
}