PageSourceSearch

https://shopbywarchee.com/cdn/shop/t/2/assets/recent-product.min.js?v=177202654099872580831716809566

js shopbywarchee.com collected 2026-10-09 23:35:24 UTC 4,491 bytes, 164 lines download raw bytes

1 jQuery.cookie = function(b, j, m) {
2	if (typeof j != "undefined") {
3		 m = m || {};
4		 if (j === null) {
5			 j = "";
6			 m.expires = -1
7		 }
8		 var e = "";
9		 if (m.expires && (typeof m.expires == "number" || m.expires.toUTCString)) {
10			 var f;
11			 if (typeof m.expires == "number") {
12				 f = new Date();
13				 f.setTime(f.getTime() + (m.expires * 24 * 60 * 60 * 1000))
14			 } else {
15				 f = m.expires
16			 }
17			 e = "; expires=" + f.toUTCString()
18		 }
19		 var l = m.path ? "; path=" + (m.path) : "";
20		 var g = m.domain ? "; domain=" + (m.domain) : "";
21		 var a = m.secure ? "; secure" : "";
22		 document.cookie = [b, "=", encodeURIComponent(j), e, l, g, a].join("")
23	 } else {
24		 var d = null;
25		 if (document.cookie && document.cookie != "") {
26			 var k = document.cookie.split(";");
27			 for (var h = 0; h < k.length; h++) {
28				 var c = jQuery.trim(k[h]);
29				 if (c.substring(0, b.length + 1) == (b + "=")) {
30					 d = decodeURIComponent(c.substring(b.length + 1));
31					 break
32				 }
33			 }
34		 }
35		 return d
36	}
37 };
38 Shopify.Products = (function() {
39	 var a = {
40		 howManyToShow: 1,
41		 howManyToStoreInMemory: 10,
42		 wrapperId: "recently-viewed-products",
43		 templateId: "recently-viewed-product-template",
44		 onComplete: null
45	 };
46	 var c = [];
47	 var h = null;
48	 var d = null;
49	 var e = 0;
50	 var b = {
51		 configuration: {
52			 expires: 90,
53			 path: "/",
54			 domain: window.location.hostname
55		 },
56		 name: "shopify_recently_viewed",
57		 write: function(i) {
58			 jQuery.cookie(this.name, i.join(" "), this.configuration)
59		 },
60		 read: function() {
61			 var i = [];
62			 var j = jQuery.cookie(this.name);
63			 if (j !== null && typeof j != "undefined") {
64				 i = j.split(" ")
65			 }
66			 return i
67		 },
68		 destroy: function() {
69			 jQuery.cookie(this.name, null, this.configuration)
70		 },
71		 remove: function(k) {
72			 var j = this.read();
73			 var i = jQuery.inArray(k, j);
74			 if (i !== -1) {
75				 j.splice(i, 1);
76				 this.write(j)
77			 }
78		 }
79	 };
80	 var f = function() {
81		 h.show();
82		 if (a.onComplete) {
83			 try {
84				 a.onComplete()
85			 } catch (i) {}
86		 }
87	 };
88	 var g = function() {
89		if (c.length && e < a.howManyToShow){
90			const productTileTemplateUrl = "/products/"+c[0]+"?view=content";
91			return fetch(productTileTemplateUrl)
92			.then((res) => res.text())
93			.then((res) => {
94				const text = res;
95				const parser = new DOMParser();
96				const htmlDocument = parser.parseFromString(text, 'text/html');
97				const productCard = htmlDocument.documentElement.querySelector(".product-content-card",h);
98				$(".js-product-recent",h).append(productCard.outerHTML);
99				if (c.length > 0) {
100					$(".js-product-recent",h).addClass('loading');
101				}
102				c.shift();
103				e++;
104				g();
105			}).catch((err) => console.error("[Shopify Content] Failed to load content for handle: "+c[0]+"", err));		
106		}else {
107			$(".js-product-recent",h).removeClass('loading');
108			var $element = $(".js-product-recent",h);
109			wpbingo.elementslickCarousel( $element );
110			$('.product-card__image-wrapper.slider',$element).each(function() {
111				wpbingo.elementslickCarousel( $('.js-carousel',$(this)) );
112			});
113			initButtons("#recently-viewed-products");
114			initButtonsCompare("#recently-viewed-products");
115			wpbingo.countdown();
116			wpbingo.click_atribute_image();
117			wpbingo.zoom_thumb();
118			if(window.SPR){
119				SPR.initRatingHandler ();
120				SPR.initDomEls ();
121				SPR.loadProducts ();
122				SPR.loadBadges ();
123			}
124			if( $('.bwp_currency').length > 0){ Currency.Currency_customer(true); }
125			f();
126		}
127	 };
128	 return {
129		showRecentlyViewed: function(i) {
130			if( $('#recently-viewed-products').length > 0){
131				var i = i || {};
132				 var count = document.querySelector("#recently-viewed-products",h);
133				jQuery.extend(a, i);
134				c = b.read();
135				d = jQuery("#" + a.templateId);
136				h = jQuery("#" + a.wrapperId);
137				a.howManyToShow = count.getAttribute('data-count');
138				if (a.howManyToShow && d.length && h.length && c.length) {
139					g();
140				}
141				if (c.length == 0) {
142					$('.section-recently-viewed-products').remove();
143				}
144			}
145		},
146		recordRecentlyViewed: function(l) {
147			 var l = l || {};
148			 jQuery.extend(a, l);
149			 var j = b.read();
150			 if (window.location.pathname.indexOf("/products/") !== -1) {
151				 var k = window.location.pathname.match(/\/products\/([a-z0-9\-]+)/)[1];
152				 var i = jQuery.inArray(k, j);
153				 if (i === -1) {
154					 j.unshift(k);
155					 j = j.splice(0, a.howManyToStoreInMemory)
156				 } else {
157					 j.splice(i, 1);
158					 j.unshift(k)
159				 }
160				 b.write(j);
161			 }
162		 }
163	}
164 })();

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.