1(() => { 2 'use strict'; 3 var t = { 4 en: { 5 sortLabel: 'Sort by:', 6 default: 'Default sorting', 7 'title-asc': 'Sort by name (A-Z)', 8 'title-desc': 'Sort by name (Z-A)', 9 'date-desc': 'Sort by latest', 10 }, 11 it: { 12 sortLabel: 'Ordina per:', 13 default: 'Ordinamento predefinito', 14 'title-asc': 'Ordina per nome (A-Z)', 15 'title-desc': 'Ordina per nome (Z-A)', 16 'date-desc': 'Ordina per ultimi', 17 }, 18 fr: { 19 sortLabel: 'Trier par:', 20 default: 'Tri par défaut', 21 'title-asc': 'Trier par nom (A-Z)', 22 'title-desc': 'Trier par nom (Z-A)', 23 'date-desc': 'Trier par plus récent', 24 }, 25 es: { 26 sortLabel: 'Ordenar por:', 27 default: 'Orden por defecto', 28 'title-asc': 'Ordenar por nombre (A-Z)', 29 'title-desc': 'Ordenar por nombre (Z-A)', 30 'date-desc': 'Ordenar por más recientes', 31 }, 32 }; 33 function e() { 34 var t, 35 n, 36 o = 'function' == typeof Symbol ? Symbol : {}, 37 a = o.iterator || '@@iterator', 38 i = o.toStringTag || '@@toStringTag'; 39 function c(e, o, a, i) { 40 var c = o && o.prototype instanceof s ? o : s, 41 l = Object.create(c.prototype); 42 return ( 43 r( 44 l, 45 '_invoke', 46 (function (e, r, o) { 47 var a, 48 i, 49 c, 50 s = 0, 51 l = o || [], 52 d = !1, 53 f = { 54 p: 0, 55 n: 0, 56 v: t, 57 a: p, 58 f: p.bind(t, 4), 59 d: function (e, r) { 60 return ((a = e), (i = 0), (c = t), (f.n = r), u); 61 }, 62 }; 63 function p(e, r) { 64 for (i = e, c = r, n = 0; !d && s && !o && n < l.length; n++) { 65 var o, 66 a = l[n], 67 p = f.p, 68 g = a[2]; 69 e > 3 70 ? (o = g === r) && 71 ((c = a[(i = a[4]) ? 5 : ((i = 3), 3)]), (a[4] = a[5] = t)) 72 : a[0] <= p && 73 ((o = e < 2 && p < a[1]) 74 ? ((i = 0), (f.v = r), (f.n = a[1])) 75 : p < g && 76 (o = e < 3 || a[0] > r || r > g) && 77 ((a[4] = e), (a[5] = r), (f.n = g), (i = 0))); 78 } 79 if (o || e > 1) return u; 80 throw ((d = !0), r); 81 } 82 return function (o, l, g) { 83 if (s > 1) throw TypeError('Generator is already running'); 84 for ( 85 d && 1 === l && p(l, g), i = l, c = g; 86 (n = i < 2 ? t : c) || !d; 87 88 ) { 89 a || 90 (i 91 ? i < 3 92 ? (i > 1 && (f.n = -1), p(i, c)) 93 : (f.n = c) 94 : (f.v = c)); 95 try { 96 if (((s = 2), a)) { 97 if ((i || (o = 'next'), (n = a[o]))) { 98 if (!(n = n.call(a, c))) 99 throw TypeError('iterator result is not an object'); 100 if (!n.done) return n; 101 ((c = n.value), i < 2 && (i = 0)); 102 } else 103 (1 === i && (n = a.return) && n.call(a), 104 i < 2 && 105 ((c = TypeError( 106 "The iterator does not provide a '" + 107 o + 108 "' method", 109 )), 110 (i = 1))); 111 a = t; 112 } else if ((n = (d = f.n < 0) ? c : e.call(r, f)) !== u) 113 break; 114 } catch (e) { 115 ((a = t), (i = 1), (c = e)); 116 } finally { 117 s = 1; 118 } 119 } 120 return { value: n, done: d }; 121 }; 122 })(e, a, i), 123 !0, 124 ), 125 l 126 ); 127 } 128 var u = {}; 129 function s() {} 130 function l() {} 131 function d() {} 132 n = Object.getPrototypeOf; 133 var f = [][a] 134 ? n(n([][a]())) 135 : (r((n = {}), a, function () { 136 return this; 137 }), 138 n), 139 p = (d.prototype = s.prototype = Object.create(f)); 140 function g(t) { 141 return ( 142 Object.setPrototypeOf 143 ? Object.setPrototypeOf(t, d) 144 : ((t.__proto__ = d), r(t, i, 'GeneratorFunction')), 145 (t.prototype = Object.create(p)), 146 t 147 ); 148 } 149 return ( 150 (l.prototype = d), 151 r(p, 'constructor', d), 152 r(d, 'constructor', l),
153 (l.displayName = 'GeneratorFunction'), 154 r(d, i, 'GeneratorFunction'), 155 r(p), 156 r(p, i, 'Generator'), 157 r(p, a, function () { 158 return this; 159 }), 160 r(p, 'toString', function () { 161 return '[object Generator]'; 162 }), 163 (e = function () { 164 return { w: c, m: g }; 165 })() 166 ); 167 } 168 function r(t, e, n, o) { 169 var a = Object.defineProperty; 170 try { 171 a({}, '', {}); 172 } catch (t) { 173 a = 0; 174 } 175 ((r = function (t, e, n, o) { 176 function i(e, n) { 177 r(t, e, function (t) { 178 return this._invoke(e, n, t); 179 }); 180 } 181 e 182 ? a 183 ? a(t, e, { 184 value: n, 185 enumerable: !o, 186 configurable: !o, 187 writable: !o, 188 }) 189 : (t[e] = n) 190 : (i('next', 0), i('throw', 1), i('return', 2)); 191 }), 192 r(t, e, n, o)); 193 } 194 function n(t, e, r, n, o, a, i) { 195 try { 196 var c = t[a](i), 197 u = c.value; 198 } catch (t) { 199 return void r(t); 200 } 201 c.done ? e(u) : Promise.resolve(u).then(n, o); 202 } 203 function o(t) { 204 return ( 205 (o = 206 'function' == typeof Symbol && 'symbol' == typeof Symbol.iterator 207 ? function (t) { 208 return typeof t; 209 } 210 : function (t) { 211 return t && 212 'function' == typeof Symbol && 213 t.constructor === Symbol && 214 t !== Symbol.prototype 215 ? 'symbol' 216 : typeof t; 217 }), 218 o(t) 219 ); 220 } 221 !(function () { 222 var r = null, 223 a = /^[a-z0-9_-]+$/i, 224 i = /^[a-z0-9/_-]+$/i, 225 c = [ 226 'data:image/png', 227 'data:image/jpeg', 228 'data:image/jpg', 229 'data:image/gif', 230 'data:image/webp', 231 'data:image/svg+xml', 232 ], 233 u = new WeakMap(), 234 s = new WeakMap(); 235 function l() { 236 return Object.create(null); 237 } 238 function d(t) { 239 var e = parseInt(t, 10); 240 return Number.isNaN(e) || e < 1 ? null : e; 241 } 242 function f(t) { 243 if ('string' != typeof t) return null; 244 var e = (function (t) { 245 try { 246 return decodeURIComponent(t); 247 } catch (e) { 248 return t; 249 } 250 })(t.trim()); 251 return e && i.test(e) ? e : null; 252 } 253 function p(t) { 254 if (!t || !t[0]) return new Set(); 255 var e = t[0]; 256 if (u.has(e)) return u.get(e); 257 var r = new Set(); 258 return ( 259 t.find('input[data-purpose="category"]').each(function (t, e) { 260 var n = (e.getAttribute('category') || '').trim(); 261 a.test(n) && r.add(n); 262 }), 263 u.set(e, r), 264 r 265 ); 266 } 267 function g(t) { 268 if (!t || !t[0]) return new Map(); 269 var e = t[0]; 270 if (s.has(e)) return s.get(e); 271 var r = new Map(); 272 return ( 273 t.find('.product-listing__sort__option').each(function (t, e) { 274 var n = (e.getAttribute('data-field') || '').trim().toLowerCase(), 275 o = (e.getAttribute('data-value') || '').trim().toUpperCase(); 276 a.test(n) && o && (r.has(n) || r.set(n, new Set()), r.get(n).add(o)); 277 }), 278 s.set(e, r), 279 r 280 ); 281 } 282 function h(t, e) { 283 var r = l(); 284 return t && 'object' === o(t) 285 ? (Object.keys(t).forEach(function (n) { 286 if (e.has(n) && a.test(n)) { 287 var o = t[n]; 288 if (Array.isArray(o)) { 289 var i = new Set(); 290 (o.forEach(function (t) { 291 var e = f('string' == typeof t ? t : String(t)); 292 e && i.add(e); 293 }), 294 i.size > 0 && (r[n] = Array.from(i))); 295 } 296 } 297 }), 298 r) 299 : r; 300 } 301 function v(t, e) { 302 var r = l(); 303 return ( 304 t.forEach(function (t, n) { 305 if (e.has(n) && t) { 306 var o = t.split(','), 307 a = new Set(); 308 (o.forEach(function (t) { 309 var e = f(t); 310 e && a.add(e); 311 }), 312 a.size > 0 && (r[n] = Array.from(a))); 313 } 314 }), 315 r 316 ); 317 } 318 function y(t, e, r) { 319 e.forEach(function (e) { 320 var n = r[e]; 321 n && n.length > 0 ? t.set(e, n.join(',')) : t.delete(e); 322 }); 323 } 324 function w(t, e) { 325 if (!t || 'object' !== o(t)) return null; 326 var r = t.field, 327 n = t.value; 328 if ('string' != typeof r || 'string' != typeof n) return null; 329 var i = r.trim().toLowerCase(), 330 c = n.trim().toUpperCase(); 331 if (!a.test(i)) return null; 332 var u = e.get(i); 333 if (!u || !u.has(c)) return null; 334 var s = l(); 335 return ((s[i] = c), { field: i, value: c, payload: s }); 336 } 337 function m(t, e) { 338 var r = null; 339 return ( 340 t.forEach(function (t, n) { 341 if (!r && n.startsWith('sort[')) { 342 var o = n.match(/^sort\[(.*?)]$/); 343 o && (r = w({ field: o[1], value: t }, e)); 344 } 345 }), 346 r 347 ); 348 } 349 function b(t) { 350 var e = []; 351 (t.forEach(function (t, r) { 352 r.startsWith('sort[') && e.push(r); 353 }), 354 e.forEach(function (e) { 355 t.delete(e); 356 })); 357 } 358 function _(t) { 359 if ('string' != typeof t) return ''; 360 var e = document.createElement('template'); 361 return ( 362 (e.innerHTML = t), 363 ['script', 'iframe', 'object', 'embed'].forEach(function (t) { 364 e.content.querySelectorAll(t).forEach(function (t) { 365 return t.remove(); 366 }); 367 }), 368 e.content.querySelectorAll('*').forEach(function (t) {
369 Array.from(t.attributes).forEach(function (e) { 370 var r = e.name.toLowerCase(), 371 n = e.value; 372 if (r.startsWith('on')) t.removeAttribute(e.name); 373 else if (/^(href|src|xlink:href)$/.test(r) && n) { 374 var o = n.trim().toLowerCase(), 375 a = o.startsWith('javascript:') || o.startsWith('vbscript:'), 376 i = 377 o.startsWith('data:') && 378 !c.some(function (t) { 379 return o.startsWith(t); 380 }); 381 (a || i) && t.removeAttribute(e.name); 382 } 383 }); 384 }), 385 e.innerHTML 386 ); 387 } 388 function P(t) { 389 for (var e = document.cookie.split(';'), r = 0; r < e.length; r++) { 390 var n = e[r].split('='); 391 if (t === n[0].trim()) return decodeURIComponent(n[1]); 392 } 393 return null; 394 } 395 function j() { 396 if (null === P('wp-wpml_current_language')) 397 return (document.documentElement.lang || 'en').split('-')[0]; 398 var t = P('wp-wpml_current_language'); 399 return ( 400 t || 401 (t = (function () { 402 var t = window.location.pathname.split('/'), 403 e = null; 404 return ( 405 !t[1] || (2 !== t[1].length && 5 !== t[1].length) || (e = t[1]), 406 e 407 ); 408 })()), 409 t || 'en' 410 ); 411 } 412 function S(e, r) { 413 var n, 414 o, 415 a, 416 i = 417 (null === (n = t[e]) || void 0 === n ? void 0 : n.sortLabel) || 418 t.en.sortLabel, 419 c = 420 (null === (o = t[e]) || void 0 === o ? void 0 : o[r]) || 421 (null === (a = t[e]) || void 0 === a ? void 0 : a.default) || 422 t.en.default; 423 jQuery('.product-listing__sort') 424 .contents() 425 .first() 426 .replaceWith(''.concat(i, ' ').concat(c, ' ')); 427 } 428 function C() { 429 var t, e; 430 return ( 431 new URLSearchParams(window.location.search).forEach(function (r, n) { 432 n.startsWith('sort[') && 433 ((t = n.match(/\[(.*?)]/)[1]), a.test(t) && (e = r.toLowerCase())); 434 }), 435 t && e ? ''.concat(t, '-').concat(e) : 'default' 436 ); 437 } 438 function k() { 439 var t = new URLSearchParams(window.location.search), 440 e = !1; 441 return ( 442 t.forEach(function (t, r) { 443 r.includes('sort') || 'p' === r || 'lang' === r || (e = !0); 444 }), 445 e 446 ); 447 } 448 function O() { 449 var t; 450 return ( 451 (t = e().m(function t(n, a, i) { 452 var c, u, s, f, P, O, E, L, A, T, Q, W, F, U, Z, x, R, G, M; 453 return e().w( 454 function (t) { 455 for (;;) 456 switch ((t.p = t.n)) { 457 case 0: 458 return ( 459 (t.p = 0), 460 (c = new URLSearchParams(window.location.search)), 461 (u = p(n)), 462 (s = g(n)), 463 (f = l()), 464 null !== (P = d(i.productsPerPage)) && 465 (f.productsPerPage = P), 466 (O = j()) && (f.lang_ajax = O), 467 (E = d(i.page) || 1), 468 c.set('p', String(E)), 469 (f.page = E), 470 void 0 === i.clearFilters && (i.clearFilters = !1), 471 (L = 472 i.selectedCategories && 473 'object' === o(i.selectedCategories) && 474 Object.keys(i.selectedCategories).length > 0), 475 (A = l()), 476 i.clearFilters 477 ? u.forEach(function (t) { 478 c.delete(t); 479 }) 480 : L 481 ? ((A = h(i.selectedCategories, u)), y(c, u, A)) 482 : !1 === i.clearFilters && (A = v(c, u)), 483 (f.selectedCategories = A), 484 (T = w(i.sort, s)), 485 (Q = T ? null : m(c, s)), 486 (W = T || Q), 487 b(c), 488 W && 489 (c.set( 490 'sort['.concat(W.field, ']'), 491 ''.concat(W.value), 492 ), 493 (f.sort = W.payload)), 494 r && r.abort(), 495 (r = new AbortController()), 496 (F = r.signal), 497 (t.n = 1), 498 fetch(a, { 499 signal: F, 500 method: 'POST', 501 headers: { 'Content-Type': 'application/json' }, 502 body: JSON.stringify(f), 503 }) 504 ); 505 case 1: 506 if (!(U = t.v).ok) { 507 t.n = 3; 508 break; 509 } 510 return ((t.n = 2), U.json()); 511 case 2: 512 ((Z = t.v), 513 n.html(_(Z.html)), 514 (x = 515 new URLSearchParams(window.location.search).get('p') || 516 '1'), 517 i.page && 518 i.page !== parseInt(x, 10) && 519 (R = document.querySelector( 520 'section[data-purpose="content"]', 521 )) && 522 R.scrollIntoView({ 523 behavior: 'smooth', 524 block: 'start', 525 }), 526 O && c.set('lang', O), 527 (G = '' 528 .concat(window.location.origin) 529 .concat(window.location.pathname, '?') 530 .concat(c.toString())), 531 window.history.pushState({ path: G }, '', G), 532 i.sort && W 533 ? ((M = '' 534 .concat(W.field, '-') 535 .concat(W.value.toLowerCase())), 536 S(O, M)) 537 : S(O, C()), 538 k() 539 ? jQuery('#reset_filters').show() 540 : jQuery('#reset_filters').hide()); 541 case 3: 542 return t.a(2, U.ok); 543 case 4: 544 return ((t.p = 4), t.v, t.a(2, !1)); 545 } 546 }, 547 t, 548 null, 549 [[0, 4]], 550 ); 551 })), 552 (O = function () { 553 var e = this, 554 r = arguments; 555 return new Promise(function (o, a) { 556 var i = t.apply(e, r); 557 function c(t) { 558 n(i, o, a, c, u, 'next', t); 559 } 560 function u(t) { 561 n(i, o, a, c, u, 'throw', t); 562 } 563 c(void 0); 564 }); 565 }), 566 O.apply(this, arguments) 567 ); 568 } 569 function E(t, e, r) { 570 var n = +t.find('[data-purpose="content-inner"]').data('page'), 571 o = function (t) { 572 switch (t) { 573 case '<': 574 return n - 1; 575 case '>': 576 return n + 1; 577 case '<<': 578 return 1; 579 default: 580 return t; 581 } 582 }; 583 t.find('button[data-purpose="navigation"]').each(function (t, n) { 584 var a = jQuery(n), 585 i = a.data('value'); 586 a.on('click', function () { 587 switch (a.data('type')) { 588 case 'button': 589 r({ productsPerPage: e.productsPerPage, page: o(i) }); 590 break; 591 case 'page': 592 r({ productsPerPage: e.productsPerPage, page: i }); 593 } 594 }); 595 }); 596 } 597 function L(t, e, r) { 598 var n = j(), 599 o = g(t); 600 t.find('.product-listing__sort__option').each(function (t, a) { 601 var i = jQuery(a), 602 c = (i.data('value') || '').toString(), 603 u = w({ field: (i.data('field') || '').toString(), value: c }, o); 604 u && 605 i.on('click', function () { 606 r({ 607 productsPerPage: e.productsPerPage, 608 page: 1, 609 sort: { field: u.field, value: u.value }, 610 }); 611 var t = ''.concat(u.field, '-').concat(u.value.toLowerCase()); 612 S(n, t); 613 }); 614 }); 615 } 616 function A(t) { 617 t.find('.product-listing__sort') 618 .off('click') 619 .on('click', function () { 620 var t = jQuery(this).find('.product-listing__sort__dropdown'), 621 e = jQuery(this).find('#dropdown-arrow'); 622 (e.toggleClass('product-listing__sort__arrow-up'), 623 e.toggleClass('product-listing__sort__arrow-down'), 624 t.toggleClass('show')); 625 }); 626 } 627 function T(t, e, r) { 628 var n = p(t); 629 (t 630 .find('.dropdown__product-list__label') 631 .on('keydown click', function (t) { 632 if ('keydown' !== t.type || 13 === t.keyCode) { 633 var e = jQuery(this).next( 634 '.dropdown__product-list__dropdown-content', 635 ), 636 r = jQuery(this).find('#dropdown-arrow'); 637 (r.toggleClass('dropdown__product-list__arrow-up'), 638 r.toggleClass('dropdown__product-list__arrow-down'), 639 e.toggleClass('show')); 640 } 641 }), 642 t.find('input[data-purpose="category"]').each(function (t, o) { 643 var a = jQuery(o), 644 i = a.data('slug'), 645 c = (a.attr('category') || '').trim(); 646 if (n.has(c)) { 647 var u = a.attr('data-selected'), 648 s = a.parent().parent().prev().find('#dropdown-arrow'); 649 if ('true' === u) { 650 var l = a.parent().parent(); 651 !1 === l.hasClass('show') && 652 (s.toggleClass('dropdown__product-list__arrow-down'), 653 s.toggleClass('dropdown__product-list__arrow-up'), 654 l.toggleClass('show')); 655 } 656 a.on('click keydown', function (t) { 657 if ('keydown' !== t.type || 13 === t.keyCode) { 658 var o = new URLSearchParams(window.location.search), 659 u = v(o, n); 660 (u[c] || (u[c] = []), 661 o.forEach(function (t, e) { 662 var r; 663 'p' !== e && 664 '' !== t && 665 n.has(e) && 666 (u[e] || (u[e] = []), 667 null == t || 668 null === (r = t.split(',')) || 669 void 0 === r ||
670 r.filter(Boolean).forEach(function (t) { 671 var r = f(t); 672 r && !u[e].includes(r) && u[e].push(r); 673 })); 674 })); 675 var s = f(i); 676 s && 677 (u[c].includes(s) 678 ? ((u[c] = u[c].filter(function (t) { 679 return t !== s; 680 })), 681 a.attr('data-selected', 'false'), 682 a.prop('checked', !1)) 683 : (u[c].push(s), 684 a.attr('data-selected', 'true'), 685 a.prop('checked', !0)), 686 r({ 687 productsPerPage: e.productsPerPage, 688 selectedCategories: u, 689 page: 1, 690 })); 691 } 692 }); 693 } 694 }), 695 t.find('#reset_filters').on('click keypress', function (t) { 696 ('keydown' === t.type && 13 !== t.keyCode) || 697 r({ 698 productsPerPage: e.productsPerPage, 699 selectedCategories: {}, 700 page: 1, 701 clearFilters: !0, 702 }); 703 })); 704 } 705 ((window.handleProductListing = function (t) { 706 var e = t.find('.wp-block-sw-products-product-listing'), 707 r = (e.data('fetch-url') || '').toString(), 708 n = {}, 709 a = e.data('attributes'); 710 if ('string' == typeof a) 711 try { 712 n = JSON.parse(atob(a)); 713 } catch (t) { 714 n = {}; 715 } 716 else a && 'object' === o(a) && (n = a); 717 var i = (function (t) { 718 var e = l(); 719 if (!t || 'object' !== o(t)) return e; 720 if (void 0 !== t.productsPerPage) { 721 var r = d(t.productsPerPage); 722 null !== r && (e.productsPerPage = r); 723 } 724 return ( 725 'boolean' == typeof t.hideEmpty && (e.hideEmpty = t.hideEmpty), 726 e 727 ); 728 })(n), 729 c = function (n) { 730 (e.addClass('product-listing--loading'), 731 (function (_x, t, e) { 732 return O.apply(this, arguments); 733 })(t, r, n) 734 .then(function (e) { 735 e 736 ? (E(t, i, c), T(t, i, c), L(t, i, c), A(t)) 737 : console.error('Failed to fetch products'); 738 }) 739 .finally(function () { 740 setTimeout(function () { 741 e.removeClass('product-listing--loading'); 742 }, 0); 743 })); 744 }; 745 (E(t, i, c), T(t, i, c), L(t, i, c), A(t)); 746 }), 747 jQuery(function () { 748 (jQuery('.wp-block-sw-products-product-listing').each(function (t, e) { 749 'function' == typeof window.handleProductListing && 750 window.handleProductListing(jQuery(e).parent()); 751 }), 752 S(j(), C()), 753 k() || jQuery('#reset_filters').hide()); 754 })); 755 })(); 756})();
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.