PageSourceSearch

https://thejewelryedit.com/cdn/shop/t/22/assets/flits-wishlist.js?v=57139740260846312491720587132

js thejewelryedit.com collected 2026-10-07 00:16:58 UTC 30,947 bytes, 2 lines download raw bytes

1(!window.flitsApp||typeof window.flitsApp=="undefined")&&(window.flitsApp={}),(function(t,o){typeof define=="function"&&define.amd?define(o):typeof exports=="object"?module.exports=o():t.flits_tingle=o()})(this,function(){function t(t2){var o2={onClose:null,onOpen:null,beforeOpen:null,beforeClose:null,stickyFooter:!1,footer:!1,cssClass:[],closeLabel:"Close",closeMethods:["overlay","button","escape"]};this.opts=r({},o2,t2),this.init()}function o(){this.modalBoxFooter&&(this.modalBoxFooter.style.width=this.modalBox.clientWidth+"px",this.modalBoxFooter.style.left=this.modalBox.offsetLeft+"px")}function e(){this.modal=document.createElement("div"),this.modal.classList.add("flits-tingle-modal"),(this.opts.closeMethods.length===0||this.opts.closeMethods.indexOf("overlay")===-1)&&this.modal.classList.add("flits-tingle-modal--noOverlayClose"),this.modal.style.display="none",this.opts.cssClass.forEach(function(t2){typeof t2=="string"&&this.modal.classList.add(t2)},this),this.opts.closeMethods.indexOf("button")!==-1&&(this.modalCloseBtn=document.createElement("button"),this.modalCloseBtn.classList.add("flits-tingle-modal__close"),this.modalCloseBtnIcon=document.createElement("span"),this.modalCloseBtnIcon.classList.add("flits-tingle-modal__closeIcon"),this.modalCloseBtnIcon.innerHTML="\xD7",this.modalCloseBtnLabel=document.createElement("span"),this.modalCloseBtnLabel.classList.add("flits-tingle-modal__closeLabel"),this.modalCloseBtnLabel.innerHTML=this.opts.closeLabel,this.modalCloseBtn.appendChild(this.modalCloseBtnIcon),this.modalCloseBtn.appendChild(this.modalCloseBtnLabel)),this.modalBox=document.createElement("div"),this.modalBox.classList.add("flits-tingle-modal-box"),this.opts.closeMethods.indexOf("button")!==-1&&this.modalBox.appendChild(this.modalCloseBtn),this.modalBoxContent=document.createElement("div"),this.modalBoxContent.classList.add("flits-tingle-modal-box__content"),this.modalBox.appendChild(this.modalBoxContent),this.modal.appendChild(this.modalBox)}function s(){this.modalBoxFooter=document.createElement("div"),this.modalBoxFooter.classList.add("flits-tingle-modal-box__footer"),this.modalBox.appendChild(this.modalBoxFooter)}function i(){this._events={clickCloseBtn:this.close.bind(this),clickOverlay:l.bind(this),resize:this.checkOverflow.bind(this),keyboardNav:n.bind(this)},this.opts.closeMethods.indexOf("button")!==-1&&this.modalCloseBtn.addEventListener("click",this._events.clickCloseBtn),this.modal.addEventListener("mousedown",this._events.clickOverlay),window.addEventListener("resize",this._events.resize),document.addEventListener("keydown",this._events.keyboardNav)}function n(t2){this.opts.closeMethods.indexOf("escape")!==-1&&t2.which===27&&this.isOpen()&&this.close()}function l(t2){this.opts.closeMethods.indexOf("overlay")!==-1&&!d(t2.target,"tingle-modal")&&t2.clientX<this.modal.clientWidth&&this.close()}function d(t2,o2){for(;(t2=t2.parentElement)&&!t2.classList.contains(o2););return t2}function a(){this.opts.closeMethods.indexOf("button")!==-1&&this.modalCloseBtn.removeEventListener("click",this._events.clickCloseBtn),this.modal.removeEventListener("mousedown",this._events.clickOverlay),window.removeEventListener("resize",this._events.resize),document.removeEventListener("keydown",this._events.keyboardNav)}function r(){for(var t2=1;t2<arguments.length;t2++)for(var o2 in arguments[t2])arguments[t2].hasOwnProperty(o2)&&(arguments[0][o2]=arguments[t2][o2]);return arguments[0]}var h=(function(){var t2,o2=document.createElement("flits-tingle-test-transition"),e2={transition:"transitionend",OTransition:"oTransitionEnd",MozTransition:"transitionend",WebkitTransition:"webkitTransitionEnd"};for(t2 in e2)if(o2.style[t2]!==void 0)return e2[t2]})();return t.prototype.init=function(){this.modal||(e.call(this),i.call(this),document.body.insertBefore(this.modal,document.body.firstChild),this.opts.footer&&this.addFooter())},t.prototype.destroy=function(){this.modal!==null&&(a.call(this),this.modal.parentNode.removeChild(this.modal),this.modal=null)},t.prototype.open=function(){var t2=this;typeof t2.opts.beforeOpen=="function"&&t2.opts.beforeOpen(),this.modal.style.removeProperty?this.modal.style.removeProperty("display"):this.modal.style.removeAttribute("display"),document.body.classList.add("flits-tingle-enabled"),this.setStickyFooter(this.opts.stickyFooter),this.modal.classList.add("flits-tingle-modal--visible"),h?this.modal.addEventListener(h,function o2(){typeof t2.opts.onOpen=="function"&&t2.opts.onOpen.call(t2),t2.modal.removeEventListener(h,o2,!1)},!1):typeof t2.opts.onOpen=="function"&&t2.opts.onOpen.call(t2),this.checkOverflow()},t.prototype.isOpen=function(){return!!this.modal.classList.contains("flits-tingle-modal--visible")},t.prototype.close=function(){if(typeof this.opts.beforeClose!="function"||this.opts.beforeClose.call(this)){document.body.classList.remove("flits-tingle-enabled"),this.modal.classList.remove("flits-tingle-modal--visible");var t2=this;h?this.modal.addEventListener(h,function o2(){t2.modal.removeEventListener(h,o2,!1),t2.modal.style.display="none",typeof t2.opts.onClose=="function"&&t2.opts.onClose.call(this)},!1):(t2.modal.style.display="none",typeof t2.opts.onClose=="function"&&t2.opts.onClose.call(this))}},t.prototype.setContent=function(t2){typeof t2=="string"?this.modalBoxContent.innerHTML=t2:(this.modalBoxContent.innerHTML="",this.modalBoxContent.appendChild(t2))},t.prototype.getContent=function(){return this.modalBoxContent}
1,t.prototype.addFooter=function(){s.call(this)},t.prototype.setFooterContent=function(t2){this.modalBoxFooter.innerHTML=t2},t.prototype.getFooterContent=function(){return this.modalBoxFooter},t.prototype.setStickyFooter=function(t2){this.isOverflow()||(t2=!1),t2?this.modalBox.contains(this.modalBoxFooter)&&(this.modalBox.removeChild(this.modalBoxFooter),this.modal.appendChild(this.modalBoxFooter),this.modalBoxFooter.classList.add("flits-tingle-modal-box__footer--sticky"),o.call(this),this.modalBoxContent.style["padding-bottom"]=this.modalBoxFooter.clientHeight+20+"px"):this.modalBoxFooter&&(this.modalBox.contains(this.modalBoxFooter)||(this.modal.removeChild(this.modalBoxFooter),this.modalBox.appendChild(this.modalBoxFooter),this.modalBoxFooter.style.width="auto",this.modalBoxFooter.style.left="",this.modalBoxContent.style["padding-bottom"]="",this.modalBoxFooter.classList.remove("flits-tingle-modal-box__footer--sticky")))},t.prototype.addFooterBtn=function(t2,o2,e2){var s2=document.createElement("button");return s2.innerHTML=t2,s2.addEventListener("click",e2),typeof o2=="string"&&o2.length&&o2.split(" ").forEach(function(t3){s2.classList.add(t3)}),this.modalBoxFooter.appendChild(s2),s2},t.prototype.resize=function(){console.warn("Resize is deprecated and will be removed in version 1.0")},t.prototype.isOverflow=function(){var t2=window.innerHeight;return this.modalBox.clientHeight>=t2},t.prototype.checkOverflow=function(){this.modal.classList.contains("flits-tingle-modal--visible")&&(this.isOverflow()?this.modal.classList.add("flits-tingle-modal--overflow"):this.modal.classList.remove("flits-tingle-modal--overflow"),!this.isOverflow()&&this.opts.stickyFooter?this.setStickyFooter(!1):this.isOverflow()&&this.opts.stickyFooter&&(o.call(this),this.setStickyFooter(!0)))},{modal:t}}),window.flitsApp.wishlist_products=function(){var cemail="flits_customer_email",chandle="flits_products_handle",add_to_wsl_btn_class="flits-add-to-wsl-btn",remove_from_wsl_btn_class="flits-remove-from-wsl-btn",add_wsl_url="/add_to_wishlist",remove_wsl_url="/remove_from_wishlist",clicked_add_button="",clicked_remove_button="",that=this;this.getCookie=function(cname){for(var name=cname+"=",decodedCookie=decodeURIComponent(document.cookie),ca=decodedCookie.split(";"),i=0;i<ca.length;i++){for(var c=ca[i];c.charAt(0)==" ";)c=c.substring(1);if(c.indexOf(name)==0)return c.substring(name.length,c.length)}return""},this.setCookie=function(cname,cvalue,exdays){var d=new Date;d.setTime(d.getTime()+exdays*24*60*60*1e3);var expires="expires="+d.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"};var modal=new flits_tingle.modal({footer:!1,stickyFooter:!1,getContent:!0,closeMethods:["button"],closeLabel:"Close",beforeClose:function(){return!0}}),modal_content=document.getElementById("flits-wsl-guest-modal").innerHTML;modal.setContent(modal_content),document.getElementById("flits-wsl-guest-modal").remove(),document.getElementById("flits-guest-wsl-form").addEventListener("submit",function(event){event.preventDefault();var flits_customer_email=document.getElementById("flits_email_id").value;if(typeof flits_customer_email=="undefined"||flits_customer_email==null||flits_customer_email=="")return!1;that.setCookie(cemail,flits_customer_email,15),document.getElementById("flits-guest-wsl-form").style.display="none";var email_text=document.getElementById("flits-guest-email").innerHTML;document.getElementById("flits-guest-email").innerHTML=email_text.replace("##customer_email##","<strong>"+flits_customer_email+"</strong>"),document.getElementById("flits-wsl-msg-modal").style.display="block",clicked_add_button.click()}),this.get_ajax_obj=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;if(window.ActiveXObject)return new ActiveXObject("Microsoft.XMLHTTP")},this.wsl_pagination=function(e){this.reset_pagination();var prev=document.querySelectorAll(".flits-wsl-pagination-prev"),next=document.querySelectorAll(".flits-wsl-pagination-next"),that2=this;this.setPaginationClickEvent(),prev.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("click",function(e2){var page_number=document.getElementById("flits-wishlist-current-page").value;if(page_number<=1)return!1;page_number=parseInt(page_number)-1,that2.change_page(page_number)})}),next.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("click",function(e2){var page_number=document.getElementById("flits-wishlist-current-page").value;if(page_number>=document.getElementById("flits-wishlist-total-page").value)return!1;page_number=parseInt(page_number)+1,that2.change_page(page_number)})});var p=this.getUrlParamVal("p");this.change_page(p)},this.change_variant_price=function(e){var variant_option=document.querySelectorAll(".product-variant-options"),that2=this;variant_option.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("change",function(e2){var variant_price=this.options[this.selectedIndex].getAttribute("data-flits-variant-price");this.closest(".flits-row").parentNode.querySelector(".flits-variant-price").innerHTML=variant_price})})},this.setPaginationClickEvent=function(){var wsl_page=document.querySelectorAll(".flits-wsl-pagination-page");wsl_page.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("click",function(e){e.stopPropagation();var page_number=this.getAttribute("data-page");that.change_page(page_number)})})},this.getUrlParamVal=function(str){var v=window.location.search.match(new RegExp("(?:[?&]"+str+"=)([^&]+)"));return v?v[1]:null},this.reset_pagination=function(){var total_data=parseInt(document.getElementById("flits-wishlist-size").value),limit=parseInt(document.getElementById("flits-wishlist-limit").value),total_pages=parseInt(document.getElementById("flits-wishlist-total-page").value),
1current_page=parseInt(document.getElementById("flits-wishlist-current-page").value),org_total_data=document.querySelectorAll(".flits-wsl-product-row");org_total_data.forEach(function(item,index){var current_page2=parseInt(index/limit)+1;item.setAttribute("data-page",current_page2)}),total_pages=Math.ceil(org_total_data.length/limit),document.querySelectorAll(".flits-wsl-pagination-page").forEach(function(node,index){node.parentNode.removeChild(node)});for(var next_btn=document.querySelector(".flits-wsl-pagination-next"),next_btn_parent=next_btn.parentNode,i=1;i<=total_pages;i++){var a=document.createElement("a");a.href="javascript:void(0)",a.classList.add("flits-wsl-pagination-page"),a.setAttribute("data-page",i),a.innerHTML=i,i==current_page&&a.classList.add("active"),next_btn_parent.insertBefore(a,next_btn)}this.setPaginationClickEvent(),total_pages<current_page&&(current_page=total_pages),document.getElementById("flits-wishlist-total-page").value=total_pages,document.getElementById("flits-wishlist-current-page").value=current_page,this.change_page(current_page),total_pages<=1?document.getElementById("flits-page-wishlist").querySelector(".flits-pagination-div").style.display="none":document.getElementById("flits-page-wishlist").querySelector(".flits-pagination-div").style.display="block"},this.change_page=function(page_number){document.querySelectorAll(".flits-wsl-product-row").forEach(function(item){item.style.display="none"});var show=document.querySelectorAll(".flits-wsl-product-row[data-page='"+page_number+"']");show.forEach(function(item){item.style.display="inline-block"}),document.getElementById("flits-wishlist-current-page").value=page_number,document.querySelector(".flits-wsl-pagination-page.active")&&document.querySelector(".flits-wsl-pagination-page.active").classList.remove("active"),document.querySelector('.flits-wsl-pagination-page[data-page="'+page_number+'"]')&&document.querySelector('.flits-wsl-pagination-page[data-page="'+page_number+'"]').classList.add("active");var newurl=window.location.protocol+"//"+window.location.host+window.location.pathname+"?p="+page_number+location.hash;window.history.pushState({path:newurl},"",newurl)},this.add_product=function(){var that2=this,a=document.querySelectorAll("."+add_to_wsl_btn_class);a.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("click",function(e){var addwsl=this;clicked_add_button=addwsl;var customer_id=addwsl.getAttribute("data-flits-customer-id"),customer_email=addwsl.getAttribute("data-flits-customer-email"),product_id=addwsl.getAttribute("data-flits-product-id"),product_handle=addwsl.getAttribute("data-flits-product-handle"),product_title=addwsl.getAttribute("data-flits-product-title"),product_image=addwsl.getAttribute("data-flits-product-image"),page=addwsl.getAttribute("data-page"),token=document.getElementById("flits-wsl-token").value,url=document.getElementById("flits-wsl-url").value+add_wsl_url;if(that2.isNull(customer_email)){var customer_email_cookie=that2.getCookie(cemail);if(that2.isNull(customer_email_cookie))return modal.open(),!1;customer_email=customer_email_cookie}clicked_add_button.disabled=!0;var wsl_btn=addwsl.parentNode,count=0,wsl_product_count=0;switch(page){case"product-page":case"collection-page":wsl_btn.getElementsByClassName("flits-add-to-wsl-btn")[0].style.display="none",wsl_btn.getElementsByClassName("flits-remove-from-wsl-btn")[0].style.display="inline-block",wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0]&&(count=parseInt(wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0].innerHTML),wsl_product_count=parseInt(count)+1,wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0].innerHTML=wsl_product_count);break}var ajax=that2.get_ajax_obj();ajax.onreadystatechange=function(){if(this.readyState==4&&this.status==200){clicked_add_button.disabled=!1;var res2=JSON.parse(this.responseText);switch(that2.setCookie(chandle,res2.products_handle,15),page){case"product-page":case"collection-page":wsl_btn.getElementsByClassName("flits-add-to-wsl-btn")[0].style.display="none",wsl_btn.getElementsByClassName("flits-remove-from-wsl-btn")[0].style.display="inline-block",wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0]&&(wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0].innerHTML=wsl_product_count);break}}},ajax.open("POST",url,!0),ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");var data=that2.serialize({customer_hash:window.flitsApp.customer_hash,token:token,customer_id:customer_id,customer_email:customer_email,product_id:product_id,product_handle:product_handle,product_title:product_title,product_image:product_image,wsl_product_count:wsl_product_count});ajax.send(data)})})},this.remove_product=function(){var that2=this,a=document.querySelectorAll("."+remove_from_wsl_btn_class);a.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("click",function(e){var removewsl=this;clicked_remove_button=removewsl;var customer_id=removewsl.getAttribute("data-flits-customer-id"),customer_email=removewsl.getAttribute("data-flits-customer-email"),product_id=removewsl.getAttribute("data-flits-product-id"),product_handle=removewsl.getAttribute("data-flits-product-handle"),product_title=removewsl.getAttribute("data-flits-product-title"),product_image=removewsl.getAttribute("data-flits-product-image"),page=removewsl.getAttribute("data-page"),token=document.getElementById("flits-wsl-token").value,url=document.getElementById("flits-wsl-url").value+remove_wsl_url;if(that2.isNull(customer_email))var customer_email=that2.getCookie(cemail);clicked_remove_button.disabled=!0;var wsl_btn=removewsl.parentNode,count=0,wsl_product_count=0;
1switch(page){case"product-page":case"collection-page":wsl_btn.getElementsByClassName("flits-remove-from-wsl-btn")[0].style.display="none",wsl_btn.getElementsByClassName("flits-add-to-wsl-btn")[0].style.display="inline-block",wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0]&&(count=parseInt(wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0].innerHTML),wsl_product_count=parseInt(count)-1,wsl_product_count<=0&&(wsl_product_count=0),wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0].innerHTML=wsl_product_count);break;case"account-wsl-page":if(document.querySelector(".flits-remove-from-wsl-btn[data-flits-product-id='"+product_id+"']")){document.querySelector(".flits-remove-from-wsl-btn[data-flits-product-id='"+product_id+"']").closest("div .flits-wsl-product-row").remove();var removewsl=document.querySelectorAll(".flits-wsl-product-row");removewsl.length<1&&(document.querySelector(".flits-wishlist-ul").classList.add("flits-hidden"),document.querySelector(".flits-wsl-view-empty").classList.remove("flits-hidden"))}that2.reset_pagination();break}var ajax=that2.get_ajax_obj();ajax.onreadystatechange=function(){if(this.readyState==4&&this.status==200){clicked_remove_button.disabled=!1;var res2=JSON.parse(this.responseText);switch(that2.setCookie(chandle,res2.products_handle,15),page){case"product-page":case"collection-page":wsl_btn.getElementsByClassName("flits-remove-from-wsl-btn")[0].style.display="none",wsl_btn.getElementsByClassName("flits-add-to-wsl-btn")[0].style.display="inline-block",wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0]&&(wsl_btn.parentNode.getElementsByClassName("flits-wsl-product-count")[0].innerHTML=wsl_product_count);break;case"account-wsl-page":if(document.querySelector(".flits-remove-from-wsl-btn[data-flits-product-id='"+product_id+"']")){document.querySelector(".flits-remove-from-wsl-btn[data-flits-product-id='"+product_id+"']").closest("div .flits-wsl-product-row").remove();var removewsl2=document.querySelectorAll(".flits-wsl-product-row");removewsl2.length<1&&(document.querySelector(".flits-wishlist-ul").classList.add("flits-hidden"),document.querySelector(".flits-wsl-view-empty").classList.remove("flits-hidden"))}that2.reset_pagination();break}}},ajax.open("DELETE",url,!0),ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded");var data=that2.serialize({customer_hash:window.flitsApp.customer_hash,token:token,customer_id:customer_id,customer_email:customer_email,product_id:product_id,product_handle:product_handle,product_title:product_title,product_image:product_image,wsl_product_count:wsl_product_count});ajax.send(data)})})},this.serialize=function(obj){var str=[];for(var p in obj)obj.hasOwnProperty(p)&&str.push(encodeURIComponent(p)+"="+encodeURIComponent(obj[p]));return str.join("&")},this.isNull=function(t){return typeof t=="undefined"||t==null||t.trim()==""},this.flits_wsl_guest_login=function(){for(var flits_handel_cookie=that.getCookie(chandle),flits_handel_array=flits_handel_cookie.split(","),i=0;i<flits_handel_array.length;i++){var s=document.querySelectorAll("*[data-flits-product-handle='"+flits_handel_array[i]+"']");s.length>0&&(s[0].parentElement.querySelectorAll(".flits-add-to-wsl-btn")[0].style.display="none",s[0].parentElement.querySelectorAll(".flits-remove-from-wsl-btn")[0].style.display="inline-block")}},this.add_to_cart_event=function(){var add_cart=document.querySelectorAll(".flits-wsl-add-to-cart"),that2=this;add_cart.forEach(function(item,index){typeof item.addEventListener=="function"&&item.addEventListener("click",function(e){var quantity=this.closest("li").querySelector(".flits-wsl-product-variant-quantity").value,select=this.closest("li").querySelector(".product-variant-options"),id=select.options[select.selectedIndex].value,data="id="+id+"&quantity="+quantity;that2.addToCart(data,function(line_item){location.href="/cart"},function(){})})})},this.addToCart=function(data,suc_callback,error_callback){var that2=this,ajax=that2.get_ajax_obj();ajax.onreadystatechange=function(){if(this.readyState==4)if(this.status==200){var line_item=JSON.parse(this.responseText);typeof suc_callback=="function"&&suc_callback(line_item)}else typeof error_callback=="function"&&error_callback(res)},ajax.open("POST","/cart/add.js",!0),ajax.setRequestHeader("Content-type","application/x-www-form-urlencoded"),ajax.send(data)},this.add_product(),this.remove_product(),location.pathname!="/account"&&this.flits_wsl_guest_login(),location.pathname=="/account"&&(this.wsl_pagination(),this.change_variant_price(),this.add_to_cart_event())},(function(funcName,baseObj){funcName=funcName||"docReady",baseObj=baseObj||window;var readyList=[],readyFired=!1,readyEventHandlersInstalled=!1;function ready(){if(!readyFired){readyFired=!0;for(var i=0;i<readyList.length;i++)readyList[i].fn.call(window,readyList[i].ctx);readyList=[]}}function readyStateChange(){document.readyState==="complete"&&ready()}baseObj[funcName]=function(callback,context){if(typeof callback!="function")throw new TypeError("callback for docReady(fn) must be a function");if(readyFired){setTimeout(function(){callback(context)},1);return}else readyList.push({fn:callback,ctx:context});document.readyState==="complete"?setTimeout(ready,1):readyEventHandlersInstalled||(document.addEventListener?(document.addEventListener("DOMContentLoaded",ready,!1),window.addEventListener("load",ready,!1)):(document.attachEvent("onreadystatechange",readyStateChange),window.attachEvent("onload",ready)),readyEventHandlersInstalled=!0)}})("flits_docReady",window),flits_docReady(function(){var is_wishlist_automatic=document.getElementById("flits-is-wishlist-automatic").value,addtocart_selectors=["button[name='add']"];
1addtocart_selectors.forEach(function(selector){var els=document.querySelectorAll(selector);if(typeof els=="object"&&els)for(var i=0;i<els.length;i++){var el=els[i];if(typeof el.addEventListener!="function")return;is_wishlist_automatic==1&&el.parentElement.after(document.getElementById("flits-wishlist-automatic-code").children[0],el.parentElement.firstChild)}})}),location.pathname=="/account"&&(window.flitsApp.get_wishlist_products_using_ajax=function(){var url=flitsAppJquery("#flits-wsl-url").val(),customer_id=flitsAppJquery("#flits-wsl-customer-id").val(),token=flitsAppJquery("#flits-wsl-token").val();flitsAppJquery.ajax({method:"get",url:url,data:{customer_id:customer_id,customer_hash:window.flitsApp.customer_hash,token:token},success:function(data){var count=data.count,products=data.data,status=data.status;status&&count>0?(flitsAppJquery.each(products,function(index,product){var li=flitsAppJquery(".flits-wsl-li-structure").clone();li.removeClass("flits-wsl-li-structure"),li.addClass("flits-wsl-product-row"),li.find(".flits-product-title-anchor").attr("href","/products/"+product.product_handle),li.attr("data-flits-wishlist-product-handle",product.product_handle),flitsAppJquery(".flits-wishlist-ul").append(li)}),flitsAppJquery("#flits-wishlist-size").val(count),flitsAppJquery("#flits-wishlist-limit").val(8),flitsAppJquery("#flits-wishlist-total-page").val(Math.ceil(count/8)),flitsAppJquery(".flits-wsl-view-empty").addClass("flits-hidden"),flitsAppJquery(".flits-wishlist-ul").removeClass("flits-hidden"),document.getElementById("flits-wishlist-current-page").value=1,window.flitsApp.wishlist_products_obj.reset_pagination(),window.flitsApp.set_wishlist_products_using_ajax(),window.flitsApp.wishlist_products_obj.remove_product()):(flitsAppJquery(".flits-wsl-view-empty").removeClass("flits-hidden"),flitsAppJquery(".flits-wishlist-ul").addClass("flits-hidden"))},error:function(){flitsAppJquery(".flits-wsl-view-empty").removeClass("flits-hidden"),flitsAppJquery(".flits-wishlist-ul").addClass("flits-hidden")}})},window.flitsApp.set_wishlist_products_using_ajax=function(){window.flitsApp.set_wishlist_add_change_event(),window.flitsApp.set_wishlist_add_click_event();var moneyFormat=flitsAppJquery("#flits-shop-money-format").val(),$_=flitsAppJquery;$_("[data-flits-wishlist-product-handle]").each(function(index,item){var wishlist_product_selector=$_(this),handle=$_(this).attr("data-flits-wishlist-product-handle");$_.ajax({method:"get",url:"/products/"+handle+".json",success:function(data){var product=data.product,image="https://cdn.shopify.com/s/assets/no-image-2048-5e88c1b20e087fb7bbe9a3771824e743c244f437e4f8ba93bbf7b11b53f7824c.gif";product.image!=null&&(image=product.image.src);var extidx=image.lastIndexOf("."),extension=image.substr(extidx);image=image.replace(extension,"_200x_crop_center"+extension),$_(wishlist_product_selector).find(".flits-product-img").css({background:"url("+image+")","background-size":"contain","background-repeat":"no-repeat","background-position":"center center","background-image":image});var display_variant_price=0;$_.each(product.variants,function(variant_index,variant){var variant_price=window.flitsApp.formatMoney(Math.abs(variant.price*100),moneyFormat).replace(/((\,00)|(\.00))$/g,""),variant_title=variant.title;product.variants.length==1&&variant_title=="Default Title"&&(variant_title=product.title);var option=$_("<option/>");option.html(variant_title),option.attr("value",variant.id),option.attr("data-flits-variant-price",variant_price),$_.ajax({method:"get",url:location.origin+"/products/"+product.handle+"?view=flits_product_variant_data&variant="+variant.id,success:function(data2){var parser=new DOMParser,htmlDoc=parser.parseFromString(data2,"text/html"),res2=JSON.parse(htmlDoc.querySelector(".flits-product-variant-data").innerHTML);if(res2.inventory_management=="shopify"&&res2.inventory_policy=="deny"&&res2.inventory_quantity<=0){option.html(option.html()+" - Sold Out");var flits_add_cart_btn=$_(wishlist_product_selector).find(".flits-add-to-cart"),selected_variant_text=$_(wishlist_product_selector).find(".flits-product-variant-options option:selected").html();if(selected_variant_text.indexOf("Sold Out")!=-1){var sold_out_text=flits_add_cart_btn.attr("data-flits-sold-out-text");flits_add_cart_btn.addClass("flits-btn-danger").attr("disabled",!0).html(sold_out_text)}}},error:function(){}}),display_variant_price<=0&&(display_variant_price=variant_price),$_(wishlist_product_selector).find(".flits-product-variant-options").append(option)}),$_(wishlist_product_selector).find(".flits-product-variant-title").append(product.title),$_(wishlist_product_selector).find(".flits-product-variant-price").append(display_variant_price),$_(wishlist_product_selector).find(".flits-wsl-product-remove").attr("data-flits-product-id",product.id),$_(wishlist_product_selector).find(".flits-wsl-product-remove").attr("data-flits-product-title",product.title),$_(wishlist_product_selector).find(".flits-wsl-product-remove").attr("data-flits-product-handle",product.handle),$_(wishlist_product_selector).attr("title",product.title),window.flitsApp.wishlist_products_obj.reset_pagination()},error:function(){$_(wishlist_product_selector).remove(),window.flitsApp.wishlist_products_obj.reset_pagination()}})})},window.flitsApp.set_wishlist_add_change_event=function(){flitsAppJquery(document).on("change",".flits-wsl-product-row .flits-product-variant-options",function(ev){var variant_price=this.options[this.selectedIndex].getAttribute("data-flits-variant-price"),flits_product_variant_price_div=this.closest(".flits-row").parentNode.querySelector(".flits-product-variant-price");flits_product_variant_price_div.innerHTML=variant_price;var flits_add_cart_btn_text="",flits_add_cart_btn=this.closest(".flits-row").parentNode.querySelector(".flits-add-to-cart"),selected_product_variant_text=this.options[this.selectedIndex].innerHTML;selected_product_variant_text.indexOf("Sold Out")!=-1?(flits_add_cart_btn_text=flits_add_cart_btn.getAttribute("data-flits-sold-out-text"),flits_add_cart_btn.disabled=!0,flits_add_cart_btn.classList.add("flits-btn-danger")):(flits_add_cart_btn_text=flits_add_cart_btn.getAttribute("data-flits-add-to-cart-text"),flits_add_cart_btn.disabled=!1,flits_add_cart_btn.classList.remove("flits-btn-danger")),flits_add_cart_btn.innerHTML=flits_add_cart_btn_text})},window.flitsApp.set_wishlist_add_click_event=function(){flitsAppJquery(document).on("click",".flits-wsl-product-row .flits-product-quantity-adjuster",function(ev){var el=this,flits_quantity_selector=el.parentNode.querySelector(".flits-product-quantity-num"),qty=parseInt(flits_quantity_selector.value);qty=flits_validate_quantity(qty),qtyMin=1,el.classList.contains("flits-product-quantity-add")?qty=qty+1:qty=qty<=qtyMin?qtyMin:qty-1,flits_quantity_selector.value=qty}),flits_validate_quantity=function(qty){return parseFloat(qty)==parseInt(qty)&&!isNaN(qty)?qty:1}},window.flitsApp.run_after_jquery=function(callback){var callback_interval=setInterval(function(){typeof flitsAppJquery=="undefined"||(clearInterval(callback_interval),typeof callback=="function"&&callback())},1e3)},window.flitsApp.append_anchor_div=function(appent_at){var pages_div=document.querySelector(".flits-pages"),div_anchor=d
1ocument.querySelector(".flits-wishlist-extra-data .flits-anchor a"),div_div=document.querySelector(".flits-wishlist-extra-data .flits-div div");if(div_anchor){var list_group_length=document.querySelector(".flits-list-group").children.length,list_group=document.querySelector(".flits-list-group");appent_at>=list_group_length?list_group.insertBefore(div_anchor,list_group.children[list_group_length]):list_group.insertBefore(div_anchor,list_group.children[appent_at])}div_div&&pages_div&&pages_div.append(div_div),window.flitsApp.run_after_jquery(window.flitsApp.get_wishlist_products_using_ajax)},window.flitsApp.append_anchor_div(3));
2//# sourceMappingURL=/cdn/shop/t/22/assets/flits-wishlist.js.map?v=57139740260846312491720587132

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.