easyorders 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/README.md +93 -93
  2. package/dist/bin/cli.js +12 -5
  3. package/dist/template/theme/config.json +113 -95
  4. package/dist/template/theme/home-sections/Tilted-Scrolling-Marque/config.json +107 -0
  5. package/dist/template/theme/home-sections/Tilted-Scrolling-Marque/template.liquid +171 -0
  6. package/dist/template/theme/home-sections/category-mosaic/config.json +89 -4
  7. package/dist/template/theme/home-sections/category-mosaic/template.liquid +84 -69
  8. package/dist/template/theme/home-sections/different-hero/config.json +199 -0
  9. package/dist/template/theme/home-sections/different-hero/template.liquid +219 -0
  10. package/dist/template/theme/home-sections/editorial-feature/config.json +27 -1
  11. package/dist/template/theme/home-sections/editorial-feature/template.liquid +11 -10
  12. package/dist/template/theme/home-sections/newsletter-luxe/config.json +28 -2
  13. package/dist/template/theme/home-sections/newsletter-luxe/template.liquid +19 -13
  14. package/dist/template/theme/home-sections/runway-hero/config.json +87 -30
  15. package/dist/template/theme/home-sections/runway-hero/template.liquid +59 -29
  16. package/dist/template/theme/home-sections/shop-the-look/config.json +93 -1
  17. package/dist/template/theme/home-sections/shop-the-look/template.liquid +41 -19
  18. package/dist/template/theme/home-sections/slider-before-after/config.json +213 -0
  19. package/dist/template/theme/home-sections/slider-before-after/template.liquid +336 -0
  20. package/dist/template/theme/home-sections/test-hero-allbird/config.json +130 -0
  21. package/dist/template/theme/home-sections/test-hero-allbird/template.liquid +149 -0
  22. package/dist/template/theme/home-sections/trust-promise/config.json +76 -2
  23. package/dist/template/theme/home-sections/trust-promise/template.liquid +119 -96
  24. package/dist/template/theme/home-sections/zoom-parallax/config.json +48 -0
  25. package/dist/template/theme/home-sections/zoom-parallax/template.liquid +135 -0
  26. package/dist/template/theme/product-data-schema.json +27 -0
  27. package/dist/template/theme/schema.json +136 -151
  28. package/dist/template/theme/script.js +1095 -586
  29. package/dist/template/theme/sections/breadcrumbs.liquid +17 -17
  30. package/dist/template/theme/sections/categories.liquid +26 -10
  31. package/dist/template/theme/sections/fake-counter.liquid +27 -27
  32. package/dist/template/theme/sections/fake-stock.liquid +6 -6
  33. package/dist/template/theme/sections/fake-visitor.liquid +6 -6
  34. package/dist/template/theme/sections/featured-products.liquid +143 -110
  35. package/dist/template/theme/sections/fixed-buy-button.liquid +51 -46
  36. package/dist/template/theme/sections/footer.liquid +128 -129
  37. package/dist/template/theme/sections/gallery.liquid +65 -61
  38. package/dist/template/theme/sections/header.liquid +232 -152
  39. package/dist/template/theme/sections/home-products-grid.liquid +167 -109
  40. package/dist/template/theme/sections/list-products.liquid +136 -93
  41. package/dist/template/theme/sections/order-invoice.liquid +102 -154
  42. package/dist/template/theme/sections/product-description.liquid +40 -30
  43. package/dist/template/theme/sections/product-details.liquid +48 -63
  44. package/dist/template/theme/sections/products-grid.liquid +134 -86
  45. package/dist/template/theme/sections/related-products.liquid +152 -88
  46. package/dist/template/theme/sections/reviews.liquid +70 -55
  47. package/dist/template/theme/sections/slider.liquid +43 -43
  48. package/dist/template/theme/sections/thanks.liquid +33 -33
  49. package/dist/template/theme/style.css +5617 -3923
  50. package/dist/template/theme/theme-data.json +26 -9
  51. package/package.json +40 -40
@@ -1,586 +1,1095 @@
1
- !(function () {
2
- function e() {
3
- var e = document.querySelector(".ab-header");
4
- if (e && !e.dataset.scrollInit) {
5
- e.dataset.scrollInit = "1";
6
- var t = window.scrollY;
7
- window.addEventListener(
8
- "scroll",
9
- function () {
10
- var a = window.scrollY;
11
- Math.abs(a - t) < 5 ||
12
- (a > t && a > 100
13
- ? e.classList.add("ab-hidden")
14
- : e.classList.remove("ab-hidden"),
15
- (t = a));
16
- },
17
- { passive: !0 }
18
- );
19
- }
20
- }
21
- function t() {
22
- var e = document.getElementById("eo-menu-btn"),
23
- t = document.getElementById("eo-mobile-menu"),
24
- a = document.getElementById("eo-mobile-overlay"),
25
- n = document.getElementById("eo-mobile-close");
26
- function r() {
27
- t.classList.remove("ab-open"),
28
- a && a.classList.remove("ab-open"),
29
- (document.body.style.overflow = "");
30
- }
31
- e &&
32
- t &&
33
- !e.dataset.menuInit &&
34
- ((e.dataset.menuInit = "1"),
35
- e.addEventListener("click", function () {
36
- t.classList.add("ab-open"),
37
- a && a.classList.add("ab-open"),
38
- (document.body.style.overflow = "hidden");
39
- }),
40
- n && n.addEventListener("click", r),
41
- a && a.addEventListener("click", r),
42
- t.querySelectorAll(".ab-mobile-nav > a").forEach(function (e) {
43
- e.addEventListener("click", r);
44
- }),
45
- t.querySelectorAll(".ab-mobile-accordion-panel a").forEach(function (e) {
46
- e.addEventListener("click", r);
47
- }),
48
- t.querySelectorAll(".ab-mobile-accordion-trigger").forEach(function (e) {
49
- e.dataset.accordionInit ||
50
- ((e.dataset.accordionInit = "1"),
51
- e.addEventListener("click", function () {
52
- var a = e.closest(".ab-mobile-accordion");
53
- if (a) {
54
- var n = a.classList.contains("ab-open");
55
- t.querySelectorAll(".ab-mobile-accordion.ab-open").forEach(function (e) {
56
- e !== a && e.classList.remove("ab-open");
57
- }),
58
- a.classList.toggle("ab-open", !n);
59
- }
60
- }));
61
- }));
62
- }
63
- function a() {
64
- document.querySelectorAll(".ab-plist").forEach(function (e) {
65
- if (!e.dataset.scrollArrowInit) {
66
- e.dataset.scrollArrowInit = "1";
67
- var t = e.querySelector(".ab-plist-track"),
68
- a = e.querySelector(".ab-plist-prev"),
69
- n = e.querySelector(".ab-plist-next");
70
- t &&
71
- (a &&
72
- a.addEventListener("click", function () {
73
- t.scrollBy({ left: -r(), behavior: "smooth" });
74
- }),
75
- n &&
76
- n.addEventListener("click", function () {
77
- t.scrollBy({ left: r(), behavior: "smooth" });
78
- }));
79
- }
80
- function r() {
81
- var e = t.querySelector(".ab-plist-card");
82
- if (!e) return 0.8 * t.clientWidth;
83
- var a = getComputedStyle(t),
84
- n = parseFloat(a.gap) || 16;
85
- return e.offsetWidth + n;
86
- }
87
- });
88
- }
89
- function n() {
90
- document.querySelectorAll(".ab-slider").forEach(function (e) {
91
- if (!e.dataset.sliderInit) {
92
- e.dataset.sliderInit = "1";
93
- var t = e.querySelectorAll(".ab-slider-slide");
94
- if (!(t.length < 2)) {
95
- var a = e.querySelector(".ab-slider-progress-bar"),
96
- n = e.querySelector(".ab-slider-pause"),
97
- r = parseInt(e.dataset.autoplay) || 5e3,
98
- o = 0,
99
- i = !1,
100
- c = 0,
101
- l = null;
102
- n &&
103
- n.addEventListener("click", function () {
104
- i
105
- ? d()
106
- : ((i = !0), e.classList.add("ab-paused"), l && cancelAnimationFrame(l));
107
- }),
108
- d();
109
- }
110
- }
111
- function s(e) {
112
- if (!i) {
113
- var n,
114
- d = e - c,
115
- u = Math.min((d / r) * 100, 100);
116
- a && (a.style.width = u + "%"),
117
- d >= r &&
118
- ((n = o + 1),
119
- t[o].classList.remove("ab-active"),
120
- (o = n % t.length),
121
- t[o].classList.add("ab-active"),
122
- (c = performance.now())),
123
- (l = requestAnimationFrame(s));
124
- }
125
- }
126
- function d() {
127
- (i = !1),
128
- e.classList.remove("ab-paused"),
129
- (c = performance.now()),
130
- (l = requestAnimationFrame(s));
131
- }
132
- });
133
- }
134
- function r() {
135
- var e = document.querySelectorAll(".ab-reveal:not(.ab-observed)");
136
- if (e.length) {
137
- var t = new IntersectionObserver(
138
- function (e) {
139
- e.forEach(function (e) {
140
- e.isIntersecting &&
141
- (e.target.classList.add("ab-visible"), t.unobserve(e.target));
142
- });
143
- },
144
- { threshold: 0.1 }
145
- );
146
- e.forEach(function (e) {
147
- e.classList.add("ab-observed"), t.observe(e);
148
- });
149
- }
150
- }
151
- function o() {
152
- document.querySelectorAll(".ab-gallery").forEach(function (e) {
153
- if (!e.dataset.galleryInit) {
154
- e.dataset.galleryInit = "1";
155
- var t = e.querySelector(".ab-gallery-main-media"),
156
- a = e.querySelectorAll(".ab-gallery-thumb"),
157
- n = [];
158
- a.forEach(function (e) {
159
- e.dataset.src && n.push(e.dataset.src);
160
- }),
161
- 0 === n.length && t && n.push(t.src),
162
- document.querySelectorAll("body > .ab-lightbox").forEach(function (e) {
163
- e.remove();
164
- });
165
- var r = e.querySelector("[data-lightbox]");
166
- r && document.body.appendChild(r);
167
- var o = r && r.querySelector("[data-lightbox-img]"),
168
- i = r && r.querySelector("[data-lightbox-counter]"),
169
- c = 0;
170
- a.forEach(function (n) {
171
- n.addEventListener("click", function () {
172
- var r = n.dataset.src;
173
- r &&
174
- t &&
175
- ((t.src = r),
176
- a.forEach(function (e) {
177
- e.classList.remove("ab-active");
178
- }),
179
- n.classList.add("ab-active"));
180
- });
181
- }),
182
- e.querySelectorAll("[data-gallery-open]").forEach(function (e) {
183
- e.addEventListener("click", function (e) {
184
- if (!e.target.closest("[data-src]") && r) {
185
- var a = t ? n.indexOf(t.src) : 0;
186
- l(-1 === a ? 0 : a),
187
- r.classList.add("ab-open"),
188
- (document.body.style.overflow = "hidden");
189
- }
190
- });
191
- }),
192
- r &&
193
- r.addEventListener("click", function (e) {
194
- var t = e.target;
195
- if (t.closest("[data-lightbox-close]"))
196
- return (
197
- r.classList.remove("ab-open"), void (document.body.style.overflow = "")
198
- );
199
- t.closest("[data-lightbox-prev]")
200
- ? l(c - 1)
201
- : t.closest("[data-lightbox-next]") && l(c + 1);
202
- });
203
- }
204
- function l(e) {
205
- (c = ((e % n.length) + n.length) % n.length),
206
- o && (o.src = n[c]),
207
- i && (i.textContent = c + 1 + " / " + n.length);
208
- }
209
- });
210
- }
211
- function i() {
212
- document.querySelectorAll(".ab-reviews").forEach(function (e) {
213
- e.getAttribute("data-reviews-init") ||
214
- (e.setAttribute("data-reviews-init", "1"),
215
- e.querySelectorAll("[data-review-comment]").forEach(function (e) {
216
- var t = document.createElement("button");
217
- (t.className = "ab-review-read-more"),
218
- (t.type = "button"),
219
- (t.textContent = "...Read more"),
220
- e.parentNode.insertBefore(t, e.nextSibling),
221
- requestAnimationFrame(function () {
222
- e.scrollHeight > e.clientHeight + 2 && t.classList.add("ab-visible");
223
- }),
224
- t.addEventListener("click", function () {
225
- e.classList.contains("ab-review-expanded")
226
- ? (e.classList.remove("ab-review-expanded"),
227
- (t.textContent = "...Read more"))
228
- : (e.classList.add("ab-review-expanded"), (t.textContent = "Show less"));
229
- });
230
- }));
231
- });
232
- }
233
- function c() {
234
- for (
235
- var e = document.querySelectorAll(".ab-fake-counter"), t = 0;
236
- t < e.length;
237
- t++
238
- ) {
239
- var a = e[t];
240
- a.dataset.counterInit ||
241
- ((a.dataset.counterInit = "1"),
242
- (function (e) {
243
- var t = e.dataset.productId || "",
244
- a = 36e5 * (parseFloat(e.dataset.hours) || 1);
245
- try {
246
- var n = localStorage.getItem("counter-" + t);
247
- n && Number(n) > 36e4 && (a = Number(n));
248
- } catch (e) {}
249
- var r = Date.now() + a,
250
- o = e.querySelector('[data-unit="days"]'),
251
- i = e.querySelector('[data-unit="hours"]'),
252
- c = e.querySelector('[data-unit="minutes"]'),
253
- l = e.querySelector('[data-unit="seconds"]');
254
- function s(e) {
255
- return e < 10 ? "0" + e : String(e);
256
- }
257
- !(function e() {
258
- var a = Math.max(0, r - Date.now()),
259
- n = Math.floor(a / 1e3),
260
- d = Math.floor(n / 86400);
261
- n -= 86400 * d;
262
- var u = Math.floor(n / 3600);
263
- n -= 3600 * u;
264
- var v = Math.floor(n / 60);
265
- (n -= 60 * v),
266
- o && (o.textContent = s(d)),
267
- i && (i.textContent = s(u)),
268
- c && (c.textContent = s(v)),
269
- l && (l.textContent = s(n));
270
- try {
271
- localStorage.setItem("counter-" + t, String(a));
272
- } catch (e) {}
273
- a > 0 &&
274
- requestAnimationFrame(function () {
275
- setTimeout(e, 1e3);
276
- });
277
- })();
278
- })(a));
279
- }
280
- }
281
- function l() {
282
- for (
283
- var e = document.querySelectorAll(".ab-fake-visitor"), t = 0;
284
- t < e.length;
285
- t++
286
- ) {
287
- var a = e[t];
288
- a.dataset.visitorInit ||
289
- ((a.dataset.visitorInit = "1"),
290
- (function (e) {
291
- var t = parseInt(e.dataset.min, 10) || 10,
292
- a = parseInt(e.dataset.max, 10) || 50,
293
- n = e.querySelector(".ab-fv-count");
294
- function r() {
295
- return Math.floor(Math.random() * (a - t + 1)) + t;
296
- }
297
- n &&
298
- ((n.textContent = String(r())),
299
- setInterval(function () {
300
- n.textContent = String(r());
301
- }, 3e3));
302
- })(a));
303
- }
304
- }
305
- function s() {
306
- for (
307
- var e = document.querySelectorAll(".lq-desc-accordion"), t = 0;
308
- t < e.length;
309
- t++
310
- ) {
311
- var a = e[t];
312
- a.dataset.descInit ||
313
- ((a.dataset.descInit = "1"),
314
- a.addEventListener("click", function (e) {
315
- var t = e.target.closest(".lq-desc-toggle");
316
- if (t) {
317
- var a = t.parentElement,
318
- n = a.querySelector(".lq-desc-panel");
319
- if (n)
320
- "true" === a.getAttribute("data-open")
321
- ? (a.removeAttribute("data-open"),
322
- t.setAttribute("aria-expanded", "false"),
323
- (n.style.display = "none"))
324
- : (a.setAttribute("data-open", "true"),
325
- t.setAttribute("aria-expanded", "true"),
326
- (n.style.display = "block"));
327
- }
328
- }));
329
- }
330
- }
331
- function u() {
332
- document
333
- .querySelectorAll('.ab-announce[data-ann-type="slider"]')
334
- .forEach(function (e) {
335
- if (!e.dataset.annSliderInit) {
336
- e.dataset.annSliderInit = "1";
337
- var t = e.querySelectorAll(".ab-ann-slide");
338
- if (t.length < 2) return;
339
- var a = 0;
340
- setInterval(function () {
341
- var n = t[a],
342
- next = (a + 1) % t.length;
343
- n.classList.remove("ab-active");
344
- n.classList.add("ab-exit-left");
345
- t[next].classList.add("ab-active");
346
- setTimeout(function () {
347
- n.classList.remove("ab-exit-left");
348
- }, 500);
349
- a = next;
350
- }, 3e3);
351
- }
352
- });
353
- }
354
- function v() {
355
- document.querySelectorAll(".ab-ann-marquee").forEach(function (e) {
356
- if (!e.dataset.marqueeInit) {
357
- e.dataset.marqueeInit = "1";
358
- var t = e.querySelector(".ab-ann-marquee-track");
359
- if (!t) return;
360
- var a = t.innerHTML,
361
- n = t.scrollWidth,
362
- r = e.offsetWidth;
363
- if (n < 1) return;
364
- var o = Math.ceil((2 * r) / n);
365
- if (o < 2) o = 2;
366
- t.innerHTML = "";
367
- for (var i = 0; i < o; i++) t.insertAdjacentHTML("beforeend", a);
368
- var c = t.scrollWidth / o,
369
- l = Math.max(c / 40, 5);
370
- t.style.setProperty("--marquee-dur", l + "s"),
371
- t.style.setProperty("--marquee-offset", "-" + c + "px"),
372
- t.classList.add("ab-running");
373
- }
374
- });
375
- }
376
- function h() {
377
- function m(root) {
378
- var wrap = root.closest("[data-eo-api-base]");
379
- if (wrap && wrap.getAttribute("data-eo-api-base")) {
380
- return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
381
- }
382
- if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__) {
383
- return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
384
- }
385
- return "https://api.easyorders.dev/api/v1";
386
- }
387
- function p(body) {
388
- if (Array.isArray(body)) return body;
389
- if (body && Array.isArray(body.data)) return body.data;
390
- return [];
391
- }
392
- document.querySelectorAll("[data-eo-hs-entity]:not([data-eo-hs-done])").forEach(function (root) {
393
- var base = m(root);
394
- var mount = root.querySelector("[data-eo-hs-mount]");
395
- var idsStr = root.getAttribute("data-eo-hs-ids") || "";
396
- var ids = idsStr
397
- .split(",")
398
- .map(function (s) {
399
- return s.trim();
400
- })
401
- .filter(Boolean);
402
- if (!base || !mount || ids.length === 0) {
403
- root.setAttribute("data-eo-hs-done", "1");
404
- return;
405
- }
406
- root.setAttribute("data-eo-hs-done", "1");
407
- var entity = root.getAttribute("data-eo-hs-entity") || "";
408
- var path =
409
- entity === "categories"
410
- ? "categories"
411
- : entity === "pages"
412
- ? "simple-pages"
413
- : "products";
414
- var url =
415
- base.replace(/\/$/, "") +
416
- "/" +
417
- path +
418
- "?filter=id||$in||" +
419
- ids.join(",") +
420
- "&limit=" +
421
- ids.length;
422
- mount.classList.add("eo-hs-loading");
423
- fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
424
- .then(function (res) {
425
- return res.ok ? res.json() : Promise.reject(new Error(String(res.status)));
426
- })
427
- .then(function (body) {
428
- var rows = p(body);
429
- var byId = {};
430
- rows.forEach(function (row) {
431
- if (row && row.id != null) byId[String(row.id)] = row;
432
- });
433
- var frag = document.createDocumentFragment();
434
- ids.forEach(function (id) {
435
- var row = byId[id];
436
- if (!row) return;
437
- if (entity === "products") {
438
- var slug = row.slug || "";
439
- var name = row.name || "";
440
- var thumb = row.thumb || "";
441
- var price =
442
- row.sale_price != null && row.price != null && row.sale_price < row.price
443
- ? row.sale_price
444
- : row.price;
445
- var el = document.createElement("a");
446
- el.className = "eo-hs-card eo-hs-card--product";
447
- el.href = slug ? "/products/" + encodeURIComponent(slug) : "#";
448
- el.innerHTML =
449
- (thumb
450
- ? '<span class="eo-hs-card__media"><img src="' +
451
- String(thumb).replace(/"/g, "") +
452
- '" alt="" loading="lazy" width="280" height="350" /></span>'
453
- : '<span class="eo-hs-card__media eo-hs-card__media--empty"></span>') +
454
- '<span class="eo-hs-card__body"><span class="eo-hs-card__title">' +
455
- String(name || "").replace(/</g, "&lt;") +
456
- "</span>" +
457
- (price != null
458
- ? '<span class="eo-hs-card__meta">' + String(price) + "</span>"
459
- : "") +
460
- "</span>";
461
- frag.appendChild(el);
462
- } else if (entity === "categories") {
463
- var cslug = row.slug || "";
464
- var cname = row.name || "";
465
- var cthumb = row.thumb || "";
466
- var ca = document.createElement("a");
467
- ca.className = "eo-hs-card eo-hs-card--category";
468
- ca.href = cslug ? "/collections/" + encodeURIComponent(cslug) : "#";
469
- ca.innerHTML =
470
- (cthumb
471
- ? '<span class="eo-hs-card__media"><img src="' +
472
- String(cthumb).replace(/"/g, "") +
473
- '" alt="" loading="lazy" width="320" height="200" /></span>'
474
- : '<span class="eo-hs-card__media eo-hs-card__media--empty"></span>') +
475
- '<span class="eo-hs-card__body"><span class="eo-hs-card__title">' +
476
- String(cname || "").replace(/</g, "&lt;") +
477
- "</span></span>";
478
- frag.appendChild(ca);
479
- } else {
480
- var pslug = row.slug || "";
481
- var ptitle = row.title || "";
482
- var pa = document.createElement("a");
483
- pa.className = "eo-hs-card eo-hs-card--page";
484
- pa.href = pslug ? "/pages/" + encodeURIComponent(pslug) : "#";
485
- pa.innerHTML =
486
- '<span class="eo-hs-card__body"><span class="eo-hs-card__title">' +
487
- String(ptitle || "").replace(/</g, "&lt;") +
488
- "</span></span>";
489
- frag.appendChild(pa);
490
- }
491
- });
492
- mount.textContent = "";
493
- mount.appendChild(frag);
494
- mount.classList.remove("eo-hs-loading");
495
- root.classList.remove("eo-hs--empty");
496
- })
497
- .catch(function () {
498
- mount.classList.remove("eo-hs-loading");
499
- mount.innerHTML =
500
- '<p class="eo-hs-error" role="status">Unable to load this block. Check your connection or try again later.</p>';
501
- });
502
- });
503
- }
504
- function d() {
505
- function b(el) {
506
- var wrap = el.closest("[data-eo-api-base]");
507
- if (wrap && wrap.getAttribute("data-eo-api-base")) {
508
- return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
509
- }
510
- if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__) {
511
- return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
512
- }
513
- return "https://api.easyorders.dev/api/v1";
514
- }
515
- document.querySelectorAll("a[data-eo-hs-cta]:not([data-eo-hs-cta-done])").forEach(function (a) {
516
- var id = String(a.getAttribute("data-eo-hs-cta-id") || "").trim();
517
- var entity = a.getAttribute("data-eo-hs-cta-entity") || "";
518
- a.setAttribute("data-eo-hs-cta-done", "1");
519
- if (!id) return;
520
- var base = b(a);
521
- var path =
522
- entity === "categories"
523
- ? "categories"
524
- : entity === "pages"
525
- ? "simple-pages"
526
- : "products";
527
- var url =
528
- base.replace(/\/$/, "") +
529
- "/" +
530
- path +
531
- "?filter=id||$in||" + id + "&limit=1";
532
- fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
533
- .then(function (res) {
534
- return res.ok ? res.json() : Promise.reject(new Error(String(res.status)));
535
- })
536
- .then(function (body) {
537
- var rows = Array.isArray(body) ? body : body && Array.isArray(body.data) ? body.data : [];
538
- var row = rows[0];
539
- if (!row) return;
540
- var slug = row.slug || "";
541
- if (entity === "categories" && slug) a.href = "/collections/" + encodeURIComponent(slug);
542
- else if (entity === "pages" && slug) a.href = "/pages/" + encodeURIComponent(slug);
543
- else if (entity === "products" && slug) a.href = "/products/" + encodeURIComponent(slug);
544
- })
545
- .catch(function () {});
546
- });
547
- }
548
- e(),
549
- t(),
550
- a(),
551
- n(),
552
- r(),
553
- o(),
554
- u(),
555
- v(),
556
- h(),
557
- d(),
558
- window.__abGalleryKeyInit ||
559
- ((window.__abGalleryKeyInit = !0),
560
- document.addEventListener("keydown", function (e) {
561
- var t = document.querySelector("body > .ab-lightbox.ab-open");
562
- if (t) {
563
- if ("Escape" === e.key)
564
- return (
565
- t.classList.remove("ab-open"), void (document.body.style.overflow = "")
566
- );
567
- if ("ArrowLeft" !== e.key)
568
- if ("ArrowRight" !== e.key);
569
- else {
570
- var a = t.querySelector("[data-lightbox-next]");
571
- a && a.click();
572
- }
573
- else {
574
- var n = t.querySelector("[data-lightbox-prev]");
575
- n && n.click();
576
- }
577
- }
578
- })),
579
- i(),
580
- c(),
581
- l(),
582
- s(),
583
- new MutationObserver(function () {
584
- e(), t(), a(), n(), r(), o(), u(), v(), h(), d(), i(), c(), l(), s();
585
- }).observe(document.body, { childList: !0, subtree: !0 });
586
- })();
1
+ !(function () {
2
+ var EO_STORE_API_FALLBACK = "https://api.easy-orders.net/api/v1";
3
+ function e() {
4
+ var e = document.querySelector(".ab-header");
5
+ if (e && !e.dataset.scrollInit) {
6
+ e.dataset.scrollInit = "1";
7
+ var t = window.scrollY;
8
+ window.addEventListener(
9
+ "scroll",
10
+ function () {
11
+ var a = window.scrollY;
12
+ Math.abs(a - t) < 5 ||
13
+ (a > t && a > 100
14
+ ? e.classList.add("ab-hidden")
15
+ : e.classList.remove("ab-hidden"),
16
+ (t = a));
17
+ },
18
+ { passive: !0 }
19
+ );
20
+ }
21
+ }
22
+ function t() {
23
+ var e = document.getElementById("eo-menu-btn"),
24
+ t = document.getElementById("eo-mobile-menu"),
25
+ a = document.getElementById("eo-mobile-overlay"),
26
+ n = document.getElementById("eo-mobile-close");
27
+ function r() {
28
+ t.classList.remove("ab-open"),
29
+ a && a.classList.remove("ab-open"),
30
+ (document.body.style.overflow = "");
31
+ }
32
+ e &&
33
+ t &&
34
+ !e.dataset.menuInit &&
35
+ ((e.dataset.menuInit = "1"),
36
+ e.addEventListener("click", function () {
37
+ t.classList.add("ab-open"),
38
+ a && a.classList.add("ab-open"),
39
+ (document.body.style.overflow = "hidden");
40
+ }),
41
+ n && n.addEventListener("click", r),
42
+ a && a.addEventListener("click", r),
43
+ t.querySelectorAll(".ab-mobile-nav > a").forEach(function (e) {
44
+ e.addEventListener("click", r);
45
+ }),
46
+ t.querySelectorAll(".ab-mobile-accordion-panel a").forEach(function (e) {
47
+ e.addEventListener("click", r);
48
+ }),
49
+ t.querySelectorAll(".ab-mobile-accordion-trigger").forEach(function (e) {
50
+ e.dataset.accordionInit ||
51
+ ((e.dataset.accordionInit = "1"),
52
+ e.addEventListener("click", function () {
53
+ var a = e.closest(".ab-mobile-accordion");
54
+ if (a) {
55
+ var n = a.classList.contains("ab-open");
56
+ t.querySelectorAll(".ab-mobile-accordion.ab-open").forEach(function (e) {
57
+ e !== a && e.classList.remove("ab-open");
58
+ }),
59
+ a.classList.toggle("ab-open", !n);
60
+ }
61
+ }));
62
+ }));
63
+ }
64
+ function a() {
65
+ document.querySelectorAll(".ab-plist").forEach(function (e) {
66
+ if (!e.dataset.scrollArrowInit) {
67
+ e.dataset.scrollArrowInit = "1";
68
+ var t = e.querySelector(".ab-plist-track"),
69
+ a = e.querySelector(".ab-plist-prev"),
70
+ n = e.querySelector(".ab-plist-next");
71
+ t &&
72
+ (a &&
73
+ a.addEventListener("click", function () {
74
+ t.scrollBy({ left: -r(), behavior: "smooth" });
75
+ }),
76
+ n &&
77
+ n.addEventListener("click", function () {
78
+ t.scrollBy({ left: r(), behavior: "smooth" });
79
+ }));
80
+ }
81
+ function r() {
82
+ var e = t.querySelector(".ab-plist-card");
83
+ if (!e) return 0.8 * t.clientWidth;
84
+ var a = getComputedStyle(t),
85
+ n = parseFloat(a.gap) || 16;
86
+ return e.offsetWidth + n;
87
+ }
88
+ });
89
+ }
90
+ function n() {
91
+ document.querySelectorAll(".ab-slider").forEach(function (e) {
92
+ if (!e.dataset.sliderInit) {
93
+ e.dataset.sliderInit = "1";
94
+ var t = e.querySelectorAll(".ab-slider-slide");
95
+ if (!(t.length < 2)) {
96
+ var a = e.querySelector(".ab-slider-progress-bar"),
97
+ n = e.querySelector(".ab-slider-pause"),
98
+ r = parseInt(e.dataset.autoplay) || 5e3,
99
+ o = 0,
100
+ i = !1,
101
+ c = 0,
102
+ l = null;
103
+ n &&
104
+ n.addEventListener("click", function () {
105
+ i
106
+ ? d()
107
+ : ((i = !0), e.classList.add("ab-paused"), l && cancelAnimationFrame(l));
108
+ }),
109
+ d();
110
+ }
111
+ }
112
+ function s(e) {
113
+ if (!i) {
114
+ var n,
115
+ d = e - c,
116
+ u = Math.min((d / r) * 100, 100);
117
+ a && (a.style.width = u + "%"),
118
+ d >= r &&
119
+ ((n = o + 1),
120
+ t[o].classList.remove("ab-active"),
121
+ (o = n % t.length),
122
+ t[o].classList.add("ab-active"),
123
+ (c = performance.now())),
124
+ (l = requestAnimationFrame(s));
125
+ }
126
+ }
127
+ function d() {
128
+ (i = !1),
129
+ e.classList.remove("ab-paused"),
130
+ (c = performance.now()),
131
+ (l = requestAnimationFrame(s));
132
+ }
133
+ });
134
+ }
135
+ function r() {
136
+ var e = document.querySelectorAll(".ab-reveal:not(.ab-observed)");
137
+ if (e.length) {
138
+ var t = new IntersectionObserver(
139
+ function (e) {
140
+ e.forEach(function (e) {
141
+ e.isIntersecting &&
142
+ (e.target.classList.add("ab-visible"), t.unobserve(e.target));
143
+ });
144
+ },
145
+ { threshold: 0.1 }
146
+ );
147
+ e.forEach(function (e) {
148
+ e.classList.add("ab-observed"), t.observe(e);
149
+ });
150
+ }
151
+ }
152
+ function runwayAnim() {
153
+ document.querySelectorAll("[data-section-anim]:not(.ab-anim-init)").forEach(function (h) {
154
+ h.classList.add("ab-anim-init");
155
+ if (!("IntersectionObserver" in window)) {
156
+ h.classList.add("ab-anim-visible");
157
+ return;
158
+ }
159
+ var io = new IntersectionObserver(function (entries) {
160
+ entries.forEach(function (entry) {
161
+ if (entry.isIntersecting) {
162
+ entry.target.classList.add("ab-anim-visible");
163
+ io.unobserve(entry.target);
164
+ }
165
+ });
166
+ }, { threshold: 0.15 });
167
+ io.observe(h);
168
+ });
169
+ }
170
+ function o() {
171
+ document.querySelectorAll(".ab-gallery").forEach(function (el) {
172
+ if (el.dataset.galleryInit) return;
173
+ el.dataset.galleryInit = "1";
174
+ var track = el.querySelector("[data-gallery-track]"),
175
+ slides = el.querySelectorAll(".ab-gallery-slide"),
176
+ dots = el.querySelectorAll(".ab-gallery-dot"),
177
+ srcs = [];
178
+ slides.forEach(function (s) {
179
+ if (s.dataset.src) srcs.push(s.dataset.src);
180
+ });
181
+ document.querySelectorAll("body > .ab-lightbox").forEach(function (e) {
182
+ e.remove();
183
+ });
184
+ var lb = el.querySelector("[data-lightbox]");
185
+ if (lb) document.body.appendChild(lb);
186
+ var lbImg = lb && lb.querySelector("[data-lightbox-img]"),
187
+ lbVideo = lb && lb.querySelector("[data-lightbox-video]"),
188
+ lbCnt = lb && lb.querySelector("[data-lightbox-counter]"),
189
+ idx = 0;
190
+ function isVideoSrc(u) {
191
+ if (!u) return false;
192
+ var p = u.split("?")[0].toLowerCase();
193
+ return p.endsWith(".mp4") || p.endsWith(".webm") || p.endsWith(".ogg");
194
+ }
195
+ function stopLbVideo() {
196
+ if (!lbVideo) return;
197
+ lbVideo.pause();
198
+ lbVideo.removeAttribute("src");
199
+ lbVideo.load();
200
+ lbVideo.style.display = "none";
201
+ }
202
+ function show(i) {
203
+ if (!srcs.length) return;
204
+ idx = ((i % srcs.length) + srcs.length) % srcs.length;
205
+ var url = srcs[idx];
206
+ if (isVideoSrc(url)) {
207
+ if (lbImg) { lbImg.removeAttribute("src"); lbImg.style.display = "none"; }
208
+ if (lbVideo) { lbVideo.style.display = "block"; lbVideo.src = url; lbVideo.play().catch(function(){}); }
209
+ } else {
210
+ stopLbVideo();
211
+ if (lbImg) { lbImg.style.display = ""; lbImg.src = url; }
212
+ }
213
+ if (lbCnt) lbCnt.textContent = idx + 1 + " / " + srcs.length;
214
+ }
215
+ slides.forEach(function (s) {
216
+ s.addEventListener("click", function () {
217
+ if (!lb) return;
218
+ var v = s.querySelector("video");
219
+ if (v) v.pause();
220
+ show(Number(s.dataset.slideIndex) || 0);
221
+ lb.classList.add("ab-open");
222
+ document.body.style.overflow = "hidden";
223
+ });
224
+ });
225
+ if (lb)
226
+ lb.addEventListener("click", function (e) {
227
+ var t = e.target;
228
+ if (t.closest("[data-lightbox-close]")) {
229
+ stopLbVideo();
230
+ lb.classList.remove("ab-open");
231
+ document.body.style.overflow = "";
232
+ return;
233
+ }
234
+ if (t.closest("[data-lightbox-prev]")) show(idx - 1);
235
+ else if (t.closest("[data-lightbox-next]")) show(idx + 1);
236
+ });
237
+ dots.forEach(function (d) {
238
+ d.addEventListener("click", function () {
239
+ var i = Number(d.dataset.dotIndex) || 0,
240
+ s = slides[i];
241
+ if (track && s)
242
+ track.scrollTo({ left: s.offsetLeft, behavior: "smooth" });
243
+ });
244
+ });
245
+ if (track && dots.length) {
246
+ var ticking = false;
247
+ track.addEventListener(
248
+ "scroll",
249
+ function () {
250
+ if (ticking) return;
251
+ ticking = true;
252
+ requestAnimationFrame(function () {
253
+ ticking = false;
254
+ var w = track.clientWidth;
255
+ if (!w) return;
256
+ var i = Math.round(track.scrollLeft / w);
257
+ dots.forEach(function (d, j) {
258
+ d.classList.toggle("ab-active", j === i);
259
+ });
260
+ });
261
+ },
262
+ { passive: true }
263
+ );
264
+ }
265
+ });
266
+ }
267
+ function i() {
268
+ document.querySelectorAll(".ab-reviews").forEach(function (e) {
269
+ e.getAttribute("data-reviews-init") ||
270
+ (e.setAttribute("data-reviews-init", "1"),
271
+ e.querySelectorAll("[data-review-comment]").forEach(function (e) {
272
+ var t = document.createElement("button");
273
+ (t.className = "ab-review-read-more"),
274
+ (t.type = "button"),
275
+ (t.textContent = "...Read more"),
276
+ e.parentNode.insertBefore(t, e.nextSibling),
277
+ requestAnimationFrame(function () {
278
+ e.scrollHeight > e.clientHeight + 2 && t.classList.add("ab-visible");
279
+ }),
280
+ t.addEventListener("click", function () {
281
+ e.classList.contains("ab-review-expanded")
282
+ ? (e.classList.remove("ab-review-expanded"),
283
+ (t.textContent = "...Read more"))
284
+ : (e.classList.add("ab-review-expanded"), (t.textContent = "Show less"));
285
+ });
286
+ }));
287
+ });
288
+ }
289
+ function c() {
290
+ for (
291
+ var e = document.querySelectorAll(".ab-fake-counter"), t = 0;
292
+ t < e.length;
293
+ t++
294
+ ) {
295
+ var a = e[t];
296
+ a.dataset.counterInit ||
297
+ ((a.dataset.counterInit = "1"),
298
+ (function (e) {
299
+ var t = e.dataset.productId || "",
300
+ a = 36e5 * (parseFloat(e.dataset.hours) || 1);
301
+ try {
302
+ var n = localStorage.getItem("counter-" + t);
303
+ n && Number(n) > 36e4 && (a = Number(n));
304
+ } catch (e) {}
305
+ var r = Date.now() + a,
306
+ o = e.querySelector('[data-unit="days"]'),
307
+ i = e.querySelector('[data-unit="hours"]'),
308
+ c = e.querySelector('[data-unit="minutes"]'),
309
+ l = e.querySelector('[data-unit="seconds"]');
310
+ function s(e) {
311
+ return e < 10 ? "0" + e : String(e);
312
+ }
313
+ !(function e() {
314
+ var a = Math.max(0, r - Date.now()),
315
+ n = Math.floor(a / 1e3),
316
+ d = Math.floor(n / 86400);
317
+ n -= 86400 * d;
318
+ var u = Math.floor(n / 3600);
319
+ n -= 3600 * u;
320
+ var v = Math.floor(n / 60);
321
+ (n -= 60 * v),
322
+ o && (o.textContent = s(d)),
323
+ i && (i.textContent = s(u)),
324
+ c && (c.textContent = s(v)),
325
+ l && (l.textContent = s(n));
326
+ try {
327
+ localStorage.setItem("counter-" + t, String(a));
328
+ } catch (e) {}
329
+ a > 0 &&
330
+ requestAnimationFrame(function () {
331
+ setTimeout(e, 1e3);
332
+ });
333
+ })();
334
+ })(a));
335
+ }
336
+ }
337
+ function l() {
338
+ for (
339
+ var e = document.querySelectorAll(".ab-fake-visitor"), t = 0;
340
+ t < e.length;
341
+ t++
342
+ ) {
343
+ var a = e[t];
344
+ a.dataset.visitorInit ||
345
+ ((a.dataset.visitorInit = "1"),
346
+ (function (e) {
347
+ var t = parseInt(e.dataset.min, 10) || 10,
348
+ a = parseInt(e.dataset.max, 10) || 50,
349
+ n = e.querySelector(".ab-fv-count");
350
+ function r() {
351
+ return Math.floor(Math.random() * (a - t + 1)) + t;
352
+ }
353
+ n &&
354
+ ((n.textContent = String(r())),
355
+ setInterval(function () {
356
+ n.textContent = String(r());
357
+ }, 3e3));
358
+ })(a));
359
+ }
360
+ }
361
+ function s() {
362
+ for (
363
+ var e = document.querySelectorAll(".lq-desc-accordion"), t = 0;
364
+ t < e.length;
365
+ t++
366
+ ) {
367
+ var a = e[t];
368
+ a.dataset.descInit ||
369
+ ((a.dataset.descInit = "1"),
370
+ a.addEventListener("click", function (e) {
371
+ var t = e.target.closest(".lq-desc-toggle");
372
+ if (t) {
373
+ var a = t.parentElement,
374
+ n = a.querySelector(".lq-desc-panel");
375
+ if (n)
376
+ "true" === a.getAttribute("data-open")
377
+ ? (a.removeAttribute("data-open"),
378
+ t.setAttribute("aria-expanded", "false"),
379
+ (n.style.display = "none"))
380
+ : (a.setAttribute("data-open", "true"),
381
+ t.setAttribute("aria-expanded", "true"),
382
+ (n.style.display = "block"));
383
+ }
384
+ }));
385
+ }
386
+ }
387
+ function u() {
388
+ document
389
+ .querySelectorAll('.ab-announce[data-ann-type="slider"]')
390
+ .forEach(function (e) {
391
+ if (!e.dataset.annSliderInit) {
392
+ e.dataset.annSliderInit = "1";
393
+ var t = e.querySelectorAll(".ab-ann-slide");
394
+ if (t.length < 2) return;
395
+ var a = 0;
396
+ setInterval(function () {
397
+ var n = t[a],
398
+ next = (a + 1) % t.length;
399
+ n.classList.remove("ab-active");
400
+ n.classList.add("ab-exit-left");
401
+ t[next].classList.add("ab-active");
402
+ setTimeout(function () {
403
+ n.classList.remove("ab-exit-left");
404
+ }, 500);
405
+ a = next;
406
+ }, 3e3);
407
+ }
408
+ });
409
+ }
410
+ function v() {
411
+ document.querySelectorAll(".ab-ann-marquee").forEach(function (e) {
412
+ if (!e.dataset.marqueeInit) {
413
+ e.dataset.marqueeInit = "1";
414
+ var t = e.querySelector(".ab-ann-marquee-track");
415
+ if (!t) return;
416
+ var isArabic = !!e.closest(".ab-announce--arabic");
417
+ var a = t.innerHTML,
418
+ n = t.scrollWidth,
419
+ r = e.offsetWidth;
420
+ if (n < 1) return;
421
+ var o = Math.ceil((2 * r) / n);
422
+ if (o < 2) o = 2;
423
+ t.innerHTML = "";
424
+ for (var i = 0; i < o; i++) t.insertAdjacentHTML("beforeend", a);
425
+ var c = t.scrollWidth / o,
426
+ l = Math.max(c / 40, 5);
427
+ t.style.setProperty("--marquee-dur", l + "s"),
428
+ t.style.setProperty("--marquee-offset", (isArabic ? c : -c) + "px"),
429
+ t.classList.add("ab-running");
430
+ }
431
+ });
432
+ }
433
+ function w() {
434
+ document.querySelectorAll(".ab-comparison-slider").forEach(function (slider) {
435
+ if (slider.dataset.compInit) return;
436
+ slider.dataset.compInit = "1";
437
+ var range = slider.querySelector(".ab-comp-range"),
438
+ before = slider.querySelector(".ab-before-image"),
439
+ handle = slider.querySelector(".ab-comp-handle");
440
+ if (!range || !before || !handle) return;
441
+ range.style.pointerEvents = "none";
442
+ function setPosition(val) {
443
+ var t = Math.max(0, Math.min(100, Number(val) || 0));
444
+ range.value = String(t);
445
+ before.style.clipPath = "inset(0 " + (100 - t) + "% 0 0)";
446
+ handle.style.left = t + "%";
447
+ handle.style.top = "";
448
+ handle.style.transform = "translateX(-50%)";
449
+ }
450
+ setPosition(Number(range.value) || 50);
451
+ range.addEventListener("input", function (ev) {
452
+ setPosition(ev.target.value);
453
+ });
454
+ function updateFromClient(clientX, clientY) {
455
+ var rect = slider.getBoundingClientRect();
456
+ if (rect.width <= 0 || rect.height <= 0) return;
457
+ var t = ((clientX - rect.left) / rect.width) * 100;
458
+ setPosition(t);
459
+ }
460
+ var dragPid = null;
461
+ handle.addEventListener("pointerdown", function (ev) {
462
+ if (ev.pointerType === "mouse" && ev.button !== 0) return;
463
+ dragPid = ev.pointerId;
464
+ try {
465
+ slider.setPointerCapture(ev.pointerId);
466
+ } catch (err) {}
467
+ updateFromClient(ev.clientX, ev.clientY);
468
+ });
469
+ slider.addEventListener("pointermove", function (ev) {
470
+ if (dragPid !== ev.pointerId) return;
471
+ updateFromClient(ev.clientX, ev.clientY);
472
+ });
473
+ function endDrag(ev) {
474
+ if (dragPid !== ev.pointerId) return;
475
+ try {
476
+ slider.releasePointerCapture(ev.pointerId);
477
+ } catch (err) {}
478
+ dragPid = null;
479
+ }
480
+ slider.addEventListener("pointerup", endDrag);
481
+ slider.addEventListener("pointercancel", endDrag);
482
+ });
483
+ }
484
+ function moveStockToAccordion() {
485
+ const stockElement = document.querySelector('.ab-fake-visitor');
486
+ const accordionElement = document.querySelector('.mt-5.flex.flex-col.flex-col-reverse.gap-3');
487
+
488
+ // غيرنا previous لـ next عشان نتأكد إنه مش موجود "بعد" العنصر بالفعل
489
+ if (stockElement && accordionElement && !accordionElement.nextElementSibling?.classList.contains('stock-moved')) {
490
+
491
+ stockElement.classList.add('stock-moved');
492
+
493
+ // الدالة دي بتحط العنصر بعد الـ accordionElement مباشرة
494
+ accordionElement.after(stockElement);
495
+
496
+ stockElement.style.marginTop = '8px';
497
+ }
498
+ }
499
+ function restructureCartCounter() {
500
+ document.querySelectorAll('.cart-item-quantity-counter').forEach((container) => {
501
+ if (container.querySelector('.qty-box-wrapper')) return;
502
+ const deleteBtn = container.querySelector('button.ms-2');
503
+ if (!deleteBtn) return;
504
+ const qtyWrapper = document.createElement('div');
505
+ qtyWrapper.className = 'qty-box-wrapper';
506
+ Array.from(container.childNodes).forEach(node => {
507
+ if (node !== deleteBtn) {
508
+ qtyWrapper.appendChild(node);
509
+ }
510
+ });
511
+ container.innerHTML = '';
512
+ container.appendChild(qtyWrapper);
513
+ container.appendChild(deleteBtn);
514
+ container.classList.add('flex-split-layout');
515
+ deleteBtn.classList.add('custom-trash-btn');
516
+ });
517
+ }
518
+ function syncArabicUiDirection() {
519
+ const el = document.getElementById("__NEXT_DATA__");
520
+ let lang = "en";
521
+ if (el) {
522
+ try {
523
+ const data = JSON.parse(el.textContent);
524
+ lang =
525
+ data?.props?.pageProps?.appSettings?.lang ||
526
+ data?.props?.pageProps?.locale ||
527
+ "en";
528
+ } catch (e) {}
529
+ }
530
+ lang = String(lang || "en")
531
+ .toLowerCase()
532
+ .split("-")[0];
533
+ const isArabic = lang === "ar";
534
+ document.documentElement.classList.toggle("ab-lang-ar", isArabic);
535
+ if (document.body) {
536
+ document.body.classList.toggle("ab-lang-ar", isArabic);
537
+ }
538
+ document.querySelectorAll(".ab-pd-star-half").forEach((star) => {
539
+ star.style.transform = isArabic ? "scaleX(-1)" : "";
540
+ star.style.transformOrigin = isArabic ? "center" : "";
541
+ });
542
+ document.querySelectorAll(".ab-footer-subscribe-btn svg").forEach((icon) => {
543
+ icon.style.transform = isArabic ? "scaleX(-1)" : "";
544
+ icon.style.transformOrigin = isArabic ? "center" : "";
545
+ });
546
+ document.querySelectorAll(".ab-mobile-nav > a svg").forEach((icon) => {
547
+ icon.style.transform = isArabic ? "scaleX(-1)" : "";
548
+ icon.style.transformOrigin = isArabic ? "center" : "";
549
+ });
550
+ }
551
+ function updateReviewTitle() {
552
+ const el = document.getElementById('__NEXT_DATA__');
553
+ if (!el) return;
554
+
555
+ let lang = 'en';
556
+ try {
557
+ const data = JSON.parse(el.textContent);
558
+ lang =
559
+ data?.props?.pageProps?.appSettings?.lang ||
560
+ data?.props?.pageProps?.locale ||
561
+ 'en';
562
+ } catch (e) {
563
+ console.error("Error parsing __NEXT_DATA__", e);
564
+ }
565
+ lang = String(lang || 'en').toLowerCase().split('-')[0];
566
+
567
+ const titles = {
568
+ 'ar': 'آراء لعملائنا',
569
+ 'fr': 'Véritables avis clients',
570
+ 'es': 'Opiniones reales',
571
+ 'en': 'Join our happy customers'
572
+ };
573
+ const verifiedLabels = {
574
+ 'ar': 'مشتري موثّق',
575
+ 'fr': 'Acheteur vérifié',
576
+ 'es': 'Comprador verificado',
577
+ 'en': 'Verified Buyer'
578
+ };
579
+ const addToCartLabels = {
580
+ 'ar': 'أضف إلى السلة',
581
+ 'fr': 'Ajouter au panier',
582
+ 'es': 'Agregar al carrito',
583
+ 'en': 'ADD TO CART'
584
+ };
585
+
586
+ const newTitle = titles[lang] || titles['en'];
587
+ const newVerifiedLabel = verifiedLabels[lang] || verifiedLabels['en'];
588
+ const newAddToCartLabel = addToCartLabels[lang] || addToCartLabels['en'];
589
+ const titleElement = document.querySelector('.ab-reviews-title');
590
+ if (titleElement && titleElement.innerText !== newTitle) {
591
+ titleElement.innerText = newTitle;
592
+ }
593
+ document.querySelectorAll('.verified-badge').forEach((badge) => {
594
+ if (badge.innerText !== newVerifiedLabel) {
595
+ badge.innerText = newVerifiedLabel;
596
+ }
597
+ });
598
+ document.querySelectorAll('.ab-pgrid-cta-label').forEach((label) => {
599
+ if (label.innerText !== newAddToCartLabel) {
600
+ label.innerText = newAddToCartLabel;
601
+ }
602
+ });
603
+ document.querySelectorAll('.ab-pgrid-cta').forEach((btn) => {
604
+ btn.setAttribute('aria-label', newAddToCartLabel);
605
+ });
606
+ }
607
+ function updateCartButtonText() {
608
+ const el = document.getElementById("__NEXT_DATA__");
609
+ let lang = "en";
610
+ if (el) {
611
+ try {
612
+ const data = JSON.parse(el.textContent);
613
+ lang =
614
+ data?.props?.pageProps?.appSettings?.lang ||
615
+ data?.props?.pageProps?.locale ||
616
+ "en";
617
+ } catch (e) {
618
+ console.error("Error parsing __NEXT_DATA__ for checkout locale", e);
619
+ }
620
+ }
621
+ lang = String(lang || "en")
622
+ .toLowerCase()
623
+ .split("-")[0];
624
+
625
+ const cartLabels = {
626
+ ar: "إتمام الشراء",
627
+ en: "CHECK OUT",
628
+ fr: "Payer",
629
+ es: "Finalizar compra",
630
+ };
631
+ const shippingNotes = {
632
+ ar: "يتم احتساب الشحن والخصم عند إتمام الطلب.",
633
+ en: "Shipping and discount calculated at checkout.",
634
+ fr: "Frais de port et remise calculés au paiement.",
635
+ es: "Envío y descuento calculados al finalizar la compra.",
636
+ };
637
+
638
+ const cartText = cartLabels[lang] || cartLabels.en;
639
+ const shippingText = shippingNotes[lang] || shippingNotes.en;
640
+
641
+ const cartButton = document.querySelector(
642
+ ".bg-white.shadow-xl button.bg-skin-primary"
643
+ );
644
+ if (cartButton && cartButton.innerText.trim() !== cartText) {
645
+ cartButton.innerText = cartText;
646
+ cartButton.setAttribute("data-translated", "true");
647
+ }
648
+
649
+ document.documentElement.style.setProperty(
650
+ "--ab-checkout-shipping-note",
651
+ JSON.stringify(shippingText)
652
+ );
653
+ }
654
+ function wrapVariants() {
655
+ // العثور على كل حاويات معلومات المنتج
656
+ const itemInfoContainers = document.querySelectorAll('[data-cart="item-info"]');
657
+
658
+ itemInfoContainers.forEach(container => {
659
+ // التحقق مما إذا كان قد تم التغليف بالفعل لمنع التكرار
660
+ if (container.querySelector('.variants-wrapper')) return;
661
+
662
+ // العثور على كل الـ variants داخل هذه الحاوية
663
+ const variants = container.querySelectorAll('[data-cart="item-variant"]');
664
+
665
+ if (variants.length > 0) {
666
+ // إنشاء الحاوية الجديدة
667
+ const wrapper = document.createElement('div');
668
+ wrapper.className = 'variants-wrapper';
669
+
670
+ // نقل الـ variants إلى الحاوية الجديدة
671
+ variants.forEach(variant => {
672
+ wrapper.appendChild(variant);
673
+ });
674
+
675
+ // إضافة الحاوية الجديدة داخل الـ item-info بعد الـ header
676
+ const header = container.querySelector('[data-cart="item-header"]');
677
+ if (header) {
678
+ header.after(wrapper);
679
+ } else {
680
+ container.prepend(wrapper);
681
+ }
682
+ }
683
+ });
684
+ }
685
+ function filterProductByCategory() {
686
+ function b(el) {
687
+ var wrap = el.closest("[data-eo-api-base]");
688
+ if (wrap && wrap.getAttribute("data-eo-api-base")) {
689
+ return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
690
+ }
691
+ if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__) {
692
+ return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
693
+ }
694
+ return EO_STORE_API_FALLBACK;
695
+ }
696
+ document.querySelectorAll("a[data-eo-hs-cta]:not([data-eo-hs-cta-done])").forEach(function (a) {
697
+ var id = String(a.getAttribute("data-eo-hs-cta-id") || "").trim();
698
+ var entity = a.getAttribute("data-eo-hs-cta-entity") || "";
699
+ a.setAttribute("data-eo-hs-cta-done", "1");
700
+ if (!id) return;
701
+ var base = b(a);
702
+ var path =
703
+ entity === "categories"
704
+ ? "categories"
705
+ : entity === "pages"
706
+ ? "simple-pages"
707
+ : "products";
708
+ var url =
709
+ base.replace(/\/$/, "") +
710
+ "/" +
711
+ path +
712
+ "?filter=id||$in||" + id + "&limit=1";
713
+ fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
714
+ .then(function (res) {
715
+ return res.ok ? res.json() : Promise.reject(new Error(String(res.status)));
716
+ })
717
+ .then(function (body) {
718
+ var rows = Array.isArray(body) ? body : body && Array.isArray(body.data) ? body.data : [];
719
+ var row = rows[0];
720
+ if (!row) return;
721
+ var slug = row.slug || "";
722
+ if (entity === "categories" && slug) a.href = "/collections/" + encodeURIComponent(slug);
723
+ else if (entity === "pages" && slug) a.href = "/pages/" + encodeURIComponent(slug);
724
+ else if (entity === "products" && slug) a.href = "/products/" + encodeURIComponent(slug);
725
+ })
726
+ .catch(function () {});
727
+ });
728
+ }
729
+ filterProductByCategory();
730
+
731
+ var __eoHsCurrency = "";
732
+ function detectCurrency() {
733
+ if (__eoHsCurrency) return __eoHsCurrency;
734
+ try {
735
+ var nd = document.getElementById("__NEXT_DATA__");
736
+ if (nd) {
737
+ var j = JSON.parse(nd.textContent);
738
+ var s = j && j.props && j.props.pageProps && j.props.pageProps.appSettings;
739
+ if (s && s.currency_symbol) { __eoHsCurrency = s.currency_symbol; return __eoHsCurrency; }
740
+ }
741
+ } catch (e) {}
742
+ var priceEl = document.querySelector(".ab-pgrid-price, .ab-pd-price, .ab-plist-price, .ab-featured-price, .ab-price-old");
743
+ if (priceEl) {
744
+ var txt = (priceEl.textContent || "").replace(/[\d,.\s]/g, "").trim();
745
+ if (txt) { __eoHsCurrency = txt; return __eoHsCurrency; }
746
+ }
747
+ return "";
748
+ }
749
+
750
+ function fetchHsSectionProducts() {
751
+ function apiBase(el) {
752
+ var wrap = el.closest("[data-eo-api-base]");
753
+ if (wrap && wrap.getAttribute("data-eo-api-base"))
754
+ return wrap.getAttribute("data-eo-api-base").replace(/\/$/, "");
755
+ if (typeof window.__EO_STORE_API_BASE__ === "string" && window.__EO_STORE_API_BASE__)
756
+ return window.__EO_STORE_API_BASE__.replace(/\/$/, "");
757
+ return EO_STORE_API_FALLBACK;
758
+ }
759
+ var containers = document.querySelectorAll("[data-eo-hs-ids]:not([data-eo-hs-fetched])");
760
+ if (!containers.length) return;
761
+ var cur = detectCurrency();
762
+ containers.forEach(function (container) {
763
+ var ids = (container.getAttribute("data-eo-hs-ids") || "").trim();
764
+ if (!ids) return;
765
+ container.setAttribute("data-eo-hs-fetched", "1");
766
+ var mount = container.querySelector("[data-eo-hs-mount]");
767
+ if (!mount) return;
768
+ mount.classList.add("eo-hs-loading");
769
+ var base = apiBase(container);
770
+ var entity = container.getAttribute("data-eo-hs-entity") || "products";
771
+ var path = entity === "categories" ? "categories" : "products";
772
+ var url = base + "/" + path + "?filter=id||$in||" + ids + "&limit=20";
773
+ fetch(url, { credentials: "omit", headers: { Accept: "application/json" } })
774
+ .then(function (res) { return res.ok ? res.json() : Promise.reject(res.status); })
775
+ .then(function (body) {
776
+ var rows = Array.isArray(body) ? body : body && Array.isArray(body.data) ? body.data : [];
777
+ if (!rows.length) {
778
+ mount.innerHTML = '<p class="eo-hs-error">No products found.</p>';
779
+ return;
780
+ }
781
+ var html = "";
782
+ rows.forEach(function (p) {
783
+ var slug = p.slug || "";
784
+ var name = p.name || "";
785
+ var thumb = p.thumb || (p.images && p.images[0]) || "";
786
+ var price = p.sale_price && p.sale_price < p.price ? p.sale_price : p.price || 0;
787
+ var oldPrice = p.sale_price && p.sale_price < p.price ? p.price : 0;
788
+ var currency = cur || p.currency || "";
789
+ var mediaHtml = thumb
790
+ ? '<div class="eo-hs-card__media"><img src="' + thumb + '" alt="' + name.replace(/"/g, "&quot;") + '" loading="lazy" width="320" height="400" style="width:100%;height:100%;object-fit:cover;display:block;" /></div>'
791
+ : '<div class="eo-hs-card__media eo-hs-card__media--empty"></div>';
792
+ var priceHtml = '<span class="eo-hs-card__meta">';
793
+ if (oldPrice) {
794
+ priceHtml += '<del style="opacity:0.55;margin-inline-end:4px">' + oldPrice + " " + currency + "</del> ";
795
+ }
796
+ priceHtml += price + " " + currency + "</span>";
797
+ html +=
798
+ '<a class="eo-hs-card--product" href="/products/' + encodeURIComponent(slug) + '">' +
799
+ mediaHtml +
800
+ '<div class="eo-hs-card__body">' +
801
+ '<span class="eo-hs-card__title">' + name + "</span>" +
802
+ priceHtml +
803
+ "</div></a>";
804
+ });
805
+ mount.innerHTML = html;
806
+ mount.classList.remove("eo-hs-loading");
807
+ if (typeof initFormatPrices === "function") initFormatPrices();
808
+ })
809
+ .catch(function () {
810
+ mount.innerHTML = '<p class="eo-hs-error">Failed to load products.</p>';
811
+ mount.classList.remove("eo-hs-loading");
812
+ });
813
+ });
814
+ }
815
+ function initIOSHoverFix() {
816
+ if (!("ontouchstart" in window)) return;
817
+ document.querySelectorAll('.ab-pgrid-card:not([data-ios-fix]), .ab-plist-card:not([data-ios-fix]), .ab-featured-card:not([data-ios-fix]), .ab-pgrid-card-link:not([data-ios-fix])').forEach(function(card) {
818
+ card.dataset.iosFix = "1";
819
+ var isScrolling = false;
820
+
821
+ card.addEventListener("touchstart", function() {
822
+ isScrolling = false;
823
+ }, {passive: true});
824
+
825
+ card.addEventListener("touchmove", function() {
826
+ isScrolling = true;
827
+ }, {passive: true});
828
+
829
+ card.addEventListener("touchend", function(e) {
830
+ if (isScrolling) return;
831
+ if (!e.target.closest("button") && !e.target.closest(".ab-card-actions")) {
832
+ e.preventDefault();
833
+ var link = card.tagName === "A" ? card : card.querySelector("a[href]");
834
+ if (link && typeof link.click === "function") link.click();
835
+ else card.click();
836
+ }
837
+ });
838
+ });
839
+ }
840
+ function initZoomParallax() {
841
+ const sections = document.querySelectorAll('.zp-section:not([data-zp-init])');
842
+ sections.forEach(sec => {
843
+ sec.dataset.zpInit = '1';
844
+
845
+ const center = sec.querySelector('.zp-img-center');
846
+ const tl = sec.querySelector('.zp-img-tl');
847
+ const tr = sec.querySelector('.zp-img-tr');
848
+ const bl = sec.querySelector('.zp-img-bl');
849
+ const br = sec.querySelector('.zp-img-br');
850
+
851
+ let ticking = false;
852
+
853
+ function onScroll() {
854
+ const rect = sec.getBoundingClientRect();
855
+ const viewHeight = window.innerHeight;
856
+
857
+ let progress = -rect.top / (rect.height - viewHeight);
858
+ if (progress < 0) progress = 0;
859
+ if (progress > 1) progress = 1;
860
+
861
+ if (center) center.style.transform = `scale(${1 + progress * 3})`;
862
+ if (tl) tl.style.transform = `scale(${1 + progress * 4})`;
863
+ if (tr) tr.style.transform = `scale(${1 + progress * 5})`;
864
+ if (bl) bl.style.transform = `scale(${1 + progress * 7})`;
865
+ if (br) br.style.transform = `scale(${1 + progress * 8})`;
866
+ }
867
+
868
+ window.addEventListener('scroll', () => {
869
+ if (!ticking) {
870
+ window.requestAnimationFrame(() => {
871
+ onScroll();
872
+ ticking = false;
873
+ });
874
+ ticking = true;
875
+ }
876
+ }, { passive: true });
877
+
878
+ onScroll();
879
+ });
880
+ }
881
+ initZoomParallax();
882
+ fetchHsSectionProducts();
883
+ initIOSHoverFix();
884
+ wrapVariants();
885
+ updateCartButtonText();
886
+ syncArabicUiDirection();
887
+ updateReviewTitle();
888
+ moveStockToAccordion();
889
+ restructureCartCounter();
890
+ e(),
891
+ t(),
892
+ a(),
893
+ n(),
894
+ r(),
895
+ runwayAnim(),
896
+ o(),
897
+ u(),
898
+ v(),
899
+ w(),
900
+ window.__abGalleryKeyInit ||
901
+ ((window.__abGalleryKeyInit = !0),
902
+ document.addEventListener("keydown", function (e) {
903
+ var t = document.querySelector("body > .ab-lightbox.ab-open");
904
+ if (t) {
905
+ if ("Escape" === e.key) {
906
+ var vEl = t.querySelector("[data-lightbox-video]");
907
+ if (vEl) { vEl.pause(); vEl.removeAttribute("src"); vEl.load(); vEl.style.display = "none"; }
908
+ t.classList.remove("ab-open");
909
+ document.body.style.overflow = "";
910
+ return;
911
+ }
912
+ if ("ArrowLeft" !== e.key)
913
+ if ("ArrowRight" !== e.key);
914
+ else {
915
+ var a = t.querySelector("[data-lightbox-next]");
916
+ a && a.click();
917
+ }
918
+ else {
919
+ var n = t.querySelector("[data-lightbox-prev]");
920
+ n && n.click();
921
+ }
922
+ }
923
+ })),
924
+ i(),
925
+ c(),
926
+ l(),
927
+ s(),
928
+ new MutationObserver(function () {
929
+ e(), t(), a(), n(), r(), runwayAnim(), o(), u(), v(), w(), i(), c(), l(), s();moveStockToAccordion();restructureCartCounter();syncArabicUiDirection();updateReviewTitle();updateCartButtonText();wrapVariants();filterProductByCategory();fetchHsSectionProducts();initIOSHoverFix();initZoomParallax();
930
+ }).observe(document.body, { childList: !0, subtree: !0 });
931
+ })();
932
+
933
+ /* ── Fixed Buy Button: reveal after 10% scroll on mobile ── */
934
+ !(function () {
935
+ var MOBILE_MQ = "(max-width: 768px)";
936
+ var CLASS_SHOW = "show-btn";
937
+ var ticking = false;
938
+
939
+ function update() {
940
+ ticking = false;
941
+ var el = document.querySelector(".ab-fixed-buy");
942
+ if (!el) return;
943
+
944
+ if (!window.matchMedia(MOBILE_MQ).matches) {
945
+ el.classList.remove(CLASS_SHOW);
946
+ return;
947
+ }
948
+
949
+ var doc = document.documentElement;
950
+ var scrollable = (doc.scrollHeight || document.body.scrollHeight) - window.innerHeight;
951
+ if (scrollable <= 0) {
952
+ el.classList.remove(CLASS_SHOW);
953
+ return;
954
+ }
955
+
956
+ var y = window.pageYOffset || doc.scrollTop;
957
+ var threshold = scrollable * 0.3;
958
+
959
+ if (y > threshold) {
960
+ el.classList.add(CLASS_SHOW);
961
+ } else {
962
+ el.classList.remove(CLASS_SHOW);
963
+ }
964
+ }
965
+
966
+ function onScroll() {
967
+ if (ticking) return;
968
+ ticking = true;
969
+ window.requestAnimationFrame(update);
970
+ }
971
+
972
+ window.addEventListener("scroll", onScroll, { passive: true });
973
+ window.addEventListener("resize", onScroll, { passive: true });
974
+ window.addEventListener("load", update);
975
+ update();
976
+ })();
977
+
978
+ /* ── Footer details: mobile accordion, desktop/tablet always open ── */
979
+ !(function () {
980
+ var FOOTER_MQ = "(min-width: 768px)";
981
+
982
+ function syncFooterDetails() {
983
+ var isWide = window.matchMedia(FOOTER_MQ).matches,
984
+ items = document.querySelectorAll(".ab-footer .ab-footer-details");
985
+ if (!items.length) return !1;
986
+ items.forEach(function (el) {
987
+ if (isWide) el.setAttribute("open", "");
988
+ else el.removeAttribute("open");
989
+ });
990
+ return !0;
991
+ }
992
+
993
+ function syncFooterWhenReady(attempt) {
994
+ if (syncFooterDetails()) return;
995
+ attempt < 40 &&
996
+ setTimeout(function () {
997
+ syncFooterWhenReady(attempt + 1);
998
+ }, 50);
999
+ }
1000
+
1001
+ if (document.readyState === "loading") {
1002
+ document.addEventListener("DOMContentLoaded", function () {
1003
+ syncFooterWhenReady(0);
1004
+ });
1005
+ } else {
1006
+ syncFooterWhenReady(0);
1007
+ }
1008
+
1009
+ window.addEventListener("load", function () {
1010
+ syncFooterWhenReady(0);
1011
+ });
1012
+ window.addEventListener("resize", syncFooterDetails, { passive: true });
1013
+ var mq = window.matchMedia(FOOTER_MQ);
1014
+ if (mq.addEventListener) mq.addEventListener("change", syncFooterDetails);
1015
+ else mq.onchange = syncFooterDetails;
1016
+ })();
1017
+
1018
+ const initFormatPrices = () => {
1019
+ const formatPrices = () => {
1020
+ const priceSelectors = [
1021
+ '.ab-price-old',
1022
+ '.ab-plist-price',
1023
+ '.ab-pgrid-price',
1024
+ '.ab-pd-price',
1025
+ '.ab-pd-price-old',
1026
+ '.ab-fixed-buy-price',
1027
+ '.ab-fixed-buy-price-old',
1028
+ '.ab-featured-price',
1029
+ '.eo-hs-card__meta',
1030
+ '.shop-the-look__pick-price',
1031
+ '.ab-invoice-item-unit-price',
1032
+ '.ab-invoice-item-total',
1033
+ '.ab-invoice-totals dd',
1034
+ '.total_price',
1035
+ '[data-cart="item-price"]',
1036
+ '[data-invoice="invoice-subtotal-value"]',
1037
+ '.shipping_cost',
1038
+ '[data-invoice="invoice-total-value"]',
1039
+ 'p[class~="flex"][class*="text-gray-500"][class*="items-center"][class*="gap-0.5"]',
1040
+ 'div[class~="flex"][class~="items-center"][class~="gap-2.5"][class*="mt-3"] span[class~="flex"][class~="items-center"][class~="gap-1"]',
1041
+ 'div[class~="flex"][class~="items-center"][class~="gap-2.5"][class*="mt-3"] del[class~="flex"][class~="items-center"][class~="gap-1"]'
1042
+ ].join(', ');
1043
+
1044
+ document.querySelectorAll(priceSelectors).forEach(el => {
1045
+
1046
+ const walkTextNodes = (node) => {
1047
+ if (node.nodeType === Node.TEXT_NODE) {
1048
+ let text = node.textContent;
1049
+ const matches = text.match(/\d{4,}(\.\d+)?/g);
1050
+ if (matches) {
1051
+ let updated = false;
1052
+ matches.forEach(match => {
1053
+ const num = parseFloat(match);
1054
+ if (!isNaN(num)) {
1055
+ const formattedNum = num.toLocaleString('en-US');
1056
+ text = text.replace(match, formattedNum);
1057
+ updated = true;
1058
+ }
1059
+ });
1060
+ if (updated) node.textContent = text;
1061
+ }
1062
+ } else if (node.nodeType === Node.ELEMENT_NODE) {
1063
+ node.childNodes.forEach(walkTextNodes);
1064
+ }
1065
+ };
1066
+
1067
+ walkTextNodes(el);
1068
+ });
1069
+ };
1070
+
1071
+ formatPrices();
1072
+
1073
+ const observer = new MutationObserver((mutations) => {
1074
+ let shouldFormat = false;
1075
+ for (const m of mutations) {
1076
+ if (m.addedNodes.length > 0 || m.type === 'characterData') {
1077
+ shouldFormat = true;
1078
+ break;
1079
+ }
1080
+ }
1081
+ if (shouldFormat) formatPrices();
1082
+ });
1083
+
1084
+ observer.observe(document.body, {
1085
+ childList: true,
1086
+ subtree: true,
1087
+ characterData: true
1088
+ });
1089
+ };
1090
+
1091
+ if (document.readyState === 'loading') {
1092
+ document.addEventListener('DOMContentLoaded', initFormatPrices);
1093
+ } else {
1094
+ initFormatPrices();
1095
+ }