PageSourceSearch

https://www.huthwaiteinternational.com/hubfs/hub_generated/templat…/1744234824748/template_shop.min.js

js huthwaiteinternational.com collected 2026-10-02 15:17:42 UTC 6,292 bytes, 1 lines download raw bytes

1function Cart(){}function Util(){}if(function(){var t=document.getElementsByClassName("js-cd-cart"),e=window.localStorage,n="cartItems";if(t.length>0){var a=document.getElementsByClassName("js-cd-add-to-cart"),i=t[0].getElementsByClassName("cd-cart__body")[0],s=i.getElementsByTagName("ul")[0],c=t[0].getElementsByClassName("cd-cart__checkout")[0].getElementsByTagName("span")[0],l=t[0].getElementsByClassName("cd-cart__checkout")[0],r=t[0].getElementsByClassName("cd-cart__count")[0],o=r.getElementsByTagName("li"),u=12;function d(t){return localStorage.getItem(t)?e.getItem(t):""}function m(){return""===d(n)?[]:JSON.parse(d(n))}function p(t){var a,i;a=n,i=JSON.stringify(t),e.setItem(a,i)}function f(e){if(e.preventDefault(),!animatingQuantity){Util.hasClass(t[0],"cd-cart--empty");!function(t){for(var e=t.getAttribute("data-svcId"),n=t.getAttribute("data-title"),a=Number(t.getAttribute("data-price")).toFixed(2),i=m(),s=null,c=0;c<i.length;c++){var l=i[c];if(l.id===e){s=l;break}}null!==s?s.qty<u&&(s.qty+=1):i.push({id:e,price:a,title:n,qty:1});p(i),g()}(this),y(),C(),Util.removeClass(t[0],"cd-cart--empty")}}function v(e){(void 0===e?Util.hasClass(t[0],"cd-cart--open"):e)?(Util.removeClass(t[0],"cd-cart--open"),cartTimeoutId&&clearInterval(cartTimeoutId),setTimeout((function(){i.scrollTop=0,0==Number(o[0].innerText)&&Util.addClass(t[0],"cd-cart--empty")}),500)):Util.addClass(t[0],"cd-cart--open")}function g(){for(var t=m(),e="",n=0;n<t.length;n++){var a=t[n];e+='<li data-svcId="'+a.id+'" class="cd-cart__product"><div class="cd-cart__details"><h3 class="wrappy"><a href="#0" title="'+a.title+'">'+a.title+'</a></h3><span class="cd-cart__price">'+a.price+'</span><div class="cd-cart__actions"><a href="#0" class="cd-cart__delete-item">Delete</a><div class="cd-cart__quantity"><label for="cd-product-'+a.id+'">Qty</label><span class="cd-cart__select"><select class="reset" data-svcId="'+a.id+'" id="cd-product-'+a.id+'" name="quantity">'+h(a.qty)+'</select><svg class="icon" viewBox="0 0 12 12"><polyline fill="none" stroke="currentColor" points="2,4 6,8 10,4 "/></svg></span></div></div></div></li>'}s.innerHTML=e}function h(t){for(var e="",n=1;n<u+1;n++)e+='<option value="'+n+'" '+(n===t?"selected":"")+">"+n+"</option>";return e}function y(){for(var t=m(),e=0,n=0;n<t.length;n++){var a=t[n];e+=a.qty}0===e?(o[0].innerText="",animatingQuantity=!1):(Util.addClass(r,"cd-cart__count--update"),setTimeout((function(){o[0].innerText=e}),150),setTimeout((function(){Util.removeClass(r,"cd-cart__count--update")}),200),setTimeout((function(){o[1].innerText=e,animatingQuantity=!1}),230))}function C(){for(var t=m(),e=0,n=0;n<t.length;n++){var a=t[n];e+=a.qty*a.price}c.innerText=e.toFixed(2)}cartTimeoutId=!1,animatingQuantity=!1,Cart.initCartEvents=function(){for(var e=0;e<a.length;e++)!function(t){a[t].addEventListener("click",f)}(e);l.addEventListener("click",(function(t){t.preventDefault(),window.location.replace("https://www.huthwaiteinternational.com/checkout/")})),t[0].getElementsByClassName("cd-cart__trigger")[0].addEventListener("click",(function(t){t.preventDefault(),v()})),t[0].addEventListener("click",(function(e){e.target==t[0]?v(!0):e.target.closest(".cd-cart__delete-item")&&(e.preventDefault(),function(t){for(var e=t.getAttribute("data-svcId"),n=m(),a=-1,i=0;i<n.length;i++){if(n[i].id===e){a=i;break}}-1!==a&&n.splice(a,1);p(n),g(),C(),y()}(e.target.closest(".cd-cart__product")))})),t[0].addEventListener("change",(function(t){"select"==t.target.tagName.toLowerCase()&&function(t){for(var e=t.target.getAttribute("data-svcId"),n=m(),a=0;a<n.length;a++){var i=n[a];if(i.id===e){i.qty=Number(t.target.value);break}}p(n),g(),y(),C()}(t)})),m().length>0&&(g(),y(),C(),Util.removeClass(t[0],"cd-cart--empty"))}}}(),Util.hasClass=function(t,e){return t.classList?t.classList.contains(e):!!t.className.match(new RegExp("(\\s|^)"+e+"(\\s|£)"))},Util.addClass=function(t,e){var n=e.split(" ");t.classList?t.classList.add(n[0]):Util.hasClass(t,n[0])||(t.className+=" "+n[0]),n.length>1&&Util.addClass(t,n.slice(1).join(" "))},Util.removeClass=function(t,e){var n=e.split(" ");if(t.classList)t.classList.remove(n[0]);else if(Util.hasClass(t,n[0])){var a=new RegExp("(\\s|^)"+n[0]+"(\\s|£)");t.className=t.className.replace(a," ")}n.length>1&&Util.removeClass(t,n.slice(1).join(" "))},Util.toggleClass=function(t,e,n){n?Util.addClass(t,e):Util.removeClass(t,e)},Util.setAttributes=function(t,e){for(var n in e)t.setAttribute(n,e[n])},Util.getChildrenByClassName=function(t,e){t.children;for(var n=[],a=0;a<t.children.length;a++)Util.hasClass(t.children[a],e)&&n.push(t.children[a]);return n},Util.setHeight=function(t,e,n,a,i){var s=e-t,c=null,l=function(e){c||(c=e);var r=e-c,o=parseInt(r/a*s+t);n.setAttribute("style","height:"+o+"px;"),r<a?window.requestAnimationFrame(l):i()};n.setAttribute("style","height:"+t+"px;"),window.requestAnimationFrame(l)},Util.scrollTo=function(t,e,n){var a=window.scrollY||document.documentElement.scrollTop,i=null,s=function(c){i||(i=c);var l=c-i;l>e&&(l=e);var r=Math.easeInOutQuad(l,a,t-a,e);window.scrollTo(0,r),l<e?window.requestAnimationFrame(s):n&&n()};window.requestAnimationFrame(s)},Util.moveFocus=function(t){t||(t=document.getElementsByTagName("body")[0]),t.focus(),document.activeElement!==t&&(t.setAttribute("tabindex","-1"),t.focu
1s())},Util.getIndexInArray=function(t,e){return Array.prototype.indexOf.call(t,e)},Util.cssSupports=function(t,e){return"CSS"in window?CSS.supports(t,e):t.replace(/-([a-z])/g,(function(t){return t[1].toUpperCase()}))in document.body.style},Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector),Element.prototype.closest||(Element.prototype.closest=function(t){var e=this;if(!document.documentElement.contains(e))return null;do{if(e.matches(t))return e;e=e.parentElement||e.parentNode}while(null!==e&&1===e.nodeType);return null}),"function"!=typeof window.CustomEvent){function CustomEvent(t,e){e=e||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,e.bubbles,e.cancelable,e.detail),n}CustomEvent.prototype=window.Event.prototype,window.CustomEvent=CustomEvent}Math.easeInOutQuad=function(t,e,n,a){return(t/=a/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e};

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.