1/******/ (function() { // webpackBootstrap 2/******/ var __webpack_modules__ = ({ 3 4/***/ 993: 5/***/ (function(module, exports) { 6 7!(function(e, t) { 8 "object" == typeof exports && "object" == typeof module ? module.exports = t() : "function" == typeof define && define.amd ? define("DoMini", [], t) : "object" == typeof exports ? exports.DoMini = t() : e.DoMini = t(); 9})(window, (() => (() => { 10 "use strict"; 11 var e = { d: (t2, n2) => { 12 for (var i2 in n2) e.o(n2, i2) && !e.o(t2, i2) && Object.defineProperty(t2, i2, { enumerable: true, get: n2[i2] }); 13 }, o: (e2, t2) => Object.prototype.hasOwnProperty.call(e2, t2) }, t = {}; 14 let n; 15 e.d(t, { default: () => r }), void 0 === window.DoMini ? (n = function(e2, t2) { 16 return void 0 !== arguments[2] ? this.constructor.call(this, e2, t2) : 1 !== arguments.length || "function" != typeof arguments[0] ? new n(e2, t2, true) : void ("complete" === document.readyState || "loaded" === document.readyState || "interactive" === document.readyState ? arguments[0].apply(this, [n]) : window.addEventListener("DOMContentLoaded", (() => { 17 arguments[0].apply(this, [n]); 18 }))); 19 }, n.prototype = n.fn = { constructor: function(e2, t2) { 20 if (this.length = 0, void 0 !== t2) { 21 if (t2 instanceof n) return t2.find(e2); 22 if (this.isValidNode(t2) || "string" == typeof t2) return n(t2).find(e2); 23 } else if ("string" == typeof e2 && "" !== e2) this.push(...this._(e2)); 24 else { 25 if (e2 instanceof n) return e2; 26 this.isValidNode(e2) && this.push(e2); 27 } 28 return this; 29 }, _: function(e2) { 30 return "<" === e2.charAt(0) ? n._fn.createElementsFromHTML(e2) : [...document.querySelectorAll(e2)]; 31 }, isValidNode: (e2) => e2 instanceof Element || e2 instanceof Document || e2 instanceof Window, push: Array.prototype.push, pop: Array.prototype.pop, sort: Array.prototype.sort, splice: Array.prototype.splice }, n.prototype[Symbol.iterator] = Array.prototype[Symbol.iterator], n._fn = {}, n.version = "0.2.8") : n = window.DoMini; 32 const i = n; 33 i.fn.get = function(e2) { 34 return void 0 === e2 ? Array.from(this) : this[e2]; 35 }, i.fn.extend = function() { 36 for (let e2 = 1; e2 < arguments.length; e2++) for (let t2 in arguments[e2]) arguments[e2].hasOwnProperty(t2) && (arguments[0][t2] = arguments[e2][t2]); 37 return arguments[0]; 38 }, i.fn.forEach = function(e2) { 39 return this.get().forEach((function(t2, n2, i2) { 40 e2.apply(t2, [t2, n2, i2]); 41 })), this; 42 }, i.fn.each = function(e2) { 43 return this.get().forEach((function(t2, n2, i2) { 44 e2.apply(t2, [n2, t2, i2]); 45 })), this; 46 }, i.fn.css = function(e2, t2) { 47 for (const n2 of this) if (1 === arguments.length) { 48 if ("object" != typeof e2) return window.getComputedStyle(n2)[e2]; 49 Object.keys(e2).forEach((function(t3) { 50 n2.style[t3] = e2[t3]; 51 })); 52 } else n2.style[e2] = t2; 53 return this; 54 }, i.fn.hasClass = function(e2) { 55 let t2 = this.get(0); 56 return null != t2 && t2.classList.contains(e2); 57 }, i.fn.addClass = function(e2) { 58 let t2 = e2; 59 return "string" == typeof e2 && (t2 = e2.split(" ")), t2 = t2.filter((function(e3) { 60 return "" !== e3.trim(); 61 })), t2.length > 0 && this.forEach((function(e3) { 62 e3.classList.add.apply(e3.classList, t2); 63 })), this; 64 }, i.fn.removeClass = function(e2) { 65 if (void 0 !== e2) { 66 let t2 = e2; 67 "string" == typeof e2 && (t2 = e2.split(" ")), t2 = t2.filter((function(e3) { 68 return "" !== e3.trim(); 69 })), t2.length > 0 && this.forEach((function(e3) { 70 e3.classList.remove.apply(e3.classList, t2); 71 })); 72 } else this.forEach((function(e3) { 73 e3.classList.length > 0 && e3.classList.remove.apply(e3.classList, e3.classList); 74 })); 75 return this; 76 }, i.fn.isVisible = function() { 77 let e2, t2 = this.get(0), n2 = true; 78 for (; null !== t2; ) { 79 if (e2 = window.getComputedStyle(t2), "none" === e2.display || "hidden" === e2.visibility || 0 === parseInt(e2.opacity)) { 80 n2 = false; 81 break; 82 } 83 t2 = t2.parentElement; 84 } 85 return n2; 86 }, i.fn.val = function(e2) { 87 let t2; 88 if (1 === arguments.length) { 89 for (const t3 of this) if ("select-multiple" === t3.type) { 90 e2 = "string" == typeof e2 ? e2.split(",") : e2; 91 for (let n2, i2 = 0, o2 = t3.options.length; i2 < o2; i2++) n2 = t3.options[i2], n2.selected = -1 !== e2.indexOf(n2.value); 92 } else t3.value = e2; 93 t2 = this; 94 } else { 95 let e3 = this.get(0); 96 null != e3 && (t2 = "select-multiple" === e3.type ? Array.prototype.map.call(e3.selectedOptions, (function(e4) { 97 return e4.value; 98 })) : e3.value); 99 } 100 return t2; 101 }, i.fn.attr = function(e2, t2) { 102 let n2; 103 for (const i2 of this) if (2 === arguments.length) i2.setAttribute(e2, t2), n2 = this; 104 else { 105 if ("object" != typeof e2) { 106 n2 = i2.getAttribute(e2); 107 break; 108 } 109 Object.keys(e2).forEach((function(t3) { 110 i2.setAttribute(t3, e2[t3]); 111 })); 112 } 113 return n2; 114 }, i.fn.removeAttr = function(e2) { 115 for (const t2 of this) t2.removeAttribute(e2); 116 return this; 117 }, i.fn.prop = function(e2, t2) { 118 let n2; 119 for (const i2 of this) { 120 if (2 !== arguments.length) { 121 n2 = void 0 !== i2[e2] ? i2[e2] : null; 122 break; 123 } 124 i2[e2] = t2; 125 }
126 return 2 === arguments.length ? this : n2; 127 }, i.fn.data = function(e2, t2) { 128 const n2 = e2.replace(/-([a-z])/g, (function(e3) { 129 return e3[1].toUpperCase(); 130 })); 131 if (2 === arguments.length) { 132 for (const e3 of this) null != e3 && (e3.dataset[n2] = t2); 133 return this; 134 } 135 { 136 let e3 = this.get(0); 137 return null != e3 && void 0 !== e3.dataset[n2] ? e3.dataset[n2] : ""; 138 } 139 }, i.fn.html = function(e2) { 140 if (1 === arguments.length) { 141 for (const t2 of this) t2.innerHTML = e2; 142 return this; 143 } 144 { 145 let e3 = this.get(0); 146 return null == e3 ? "" : e3.innerHTML; 147 } 148 }, i.fn.text = function(e2) { 149 if (1 === arguments.length) { 150 for (const t2 of this) t2.textContent = e2; 151 return this; 152 } 153 { 154 let e3 = this.get(0); 155 return null == e3 ? "" : e3.textContent; 156 } 157 }, i.fn.position = function() { 158 let e2 = this.get(0); 159 return null != e2 ? { top: e2.offsetTop, left: e2.offsetLeft } : { top: 0, left: 0 }; 160 }, i.fn.offset = function() { 161 let e2 = this.get(0); 162 return null != e2 ? i._fn.hasFixedParent(e2) ? e2.getBoundingClientRect() : i._fn.absolutePosition(e2) : { top: 0, left: 0 }; 163 }, i.fn.outerWidth = function(e2) { 164 e2 = e2 || false; 165 let t2 = this.get(0); 166 return null != t2 ? e2 ? parseInt(t2.offsetWidth) + parseInt(this.css("marginLeft")) + parseInt(this.css("marginRight")) : parseInt(t2.offsetWidth) : 0; 167 }, i.fn.outerHeight = function(e2) { 168 e2 = e2 || false; 169 let t2 = this.get(0); 170 return null != t2 ? e2 ? parseInt(t2.offsetHeight) + parseInt(this.css("marginTop")) + parseInt(this.css("marginBottom")) : parseInt(t2.offsetHeight) : 0; 171 }, i.fn.noPaddingHeight = function(e2) { 172 return e2 = e2 || false, this.length > 0 ? e2 ? parseInt(this.css("height")) + parseInt(this.css("marginTop")) + parseInt(this.css("marginBottom")) : parseInt(this.css("height")) : 0; 173 }, i.fn.noPaddingWidth = function(e2) { 174 return e2 = e2 || false, this.length > 0 ? e2 ? parseInt(this.css("width")) + parseInt(this.css("marginLeft")) + parseInt(this.css("marginRight")) : parseInt(this.css("width")) : 0; 175 }, i.fn.innerWidth = function() { 176 let e2 = this.get(0); 177 if (null != e2) { 178 let t2 = window.getComputedStyle(e2); 179 return this.outerWidth() - parseFloat(t2.borderLeftWidth) - parseFloat(t2.borderRightWidth); 180 } 181 return 0; 182 }, i.fn.innerHeight = function() { 183 let e2 = this.get(0); 184 if (null != e2) { 185 let t2 = window.getComputedStyle(e2); 186 return this.outerHeight() - parseFloat(t2.borderTopWidth) - parseFloat(t2.borderBottomtWidth); 187 } 188 return 0; 189 }, i.fn.width = function() { 190 return this.outerWidth(); 191 }, i.fn.height = function() { 192 return this.outerHeight(); 193 }, i.fn.on = function() { 194 let e2 = arguments, t2 = function(e3, t3) { 195 let n3; 196 if ("mouseenter" === t3.type || "mouseleave" === t3.type || "mouseover" === t3.type) { 197 let o2 = document.elementFromPoint(t3.clientX, t3.clientY); 198 if (!o2.matches(e3[1])) for (; (o2 = o2.parentElement) && !o2.matches(e3[1]); ) ; 199 null != o2 && (n3 = i(o2)); 200 } else n3 = i(t3.target).closest(e3[1]); 201 if (null != n3 && n3.closest(this).length > 0) { 202 let i2 = []; 203 if (i2.push(t3), void 0 !== e3[4]) for (let t4 = 4; t4 < e3.length; t4++) i2.push(e3[t4]); 204 e3[2].apply(n3.get(0), i2); 205 } 206 }, n2 = e2[0].split(" "); 207 for (let o2 = 0; o2 < n2.length; o2++) { 208 let r2 = n2[o2]; 209 if ("string" == typeof e2[1]) this.forEach((function(n3) { 210 if (!i._fn.hasEventListener(n3, r2, e2[2])) { 211 let i2 = t2.bind(n3, e2); 212 n3.addEventListener(r2, i2, e2[3]), n3._domini_events = void 0 === n3._domini_events ? [] : n3._domini_events, n3._domini_events.push({ type: r2, selector: e2[1], func: i2, trigger: e2[2], args: e2[3] }); 213 } 214 })); 215 else for (let t3 = 0; t3 < n2.length; t3++) { 216 let o3 = n2[t3]; 217 this.forEach((function(t4) { 218 i._fn.hasEventListener(t4, o3, e2[1]) || (t4.addEventListener(o3, e2[1], e2[2]), t4._domini_events = void 0 === t4._domini_events ? [] : t4._domini_events, t4._domini_events.push({ type: o3, func: e2[1], trigger: e2[1], args: e2[2] })); 219 })); 220 } 221 } 222 return this; 223 }, i.fn.off = function(e2, t2) { 224 return this.forEach((function(n2) { 225 if (void 0 !== n2._domini_events && n2._domini_events.length > 0) if (void 0 === e2) { 226 let e3; 227 for (; e3 = n2._domini_events.pop(); ) n2.removeEventListener(e3.type, e3.func, e3.args); 228 n2._domini_events = []; 229 } else e2.split(" ").forEach((function(e3) { 230 let i2, o2 = []; 231 for (; i2 = n2._domini_events.pop(); ) i2.type !== e3 || void 0 !== t2 && i2.trigger !== t2 ? o2.push(i2) : n2.removeEventListener(e3, i2.func, i2.args); 232 n2._domini_events = o2; 233 })); 234 })), this; 235 }, i.fn.offForced = function() { 236 let e2 = this; 237 return this.forEach((function(t2, n2) { 238 let i2 = t2.cloneNode(true); 239 t2.parentNode.replaceChild(i2, t2), e2[n2] = i2; 240 })), this; 241 }, i.fn.trigger = function(e2, t2, n2, o2) { 242 return n2 = n2 || false, o2 = o2 || false, this.forEach((function(r2) { 243 let s = false;
244 if (o2 && "undefined" != typeof jQuery && void 0 !== jQuery._data && void 0 !== jQuery._data(r2, "events") && void 0 !== jQuery._data(r2, "events")[e2] && (jQuery(r2).trigger(e2, t2), s = true), !s && n2) { 245 let n3 = new Event(e2); 246 n3.detail = t2, r2.dispatchEvent(n3); 247 } 248 if (void 0 !== r2._domini_events) r2._domini_events.forEach((function(n3) { 249 if (n3.type === e2) { 250 let i2 = new Event(e2); 251 n3.trigger.apply(r2, [i2].concat(t2)); 252 } 253 })); 254 else { 255 let n3 = false, o3 = r2; 256 for (; o3 = o3.parentElement, null != o3 && (void 0 !== o3._domini_events && o3._domini_events.forEach((function(s2) { 257 if (void 0 !== s2.selector) { 258 let l = i(o3).find(s2.selector); 259 if (l.length > 0 && l.get().indexOf(r2) >= 0 && s2.type === e2) { 260 let i2 = new Event(e2); 261 s2.trigger.apply(r2, [i2].concat(t2)), n3 = true; 262 } 263 } 264 })), !n3); ) ; 265 } 266 })), this; 267 }, i.fn.clear = function() { 268 for (const e2 of this) delete e2._domini_events; 269 return this; 270 }, i.fn.clone = function() { 271 let e2 = []; 272 for (const t2 of this) e2.push(t2.cloneNode(true)); 273 return i().add(e2); 274 }, i.fn.detach = function(e2) { 275 let t2 = this, n2 = []; 276 void 0 !== e2 && (t2 = this.find(e2)); 277 for (const e3 of t2) null != e3.parentElement && n2.push(e3.parentElement.removeChild(e3)); 278 return i().add(n2); 279 }, i.fn.remove = function(e2) { 280 return this.detach(e2).off().clear(); 281 }, i.fn.prepend = function(e2) { 282 if ((e2 = i._fn.elementArrayFromAny(e2)).length > 0) for (const t2 of this) for (const n2 of e2) t2.insertBefore(n2, t2.children[0]); 283 return this; 284 }, i.fn.append = function(e2) { 285 if ((e2 = i._fn.elementArrayFromAny(e2)).length > 0) for (const t2 of this) for (const n2 of e2) t2.appendChild(n2); 286 return this; 287 }, i.fn.is = function(e2) { 288 let t2 = false; 289 for (const n2 of this) if (n2.matches(e2)) { 290 t2 = true; 291 break; 292 } 293 return t2; 294 }, i.fn.parent = function(e2) { 295 let t2 = []; 296 for (const n2 of this) { 297 let i2 = n2.parentElement; 298 "string" == typeof e2 && (null == i2 || i2.matches(e2) || (i2 = null)), t2.push(i2); 299 } 300 return i().add(t2); 301 }, i.fn.copy = function(e2, t2) { 302 let n2, i2, o2; 303 if ("object" != typeof e2 || null === e2) return n2 = e2, n2; 304 for (i2 in n2 = new e2.constructor(), e2) e2.hasOwnProperty(i2) && (o2 = typeof e2[i2], t2 && "object" === o2 && null !== e2[i2] ? n2[i2] = this.copy(e2[i2]) : n2[i2] = e2[i2]); 305 return n2; 306 }, i.fn.first = function() { 307 return i(this[0]); 308 }, i.fn.last = function() { 309 return i(this[this.length - 1]); 310 }, i.fn.prev = function(e2) { 311 let t2 = []; 312 for (const n2 of this) { 313 let i2; 314 if ("string" == typeof e2) for (i2 = n2.previousElementSibling; null != i2; ) { 315 if (i2.matches(e2)) { 316 t2.push(i2); 317 break; 318 } 319 i2 = i2.previousElementSibling; 320 } 321 else t2.push(n2.previousElementSibling); 322 } 323 return i(null).add(t2); 324 }, i.fn.next = function(e2) { 325 let t2 = []; 326 for (const n2 of this) { 327 let i2; 328 if ("string" == typeof e2) for (i2 = n2.nextElementSibling; null != i2; ) { 329 if (i2.matches(e2)) { 330 t2.includes(i2) || t2.push(i2); 331 break; 332 } 333 i2 = i2.nextElementSibling; 334 } 335 else t2.push(n2.nextElementSibling); 336 } 337 return i(null).add(t2); 338 }, i.fn.closest = function(e2) { 339 let t2 = []; 340 for (let n2 of this) if ("string" == typeof e2 && "" !== e2) { 341 for (; !n2.matches(e2) && (n2 = n2.parentElement); ) ; 342 t2.includes(n2) || t2.push(n2); 343 } else { 344 if ((e2 = e2 instanceof i ? e2.get(0) : e2) instanceof Element) for (; n2 !== e2 && (n2 = n2.parentElement); ) ; 345 else n2 = null; 346 t2.includes(n2) || t2.push(n2); 347 } 348 return i().add(t2); 349 }, i.fn.add = function(e2) { 350 let t2 = i._fn.elementArrayFromAny(e2); 351 for (const e3 of t2) Array.from(this).includes(e3) || this.push(e3); 352 return this; 353 }, i.fn.find = function(e2) { 354 const t2 = new i(); 355 if ("string" == typeof e2) { 356 let n2 = [];
357 this.get().forEach((function(t3) { 358 const i2 = t3.querySelectorAll?.(e2) ?? []; 359 n2 = n2.concat(Array.from(i2)); 360 })), n2.length > 0 && t2.add(n2); 361 } 362 return t2; 363 }, i._fn.bodyTransform = function() { 364 let e2 = 0, t2 = 0; 365 if ("undefined" != typeof WebKitCSSMatrix) { 366 let n2 = window.getComputedStyle(document.body); 367 if (void 0 !== n2.transform) { 368 let i2 = new WebKitCSSMatrix(n2.transform); 369 "undefined" !== i2.m41 && (e2 = i2.m41), "undefined" !== i2.m42 && (t2 = i2.m42); 370 } 371 } 372 return { x: e2, y: t2 }; 373 }, i._fn.bodyTransformY = function() { 374 return this.bodyTransform().y; 375 }, i._fn.bodyTransformX = function() { 376 return this.bodyTransform().x; 377 }, i._fn.hasFixedParent = function(e2) { 378 if (0 != i._fn.bodyTransformY()) return false; 379 do { 380 if ("fixed" == window.getComputedStyle(e2).position) return true; 381 } while (e2 = e2.parentElement); 382 return false; 383 }, i._fn.hasEventListener = function(e2, t2, n2) { 384 if (void 0 === e2._domini_events) return false; 385 for (let i2 = 0; i2 < e2._domini_events.length; i2++) if (e2._domini_events[i2].trigger === n2 && e2._domini_events[i2].type === t2) return true; 386 return false; 387 }, i._fn.allDescendants = function(e2) { 388 let t2 = [], n2 = this; 389 return Array.isArray(e2) || (e2 = [e2]), e2.forEach((function(e3) { 390 for (let i2 = 0; i2 < e3.childNodes.length; i2++) { 391 let o2 = e3.childNodes[i2]; 392 t2.push(o2), t2 = t2.concat(n2.allDescendants(o2)); 393 } 394 })), t2; 395 }, i._fn.createElementsFromHTML = function(e2) { 396 let t2 = document.createElement("template"); 397 return t2.innerHTML = e2.replace(/(\r\n|\n|\r)/gm, ""), [...t2.content.childNodes]; 398 }, i._fn.elementArrayFromAny = function(e2) { 399 if ("string" == typeof e2) e2 = i(e2).get(); 400 else if (e2 instanceof i) e2 = e2.get(); 401 else if (e2 instanceof Element) e2 = [e2]; 402 else { 403 if (!(e2 instanceof Array)) return []; 404 e2 = e2.filter(((e3) => e3 instanceof Element)); 405 } 406 return e2; 407 }, i._fn.ElementArrayFromAny = i._fn.elementArrayFromAny, i._fn.absolutePosition = function(e2) { 408 if (!e2.getClientRects().length) return { top: 0, left: 0 }; 409 let t2 = e2.getBoundingClientRect(), n2 = e2.ownerDocument.defaultView; 410 return { top: t2.top + n2.pageYOffset, left: t2.left + n2.pageXOffset }; 411 }, i._fn.plugin = function(e2, t2) { 412 i.fn[e2] = function(n2) { 413 return void 0 !== n2 && t2[n2] ? t2[n2].apply(this, Array.prototype.slice.call(arguments, 1)) : this.forEach((function(i2) { 414 i2["domini_" + e2] = Object.create(t2).init(n2, i2); 415 })); 416 }; 417 }, document.dispatchEvent(new Event("domini-dom-core-loaded")); 418 const o = i; 419 i.fn.animate = function(e2, t2, n2) { 420 t2 = t2 || 200, n2 = n2 || "easeInOutQuad"; 421 for (const o2 of this) { 422 let r2, s, l, f, a, c = 0, u = 60, h = {}, d = {}; 423 if (l = this.prop("_domini_animations"), l = null == l ? [] : l, false === e2) l.forEach((function(e3) { 424 clearInterval(e3); 425 })); 426 else { 427 let p = function() { 428 c++, c > r2 ? clearInterval(f) : (s = a(c / r2), Object.keys(d).forEach((function(e3) { 429 e3.indexOf("scroll") > -1 ? o2[e3] = h[e3] + d[e3] * s : o2.style[e3] = h[e3] + d[e3] * s + "px"; 430 }))); 431 }; 432 a = i.fn.animate.easing[n2] ?? i.fn.animate.easing.easeInOutQuad, Object.keys(e2).forEach((function(t3) { 433 t3.indexOf("scroll") > -1 ? (h[t3] = o2[t3], d[t3] = e2[t3] - h[t3]) : (h[t3] = parseInt(window.getComputedStyle(o2)[t3]), d[t3] = e2[t3] - h[t3]); 434 })), r2 = t2 / 1e3 * u, f = setInterval(p, 1e3 / u), l.push(f), this.prop("_domini_animations", l); 435 } 436 } 437 return this; 438 }, i.fn.animate.easing = { linear: function(e2) { 439 return e2; 440 }, easeInOutQuad: function(e2) { 441 return e2 < 0.5 ? 2 * e2 * e2 : 1 - Math.pow(-2 * e2 + 2, 2) / 2; 442 }, easeOutQuad: function(e2) { 443 return 1 - (1 - e2) * (1 - e2); 444 } }, i.fn.unhighlight = function(e2) { 445 let t2 = { className: "highlight", element: "span" }; 446 return i.fn.extend(t2, e2), this.find(t2.element + "." + t2.className).forEach((function() { 447 let e3 = this.parentNode; 448 e3.replaceChild(this.firstChild, this), e3.normalize(); 449 })); 450 }, i.fn.highlight = function(e2, t2) { 451 this.defaults = { className: "highlight", element: "span", caseSensitive: false, wordsOnly: false, excludeParents: ".excludeFromHighlight" }; 452 const n2 = i, o2 = { ...this.defaults, ...t2 }; 453 if (e2.constructor === String && (e2 = [e2]), (e2 = e2.filter((function(e3) { 454 return "" !== e3; 455 }
455))).forEach((function(e3, t3, n3) { 456 n3[t3] = e3.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&").normalize("NFD").replace(/[\u0300-\u036f]/g, ""); 457 })), 0 === e2.length) return this; 458 let r2 = o2.caseSensitive ? "" : "i", s = "(" + e2.join("|") + ")"; 459 o2.wordsOnly && (s = "(?:,|^|\\s)" + s + "(?:,|$|\\s)"); 460 let l = new RegExp(s, r2); 461 function f(e3, t3, i2, o3, r3) { 462 if (r3 = "" === r3 ? n2.fn.highlight.defaults : r3, 3 === e3.nodeType) { 463 if (!n2(e3.parentNode).is(r3)) { 464 let n3 = e3.data.normalize("NFD").replace(/[\u0300-\u036f]/g, "").match(t3); 465 if (n3) { 466 let t4, r4 = document.createElement(i2 || "span"); 467 r4.className = o3 || "highlight", t4 = /\.|,|\s/.test(n3[0].charAt(0)) ? n3.index + 1 : n3.index; 468 let s2 = e3.splitText(t4); 469 s2.splitText(n3[1].length); 470 let l2 = s2.cloneNode(true); 471 return r4.appendChild(l2), s2.parentNode.replaceChild(r4, s2), 1; 472 } 473 } 474 } else if (1 === e3.nodeType && e3.childNodes && !/(script|style)/i.test(e3.tagName) && !n2(e3).closest(r3).length > 0 && (e3.tagName !== i2.toUpperCase() || e3.className !== o3)) for (let n3 = 0; n3 < e3.childNodes.length; n3++) n3 += f(e3.childNodes[n3], t3, i2, o3, r3); 475 return 0; 476 } 477 return this.forEach((function(e3) { 478 f(e3, l, o2.element, o2.className, o2.excludeParents); 479 })); 480 }, i.fn.serialize = function() { 481 let e2 = this.get(0); 482 if (!e2 || "FORM" !== e2.nodeName) return ""; 483 let t2, n2, i2 = []; 484 for (t2 = e2.elements.length - 1; t2 >= 0; t2 -= 1) if ("" !== e2.elements[t2].name) switch (e2.elements[t2].nodeName) { 485 case "INPUT": 486 switch (e2.elements[t2].type) { 487 case "checkbox": 488 case "radio": 489 e2.elements[t2].checked && i2.push(e2.elements[t2].name + "=" + encodeURIComponent(e2.elements[t2].value)); 490 break; 491 case "file": 492 break; 493 default: 494 i2.push(e2.elements[t2].name + "=" + encodeURIComponent(e2.elements[t2].value)); 495 } 496 break; 497 case "TEXTAREA": 498 i2.push(e2.elements[t2].name + "=" + encodeURIComponent(e2.elements[t2].value)); 499 break; 500 case "SELECT": 501 switch (e2.elements[t2].type) { 502 case "select-one": 503 i2.push(e2.elements[t2].name + "=" + encodeURIComponent(e2.elements[t2].value)); 504 break; 505 case "select-multiple": 506 for (n2 = e2.elements[t2].options.length - 1; n2 >= 0; n2 -= 1) e2.elements[t2].options[n2].selected && i2.push(e2.elements[t2].name + "=" + encodeURIComponent(e2.elements[t2].options[n2].value)); 507 } 508 break; 509 case "BUTTON": 510 switch (e2.elements[t2].type) { 511 case "reset": 512 case "submit": 513 case "button": 514 i2.push(e2.elements[t2].name + "=" + encodeURIComponent(e2.elements[t2].value)); 515 } 516 } 517 return i2.join("&"); 518 }, i.fn.serializeObject = function(e2, t2) { 519 let n2, o2 = []; 520 for (n2 in e2) if (e2.hasOwnProperty(n2)) { 521 let r2 = t2 ? t2 + "[" + n2 + "]" : n2, s = e2[n2]; 522 o2.push(null !== s && "object" == typeof s ? i.fn.serializeObject(s, r2) : encodeURIComponent(r2) + "=" + encodeURIComponent(s)); 523 } 524 return o2.join("&"); 525 }, i.fn.inViewPort = function(e2, t2) { 526 let n2, i2, o2 = this.get(0); 527 if (null == o2) return false; 528 e2 = void 0 === e2 ? 0 : e2, t2 = void 0 === t2 ? window : "string" == typeof t2 ? document.querySelector(t2) : t2; 529 let r2 = o2.getBoundingClientRect(), s = r2.top, l = r2.bottom, f = r2.left, a = r2.right, c = false; 530 if (null == t2 && (t2 = window), t2 === window) n2 = window.innerWidth || 0, i2 = window.innerHeight || 0; 531 else { 532 n2 = t2.clientWidth, i2 = t2.clientHeight; 533 let e3 = t2.getBoundingClientRect(); 534 s -= e3.top, l -= e3.top, f -= e3.left, a -= e3.left; 535 } 536 return e2 = ~~Math.round(parseFloat(e2)), a <= 0 || f >= n2 || (c = e2 > 0 ? s >= e2 && l < i2 - e2 : (l > 0 && s <= i2 - e2) | (s <= 0 && l > e2)), c; 537 }, i.fn.ajax = function(e2) { 538 if ("cors" === (e2 = this.extend({ url: "", method: "GET", cors: "cors", data: {}, success: null, fail: null, accept: "text/html", contentType: "application/x-www-form-urlencoded; charset=UTF-8" }, e2)).cors) { 539 let t2 = new XMLHttpRequest(); 540 return t2.onreadystatechange = function() { 541 null != e2.success && 4 === this.readyState && this.status >= 200 && this.status < 400 && e2.success(this.responseText), null != e2.fail && 4 === this.readyState && this.status >= 400 && e2.fail(this); 542 }, t2.open(e2.method.toUpperCase(), e2.url, true), t2.setRequestHeader("Content-type", e2.contentType), t2.setRequestHeader("Accept", e2.accept), t2.send(this.serializeObject(e2.data)), t2; 543 } 544 { 545 let t2 = "ajax_cb_" + "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (function(e3) { 546 let t3 = 16 * Math.random() | 0; 547 return ("x" === e3 ? t3 : 3 & t3 | 8).toString(16); 548 })).replaceAll("-", ""); 549 i.fn[t2] = function() { 550 e2.success.apply(this, arguments), delete i.fn[e2.data.fn]; 551 }, e2.data.callback = "DoMini.fn." + t2, e2.data.fn = t2; 552 let n2 = document.createElement("script"); 553 n2.type = "text/javascript", n2.src = e2.url + "?" + this.serializeObject(e2.data), n2.onload = function() { 554 this.remove(); 555 }, document.body.appendChild(n2); 556 } 557 }; 558 const r = o; 559 return t.default; 560})())); 561 562 563/***/ }) 564 565/******/ }); 566/************************************************************************/ 567/******/ // The module cache 568/******/ var __webpack_module_cache__ = {}; 569/******/ 570/******/ // The require function 571/******/ function __webpack_require__(moduleId) { 572/******/ // Check if module is in cache 573/******/ var cachedModule = __webpack_module_cache__[moduleId]; 574/******/ if (cachedModule !== undefined) { 575/******/ return cachedModule.exports; 576/******/ } 577/******/ // Create a new module (and put it into the cache) 578/******/ var module = __webpack_module_cache__[moduleId] = { 579/******/ // no module.id needed 580/******/ // no module.loaded needed 581/******/ exports: {} 582/******/ }; 583/******/ 584/******/ // Execute the module function 585/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__); 586/******/ 587/******/ // Return the exports of the module 588/******/ return module.exports; 589/******/ } 590/******/ 591/************************************************************************/ 592var __webpack_exports__ = {}; 593// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. 594!function() { 595"use strict"; 596 597// EXTERNAL MODULE: ./node_modules/domini/dist/domini.js 598var domini = __webpack_require__(993); 599;// ./src/client/external/helpers/base64.js 600 601const Base64 = { 602 // private property 603 _keyStr: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
603+/=", 604 // public method for encoding 605 encode: function(input) { 606 return btoa(this._utf8_encode(input)); 607 }, 608 // public method for decoding 609 decode: function(input) { 610 return this._utf8_decode( 611 atob(input.replace(/[^A-Za-z0-9\+\/\=]/g, "")) 612 ); 613 }, 614 // private method for UTF-8 encoding 615 _utf8_encode: function(string) { 616 string = string.replace(/\r\n/g, "\n"); 617 let utftext = ""; 618 for (let n = 0; n < string.length; n++) { 619 let c = string.charCodeAt(n); 620 if (c < 128) { 621 utftext += String.fromCharCode(c); 622 } else if (c > 127 && c < 2048) { 623 utftext += String.fromCharCode(c >> 6 | 192); 624 utftext += String.fromCharCode(c & 63 | 128); 625 } else { 626 utftext += String.fromCharCode(c >> 12 | 224); 627 utftext += String.fromCharCode(c >> 6 & 63 | 128); 628 utftext += String.fromCharCode(c & 63 | 128); 629 } 630 } 631 return utftext; 632 }, 633 // private method for UTF-8 decoding 634 _utf8_decode: function(utftext) { 635 let string = "", i = 0, c = 0, c2, c3; 636 while (i < utftext.length) { 637 c = utftext.charCodeAt(i); 638 if (c < 128) { 639 string += String.fromCharCode(c); 640 i++; 641 } else if (c > 191 && c < 224) { 642 c2 = utftext.charCodeAt(i + 1); 643 string += String.fromCharCode((c & 31) << 6 | c2 & 63); 644 i += 2; 645 } else { 646 c2 = utftext.charCodeAt(i + 1); 647 c3 = utftext.charCodeAt(i + 2); 648 string += String.fromCharCode((c & 15) << 12 | (c2 & 63) << 6 | c3 & 63); 649 i += 3; 650 } 651 } 652 return string; 653 } 654}; 655/* harmony default export */ var base64 = (Base64); 656 657;// ./src/client/external/helpers/hooks-filters.js 658 659const Hooks = { 660 filters: {}, 661 /** 662 * Adds a callback function to a specific programmatically triggered tag (hook) 663 * 664 * @param tag - the hook name 665 * @param callback - the callback function variable name 666 * @param priority - (optional) default=10 667 * @param scope - (optional) function scope. When a function is executed within an object scope, the object variable should be passed. 668 */ 669 addFilter: function(tag, callback, priority, scope) { 670 priority = typeof priority === "undefined" ? 10 : priority; 671 scope = typeof scope === "undefined" ? null : scope; 672 Hooks.filters[tag] = Hooks.filters[tag] || []; 673 Hooks.filters[tag].push({ priority, scope, callback }); 674 }, 675 /** 676 * Removes a callback function from a hook 677 * 678 * @param tag - the hook name 679 * @param callback - the callback function variable 680 */ 681 removeFilter: function(tag, callback) { 682 if (typeof Hooks.filters[tag] != "undefined") { 683 if (typeof callback == "undefined") { 684 Hooks.filters[tag] = []; 685 } else { 686 Hooks.filters[tag].forEach(function(filter, i) { 687 if (filter.callback === callback) { 688 Hooks.filters[tag].splice(i, 1); 689 } 690 }); 691 } 692 } 693 }, 694 applyFilters: function(tag) { 695 let filters = [], args = Array.prototype.slice.call(arguments), value = arguments[1]; 696 if (typeof Hooks.filters[tag] !== "undefined" && Hooks.filters[tag].length > 0) { 697 Hooks.filters[tag].forEach(function(hook) { 698 filters[hook.priority] = filters[hook.priority] || []; 699 filters[hook.priority].push({ 700 scope: hook.scope, 701 callback: hook.callback 702 }); 703 }); 704 args.splice(0, 2); 705 filters.forEach(function(hooks) { 706 hooks.forEach(function(obj) { 707 value = obj.callback.apply(obj.scope, [value].concat(args)); 708 }); 709 }); 710 } 711 return value; 712 } 713}; 714/* harmony default export */ var hooks_filters = (Hooks); 715 716;// ./src/client/external/helpers/interval-until-execute.js 717 718function intervalUntilExecute(f, criteria, interval = 100, maxTries = 50) { 719 let t, tries = 0, res = typeof criteria === "function" ? criteria() : criteria; 720 if (res === false) { 721 t = setInterval(function() { 722 res = typeof criteria === "function" ? criteria() : criteria; 723 tries++; 724 if (tries > maxTries) { 725 clearInterval(t); 726 return false; 727 } 728 if (res !== false) { 729 clearInterval(t); 730 return f(res); 731 } 732 }, interval); 733 } else { 734 return f(res); 735 } 736} 737; 738 739;
739// ./src/client/external/helpers/swiped.js 740 741/** 742 * swiped-events.js - v@version@ 743 * Pure JavaScript swipe events 744 * https://github.com/john-doherty/swiped-events 745 * @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element 746 * @author John Doherty <www.johndoherty.info> 747 * @license MIT 748 */ 749(function(window2, document2) { 750 "use strict"; 751 if (typeof window2.CustomEvent !== "function") { 752 window2.CustomEvent = function(event, params) { 753 params = params || { bubbles: false, cancelable: false, detail: void 0 }; 754 var evt = document2.createEvent("CustomEvent"); 755 evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail); 756 return evt; 757 }; 758 window2.CustomEvent.prototype = window2.Event.prototype; 759 } 760 document2.addEventListener("touchstart", handleTouchStart, false); 761 document2.addEventListener("touchmove", handleTouchMove, false); 762 document2.addEventListener("touchend", handleTouchEnd, false); 763 var xDown = null; 764 var yDown = null; 765 var xDiff = null; 766 var yDiff = null; 767 var timeDown = null; 768 var startEl = null; 769 function handleTouchEnd(e) { 770 if (startEl !== e.target) return; 771 var swipeThreshold = parseInt(getNearestAttribute(startEl, "data-swipe-threshold", "20"), 10); 772 var swipeTimeout = parseInt(getNearestAttribute(startEl, "data-swipe-timeout", "500"), 10); 773 var timeDiff = Date.now() - timeDown; 774 var eventType = ""; 775 var changedTouches = e.changedTouches || e.touches || []; 776 if (Math.abs(xDiff) > Math.abs(yDiff)) { 777 if (Math.abs(xDiff) > swipeThreshold && timeDiff < swipeTimeout) { 778 if (xDiff > 0) { 779 eventType = "swiped-left"; 780 } else { 781 eventType = "swiped-right"; 782 } 783 } 784 } else if (Math.abs(yDiff) > swipeThreshold && timeDiff < swipeTimeout) { 785 if (yDiff > 0) { 786 eventType = "swiped-up"; 787 } else { 788 eventType = "swiped-down"; 789 } 790 } 791 if (eventType !== "") { 792 var eventData = { 793 dir: eventType.replace(/swiped-/, ""), 794 xStart: parseInt(xDown, 10), 795 xEnd: parseInt((changedTouches[0] || {}).clientX || -1, 10), 796 yStart: parseInt(yDown, 10), 797 yEnd: parseInt((changedTouches[0] || {}).clientY || -1, 10) 798 }; 799 startEl.dispatchEvent(new CustomEvent("swiped", { bubbles: true, cancelable: true, detail: eventData })); 800 startEl.dispatchEvent(new CustomEvent(eventType, { bubbles: true, cancelable: true, detail: eventData })); 801 } 802 xDown = null; 803 yDown = null; 804 timeDown = null; 805 } 806 function handleTouchStart(e) { 807 if (e.target.getAttribute("data-swipe-ignore") === "true") return; 808 startEl = e.target; 809 timeDown = Date.now(); 810 xDown = e.touches[0].clientX; 811 yDown = e.touches[0].clientY; 812 xDiff = 0; 813 yDiff = 0; 814 } 815 function handleTouchMove(e) { 816 if (!xDown || !yDown) return; 817 var xUp = e.touches[0].clientX; 818 var yUp = e.touches[0].clientY; 819 xDiff = xDown - xUp; 820 yDiff = yDown - yUp; 821 } 822 function getNearestAttribute(el, attributeName, defaultValue) { 823 while (el && el !== document2.documentElement) { 824 var attributeValue = el.getAttribute(attributeName); 825 if (attributeValue) { 826 return attributeValue; 827 } 828 el = el.parentNode; 829 } 830 return defaultValue; 831 } 832})(window, document); 833 834;// ./src/client/bundle/optimized/asp-prereq.js 835 836 837 838 839 840 841window.WPD = window.WPD || {}; 842window.WPD.dom = domini; 843window.WPD.domini = window.WPD.dom; 844window.WPD.DoMini = window.WPD.dom; 845window.DoMini = window.WPD.dom; 846window.WPD.Base64 = window.WPD.Base64 || base64; 847window.WPD.Hooks = window.WPD.Hooks || hooks_filters; 848window.WPD.intervalUntilExecute = window.WPD.intervalUntilExecute || intervalUntilExecute; 849 850}(); 851Object(window.WPD).AjaxSearchPro = __webpack_exports__["default"]; 852/******/ })() 853;/******/ (function() { // webpackBootstrap 854/******/ "use strict"; 855/******/ // The require scope 856/******/ var __webpack_require__ = {}; 857/******/ 858/************************************************************************/ 859/******/ /* webpack/runtime/define property getters */ 860/******/ !function() { 861/******/ // define getter functions for harmony exports 862/******/ __webpack_require__.d = function(exports, definition) { 863/******/ for(var key in definition) { 864/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 865/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 866/******/ } 867/******/ } 868/******/ }; 869/******/ }(); 870/******/ 871/******/ /* webpack/runtime/hasOwnProperty shorthand */ 872/******/ !function() { 873/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 874/******/ }(); 875/******/ 876/************************************************************************/ 877var __webpack_exports__ = {}; 878 879// EXPORTS 880__webpack_require__.d(__webpack_exports__, { 881 "default": function() { return /* binding */ asp_core; } 882}); 883 884;// ./src/client/plugin/core/base.js 885 886const base_AjaxSearchPro = new function() { 887 this.helpers = {}; 888 this.plugin = {}; 889 this.addons = { 890 addons: [], 891 add: function(addon) {
892 if (this.addons.indexOf(addon) === -1) { 893 let k = this.addons.push(addon); 894 this.addons[k - 1].init(); 895 } 896 }, 897 remove: function(name) { 898 this.addons.filter(function(addon) { 899 if (addon.name === name) { 900 if (typeof addon.destroy != "undefined") { 901 addon.destroy(); 902 } 903 return false; 904 } else { 905 return true; 906 } 907 }); 908 } 909 }; 910}(); 911/* harmony default export */ var base = (base_AjaxSearchPro); 912 913;// external "DoMini" 914var external_DoMini_namespaceObject = Object(window.WPD)["DoMini"]; 915;// ./src/client/plugin/core/etc/helpers.js 916 917 918 919"use strict"; 920base.helpers.Hooks = window.WPD.Hooks; 921base.helpers.deviceType = function() { 922 let w = window.innerWidth; 923 if (w <= 640) { 924 return "phone"; 925 } else if (w <= 1024) { 926 return "tablet"; 927 } else { 928 return "desktop"; 929 } 930}; 931base.helpers.detectIOS = function() { 932 if (typeof window.navigator != "undefined" && typeof window.navigator.userAgent != "undefined") 933 return window.navigator.userAgent.match(/(iPod|iPhone|iPad)/) != null; 934 return false; 935}; 936base.helpers.isMobile = function() { 937 try { 938 document.createEvent("TouchEvent"); 939 return true; 940 } catch (e) { 941 return false; 942 } 943}; 944base.helpers.isTouchDevice = function() { 945 return "ontouchstart" in window; 946}; 947base.helpers.isSafari = function() { 948 return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 949}; 950base.helpers.escapeHtml = function(unsafe) { 951 return unsafe.replaceAll("&", "&").replaceAll("<", "<").replaceAll(">", ">").replaceAll('"', """).replaceAll("'", "'"); 952}; 953base.helpers.whichjQuery = function(plugin) { 954 let jq = false; 955 if (typeof window.$ != "undefined") { 956 if (typeof plugin === "undefined") { 957 jq = window.$; 958 } else { 959 if (typeof window.$.fn[plugin] != "undefined") { 960 jq = window.$; 961 } 962 } 963 } 964 if (jq === false && typeof window.jQuery != "undefined") { 965 jq = window.jQuery; 966 if (typeof plugin === "undefined") { 967 jq = window.jQuery; 968 } else { 969 if (typeof window.jQuery.fn[plugin] != "undefined") { 970 jq = window.jQuery; 971 } 972 } 973 } 974 return jq; 975}; 976base.helpers.formData = function(form, data) { 977 let $this = this, els = form.find("input,textarea,select,button").get(); 978 if (arguments.length === 1) { 979 data = {}; 980 els.forEach(function(el) { 981 if (el.name && !el.disabled && (el.checked || /select|textarea/i.test(el.nodeName) || /text/i.test(el.type) || external_DoMini_namespaceObject(el).hasClass("hasDatepicker") || external_DoMini_namespaceObject(el).hasClass("asp_slider_hidden"))) { 982 if (data[el.name] === void 0) { 983 data[el.name] = []; 984 } 985 if (external_DoMini_namespaceObject(el).hasClass("hasDatepicker")) { 986 data[el.name].push(external_DoMini_namespaceObject(el).parent().find(".asp_datepicker_hidden").val()); 987 } else { 988 data[el.name].push(external_DoMini_namespaceObject(el).val()); 989 } 990 } 991 }); 992 return JSON.stringify(data); 993 } else { 994 if (typeof data != "object") { 995 data = JSON.parse(data); 996 } 997 els.forEach(function(el) { 998 if (el.name) { 999 if (data[el.name]) { 1000 let names = data[el.name], _this = external_DoMini_namespaceObject(el); 1001 if (Object.prototype.toString.call(names) !== "[object Array]") { 1002 names = [names]; 1003 } 1004 if (el.type === "checkbox" || el.type === "radio") { 1005 let val = _this.val(), found = false; 1006 for (let i = 0; i < names.length; i++) { 1007 if (names[i] === val) { 1008 found = true; 1009 break; 1010 } 1011 } 1012 _this.prop("checked", found); 1013 } else { 1014 _this.val(names[0]); 1015 if (external_DoMini_namespaceObject(el).hasClass("asp_gochosen") || external_DoMini_namespaceObject(el).hasClass("asp_goselect2")) { 1016 WPD.intervalUntilExecute(function(_$) { 1017 _$(el).trigger("change.asp_select2"); 1018 }, function() { 1019 return $this.whichjQuery("asp_select2"); 1020 }, 50, 3); 1021 } else if (external_DoMini_namespaceObject(el).hasClass("hasDatepicker")) { 1022 WPD.intervalUntilExecute(function(_$) { 1023 let value = names[0], format = _$(_this.get(0)).datepicker("option", "dateFormat"); 1024 _$(_this.get(0)).datepicker("option", "dateFormat", "yy-mm-dd"); 1025 _$(_this.get(0)).datepicker("setDate", value); 1026 _$(_this.get(0)).datepicker("option", "dateFormat", format); 1027 _$(_this.get(0)).trigger("selectnochange"); 1028 }, function() { 1029 return $this.whichjQuery("datepicker"); 1030 }, 50, 3); 1031 } 1032 } 1033 } else { 1034 if (el.type === "checkbox" || el.type === "radio") { 1035 external_DoMini_namespaceObject(el).prop("checked", false); 1036 } 1037 } 1038 } 1039 }); 1040 return form; 1041 } 1042}; 1043base.helpers.submitToUrl = function(action, method, input, target) { 1044 let form; 1045 form = external_DoMini_namespaceObject('<form style="display: none;" />'); 1046 form.attr("action", action); 1047 form.attr("method", method); 1048 external_DoMini_namespaceObject("body").append(form); 1049 if (typeof input !== "undefined" && input !== null) { 1050 Object.keys(input).forEach(function(name) { 1051 let value = input[name]; 1052 let $input = external_DoMini_namespaceObject('<input type="hidden" />'); 1053 $input.attr("name", name); 1054 $input.attr("value", value); 1055 form.append($input); 1056 }); 1057 } 1058 if (typeof target != "undefined" && target === "new") { 1059 form.attr("target", "_blank"); 1060 } 1061 form.get(0).submit(); 1062}; 1063base.helpers.openInNewTab = function(url) { 1064 Object.assign(document.createElement("a"), { target: "_blank", href: url }).click(); 1065}; 1066base.helpers.isScrolledToBottom = function(el, tolerance) { 1067 return el.scrollHeight - el.scrollTop - external_DoMini_namespaceObject(el).outerHeight() < tolerance; 1068}; 1069base.helpers.getWidthFromCSSValue = function(width, containerWidth) { 1070 let min = 100, ret; 1071 width = width + ""; 1072 if (width.indexOf("px") > -1) { 1073 ret = parseInt(width, 10); 1074 } else if (width.indexOf("%") > -1) { 1075 if (typeof containerWidth != "undefined" && containerWidth != null) { 1076 ret = Math.floor(parseInt(width, 10) / 100 * containerWidth); 1077 } else { 1078 ret = parseInt(width, 10); 1079 } 1080 } else { 1081 ret = parseInt(width, 10); 1082 } 1083 return ret < 100 ? min : ret; 1084}; 1085base.helpers.nicePhrase = function(s) { 1086 return encodeURIComponent(s).replace(/\%20/g, "+"); 1087}; 1088base.helpers.inputToFloat = function(input) {
1089 return input.replace(/^[.]/g, "").replace(/[^0-9.-]/g, "").replace(/^[-]/g, "x").replace(/[-]/g, "").replace(/[x]/g, "-").replace(/(\..*?)\..*/g, "$1"); 1090}; 1091base.helpers.addThousandSeparators = function(n, s) { 1092 if (s !== "") { 1093 s = s || ","; 1094 return String(n).replace(/(?:^|[^.\d])\d+/g, function(n2) { 1095 return n2.replace(/\B(?=(?:\d{3})+\b)/g, s); 1096 }); 1097 } else { 1098 return n; 1099 } 1100}; 1101base.helpers.decodeHTMLEntities = function(str) { 1102 let element = document.createElement("div"); 1103 if (str && typeof str === "string") { 1104 str = str.replace(/<script[^>]*>([\S\s]*?)<\/script>/gmi, ""); 1105 str = str.replace(/<\/?\w(?:[^"'>]|"[^"]*"|'[^']*')*>/gmi, ""); 1106 element.innerHTML = str; 1107 str = element.textContent; 1108 element.textContent = ""; 1109 } 1110 return str; 1111}; 1112base.helpers.isScrolledToRight = function(el) { 1113 return el.scrollWidth - external_DoMini_namespaceObject(el).outerWidth() === el.scrollLeft; 1114}; 1115base.helpers.isScrolledToLeft = function(el) { 1116 return el.scrollLeft === 0; 1117}; 1118/* harmony default export */ var helpers = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 1119 1120;// ./src/client/plugin/core/actions/animation.js 1121 1122 1123 1124"use strict"; 1125base.plugin.addAnimation = function() { 1126 let $this = this, i = 0, j = 1, delay = 25, checkViewport = true; 1127 if ($this.call_num > 0 || $this._no_animations) { 1128 $this.n("results").find(".item, .asp_group_header").removeClass("opacityZero").removeClass("asp_an_" + $this.animOptions.items); 1129 return false; 1130 } 1131 $this.n("results").find(".item, .asp_group_header").forEach(function() { 1132 let x = this; 1133 if (j === 1) { 1134 checkViewport = external_DoMini_namespaceObject(x).inViewPort(0); 1135 } 1136 if (j > 1 && checkViewport && !external_DoMini_namespaceObject(x).inViewPort(0) || j > 80) { 1137 external_DoMini_namespaceObject(x).removeClass("opacityZero"); 1138 return true; 1139 } 1140 if ($this.o.resultstype === "isotopic" && j > $this.il.itemsPerPage) { 1141 external_DoMini_namespaceObject(x).removeClass("opacityZero"); 1142 return; 1143 } 1144 setTimeout(function() { 1145 external_DoMini_namespaceObject(x).addClass("asp_an_" + $this.animOptions.items); 1146 external_DoMini_namespaceObject(x).removeClass("opacityZero"); 1147 }, i + delay); 1148 i = i + 45; 1149 j++; 1150 }); 1151}; 1152base.plugin.removeAnimation = function() { 1153 let $this = this; 1154 this.n("items").forEach(function() { 1155 external_DoMini_namespaceObject(this).removeClass("asp_an_" + $this.animOptions.items); 1156 }); 1157}; 1158/* harmony default export */ var animation = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 1159 1160;// ./src/client/plugin/core/actions/filters.js 1161 1162 1163 1164"use strict"; 1165let filters_helpers = base.helpers; 1166base.plugin.setFilterStateInput = function(timeout) { 1167 let $this = this; 1168 if (typeof timeout == "undefined") { 1169 timeout = 65; 1170 } 1171 let process = function() { 1172 if (JSON.stringify($this.originalFormData) !== JSON.stringify(filters_helpers.formData(external_DoMini_namespaceObject("form", $this.n("searchsettings"))))) { 1173 $this.n("searchsettings").find("input[name=filters_initial]").val(0); 1174 } else { 1175 $this.n("searchsettings").find("input[name=filters_initial]").val(1); 1176 } 1177 }; 1178 if (timeout === 0) { 1179 process(); 1180 } else { 1181 setTimeout(function() { 1182 process(); 1183 }, timeout); 1184 } 1185}; 1186base.plugin.resetSearchFilters = function() { 1187 let $this = this; 1188 if (typeof $this.originalFormData === "undefined") { 1189 return; 1190 } 1191 filters_helpers.formData(external_DoMini_namespaceObject("form", $this.n("searchsettings")), $this.originalFormData); 1192 $this.resetNoUISliderFilters(); 1193 if (typeof $this.select2jQuery != "undefined") { 1194 $this.select2jQuery($this.n("searchsettings").get(0)).find(".asp_gochosen,.asp_goselect2").trigger("change.asp_select2"); 1195 } 1196 $this.n("text").val(""); 1197 $this.n("textAutocomplete").val(""); 1198 $this.n("proloading").css("display", "none"); 1199 $this.hideLoader(); 1200 $this.searchAbort(); 1201 $this.setFilterStateInput(0); 1202 $this.n("searchsettings").trigger("set_option_checked"); 1203}; 1204base.plugin.resetNoUISliderFilters = function() { 1205 if (this.noUiSliders.length > 0) {
1206 this.noUiSliders.forEach(function(slider) { 1207 if (typeof slider.noUiSlider != "undefined") { 1208 let vals = []; 1209 external_DoMini_namespaceObject(slider).parent().find(".asp_slider_hidden").forEach(function(el) { 1210 vals.push(external_DoMini_namespaceObject(el).val()); 1211 }); 1212 if (vals.length > 0) { 1213 slider.noUiSlider.set(vals); 1214 } 1215 } 1216 }); 1217 } 1218}; 1219/* harmony default export */ var filters = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 1220 1221;// ./src/client/plugin/core/actions/loader.js 1222 1223 1224 1225"use strict"; 1226base.plugin.showMoreResLoader = function() { 1227 let $this = this; 1228 $this.n("resultsDiv").addClass("asp_more_res_loading"); 1229}; 1230base.plugin.showLoader = function(recall) { 1231 let $this = this; 1232 recall = typeof recall !== "undefined" ? recall : false; 1233 if ($this.o.loaderLocation === "none") return; 1234 if (!$this.n("search").hasClass("hiddend") && $this.o.loaderLocation !== "results") { 1235 $this.n("proloading").css({ 1236 display: "block" 1237 }); 1238 } 1239 if (recall !== false) { 1240 return false; 1241 } 1242 if ($this.n("search").hasClass("hiddend") && $this.o.loaderLocation !== "search" || !$this.n("search").hasClass("hiddend") && ($this.o.loaderLocation === "both" || $this.o.loaderLocation === "results")) { 1243 if (!$this.usingLiveLoader()) { 1244 if ($this.n("resultsDiv").find(".asp_results_top").length > 0) 1245 $this.n("resultsDiv").find(".asp_results_top").css("display", "none"); 1246 $this.showResultsBox(); 1247 external_DoMini_namespaceObject(".asp_res_loader", $this.n("resultsDiv")).removeClass("hiddend"); 1248 $this.n("results").css("display", "none"); 1249 $this.n("showmoreContainer").css("display", "none"); 1250 if (typeof $this.hidePagination !== "undefined") { 1251 $this.hidePagination(); 1252 } 1253 } 1254 } 1255}; 1256base.plugin.hideLoader = function() { 1257 let $this = this; 1258 $this.n("proloading").css({ 1259 display: "none" 1260 }); 1261 external_DoMini_namespaceObject(".asp_res_loader", $this.n("resultsDiv")).addClass("hiddend"); 1262 $this.n("results").css("display", ""); 1263 $this.n("resultsDiv").removeClass("asp_more_res_loading"); 1264}; 1265/* harmony default export */ var loader = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 1266 1267;// ./src/client/plugin/core/actions/other.js 1268 1269 1270 1271"use strict"; 1272base.plugin.loadASPFonts = function() { 1273 if (ASP.font_url !== false) { 1274 let font = new FontFace( 1275 "asppsicons2", 1276 "url(" + ASP.font_url.replace("http:", "") + ")", 1277 { style: "normal", weight: "normal", display: "swap" } 1278 ); 1279 font.load().then(function(loaded_face) { 1280 document.fonts.add(loaded_face); 1281 }).catch(function(er) { 1282 }); 1283 ASP.font_url = false; 1284 } 1285}; 1286base.plugin.updateHref = function(anchor) { 1287 anchor = anchor || window.location.hash; 1288 if (this.o.trigger.update_href && !this.usingLiveLoader()) { 1289 if (!window.location.origin) { 1290 window.location.origin = window.location.protocol + "//" + window.location.hostname + (window.location.port ? ":" + window.location.port : ""); 1291 } 1292 let url = this.getStateURL() + (this.resultsOpened ? "&asp_s=" : "&asp_ls=") + this.n("text").val() + anchor; 1293 history.replaceState("", "", url.replace(location.origin, "")); 1294 } 1295}; 1296base.plugin.fixClonedSelf = function() { 1297 let $this = this, old_instance_id = String($this.o.iid), old_real_id = String($this.o.rid); 1298 while (!ASP.instances.set($this)) { 1299 ++$this.o.iid; 1300 if ($this.o.iid > 50) { 1301 break; 1302 } 1303 } 1304 if (old_instance_id !== $this.o.iid) { 1305 $this.o.rid = $this.o.id + "_" + $this.o.iid; 1306 $this.n("search").get(0).id = "ajaxsearchpro" + $this.o.rid; 1307 $this.n("search").removeClass("asp_m_" + old_real_id).addClass("asp_m_" + $this.o.rid).data("instance", $this.o.iid); 1308 $this.n("container").removeClass("asp_w_container_" + old_real_id).addClass("asp_w_container_" + $this.o.rid).data("instance", $this.o.iid); 1309 $this.n("searchsettings").get(0).id = $this.n("searchsettings").get(0).id.replace("settings" + old_real_id, "settings" + $this.o.rid); 1310 if ($this.n("searchsettings").hasClass("asp_s_" + old_real_id)) { 1311 $this.n("searchsettings").removeClass("asp_s_" + old_real_id).addClass("asp_s_" + $this.o.rid).data("instance", $this.o.iid); 1312 } else { 1313 $this.n("searchsettings").removeClass("asp_sb_" + old_real_id).addClass("asp_sb_" + $this.o.rid).data("instance", $this.o.iid); 1314 } 1315 $this.n("resultsDiv").get(0).id = $this.n("resultsDiv").get(0).id.replace("prores" + old_real_id, "prores" + $this.o.rid); 1316 $this.n("resultsDiv").removeClass("asp_r_" + old_real_id).addClass("asp_r_" + $this.o.rid).data("instance", $this.o.iid); 1317 $this.n("container").find(".asp_init_data").data("instance", $this.o.iid); 1318 $this.n("container").find(".asp_init_data").get(0).id = $this.n("container").find(".asp_init_data").get(0).id.replace("asp_init_id_" + old_real_id, "asp_init_id_" + $this.o.rid); 1319 $this.n("prosettings").data("opened", 0); 1320 } 1321}; 1322base.plugin.destroy = function() {
1323 let $this = this; 1324 Object.keys($this.nodes).forEach(function(k) { 1325 $this.nodes[k].off?.(); 1326 }); 1327 if (typeof $this.n("searchsettings").get(0).referenced !== "undefined") { 1328 --$this.n("searchsettings").get(0).referenced; 1329 if ($this.n("searchsettings").get(0).referenced < 0) { 1330 $this.n("searchsettings").remove(); 1331 } 1332 } else { 1333 $this.n("searchsettings").remove(); 1334 } 1335 if (typeof $this.n("resultsDiv").get(0).referenced !== "undefined") { 1336 --$this.n("resultsDiv").get(0).referenced; 1337 if ($this.n("resultsDiv").get(0).referenced < 0) { 1338 $this.n("resultsDiv").remove?.(); 1339 } 1340 } else { 1341 $this.n("resultsDiv").remove?.(); 1342 } 1343 $this.n("trythis").remove?.(); 1344 $this.n("search").remove?.(); 1345 $this.n("container").remove?.(); 1346 $this.documentEventHandlers.forEach(function(h) { 1347 external_DoMini_namespaceObject(h.node).off(h.event, h.handler); 1348 }); 1349}; 1350/* harmony default export */ var other = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 1351 1352;// ./src/client/plugin/core/actions/redirect.js 1353 1354 1355 1356"use strict"; 1357let redirect_helpers = base.helpers; 1358base.plugin.isRedirectToFirstResult = function() { 1359 let $this = this; 1360 return (external_DoMini_namespaceObject(".asp_res_url", $this.n("resultsDiv")).length > 0 || external_DoMini_namespaceObject(".asp_es_" + $this.o.id + " a").length > 0 || $this.o.resPage.useAjax && external_DoMini_namespaceObject($this.o.resPage.selector + "a").length > 0) && ($this.o.redirectOnClick && $this.ktype === "click" && $this.o.trigger.click === "first_result" || $this.o.redirectOnEnter && ($this.ktype === "input" || $this.ktype === "keyup") && $this.keycode === 13 && $this.o.trigger.return === "first_result" || $this.ktype === "button" && $this.o.sb.redirect_action === "first_result"); 1361}; 1362base.plugin.doRedirectToFirstResult = function() { 1363 let $this = this, _loc, url; 1364 if ($this.ktype === "click") { 1365 _loc = $this.o.trigger.click_location; 1366 } else if ($this.ktype === "button") { 1367 _loc = $this.o.sb.redirect_location; 1368 } else { 1369 _loc = $this.o.trigger.return_location; 1370 } 1371 if (external_DoMini_namespaceObject(".asp_res_url", $this.n("resultsDiv")).length > 0) { 1372 url = external_DoMini_namespaceObject(external_DoMini_namespaceObject(".asp_res_url", $this.n("resultsDiv")).get(0)).attr("href"); 1373 } else if (external_DoMini_namespaceObject(".asp_es_" + $this.o.id + " a").length > 0) { 1374 url = external_DoMini_namespaceObject(external_DoMini_namespaceObject(".asp_es_" + $this.o.id + " a").get(0)).attr("href"); 1375 } else if ($this.o.resPage.useAjax && external_DoMini_namespaceObject($this.o.resPage.selector + "a").length > 0) { 1376 url = external_DoMini_namespaceObject(external_DoMini_namespaceObject($this.o.resPage.selector + "a").get(0)).attr("href"); 1377 } 1378 if (url !== "") { 1379 if (_loc === "same") { 1380 location.href = url; 1381 } else { 1382 redirect_helpers.openInNewTab(url); 1383 } 1384 $this.hideLoader(); 1385 $this.hideResults(); 1386 } 1387 return false; 1388}; 1389base.plugin.doRedirectToResults = function(ktype) { 1390 let $this = this, _loc; 1391 if (typeof $this.reportSettingsValidity != "undefined" && !$this.reportSettingsValidity()) { 1392 $this.showNextInvalidFacetMessage?.(); 1393 return false; 1394 } 1395 if (ktype === "click") { 1396 _loc = $this.o.trigger.click_location; 1397 } else if (ktype === "button") { 1398 _loc = $this.o.sb.redirect_location; 1399 } else { 1400 _loc = $this.o.trigger.return_location; 1401 } 1402 let url = $this.getRedirectURL(ktype); 1403 if ($this.o.overridewpdefault) { 1404 if ($this.o.resPage.useAjax) { 1405 $this.hideResults(); 1406 $this.liveLoad($this.o.resPage.selector, url); 1407 $this.showLoader(); 1408 if ($this.att("blocking") === false) { 1409 $this.hideSettings?.(); 1410 } 1411 return false; 1412 } 1413 if ($this.o.override_method === "post") { 1414 redirect_helpers.submitToUrl(url, "post", { 1415 asp_active: 1, 1416 p_asid: $this.o.id, 1417 p_asp_data: external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() 1418 }, _loc); 1419 } else { 1420 if (_loc === "same") { 1421 location.href = url; 1422 } else { 1423 redirect_helpers.openInNewTab(url); 1424 } 1425 } 1426 } else { 1427 redirect_helpers.submitToUrl(url, "post", { 1428 np_asid: $this.o.id, 1429 np_asp_data: external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() 1430 }, _loc); 1431 } 1432 $this.n("proloading").css("display", "none"); 1433 $this.hideLoader(); 1434 if ($this.att("blocking") === false) $this.hideSettings?.(); 1435 $this.hideResults(); 1436 $this.searchAbort(); 1437}; 1438base.plugin.getRedirectURL = function(ktype) {
1439 let $this = this, url, source, final, base_url; 1440 ktype = typeof ktype !== "undefined" ? ktype : "enter"; 1441 if (ktype === "click") { 1442 source = $this.o.trigger.click; 1443 } else if (ktype === "button") { 1444 source = $this.o.sb.redirect_action; 1445 } else { 1446 source = $this.o.trigger.return; 1447 } 1448 if (source === "results_page") { 1449 url = "?s=" + redirect_helpers.nicePhrase($this.n("text").val()); 1450 } else if (source === "woo_results_page") { 1451 url = "?post_type=product&s=" + redirect_helpers.nicePhrase($this.n("text").val()); 1452 } else { 1453 if (ktype === "button") { 1454 base_url = source === "elementor_page" ? $this.o.sb.elementor_url : $this.o.sb.redirect_url; 1455 base_url = redirect_helpers.decodeHTMLEntities(base_url); 1456 url = $this.parseCustomRedirectURL(base_url, $this.n("text").val()); 1457 } else { 1458 base_url = source === "elementor_page" ? $this.o.trigger.elementor_url : $this.o.trigger.redirect_url; 1459 base_url = redirect_helpers.decodeHTMLEntities(base_url); 1460 url = $this.parseCustomRedirectURL(base_url, $this.n("text").val()); 1461 } 1462 } 1463 if ($this.o.homeurl.indexOf("?") > 1 && url.indexOf("?") === 0) { 1464 url = url.replace("?", "&"); 1465 } 1466 if ($this.o.overridewpdefault && $this.o.override_method !== "post") { 1467 let start = "&"; 1468 if (($this.o.homeurl.indexOf("?") === -1 || source === "elementor_page") && url.indexOf("?") === -1) { 1469 start = "?"; 1470 } 1471 let addUrl = url + start + "asp_active=1&p_asid=" + $this.o.id + "&p_asp_data=1&" + external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize(); 1472 if (source === "elementor_page") { 1473 final = addUrl; 1474 } else { 1475 final = $this.o.homeurl + addUrl; 1476 } 1477 } else { 1478 if (source === "elementor_page") { 1479 final = url; 1480 } else { 1481 final = $this.o.homeurl + url; 1482 } 1483 } 1484 final = final.replace("https://", "https:///"); 1485 final = final.replace("http://", "http:///"); 1486 final = final.replace(/\/\//g, "/"); 1487 return redirect_helpers.Hooks.applyFilters("asp_redirect_url", final, $this.o.id, $this.o.iid); 1488}; 1489base.plugin.parseCustomRedirectURL = function(url, phrase) { 1490 let $this = this, u = redirect_helpers.decodeHTMLEntities(url).replace(/{phrase}/g, redirect_helpers.nicePhrase(phrase)), items = u.match(/{(.*?)}/g); 1491 if (items !== null) { 1492 items.forEach(function(v) { 1493 v = v.replace(/[{}]/g, ""); 1494 let node = external_DoMini_namespaceObject('input[type=radio][name*="aspf[' + v + '_"]:checked', $this.n("searchsettings")); 1495 if (node.length === 0) 1496 node = external_DoMini_namespaceObject('input[type=text][name*="aspf[' + v + '_"]', $this.n("searchsettings")); 1497 if (node.length === 0) 1498 node = external_DoMini_namespaceObject('input[type=hidden][name*="aspf[' + v + '_"]', $this.n("searchsettings")); 1499 if (node.length === 0) 1500 node = external_DoMini_namespaceObject('select[name*="aspf[' + v + '_"]:not([multiple])', $this.n("searchsettings")); 1501 if (node.length === 0) 1502 node = external_DoMini_namespaceObject('input[type=radio][name*="termset[' + v + '"]:checked', $this.n("searchsettings")); 1503 if (node.length === 0) 1504 node = external_DoMini_namespaceObject('input[type=text][name*="termset[' + v + '"]', $this.n("searchsettings")); 1505 if (node.length === 0) 1506 node = external_DoMini_namespaceObject('input[type=hidden][name*="termset[' + v + '"]', $this.n("searchsettings")); 1507 if (node.length === 0) 1508 node = external_DoMini_namespaceObject('select[name*="termset[' + v + '"]:not([multiple])', $this.n("searchsettings")); 1509 if (node.length === 0) 1510 return true; 1511 let val = node.val(); 1512 val = "" + val; 1513 u = u.replace("{" + v + "}", val); 1514 }); 1515 } 1516 return u; 1517}; 1518/* harmony default export */ var redirect = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 1519 1520;// ./src/client/plugin/core/actions/results.js 1521 1522 1523 1524"use strict"; 1525let results_helpers = base.helpers; 1526base.plugin.showResults = function() { 1527 let $this = this; 1528 results_helpers.Hooks.applyFilters("asp/results/show/start", $this); 1529 $this.initResults(); 1530 if ($this.o.resultstype === "horizontal") { 1531 $this.createHorizontalScroll(); 1532 } else { 1533 if ($this.o.resultstype === "vertical") { 1534 $this.createVerticalScroll(); 1535 } 1536 } 1537 switch ($this.o.resultstype) { 1538 case "horizontal": 1539 $this.showHorizontalResults(); 1540 break; 1541 case "vertical": 1542 $this.showVerticalResults(); 1543 break; 1544 case "polaroid": 1545 $this.showPolaroidResults(); 1546 break; 1547 case "isotopic": 1548 $this.showIsotopicResults(); 1549 break; 1550 default: 1551 $this.showHorizontalResults(); 1552 break; 1553 } 1554 $this.showAnimatedImages(); 1555 $this.hideLoader(); 1556 if (!$this.n("proclose").hasClass("--skip")) { 1557 $this.n("proclose").css({ 1558 display: "block" 1559 }); 1560 } 1561 $this.n("proclose").removeClass("--skip"); 1562 if (results_helpers.isMobile() && $this.o.mobile.hide_keyboard && !$this.resultsOpened) 1563 document.activeElement.blur(); 1564 if ($this.o.settingsHideOnRes && $this.att("blocking") === false) 1565 $this.hideSettings?.(); 1566 $this.eh.resulsDivHoverMouseEnter = $this.eh.resulsDivHoverMouseEnter || function() { 1567 external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).removeClass("hovered"); 1568 external_DoMini_namespaceObject(this).addClass("hovered"); 1569 }; 1570 $this.eh.resulsDivHoverMouseLeave = $this.eh.resulsDivHoverMouseLeave || function() { 1571 external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).removeClass("hovered"); 1572 }; 1573 $this.n("resultsDiv").find(".item").on("mouseenter", $this.eh.resulsDivHoverMouseEnter); 1574 $this.n("resultsDiv").find(".item").on("mouseleave", $this.eh.resulsDivHoverMouseLeave); 1575 $this.fixSettingsAccessibility(); 1576 $this.resultsOpened = true; 1577 results_helpers.Hooks.addFilter("asp/results/show/end", $this); 1578}; 1579base.plugin.hideResults = function(blur) {
1580 let $this = this; 1581 blur = typeof blur == "undefined" ? true : blur; 1582 $this.initResults(); 1583 if (!$this.resultsOpened) return false; 1584 $this.n("resultsDiv").removeClass($this.resAnim.showClass).addClass($this.resAnim.hideClass); 1585 setTimeout(function() { 1586 $this.n("resultsDiv").css($this.resAnim.hideCSS); 1587 }, $this.resAnim.duration); 1588 $this.n("proclose").css({ 1589 display: "none" 1590 }); 1591 if (results_helpers.isMobile() && blur) 1592 document.activeElement.blur(); 1593 $this.resultsOpened = false; 1594 if (typeof $this.ptstack != "undefined") 1595 delete $this.ptstack; 1596 $this.hideArrowBox?.(); 1597 $this.n("s").trigger("asp_results_hide", [$this.o.id, $this.o.iid], true, true); 1598}; 1599base.plugin.updateResults = function(html) { 1600 let $this = this; 1601 if (html.replace(/^\s*[\r\n]/gm, "") === "" || external_DoMini_namespaceObject(html).hasClass("asp_nores") || external_DoMini_namespaceObject(html).find(".asp_nores").length > 0) { 1602 $this.n("showmoreContainer").css("display", "none"); 1603 external_DoMini_namespaceObject("span", $this.n("showmore")).html(""); 1604 } else { 1605 if ($this.o.resultstype === "isotopic" && $this.call_num > 0 && $this.isotopic != null && typeof $this.isotopic.appended != "undefined" && $this.n("items").length > 0) { 1606 let $items = external_DoMini_namespaceObject(html), $last = $this.n("items").last(), last = parseInt($this.n("items").last().attr("data-itemnum")); 1607 $items.get().forEach(function(el) { 1608 external_DoMini_namespaceObject(el).attr("data-itemnum", ++last).css({ 1609 "width": $last.css("width"), 1610 "height": $last.css("height") 1611 }); 1612 }); 1613 $this.n("resdrg").append($items); 1614 $this.isotopic.appended($items.get()); 1615 $this.nodes.items = external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).length > 0 ? external_DoMini_namespaceObject(".item", $this.n("resultsDiv")) : external_DoMini_namespaceObject(".photostack-flip", $this.n("resultsDiv")); 1616 } else { 1617 if ($this.call_num > 0 && $this.o.resultstype === "vertical") { 1618 $this.n("resdrg").html($this.n("resdrg").html() + '<div class="asp_v_spacer"></div>' + html); 1619 } else { 1620 $this.n("resdrg").html($this.n("resdrg").html() + html); 1621 } 1622 } 1623 } 1624}; 1625base.plugin.showResultsBox = function() { 1626 let $this = this; 1627 $this.initResults(); 1628 $this.n("s").trigger("asp_results_show", [$this.o.id, $this.o.iid], true, true); 1629 $this.n("resultsDiv").css({ 1630 display: "block", 1631 height: "auto" 1632 }); 1633 $this.n("results").find(".item, .asp_group_header").addClass($this.animationOpacity); 1634 $this.n("resultsDiv").css($this.resAnim.showCSS); 1635 $this.n("resultsDiv").removeClass($this.resAnim.hideClass).addClass($this.resAnim.showClass); 1636 $this.fixResultsPosition(true); 1637}; 1638base.plugin.keywordHighlight = function() { 1639 const $this = this; 1640 if (!$this.o.highlight) { 1641 return; 1642 } 1643 const phrase = $this.n("text").val().replace(/["']/g, ""); 1644 if (phrase === "" || phrase.length < $this.o.trigger.minWordLength) { 1645 return; 1646 } 1647 const words = phrase.trim().split(" ").filter((s) => s.length >= $this.o.trigger.minWordLength); 1648 $this.n("resultsDiv").find("figcaption, div.item").highlight([phrase.trim()], { 1649 element: "span", 1650 className: "highlighted", 1651 wordsOnly: $this.o.highlightWholewords 1652 }); 1653 if (words.length > 0) { 1654 $this.n("resultsDiv").find("figcaption, div.item").highlight(words, { 1655 element: "span", 1656 className: "highlighted", 1657 wordsOnly: $this.o.highlightWholewords 1658 }); 1659 } 1660}; 1661base.plugin.addHighlightString = function($items) { 1662 let $this = this, phrase = $this.n("text").val().replace(/["']/g, ""); 1663 $items = typeof $items == "undefined" ? $this.n("items").find("a.asp_res_url") : $items; 1664 if ($this.o.singleHighlight && phrase !== "" && $items.length > 0) { 1665 $items.forEach(function() { 1666 try { 1667 const url = new URL(external_DoMini_namespaceObject(this).attr("href")); 1668 url.searchParams.set("asp_highlight", phrase); 1669 url.searchParams.set("p_asid", $this.o.id); 1670 external_DoMini_namespaceObject(this).attr("href", url.href); 1671 } catch (e) { 1672 } 1673 }); 1674 } 1675}; 1676base.plugin.scrollToResults = function() {
1677 let $this = this, tolerance = Math.floor(window.innerHeight * 0.1), stop; 1678 if (!$this.resultsOpened || $this.call_num > 0 || !$this.o.scrollToResults.enabled || $this.n("search").closest(".asp_preview_data").length > 0 || $this.o.compact.enabled || $this.n("resultsDiv").inViewPort(tolerance)) return; 1679 if ($this.o.resultsposition === "hover") { 1680 stop = $this.n("probox").offset().top - 20; 1681 } else { 1682 stop = $this.n("resultsDiv").offset().top - 20; 1683 } 1684 stop = stop + $this.o.scrollToResults.offset; 1685 let $adminbar = external_DoMini_namespaceObject("#wpadminbar"); 1686 if ($adminbar.length > 0) 1687 stop -= $adminbar.height(); 1688 stop = stop < 0 ? 0 : stop; 1689 window.scrollTo({ top: stop, behavior: "smooth" }); 1690}; 1691base.plugin.scrollToResult = function(id) { 1692 let $el = external_DoMini_namespaceObject(id); 1693 if ($el.length && !$el.inViewPort(40)) { 1694 $el.get(0).scrollIntoView({ behavior: "smooth", block: "center", inline: "nearest" }); 1695 } 1696}; 1697base.plugin.showAnimatedImages = function() { 1698 let $this = this; 1699 $this.n("items").forEach(function() { 1700 let $image = external_DoMini_namespaceObject(this).find(".asp_image[data-src]"), src = $image.data("src"); 1701 if (typeof src != "undefined" && src != null && src !== "" && src.indexOf(".gif") > -1) { 1702 if ($image.find("canvas").length === 0) { 1703 $image.prepend(external_DoMini_namespaceObject('<div class="asp_item_canvas"><canvas></canvas></div>').get(0)); 1704 let c = external_DoMini_namespaceObject(this).find("canvas").get(0), $cc = external_DoMini_namespaceObject(this).find(".asp_item_canvas"), ctx = c.getContext("2d"), img = new Image(); 1705 img.crossOrigin = "anonymous"; 1706 img.onload = function() { 1707 external_DoMini_namespaceObject(c).attr({ 1708 "width": img.width, 1709 "height": img.height 1710 }); 1711 ctx.drawImage(img, 0, 0, img.width, img.height); 1712 $cc.css({ 1713 "background-image": "url(" + c.toDataURL() + ")" 1714 }); 1715 }; 1716 img.src = src; 1717 } 1718 } 1719 }); 1720}; 1721base.plugin.updateNoResultsHeader = function() { 1722 let $this = this, $new_nores = $this.n("resdrg").find(".asp_nores"), $old_nores; 1723 if ($new_nores.length > 0) { 1724 $new_nores = $new_nores.detach(); 1725 } 1726 $old_nores = $this.n("resultsDiv").find(".asp_nores"); 1727 if ($old_nores.length > 0) { 1728 $old_nores.remove(); 1729 } 1730 if ($new_nores.length > 0) { 1731 $this.n("resultsDiv").prepend($new_nores); 1732 $this.n("resultsDiv").find(".asp_keyword").on("click", function() { 1733 $this.n("text").val(results_helpers.decodeHTMLEntities(external_DoMini_namespaceObject(this).text())); 1734 $this.n("textAutocomplete").val(""); 1735 if (!$this.o.redirectOnClick || !$this.o.redirectOnEnter || $this.o.trigger.type) { 1736 $this.search(); 1737 } 1738 }); 1739 } 1740}; 1741base.plugin.updateInfoHeader = function(totalCount) { 1742 let $this = this, content = "", $rt = $this.n("resultsDiv").find(".asp_results_top"), phrase = $this.n("text").val().trim(); 1743 if ($rt.length > 0) { 1744 if ($this.n("items").length <= 0 || $this.n("resultsDiv").find(".asp_nores").length > 0) { 1745 $rt.css("display", "none"); 1746 } else { 1747 if (typeof $this.updateInfoHeader.resInfoBoxTxt == "undefined") { 1748 $this.updateInfoHeader.resInfoBoxTxt = $this.n("resultsDiv").find(".asp_results_top .asp_rt_phrase").length > 0 ? $this.n("resultsDiv").find(".asp_results_top .asp_rt_phrase").html() : ""; 1749 $this.updateInfoHeader.resInfoBoxTxtNoPhrase = $this.n("resultsDiv").find(".asp_results_top .asp_rt_nophrase").length > 0 ? $this.n("resultsDiv").find(".asp_results_top .asp_rt_nophrase").html() : ""; 1750 } 1751 if (phrase !== "" && $this.updateInfoHeader.resInfoBoxTxt !== "") { 1752 content = $this.updateInfoHeader.resInfoBoxTxt; 1753 } else if (phrase === "" && $this.updateInfoHeader.resInfoBoxTxtNoPhrase !== "") { 1754 content = $this.updateInfoHeader.resInfoBoxTxtNoPhrase; 1755 } 1756 if (content === void 0) { 1757 return; 1758 } 1759 if (content !== "") { 1760 content = content.replaceAll("{phrase}", results_helpers.escapeHtml($this.n("text").val())); 1761 content = content.replaceAll("{results_count}", $this.n("items").length); 1762 content = content.replaceAll("{results_count_total}", totalCount); 1763 $rt.html(content); 1764 $rt.css("display", "block"); 1765 } else { 1766 $rt.css("display", "none"); 1767 } 1768 } 1769 } 1770}; 1771 1772;// ./src/client/plugin/core/actions/scroll.js 1773 1774 1775 1776"use strict"; 1777let scroll_helpers = base.helpers; 1778base.plugin.createResultsScroll = function(type) {
1779 let $this = this, t, $resScroll = $this.n("results"); 1780 type = typeof type == "undefined" ? "vertical" : type; 1781 $resScroll.on("scroll", function() { 1782 if ($this.o.show_more.infinite) { 1783 clearTimeout(t); 1784 t = setTimeout(function() { 1785 $this.checkAndTriggerInfiniteScroll(type); 1786 }, 60); 1787 } 1788 }); 1789}; 1790base.plugin.createVerticalScroll = function() { 1791 this.createResultsScroll("vertical"); 1792}; 1793base.plugin.createHorizontalScroll = function() { 1794 this.createResultsScroll("horizontal"); 1795}; 1796base.plugin.checkAndTriggerInfiniteScroll = function(caller) { 1797 let $this = this, $r = external_DoMini_namespaceObject(".item", $this.n("resultsDiv")); 1798 caller = typeof caller == "undefined" ? "window" : caller; 1799 if ($this.n("showmore").length === 0 || $this.n("showmoreContainer").css("display") === "none") { 1800 return false; 1801 } 1802 if (caller === "window" || caller === "horizontal") { 1803 if ($this.o.resultstype === "isotopic" && external_DoMini_namespaceObject("nav.asp_navigation", $this.n("resultsDiv")).css("display") !== "none") { 1804 return false; 1805 } 1806 let onViewPort = $r.last().inViewPort(0, $this.n("resultsDiv").get(0)), onScreen = $r.last().inViewPort(0); 1807 if (!$this.searching && $r.length > 0 && onViewPort && onScreen) { 1808 $this.n("showmore").find("a.asp_showmore").trigger("click"); 1809 } 1810 } else if (caller === "vertical") { 1811 let $scrollable = $this.n("results"); 1812 if (scroll_helpers.isScrolledToBottom($scrollable.get(0), 20)) { 1813 $this.n("showmore").find("a.asp_showmore").trigger("click"); 1814 } 1815 } else if (caller === "isotopic") { 1816 if (!$this.searching && $r.length > 0 && $this.n("resultsDiv").find("nav.asp_navigation ul li").last().hasClass("asp_active")) { 1817 $this.n("showmore").find("a.asp_showmore").trigger("click"); 1818 } 1819 } 1820}; 1821 1822;// ./src/client/global/utils/other.ts 1823 1824function buildRestUrl(base, path, params = {}) { 1825 const url = base + path; 1826 const entries = Object.entries(params); 1827 if (entries.length === 0) return url; 1828 const sep = url.includes("?") ? "&" : "?"; 1829 return url + sep + entries.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&"); 1830} 1831const nicePhrase = function(s) { 1832 return encodeURIComponent(s).replace(/\%20/g, "+"); 1833}; 1834function isNumeric(input) { 1835 if (typeof input === "number" && !isNaN(input)) { 1836 return true; 1837 } 1838 if (typeof input === "string") { 1839 const trimmed = input.trim(); 1840 if (trimmed === "") return false; 1841 const num = Number(trimmed); 1842 return !isNaN(num) && trimmed === String(num).trim(); 1843 } 1844 return false; 1845} 1846function md5(str) { 1847 const bytes = new TextEncoder().encode(str); 1848 const len = bytes.length; 1849 const paddedLen = (len + 8 >>> 6 << 6) + 64; 1850 const padded = new Uint8Array(paddedLen); 1851 padded.set(bytes); 1852 padded[len] = 128; 1853 const view = new DataView(padded.buffer); 1854 view.setUint32(paddedLen - 8, len << 3 >>> 0, true); 1855 view.setUint32(paddedLen - 4, len >>> 29, true); 1856 let a = 1732584193, b = 4023233417, c = 2562383102, d = 271733878; 1857 const s = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]; 1858 const k = [3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426, 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134, 1804603682, 4254626195, 2792965006, 1236535329, 4129170786, 3225465664, 643717713, 3921069994, 3593408605, 38016083, 3634488961, 3889429448, 568446438, 3275163606, 4107603335, 1163531501, 2850285829, 4243563512, 1735328473, 2368359562, 4294588738, 2272392833, 1839030562, 4259657740, 2763975236, 1272893353, 4139469664, 3200236656, 681279174, 3936430074, 3572445317, 76029189, 3654602809, 3873151461, 530742520, 3299628645, 4096336452, 1126891415, 2878612391, 4237533241, 1700485571, 2399980690, 4293915773, 2240044497, 1873313359, 4264355552, 2734768916, 1309151649, 4149444226, 3174756917, 718787259, 3951481745]; 1859 for (let i = 0; i < paddedLen; i += 64) { 1860 const w = []; 1861 for (let t = 0; t < 16; t++) w[t] = view.getUint32(i + t * 4, true); 1862 const aa = a, bb = b, cc = c, dd = d; 1863 for (let j = 0; j < 64; j++) { 1864 let f, g; 1865 if (j < 16) { 1866 f = b & c | ~b & d; 1867 g = j; 1868 } else if (j < 32) { 1869 f = d & b | ~d & c; 1870 g = (5 * j + 1) % 16; 1871 } else if (j < 48) { 1872 f = b ^ c ^ d; 1873 g = (3 * j + 5) % 16; 1874 } else { 1875 f = c ^ (b | ~d); 1876 g = 7 * j % 16; 1877 } 1878 const rot = a + f + k[j] + w[g] >>> 0; 1879 const temp = d; 1880 d = c; 1881 c = b; 1882 b = b + (rot << s[j] | rot >>> 32 - s[j]) >>> 0; 1883 a = temp; 1884 } 1885 a = a + aa >>> 0; 1886 b = b + bb >>> 0; 1887 c = c + cc >>> 0; 1888 d = d + dd >>> 0; 1889 } 1890 const toHexLe = (n) => [n & 255, n >>> 8 & 255, n >>> 16 & 255, n >>> 24 & 255].map((byte) => byte.toString(16).padStart(2, "0")).join(""); 1891 return toHexLe(a) + toHexLe(b) + toHexLe(c) + toHexLe(d); 1892} 1893function parse_str(str) { 1894 const decodeQueryComponent = (value) => decodeURIComponent(value.replace(/\+/g, "%20")); 1895 const splitKeys = (rawKey) => {
1896 const keys = []; 1897 let bracketContentStart = 0; 1898 for (let index = 0; index < rawKey.length; index++) { 1899 if (rawKey.charAt(index) === "[" && !bracketContentStart) { 1900 bracketContentStart = index + 1; 1901 } else if (rawKey.charAt(index) === "]" && bracketContentStart) { 1902 if (!keys.length) { 1903 keys.push(rawKey.slice(0, bracketContentStart - 1)); 1904 } 1905 keys.push(rawKey.substring(bracketContentStart, index)); 1906 bracketContentStart = 0; 1907 if (rawKey.charAt(index + 1) !== "[") { 1908 break; 1909 } 1910 } 1911 } 1912 return keys.length ? keys : [rawKey]; 1913 }; 1914 const normalizeRootKey = (key) => { 1915 let normalizedKey = key; 1916 for (let index = 0; index < normalizedKey.length; index++) { 1917 const character = normalizedKey.charAt(index); 1918 if (character === " " || character === "." || character === "[") { 1919 normalizedKey = normalizedKey.substring(0, index) + "_" + normalizedKey.substring(index + 1); 1920 } 1921 if (character === "[") { 1922 break; 1923 } 1924 } 1925 return normalizedKey; 1926 }; 1927 const getNextNumericKey = (target) => { 1928 let maxIndex = -1; 1929 for (const property in target) { 1930 if (Object.prototype.hasOwnProperty.call(target, property) && /^\d+$/.test(property) && Number(property) > maxIndex) { 1931 maxIndex = Number(property); 1932 } 1933 } 1934 return String(maxIndex + 1); 1935 }; 1936 const isSequentialArray = (obj) => { 1937 const keys = Object.keys(obj); 1938 if (keys.length === 0) return false; 1939 const numericKeys = keys.filter((k) => /^\d+$/.test(k)).map(Number).sort((a, b) => a - b); 1940 if (numericKeys.length !== keys.length) return false; 1941 for (let i = 0; i < numericKeys.length; i++) { 1942 if (numericKeys[i] !== i) return false; 1943 } 1944 return true; 1945 }; 1946 const convertToArrays = (obj) => { 1947 if (typeof obj !== "object" || obj === null) { 1948 return obj; 1949 } 1950 if (isSequentialArray(obj)) { 1951 const arr = []; 1952 const keys = Object.keys(obj).map(Number).sort((a, b) => a - b); 1953 for (const key of keys) { 1954 arr[key] = convertToArrays(obj[String(key)]); 1955 } 1956 return arr; 1957 } 1958 const result2 = {}; 1959 for (const key in obj) { 1960 if (Object.prototype.hasOwnProperty.call(obj, key)) { 1961 result2[key] = convertToArrays(obj[key]); 1962 } 1963 } 1964 return result2; 1965 }; 1966 const result = {}; 1967 const segments = String(str).replace(/^&/, "").replace(/&$/, "").split("&"); 1968 for (const segment of segments) { 1969 const [rawKeyPart, ...rawValueParts] = segment.split("="); 1970 let rawKey = decodeQueryComponent(rawKeyPart ?? ""); 1971 const value = rawValueParts.length === 0 ? "" : decodeQueryComponent(rawValueParts.join("=")); 1972 rawKey = rawKey.trimStart(); 1973 const nullByteIndex = rawKey.indexOf("\0"); 1974 if (nullByteIndex > -1) { 1975 rawKey = rawKey.slice(0, nullByteIndex); 1976 } 1977 if (!rawKey || rawKey.charAt(0) === "[") { 1978 continue; 1979 } 1980 const keys = splitKeys(rawKey); 1981 keys[0] = normalizeRootKey(keys[0]); 1982 let current = result; 1983 let parent = result; 1984 let currentKey = ""; 1985 for (let index = 0; index < keys.length; index++) { 1986 currentKey = keys[index].replace(/^['"]/, "").replace(/['"]$/, ""); 1987 parent = current; 1988 if ((currentKey === "" || currentKey === " ") && index !== 0) { 1989 currentKey = getNextNumericKey(current); 1990 } 1991 if (Object(current[currentKey]) !== current[currentKey]) { 1992 current[currentKey] = {}; 1993 } 1994 current = current[currentKey]; 1995 } 1996 parent[currentKey] = value; 1997 } 1998 return convertToArrays(result); 1999} 2000 2001;// ./src/client/plugin/core/actions/search.js 2002 2003 2004 2005 2006"use strict"; 2007let search_helpers = base.helpers; 2008base.plugin.isDuplicateSearchTriggered = function() { 2009 let $this = this; 2010 for (let i = 0; i < 25; i++) { 2011 let id = $this.o.id + "_" + i; 2012 if (id !== $this.o.rid) { 2013 if (window.ASP.instances.get($this.o.id, i) !== false) { 2014 return window.ASP.instances.get($this.o.id, i).searching; 2015 } 2016 } 2017 } 2018 return false; 2019}; 2020base.plugin.searchAbort = function() { 2021 let $this = this; 2022 if ($this.post != null) { 2023 $this.post.abort(); 2024 $this.isAutoP = false;
2025 } 2026}; 2027base.plugin.searchWithCheck = function(timeout) { 2028 let $this = this; 2029 if (typeof timeout == "undefined") 2030 timeout = 50; 2031 if ($this.n("text").val().length < $this.o.charcount) return; 2032 $this.searchAbort(); 2033 clearTimeout($this.timeouts.searchWithCheck); 2034 $this.timeouts.searchWithCheck = setTimeout(function() { 2035 $this.search(); 2036 }, timeout); 2037}; 2038base.plugin.search = function(count, order, recall, apiCall, supressInvalidMsg) { 2039 let $this = this, abort = false; 2040 const shouldAbortSearch = function(data2, recall2, apiCall2, supressInvalidMsg2) { 2041 $this.hideArrowBox?.(); 2042 if (typeof $this.reportSettingsValidity != "undefined" && !$this.isAutoP && !$this.reportSettingsValidity()) { 2043 if (!supressInvalidMsg2) { 2044 $this.showNextInvalidFacetMessage?.(); 2045 $this.scrollToNextInvalidFacetMessage?.(); 2046 } 2047 return true; 2048 } 2049 if (!recall2 && !apiCall2 && JSON.stringify(data2) === JSON.stringify($this.lastSearchData)) { 2050 if (!$this.resultsOpened && !$this.usingLiveLoader()) { 2051 $this.showResults(); 2052 } 2053 if ($this.isRedirectToFirstResult()) { 2054 $this.doRedirectToFirstResult(); 2055 return true; 2056 } 2057 return true; 2058 } 2059 return false; 2060 }; 2061 const prepareRequestData = function() { 2062 let data2 = { 2063 action: "ajaxsearchpro_search", 2064 aspp: $this.n("text").val(), 2065 asid: $this.o.id, 2066 asp_inst_id: $this.o.rid, 2067 options: external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() 2068 }; 2069 data2 = search_helpers.Hooks.applyFilters("asp_search_data", data2, $this.o.id, $this.o.iid); 2070 if ($this.isAutoP) { 2071 data2.autop = 1; 2072 } 2073 return data2; 2074 }; 2075 const applyPaginationData = function(data2, recall2) { 2076 if (recall2) { 2077 $this.call_num++; 2078 data2.asp_call_num = $this.call_num; 2079 if ($this.autopStartedTheSearch) { 2080 data2.options += "&" + external_DoMini_namespaceObject.fn.serializeObject($this.autopData); 2081 --data2.asp_call_num; 2082 } 2083 } else { 2084 $this.call_num = 0; 2085 $this.autopStartedTheSearch = !!data2.autop; 2086 } 2087 }; 2088 const applyPreviewOptions = function(data2) { 2089 let $form = external_DoMini_namespaceObject('form[name="asp_data"]'); 2090 if ($form.length > 0) { 2091 data2.asp_preview_options = $form.serialize(); 2092 } 2093 }; 2094 const applyForcedOptions = function(data2, count2, order2) { 2095 if (typeof count2 != "undefined" && count2 !== false) { 2096 data2.options += "&force_count=" + parseInt(count2); 2097 } 2098 if (typeof order2 != "undefined" && order2 !== false) { 2099 data2.options += "&force_order=" + parseInt(order2); 2100 } 2101 }; 2102 const handleAjaxFailure = function(jqXHR) { 2103 if (jqXHR.aborted) 2104 return; 2105 $this.n("resdrg").html(""); 2106 $this.n("resdrg").html('<div class="asp_nores">The request failed. Please check your connection! Status: ' + jqXHR.status + "</div>"); 2107 $this.nodes.item = external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).length > 0 ? external_DoMini_namespaceObject(".item", $this.n("resultsDiv")) : external_DoMini_namespaceObject(".photostack-flip", $this.n("resultsDiv")); 2108 $this.results_num = 0; 2109 $this.searching = false; 2110 $this.hideLoader(); 2111 $this.showResults(); 2112 $this.scrollToResults(); 2113 $this.isAutoP = false; 2114 }; 2115 const collectResults = function(data_response) { 2116 let res = []; 2117 if (typeof data_response.results.groups != "undefined") { 2118 Object.keys(data_response.results.groups).forEach(function(k) { 2119 if (typeof data_response.results.groups[k].items != "undefined") { 2120 let group = data_response.results.groups[k].items; 2121 if (Array.isArray(group)) { 2122 group.forEach(function(result) { 2123 res.push(result); 2124 }); 2125 } 2126 } 2127 }); 2128 } else { 2129 res = Array.isArray(data_response.results) ? data_response.results : res; 2130 } 2131 return res; 2132 }; 2133 const handleResponse = function(data_response, data2, recall2, hash) { 2134 $this.searching = false; 2135 if (data_response.html === void 0) { 2136 $this.hideLoader(); 2137 alert('Ajax Search Pro Error:\r\n\r\nPlease look up "The response data is missing" from the documentation at\r\n\r\n documentation.ajaxsearchpro.com'); 2138 return false;
2139 } 2140 let html_response = search_helpers.Hooks.applyFilters("asp_search_html", data_response.html, $this.o.id, $this.o.iid); 2141 $this.n("s").trigger("asp_search_end", [$this.o.id, $this.o.iid, $this.n("text").val(), data_response], true, true); 2142 let res = collectResults(data_response); 2143 $this.statisticsID = data_response?.statistics_id ?? 0; 2144 if (typeof hash === "string" && !window.ASP.cache.list.has(hash)) { 2145 window.ASP.cache.list.add(hash); 2146 } 2147 if ($this.autopStartedTheSearch) { 2148 if (typeof data2.autop != "undefined") { 2149 $this.autopData["not_in"] = {}; 2150 $this.autopData["not_in_count"] = 0; 2151 if (typeof data_response.results != "undefined") { 2152 res.forEach(function(r) { 2153 if (typeof $this.autopData["not_in"][r["content_type"]] == "undefined") { 2154 $this.autopData["not_in"][r["content_type"]] = []; 2155 } 2156 $this.autopData["not_in"][r["content_type"]].push(r["id"]); 2157 ++$this.autopData["not_in_count"]; 2158 }); 2159 } 2160 } else { 2161 data_response.full_results_count += $this.autopData["not_in_count"]; 2162 } 2163 } 2164 if (!recall2) { 2165 $this.initResults(); 2166 $this.n("resdrg").html(""); 2167 $this.n("resdrg").html(html_response); 2168 $this.results_num = data_response.results_count; 2169 } else { 2170 $this.updateResults(html_response); 2171 $this.results_num += data_response.results_count; 2172 } 2173 $this.updateNoResultsHeader(); 2174 $this.nodes.items = external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).length > 0 ? external_DoMini_namespaceObject(".item", $this.n("resultsDiv")) : external_DoMini_namespaceObject(".photostack-flip", $this.n("resultsDiv")); 2175 $this.addHighlightString(); 2176 $this.gaEvent?.("search_end", { "results_count": $this.n("items").length }); 2177 if ($this.isRedirectToFirstResult()) { 2178 $this.doRedirectToFirstResult(); 2179 return false; 2180 } 2181 $this.hideLoader(); 2182 $this.showResults(); 2183 if (window.location.hash !== "" && window.location.hash.indexOf("#asp-res-") > -1 && external_DoMini_namespaceObject(window.location.hash).length > 0) { 2184 $this.scrollToResult(window.location.hash); 2185 } else { 2186 $this.scrollToResults(); 2187 } 2188 $this.lastSuccesfulSearch = external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim(); 2189 $this.lastSearchData = data2; 2190 $this.updateInfoHeader(data_response.full_results_count); 2191 $this.updateHref(); 2192 if ($this.n("showmore").length > 0) { 2193 if (external_DoMini_namespaceObject("span", $this.n("showmore")).length > 0 && data_response.results_count > 0 && data_response.full_results_count - $this.results_num > 0) { 2194 if ($this.n("showmore").data("text") === "") { 2195 $this.n("showmore").data("text", $this.n("showmore").html()); 2196 } 2197 $this.n("showmore").html($this.n("showmore").data("text").replaceAll("{phrase}", search_helpers.escapeHtml($this.n("text").val()))); 2198 $this.n("showmoreContainer").css("display", "block"); 2199 $this.n("showmore").css("display", "block"); 2200 external_DoMini_namespaceObject("span", $this.n("showmore")).html("(" + (data_response.full_results_count - $this.results_num) + ")"); 2201 let $a = external_DoMini_namespaceObject("a", $this.n("showmore")); 2202 $a.attr("href", ""); 2203 $a.off(); 2204 $a.on($this.clickTouchend, function(e) { 2205 e.preventDefault(); 2206 e.stopImmediatePropagation(); 2207 if ($this.o.show_more.action === "ajax") { 2208 if ($this.searching) 2209 return false; 2210 $this.showMoreResLoader(); 2211 $this.search(false, false, true); 2212 } else { 2213 let url, base_url; 2214 external_DoMini_namespaceObject(this).off(); 2215 if ($this.o.show_more.action === "results_page") { 2216 url = "?s=" + search_helpers.nicePhrase($this.n("text").val()); 2217 } else if ($this.o.show_more.action === "woo_results_page") { 2218 url = "?post_type=product&s=" + search_helpers.nicePhrase($this.n("text").val()); 2219 } else { 2220 if ($this.o.show_more.action === "elementor_page") { 2221 url = $this.parseCustomRedirectURL($this.o.show_more.elementor_url, $this.n("text").val()); 2222 } else { 2223 url = $this.parseCustomRedirectURL($this.o.show_more.url, $this.n("text").val()); 2224 } 2225 url = external_DoMini_namespaceObject("<textarea />").html(url).text(); 2226 } 2227 if ($this.o.show_more.action !== "elementor_page" && $this.o.homeurl.indexOf("?") > 1 && url.indexOf("?") === 0) { 2228 url = url.replace("?", "&"); 2229 } 2230 base_url = $this.o.show_more.action === "elementor_page" ? url : $this.o.homeurl + url; 2231 if ($this.o.overridewpdefault) { 2232 if ($this.o.override_method === "post") { 2233 search_helpers.submitToUrl(base_url, "post", { 2234 asp_active: 1, 2235 p_asid: $this.o.id, 2236 p_asp_data: external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() 2237 }, $this.o.show_more.location); 2238 } else { 2239 let final = base_url + "&asp_active=1&p_asid=" + $this.o.id + "&p_asp_data=1&" + external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize(); 2240 if ($this.o.show_more.location === "same") { 2241 location.href = final; 2242 } else { 2243 search_helpers.openInNewTab(final); 2244 } 2245 } 2246 } else { 2247 search_helpers.submitToUrl(base_url, "post", { 2248 np_asid: $this.o.id, 2249 np_asp_data: external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() 2250 }, $this.o.show_more.location); 2251 } 2252 } 2253 }); 2254 } else { 2255 $this.n("showmoreContainer").css("display", "none"); 2256 external_DoMini_namespaceObject("span", $this.n("showmore")).html(""); 2257 } 2258 } 2259 $this.isAutoP = false;
2260 search_helpers.Hooks.applyFilters("asp/search/end", $this, data2, $this.o.id, $this.o.iid, $this.n("text").val(), data_response); 2261 }; 2262 const tryLiveLoad = function() { 2263 if (external_DoMini_namespaceObject(".asp_es_" + $this.o.id).length > 0) { 2264 $this.liveLoad(".asp_es_" + $this.o.id, $this.getCurrentLiveURL(), $this.o.trigger.update_href); 2265 return true; 2266 } else if ($this.o.resPage.useAjax) { 2267 $this.liveLoad($this.o.resPage.selector, $this.getRedirectURL()); 2268 return true; 2269 } else if ($this.o.wooShop.useAjax) { 2270 $this.liveLoad($this.o.wooShop.selector, $this.getLiveURLbyBaseLocation($this.o.wooShop.url)); 2271 return true; 2272 } else if ($this.o.taxArchive.useAjax) { 2273 $this.liveLoad($this.o.taxArchive.selector, $this.getLiveURLbyBaseLocation($this.o.taxArchive.url)); 2274 return true; 2275 } else if ($this.o.cptArchive.useAjax) { 2276 $this.liveLoad($this.o.cptArchive.selector, $this.getLiveURLbyBaseLocation($this.o.cptArchive.url)); 2277 return true; 2278 } 2279 return false; 2280 }; 2281 const getCacheHash = function(data2) { 2282 const options = parse_str(data2.options); 2283 const str = data2.asid + $this.n("text").val() + JSON.stringify(options) + (data2.autop === void 0 ? "" : data2.autop) + (data2.asp_call_num === void 0 ? 0 : data2.asp_call_num); 2284 return md5(str).slice(0, 14); 2285 }; 2286 const ajaxSearch = function(data2, hash) { 2287 $this.post = external_DoMini_namespaceObject.fn.ajax({ 2288 "url": window.ASP.ajaxurl, 2289 "method": "POST", 2290 "data": data2, 2291 "success": function(response) { 2292 const data_response = JSON.parse(response); 2293 responseHandler(data_response, hash); 2294 }, 2295 "fail": handleAjaxFailure 2296 }); 2297 }; 2298 const responseHandler = function(data_response, hash) { 2299 return handleResponse(data_response, data, recall, hash); 2300 }; 2301 const registerCachedStatistics = function(data_response) { 2302 const params = { 2303 phrase: $this.n("text").val(), 2304 page: $this.call_num + 1, 2305 asp_id: $this.o.id, 2306 device_type: $this.n("searchsettings").find("input[name=device]").val(), 2307 lang: data_response.lang, 2308 user_id: ASP.cache.uid, 2309 found_results: data_response.full_results_count !== void 0 ? data_response.full_results_count : 0, 2310 results: [], 2311 suggested: 0 2312 }; 2313 if (data_response.results.suggested !== void 0) { 2314 window.ASP.cache.queue.pushToSend({ ...params, found_results: 0 }); 2315 params.results = data_response.results.suggested.map((result) => { 2316 return { 2317 id: result.id, 2318 content_type: result.content_type 2319 }; 2320 }); 2321 params.suggested = 1; 2322 params.phrase = data_response.results.keywords[0]; 2323 } else { 2324 if (data_response.results.groups !== void 0) { 2325 Object.keys(data_response.results.groups).forEach(function(k) { 2326 data_response.results.groups[k].items.map((result) => { 2327 if (params.results.find((r) => r.id === result.id) === void 0) { 2328 params.results.push({ 2329 id: result.id, 2330 content_type: result.content_type 2331 }); 2332 } 2333 }); 2334 }); 2335 } else if (Array.isArray(data_response.results)) { 2336 params.results = data_response.results.map((result) => { 2337 return { 2338 id: result.id, 2339 content_type: result.content_type 2340 }; 2341 }); 2342 } 2343 } 2344 window.ASP.cache.queue.pushToSend(params); 2345 }; 2346 if ($this.isDuplicateSearchTriggered()) 2347 return false; 2348 recall = typeof recall == "undefined" ? false : recall; 2349 apiCall = typeof apiCall == "undefined" ? false : apiCall; 2350 supressInvalidMsg = typeof supressInvalidMsg == "undefined" ? false : supressInvalidMsg; 2351 this.updateSettingsDeviceField?.(); 2352 let data = prepareRequestData(); 2353 abort = shouldAbortSearch(data, recall, apiCall, supressInvalidMsg); 2354 if (abort) { 2355 $this.hideLoader(); 2356 $this.searchAbort(); 2357 return false; 2358 } 2359 $this.n("s").trigger("asp_search_start", [$this.o.id, $this.o.iid, $this.n("text").val()], true, true); 2360 $this.searching = true; 2361 $this.n("proclose").css({ 2362 display: "none" 2363 }); 2364 $this.showLoader(recall); 2365 if (!$this.att("blocking") && !$this.o.trigger.facet) $this.hideSettings?.(); 2366 applyPaginationData(data, recall); 2367 applyPreviewOptions(data); 2368 applyForcedOptions(data, count, order); 2369 data.version = ASP.version; 2370 $this.gaEvent?.("search_start"); 2371 if (tryLiveLoad()) { 2372 return; 2373 } 2374 if (window.ASP.cache.enabled && window.ASP.cache.type === "super_file") { 2375 const hash = getCacheHash(data); 2376 if (window.ASP.cache.list.has(hash)) { 2377 fetch(window.ASP.cache.url + hash + ".json?t=" + ASP.cache.timestamp).then((response) => { 2378 if (!response.ok) { 2379 throw new Error("Network response was not ok"); 2380 } 2381 return response.json(); 2382 }).then((response) => { 2383 if (window.ASP.statistics.enabled) { 2384 registerCachedStatistics(response); 2385 } 2386 responseHandler(response, hash); 2387 }).catch((error) => { 2388 console.error("Error:", error); 2389 ajaxSearch(data, hash); 2390 window.ASP.initCache(true); 2391 }); 2392 return; 2393 } 2394 ajaxSearch(data, hash); 2395 } else { 2396 ajaxSearch(data); 2397 } 2398}; 2399/* harmony default export */ var search = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 2400 2401;// ./src/client/plugin/core/etc/api.js 2402 2403 2404 2405"use strict"; 2406let api_helpers = base.helpers; 2407base.plugin.searchFor = function(phrase) { 2408 if (typeof phrase != "undefined") { 2409 this.n("text").val(phrase); 2410 } 2411 this.n("textAutocomplete").val(""); 2412 this.search(false, false, false, true); 2413}; 2414base.plugin.searchRedirect = function(phrase) { 2415 let url = this.parseCustomRedirectURL(this.o.trigger.redirect_url, phrase); 2416 if (this.o.homeurl.indexOf("?") > 1 && url.indexOf("?") === 0) { 2417 url = url.replace("?", "&"); 2418 } 2419 if (this.o.overridewpdefault) { 2420 if (this.o.override_method === "post") { 2421 api_helpers.submitToUrl(this.o.homeurl + url, "post", { 2422 asp_active: 1, 2423 p_asid: this.o.id, 2424 p_asp_data: external_DoMini_namespaceObject("form", this.n("searchsettings")).serialize() 2425 }); 2426 } else { 2427 location.href = this.o.homeurl + url + "&asp_active=1&p_asid=" + this.o.id + "&p_asp_data=1&" + external_DoMini_namespaceObject("form", this.n("searchsettings")).serialize(); 2428 } 2429 } else { 2430 api_helpers.submitToUrl(this.o.homeurl + url, "post", { 2431 np_asid: this.o.id, 2432 np_asp_data: external_DoMini_namespaceObject("form", this.n("searchsettings")).serialize() 2433 }); 2434 } 2435}; 2436base.plugin.toggleSettings = function(state) { 2437 if (typeof state != "undefined") { 2438 if (state === "show") { 2439 this.showSettings?.(); 2440 } else { 2441 this.hideSettings?.(); 2442 } 2443 } else { 2444 if (this.n("prosettings").data("opened") === "1") { 2445 this.hideSettings?.(); 2446 } else { 2447 this.showSettings?.(); 2448 } 2449 } 2450}; 2451base.plugin.closeResults = function(clear) { 2452 if (typeof clear != "undefined" && clear) { 2453 this.n("text").val(""); 2454 this.n("textAutocomplete").val(""); 2455 } 2456 this.hideResults(); 2457 this.n("proloading").css("display", "none"); 2458 this.hideLoader(); 2459 this.searchAbort(); 2460}; 2461base.plugin.getStateURL = function() { 2462 let url = location.href, sep; 2463 url = url.split("p_asid"); 2464 url = url[0]; 2465 url = url.replace("&asp_active=1", ""); 2466 url = url.replace("?asp_active=1", ""); 2467 url = url.slice(-1) === "?" ? url.slice(0, -1) : url; 2468 url = url.slice(-1) === "&" ? url.slice(0, -1) : url; 2469 sep = url.indexOf("?") > 1 ? "&" : "?"; 2470 return url + sep + "p_asid=" + this.o.id + "&p_asp_data=1&" + external_DoMini_namespaceObject("form", this.n("searchsettings")).serialize(); 2471}; 2472base.plugin.resetSearch = function() { 2473 this.resetSearchFilters(); 2474}; 2475base.plugin.filtersInitial = function() { 2476 return this.n("searchsettings").find("input[name=filters_initial]").val() === "1"; 2477}; 2478base.plugin.filtersChanged = function() { 2479 return this.n("searchsettings").find("input[name=filters_changed]").val() === "1"; 2480}; 2481/* harmony default export */ var api = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 2482 2483;// ./src/client/plugin/core/etc/position.js 2484 2485 2486 2487"use strict"; 2488let position_helpers = base.helpers; 2489base.plugin.detectAndFixFixedPositioning = function() {
2490 let $this = this, fixedp = false, n = $this.n("search").get(0); 2491 while (n) { 2492 n = n.parentElement; 2493 if (n != null && window.getComputedStyle(n).position === "fixed") { 2494 fixedp = true; 2495 break; 2496 } 2497 } 2498 if (fixedp || $this.n("search").css("position") === "fixed") { 2499 if ($this.n("resultsDiv").css("position") === "absolute") { 2500 $this.n("resultsDiv").css({ 2501 "position": "fixed", 2502 "z-index": 2147483646 2503 }); 2504 } 2505 if (!$this.att("blocking")) { 2506 $this.n("searchsettings").css({ 2507 "position": "fixed", 2508 "z-index": 2147483646 2509 }); 2510 } 2511 } else { 2512 if ($this.n("resultsDiv").css("position") === "fixed") 2513 $this.n("resultsDiv").css("position", "absolute"); 2514 if (!$this.att("blocking")) 2515 $this.n("searchsettings").css("position", "absolute"); 2516 } 2517}; 2518base.plugin.fixSettingsAccessibility = function() { 2519 let $this = this; 2520 $this.n("searchsettings").find("input.asp_select2-search__field").attr("aria-label", "Select2 search"); 2521}; 2522base.plugin.fixTryThisPosition = function() { 2523 let $this = this; 2524 $this.n("trythis").css({ 2525 left: $this.n("search").position().left 2526 }); 2527}; 2528base.plugin.fixResultsPosition = function(ignoreVisibility) { 2529 ignoreVisibility = typeof ignoreVisibility == "undefined" ? false : ignoreVisibility; 2530 let $this = this, $body = external_DoMini_namespaceObject("body"), bodyTop = 0, rpos = $this.n("resultsDiv").css("position"); 2531 if (external_DoMini_namespaceObject._fn.bodyTransformY() !== 0 || $body.css("position") !== "static") { 2532 bodyTop = $body.offset().top; 2533 } 2534 if (external_DoMini_namespaceObject._fn.bodyTransformY() !== 0 && rpos === "fixed") { 2535 rpos = "absolute"; 2536 $this.n("resultsDiv").css("position", "absolute"); 2537 } 2538 if (rpos === "fixed") { 2539 bodyTop = 0; 2540 } 2541 if (rpos !== "fixed" && rpos !== "absolute") { 2542 return; 2543 } 2544 if (ignoreVisibility || $this.n("resultsDiv").css("visibility") === "visible") { 2545 let _rposition = $this.n("search").offset(), bodyLeft = 0; 2546 if (external_DoMini_namespaceObject._fn.bodyTransformX() !== 0 || $body.css("position") !== "static") { 2547 bodyLeft = $body.offset().left; 2548 } 2549 if (typeof _rposition != "undefined") { 2550 let vwidth, adjust = 0; 2551 if (position_helpers.deviceType() === "phone") { 2552 vwidth = $this.o.results.width_phone; 2553 } else if (position_helpers.deviceType() === "tablet") { 2554 vwidth = $this.o.results.width_tablet; 2555 } else { 2556 vwidth = $this.o.results.width; 2557 } 2558 if (vwidth === "auto") { 2559 vwidth = $this.n("search").outerWidth() < 240 ? 240 : $this.n("search").outerWidth(); 2560 } 2561 $this.n("resultsDiv").css("width", !isNaN(vwidth) ? vwidth + "px" : vwidth); 2562 if ($this.o.resultsSnapTo === "right") { 2563 adjust = $this.n("resultsDiv").outerWidth() - $this.n("search").outerWidth(); 2564 } else if ($this.o.resultsSnapTo === "center") { 2565 adjust = Math.floor(($this.n("resultsDiv").outerWidth() - parseInt($this.n("search").outerWidth())) / 2); 2566 } 2567 $this.n("resultsDiv").css({ 2568 top: _rposition.top + $this.n("search").outerHeight(true) - bodyTop + "px", 2569 left: _rposition.left - adjust - bodyLeft + "px" 2570 }); 2571 } 2572 } 2573}; 2574base.plugin.fixSettingsPosition = function(ignoreVisibility) { 2575 ignoreVisibility = typeof ignoreVisibility == "undefined" ? false : ignoreVisibility; 2576 let $this = this, $body = external_DoMini_namespaceObject("body"), bodyTop = 0, settPos = $this.n("searchsettings").css("position"); 2577 if (external_DoMini_namespaceObject._fn.bodyTransformY() !== 0 || $body.css("position") !== "static") { 2578 bodyTop = $body.offset().top; 2579 } 2580 if (external_DoMini_namespaceObject._fn.bodyTransformY() !== 0 && settPos === "fixed") { 2581 settPos = "absolute"; 2582 $this.n("searchsettings").css("position", "absolute"); 2583 } 2584 if (settPos === "fixed") { 2585 bodyTop = 0; 2586 } 2587 if ((ignoreVisibility || $this.n("prosettings").data("opened") === "1") && $this.att("blocking") !== true) { 2588 let $n, sPosition, top, left, bodyLeft = 0; 2589 if (external_DoMini_namespaceObject._fn.bodyTransformX() !== 0 || $body.css("position") !== "static") { 2590 bodyLeft = $body.offset().left; 2591 } 2592 $this.fixSettingsWidth(); 2593 if ($this.n("prosettings").css("display") !== "none") { 2594 $n = $this.n("prosettings"); 2595 } else { 2596 $n = $this.n("promagnifier"); 2597 } 2598 sPosition = $n.offset(); 2599 top = sPosition.top + $n.height() - 2 - bodyTop + "px"; 2600 left = $this.o.settingsimagepos === "left" ? sPosition.left : sPosition.left + $n.width() - $this.n("searchsettings").width(); 2601 left = left - bodyLeft + "px"; 2602 $this.n("searchsettings").css({ 2603 display: "block", 2604 top, 2605 left 2606 }); 2607 } 2608}; 2609base.plugin.fixSettingsWidth = function() {
2610 let $this = this; 2611 if ($this.att("blocking") || $this.o.fss_layout === "masonry") return; 2612 $this.n("searchsettings").css({ "width": "100%" }); 2613 if ($this.n("searchsettings").width() % external_DoMini_namespaceObject("fieldset", $this.n("searchsettings")).outerWidth(true) > 10) { 2614 let newColumnCount = Math.floor($this.n("searchsettings").width() / external_DoMini_namespaceObject("fieldset", $this.n("searchsettings")).outerWidth(true)); 2615 newColumnCount = newColumnCount <= 0 ? 1 : newColumnCount; 2616 $this.n("searchsettings").css({ 2617 "width": newColumnCount * external_DoMini_namespaceObject("fieldset", $this.n("searchsettings")).outerWidth(true) + 8 + "px" 2618 }); 2619 } 2620}; 2621base.plugin.hideOnInvisibleBox = function() { 2622 let $this = this; 2623 if ($this.o.detectVisibility && !$this.o.compact.enabled && !$this.n("search").hasClass("hiddend") && !$this.n("search").isVisible()) { 2624 $this.hideSettings?.(); 2625 $this.hideResults(); 2626 } 2627}; 2628/* harmony default export */ var position = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 2629 2630;// ./src/client/plugin/core/events/button.js 2631 2632 2633 2634"use strict"; 2635let button_helpers = base.helpers; 2636base.plugin.initMagnifierEvents = function() { 2637 let $this = this, t; 2638 $this.n("promagnifier").on("click", function(e) { 2639 let compact = $this.n("search").attr("data-asp-compact") || "closed"; 2640 $this.keycode = e.keyCode || e.which; 2641 $this.ktype = e.type; 2642 if ($this.o.compact.enabled) { 2643 if (compact === "closed" || $this.o.compact.closeOnMagnifier && compact === "open") { 2644 return false; 2645 } 2646 } 2647 $this.gaEvent?.("magnifier"); 2648 if ($this.n("text").val().length >= $this.o.trigger.charcount_magnifier_enter && $this.o.redirectOnClick && $this.o.trigger.click !== "first_result") { 2649 $this.doRedirectToResults("click"); 2650 clearTimeout(t); 2651 return false; 2652 } 2653 if ($this.o.trigger.click === "ajax_search" && $this.n("text").val().length < $this.o.trigger.charcount_magnifier_enter) { 2654 return false; 2655 } 2656 if (!($this.o.trigger.click === "ajax_search" || $this.o.trigger.click === "first_result")) { 2657 return false; 2658 } 2659 $this.searchAbort(); 2660 clearTimeout($this.timeouts.search); 2661 $this.n("proloading").css("display", "none"); 2662 if ($this.n("text").val().length >= $this.o.charcount) { 2663 $this.timeouts.search = setTimeout(function() { 2664 if (external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim() !== $this.lastSuccesfulSearch || !$this.resultsOpened && !$this.usingLiveLoader()) { 2665 $this.search(); 2666 } else { 2667 if ($this.isRedirectToFirstResult()) 2668 $this.doRedirectToFirstResult(); 2669 else 2670 $this.n("proclose").css("display", "block"); 2671 } 2672 }, $this.o.trigger.delay); 2673 } 2674 }); 2675}; 2676base.plugin.initButtonEvents = function() { 2677 let $this = this; 2678 $this.n("searchsettings").find("button.asp_s_btn").on("click", function(e) { 2679 $this.ktype = "button"; 2680 e.preventDefault(); 2681 if ($this.n("text").val().length >= $this.o.charcount) { 2682 if ($this.o.sb.redirect_action !== "ajax_search") { 2683 if ($this.o.sb.redirect_action !== "first_result") { 2684 $this.doRedirectToResults("button"); 2685 } else { 2686 if ($this.isRedirectToFirstResult()) { 2687 $this.doRedirectToFirstResult(); 2688 return false; 2689 } 2690 $this.search(); 2691 } 2692 } else { 2693 if (external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim() !== $this.lastSuccesfulSearch || !$this.resultsOpened) { 2694 $this.search(); 2695 } 2696 } 2697 clearTimeout($this.timeouts.search); 2698 } 2699 }); 2700 $this.n("searchsettings").find("button.asp_r_btn").on("click", function(e) { 2701 let currentFormData = button_helpers.formData(external_DoMini_namespaceObject("form", $this.n("searchsettings"))), lastPhrase = $this.n("text").val(); 2702 e.preventDefault(); 2703 $this.resetSearchFilters(); 2704 if ($this.o.rb.action === "live" && (JSON.stringify(currentFormData) !== JSON.stringify(button_helpers.formData(external_DoMini_namespaceObject("form", $this.n("searchsettings")))) || lastPhrase !== "")) { 2705 if ($this.isAutoP) { 2706 $this.initAutop(); 2707 } else { 2708 $this.search(false, false, false, true, true); 2709 } 2710 } else { 2711 if ($this.o.rb.action === "close") { 2712 $this.hideResults(); 2713 } 2714 } 2715 }); 2716}; 2717/* harmony default export */ var events_button = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 2718 2719;// ./src/client/plugin/core/events/input.js 2720 2721 2722 2723"use strict"; 2724let input_helpers = base.helpers; 2725base.plugin.initInputEvents = function() {
2726 let $this = this, initialized = false; 2727 let initTriggers = function() { 2728 $this.n("text").off("mousedown touchstart keydown", initTriggers); 2729 if (!initialized) { 2730 $this._initFocusInput(); 2731 if ($this.o.trigger.type) { 2732 $this._initSearchInput(); 2733 } 2734 $this._initEnterEvent(); 2735 $this._initFormEvent(); 2736 $this.initAutocompleteEvent?.(); 2737 initialized = true; 2738 } 2739 }; 2740 $this.n("text").on("mousedown touchstart keydown", initTriggers, { passive: true }); 2741}; 2742base.plugin._initFocusInput = function() { 2743 let $this = this; 2744 $this.n("text").on("click", function(e) { 2745 e.stopPropagation(); 2746 e.stopImmediatePropagation(); 2747 external_DoMini_namespaceObject(this).trigger("focus"); 2748 $this.gaEvent?.("focus"); 2749 if (external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim() === $this.lastSuccesfulSearch) { 2750 if (!$this.resultsOpened && !$this.usingLiveLoader()) { 2751 $this._no_animations = true; 2752 $this.showResults(); 2753 $this._no_animations = false; 2754 } 2755 return false; 2756 } 2757 }); 2758 $this.n("text").on("focus input", function() { 2759 if ($this.searching) { 2760 return; 2761 } 2762 if (external_DoMini_namespaceObject(this).val() !== "") { 2763 $this.n("proclose").css("display", "block"); 2764 } else { 2765 $this.n("proclose").css({ 2766 display: "none" 2767 }); 2768 } 2769 }); 2770}; 2771base.plugin._initSearchInput = function() { 2772 let $this = this; 2773 $this.n("text").on("input", function(e) { 2774 $this.keycode = e.keyCode || e.which; 2775 $this.ktype = e.type; 2776 $this.updateHref(); 2777 if (!$this.o.trigger.type) { 2778 $this.searchAbort(); 2779 clearTimeout($this.timeouts.search); 2780 $this.hideLoader(); 2781 return false; 2782 } 2783 $this.hideArrowBox?.(); 2784 if ($this.n("text").val().length < $this.o.charcount) { 2785 $this.n("proloading").css("display", "none"); 2786 if (!$this.att("blocking")) $this.hideSettings?.(); 2787 $this.hideResults(false); 2788 $this.searchAbort(); 2789 clearTimeout($this.timeouts.search); 2790 return false; 2791 } 2792 $this.searchAbort(); 2793 clearTimeout($this.timeouts.search); 2794 $this.n("textAutocomplete").val(""); 2795 $this.n("proloading").css("display", "none"); 2796 $this.timeouts.search = setTimeout(function() { 2797 if (external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim() !== $this.lastSuccesfulSearch || !$this.resultsOpened && !$this.usingLiveLoader()) { 2798 $this.search(); 2799 } else { 2800 if ($this.isRedirectToFirstResult()) 2801 $this.doRedirectToFirstResult(); 2802 else 2803 $this.n("proclose").css("display", "block"); 2804 } 2805 }, $this.o.trigger.delay); 2806 }); 2807}; 2808base.plugin._initEnterEvent = function() { 2809 let $this = this, rt, enterRecentlyPressed = false; 2810 $this.n("text").on("keyup", function(e) { 2811 $this.keycode = e.keyCode || e.which; 2812 $this.ktype = e.type; 2813 if ($this.keycode === 13) { 2814 clearTimeout(rt); 2815 rt = setTimeout(function() { 2816 enterRecentlyPressed = false; 2817 }, 300); 2818 if (enterRecentlyPressed) { 2819 return false; 2820 } else { 2821 enterRecentlyPressed = true; 2822 } 2823 } 2824 let isInput = external_DoMini_namespaceObject(this).hasClass("orig"); 2825 if (isInput && $this.keycode === 13) { 2826 if ($this.o.redirectOnEnter && $this.n("text").val().length >= $this.o.trigger.charcount_magnifier_enter) { 2827 $this.gaEvent?.("return"); 2828 if ($this.o.trigger.return !== "first_result") { 2829 $this.doRedirectToResults($this.ktype); 2830 } else { 2831 $this.search(); 2832 } 2833 } else if ($this.o.trigger.return === "ajax_search" && $this.n("text").val().length >= $this.o.trigger.charcount_magnifier_enter) { 2834 if (external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim() !== $this.lastSuccesfulSearch || !$this.resultsOpened) { 2835 $this.gaEvent?.("return"); 2836 $this.search(); 2837 } 2838 } 2839 clearTimeout($this.timeouts.search); 2840 } 2841 }); 2842}; 2843base.plugin._initFormEvent = function() {
2844 let $this = this; 2845 external_DoMini_namespaceObject($this.n("text").closest("form").get(0)).on("submit", function(e, args) { 2846 e.preventDefault(); 2847 if (input_helpers.isMobile()) { 2848 if ($this.o.redirectOnEnter) { 2849 let event = new Event("keyup"); 2850 event.keyCode = event.which = 13; 2851 this.n("text").get(0).dispatchEvent(event); 2852 } else { 2853 $this.search(); 2854 document.activeElement.blur(); 2855 } 2856 } else if (typeof args != "undefined" && args === "ajax") { 2857 $this.search(); 2858 } 2859 }); 2860}; 2861/* harmony default export */ var input = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 2862 2863;// ./src/client/plugin/core/events/navigation.js 2864 2865 2866 2867"use strict"; 2868base.plugin.initNavigationEvents = function() { 2869 let $this = this; 2870 let handler = function(e) { 2871 let keycode = e.keyCode || e.which; 2872 if (external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).length > 0 && $this.n("resultsDiv").css("display") !== "none" && $this.o.resultstype === "vertical") { 2873 if (keycode === 40 || keycode === 38) { 2874 let $hovered = $this.n("resultsDiv").find(".item.hovered"); 2875 $this.n("text").trigger("blur"); 2876 if ($hovered.length === 0) { 2877 $this.n("resultsDiv").find(".item").first().addClass("hovered"); 2878 } else { 2879 if (keycode === 40) { 2880 if ($hovered.next(".item").length === 0) { 2881 $this.n("resultsDiv").find(".item").removeClass("hovered").first().addClass("hovered"); 2882 } else { 2883 $hovered.removeClass("hovered").next(".item").addClass("hovered"); 2884 } 2885 } 2886 if (keycode === 38) { 2887 if ($hovered.prev(".item").length === 0) { 2888 $this.n("resultsDiv").find(".item").removeClass("hovered").last().addClass("hovered"); 2889 } else { 2890 $hovered.removeClass("hovered").prev(".item").addClass("hovered"); 2891 } 2892 } 2893 } 2894 e.stopPropagation(); 2895 e.preventDefault(); 2896 if (!$this.n("resultsDiv").find(".resdrg .item.hovered").inViewPort(50, $this.n("resultsDiv").get(0))) { 2897 let n = $this.n("resultsDiv").find(".resdrg .item.hovered").get(0); 2898 if (n != null && typeof n.scrollIntoView != "undefined") { 2899 n.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest" }); 2900 } 2901 } 2902 } 2903 if (keycode === 13 && external_DoMini_namespaceObject(".item.hovered", $this.n("resultsDiv")).length > 0) { 2904 e.stopPropagation(); 2905 e.preventDefault(); 2906 external_DoMini_namespaceObject(".item.hovered a.asp_res_url", $this.n("resultsDiv")).get(0).click(); 2907 } 2908 } 2909 }; 2910 $this.documentEventHandlers.push({ 2911 "node": document, 2912 "event": "keydown", 2913 "handler": handler 2914 }); 2915 external_DoMini_namespaceObject(document).on("keydown", handler); 2916}; 2917/* harmony default export */ var navigation = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 2918 2919;// ./src/client/global/utils/device.ts 2920 2921const deviceType = () => { 2922 let w = window.innerWidth; 2923 if (w <= 640) { 2924 return "phone"; 2925 } else if (w <= 1024) { 2926 return "tablet"; 2927 } else { 2928 return "desktop"; 2929 } 2930}; 2931const detectIOS = () => { 2932 if (typeof window.navigator != "undefined" && typeof window.navigator.userAgent != "undefined") 2933 return window.navigator.userAgent.match(/(iPod|iPhone|iPad)/) != null; 2934 return false; 2935}; 2936const isMobile = () => { 2937 try { 2938 document.createEvent("TouchEvent"); 2939 return true; 2940 } catch (e) { 2941 return false; 2942 } 2943}; 2944const isTouchDevice = () => { 2945 return "ontouchstart" in window; 2946}; 2947 2948;// ./src/client/utils/browser.ts 2949 2950 2951const isFirefox = navigator.userAgent.toLowerCase().includes("firefox"); 2952const ua = navigator.userAgent; 2953const isWebKit = /AppleWebKit/.test(ua) && !/Edge/.test(ua); 2954let fakeInput; 2955const focusInput = (targetInput) => { 2956 if (!detectIOS()) { 2957 targetInput?.focus(); 2958 return; 2959 } 2960 if (targetInput === void 0 || fakeInput === void 0) { 2961 fakeInput = document.createElement("input"); 2962 fakeInput.setAttribute("type", "text"); 2963 fakeInput.style.position = "absolute"; 2964 fakeInput.style.opacity = "0"; 2965 fakeInput.style.height = "0"; 2966 fakeInput.style.fontSize = "16px"; 2967 document.body.prepend(fakeInput); 2968 } 2969 if (targetInput === void 0) { 2970 fakeInput.focus(); 2971 } else { 2972 targetInput.focus(); 2973 } 2974}; 2975 2976 2977;// ./src/client/plugin/core/events/other.js 2978 2979 2980 2981 2982"use strict"; 2983let other_helpers = base.helpers; 2984base.plugin.initOtherEvents = function() {
2985 let $this = this, handler, handler2; 2986 if ($this.o.preventEvents && typeof jQuery !== "undefined") { 2987 jQuery($this.n("search").get(0)).closest("a, li").off(); 2988 } 2989 if (other_helpers.isMobile() && other_helpers.detectIOS()) { 2990 $this.n("text").on("touchstart", function() { 2991 $this.savedScrollTop = window.scrollY; 2992 $this.savedContainerTop = $this.n("search").offset().top; 2993 }); 2994 } 2995 if ($this.o.focusOnPageload) { 2996 external_DoMini_namespaceObject(window).on("load", function() { 2997 $this.n("text").get(0).focus(); 2998 }, { "options": { "once": true } }); 2999 } 3000 $this.n("proclose").on($this.clickTouchend, function(e) { 3001 e.preventDefault(); 3002 e.stopImmediatePropagation(); 3003 $this.n("text").val(""); 3004 $this.n("textAutocomplete").val(""); 3005 $this.n("proloading").css("display", "none"); 3006 $this.hideLoader(); 3007 $this.searchAbort(); 3008 if ($this.o.close_icon.action === "clear") { 3009 if ($this.o.close_icon.close_results) { 3010 $this.hideResults(); 3011 } 3012 } else if ($this.o.close_icon.action === "reset") { 3013 $this.resetSearchFilters(); 3014 if ($this.o.close_icon.close_results) { 3015 $this.hideResults(); 3016 } 3017 } else if ($this.o.close_icon.action === "reset_and_search") { 3018 $this.resetSearchFilters(); 3019 if ($this.usingLiveLoader()) { 3020 if (external_DoMini_namespaceObject(".asp_es_" + $this.o.id).length > 0) { 3021 $this.showLoader(); 3022 $this.liveLoad(".asp_es_" + $this.o.id, $this.getCurrentLiveURL(), $this.o.trigger.update_href); 3023 } else { 3024 const array = ["resPage", "wooShop", "taxArchive", "cptArchive"]; 3025 for (let i = 0; i < array.length; i++) { 3026 if ($this.o[array[i]].useAjax) { 3027 $this.showLoader(); 3028 $this.liveLoad($this.o[array[i]].selector, $this.getCurrentLiveURL()); 3029 break; 3030 } 3031 } 3032 } 3033 } else { 3034 if ($this.o.autop.state !== "disabled") { 3035 $this.initAutop(); 3036 } else { 3037 $this.search(false, false, false, true, true); 3038 } 3039 } 3040 $this.n("proclose").addClass("--skip"); 3041 } 3042 $this.n("proclose").css({ 3043 display: "none" 3044 }); 3045 $this.n("text").trigger("focus"); 3046 $this.n("text").get(0).focus(); 3047 }); 3048 if (other_helpers.isMobile()) { 3049 handler = function() { 3050 $this.orientationChange(); 3051 setTimeout(function() { 3052 $this.orientationChange(); 3053 }, 600); 3054 }; 3055 $this.documentEventHandlers.push({ 3056 "node": window, 3057 "event": "orientationchange", 3058 "handler": handler 3059 }); 3060 external_DoMini_namespaceObject(window).on("orientationchange", handler); 3061 } else { 3062 handler = function() { 3063 $this.resize(); 3064 }; 3065 $this.documentEventHandlers.push({ 3066 "node": window, 3067 "event": "resize", 3068 "handler": handler 3069 }); 3070 external_DoMini_namespaceObject(window).on("resize", handler, { passive: true }); 3071 } 3072 handler2 = function() { 3073 $this.scrolling(false); 3074 }; 3075 $this.documentEventHandlers.push({ 3076 "node": window, 3077 "event": "scroll", 3078 "handler": handler2 3079 }); 3080 external_DoMini_namespaceObject(window).on("scroll", handler2, { passive: true }); 3081 if (other_helpers.isMobile() && $this.o.mobile.menu_selector !== "") { 3082 external_DoMini_namespaceObject($this.o.mobile.menu_selector).on("touchend", function(e) { 3083 let _this = this; 3084 focusInput(); 3085 setTimeout(function() { 3086 let $input = external_DoMini_namespaceObject(_this).find("input.orig"); 3087 $input = $input.length === 0 ? external_DoMini_namespaceObject(_this).next().find("input.orig") : $input; 3088 $input = $input.length === 0 ? external_DoMini_namespaceObject(_this).parent().find("input.orig") : $input; 3089 $input = $input.length === 0 ? $this.n("text") : $input; 3090 if ($this.n("search").inViewPort()) { 3091 focusInput($input.get(0)); 3092 } 3093 }, 1e3); 3094 }); 3095 } 3096 if (other_helpers.detectIOS() && other_helpers.isMobile() && other_helpers.isTouchDevice()) { 3097 if (parseInt($this.n("text").css("font-size")) < 16) { 3098 $this.n("text").data("fontSize", $this.n("text").css("font-size")).css("font-size", "16px"); 3099 $this.n("textAutocomplete").css("font-size", "16px"); 3100 external_DoMini_namespaceObject("body").append("<style>#ajaxsearchpro" + $this.o.rid + " input.orig::-webkit-input-placeholder{font-size: 16px !important;}</style>"); 3101 } 3102 } 3103}; 3104base.plugin.orientationChange = function() { 3105 const $this = this; 3106 $this.detectAndFixFixedPositioning(); 3107 $this.fixSettingsPosition(); 3108 $this.fixResultsPosition(); 3109 $this.fixTryThisPosition(); 3110 $this.updateSettingsDeviceField?.(); 3111 if ($this.o.resultstype === "isotopic" && $this.n("resultsDiv").css("visibility") === "visible") { 3112 $this.calculateIsotopeRows(); 3113 $this.showPagination(true); 3114 $this.removeAnimation(); 3115 } 3116}; 3117base.plugin.resize = function() { 3118 this.hideArrowBox?.(); 3119 this.orientationChange(); 3120 this.updateSettingsDeviceField?.(); 3121}; 3122base.plugin.scrolling = function(ignoreVisibility) {
3123 let $this = this; 3124 $this.detectAndFixFixedPositioning(); 3125 $this.hideOnInvisibleBox(); 3126 $this.fixSettingsPosition(ignoreVisibility); 3127 $this.fixResultsPosition(ignoreVisibility); 3128}; 3129base.plugin.initTryThisEvents = function() { 3130 let $this = this; 3131 if ($this.n("trythis").find("a").length > 0) { 3132 $this.n("trythis").find("a").on("click touchend", function(e) { 3133 e.preventDefault(); 3134 e.stopImmediatePropagation(); 3135 if ($this.o.compact.enabled) { 3136 let state = $this.n("search").attr("data-asp-compact") || "closed"; 3137 if (state === "closed") 3138 $this.n("promagnifier").trigger("click"); 3139 } 3140 document.activeElement.blur(); 3141 $this.n("textAutocomplete").val(""); 3142 $this.n("text").val(external_DoMini_namespaceObject(this).text()); 3143 $this.gaEvent?.("try_this"); 3144 if ($this.o.trigger.type) { 3145 $this.searchWithCheck(80); 3146 } 3147 }); 3148 $this.n("trythis").css({ 3149 visibility: "visible" 3150 }); 3151 } 3152}; 3153base.plugin.initSelect2 = function() { 3154 let $this = this; 3155 window.WPD.intervalUntilExecute(function(jq) { 3156 if (typeof jq.fn.asp_select2 !== "undefined") { 3157 $this.select2jQuery = jq; 3158 external_DoMini_namespaceObject("select.asp_gochosen, select.asp_goselect2", $this.n("searchsettings")).forEach(function() { 3159 external_DoMini_namespaceObject(this).removeAttr("data-asp_select2-id"); 3160 external_DoMini_namespaceObject(this).find('option[value=""]').val("__any__"); 3161 $this.select2jQuery(this).asp_select2({ 3162 width: "100%", 3163 theme: "flat", 3164 allowClear: external_DoMini_namespaceObject(this).find('option[value=""]').length > 0, 3165 "language": { 3166 "noResults": function() { 3167 return $this.o.select2.nores; 3168 } 3169 }, 3170 escapeMarkup: function(markup) { 3171 return markup; 3172 } 3173 }); 3174 $this.select2jQuery(this).on("change", function() { 3175 external_DoMini_namespaceObject(this).trigger("change"); 3176 }); 3177 }); 3178 } 3179 }, function() { 3180 return other_helpers.whichjQuery("asp_select2"); 3181 }); 3182}; 3183/* harmony default export */ var events_other = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3184 3185;// ./src/client/plugin/core/events/results.js 3186 3187 3188 3189"use strict"; 3190base.plugin.initResultsEvents = function() { 3191 let $this = this; 3192 $this.n("resultsDiv").css({ 3193 opacity: "0" 3194 }); 3195 let handler = function(e) { 3196 let keycode = e.keyCode || e.which, ktype = e.type; 3197 if (external_DoMini_namespaceObject(e.target).closest(".asp_w, .asp-sl-overlay, .asp-simple-lightbox").length === 0) { 3198 $this.hideOnInvisibleBox(); 3199 $this.hideArrowBox?.(); 3200 if (ktype !== "click" || ktype !== "touchend" || keycode !== 3) { 3201 if ($this.o.compact.enabled) { 3202 let compact = $this.n("search").attr("data-asp-compact") || "closed"; 3203 if ($this.o.compact.closeOnDocument && compact === "open" && !$this.resultsOpened) { 3204 $this.closeCompact(); 3205 $this.searchAbort(); 3206 $this.hideLoader(); 3207 } 3208 } else { 3209 if (!$this.resultsOpened || !$this.o.closeOnDocClick) return; 3210 } 3211 if (!$this.dragging) { 3212 $this.hideLoader(); 3213 $this.searchAbort(); 3214 $this.hideResults(); 3215 } 3216 } 3217 } 3218 }; 3219 $this.documentEventHandlers.push({ 3220 "node": document, 3221 "event": $this.clickTouchend, 3222 "handler": handler 3223 }); 3224 external_DoMini_namespaceObject(document).on($this.clickTouchend, handler); 3225 const recordInteractions = ASP.statistics.enabled && ASP.statistics.record_results && ASP.statistics.record_result_interactions; 3226 $this.n("resultsDiv").on("click", ".results .item", function(e) { 3227 if ($this.o.results.disableClick) { 3228 e.preventDefault(); 3229 return false; 3230 } 3231 if (external_DoMini_namespaceObject(this).attr("id") !== "") { 3232 $this.updateHref("#" + external_DoMini_namespaceObject(this).attr("id")); 3233 } 3234 if (recordInteractions) { 3235 ASP.registerInteraction(this, $this.statisticsID); 3236 } 3237 $this.gaEvent?.("result_click", { 3238 "result_title": external_DoMini_namespaceObject(this).find("a.asp_res_url").text(), 3239 "result_url": external_DoMini_namespaceObject(this).find("a.asp_res_url").attr("href") 3240 }); 3241 }); 3242 if ($this.o.resultstype === "isotopic") { 3243 $this.n("resultsDiv").on("swiped-left", function() { 3244 if ($this.visiblePagination()) 3245 $this.n("resultsDiv").find("a.asp_next").trigger("click"); 3246 }); 3247 $this.n("resultsDiv").on("swiped-right", function() { 3248 if ($this.visiblePagination()) 3249 $this.n("resultsDiv").find("a.asp_prev").trigger("click"); 3250 }); 3251 } 3252}; 3253/* harmony default export */ var results = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3254 3255;// ./src/client/plugin/core/events/touch.js 3256 3257 3258 3259"use strict"; 3260base.plugin.monitorTouchMove = function() {
3261 let $this = this; 3262 $this.dragging = false; 3263 external_DoMini_namespaceObject("body").on("touchmove", function() { 3264 $this.dragging = true; 3265 }).on("touchstart", function() { 3266 $this.dragging = false; 3267 }); 3268}; 3269/* harmony default export */ var touch = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3270 3271;// ./src/client/plugin/core/init/autopopulate.js 3272 3273 3274let autopopulate_helpers = base.helpers; 3275"use strict"; 3276base.plugin.initAutop = function() { 3277 let $this = this; 3278 if ($this.o.autop.state === "disabled") return false; 3279 let location = window.location.href; 3280 let stop = location.indexOf("asp_ls=") > -1 || location.indexOf("asp_ls&") > -1; 3281 if (stop) { 3282 return false; 3283 } 3284 let count = $this.o.show_more.enabled && $this.o.show_more.action === "ajax" ? false : $this.o.autop.count; 3285 $this.isAutoP = true; 3286 if ($this.o.compact.enabled) { 3287 $this.openCompact(); 3288 } 3289 if ($this.o.autop.state === "phrase") { 3290 if (!$this.o.is_results_page) { 3291 $this.n("text").val(autopopulate_helpers.decodeHTMLEntities($this.o.autop.phrase)); 3292 } 3293 $this.search(count); 3294 } else if ($this.o.autop.state === "latest") { 3295 $this.search(count, 1); 3296 } else { 3297 $this.search(count, 2); 3298 } 3299}; 3300/* harmony default export */ var autopopulate = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3301 3302;// ./src/client/plugin/core/init/etc.js 3303 3304 3305 3306"use strict"; 3307let etc_helpers = base.helpers; 3308base.plugin.initEtc = function() { 3309 let $this = this; 3310 $this.il = { 3311 columns: 3, 3312 rows: $this.o.isotopic.pagination ? $this.o.isotopic.rows : 1e4, 3313 itemsPerPage: 6, 3314 lastVisibleItem: -1 3315 }; 3316 $this.filterFns = { 3317 number: function(i, el) { 3318 if (typeof el === "undefined" || typeof i === "object") { 3319 el = i; 3320 } 3321 const number = external_DoMini_namespaceObject(el).attr("data-itemnum"), currentPage = $this.currentPage, itemsPerPage = $this.il.itemsPerPage; 3322 if (number % ($this.il.columns * $this.il.rows) < $this.il.columns * ($this.il.rows - 1)) 3323 external_DoMini_namespaceObject(el).addClass("asp_gutter_bottom"); 3324 else 3325 external_DoMini_namespaceObject(el).removeClass("asp_gutter_bottom"); 3326 return parseInt(number, 10) < itemsPerPage * currentPage && parseInt(number, 10) >= itemsPerPage * (currentPage - 1); 3327 } 3328 }; 3329 etc_helpers.Hooks.applyFilters("asp/init/etc", $this); 3330}; 3331base.plugin.initInfiniteScroll = function() { 3332 let $this = this; 3333 if ($this.o.show_more.infinite && $this.o.resultstype !== "polaroid") { 3334 let t, handler; 3335 handler = function() { 3336 clearTimeout(t); 3337 t = setTimeout(function() { 3338 $this.checkAndTriggerInfiniteScroll("window"); 3339 }, 80); 3340 }; 3341 $this.documentEventHandlers.push({ 3342 "node": window, 3343 "event": "scroll", 3344 "handler": handler 3345 }); 3346 external_DoMini_namespaceObject(window).on("scroll", handler); 3347 $this.n("results").on("scroll", handler); 3348 let tt; 3349 $this.n("resultsDiv").on("nav_switch", function() { 3350 clearTimeout(tt); 3351 tt = setTimeout(function() { 3352 $this.checkAndTriggerInfiniteScroll("isotopic"); 3353 }, 800); 3354 }); 3355 } 3356}; 3357base.plugin.hooks = function() { 3358 let $this = this; 3359 $this.n("s").on("asp_elementor_results", function(e, id) { 3360 if (parseInt($this.o.id) === parseInt(id)) { 3361 if (typeof window.jetpackLazyImagesModule == "function") { 3362 setTimeout(function() { 3363 window.jetpackLazyImagesModule(); 3364 }, 300); 3365 } 3366 } 3367 }); 3368}; 3369/* harmony default export */ var etc = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3370 3371;// ./src/client/plugin/core/init/init.js 3372 3373 3374 3375"use strict"; 3376let init_helpers = base.helpers; 3377base.plugin.init = function(options, elem) { 3378 let $this = this; 3379 $this.searching = false; 3380 $this.triggerPrevState = false; 3381 $this.isAutoP = false; 3382 $this.autopStartedTheSearch = false; 3383 $this.autopData = {}; 3384 $this.settingsInitialized = false; 3385 $this.resultsInitialized = false; 3386 $this.settingsChanged = false; 3387 $this.resultsOpened = false; 3388 $this.post = null; 3389 $this.postAuto = null; 3390 $this.savedScrollTop = 0; 3391 $this.savedContainerTop = 0; 3392 $this.disableMobileScroll = false;
3393 $this.clickTouchend = "click touchend"; 3394 $this.mouseupTouchend = "mouseup touchend"; 3395 $this.noUiSliders = []; 3396 $this.timeouts = { 3397 "compactBeforeOpen": null, 3398 "compactAfterOpen": null, 3399 "search": null, 3400 "searchWithCheck": null 3401 }; 3402 $this.eh = {}; 3403 $this.documentEventHandlers = [ 3404 /** 3405 * {"node": document|window, "event": event_name, "handler": function()..} 3406 */ 3407 ]; 3408 $this.currentPage = 1; 3409 $this.currentPageURL = location.href; 3410 $this.isotopic = null; 3411 $this.sIsotope = null; 3412 $this.lastSuccesfulSearch = ""; 3413 $this.lastSearchData = {}; 3414 $this._no_animations = false; 3415 $this.call_num = 0; 3416 $this.results_num = 0; 3417 $this.o = external_DoMini_namespaceObject.fn.extend({}, options); 3418 $this.dynamicAtts = {}; 3419 $this.nodes = {}; 3420 $this.nodes.search = external_DoMini_namespaceObject(elem); 3421 if (init_helpers.isMobile()) 3422 $this.animOptions = $this.o.animations.mob; 3423 else 3424 $this.animOptions = $this.o.animations.pc; 3425 $this.initNodeVariables(); 3426 $this.animationOpacity = $this.animOptions.items.indexOf("In") < 0 ? "opacityOne" : "opacityZero"; 3427 $this.o.resPage.useAjax = $this.o.compact.enabled ? 0 : $this.o.resPage.useAjax; 3428 if (init_helpers.isMobile()) { 3429 $this.o.trigger.type = $this.o.mobile.trigger_on_type; 3430 $this.o.trigger.click = $this.o.mobile.click_action; 3431 $this.o.trigger.click_location = $this.o.mobile.click_action_location; 3432 $this.o.trigger.return = $this.o.mobile.return_action; 3433 $this.o.trigger.return_location = $this.o.mobile.return_action_location; 3434 $this.o.trigger.redirect_url = $this.o.mobile.redirect_url; 3435 $this.o.trigger.elementor_url = $this.o.mobile.elementor_url; 3436 } 3437 $this.o.redirectOnClick = $this.o.trigger.click !== "ajax_search" && $this.o.trigger.click !== "nothing"; 3438 $this.o.redirectOnEnter = $this.o.trigger.return !== "ajax_search" && $this.o.trigger.return !== "nothing"; 3439 if ($this.usingLiveLoader()) { 3440 $this.o.trigger.type = $this.o.resPage.trigger_type; 3441 $this.o.trigger.facet = $this.o.resPage.trigger_facet; 3442 if ($this.o.resPage.trigger_magnifier) { 3443 $this.o.redirectOnClick = 0; 3444 $this.o.trigger.click = "ajax_search"; 3445 } 3446 if ($this.o.resPage.trigger_return) { 3447 $this.o.redirectOnEnter = 0; 3448 $this.o.trigger.return = "ajax_search"; 3449 } 3450 } 3451 $this.statisticsID = $this.n("container").data("statistics-id"); 3452 $this.statisticsID = $this.statisticsID === "" ? 0 : parseInt($this.statisticsID); 3453 if ($this.o.compact.overlay && external_DoMini_namespaceObject("#asp_absolute_overlay").length === 0) { 3454 external_DoMini_namespaceObject("body").append("<div id='asp_absolute_overlay'></div>"); 3455 } 3456 if ($this.usingLiveLoader()) { 3457 $this.initLiveLoaderPopState?.(); 3458 } 3459 if (typeof $this.initCompact !== "undefined") { 3460 $this.initCompact(); 3461 } 3462 $this.monitorTouchMove(); 3463 $this.initEvents(); 3464 $this.initAutop(); 3465 $this.initEtc(); 3466 $this.hooks(); 3467 $this.n("s").trigger("asp_init_search_bar", [$this.o.id, $this.o.iid], true, true); 3468 return this; 3469}; 3470base.plugin.n = function(k) { 3471 if (typeof this.nodes[k] !== "undefined") { 3472 return this.nodes[k]; 3473 } else { 3474 switch (k) { 3475 case "s": 3476 this.nodes[k] = this.nodes.search; 3477 break; 3478 case "container": 3479 this.nodes[k] = this.nodes.search.closest(".asp_w_container"); 3480 break; 3481 case "searchsettings": 3482 this.nodes[k] = external_DoMini_namespaceObject(".asp_ss", this.n("container")); 3483 break; 3484 case "resultsDiv": 3485 this.nodes[k] = external_DoMini_namespaceObject(".asp_r", this.n("container")); 3486 break; 3487 case "probox": 3488 this.nodes[k] = external_DoMini_namespaceObject(".probox", this.nodes.search); 3489 break; 3490 case "proinput": 3491 this.nodes[k] = external_DoMini_namespaceObject(".proinput", this.nodes.search); 3492 break; 3493 case "text": 3494 this.nodes[k] = external_DoMini_namespaceObject(".proinput input.orig", this.nodes.search); 3495 break; 3496 case "textAutocomplete": 3497 this.nodes[k] = external_DoMini_namespaceObject(".proinput input.autocomplete", this.nodes.search); 3498 break; 3499 case "proloading": 3500 this.nodes[k] = external_DoMini_namespaceObject(".proloading", this.nodes.search); 3501 break; 3502 case "proclose": 3503 this.nodes[k] = external_DoMini_namespaceObject(".proclose", this.nodes.search); 3504 break; 3505 case "promagnifier": 3506 this.nodes[k] = external_DoMini_namespaceObject(".promagnifier", this.nodes.search); 3507 break; 3508 case "prosettings": 3509 this.nodes[k] = external_DoMini_namespaceObject(".prosettings", this.nodes.search); 3510 break; 3511 case "settingsAppend": 3512 this.nodes[k] = external_DoMini_namespaceObject("#wpdreams_asp_settings_" + this.o.id); 3513 break; 3514 case "resultsAppend": 3515 this.nodes[k] = external_DoMini_namespaceObject("#wpdreams_asp_results_" + this.o.id); 3516 break; 3517 case "trythis": 3518 this.nodes[k] = external_DoMini_namespaceObject("#asp-try-" + this.o.rid); 3519 break; 3520 case "hiddenContainer": 3521 this.nodes[k] = external_DoMini_namespaceObject(".asp_hidden_data", this.n("container")); 3522 break; 3523 case "aspItemOverlay": 3524 this.nodes[k] = external_DoMini_namespaceObject(".asp_item_overlay", this.n("hiddenContainer")); 3525 break; 3526 case "showmoreContainer": 3527 this.nodes[k] = external_DoMini_namespaceObject(".asp_showmore_container", this.n("resultsDiv")); 3528 break; 3529 case "showmore": 3530 this.nodes[k] = external_DoMini_namespaceObject(".showmore", this.n("resultsDiv")); 3531 break; 3532 case "items": 3533 this.nodes[k] = external_DoMini_namespaceObject(".item", this.n("resultsDiv")).length > 0 ? external_DoMini_namespaceObject(".item", this.n("resultsDiv")) : external_DoMini_namespaceObject(".photostack-flip", this.n("resultsDiv")); 3534 break; 3535 case "results": 3536 this.nodes[k] = external_DoMini_namespaceObject(".results", this.n("resultsDiv")); 3537 break; 3538 case "resdrg": 3539 this.nodes[k] = external_DoMini_namespaceObject(".resdrg", this.n("resultsDiv")); 3540 break; 3541 } 3542 return this.nodes[k]; 3543 } 3544}; 3545base.plugin.att = function(k) { 3546 if (typeof this.dynamicAtts[k] !== "undefined") { 3547 return this.dynamicAtts[k]; 3548 } else { 3549 switch (k) { 3550 case "blocking": 3551 this.dynamicAtts[k] = this.n("searchsettings").hasClass("asp_sb"); 3552 } 3553 } 3554 return this.dynamicAtts[k]; 3555}; 3556base.plugin.initNodeVariables = function() {
3557 let $this = this; 3558 $this.o.id = $this.nodes.search.data("id"); 3559 $this.o.iid = $this.nodes.search.data("instance"); 3560 $this.o.rid = $this.o.id + "_" + $this.o.iid; 3561 $this.fixClonedSelf(); 3562}; 3563base.plugin.initEvents = function() { 3564 this.initSettingsSwitchEvents?.(); 3565 this.initOtherEvents(); 3566 this.initTryThisEvents(); 3567 this.initMagnifierEvents(); 3568 this.initInputEvents(); 3569 if (this.o.compact.enabled) { 3570 this.initCompactEvents(); 3571 } 3572}; 3573/* harmony default export */ var init = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3574 3575;// ./src/client/plugin/core/init/results.js 3576 3577 3578 3579"use strict"; 3580let init_results_helpers = base.helpers; 3581base.plugin.initResults = function() { 3582 if (!this.resultsInitialized) { 3583 this.initResultsBox(); 3584 this.initResultsEvents(); 3585 if (this.o.resultstype === "vertical") { 3586 this.initNavigationEvents?.(); 3587 } 3588 if (this.o.resultstype === "isotopic") { 3589 this.initIsotopicPagination?.(); 3590 } 3591 } 3592}; 3593base.plugin.initResultsBox = function() { 3594 let $this = this; 3595 $this.initResultsAnimations(); 3596 if (init_results_helpers.isMobile() && $this.o.mobile.force_res_hover) { 3597 $this.o.resultsposition = "hover"; 3598 $this.nodes.resultsDiv = $this.n("resultsDiv").clone(); 3599 external_DoMini_namespaceObject("body").append($this.nodes.resultsDiv); 3600 $this.n("resultsDiv").css({ 3601 "position": "absolute" 3602 }); 3603 } else { 3604 if ($this.o.resultsposition === "hover" && $this.n("resultsAppend").length <= 0) { 3605 $this.nodes.resultsDiv = $this.n("resultsDiv").clone(); 3606 external_DoMini_namespaceObject("body").append($this.nodes.resultsDiv); 3607 } else { 3608 $this.o.resultsposition = "block"; 3609 $this.n("resultsDiv").css({ 3610 "position": "static" 3611 }); 3612 if ($this.n("resultsAppend").length > 0) { 3613 if ($this.n("resultsAppend").find(".asp_r_" + $this.o.id).length > 0) { 3614 $this.nodes.resultsDiv = $this.n("resultsAppend").find(".asp_r_" + $this.o.id); 3615 if (typeof $this.nodes.resultsDiv.get(0).referenced !== "undefined") { 3616 ++$this.nodes.resultsDiv.get(0).referenced; 3617 } else { 3618 $this.nodes.resultsDiv.get(0).referenced = 1; 3619 } 3620 } else { 3621 $this.nodes.resultsDiv = $this.nodes.resultsDiv.clone(); 3622 $this.nodes.resultsAppend.append($this.nodes.resultsDiv); 3623 } 3624 } 3625 } 3626 } 3627 $this.nodes.showmore = external_DoMini_namespaceObject(".showmore", $this.nodes.resultsDiv); 3628 $this.nodes.items = external_DoMini_namespaceObject(".item", $this.n("resultsDiv")).length > 0 ? external_DoMini_namespaceObject(".item", $this.nodes.resultsDiv) : external_DoMini_namespaceObject(".photostack-flip", $this.nodes.resultsDiv); 3629 $this.nodes.results = external_DoMini_namespaceObject(".results", $this.nodes.resultsDiv); 3630 $this.nodes.resdrg = external_DoMini_namespaceObject(".resdrg", $this.nodes.resultsDiv); 3631 $this.nodes.resultsDiv.get(0).id = $this.nodes.resultsDiv.get(0).id.replace("__original__", ""); 3632 $this.detectAndFixFixedPositioning(); 3633 $this.initInfiniteScroll(); 3634 $this.resultsInitialized = true; 3635}; 3636base.plugin.initResultsAnimations = function() { 3637 let $this = this, rpos = $this.n("resultsDiv").css("position"), blocking = rpos !== "fixed" && rpos !== "absolute"; 3638 $this.resAnim = { 3639 "showClass": "", 3640 "showCSS": { 3641 "visibility": "visible", 3642 "display": "block", 3643 "opacity": 1, 3644 "animation-duration": $this.animOptions.results.dur + "ms" 3645 }, 3646 "hideClass": "", 3647 "hideCSS": { 3648 "visibility": "hidden", 3649 "opacity": 0, 3650 "display": "none" 3651 }, 3652 "duration": $this.animOptions.results.dur + "ms" 3653 }; 3654 if ($this.animOptions.results.anim === "fade") { 3655 $this.resAnim.showClass = "asp_an_fadeIn"; 3656 $this.resAnim.hideClass = "asp_an_fadeOut"; 3657 } 3658 if ($this.animOptions.results.anim === "fadedrop" && !blocking) { 3659 $this.resAnim.showClass = "asp_an_fadeInDrop"; 3660 $this.resAnim.hideClass = "asp_an_fadeOutDrop"; 3661 } else if ($this.animOptions.results.anim === "fadedrop") { 3662 $this.resAnim.showClass = "asp_an_fadeIn"; 3663 $this.resAnim.hideClass = "asp_an_fadeOut"; 3664 } 3665 $this.n("resultsDiv").css({ 3666 "-webkit-animation-duration": $this.resAnim.duration + "ms", 3667 "animation-duration": $this.resAnim.duration + "ms"
3668 }); 3669}; 3670/* harmony default export */ var init_results = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3671 3672;// ./src/client/bundle/optimized/asp-core.js 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696/* harmony default export */ var asp_core = (base); 3697 3698Object(window.WPD).AjaxSearchPro = __webpack_exports__["default"]; 3699/******/ })() 3700;/******/ (function() { // webpackBootstrap 3701/******/ "use strict"; 3702/******/ // The require scope 3703/******/ var __webpack_require__ = {}; 3704/******/ 3705/************************************************************************/ 3706/******/ /* webpack/runtime/define property getters */ 3707/******/ !function() { 3708/******/ // define getter functions for harmony exports 3709/******/ __webpack_require__.d = function(exports, definition) { 3710/******/ for(var key in definition) { 3711/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 3712/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 3713/******/ } 3714/******/ } 3715/******/ }; 3716/******/ }(); 3717/******/ 3718/******/ /* webpack/runtime/hasOwnProperty shorthand */ 3719/******/ !function() { 3720/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 3721/******/ }(); 3722/******/ 3723/************************************************************************/ 3724var __webpack_exports__ = {}; 3725 3726// EXPORTS 3727__webpack_require__.d(__webpack_exports__, { 3728 "default": function() { return /* binding */ asp_results_vertical; } 3729}); 3730 3731;// external "AjaxSearchPro" 3732var external_AjaxSearchPro_namespaceObject = Object(window.WPD)["AjaxSearchPro"]; 3733;// external "DoMini" 3734var external_DoMini_namespaceObject = Object(window.WPD)["DoMini"]; 3735;// ./src/client/plugin/core/actions/results_vertical.js 3736 3737 3738 3739"use strict"; 3740external_AjaxSearchPro_namespaceObject.plugin.showVerticalResults = function() { 3741 let $this = this; 3742 $this.showResultsBox(); 3743 if ($this.n("items").length > 0) {
3744 let count = $this.n("items").length < $this.o.itemscount ? $this.n("items").length : $this.o.itemscount; 3745 count = count <= 0 ? 9999 : count; 3746 let groups = external_DoMini_namespaceObject(".asp_group_header", $this.n("resultsDiv")); 3747 if ($this.o.itemscount === 0 || $this.n("items").length <= $this.o.itemscount) { 3748 $this.n("results").css({ 3749 height: "auto" 3750 }); 3751 } else { 3752 if ($this.call_num < 1) 3753 $this.n("results").css({ 3754 height: "30px" 3755 }); 3756 if ($this.call_num < 1) { 3757 let i = 0, h = 0, final_h = 0, highest = 0; 3758 $this.n("items").forEach(function() { 3759 h += external_DoMini_namespaceObject(this).outerHeight(true); 3760 if (external_DoMini_namespaceObject(this).outerHeight(true) > highest) 3761 highest = external_DoMini_namespaceObject(this).outerHeight(true); 3762 i++; 3763 }); 3764 final_h = highest * count; 3765 if (final_h > h) 3766 final_h = h; 3767 i = i < 1 ? 1 : i; 3768 h = h / i * count; 3769 if (groups.length > 0) { 3770 groups.forEach(function(el, index) { 3771 let position = Array.prototype.slice.call(el.parentNode.children).indexOf(el), group_position = position - index - Math.floor(position / 3); 3772 if (group_position < count) { 3773 final_h += external_DoMini_namespaceObject(this).outerHeight(true); 3774 } 3775 }); 3776 } 3777 $this.n("results").css({ 3778 height: final_h + "px" 3779 }); 3780 } 3781 } 3782 $this.n("items").last().addClass("asp_last_item"); 3783 $this.n("results").find(".asp_group_header").prev(".item").addClass("asp_last_item"); 3784 $this.keywordHighlight(); 3785 } 3786 $this.resize(); 3787 if ($this.n("items").length === 0) { 3788 $this.n("results").css({ 3789 height: "auto" 3790 }); 3791 } 3792 if ($this.call_num < 1) { 3793 $this.n("results").get(0).scrollTop = 0; 3794 } 3795 if ($this.o.preventBodyScroll) { 3796 let t, $body = external_DoMini_namespaceObject("body"), bodyOverflow = $body.css("overflow"), bodyHadNoStyle = typeof $body.attr("style") === "undefined"; 3797 $this.n("results").off("touchstart"); 3798 $this.n("results").off("touchend"); 3799 $this.n("results").on("touchstart", function() { 3800 clearTimeout(t); 3801 external_DoMini_namespaceObject("body").css("overflow", "hidden"); 3802 }).on("touchend", function() { 3803 clearTimeout(t); 3804 t = setTimeout(function() { 3805 if (bodyHadNoStyle) { 3806 external_DoMini_namespaceObject("body").removeAttr("style"); 3807 } else { 3808 external_DoMini_namespaceObject("body").css("overflow", bodyOverflow); 3809 } 3810 }, 300); 3811 }); 3812 } 3813 $this.addAnimation(); 3814 $this.fixResultsPosition(true); 3815 $this.searching = false; 3816}; 3817/* harmony default export */ var results_vertical = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 3818 3819;// ./src/client/bundle/optimized/asp-results-vertical.js 3820 3821 3822 3823/* harmony default export */ var asp_results_vertical = (external_AjaxSearchPro_namespaceObject); 3824 3825Object(window.WPD).AjaxSearchPro = __webpack_exports__["default"]; 3826/******/ })() 3827;/******/ (function() { // webpackBootstrap 3828/******/ "use strict"; 3829/******/ // The require scope 3830/******/ var __webpack_require__ = {}; 3831/******/ 3832/************************************************************************/ 3833/******/ /* webpack/runtime/define property getters */ 3834/******/ !function() { 3835/******/ // define getter functions for harmony exports 3836/******/ __webpack_require__.d = function(exports, definition) { 3837/******/ for(var key in definition) { 3838/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 3839/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 3840/******/ } 3841/******/ } 3842/******/ }; 3843/******/ }(); 3844/******/ 3845/******/ /* webpack/runtime/hasOwnProperty shorthand */ 3846/******/ !function() { 3847/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 3848/******/ }(); 3849/******/ 3850/************************************************************************/ 3851var __webpack_exports__ = {}; 3852 3853// EXPORTS 3854__webpack_require__.d(__webpack_exports__, { 3855 "default": function() { return /* binding */ asp_live; } 3856}); 3857 3858;// external "AjaxSearchPro" 3859var external_AjaxSearchPro_namespaceObject = Object(window.WPD)["AjaxSearchPro"]; 3860;// external "DoMini" 3861var external_DoMini_namespaceObject = Object(window.WPD)["DoMini"]; 3862;// ./src/client/plugin/core/actions/live.js 3863 3864 3865 3866"use strict"; 3867let helpers = external_AjaxSearchPro_namespaceObject.helpers; 3868external_AjaxSearchPro_namespaceObject.plugin.liveLoad = function(origSelector, url, updateLocation, forceAjax, cache) { 3869 let selector = origSelector; 3870 if (selector === "body" || selector === "html") { 3871 console.log("Ajax Search Pro: Do not use html or body as the live loader selector."); 3872 return false;
3873 } 3874 let $this = this; 3875 if (ASP.pageHTML !== "") { 3876 $this.setLiveLoadCache(ASP.pageHTML, origSelector); 3877 } 3878 function process(html) { 3879 let data = helpers.Hooks.applyFilters("asp/live_load/raw_data", html, $this); 3880 let parser = new DOMParser(); 3881 let dataNode = parser.parseFromString(data, "text/html"); 3882 let $dataNode = external_DoMini_namespaceObject(dataNode); 3883 if (data !== "" && $dataNode.length > 0 && $dataNode.find(selector).length > 0) { 3884 data = data.replace(/&asp_force_reset_pagination=1/gmi, ""); 3885 data = data.replace(/%26asp_force_reset_pagination%3D1/gmi, ""); 3886 data = data.replace(/&asp_force_reset_pagination=1/gmi, ""); 3887 if (helpers.isSafari()) { 3888 data = data.replace(/srcset/gmi, "nosrcset"); 3889 } 3890 data = helpers.Hooks.applyFilters("asp_live_load_html", data, $this.o.id, $this.o.iid); 3891 $dataNode = external_DoMini_namespaceObject(parser.parseFromString(data, "text/html")); 3892 const newStatisticsID = $dataNode.find("#asp-statistics").data("statistics-id"); 3893 $this.statisticsID = newStatisticsID === "" ? 0 : parseInt(newStatisticsID); 3894 let replacementNode = $dataNode.find(selector).get(0); 3895 replacementNode = helpers.Hooks.applyFilters("asp/live_load/replacement_node", replacementNode, $this, $el.get(0), data); 3896 if (replacementNode != null) { 3897 $el.get(0).parentNode.replaceChild(replacementNode, $el.get(0)); 3898 } 3899 $el = external_DoMini_namespaceObject(selector).first(); 3900 if (updateLocation) { 3901 document.title = dataNode.title; 3902 history.pushState({}, null, url); 3903 } 3904 external_DoMini_namespaceObject(selector).first().find(".woocommerce-ordering select.orderby").on("change", function() { 3905 if (external_DoMini_namespaceObject(this).closest("form").length > 0) { 3906 external_DoMini_namespaceObject(this).closest("form").get(0).submit(); 3907 } 3908 }); 3909 if ($this.o.highlight) { 3910 $el.highlight( 3911 $this.n("text").val().replace(/["']/g, "").split(" "), 3912 { element: "span", className: "asp_single_highlighted_" + $this.o.id, wordsOnly: !!$this.o.highlightWholewords } 3913 ); 3914 } 3915 $this.addHighlightString(external_DoMini_namespaceObject(selector).find("a")); 3916 if (ASP.statistics.enabled && ASP.statistics.record_results && ASP.statistics.record_result_interactions && ASP.getResultsPageResultSelector() !== "") { 3917 external_DoMini_namespaceObject(selector).find(ASP.getResultsPageResultSelector()).off().on("click", function() { 3918 ASP.registerInteraction(this, $this.statisticsID); 3919 }); 3920 } 3921 helpers.Hooks.applyFilters("asp/live_load/finished", url, $this, selector, $el.get(0), dataNode); 3922 ASP.initialize(); 3923 $this.lastSuccesfulSearch = external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() + $this.n("text").val().trim(); 3924 $this.lastSearchData = data; 3925 $this.setLiveLoadCache(html, origSelector); 3926 } 3927 $this.n("s").trigger("asp_search_end", [$this.o.id, $this.o.iid, $this.n("text").val(), data], true, true); 3928 $this.gaEvent?.("search_end", { "results_count": "unknown" }); 3929 $this.hideLoader(); 3930 $el.css("opacity", 1); 3931 $this.searching = false; 3932 if ($this.n("text").val() !== "") { 3933 $this.n("proclose").css({ 3934 display: "block" 3935 }); 3936 } 3937 } 3938 updateLocation = typeof updateLocation == "undefined" ? true : updateLocation; 3939 forceAjax = typeof forceAjax == "undefined" ? true : forceAjax; 3940 let altSel = $this.getLiveLoadAltSelectors(); 3941 if (selector !== "#main") 3942 altSel.unshift("#main"); 3943 if (external_DoMini_namespaceObject(selector).length < 1) { 3944 for (const s of altSel) { 3945 if (external_DoMini_namespaceObject(s).length > 0) { 3946 selector = s; 3947 break; 3948 } 3949 } 3950 if (external_DoMini_namespaceObject(selector).length < 1) { 3951 console.log("Ajax Search Pro: The live search selector does not exist on the page."); 3952 return false; 3953 } 3954 } 3955 selector = helpers.Hooks.applyFilters("asp/live_load/selector", selector, this); 3956 let $el = external_DoMini_namespaceObject(selector).first(); 3957 $this.searchAbort(); 3958 $el.css("opacity", 0.4); 3959 url = helpers.Hooks.applyFilters("asp/live_load/url", url, $this, selector, $el.get(0)); 3960 helpers.Hooks.applyFilters("asp/live_load/start", url, $this, selector, $el.get(0)); 3961 if (!forceAjax && $this.n("searchsettings").find("input[name=filters_initial]").val() === "1" && $this.n("text").val() === "") { 3962 window.WPD.intervalUntilExecute(function() { 3963 process(ASP.pageHTML); 3964 }, function() { 3965 return ASP.pageHTML !== ""; 3966 }); 3967 } else { 3968 if (typeof cache != "undefined") { 3969 process(cache.html); 3970 } else { 3971 $this.searching = true;
3972 $this.post = external_DoMini_namespaceObject.fn.ajax({ 3973 url, 3974 method: "GET", 3975 success: function(data) { 3976 process(data); 3977 $this.isAutoP = false; 3978 }, 3979 dataType: "html", 3980 fail: function(jqXHR) { 3981 $el.css("opacity", 1); 3982 if (jqXHR.aborted) { 3983 return; 3984 } 3985 $el.html("This request has failed. Please check your connection."); 3986 $this.hideLoader(); 3987 $this.searching = false; 3988 $this.n("proclose").css({ 3989 display: "block" 3990 }); 3991 $this.isAutoP = false; 3992 } 3993 }); 3994 } 3995 } 3996}; 3997external_AjaxSearchPro_namespaceObject.plugin.getLiveLoadAltSelectors = function() { 3998 return [ 3999 ".search-content", 4000 "#content #posts-container", 4001 "#content", 4002 "#Content", 4003 "div[role=main]", 4004 "main[role=main]", 4005 "div.theme-content", 4006 "div.td-ss-main-content", 4007 "main#page-content", 4008 "main.l-content", 4009 "#primary", 4010 "#main-content", 4011 ".main-content", 4012 ".search section .bde-post-loop", 4013 // breakdance posts loop section search archive 4014 ".archive section .bde-post-loop", 4015 // breakdance posts loop section general archive 4016 ".search section .bde-post-list", 4017 // breakdance posts list section search archive 4018 ".archive section .bde-post-list", 4019 // breakdance posts list section general archive 4020 "main .wp-block-query", 4021 // block themes 4022 "main" 4023 // fallback 4024 ]; 4025}; 4026external_AjaxSearchPro_namespaceObject.plugin.usingLiveLoader = function() { 4027 const $this = this; 4028 if ($this._usingLiveLoader !== void 0) return $this._usingLiveLoader; 4029 const o = $this.o; 4030 const idClass = "asp_es_" + o.id; 4031 const altSelectors = this.getLiveLoadAltSelectors().join(","); 4032 if (document.getElementsByClassName(idClass).length) { 4033 return $this._usingLiveLoader = true; 4034 } 4035 const options = ["resPage", "wooShop", "cptArchive", "taxArchive"]; 4036 $this._usingLiveLoader = options.some((key) => { 4037 const opt = o[key]; 4038 return opt.useAjax && (document.querySelector(opt.selector) || altSelectors && document.querySelector(altSelectors)); 4039 }); 4040 return $this._usingLiveLoader; 4041}; 4042external_AjaxSearchPro_namespaceObject.plugin.getLiveURLbyBaseLocation = function(location) { 4043 let $this = this, url = "asp_ls=" + helpers.nicePhrase($this.n("text").val()), start = "&"; 4044 if (location.indexOf("?") === -1) { 4045 start = "?"; 4046 } 4047 this.updateSettingsDeviceField?.(); 4048 let final = location + start + url + "&asp_active=1&asp_force_reset_pagination=1&p_asid=" + $this.o.id + "&p_asp_data=1&" + external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize(); 4049 final = final.replace("?&", "?"); 4050 final = final.replace("&&", "&"); 4051 return final; 4052}; 4053external_AjaxSearchPro_namespaceObject.plugin.getCurrentLiveURL = function() { 4054 const $this = this; 4055 const url = new URL(window.location.href); 4056 let location; 4057 url.hash = ""; 4058 location = url.href; 4059 location = location.replace(/([?&])query-\w+-page=\d+/, "$1"); 4060 location = location.indexOf("asp_ls=") > -1 ? location.slice(0, location.indexOf("asp_ls=")) : location; 4061 location = location.indexOf("asp_ls&") > -1 ? location.slice(0, location.indexOf("asp_ls&")) : location; 4062 location = location.indexOf("p_asid=") > -1 ? location.slice(0, location.indexOf("p_asid=")) : location; 4063 location = location.indexOf("asp_") > -1 ? location.slice(0, location.indexOf("asp_")) : location; 4064 return $this.getLiveURLbyBaseLocation(location); 4065}; 4066external_AjaxSearchPro_namespaceObject.plugin.initLiveLoaderPopState = function() { 4067 let $this = this; 4068 $this.liveLoadCache = []; 4069 window.addEventListener("popstate", () => { 4070 let data = $this.getLiveLoadCache(); 4071 if (data !== false) { 4072 $this.n("text").val(data.phrase); 4073 helpers.formData(external_DoMini_namespaceObject("form", $this.n("searchsettings")), data.settings); 4074 $this.resetNoUISliderFilters(); 4075 $this.liveLoad(data.selector, document.location.href, false, false, data); 4076 } 4077 }); 4078 if (ASP.pageHTML === "") { 4079 if (typeof ASP._ajax_page_html === "undefined") { 4080 ASP._ajax_page_html = true; 4081 const url = new URL($this.currentPageURL); 4082 url.searchParams.append("statistics", 0);
4083 external_DoMini_namespaceObject.fn.ajax({ 4084 url, 4085 method: "GET", 4086 success: function(data) { 4087 ASP.pageHTML = data; 4088 }, 4089 dataType: "html" 4090 }); 4091 } 4092 } 4093}; 4094external_AjaxSearchPro_namespaceObject.plugin.setLiveLoadCache = function(html, selector) { 4095 let $this = this; 4096 if ($this.liveLoadCache.filter((item) => { 4097 return item.href === document.location.href; 4098 }).length === 0) { 4099 $this.liveLoadCache.push({ 4100 "href": html === ASP.pageHTML ? $this.currentPageURL : document.location.href, 4101 "phrase": html === ASP.pageHTML ? "" : $this.n("text").val(), 4102 "selector": selector, 4103 "html": html, 4104 "settings": html === ASP.pageHTML ? $this.originalFormData : helpers.formData(external_DoMini_namespaceObject("form", $this.n("searchsettings"))) 4105 }); 4106 } 4107}; 4108external_AjaxSearchPro_namespaceObject.plugin.getLiveLoadCache = function() { 4109 let $this = this; 4110 let res = $this.liveLoadCache.filter((item) => { 4111 return item.href === document.location.href; 4112 }); 4113 return res.length > 0 ? res[0] : false; 4114}; 4115/* harmony default export */ var live = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 4116 4117;// ./src/client/bundle/optimized/asp-live.js 4118 4119 4120 4121/* harmony default export */ var asp_live = (external_AjaxSearchPro_namespaceObject); 4122 4123Object(window.WPD).AjaxSearchPro = __webpack_exports__["default"]; 4124/******/ })() 4125;/******/ (function() { // webpackBootstrap 4126/******/ "use strict"; 4127/******/ // The require scope 4128/******/ var __webpack_require__ = {}; 4129/******/ 4130/************************************************************************/ 4131/******/ /* webpack/runtime/define property getters */ 4132/******/ !function() { 4133/******/ // define getter functions for harmony exports 4134/******/ __webpack_require__.d = function(exports, definition) { 4135/******/ for(var key in definition) { 4136/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 4137/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 4138/******/ } 4139/******/ } 4140/******/ }; 4141/******/ }(); 4142/******/ 4143/******/ /* webpack/runtime/hasOwnProperty shorthand */ 4144/******/ !function() { 4145/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 4146/******/ }(); 4147/******/ 4148/************************************************************************/ 4149var __webpack_exports__ = {}; 4150 4151// EXPORTS 4152__webpack_require__.d(__webpack_exports__, { 4153 "default": function() { return /* binding */ asp_autocomplete; } 4154}); 4155 4156;// external "AjaxSearchPro" 4157var external_AjaxSearchPro_namespaceObject = Object(window.WPD)["AjaxSearchPro"]; 4158;// external "DoMini" 4159var external_DoMini_namespaceObject = Object(window.WPD)["DoMini"]; 4160;// ./src/client/plugin/core/actions/autocomplete.js 4161 4162 4163 4164"use strict"; 4165external_AjaxSearchPro_namespaceObject.plugin.autocompleteCheck = function(val = "") { 4166 if (this.n("text").val() === "") { 4167 this.n("textAutocomplete").val(""); 4168 return false; 4169 } 4170 let autocompleteVal = this.n("textAutocomplete").val(); 4171 return !(autocompleteVal !== "" && autocompleteVal.indexOf(val) === 0); 4172}; 4173external_AjaxSearchPro_namespaceObject.plugin.autocomplete = function() { 4174 let $this = this, val = $this.n("text").val(); 4175 if (!$this.autocompleteCheck(val)) { 4176 return; 4177 } 4178 if ($this.n("text").val().length >= $this.o.autocomplete.trigger_charcount) { 4179 let data = { 4180 action: "ajaxsearchpro_autocomplete", 4181 asid: $this.o.id, 4182 sauto: $this.n("text").val(), 4183 asp_inst_id: $this.o.rid, 4184 options: external_DoMini_namespaceObject("form", $this.n("searchsettings")).serialize() 4185 }; 4186 $this.postAuto = external_DoMini_namespaceObject.fn.ajax({ 4187 "url": ASP.ajaxurl, 4188 "method": "POST", 4189 "data": data, 4190 "success": function(response) { 4191 if (response.length > 0) { 4192 response = external_DoMini_namespaceObject("<textarea />").html(response).text(); 4193 response = response.replace(/^\s*[\r\n]/gm, ""); 4194 response = val + response.substring(val.length); 4195 } 4196 $this.n("textAutocomplete").val(response); 4197 $this.fixAutocompleteScrollLeft(); 4198 } 4199 }); 4200 } 4201}; 4202external_AjaxSearchPro_namespaceObject.plugin.autocompleteGoogleOnly = function() {
4203 let $this = this, val = $this.n("text").val(); 4204 if (!$this.autocompleteCheck(val)) { 4205 return; 4206 } 4207 let lang = $this.o.autocomplete.lang; 4208 ["wpml_lang", "polylang_lang", "qtranslate_lang"].forEach(function(v) { 4209 if (external_DoMini_namespaceObject('input[name="' + v + '"]', $this.n("searchsettings")).length > 0 && external_DoMini_namespaceObject('input[name="' + v + '"]', $this.n("searchsettings")).val().length > 1) { 4210 lang = external_DoMini_namespaceObject('input[name="' + v + '"]', $this.n("searchsettings")).val(); 4211 } 4212 }); 4213 if ($this.n("text").val().length >= $this.o.autocomplete.trigger_charcount) { 4214 external_DoMini_namespaceObject.fn.ajax({ 4215 url: "https://clients1.google.com/complete/search", 4216 cors: "no-cors", 4217 data: { 4218 q: val, 4219 hl: lang, 4220 nolabels: "t", 4221 client: "hp", 4222 ds: "" 4223 }, 4224 success: function(data) { 4225 if (data[1].length > 0) { 4226 let response = data[1][0][0].replace(/(<([^>]+)>)/ig, ""); 4227 response = external_DoMini_namespaceObject("<textarea />").html(response).text(); 4228 response = response.substring(val.length); 4229 $this.n("textAutocomplete").val(val + response); 4230 $this.fixAutocompleteScrollLeft(); 4231 } 4232 } 4233 }); 4234 } 4235}; 4236external_AjaxSearchPro_namespaceObject.plugin.fixAutocompleteScrollLeft = function() { 4237 this.n("textAutocomplete").get(0).scrollLeft = this.n("text").get(0).scrollLeft; 4238}; 4239/* harmony default export */ var autocomplete = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 4240 4241;// ./src/client/plugin/core/events/autocomplete.js 4242 4243 4244 4245"use strict"; 4246let helpers = external_AjaxSearchPro_namespaceObject.helpers; 4247external_AjaxSearchPro_namespaceObject.plugin.initAutocompleteEvent = function() { 4248 let $this = this, tt; 4249 if ($this.o.autocomplete.enabled && !helpers.isMobile() || $this.o.autocomplete.mobile && helpers.isMobile()) { 4250 $this.n("text").on("keydown", function(e) { 4251 const keyCode = e.keyCode || e.which; 4252 if (keyCode === 9 && $this.n("textAutocomplete").val() !== "" && $this.n("textAutocomplete").val() !== external_DoMini_namespaceObject(this).val()) { 4253 e.preventDefault(); 4254 } 4255 }); 4256 $this.n("text").on("keyup", function(e) { 4257 $this.keycode = e.keyCode || e.which; 4258 $this.ktype = e.type; 4259 let thekey = 39; 4260 if (external_DoMini_namespaceObject("body").hasClass("rtl")) { 4261 thekey = 37; 4262 } 4263 if (($this.keycode === thekey || $this.keycode === 9) && $this.n("textAutocomplete").val() !== "") { 4264 e.preventDefault(); 4265 $this.n("text").val($this.n("textAutocomplete").val()); 4266 if ($this.o.trigger.type) { 4267 $this.searchAbort(); 4268 $this.search(); 4269 } 4270 } else { 4271 clearTimeout(tt); 4272 if ($this.postAuto != null) $this.postAuto.abort(); 4273 if ($this.o.autocomplete.googleOnly) { 4274 $this.autocompleteGoogleOnly(); 4275 } else { 4276 tt = setTimeout(function() { 4277 $this.autocomplete(); 4278 tt = null; 4279 }, $this.o.trigger.autocomplete_delay); 4280 } 4281 } 4282 }); 4283 $this.n("text").on("keyup mouseup input blur select", function() { 4284 $this.fixAutocompleteScrollLeft(); 4285 }); 4286 } 4287}; 4288/* harmony default export */ var events_autocomplete = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 4289 4290;// ./src/client/bundle/optimized/asp-autocomplete.js 4291 4292 4293 4294 4295/* harmony default export */ var asp_autocomplete = (external_AjaxSearchPro_namespaceObject); 4296 4297Object(window.WPD).AjaxSearchPro = __webpack_exports__["default"]; 4298/******/ })() 4299;/******/ (function() { // webpackBootstrap 4300/******/ "use strict"; 4301/******/ // The require scope 4302/******/ var __webpack_require__ = {}; 4303/******/ 4304/************************************************************************/ 4305/******/ /* webpack/runtime/compat get default export */ 4306/******/ !function() { 4307/******/ // getDefaultExport function for compatibility with non-harmony modules 4308/******/ __webpack_require__.n = function(module) {
4309/******/ var getter = module && module.__esModule ? 4310/******/ function() { return module['default']; } : 4311/******/ function() { return module; }; 4312/******/ __webpack_require__.d(getter, { a: getter }); 4313/******/ return getter; 4314/******/ }; 4315/******/ }(); 4316/******/ 4317/******/ /* webpack/runtime/define property getters */ 4318/******/ !function() { 4319/******/ // define getter functions for harmony exports 4320/******/ __webpack_require__.d = function(exports, definition) { 4321/******/ for(var key in definition) { 4322/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 4323/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 4324/******/ } 4325/******/ } 4326/******/ }; 4327/******/ }(); 4328/******/ 4329/******/ /* webpack/runtime/hasOwnProperty shorthand */ 4330/******/ !function() { 4331/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 4332/******/ }(); 4333/******/ 4334/************************************************************************/ 4335 4336;// external "DoMini" 4337var external_DoMini_namespaceObject = DoMini; 4338var external_DoMini_default = /*#__PURE__*/__webpack_require__.n(external_DoMini_namespaceObject); 4339;// ./src/client/plugin/wrapper/instances.js 4340 4341 4342window._asp_instances_storage = window._asp_instances_storage || []; 4343const instances = { 4344 instances: window._asp_instances_storage, 4345 get: function(id, instance) { 4346 this.clean(); 4347 if (typeof id === "undefined" || id === 0) { 4348 return this.instances; 4349 } else { 4350 if (typeof instance === "undefined") { 4351 let ret = []; 4352 for (let i = 0; i < this.instances.length; i++) { 4353 if (parseInt(this.instances[i].o.id) === id) { 4354 ret.push(this.instances[i]); 4355 } 4356 } 4357 return ret.length > 0 ? ret : false;
4358 } else { 4359 for (let i = 0; i < this.instances.length; i++) { 4360 if (parseInt(this.instances[i].o.id) === id && parseInt(this.instances[i].o.iid) === instance) { 4361 return this.instances[i]; 4362 } 4363 } 4364 } 4365 } 4366 return false; 4367 }, 4368 set: function(obj) { 4369 if (!this.exist(obj.o.id, obj.o.iid)) { 4370 this.instances.push(obj); 4371 return true; 4372 } else { 4373 return false; 4374 } 4375 }, 4376 exist: function(id, instance) { 4377 this.clean(); 4378 for (let i = 0; i < this.instances.length; i++) { 4379 if (parseInt(this.instances[i].o.id) === parseInt(id)) { 4380 if (typeof instance === "undefined") { 4381 return true; 4382 } else if (parseInt(this.instances[i].o.iid) === parseInt(instance)) { 4383 return true; 4384 } 4385 } 4386 } 4387 return false; 4388 }, 4389 clean: function() { 4390 let unset = [], _this = this; 4391 this.instances.forEach(function(v, k) { 4392 if (external_DoMini_namespaceObject(".asp_m_" + v.o.rid).length === 0) { 4393 unset.push(k); 4394 } 4395 }); 4396 unset.forEach(function(k) { 4397 if (typeof _this.instances[k] !== "undefined") { 4398 _this.instances[k].destroy(); 4399 _this.instances.splice(k, 1); 4400 } 4401 }); 4402 }, 4403 destroy: function(id, instance) { 4404 let i = this.get(id, instance); 4405 if (i !== false) { 4406 if (Array.isArray(i)) { 4407 i.forEach(function(s) { 4408 s.destroy(); 4409 }); 4410 this.instances = []; 4411 } else { 4412 let u = 0; 4413 this.instances.forEach(function(v, k) { 4414 if (parseInt(v.o.id) === id && parseInt(v.o.iid) === instance) { 4415 u = k; 4416 } 4417 }); 4418 i.destroy(); 4419 this.instances.splice(u, 1); 4420 } 4421 } 4422 } 4423}; 4424/* harmony default export */ var wrapper_instances = (instances); 4425 4426;// ./src/client/plugin/wrapper/api.ts 4427 4428 4429function api() { 4430 "use strict"; 4431 const a4 = function(id, instance, func, args) { 4432 let s = wrapper_instances.get(id, instance); 4433 return s !== false && s[func].apply(s, [args]); 4434 }, a3 = function(id, func, args) { 4435 let s; 4436 if (typeof func === "number" && isFinite(func)) { 4437 s = wrapper_instances.get(id, func); 4438 return s !== false && s[args].apply(s); 4439 } else if (typeof func === "string") { 4440 s = wrapper_instances.get(id);
4441 return s !== false && s.forEach(function(i) { 4442 const f = i[func]; 4443 if (typeof f === "function") { 4444 f.apply(i, [args]); 4445 } 4446 }); 4447 } 4448 }, a2 = function(id, func) { 4449 let s; 4450 if (func === "exists") { 4451 return wrapper_instances.exist(id); 4452 } 4453 s = wrapper_instances.get(id); 4454 return s !== false && s.forEach(function(i) { 4455 const f = i[func]; 4456 if (typeof f === "function") { 4457 f.apply(i); 4458 } 4459 }); 4460 }; 4461 if (arguments.length === 4) { 4462 return a4.apply(this, arguments); 4463 } else if (arguments.length === 3) { 4464 return a3.apply(this, arguments); 4465 } else if (arguments.length === 2) { 4466 return a2.apply(this, arguments); 4467 } else if (arguments.length === 0) { 4468 console.log("Usage: ASP.api(id, [optional]instance, function, [optional]args);"); 4469 console.log("For more info: https://knowledgebase.ajaxsearchpro.com/other/javascript-api"); 4470 } 4471} 4472 4473;// ./src/client/utils/onSafeDocumentReady.ts 4474 4475const onSafeDocumentReady = (callback) => { 4476 let wasExecuted = false; 4477 const isDocumentReady = () => { 4478 return document.readyState === "complete" || document.readyState === "interactive" || document.readyState === "loaded"; 4479 }; 4480 const removeListeners = () => { 4481 window.removeEventListener("DOMContentLoaded", onDOMContentLoaded); 4482 document.removeEventListener("readystatechange", onReadyStateChange); 4483 }; 4484 const runCallback = () => { 4485 if (!wasExecuted) { 4486 wasExecuted = true; 4487 callback(); 4488 removeListeners(); 4489 } 4490 }; 4491 const onDOMContentLoaded = () => { 4492 runCallback(); 4493 }; 4494 const onReadyStateChange = () => { 4495 if (isDocumentReady()) { 4496 runCallback(); 4497 } 4498 }; 4499 if (isDocumentReady()) { 4500 runCallback(); 4501 } else { 4502 window.addEventListener("DOMContentLoaded", onDOMContentLoaded); 4503 document.addEventListener("readystatechange", onReadyStateChange); 4504 } 4505}; 4506/* harmony default export */ var utils_onSafeDocumentReady = (onSafeDocumentReady); 4507 4508;// ./src/client/global/utils/browser.ts 4509 4510 4511 4512const isSafari = () => { 4513 return /^((?!chrome|android).)*safari/i.test(navigator.userAgent); 4514}; 4515const whichjQuery = (plugin) => { 4516 let jq = false; 4517 if (typeof window.$ != "undefined") { 4518 if (typeof plugin === "undefined") { 4519 jq = window.$; 4520 } else { 4521 if (typeof window.$.fn[plugin] != "undefined") { 4522 jq = window.$; 4523 } 4524 } 4525 } 4526 if (jq === false && typeof window.jQuery != "undefined") { 4527 jq = window.jQuery; 4528 if (typeof plugin === "undefined") { 4529 jq = window.jQuery; 4530 } else { 4531 if (typeof window.jQuery.fn[plugin] != "undefined") { 4532 jq = window.jQuery; 4533 } 4534 } 4535 } 4536 return jq; 4537}; 4538const formData = function(form, d) { 4539 let els = form.find("input,textarea,select,button").get(); 4540 if (arguments.length === 1) { 4541 const data = {}; 4542 els.forEach(function(el) { 4543 if (el.name && !el.disabled && (el.checked || /select|textarea/i.test(el.nodeName) || /text/i.test(el.type) || $(el).hasClass("hasDatepicker") || $(el).hasClass("asp_slider_hidden"))) { 4544 if (data[el.name] === void 0) { 4545 data[el.name] = []; 4546 } 4547 if ($(el).hasClass("hasDatepicker")) { 4548 data[el.name].push($(el).parent().find(".asp_datepicker_hidden").val()); 4549 } else { 4550 data[el.name].push($(el).val()); 4551 } 4552 } 4553 }); 4554 return JSON.stringify(data); 4555 } else if (d !== void 0) { 4556 const data = typeof d != "object" ? JSON.parse(d) : d; 4557 els.forEach(function(el) { 4558 if (el.name) { 4559 if (data[el.name]) { 4560 let names = data[el.name], _this = $(el); 4561 if (Object.prototype.toString.call(names) !== "[object Array]") { 4562 names = [names]; 4563 } 4564 if (el.type === "checkbox" || el.type === "radio") { 4565 let val = _this.val(), found = false; 4566 for (let i = 0; i < names.length; i++) { 4567 if (names[i] === val) { 4568 found = true; 4569 break; 4570 } 4571 } 4572 _this.prop("checked", found); 4573 } else { 4574 _this.val(names[0]); 4575 if ($(el).hasClass("asp_gochosen") || $(el).hasClass("asp_goselect2")) { 4576 intervalUntilExecute(function(_$) { 4577 _$(el).trigger("change.asp_select2"); 4578 }, function() {
4579 return whichjQuery("asp_select2"); 4580 }, 50, 3); 4581 } else if ($(el).hasClass("hasDatepicker")) { 4582 intervalUntilExecute(function(_$) { 4583 const node = _this.get(0); 4584 if (node === void 0) { 4585 return; 4586 } 4587 let value = names[0], format = _$(node).datepicker("option", "dateFormat"); 4588 _$(node).datepicker("option", "dateFormat", "yy-mm-dd"); 4589 _$(node).datepicker("setDate", value); 4590 _$(node).datepicker("option", "dateFormat", format); 4591 _$(node).trigger("selectnochange"); 4592 }, function() { 4593 return whichjQuery("datepicker"); 4594 }, 50, 3); 4595 } 4596 } 4597 } else { 4598 if (el.type === "checkbox" || el.type === "radio") { 4599 $(el).prop("checked", false); 4600 } 4601 } 4602 } 4603 }); 4604 return form; 4605 } 4606}; 4607const submitToUrl = function(action, method, input, target = "self") { 4608 let form; 4609 form = $('<form style="display: none;" />'); 4610 form.attr("action", action); 4611 form.attr("method", method); 4612 $("body").append(form); 4613 if (typeof input !== "undefined" && input !== null) { 4614 Object.keys(input).forEach(function(name) { 4615 let value = input[name]; 4616 let $input = $('<input type="hidden" />'); 4617 $input.attr("name", name); 4618 $input.attr("value", value); 4619 form.append($input); 4620 }); 4621 } 4622 if (target == "new") { 4623 form.attr("target", "_blank"); 4624 } 4625 form.get(0).submit(); 4626}; 4627const openInNewTab = function(url) { 4628 Object.assign(document.createElement("a"), { target: "_blank", href: url }).click(); 4629}; 4630const scrollToFirstVisibleElement = function(elements, offset = 0) { 4631 for (const element2 of elements) { 4632 if (recursiveCheckVisibility(element2)) { 4633 window.scrollTo({ 4634 top: element2.getBoundingClientRect().top - 120 + window.pageYOffset + offset, 4635 behavior: "smooth" 4636 }); 4637 return true; 4638 } 4639 } 4640 return false; 4641}; 4642const recursiveCheckVisibility = function(element2) { 4643 if (typeof element2.checkVisibility === "undefined") { 4644 return true; 4645 } 4646 let el = element2, visible = true; 4647 while (el !== null) { 4648 if (!el.checkVisibility({ 4649 opacityProperty: true, 4650 visibilityProperty: true, 4651 contentVisibilityAuto: true 4652 })) { 4653 visible = false; 4654 break; 4655 } 4656 el = el.parentElement; 4657 } 4658 return visible; 4659}; 4660 4661;// ./src/client/global/utils/other.ts 4662 4663function buildRestUrl(base, path, params = {}) { 4664 const url = base + path; 4665 const entries = Object.entries(params); 4666 if (entries.length === 0) return url; 4667 const sep = url.includes("?") ? "&" : "?"; 4668 return url + sep + entries.map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join("&"); 4669} 4670const nicePhrase = function(s) { 4671 return encodeURIComponent(s).replace(/\%20/g, "+"); 4672}; 4673function isNumeric(input) { 4674 if (typeof input === "number" && !isNaN(input)) { 4675 return true; 4676 } 4677 if (typeof input === "string") { 4678 const trimmed = input.trim(); 4679 if (trimmed === "") return false; 4680 const num = Number(trimmed); 4681 return !isNaN(num) && trimmed === String(num).trim(); 4682 } 4683 return false; 4684} 4685function md5(str) { 4686 const bytes = new TextEncoder().encode(str); 4687 const len = bytes.length; 4688 const paddedLen = (len + 8 >>> 6 << 6) + 64; 4689 const padded = new Uint8Array(paddedLen); 4690 padded.set(bytes); 4691 padded[len] = 128; 4692 const view = new DataView(padded.buffer); 4693 view.setUint32(paddedLen - 8, len << 3 >>> 0, true); 4694 view.setUint32(paddedLen - 4, len >>> 29, true); 4695 let a = 1732584193, b = 4023233417, c = 2562383102, d = 271733878; 4696 const s = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]; 4697 const k = [3614090360, 3905402710, 606105819, 3250441966, 4118548399, 1200080426, 2821735955, 4249261313, 1770035416, 2336552879, 4294925233, 2304563134, 1804603682, 4254626195, 2792965006, 1236535329, 4129170786, 3225465664, 643717713, 3921069994, 3593408605, 38016083, 3634488961, 3889429448, 568446438, 3275163606, 4107603335, 1163531501, 2850285829, 4243563512, 1735328473, 2368359562, 4294588738, 2272392833, 1839030562, 4259657740, 2763975236, 1272893353, 4139469664, 3200236656, 681279174, 3936430074, 3572445317, 76029189, 3654602809, 3873151461, 530742520, 3299628645, 4096336452, 1126891415, 2878612391, 4237533241, 1700485571, 2399980690, 4293915773, 2240044497, 1873313359, 4264355552, 2734768916, 1309151649, 4149444226, 3174756917, 718787259, 3951481745]; 4698 for (let i = 0; i < paddedLen; i += 64) { 4699 const w = []; 4700 for (let t = 0; t < 16; t++) w[t] = view.getUint32(i + t * 4, true); 4701 const aa = a, bb = b, cc = c, dd = d; 4702 for (let j = 0; j < 64; j++) { 4703 let f, g; 4704 if (j < 16) { 4705 f = b & c | ~b & d; 4706 g = j; 4707 } else if (j < 32) { 4708 f = d & b | ~d & c; 4709 g = (5 * j + 1) % 16; 4710 } else if (j < 48) { 4711 f = b ^ c ^ d; 4712 g = (3 * j + 5) % 16; 4713 } else { 4714 f = c ^ (b | ~d); 4715 g = 7 * j % 16; 4716 } 4717 const rot = a + f + k[j] + w[g] >>> 0; 4718 const temp = d; 4719 d = c; 4720 c = b; 4721 b = b + (rot << s[j] | rot >>> 32 - s[j]) >>> 0; 4722 a = temp; 4723 } 4724 a = a + aa >>> 0; 4725 b = b + bb >>> 0; 4726 c = c + cc >>> 0; 4727 d = d + dd >>> 0; 4728 } 4729 const toHexLe = (n) => [n & 255, n >>> 8 & 255, n >>> 16 & 255, n >>> 24 & 255].map((byte) => byte.toString(16).padStart(2, "0")).join(""); 4730 return toHexLe(a) + toHexLe(b) + toHexLe(c) + toHexLe(d); 4731} 4732function parse_str(str) { 4733 const decodeQueryComponent = (value) => decodeURIComponent(value.replace(/\+/g, "%20")); 4734 const splitKeys = (rawKey) => {
4735 const keys = []; 4736 let bracketContentStart = 0; 4737 for (let index = 0; index < rawKey.length; index++) { 4738 if (rawKey.charAt(index) === "[" && !bracketContentStart) { 4739 bracketContentStart = index + 1; 4740 } else if (rawKey.charAt(index) === "]" && bracketContentStart) { 4741 if (!keys.length) { 4742 keys.push(rawKey.slice(0, bracketContentStart - 1)); 4743 } 4744 keys.push(rawKey.substring(bracketContentStart, index)); 4745 bracketContentStart = 0; 4746 if (rawKey.charAt(index + 1) !== "[") { 4747 break; 4748 } 4749 } 4750 } 4751 return keys.length ? keys : [rawKey]; 4752 }; 4753 const normalizeRootKey = (key) => { 4754 let normalizedKey = key; 4755 for (let index = 0; index < normalizedKey.length; index++) { 4756 const character = normalizedKey.charAt(index); 4757 if (character === " " || character === "." || character === "[") { 4758 normalizedKey = normalizedKey.substring(0, index) + "_" + normalizedKey.substring(index + 1); 4759 } 4760 if (character === "[") { 4761 break; 4762 } 4763 } 4764 return normalizedKey; 4765 }; 4766 const getNextNumericKey = (target) => { 4767 let maxIndex = -1; 4768 for (const property in target) { 4769 if (Object.prototype.hasOwnProperty.call(target, property) && /^\d+$/.test(property) && Number(property) > maxIndex) { 4770 maxIndex = Number(property); 4771 } 4772 } 4773 return String(maxIndex + 1); 4774 }; 4775 const isSequentialArray = (obj) => { 4776 const keys = Object.keys(obj); 4777 if (keys.length === 0) return false; 4778 const numericKeys = keys.filter((k) => /^\d+$/.test(k)).map(Number).sort((a, b) => a - b); 4779 if (numericKeys.length !== keys.length) return false; 4780 for (let i = 0; i < numericKeys.length; i++) { 4781 if (numericKeys[i] !== i) return false; 4782 } 4783 return true; 4784 }; 4785 const convertToArrays = (obj) => { 4786 if (typeof obj !== "object" || obj === null) { 4787 return obj; 4788 } 4789 if (isSequentialArray(obj)) { 4790 const arr = []; 4791 const keys = Object.keys(obj).map(Number).sort((a, b) => a - b); 4792 for (const key of keys) { 4793 arr[key] = convertToArrays(obj[String(key)]); 4794 } 4795 return arr; 4796 } 4797 const result2 = {}; 4798 for (const key in obj) { 4799 if (Object.prototype.hasOwnProperty.call(obj, key)) { 4800 result2[key] = convertToArrays(obj[key]); 4801 } 4802 } 4803 return result2; 4804 }; 4805 const result = {}; 4806 const segments = String(str).replace(/^&/, "").replace(/&$/, "").split("&"); 4807 for (const segment of segments) { 4808 const [rawKeyPart, ...rawValueParts] = segment.split("="); 4809 let rawKey = decodeQueryComponent(rawKeyPart ?? ""); 4810 const value = rawValueParts.length === 0 ? "" : decodeQueryComponent(rawValueParts.join("=")); 4811 rawKey = rawKey.trimStart(); 4812 const nullByteIndex = rawKey.indexOf("\0"); 4813 if (nullByteIndex > -1) { 4814 rawKey = rawKey.slice(0, nullByteIndex); 4815 } 4816 if (!rawKey || rawKey.charAt(0) === "[") { 4817 continue; 4818 } 4819 const keys = splitKeys(rawKey); 4820 keys[0] = normalizeRootKey(keys[0]); 4821 let current = result; 4822 let parent = result; 4823 let currentKey = ""; 4824 for (let index = 0; index < keys.length; index++) { 4825 currentKey = keys[index].replace(/^['"]/, "").replace(/['"]$/, ""); 4826 parent = current; 4827 if ((currentKey === "" || currentKey === " ") && index !== 0) { 4828 currentKey = getNextNumericKey(current); 4829 } 4830 if (Object(current[currentKey]) !== current[currentKey]) { 4831 current[currentKey] = {}; 4832 } 4833 current = current[currentKey]; 4834 } 4835 parent[currentKey] = value; 4836 } 4837 return convertToArrays(result); 4838} 4839 4840;// ./src/client/plugin/wrapper/asp.ts 4841 4842 4843 4844 4845 4846 4847 4848const ASP = window.ASP; 4849const ASP_EXTENDED = { 4850 instances: wrapper_instances, 4851 instance_args: [], 4852 api: api, 4853 initialized: false, 4854 initCache: function(force = false) { 4855 if (this.initialized && !force) { 4856 return; 4857 } 4858 ASP.cache.list = /* @__PURE__ */ new Set(); 4859 ASP.cache.timestamp = (/* @__PURE__ */ new Date()).getTime(); 4860 let t; 4861 ASP.cache.queue = ASP.cache.queue || { 4862 items: [], 4863 pushToSend: (item) => { 4864 ASP.cache.queue.items.push(item); 4865 clearTimeout(t); 4866 t = setTimeout(() => { 4867 const itemsCopy = [...ASP.cache.queue.items]; 4868 ASP.cache.queue.items = []; 4869 fetch(buildRestUrl(ASP.rest_url, "ajax-search-pro/statistics/searches/add"), { 4870 headers: { 4871 "Content-Type": "application/json" 4872 }, 4873 method: "POST", 4874 credentials: "same-origin", 4875 body: JSON.stringify(itemsCopy) 4876 }).catch((error) => { 4877 console.log(error); 4878 }); 4879 }, 1e3); 4880 } 4881 }; 4882 if (!ASP.cache.enabled || ASP.cache.type !== "super_file") { 4883 return; 4884 } 4885 fetch(buildRestUrl(ASP.rest_url, "ajax-search-pro/results_cache/keyset", { t: ASP.cache.timestamp }), { 4886 headers: { 4887 "Content-Type": "application/json" 4888 }, 4889 method: "GET" 4890 }).then((r) => r.json()).then((r) => { 4891 ASP.cache.list = new Set(r); 4892 }).catch((error) => { 4893 console.log(error); 4894 }); 4895 }, 4896 initializeAllSearches: function() { 4897 const instances2 = this.getInstances(); 4898 instances2.forEach(function(data, i) {
4899 external_DoMini_default().fn._(".asp_m_" + i).forEach(function(el) { 4900 if (typeof el.hasAsp != "undefined") { 4901 return true; 4902 } 4903 el.hasAsp = true; 4904 return external_DoMini_default()(el).ajaxsearchpro(data); 4905 }); 4906 }); 4907 }, 4908 initializeSearchByID: function(id, instance = 0) { 4909 const data = this.getInstance(id); 4910 const selector = instance === 0 ? ".asp_m_" + id : ".asp_m_" + id + "_" + instance; 4911 external_DoMini_default().fn._(selector).forEach(function(el) { 4912 if (typeof el.hasAsp != "undefined") { 4913 return true; 4914 } 4915 el.hasAsp = true; 4916 return external_DoMini_default()(el).ajaxsearchpro(data); 4917 }); 4918 }, 4919 getInstances: function() { 4920 external_DoMini_default().fn._(".asp_init_data").forEach((el) => { 4921 const id = parseInt(el.dataset["aspId"] || ""); 4922 if (typeof el.dataset["settings"] !== "undefined") { 4923 this.instance_args[id] = JSON.parse(el.dataset["settings"]); 4924 } 4925 }); 4926 return this.instance_args; 4927 }, 4928 getInstance: function(id) { 4929 if (typeof this.instance_args[id] !== "undefined") { 4930 return this.instance_args[id]; 4931 } 4932 return this.getInstances()[id]; 4933 }, 4934 initialize: function(id) { 4935 if (typeof ASP.version == "undefined") { 4936 return false; 4937 } 4938 if (ASP.script_async_load || ASP.init_only_in_viewport) { 4939 const searches = document.querySelectorAll(".asp_w_container"); 4940 if (searches.length) { 4941 const observer = new IntersectionObserver((entries) => { 4942 entries.forEach((entry) => { 4943 if (entry.isIntersecting) { 4944 const id2 = parseInt(entry.target.dataset.id ?? "0"); 4945 const instance = parseInt(entry.target.dataset.instance ?? "0"); 4946 this.initializeSearchByID(id2, instance); 4947 observer.unobserve(entry.target); 4948 } 4949 }); 4950 }); 4951 const observedElements = /* @__PURE__ */ new WeakSet(); 4952 searches.forEach(function(search) { 4953 if (observedElements.has(search)) { 4954 return; 4955 } 4956 observedElements.add(search); 4957 observer.observe(search); 4958 }); 4959 } 4960 this.getInstances().forEach((inst, id2) => { 4961 if (inst.compact.enabled) { 4962 this.initializeSearchByID(id2); 4963 } 4964 }); 4965 } else { 4966 if (typeof id === "undefined") { 4967 this.initializeAllSearches(); 4968 } else { 4969 this.initializeSearchByID(id); 4970 } 4971 } 4972 this.initializeMutateDetector(); 4973 this.initializeHighlight(); 4974 this.initializeOtherEvents(); 4975 this.initializeStatistics(); 4976 this.initCache(); 4977 this.initialized = true; 4978 return true; 4979 }, 4980 initializeStatistics: function() { 4981 const $this = this; 4982 const s = new URLSearchParams(location.search); 4983 const recordInteractions = ASP.statistics.enabled && ASP.statistics.record_results && ASP.statistics.record_result_interactions; 4984 if (!this.initialized && s.has("s") && recordInteractions && $this.getResultsPageResultSelector() !== "") { 4985 external_DoMini_default()($this.getResultsPageResultSelector()).on("click", function() { 4986 $this.registerInteraction(this); 4987 }); 4988 } 4989 }, 4990 getResultsPageResultSelector: function() { 4991 if (ASP.statistics.results_page_dom_selector !== "") { 4992 const $d = external_DoMini_default()(ASP.statistics.results_page_dom_selector); 4993 if ($d.length > 0) { 4994 return ASP.statistics.results_page_dom_selector; 4995 } 4996 return ""; 4997 } 4998 const selectors = [ 4999 "main article", 5000 "#main article", 5001 "#main-content article", 5002 "#main_content article", 5003 "#content article", 5004 "main li.product", 5005 "main div.product", 5006 ".wp-block-post" 5007 ]; 5008 for (const s of selectors) { 5009 const $d = external_DoMini_default()(s); 5010 if ($d.length > 0) { 5011 return s; 5012 } 5013 } 5014 return ""; 5015 }, 5016 registerInteraction: function(item, statisticsID) { 5017 if (statisticsID === void 0) { 5018 const containerStatId = external_DoMini_default()("body").find("#asp-statistics").data("statistics-id").replace(/\s/g, ""); 5019 statisticsID = containerStatId === "" ? 0 : parseInt(containerStatId); 5020 } 5021 statisticsID = isNaN(statisticsID) ? 0 : statisticsID; 5022 if (statisticsID === 0) { 5023 return; 5024 } 5025 let data = { 5026 search_id: statisticsID 5027 }; 5028 if (external_DoMini_default()(item).data("id") !== "" && external_DoMini_default()(item).data("c
5028ontent-type") !== "") { 5029 data.result_id = parseInt(external_DoMini_default()(item).data("id")); 5030 data.content_type = external_DoMini_default()(item).data("content-type"); 5031 } else { 5032 if (item.nodeName === "A") { 5033 data.url = external_DoMini_default()(item).attr("href"); 5034 } else { 5035 data.url = external_DoMini_default()(item).find("a").attr("href"); 5036 } 5037 if (!data.url) { 5038 return; 5039 } 5040 } 5041 fetch(buildRestUrl(ASP.rest_url, "ajax-search-pro/statistics/interaction/add"), { 5042 headers: { 5043 "Content-Type": "application/json" 5044 }, 5045 method: "POST", 5046 body: JSON.stringify(data) 5047 }).catch((error) => { 5048 console.log(error); 5049 }); 5050 }, 5051 initializeHighlight: function() { 5052 if (!ASP.highlight.enabled) { 5053 return; 5054 } 5055 const data = ASP.highlight.data; 5056 let selector = data.selector !== "" && external_DoMini_default()(data.selector).length > 0 ? data.selector : "article", phrase; 5057 selector = external_DoMini_default()(selector).length > 0 ? selector : "body"; 5058 const s = new URLSearchParams(location.search); 5059 phrase = s.get("s") ?? s.get("asp_highlight") ?? s.get("asp_s") ?? s.get("asp_ls") ?? ""; 5060 external_DoMini_default()(selector).unhighlight({ className: "asl_single_highlighted" }); 5061 if (phrase === null) { 5062 return; 5063 } 5064 phrase = phrase.trim(); 5065 if (phrase === "") { 5066 return; 5067 } 5068 const words = phrase.trim().split(" ").map((s2) => s2.trim()).filter((s2) => s2.length >= data.minWordLength); 5069 external_DoMini_default()(selector).highlight([phrase.trim()], { 5070 element: "span", 5071 className: "asp_single_highlighted_" + data.id + " asp_single_highlighted_exact", 5072 wordsOnly: data.whole, 5073 excludeParents: ".asp_w, .asp-try" 5074 }); 5075 if (words.length > 0) { 5076 external_DoMini_default()(selector).highlight(words, { 5077 element: "span", 5078 className: "asp_single_highlighted_" + data.id, 5079 wordsOnly: data.whole, 5080 excludeParents: ".asp_w, .asp-try, .asp_single_highlighted_" + data.id 5081 }); 5082 } 5083 if (data.scroll) { 5084 if (!scrollToFirstVisibleElement(external_DoMini_default()(".asp_single_highlighted_" + data.id + ".asp_single_highlighted_exact").get(), data.scroll_offset)) { 5085 scrollToFirstVisibleElement(external_DoMini_default()(".asp_single_highlighted_" + data.id).get(), data.scroll_offset); 5086 } 5087 } 5088 }, 5089 initializeOtherEvents: function() { 5090 let ttt, ts; 5091 const $body = external_DoMini_default()("body"); 5092 ts = "#menu-item-search, .fa-search, .fa, .fas"; 5093 ts = ts + ", .fusion-flyout-menu-toggle, .fusion-main-menu-search-open"; 5094 ts = ts + ", #search_button"; 5095 ts = ts + ", .mini-search.popup-search"; 5096 ts = ts + ", .icon-search"; 5097 ts = ts + ", .menu-item-search-dropdown"; 5098 ts = ts + ", .mobile-menu-button"; 5099 ts = ts + ", .td-icon-search, .tdb-search-icon"; 5100 ts = ts + ", .side_menu_button, .search_button"; 5101 ts = ts + ", .raven-search-form-toggle"; 5102 ts = ts + ", [data-elementor-open-lightbox], .elementor-button-link, .elementor-button"; 5103 ts = ts + ", i[class*=-search], a[class*=-search]"; 5104 $body.on("click touchend", ts, () => { 5105 clearTimeout(ttt); 5106 ttt = setTimeout(() => { 5107 this.initializeAllSearches(); 5108 }, 300); 5109 }); 5110 if (typeof window.jQuery != "undefined") { 5111 window.jQuery(document).on("elementor/popup/show", () => { 5112 setTimeout(() => { 5113 this.initializeAllSearches(); 5114 }, 10); 5115 }); 5116 } 5117 }, 5118 initializeMutateDetector: function() { 5119 let t; 5120 if (typeof ASP.detect_ajax != "undefined" && ASP.detect_ajax) { 5121 const o = new MutationObserver(() => { 5122 clearTimeout(t); 5123 t = setTimeout(() => { 5124 this.initializeAllSearches(); 5125 }, 500); 5126 }); 5127 const body = document.querySelector("body"); 5128 if (body == null) { 5129 return; 5130 } 5131 o.observe(body, { subtree: true, childList: true }); 5132 } 5133 }, 5134 loadScriptStack: function(stack) { 5135 let scriptTag; 5136 if (stack.length > 0) { 5137 const script = stack.shift(); 5138 if (script === void 0) { 5139 return; 5140 } 5141 scriptTag = document.createElement("script"); 5142 scriptTag.src = script["src"] + "?ver=" + ASP.version; 5143 scriptTag.onload = () => { 5144 if (stack.length > 0) { 5145 this.loadScriptStack(stack); 5146 } else { 5147 if (typeof window.WPD.AjaxSearchPro != "undefined") { 5148 external_DoMini_default()._fn.plugin("ajaxsearchpro", window.WPD.AjaxSearchPro.plugin); 5149 } 5150 this.ready(); 5151 } 5152 }; 5153 document.body.appendChild(scriptTag); 5154 } 5155 }, 5156 ready: function() { 5157 const $this = this; 5158 utils_onSafeDocumentReady(() => { 5159 $this.initialize(); 5160 }); 5161 }, 5162 init: function() { 5163 if (ASP.script_async_load) { 5164 this.loadScriptStack(ASP.additional_scripts); 5165 } else { 5166 if (typeof window.WPD.AjaxSearchPro !== "undefined") { 5167 this.ready(); 5168 } 5169 } 5170 } 5171}; 5172/* harmony default export */ var asp = (ASP_EXTENDED); 5173 5174;// external "window.WPD.intervalUntilExecute" 5175var external_window_WPD_intervalUntilExecute_namespaceObject = window.WPD.intervalUntilExecute; 5176;// ./src/client/plugin/wrapper/wrapper.js 5177 5178 5179 5180 5181function load() { 5182 if (typeof window.WPD.AjaxSearchPro != "undefined") { 5183 external_DoMini_namespaceObject._fn.plugin("ajaxsearchpro", window.WPD.AjaxSearchPro.plugin); 5184 } 5185 window.ASP = { ...window.ASP, ...asp }; 5186 external_window_WPD_intervalUntilExecute_namespaceObject(() => window.ASP.init(), function() { 5187 return typeof window.ASP.version != "undefined"; 5188 }); 5189} 5190 5191;// ./src/client/bundle/optimized/asp-wrapper.js 5192 5193 5194(function() { 5195 if (navigator.userAgent.indexOf("Chrome-Lighthouse") === -1) { 5196 if (typeof window.WPD != "undefined" && typeof window.WPD.dom != "undefined") { 5197 window.WPD.AjaxSearchPro._load = load; 5198 load(); 5199 } 5200 } 5201})(); 5202 5203/******/ })() 5204;/******/ (function() { // webpackBootstrap 5205/******/ "use strict"; 5206/******/ // The require scope 5207/******/ var __webpack_require__ = {}; 5208/******/ 5209/************************************************************************/ 5210/******/ /* webpack/runtime/define property getters */ 5211/******/ !function() { 5212/******/ // define getter functions for harmony exports 5213/******/ __webpack_require__.d = function(exports, definition) { 5214/******/ for(var key in definition) { 5215/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 5216/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 5217/******/ } 5218/******/ } 5219/******/ }; 5220/******/ }(); 5221/******/ 5222/******/ /* webpack/runtime/hasOwnProperty shorthand */ 5223/******/ !function() { 5224/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } 5225/******/ }(); 5226/******/ 5227/************************************************************************/ 5228var __webpack_exports__ = {}; 5229 5230// EXPORTS 5231__webpack_require__.d(__webpack_exports__, { 5232 "default": function() { return /* binding */ asp_addons_woocommerce; } 5233}); 5234 5235;// external "AjaxSearchPro" 5236var external_AjaxSearchPro_namespaceObject = Object(window.WPD)["AjaxSearchPro"]; 5237;// ./src/client/addons/woocommerce.js 5238 5239 5240const helpers = external_AjaxSearchPro_namespaceObject.helpers; 5241const { Hooks } = helpers; 5242class WooCommerceAddToCartAddon { 5243 name = "Woo Add To Cart Addon"; 5244 init() { 5245 Hooks.addFilter("asp/search/end", this.finished.bind(this), 10, this); 5246 } 5247 finished($this) { 5248 if (typeof wc_add_to_cart_params === "undefined" || typeof jQuery === "undefined") { 5249 return $this; 5250 } 5251 this.requests = []; 5252 this.addRequest = this.addRequest.bind(this); 5253 this.run = this.run.bind(this); 5254 this.$liveRegion = this.createLiveRegion(); 5255 jQuery($this.n("resdrg").get(0)).find(".add-to-cart-button:not(.wc-interactive)").off().on("click", { addToCartHandler: this }, this.onAddToCart); 5256 return $this; 5257 } 5258 /** 5259 * Add add-to-cart event to the queue. 5260 */ 5261 addRequest(request) { 5262 this.requests.push(request); 5263 if (this.requests.length === 1) { 5264 this.run(); 5265 } 5266 } 5267 /** 5268 * Run add-to-cart events in sequence. 5269 */ 5270 run() { 5271 const requestManager = this; 5272 const originalCallback = requestManager.requests[0].complete; 5273 requestManager.requests[0].complete = function() { 5274 if (typeof originalCallback === "function") { 5275 originalCallback(); 5276 } 5277 requestManager.requests.shift(); 5278 if (requestManager.requests.length > 0) { 5279 requestManager.run(); 5280 } 5281 }; 5282 jQuery.ajax(this.requests[0]); 5283 } 5284 /** 5285 * Handle the add to cart event. 5286 */ 5287 onAddToCart(e) { 5288 const $thisbutton = jQuery(this); 5289 if ($thisbutton.is(".ajax-add-to-cart")) { 5290 if (!$thisbutton.attr("data-product_id")) { 5291 return true; 5292 } 5293 e.data.addToCartHandler.$liveRegion.text("").removeAttr("aria-relevant"); 5294 e.preventDefault(); 5295 $thisbutton.removeClass("added"); 5296 $thisbutton.addClass("loading"); 5297 if (false === jQuery(document.body).triggerHandler("should_send_ajax_request.adding_to_cart", [$thisbutton])) { 5298 jQuery(document.body).trigger("ajax_request_not_sent.adding_to_cart", [false, false, $thisbutton]); 5299 return true; 5300 } 5301 const data = {}; 5302 jQuery.each($thisbutton.data(), function(key, value) { 5303 data[key] = value; 5304 }); 5305 jQuery.each($thisbutton[0].dataset, function(key, value) { 5306 data[key] = value; 5307 }); 5308 const $quantityButton = $thisbutton.closest(".add-to-cart-container").find(".add-to-cart-quantity"); 5309 if ($quantityButton.length > 0) { 5310 data.quantity = $quantityButton.get(0).value; 5311 } 5312 jQuery(document.body).trigger("adding_to_cart", [$thisbutton, data]); 5313 e.data.addToCartHandler.addRequest({ 5314 type: "POST", 5315 url: wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%", "add_to_cart"), 5316 data, 5317 success: function(response) { 5318 if (!response) { 5319 return; 5320 } 5321 if (response.error && response.product_url) { 5322 window.location = response.product_url; 5323 return; 5324 } 5325 if (wc_add_to_cart_params.cart_redirect_after_add === "yes") { 5326 window.location = wc_add_to_cart_params.cart_url; 5327 return; 5328 } 5329 jQuery(document.body).trigger("added_to_cart", [response.fragments, response.cart_hash, $thisbutton]); 5330 }, 5331 dataType: "json" 5332 }); 5333 } 5334 } 5335 /** 5336 * Add live region into the body element. 5337 */ 5338 createLiveRegion() { 5339 const existingLiveRegion = jQuery(".widget_shopping_cart_live_region"); 5340 if (existingLiveRegion.length) { 5341 return existingLiveRegion; 5342 } 5343 return jQuery('<div class="widget_shopping_cart_live_region screen-reader-text" role="status"></div>').appendTo("body"); 5344 } 5345} 5346external_AjaxSearchPro_namespaceObject.addons.add(new WooCommerceAddToCartAddon()); 5347/* harmony default export */ var woocommerce = ((/* unused pure expression or super */ null && (AjaxSearchPro))); 5348 5349;// ./src/client/bundle/optimized/asp-addons-woocommerce.js 5350 5351 5352 5353/* harmony default export */ var asp_addons_woocommerce = (external_AjaxSearchPro_namespaceObject); 5354 5355Object(window.WPD).AjaxSearchPro = __webpack_exports__["default"]; 5356/******/ })() 5357;
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.