diff --git a/Block/Widget/Recommendation.php b/Block/Widget/Recommendation.php index d90a2dd..a09cd86 100644 --- a/Block/Widget/Recommendation.php +++ b/Block/Widget/Recommendation.php @@ -136,15 +136,19 @@ public function getWidgetJsonConfig() } else { $itemSkus = null; } + + $additionalParams = htmlentities($this->getData('additional_parameters') ?? ''); + $this->logger->debug("additional_parameters: ".$additionalParams); $response = [ - 'title'=>$this->getData('title'), + 'title' => $this->getData('title'), 'widget_id' => $this->getData('rec_widget_id'), 'widget_type' => $this->getData('rec_widget_type'), 'category_id' => $this->getData('category_id'), - 'query'=> $this->getData('keyword_query'), - 'item_ids'=> $itemSkus, - 'products_visible'=> $this->getData('products_visible'), - 'products_to_fetch'=> $this->getData('products_to_fetch') + 'query' => $this->getData('keyword_query'), + 'item_ids' => $itemSkus, + 'products_visible' => $this->getData('products_visible'), + 'products_to_fetch' => $this->getData('products_to_fetch'), + 'additional_parameters' => $additionalParams, ]; return $this->jsonSerializer->serialize($response); } diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 271aa29..40f4477 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,3 +1,9 @@ +## 1.8.2 + +## Changed + +- [`CHANGED`]: Support additional API parameters in Recommendations widgets. + ## 1.8.1 ## Fixed diff --git a/composer.json b/composer.json index e0a2bcd..034d8dc 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "bloomreach/bloomreach-connector-magento", "description": "Bloomreach connector for autosuggest,collection and product search", - "version": "1.8.1", + "version": "1.8.2", "type": "magento2-module", "license": "proprietary", "authors": [ diff --git a/etc/widget.xml b/etc/widget.xml index 71b1dfc..274263e 100644 --- a/etc/widget.xml +++ b/etc/widget.xml @@ -81,6 +81,10 @@ + + + Additional API parameters. For example, "name1=value1&name2=value2" + diff --git a/package.json b/package.json index fcc1b00..9ce70f7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "magento-connector", - "version": "1.8.1", + "version": "1.8.2", "description": "NPM tools to aid in developing this connector application", "main": "index.js", "repository": { diff --git a/view/frontend/web/js/autosuggest.js b/view/frontend/web/js/autosuggest.js index 2d1d62c..43a2a35 100644 --- a/view/frontend/web/js/autosuggest.js +++ b/view/frontend/web/js/autosuggest.js @@ -1,4 +1,4 @@ -!function(){"use strict";const e=Object.assign(Object.assign({},window.BloomreachModules?window.BloomreachModules:{}),{version:"3.1.1"});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var r={},o=n(Object.freeze({__proto__:null,default:{}}));function s(e,t){for(var n=0,r=e.length-1;r>=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return i.exec(e).slice(1)};function u(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=s(v(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function c(e){var t=l(e),n="/"===_(e,-1);return(e=s(v(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function l(e){return"/"===e.charAt(0)}function g(){return c(v(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function d(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=u(e).substr(1),t=u(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),s=Math.min(r.length,o.length),i=s,a=0;a":">",'"':""","'":"'"},s=/[&<>'"]/g;function i(e){return o[e]||e}function a(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(s,i)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:a}):e.escapeXML.toString=a}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var o=0;o=0;r--){var o=e[r];"."===o?e.splice(r,1):".."===o?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var i=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return i.exec(e).slice(1)};function u(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=s(_(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function c(e){var t=l(e),n="/"===b(e,-1);return(e=s(_(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function l(e){return"/"===e.charAt(0)}function g(){return c(_(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function f(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=u(e).substr(1),t=u(t).substr(1);for(var r=n(e.split("/")),o=n(t.split("/")),s=Math.min(r.length,o.length),i=s,a=0;a":">",'"':""","'":"'"},s=/[&<>'"]/g;function i(e){return o[e]||e}function a(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(s,i)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:a}):e.escapeXML.toString=a}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var o=0;o @@ -6,5 +6,5 @@ * @project EJS * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} */ -var t=o,n=b,r=y,s=!1,i=w,a="locals",u=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],c=u.concat("cache"),l=/^\uFEFF/,g=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function d(n,r){var o;if(r.some((function(r){return o=e.resolveInclude(n,r,!0),t.existsSync(o)})))return o}function f(t,n){var r,o=t.filename,s=arguments.length>1;if(t.cache){if(!o)throw new Error("cache option requires a filename");if(r=e.cache.get(o))return r;s||(n=p(o).toString().replace(l,""))}else if(!s){if(!o)throw new Error("Internal EJS error: no file name or template provided");n=p(o).toString().replace(l,"")}return r=e.compile(n,t),t.cache&&e.cache.set(o,r),r}function p(t){return e.fileLoader(t)}function m(n,o){var s=r.shallowCopy(r.createNullProtoObjWherePossible(),o);if(s.filename=function(n,r){var o,s,i=r.views,a=/^[A-Za-z]+:\\|^\//.exec(n);if(a&&a.length)n=n.replace(/^\/*/,""),o=Array.isArray(r.root)?d(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(s=e.resolveInclude(n,r.filename),t.existsSync(s)&&(o=s)),!o&&Array.isArray(i)&&(o=d(n,i)),!o&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return o}(n,s),"function"==typeof o.includer){var i=o.includer(n,s.filename);if(i&&(i.filename&&(s.filename=i.filename),i.template))return f(s,i.template)}return f(s)}function h(e,t,n,r,o){var s=t.split("\n"),i=Math.max(r-3,0),a=Math.min(s.length,r+3),u=o(n),c=s.slice(i,a).map((function(e,t){var n=t+i+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=u,e.message=(u||"ejs")+":"+r+"\n"+c+"\n\n"+e.message,e}function v(e){return e.replace(/;(\s*$)/,"$1")}function _(t,n){var o=r.hasOwnOnlyObject(n),s=r.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",s.client=o.client||!1,s.escapeFunction=o.escape||o.escapeFunction||r.escapeXML,s.compileDebug=!1!==o.compileDebug,s.debug=!!o.debug,s.filename=o.filename,s.openDelimiter=o.openDelimiter||e.openDelimiter||"<",s.closeDelimiter=o.closeDelimiter||e.closeDelimiter||">",s.delimiter=o.delimiter||e.delimiter||"%",s.strict=o.strict||!1,s.context=o.context,s.cache=o.cache||!1,s.rmWhitespace=o.rmWhitespace,s.root=o.root,s.includer=o.includer,s.outputFunctionName=o.outputFunctionName,s.localsName=o.localsName||e.localsName||a,s.views=o.views,s.async=o.async,s.destructuredLocals=o.destructuredLocals,s.legacyInclude=void 0===o.legacyInclude||!!o.legacyInclude,s.strict?s._with=!1:s._with=void 0===o._with||o._with,this.opts=s,this.regex=this.createRegex()}e.cache=r.cache,e.fileLoader=t.readFileSync,e.localsName=a,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var o=n.dirname,s=n.extname,i=(0,n.resolve)(r?t:o(t),e);return s(e)||(i+=".ejs"),i},e.compile=function(e,t){return t&&t.scope&&(s||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),s=!0),t.context||(t.context=t.scope),delete t.scope),new _(e,t).compile()},e.render=function(e,t,n){var o=t||r.createNullProtoObjWherePossible(),s=n||r.createNullProtoObjWherePossible();return 2==arguments.length&&r.shallowCopyFromList(s,o,u),f(s,e)(o)},e.renderFile=function(){var t,n,o,s=Array.prototype.slice.call(arguments),i=s.shift(),a={filename:i};return"function"==typeof arguments[arguments.length-1]&&(t=s.pop()),s.length?(n=s.shift(),s.length?r.shallowCopy(a,s.pop()):(n.settings&&(n.settings.views&&(a.views=n.settings.views),n.settings["view cache"]&&(a.cache=!0),(o=n.settings["view options"])&&r.shallowCopy(a,o)),r.shallowCopyFromList(a,n,c)),a.filename=i):n=r.createNullProtoObjWherePossible(),function(t,n,r){var o;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(o=f(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{o=f(t)(n)}catch(e){return r(e)}r(null,o)}(a,n,t)},e.Template=_,e.clearCache=function(){e.cache.reset()},_.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},_.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=r.escapeRegExpChars(this.opts.delimiter),n=r.escapeRegExpChars(this.opts.openDelimiter),o=r.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,o),new RegExp(e)},compile:function(){var e,t,o,s=this.opts,i="",a="",u=s.escapeFunction,c=s.filename?JSON.stringify(s.filename):"undefined";if(!this.source){if(this.generateSource(),i+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',s.outputFunctionName){if(!g.test(s.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");i+=" var "+s.outputFunctionName+" = __append;\n"}if(s.localsName&&!g.test(s.localsName))throw new Error("localsName is not a valid JS identifier.");if(s.destructuredLocals&&s.destructuredLocals.length){for(var l=" var __locals = ("+s.localsName+" || {}),\n",d=0;d0&&(l+=",\n "),l+=f+" = __locals."+f}i+=l+";\n"}!1!==s._with&&(i+=" with ("+s.localsName+" || {}) {\n",a+=" }\n"),a+=" return __output;\n",this.source=i+this.source+a}e=s.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+c+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,s.client&&(e="escapeFn = escapeFn || "+u.toString()+";\n"+e,s.compileDebug&&(e="rethrow = rethrow || "+h.toString()+";\n"+e)),s.strict&&(e='"use strict";\n'+e),s.debug&&console.log(e),s.compileDebug&&s.filename&&(e=e+"\n//# sourceURL="+c+"\n");try{if(s.async)try{o=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else o=Function;t=new o(s.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(s.filename&&(e.message+=" in "+s.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",s.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var p=s.client?t:function(e){return t.apply(s.context,[e||r.createNullProtoObjWherePossible(),u,function(t,n){var o=r.shallowCopy(r.createNullProtoObjWherePossible(),e);return n&&(o=r.shallowCopy(o,n)),m(t,s)(o)},h])};if(s.filename&&"function"==typeof Object.defineProperty){var v=s.filename,_=n.basename(v,n.extname(v));try{Object.defineProperty(p,"name",{value:_,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return p},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,o=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(s,i){var a;if(0===s.indexOf(r+n)&&0!==s.indexOf(r+n+n)&&(a=t[i+2])!=n+o&&a!="-"+n+o&&a!="_"+n+o)throw new Error('Could not find matching close tag for "'+s+'".');e.scanLine(s)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),o=[];r;)0!==(e=r.index)&&(o.push(t.substring(0,e)),t=t.slice(e)),o.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&o.push(t),o},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,o=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=_.modes.EVAL;break;case r+n+"=":this.mode=_.modes.ESCAPED;break;case r+n+"-":this.mode=_.modes.RAW;break;case r+n+"#":this.mode=_.modes.COMMENT;break;case r+n+n:this.mode=_.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+o:this.mode=_.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+o,n+o)+'")\n';break;case n+o:case"-"+n+o:case"_"+n+o:this.mode==_.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case _.modes.EVAL:case _.modes.ESCAPED:case _.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case _.modes.EVAL:this.source+=" ; "+e+"\n";break;case _.modes.ESCAPED:this.source+=" ; __append(escapeFn("+v(e)+"))\n";break;case _.modes.RAW:this.source+=" ; __append("+v(e)+")\n";break;case _.modes.COMMENT:break;case _.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=r.escapeXML,e.__express=e.renderFile,e.VERSION=i,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(r);var O="Invariant failed";function j(e,t){if(!e)throw new Error(O)}const x=2,L='<%= query %>',E="$",A="q",S=8,T=8,C=4,N="page",k="suggest",M=".search__input";const D={method:"GET",headers:{"Content-Type":"application/json"}};function F(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const q=(e,t="$",n=!0)=>`${n?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${n?"":` ${t}`}`;function P(){return Math.floor(1e12+9e12*Math.random())}const R="https://suggest.dxpapi.com/api/v2/suggest/",$=["_br_uid_2","fq","sort"];function I(e){const t=Object.assign({},e),n=(null==t?void 0:t.endpoint)||R;return(null==t?void 0:t.endpoint)&&(null==t||delete t.endpoint),`${n}${r=t,`?${Object.keys(r).reduce(((e,t)=>[...e,`${t}=${$.includes(t)?r[t]:encodeURIComponent(r[t])}`]),[]).join("&")}`}`;var r}async function W(e){return async function(e,t){const n=await fetch(e,t);return await n.json()}(I(e),D)}var H,U='<% if (terms.length || productSuggestions.length) { %>\n \n <% } %>\n';function B(){const e=function(){var e;const t=null===(e=null===window||void 0===window?void 0:window.bloomreachConnector)||void 0===e?void 0:e.config;return Object.assign({default_search_parameter:A,url:window.location.href,ref_url:window.location.href,tracking_cookie:F(),format_money:e=>q(e,window.bloomreachDefaultCurrency||E),default_currency:window.bloomreachDefaultCurrency||E},t)}();return Object.assign(Object.assign({request_type:k},e),{autosuggest:Object.assign({enabled:!0,endpoint:"",number_of_terms:C,number_of_products:T,number_of_collections:S,selector:M,template:U,catalog_views:""},e.autosuggest)})}function z(){var e;const t=B();j(null===(e=t.autosuggest)||void 0===e?void 0:e.selector);return document.querySelector(t.autosuggest.selector)}function J(){return document.querySelector(".blm-autosuggest-search-results")}function Q(e,t){const n=new URLSearchParams(window.location.search);"function"==typeof t?n.set(e,t(n.get(e)).replace(/"/g,'\\"')):""===t?n.delete(e):n.set(e,t.replace(/"/g,'\\"')),function(e){const t={};for(const n of e.entries())t[n[0]]=n[1];window.history.pushState(t,document.title,`?${e.toString()}`)}(n)}function X(){J().querySelectorAll(".blm-autosuggest__suggestion-term-link--category").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(e=>{var t;e.preventDefault();const n=e.target,r=(null===(t=n.dataset)||void 0===t?void 0:t.categoryId)||"";window.BloomreachModules&&window.BloomreachModules.search&&(Q(N,"1"),window.BloomreachModules.search.load(r).then((()=>(z().value=(null==n?void 0:n.textContent)||"",J().innerHTML="",Re({last_template_data:null}),!0))).catch(console.error))})),e.setAttribute("hasListener","true"))}))}function G(){const e=function(e,t){let n=e;for(;n&&n.parentNode;)if(n=n.parentNode,n&&n.tagName.toLowerCase()===t.toLowerCase())return n;return null}(z(),"form");e.getAttribute("hasListener")||(e.addEventListener("submit",(()=>{var e,t;const n={q:z().value,catalogs:[{name:"example_en"}]};null===(t=null===(e=window.BrTrk||{})||void 0===e?void 0:e.getTracker())||void 0===t||t.logEvent("suggest","submit",n,{},!0)})),e.setAttribute("hasListener","true"))}!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(H||(H={})),window.matchMedia(`(max-width: ${H.medium})`),window.matchMedia(`(min-width:${H.medium}) and (max-width: ${H.xlarge})`);var V=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Z="object"==typeof t&&t&&t.Object===Object&&t,K="object"==typeof self&&self&&self.Object===Object&&self,Y=Z||K||Function("return this")(),ee=Y,te=function(){return ee.Date.now()},ne=/\s/;var re=function(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t},oe=/^\s+/;var se=function(e){return e?e.slice(0,re(e)+1).replace(oe,""):e},ie=Y.Symbol,ae=ie,ue=Object.prototype,ce=ue.hasOwnProperty,le=ue.toString,ge=ae?ae.toStringTag:void 0;var de=function(e){var t=ce.call(e,ge),n=e[ge];try{e[ge]=void 0;var r=!0}catch(e){}var o=le.call(e);return r&&(t?e[ge]=n:delete e[ge]),o},fe=Object.prototype.toString;var pe=de,me=function(e){return fe.call(e)},he=ie?ie.toStringTag:void 0;var ve=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":he&&he in Object(e)?pe(e):me(e)},_e=function(e){return null!=e&&"object"==typeof e};var be=se,ye=V,we=function(e){return"symbol"==typeof e||_e(e)&&"[object Symbol]"==ve(e)},Oe=/^[-+]0x[0-9a-f]+$/i,je=/^0b[01]+$/i,xe=/^0o[0-7]+$/i,Le=parseInt;var Ee=V,Ae=te,Se=function(e){if("number"==typeof e)return e;if(we(e))return NaN;if(ye(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ye(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=be(e);var n=je.test(e);return n||xe.test(e)?Le(e.slice(2),n?2:8):Oe.test(e)?NaN:+e},Te=Math.max,Ce=Math.min;var Ne=function(e,t,n){var r,o,s,i,a,u,c=0,l=!1,g=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function f(t){var n=r,s=o;return r=o=void 0,c=t,i=e.apply(s,n)}function p(e){var n=e-u;return void 0===u||n>=t||n<0||g&&e-c>=s}function m(){var e=Ae();if(p(e))return h(e);a=setTimeout(m,function(e){var n=t-(e-u);return g?Ce(n,s-(e-c)):n}(e))}function h(e){return a=void 0,d&&r?f(e):(r=o=void 0,i)}function v(){var e=Ae(),n=p(e);if(r=arguments,o=this,u=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(m,t),l?f(e):i}(u);if(g)return clearTimeout(a),a=setTimeout(m,t),f(u)}return void 0===a&&(a=setTimeout(m,t)),i}return t=Se(t)||0,Ee(n)&&(l=!!n.leading,s=(g="maxWait"in n)?Te(Se(n.maxWait)||0,t):s,d="trailing"in n?!!n.trailing:d),v.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=u=o=a=void 0},v.flush=function(){return void 0===a?i:h(Ae())},v};function ke(){return e=>{const t=e.target.value,n=z();t.length>=x?(n.dataset.originalQuery=t,async function(e){Re({request_id:P()});const t=function(e){var t,n,r;const o=B(),s=new URLSearchParams(window.location.search),i=Pe(),a=Object.assign(Object.assign({},(null===(t=null==o?void 0:o.autosuggest)||void 0===t?void 0:t.endpoint)?{endpoint:o.autosuggest.endpoint}:{}),{q:e||s.get((null==o?void 0:o.default_search_parameter)||"")||"",sort:null===(n=o.autosuggest)||void 0===n?void 0:n.sort,account_id:o.account_id,domain_key:o.domain_key,request_id:i.request_id,_br_uid_2:o.tracking_cookie,ref_url:o.ref_url,url:o.url,request_type:o.request_type,catalog_views:null===(r=o.autosuggest)||void 0===r?void 0:r.catalog_views});for(const[e,t]of s.entries())Object.keys(a).includes(e)||(a[e]=t);return a}(e),n=(o=await W(t),function(e){return"suggestionGroups"in e}(o)?function(e){var t,n,r,o,s,i,a,u,c;const l=B(),g=(null===(n=null===(t=null==e?void 0:e.suggestionGroups)||void 0===t?void 0:t[0])||void 0===n?void 0:n.searchSuggestions)||[],d=(null===(o=null===(r=null==e?void 0:e.suggestionGroups)||void 0===r?void 0:r[0])||void 0===o?void 0:o.querySuggestions)||[],f=(null===(i=null===(s=null==e?void 0:e.suggestionGroups)||void 0===s?void 0:s[0])||void 0===i?void 0:i.attributeSuggestions)||[],p=Object.assign(Object.assign({},(null===(a=null==e?void 0:e.queryContext)||void 0===a?void 0:a.originalQuery)?{originalQuery:e.queryContext.originalQuery}:{}),{terms:[...d.map(((e,t)=>{var n;return Object.assign(Object.assign(Object.assign({},e),{text:e.query,displayText:e.displayText,link:`${l.search_page_url}?${l.default_search_parameter}=${encodeURIComponent(e.query)}`}),0===t&&f?{categories:f.map((e=>Object.assign(Object.assign({},e),{name:e.name,value:e.value,type:e.attributeType}))).slice(0,null===(n=l.autosuggest)||void 0===n?void 0:n.number_of_collections)}:{})}))].slice(0,null===(u=l.autosuggest)||void 0===u?void 0:u.number_of_terms),productSuggestions:[...g.map((e=>Object.assign(Object.assign({},e),{id:e.pid,image:e.thumb_image,title:e.title,link:e.url,sale_price:Number((null==e?void 0:e.sale_price)||"0")})))].slice(0,null===(c=l.autosuggest)||void 0===c?void 0:c.number_of_products),config:l});return qe(p)}(o):function(e){var t,n;const r=B(),o=Object.assign(Object.assign({},e.response.q?{originalQuery:e.response.q}:{}),{terms:[...e.response.suggestions?e.response.suggestions.map((e=>{var t;return Object.assign(Object.assign(Object.assign({},e),{text:e.q,displayText:e.dq,link:`${r.search_page_url}?${r.default_search_parameter}=${encodeURIComponent(e.q)}`}),e.filters?{categories:e.filters.map((e=>Object.assign(Object.assign({},e),{name:e.name,value:e.value,type:e.key}))).slice(0,null===(t=r.autosuggest)||void 0===t?void 0:t.number_of_collections)}:{})})):[]].slice(0,null===(t=r.autosuggest)||void 0===t?void 0:t.number_of_terms),productSuggestions:[...e.response.products?e.response.products.map((e=>Object.assign(Object.assign(Object.assign({},e),{id:e.pid,image:e.thumb_image,title:e.title,link:e.url,sale_price:Number.isNaN(e.sale_price)?Number.isNaN(e.price)?"0":e.price:e.sale_price}),"price"in e&&"sale_price"in e?{price:e.price}:{}))):[]].slice(0,null===(n=r.autosuggest)||void 0===n?void 0:n.number_of_products),config:r});return qe(o)}(o));var o;Re({last_template_data:n}),J().innerHTML=r.render(U,n),X(),J().querySelectorAll(".blm-autosuggest__suggestion-term-link").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(e){return()=>{var t,n;const{suggestionText:r}=e.dataset,{originalQuery:o}=z().dataset,s={aq:o,q:r,catalogs:[{name:"example_en"}]};null===(n=null===(t=window.BrTrk||{})||void 0===t?void 0:t.getTracker())||void 0===n||n.logEvent("suggest","click",s,{},!0)}}(e)),e.setAttribute("hasListener","true"))}))}(t).catch(console.error)):(J().innerHTML="",n.dataset.originalQuery="",Re({last_template_data:null}))}}function Me(){document.body.getAttribute("hasMousedownListener")||(document.body.addEventListener("mousedown",(e=>{!function(e,t){var n;let r=e;for(;r&&r.parentNode;)if(r=r.parentNode,r&&(null===(n=r.classList)||void 0===n?void 0:n.contains(t)))return r;return null}(e.target,"blm-autosuggest")?J().innerHTML="":Ie({mouseDownEventHappenedInsideAutosuggestResultsContainer:!0})})),document.body.setAttribute("hasMousedownListener","true"));const e=z();e.getAttribute("hasBlurListener")||(e.addEventListener("blur",(()=>$e().mouseDownEventHappenedInsideAutosuggestResultsContainer?(Ie({mouseDownEventHappenedInsideAutosuggestResultsContainer:!1}),!1):(J().innerHTML="",!0))),e.setAttribute("hasBlurListener","true"))}function De(){const e=z();e.getAttribute("hasFocusListener")||(e.addEventListener("focus",(()=>{const e=Pe().last_template_data;Pe(),e&&(J().innerHTML=r.render(U,e))})),e.setAttribute("hasFocusListener","true"))}function Fe(){Me(),De(),function(){const e=z();e.getAttribute("hasKeyupListener")||(e.addEventListener("keyup",Ne(ke(),500)),e.setAttribute("hasKeyupListener","true"))}()}function qe(e){const t=Object.assign({},e);return e.terms.forEach(((n,o)=>{const s=r.render(L,{query:e.originalQuery}).trim();(t.terms[o]||{}).processedText=n.text.replace(e.originalQuery||"",s)})),t}function Pe(){return window.BloomreachModules.autosuggest.getCurrentAutosuggestRequestState()}function Re(e){window.BloomreachModules.autosuggest.setCurrentAutosuggestRequestState(Object.assign(Object.assign({},Pe()),e))}function $e(){return window.BloomreachModules.autosuggest.getCurrentAutosuggestUiState()}function Ie(e){window.BloomreachModules.autosuggest.setCurrentAutosuggestUiState(Object.assign(Object.assign({},$e()),e))}const We=function(){let e={request_id:0,last_template_data:null},t={mouseDownEventHappenedInsideAutosuggestResultsContainer:!1};return{setCurrentAutosuggestRequestState:t=>{e=t},getCurrentAutosuggestRequestState:()=>e,setCurrentAutosuggestUiState:e=>{t=e},getCurrentAutosuggestUiState:()=>t,load:async()=>{!function(){if(!J()){const e=document.createElement("style");e.innerHTML=`.blm-autosuggest-search-results {\n width: 100%;\n position: absolute;\n z-index: 100;\n left: 0;\n transform: translateY(${z().offsetHeight}px);\n }`,document.head.appendChild(e)}}(),function(){var e;if(!J()){const t=document.createElement("div");t.classList.add("blm-autosuggest-search-results"),null===(e=z().parentElement)||void 0===e||e.appendChild(t)}}(),function(){var e;const t=B();return j(t.account_id),j(t.domain_key),z(),J(),null===(e=null==t?void 0:t.autosuggest)||void 0===e?void 0:e.enabled}()&&(Fe(),G(),z().setAttribute("autocomplete","off"))}}}();window.BloomreachModules=Object.assign(Object.assign({},e),{autosuggest:We}),We.load().catch(console.error)}(); +var t=o,n=v,r=y,s=!1,i=w,a="locals",u=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],c=u.concat("cache"),l=/^\uFEFF/,g=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function f(n,r){var o;if(r.some((function(r){return o=e.resolveInclude(n,r,!0),t.existsSync(o)})))return o}function p(t,n){var r,o=t.filename,s=arguments.length>1;if(t.cache){if(!o)throw new Error("cache option requires a filename");if(r=e.cache.get(o))return r;s||(n=d(o).toString().replace(l,""))}else if(!s){if(!o)throw new Error("Internal EJS error: no file name or template provided");n=d(o).toString().replace(l,"")}return r=e.compile(n,t),t.cache&&e.cache.set(o,r),r}function d(t){return e.fileLoader(t)}function m(n,o){var s=r.shallowCopy(r.createNullProtoObjWherePossible(),o);if(s.filename=function(n,r){var o,s,i=r.views,a=/^[A-Za-z]+:\\|^\//.exec(n);if(a&&a.length)n=n.replace(/^\/*/,""),o=Array.isArray(r.root)?f(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(s=e.resolveInclude(n,r.filename),t.existsSync(s)&&(o=s)),!o&&Array.isArray(i)&&(o=f(n,i)),!o&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return o}(n,s),"function"==typeof o.includer){var i=o.includer(n,s.filename);if(i&&(i.filename&&(s.filename=i.filename),i.template))return p(s,i.template)}return p(s)}function h(e,t,n,r,o){var s=t.split("\n"),i=Math.max(r-3,0),a=Math.min(s.length,r+3),u=o(n),c=s.slice(i,a).map((function(e,t){var n=t+i+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=u,e.message=(u||"ejs")+":"+r+"\n"+c+"\n\n"+e.message,e}function _(e){return e.replace(/;(\s*$)/,"$1")}function b(t,n){var o=r.hasOwnOnlyObject(n),s=r.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",s.client=o.client||!1,s.escapeFunction=o.escape||o.escapeFunction||r.escapeXML,s.compileDebug=!1!==o.compileDebug,s.debug=!!o.debug,s.filename=o.filename,s.openDelimiter=o.openDelimiter||e.openDelimiter||"<",s.closeDelimiter=o.closeDelimiter||e.closeDelimiter||">",s.delimiter=o.delimiter||e.delimiter||"%",s.strict=o.strict||!1,s.context=o.context,s.cache=o.cache||!1,s.rmWhitespace=o.rmWhitespace,s.root=o.root,s.includer=o.includer,s.outputFunctionName=o.outputFunctionName,s.localsName=o.localsName||e.localsName||a,s.views=o.views,s.async=o.async,s.destructuredLocals=o.destructuredLocals,s.legacyInclude=void 0===o.legacyInclude||!!o.legacyInclude,s.strict?s._with=!1:s._with=void 0===o._with||o._with,this.opts=s,this.regex=this.createRegex()}e.cache=r.cache,e.fileLoader=t.readFileSync,e.localsName=a,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var o=n.dirname,s=n.extname,i=(0,n.resolve)(r?t:o(t),e);return s(e)||(i+=".ejs"),i},e.compile=function(e,t){return t&&t.scope&&(s||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),s=!0),t.context||(t.context=t.scope),delete t.scope),new b(e,t).compile()},e.render=function(e,t,n){var o=t||r.createNullProtoObjWherePossible(),s=n||r.createNullProtoObjWherePossible();return 2==arguments.length&&r.shallowCopyFromList(s,o,u),p(s,e)(o)},e.renderFile=function(){var t,n,o,s=Array.prototype.slice.call(arguments),i=s.shift(),a={filename:i};return"function"==typeof arguments[arguments.length-1]&&(t=s.pop()),s.length?(n=s.shift(),s.length?r.shallowCopy(a,s.pop()):(n.settings&&(n.settings.views&&(a.views=n.settings.views),n.settings["view cache"]&&(a.cache=!0),(o=n.settings["view options"])&&r.shallowCopy(a,o)),r.shallowCopyFromList(a,n,c)),a.filename=i):n=r.createNullProtoObjWherePossible(),function(t,n,r){var o;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(o=p(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{o=p(t)(n)}catch(e){return r(e)}r(null,o)}(a,n,t)},e.Template=b,e.clearCache=function(){e.cache.reset()},b.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},b.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=r.escapeRegExpChars(this.opts.delimiter),n=r.escapeRegExpChars(this.opts.openDelimiter),o=r.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,o),new RegExp(e)},compile:function(){var e,t,o,s=this.opts,i="",a="",u=s.escapeFunction,c=s.filename?JSON.stringify(s.filename):"undefined";if(!this.source){if(this.generateSource(),i+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',s.outputFunctionName){if(!g.test(s.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");i+=" var "+s.outputFunctionName+" = __append;\n"}if(s.localsName&&!g.test(s.localsName))throw new Error("localsName is not a valid JS identifier.");if(s.destructuredLocals&&s.destructuredLocals.length){for(var l=" var __locals = ("+s.localsName+" || {}),\n",f=0;f0&&(l+=",\n "),l+=p+" = __locals."+p}i+=l+";\n"}!1!==s._with&&(i+=" with ("+s.localsName+" || {}) {\n",a+=" }\n"),a+=" return __output;\n",this.source=i+this.source+a}e=s.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+c+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,s.client&&(e="escapeFn = escapeFn || "+u.toString()+";\n"+e,s.compileDebug&&(e="rethrow = rethrow || "+h.toString()+";\n"+e)),s.strict&&(e='"use strict";\n'+e),s.debug&&console.log(e),s.compileDebug&&s.filename&&(e=e+"\n//# sourceURL="+c+"\n");try{if(s.async)try{o=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else o=Function;t=new o(s.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(s.filename&&(e.message+=" in "+s.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",s.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var d=s.client?t:function(e){return t.apply(s.context,[e||r.createNullProtoObjWherePossible(),u,function(t,n){var o=r.shallowCopy(r.createNullProtoObjWherePossible(),e);return n&&(o=r.shallowCopy(o,n)),m(t,s)(o)},h])};if(s.filename&&"function"==typeof Object.defineProperty){var _=s.filename,b=n.basename(_,n.extname(_));try{Object.defineProperty(d,"name",{value:b,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return d},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,o=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(s,i){var a;if(0===s.indexOf(r+n)&&0!==s.indexOf(r+n+n)&&(a=t[i+2])!=n+o&&a!="-"+n+o&&a!="_"+n+o)throw new Error('Could not find matching close tag for "'+s+'".');e.scanLine(s)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),o=[];r;)0!==(e=r.index)&&(o.push(t.substring(0,e)),t=t.slice(e)),o.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&o.push(t),o},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,o=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=b.modes.EVAL;break;case r+n+"=":this.mode=b.modes.ESCAPED;break;case r+n+"-":this.mode=b.modes.RAW;break;case r+n+"#":this.mode=b.modes.COMMENT;break;case r+n+n:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+o:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+o,n+o)+'")\n';break;case n+o:case"-"+n+o:case"_"+n+o:this.mode==b.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case b.modes.EVAL:case b.modes.ESCAPED:case b.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case b.modes.EVAL:this.source+=" ; "+e+"\n";break;case b.modes.ESCAPED:this.source+=" ; __append(escapeFn("+_(e)+"))\n";break;case b.modes.RAW:this.source+=" ; __append("+_(e)+")\n";break;case b.modes.COMMENT:break;case b.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=r.escapeXML,e.__express=e.renderFile,e.VERSION=i,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(r);var x="Invariant failed";function E(e,t){if(!e)throw new Error(x)}const L=2,A='<%= query %>',S="$",O="q",T=8,j=8,C=4,N="page",k="suggest",M=".search__input";const D={method:"GET",headers:{"Content-Type":"application/json"}};function F(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const $=(e,t="$",n=!0)=>`${n?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${n?"":` ${t}`}`;function q(){return Math.floor(1e12+9e12*Math.random())}const P="https://suggest.dxpapi.com/api/v2/suggest/",R=["_br_uid_2","fq","sort"];function I(e){const t=Object.assign({},e),n=(null==t?void 0:t.endpoint)||P;return(null==t?void 0:t.endpoint)&&(null==t||delete t.endpoint),`${n}${r=t,`?${Object.keys(r).reduce(((e,t)=>[...e,`${t}=${R.includes(t)?r[t]:encodeURIComponent(r[t])}`]),[]).join("&")}`}`;var r}async function W(e){return async function(e,t){const n=await fetch(e,t);return await n.json()}(I(e),D)}var H,U='<% if (terms.length || productSuggestions.length) { %>\n \n <% } %>\n';function B(){const e=function(){const e=window?.bloomreachConnector?.config;return{default_search_parameter:O,url:window.location.href,ref_url:window.location.href,tracking_cookie:F(),format_money:e=>$(e,window.bloomreachDefaultCurrency||S),default_currency:window.bloomreachDefaultCurrency||S,...e}}();return{request_type:k,...e,autosuggest:{enabled:!0,endpoint:"",number_of_terms:C,number_of_products:j,number_of_collections:T,selector:M,template:U,catalog_views:"",...e?.autosuggest??{}}}}function z(){const e=B();E(e.autosuggest?.selector);return document.querySelector(e.autosuggest.selector)}function J(){return document.querySelector(".blm-autosuggest-search-results")}function Q(e,t){const n=new URLSearchParams(window.location.search);"function"==typeof t?n.set(e,t(n.get(e)).replace(/"/g,'\\"')):""===t?n.delete(e):n.set(e,t.replace(/"/g,'\\"')),function(e){const t={};for(const n of e.entries())t[n[0]]=n[1];window.history.pushState(t,document.title,`?${e.toString()}`)}(n)}function X(){J().querySelectorAll(".blm-autosuggest__suggestion-term-link--category").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(e=>{e.preventDefault();const t=e.target,n=t.dataset?.categoryId||"";window.BloomreachModules&&window.BloomreachModules.search&&(Q(N,"1"),window.BloomreachModules.search.load(n).then((()=>(z().value=t?.textContent||"",J().innerHTML="",Re({last_template_data:null}),!0))).catch(console.error))})),e.setAttribute("hasListener","true"))}))}function G(){const e=function(e,t){let n=e;for(;n&&n.parentElement;)if(n=n.parentElement,n&&n.tagName.toLowerCase()===t.toLowerCase())return n;return console.warn(`'${t}' not found in ancestors of ${e.nodeName}`),null}(z(),"form");e&&!e.getAttribute("hasListener")&&(e.addEventListener("submit",(()=>{const e={q:z().value,catalogs:[{name:"example_en"}]};(window.BrTrk||{})?.getTracker()?.logEvent("suggest","submit",e,{},!0)})),e.setAttribute("hasListener","true"))}!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(H||(H={})),window.matchMedia(`(max-width: ${H.medium})`),window.matchMedia(`(min-width:${H.medium}) and (max-width: ${H.xlarge})`);var V=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},Z="object"==typeof t&&t&&t.Object===Object&&t,K="object"==typeof self&&self&&self.Object===Object&&self,Y=Z||K||Function("return this")(),ee=Y,te=function(){return ee.Date.now()},ne=/\s/;var re=function(e){for(var t=e.length;t--&&ne.test(e.charAt(t)););return t},oe=/^\s+/;var se=function(e){return e?e.slice(0,re(e)+1).replace(oe,""):e},ie=Y.Symbol,ae=ie,ue=Object.prototype,ce=ue.hasOwnProperty,le=ue.toString,ge=ae?ae.toStringTag:void 0;var fe=function(e){var t=ce.call(e,ge),n=e[ge];try{e[ge]=void 0;var r=!0}catch(e){}var o=le.call(e);return r&&(t?e[ge]=n:delete e[ge]),o},pe=Object.prototype.toString;var de=fe,me=function(e){return pe.call(e)},he=ie?ie.toStringTag:void 0;var _e=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":he&&he in Object(e)?de(e):me(e)},be=function(e){return null!=e&&"object"==typeof e};var ve=se,ye=V,we=function(e){return"symbol"==typeof e||be(e)&&"[object Symbol]"==_e(e)},xe=/^[-+]0x[0-9a-f]+$/i,Ee=/^0b[01]+$/i,Le=/^0o[0-7]+$/i,Ae=parseInt;var Se=V,Oe=te,Te=function(e){if("number"==typeof e)return e;if(we(e))return NaN;if(ye(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ye(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=ve(e);var n=Ee.test(e);return n||Le.test(e)?Ae(e.slice(2),n?2:8):xe.test(e)?NaN:+e},je=Math.max,Ce=Math.min;var Ne=function(e,t,n){var r,o,s,i,a,u,c=0,l=!1,g=!1,f=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,s=o;return r=o=void 0,c=t,i=e.apply(s,n)}function d(e){var n=e-u;return void 0===u||n>=t||n<0||g&&e-c>=s}function m(){var e=Oe();if(d(e))return h(e);a=setTimeout(m,function(e){var n=t-(e-u);return g?Ce(n,s-(e-c)):n}(e))}function h(e){return a=void 0,f&&r?p(e):(r=o=void 0,i)}function _(){var e=Oe(),n=d(e);if(r=arguments,o=this,u=e,n){if(void 0===a)return function(e){return c=e,a=setTimeout(m,t),l?p(e):i}(u);if(g)return clearTimeout(a),a=setTimeout(m,t),p(u)}return void 0===a&&(a=setTimeout(m,t)),i}return t=Te(t)||0,Se(n)&&(l=!!n.leading,s=(g="maxWait"in n)?je(Te(n.maxWait)||0,t):s,f="trailing"in n?!!n.trailing:f),_.cancel=function(){void 0!==a&&clearTimeout(a),c=0,r=u=o=a=void 0},_.flush=function(){return void 0===a?i:h(Oe())},_};function ke(){return e=>{(function(e,t){let n=e;for(;n&&n.parentElement;)if(n=n.parentElement,n&&n.classList?.contains(t))return n;return console.warn(`CSS class '${t}' not found in ancestors of ${e.nodeName}`),null})(e.target,"blm-autosuggest")?We({mouseDownEventHappenedInsideAutosuggestResultsContainer:!0}):J().innerHTML=""}}function Me(){return e=>{const t=e.target.value,n=z();t.length>=L?(n.dataset.originalQuery=t,async function(e){Re({request_id:q()});const t=function(e){const t=B(),n=new URLSearchParams(window.location.search),r=Pe(),o={...t?.autosuggest?.endpoint?{endpoint:t.autosuggest.endpoint}:{},q:e||n.get(t?.default_search_parameter||"")||"",account_id:t.account_id,domain_key:t.domain_key,request_id:r.request_id,_br_uid_2:t.tracking_cookie,ref_url:t.ref_url,url:t.url,request_type:t.request_type,catalog_views:t.autosuggest?.catalog_views};for(const[e,t]of n.entries())Object.keys(o).includes(e)||(o[e]=t);return o}(e),n=(s=await W(t),function(e){return"suggestionGroups"in e}(s)?function(e){const t=B(),n=e?.suggestionGroups?.[0]?.searchSuggestions||[],r=e?.suggestionGroups?.[0]?.querySuggestions||[],o=e?.suggestionGroups?.[0]?.attributeSuggestions||[],s={...e?.queryContext?.originalQuery?{originalQuery:e.queryContext.originalQuery}:{},terms:[...r.map(((e,n)=>({...e,text:e.query,displayText:e.displayText,link:`${t.search_page_url}?${t.default_search_parameter}=${encodeURIComponent(e.query)}`,...0===n&&o?{categories:o.map((e=>({...e,name:e.name,value:e.value,type:e.attributeType}))).slice(0,t.autosuggest?.number_of_collections)}:{}})))].slice(0,t.autosuggest?.number_of_terms),productSuggestions:[...n.map((e=>({...e,id:e.pid,image:e.thumb_image,title:e.title,link:e.url,sale_price:Number(e?.sale_price||"0")})))].slice(0,t.autosuggest?.number_of_products),config:t};return qe(s)}(s):function(e){const t=B(),n={...e.response.q?{originalQuery:e.response.q}:{},terms:[...e.response.suggestions?e.response.suggestions.map((e=>({...e,text:e.q,displayText:e.dq,link:`${t.search_page_url}?${t.default_search_parameter}=${encodeURIComponent(e.q)}`,...e.filters?{categories:e.filters.map((e=>({...e,name:e.name,value:e.value,type:e.key}))).slice(0,t.autosuggest?.number_of_collections)}:{}}))):[]].slice(0,t.autosuggest?.number_of_terms),productSuggestions:[...e.response.products?e.response.products.map((e=>({...e,id:e.pid,image:e.thumb_image,title:e.title,link:e.url,sale_price:Number.isNaN(e.sale_price)?Number.isNaN(e.price)?"0":e.price:e.sale_price,..."price"in e&&"sale_price"in e?{price:e.price}:{}}))):[]].slice(0,t.autosuggest?.number_of_products),config:t};return qe(n)}(s)),o=B();var s;Re({last_template_data:n}),J().innerHTML=r.render(o.autosuggest?.template||"",n),X(),J().querySelectorAll(".blm-autosuggest__suggestion-term-link").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(e){return()=>{const{suggestionText:t}=e.dataset,{originalQuery:n}=z().dataset,r={aq:n,q:t,catalogs:[{name:"example_en"}]};(window.BrTrk||{})?.getTracker()?.logEvent("suggest","click",r,{},!0)}}(e)),e.setAttribute("hasListener","true"))}))}(t).catch(console.error)):(J().innerHTML="",n.dataset.originalQuery="",Re({last_template_data:null}))}}function De(){document.body.getAttribute("hasMousedownListener")||(document.body.addEventListener("mousedown",ke()),document.body.setAttribute("hasMousedownListener","true"));const e=z();e.getAttribute("hasBlurListener")||(e.addEventListener("blur",(()=>Ie().mouseDownEventHappenedInsideAutosuggestResultsContainer?(We({mouseDownEventHappenedInsideAutosuggestResultsContainer:!1}),!1):(J().innerHTML="",!0))),e.setAttribute("hasBlurListener","true"))}function Fe(){const e=z();e.getAttribute("hasFocusListener")||(e.addEventListener("focus",(()=>{const e=Pe().last_template_data;Pe(),e&&(J().innerHTML=r.render(U,e))})),e.setAttribute("hasFocusListener","true"))}function $e(){De(),Fe(),function(){const e=z();e.getAttribute("hasKeyupListener")||(e.addEventListener("keyup",Ne(Me(),500)),e.setAttribute("hasKeyupListener","true"))}()}function qe(e){const t={...e};return e.terms.forEach(((n,o)=>{const s=r.render(A,{query:e.originalQuery}).trim();(t.terms[o]||{}).processedText=n.text.replace(e.originalQuery||"",s)})),t}function Pe(){return window.BloomreachModules.autosuggest.getCurrentAutosuggestRequestState()}function Re(e){window.BloomreachModules.autosuggest.setCurrentAutosuggestRequestState({...Pe(),...e})}function Ie(){return window.BloomreachModules.autosuggest.getCurrentAutosuggestUiState()}function We(e){window.BloomreachModules.autosuggest.setCurrentAutosuggestUiState({...Ie(),...e})}const He=function(){let e={request_id:0,last_template_data:null},t={mouseDownEventHappenedInsideAutosuggestResultsContainer:!1};return{setCurrentAutosuggestRequestState:t=>{e=t},getCurrentAutosuggestRequestState:()=>e,setCurrentAutosuggestUiState:e=>{t=e},getCurrentAutosuggestUiState:()=>t,load:async()=>{(function(){const e=B();try{if(E(e.account_id),E(e.domain_key),!z())throw Error("Search input element not found");if(function(){if(!J()){const e=document.createElement("style");e.innerHTML=`.blm-autosuggest-search-results {\n width: 100%;\n position: absolute;\n z-index: 100;\n left: 0;\n transform: translateY(${z().offsetHeight}px);\n }`,document.head.appendChild(e)}}(),function(){if(!J()){const e=document.createElement("div");e.classList.add("blm-autosuggest-search-results"),z().parentElement?.appendChild(e)}}(),!J())throw Error("Autosuggest results container element cannot be created")}catch(e){return console.error(e),!1}return e?.autosuggest?.enabled})()&&($e(),G(),z().setAttribute("autocomplete","off"))}}}();window.BloomreachModules={...e,autosuggest:He},He.load().catch(console.error)}(); //# sourceMappingURL=autosuggest.js.map diff --git a/view/frontend/web/js/category.js b/view/frontend/web/js/category.js index ed685dc..be6bc79 100644 --- a/view/frontend/web/js/category.js +++ b/view/frontend/web/js/category.js @@ -1,4 +1,4 @@ -!function(){"use strict";const e=Object.assign(Object.assign({},window.BloomreachModules?window.BloomreachModules:{}),{version:"3.1.1"});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var r={},i=n(Object.freeze({__proto__:null,default:{}}));function a(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,c=function(e){return o.exec(e).slice(1)};function s(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=a(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function l(e){var t=u(e),n="/"===v(e,-1);return(e=a(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function u(e){return"/"===e.charAt(0)}function d(){return l(g(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=s(e).substr(1),t=s(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),a=Math.min(r.length,i.length),o=a,c=0;c":">",'"':""","'":"'"},a=/[&<>'"]/g;function o(e){return i[e]||e}function c(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(a,o)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:c}):e.escapeXML.toString=c}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var c=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return c.exec(e).slice(1)};function s(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function l(e){var t=u(e),r="/"===b(e,-1);return(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function u(e){return"/"===e.charAt(0)}function d(){return l(g(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=s(e).substr(1),t=s(t).substr(1);for(var n=r(e.split("/")),a=r(t.split("/")),i=Math.min(n.length,a.length),c=i,o=0;o":">",'"':""","'":"'"},i=/[&<>'"]/g;function c(e){return a[e]||e}function o(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(i,c)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:o}):e.escapeXML.toString=o}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var r in t)n(t,r)&&"__proto__"!==r&&"constructor"!==r&&(e[r]=t[r]);return e},e.shallowCopyFromList=function(e,t,r){if(r=r||[],t=t||{},null!=e)for(var a=0;a @@ -6,5 +6,5 @@ * @project EJS * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} */ -var t=i,n=b,r=y,a=!1,o=w,c="locals",s=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=s.concat("cache"),u=/^\uFEFF/,d=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function p(n,r){var i;if(r.some((function(r){return i=e.resolveInclude(n,r,!0),t.existsSync(i)})))return i}function m(t,n){var r,i=t.filename,a=arguments.length>1;if(t.cache){if(!i)throw new Error("cache option requires a filename");if(r=e.cache.get(i))return r;a||(n=f(i).toString().replace(u,""))}else if(!a){if(!i)throw new Error("Internal EJS error: no file name or template provided");n=f(i).toString().replace(u,"")}return r=e.compile(n,t),t.cache&&e.cache.set(i,r),r}function f(t){return e.fileLoader(t)}function h(n,i){var a=r.shallowCopy(r.createNullProtoObjWherePossible(),i);if(a.filename=function(n,r){var i,a,o=r.views,c=/^[A-Za-z]+:\\|^\//.exec(n);if(c&&c.length)n=n.replace(/^\/*/,""),i=Array.isArray(r.root)?p(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(a=e.resolveInclude(n,r.filename),t.existsSync(a)&&(i=a)),!i&&Array.isArray(o)&&(i=p(n,o)),!i&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return i}(n,a),"function"==typeof i.includer){var o=i.includer(n,a.filename);if(o&&(o.filename&&(a.filename=o.filename),o.template))return m(a,o.template)}return m(a)}function _(e,t,n,r,i){var a=t.split("\n"),o=Math.max(r-3,0),c=Math.min(a.length,r+3),s=i(n),l=a.slice(o,c).map((function(e,t){var n=t+o+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=s,e.message=(s||"ejs")+":"+r+"\n"+l+"\n\n"+e.message,e}function g(e){return e.replace(/;(\s*$)/,"$1")}function v(t,n){var i=r.hasOwnOnlyObject(n),a=r.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",a.client=i.client||!1,a.escapeFunction=i.escape||i.escapeFunction||r.escapeXML,a.compileDebug=!1!==i.compileDebug,a.debug=!!i.debug,a.filename=i.filename,a.openDelimiter=i.openDelimiter||e.openDelimiter||"<",a.closeDelimiter=i.closeDelimiter||e.closeDelimiter||">",a.delimiter=i.delimiter||e.delimiter||"%",a.strict=i.strict||!1,a.context=i.context,a.cache=i.cache||!1,a.rmWhitespace=i.rmWhitespace,a.root=i.root,a.includer=i.includer,a.outputFunctionName=i.outputFunctionName,a.localsName=i.localsName||e.localsName||c,a.views=i.views,a.async=i.async,a.destructuredLocals=i.destructuredLocals,a.legacyInclude=void 0===i.legacyInclude||!!i.legacyInclude,a.strict?a._with=!1:a._with=void 0===i._with||i._with,this.opts=a,this.regex=this.createRegex()}e.cache=r.cache,e.fileLoader=t.readFileSync,e.localsName=c,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var i=n.dirname,a=n.extname,o=(0,n.resolve)(r?t:i(t),e);return a(e)||(o+=".ejs"),o},e.compile=function(e,t){return t&&t.scope&&(a||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),a=!0),t.context||(t.context=t.scope),delete t.scope),new v(e,t).compile()},e.render=function(e,t,n){var i=t||r.createNullProtoObjWherePossible(),a=n||r.createNullProtoObjWherePossible();return 2==arguments.length&&r.shallowCopyFromList(a,i,s),m(a,e)(i)},e.renderFile=function(){var t,n,i,a=Array.prototype.slice.call(arguments),o=a.shift(),c={filename:o};return"function"==typeof arguments[arguments.length-1]&&(t=a.pop()),a.length?(n=a.shift(),a.length?r.shallowCopy(c,a.pop()):(n.settings&&(n.settings.views&&(c.views=n.settings.views),n.settings["view cache"]&&(c.cache=!0),(i=n.settings["view options"])&&r.shallowCopy(c,i)),r.shallowCopyFromList(c,n,l)),c.filename=o):n=r.createNullProtoObjWherePossible(),function(t,n,r){var i;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(i=m(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{i=m(t)(n)}catch(e){return r(e)}r(null,i)}(c,n,t)},e.Template=v,e.clearCache=function(){e.cache.reset()},v.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},v.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=r.escapeRegExpChars(this.opts.delimiter),n=r.escapeRegExpChars(this.opts.openDelimiter),i=r.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,i),new RegExp(e)},compile:function(){var e,t,i,a=this.opts,o="",c="",s=a.escapeFunction,l=a.filename?JSON.stringify(a.filename):"undefined";if(!this.source){if(this.generateSource(),o+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',a.outputFunctionName){if(!d.test(a.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");o+=" var "+a.outputFunctionName+" = __append;\n"}if(a.localsName&&!d.test(a.localsName))throw new Error("localsName is not a valid JS identifier.");if(a.destructuredLocals&&a.destructuredLocals.length){for(var u=" var __locals = ("+a.localsName+" || {}),\n",p=0;p0&&(u+=",\n "),u+=m+" = __locals."+m}o+=u+";\n"}!1!==a._with&&(o+=" with ("+a.localsName+" || {}) {\n",c+=" }\n"),c+=" return __output;\n",this.source=o+this.source+c}e=a.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,a.client&&(e="escapeFn = escapeFn || "+s.toString()+";\n"+e,a.compileDebug&&(e="rethrow = rethrow || "+_.toString()+";\n"+e)),a.strict&&(e='"use strict";\n'+e),a.debug&&console.log(e),a.compileDebug&&a.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(a.async)try{i=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else i=Function;t=new i(a.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(a.filename&&(e.message+=" in "+a.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",a.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var f=a.client?t:function(e){return t.apply(a.context,[e||r.createNullProtoObjWherePossible(),s,function(t,n){var i=r.shallowCopy(r.createNullProtoObjWherePossible(),e);return n&&(i=r.shallowCopy(i,n)),h(t,a)(i)},_])};if(a.filename&&"function"==typeof Object.defineProperty){var g=a.filename,v=n.basename(g,n.extname(g));try{Object.defineProperty(f,"name",{value:v,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return f},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(a,o){var c;if(0===a.indexOf(r+n)&&0!==a.indexOf(r+n+n)&&(c=t[o+2])!=n+i&&c!="-"+n+i&&c!="_"+n+i)throw new Error('Could not find matching close tag for "'+a+'".');e.scanLine(a)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),i=[];r;)0!==(e=r.index)&&(i.push(t.substring(0,e)),t=t.slice(e)),i.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&i.push(t),i},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=v.modes.EVAL;break;case r+n+"=":this.mode=v.modes.ESCAPED;break;case r+n+"-":this.mode=v.modes.RAW;break;case r+n+"#":this.mode=v.modes.COMMENT;break;case r+n+n:this.mode=v.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+i:this.mode=v.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+i,n+i)+'")\n';break;case n+i:case"-"+n+i:case"_"+n+i:this.mode==v.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case v.modes.EVAL:case v.modes.ESCAPED:case v.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case v.modes.EVAL:this.source+=" ; "+e+"\n";break;case v.modes.ESCAPED:this.source+=" ; __append(escapeFn("+g(e)+"))\n";break;case v.modes.RAW:this.source+=" ; __append("+g(e)+")\n";break;case v.modes.COMMENT:break;case v.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=r.escapeXML,e.__express=e.renderFile,e.VERSION=o,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(r);var S="Invariant failed";function k(e,t){if(!e)throw new Error(S)}const E="cdp_segments",x="$",O=16,L="q",j=[{label:"Relevance",value:""},{label:"Price (low - high)",value:"price+asc"},{label:"Price (high - low)",value:"price+desc"},{label:"Name (A - Z)",value:"title+asc"},{label:"Name (Z - A)",value:"title+desc"}],A=0,R="price",q=4,N=2,C=2,I=5,P=6,T="fq",F="filterpanel",M="groupby",$="page",D="size",U="sort",z="search",V="category",W="keyword",J=".main-content";function B(){const e=`${E}=`;return(document.cookie.split("; ").find((t=>t.startsWith(e)))||"").replace(e,"")}const Q={method:"GET",headers:{"Content-Type":"application/json"}};function H(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const X=(e,t="$",n=!0)=>`${n?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${n?"":` ${t}`}`;const Z="https://core.dxpapi.com/api/v1/core/",G=["_br_uid_2","fq","sort"],Y="pid,title,brand,price,sale_price,thumb_image,sku_thumb_images,sku_swatch_images,sku_color_group,url,price_range,sale_price_range,description,is_live,score,skuid,group";function K(e){const t=Object.assign({},e),n=(null==t?void 0:t.endpoint)||Z;return(null==t?void 0:t.endpoint)&&(null==t||delete t.endpoint),(null==t?void 0:t.fl)||(t.fl=Y),`${n}${r=t,`?${Object.keys(r).reduce(((e,t)=>[...e,`${t}=${G.includes(t)?r[t]:encodeURIComponent(r[t])}`]),[]).join("&")}`}`;var r}async function ee(e){return async function(e,t){const n=await fetch(e,t);return await n.json()}(K(e),Q)}var te='<% if (did_you_mean.length) { %>\n \n<% } %>\n<% if (locals.keywordRedirect && keywordRedirect.redirected_query && did_you_mean.length === 0) { %>\n
\n
\n

Results for <%- keywordRedirect.redirected_query %>

\n
Redirected from "<%- keywordRedirect.original_query %>"
\n
\n
\n<% } %>\n
\n <% if (config.search.facets_included && facets.length) { %>\n \n <% } %>\n
\n
\n <%\n const haveUngroupedResults = locals.number_of_results && number_of_results > 0;\n const haveGroupedResults = locals.grouped_products && grouped_products.groups.length > 0;\n %>\n <% if (haveUngroupedResults || haveGroupedResults) { %>\n <% if (haveUngroupedResults) { %>\n

\n Showing <%- start + 1 %> - <%- Math.min(start + products.length, number_of_results) %> of <%- number_of_results %> products\n

\n <% } %>\n
\n <% if (config.search.groupby) { %>\n \n \n \n <% config.search.groupby_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n <% } %>\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n \n \n \n <% for (let i = (config.search.groupby ? 4 : 16); i <= (config.search.groupby ? 16 : 48); i += 4) { %>\n \n <% } %>\n \n \n <% } %>\n \n \n \n <% config.search.sorting_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n
\n <% } else if (!(locals.grouped_products) || grouped_products.groups.length < 1) { %>\n

\n No results found\n

\n <% } %>\n\n
\n
class="blm-product-search__results"<% } %>>\n <% if (products.length || (locals.grouped_products && grouped_products.groups.length > 0)) { %>\n %%-PRODUCT_LIST_TEMPLATE-%%\n <% } %>\n
\n\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n
\n
    \n <% paginationData.forEach(paginationNode => { %>\n
  • \n
  • \n <% }) %>\n
\n
\n <% } %>\n
\n
\n',ne='<% function printProduct(product) { %>\n
title="<%- product.variant_name %>"<% } %>>\n <%\n const matchingVariant = !Array.isArray(product.variants)\n ? null\n : \'variant_index\' in product\n ? product.variants[product.variant_index]\n : product.variants.find(variant => selectedColors.includes(variant.sku_color_group ? variant.sku_color_group.toLowerCase() : null))\n %>\n
\n <% if (product.variants && product.variants.length > 1) { %>\n <% product.variants.forEach(function(variant, index) { %>\n\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n\n
style="display: block"<% } %>\n >\n \n
\n <% }); %>\n <% } else { %>\n
\n \n
\n <% } %>\n
\n \n\n <% if (product.variants && product.variants.length > 1) { %>\n
    \n <% product.variants.slice(0, defaultMaxColorSwatches || 0).forEach(function(variant, index) { %>\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n \n <% }); %>\n
\n\n <% if (product.variants.length > defaultMaxColorSwatches || 0) { %>\n (Colors) <%- product.variants.length %>\n <% } %>\n <% } %>\n
\n<% } %>\n\n<% if (locals.grouped_products && grouped_products && grouped_products.groups) { %>\n\n <% grouped_products.groups.forEach(group => { %>\n
\n

<%- group.title %>

\n\n
\n <% group.products.forEach(printProduct); %>\n
\n
\n <% }); %>\n\n<% } else { %>\n\n <% products.forEach(printProduct); %>\n\n<% } %>\n';function re(){var e,t,n;const r=function(){var e;const t=null===(e=null===window||void 0===window?void 0:window.bloomreachConnector)||void 0===e?void 0:e.config;return Object.assign({default_search_parameter:L,url:window.location.href,ref_url:window.location.href,tracking_cookie:H(),format_money:e=>X(e,window.bloomreachDefaultCurrency||x),default_currency:window.bloomreachDefaultCurrency||x},t)}(),i=new URLSearchParams(window.location.search),a=At(),o=Object.assign({display_variants:!1,enabled:!0,endpoint:"",items_per_page:O,facets_included:!0,initial_number_of_facets:I,initial_number_of_facet_values:P,infinite_scroll:!1,selector:J,sorting_options:j,template:te,product_list_template:ne},(null==r?void 0:r.search)?r.search:{}),c=Object.assign(Object.assign({},r),{request_type:z,search_type:a.is_category_page?V:W,start:A,"facet.range":R,"stats.field":R,sort:i.get(U)||"",search:Object.assign(Object.assign(Object.assign({},o),(a.is_category_page?r.category:r.search)||{}),a.category_to_load?{category_id:a.category_to_load}:{})});return null===(n=null===(t=null===(e=c.search)||void 0===e?void 0:e.sorting_options)||void 0===t?void 0:t.sort)||void 0===n||n.call(t,((e,t)=>e.value>t.value?1:-1)),c.search&&(c.search=Object.assign(Object.assign({},c.search),{items_per_page:Number(i.has(D)?i.get(D):c.search.items_per_page),groupby:i.get(M)||c.search.groupby||""})),c}function ie(e){return"grouped_products"in e?function(e){var t;const n=Number(e.page||1),r=e.size||1,i=((null===(t=null==e?void 0:e.grouped_products)||void 0===t?void 0:t.groups)||[]).length;return[{value:"previous",label:"Previous",disabled:n<=1},{value:"next",label:"Next",disabled:it+1)).slice(-N),a=Array(r-n).fill(null).map(((e,t)=>t+(n+1))).slice(0,C);return[...n>1?[{value:"previous",label:"←"}]:[],...n-1>N?[{label:"…",value:(n-N-1).toString()}]:[],...i.map((e=>({value:e.toString()}))),{value:n.toString(),disabled:!0,active:!0},...a.map((e=>({value:e.toString()}))),...n+Ce.replace(/"/g,""").replace(/,/g,"%%-COMMA-%%"),oe=e=>Object.keys(e).map((t=>"price"===t?encodeURIComponent(`${t}:[${e[t].map((e=>`${e||"*"}`)).join(" TO ")}]`):encodeURIComponent(`${t}:${e[t].map((e=>`"${(e=>e.replace(/%%-COMMA-%%/g,",").replace(/"/g,'"'))(e)}"`)).join(" OR ")}`))).join("&fq=");function ce(e){var t;let n=0,r=0;const i=re(),a=Number(e||(null===(t=i.search)||void 0===t?void 0:t.initial_number_of_facets));document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').forEach((e=>{const t=e.querySelectorAll('.blm-product-search-filter-item:not([style*="display: none"]');n0&&e.setAttribute("style","display: block"),n++,r+=t.length>0?1:0}));const o=At(),c=document.querySelector(`.blm-load-more-facet--${o.request_id}`);0!==document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').length&&0!==r||null==c||c.classList.add("blm-hide")}function se(){const e=At(),t=document.querySelector(`.blm-load-more-facet--${e.request_id}`);return k(t),t}function le(){var e,t;const n=re(),r=Number(null===(e=n.search)||void 0===e?void 0:e.initial_number_of_facets),i=Number(null===(t=n.search)||void 0===t?void 0:t.initial_number_of_facet_values);[".blm-dynamic-filter",".blm-product-search-filter-item",".blm-product-search-load-more"].forEach((e=>{document.querySelectorAll(e).forEach((e=>{e.removeAttribute("style")}))})),ce(r-1),document.querySelectorAll(`.blm-product-search-filter-item:nth-child(-n+${i})`).forEach((e=>e.style.display="block")),se().removeAttribute("style")}function ue(){var e;const t=re();k(null===(e=t.search)||void 0===e?void 0:e.selector);return document.querySelector(t.search.selector)}function de(){const e=document.querySelector(".blm-scroll-indicator");if(e){e.innerHTML="";const t=document.createElement("div");t.classList.add("blm-scroll-indicator__loading"),e.appendChild(t)}}function pe(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox:checked");return e?Array.from(e).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.name]:e[t.name]?[...e[t.name]||[],t.value]:[t.value]})),{}):{}}var me;!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(me||(me={}));const fe=window.matchMedia(`(max-width: ${me.medium})`);function he(e){const t={};for(const n of e.entries())t[n[0]]=n[1];window.history.pushState(t,document.title,`?${e.toString()}`)}function _e(e,t,n){const r=Object.assign(Object.assign({},{valueSerializer:e=>e.toString().replace(/"/g,'\\"'),nameValueSeparator:":"}),n),i=new URLSearchParams(window.location.search);i.delete(e),Array.isArray(t)?t.forEach((t=>{i.append(e,r.valueSerializer(t))})):Object.keys(t).forEach((n=>{i.append(e,`${n}${r.nameValueSeparator}${r.valueSerializer(t[n])}`)})),he(i)}function ge(e,t){const n=new URLSearchParams(window.location.search);"function"==typeof t?n.set(e,t(n.get(e)).replace(/"/g,'\\"')):""===t?n.delete(e):n.set(e,t.replace(/"/g,'\\"')),he(n)}function ve(e){ge(e,(e=>{if(!e)return"2";let t=Number.parseInt(e,10);return(++t).toString()}))}function be(e){ge(e,(e=>{if(!e)return"1";let t=Number.parseInt(e,10);return(--t).toString()}))}function ye(){const e=At(),t=we(),n=document.querySelector(".blm-price-range-input--lower"),r=document.querySelector(".blm-price-range-input--upper");let i=parseFloat(n.value),a=parseFloat(r.value);return i>a&&([i,a]=[a,i]),i===a&&(i>e.price_range_min_value||aObject.assign(Object.assign({},e),{[t.split(":")[0]||""]:(t.split(":")[1]||"").split(",")})),{})}window.matchMedia(`(min-width:${me.medium}) and (max-width: ${me.xlarge})`);var Se=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ke="object"==typeof t&&t&&t.Object===Object&&t,Ee="object"==typeof self&&self&&self.Object===Object&&self,xe=ke||Ee||Function("return this")(),Oe=xe,Le=function(){return Oe.Date.now()},je=/\s/;var Ae=function(e){for(var t=e.length;t--&&je.test(e.charAt(t)););return t},Re=/^\s+/;var qe=function(e){return e?e.slice(0,Ae(e)+1).replace(Re,""):e},Ne=xe.Symbol,Ce=Ne,Ie=Object.prototype,Pe=Ie.hasOwnProperty,Te=Ie.toString,Fe=Ce?Ce.toStringTag:void 0;var Me=function(e){var t=Pe.call(e,Fe),n=e[Fe];try{e[Fe]=void 0;var r=!0}catch(e){}var i=Te.call(e);return r&&(t?e[Fe]=n:delete e[Fe]),i},$e=Object.prototype.toString;var De=Me,Ue=function(e){return $e.call(e)},ze=Ne?Ne.toStringTag:void 0;var Ve=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ze&&ze in Object(e)?De(e):Ue(e)},We=function(e){return null!=e&&"object"==typeof e};var Je=qe,Be=Se,Qe=function(e){return"symbol"==typeof e||We(e)&&"[object Symbol]"==Ve(e)},He=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,Ze=/^0o[0-7]+$/i,Ge=parseInt;var Ye=Se,Ke=Le,et=function(e){if("number"==typeof e)return e;if(Qe(e))return NaN;if(Be(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Be(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Je(e);var n=Xe.test(e);return n||Ze.test(e)?Ge(e.slice(2),n?2:8):He.test(e)?NaN:+e},tt=Math.max,nt=Math.min;var rt=function(e,t,n){var r,i,a,o,c,s,l=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function f(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-l>=a}function h(){var e=Ke();if(f(e))return _(e);c=setTimeout(h,function(e){var n=t-(e-s);return d?nt(n,a-(e-l)):n}(e))}function _(e){return c=void 0,p&&r?m(e):(r=i=void 0,o)}function g(){var e=Ke(),n=f(e);if(r=arguments,i=this,s=e,n){if(void 0===c)return function(e){return l=e,c=setTimeout(h,t),u?m(e):o}(s);if(d)return clearTimeout(c),c=setTimeout(h,t),m(s)}return void 0===c&&(c=setTimeout(h,t)),o}return t=et(t)||0,Ye(n)&&(u=!!n.leading,a=(d="maxWait"in n)?tt(et(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==c&&clearTimeout(c),l=0,r=s=i=c=void 0},g.flush=function(){return void 0===c?o:_(Ke())},g};function it(e){var t,n,r;const i=re(),a=(null==e?void 0:e.facet_counts)?"facets"in e.facet_counts?function(e){var t,n;return Object.assign(Object.assign({facets:null!==(n=null===(t=e.facets)||void 0===t?void 0:t.filter((e=>"text"===e.type||"number"===e.type)).filter((e=>e.value.length)).map(st))&&void 0!==n?n:[]},function(e){var t;const n=null===(t=null==e?void 0:e.filter((e=>"number_range"===e.type)).find((e=>"price"===e.name.toLowerCase())))||void 0===t?void 0:t.value.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})));return n?{priceRanges:n}:{}}(e.facets)),function(e){var t;const n=null==e?void 0:e.filter((e=>"number_stats"===e.type)).map((e=>({name:e.name.toLowerCase(),value:e.value}))),r=null!==(t=null==n?void 0:n.find((e=>"sale price"===e.name||"sale_price"===e.name)))&&void 0!==t?t:null==n?void 0:n.find((e=>"price"===e.name));return(null==r?void 0:r.value)?{maxPrice:r.value.end,minPrice:r.value.start}:{}}(e.facets))}(e.facet_counts):function(e,t){var n,r;return Object.assign(Object.assign(Object.assign({facets:Object.entries(e.facet_fields||{}).filter((e=>e[1].length)).map(at)},function(e){if(null==e?void 0:e.price)return{priceRanges:e.price.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})))};return{}}(e.facet_ranges)),ct(null===(n=null==t?void 0:t.stats_fields)||void 0===n?void 0:n.price)),ct(null===(r=null==t?void 0:t.stats_fields)||void 0===r?void 0:r.sale_price))}(e.facet_counts,e.stats):{facets:[]};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),{products:lt((null===(t=e.response)||void 0===t?void 0:t.docs)||[])}),(null==e?void 0:e.group_response)?{grouped_products:Object.keys(null==e?void 0:e.group_response).reduce(((t,n)=>{var r,i,a,o;return Object.assign(Object.assign({group_category_id:n},null===(r=e.group_response)||void 0===r?void 0:r[n]),{groups:(null===(o=null===(a=null===(i=e.group_response)||void 0===i?void 0:i[n])||void 0===a?void 0:a.groups)||void 0===o?void 0:o.map((e=>{var t;return{title:e.groupValue,products:lt((null===(t=null==e?void 0:e.doclist)||void 0===t?void 0:t.docs)||[])}})))||[]})}),{})}:{}),{did_you_mean:e.did_you_mean||[],number_of_results:Number(null===(n=e.response)||void 0===n?void 0:n.numFound),start:Number(null===(r=e.response)||void 0===r?void 0:r.start),config:i}),e.keywordRedirect?{keywordRedirect:{original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}}:{})}function at(e){return{original_title:e[0],title:e[0].replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e[1].map(ot)}}function ot(e){var t,n,r,i,a;if("name"in e){let r=null!==(t=e.name)&&void 0!==t?t:"";return"true"===e.name?r="Yes":"false"===e.name&&(r="No"),{count:null!==(n=e.count)&&void 0!==n?n:0,name:r,id:r}}return{count:null!==(r=e.count)&&void 0!==r?r:0,name:null!==(i=e.cat_name)&&void 0!==i?i:"",id:null!==(a=e.cat_id)&&void 0!==a?a:""}}function ct(e){return e?{maxPrice:e.max,minPrice:e.min}:{}}function st(e){return{original_title:e.name,title:e.name.replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e.value.map(ot)}}function lt(e){const t=re();return e.reduce(((e,n)=>[...e,...t.search.display_variants?ut(n):[dt(n)]]),[])}function ut(e){return e.variants&&e.variants.length?(dt(e).variants||[]).map(((t,n)=>Object.assign(Object.assign(Object.assign({},dt(e)),t),{variant_index:n}))):[dt(e)]}function dt(e){return Object.assign(Object.assign(Object.assign({},e),{title:e.title,image:e.thumb_image,link:e.url,id:e.pid,price:e.price,sale_price:e.sale_price}),e.variants?{variants:e.variants.map((e=>Object.assign(Object.assign({},e),{sku_color_group:e.sku_color_group,sku_swatch_images:e.sku_swatch_images,sku_thumb_images:e.sku_thumb_images,sku_sale_price:e.sku_sale_price,sku_price:e.sku_price,image:e.sku_thumb_images&&Array.isArray(e.sku_thumb_images)?e.sku_thumb_images[0]:e.sku_swatch_images[0],variant_name:e.sku_color_group})))}:{})}function pt(){const e=At(),t=document.querySelector(`.blm-range-slider__clear-values-button--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(()=>{de(),_e(T,Object.assign({},pe())),ge($,"1"),Rt({price_range_max_value:0,price_range_min_value:0}),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function mt(){document.querySelectorAll(".blm-product-search-selected-filter__clear").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(e=>{var t,n,r,i;const a=null===(r=null===(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.parentNode)||void 0===n?void 0:n.dataset)||void 0===r?void 0:r.filterCheckboxId;a&&(null===(i=document.getElementById(a))||void 0===i||i.click())})),e.setAttribute("hasListener","true"))}))}function ft(){const e=document.querySelector(".blm-product-search-selected-filters__clear-all");e&&(e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{de(),_e(T,Object.assign({},ye())),ge($,"1"),Rt({price_range_min_value:0,price_range_max_value:0}),jt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true")))}function ht(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox");e&&e.forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("change",(()=>{de(),_e(T,Object.assign(Object.assign({},pe()),ye())),ge($,"1"),Rt({price_range_min_value:0,price_range_max_value:0}),jt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true"))}))}function _t(){const e=document.querySelector("#blm-product-search-search-filters__input");e&&(e.getAttribute("hasInputListener")||(e.addEventListener("input",rt((e=>{var t;const n=((null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)||"").trim();document.querySelectorAll(".blm-dynamic-filter").forEach((e=>{let t=0;e.querySelectorAll(".blm-product-search-filter-item").forEach((e=>{var r;const i=(null===(r=e.querySelector("label"))||void 0===r?void 0:r.textContent)||"",a=!n||i.toLowerCase().includes(n.toLowerCase()),o=a?"block":"none";t+=a?1:0,e.style.display=o})),e.style.display=t?"block":"none"})),document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.style.display="none"})),se().style.display="none",n||le()}),500)),e.setAttribute("hasInputListener","true")))}function gt(){const e=At(),t=document.querySelector(`#groupby-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{var t;ge(M,null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),de(),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function vt(){const e=se();e&&!e.getAttribute("hasListener")&&(e.addEventListener("click",(()=>{ce()})),e.setAttribute("hasListener","true"))}function bt(){document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(){var e;const t=re(),n=Number(null===(e=t.search)||void 0===e?void 0:e.initial_number_of_facet_values);let r=n;const i=n;return e=>{const t=e.target.getAttribute("data-item"),n=document.getElementById(`blm-facet-block-item-${t}`).getElementsByTagName("li");for(let e=r;e=n.length&&(e.target.style.display="none")}}()),e.setAttribute("hasListener","true"))}))}function yt(){const e=At(),t=document.querySelector(`#sort-size-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(D,e.target.value),ge($,"1"),de(),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function wt(){const e=At(),t=document.querySelector(`.blm-product-search-pagination__pages--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(e=>{de();const t=e.target.dataset.value;if(t){switch(e.target.dataset.value){case"previous":be($);break;case"next":ve($);break;default:ge($,t)}jt({toReplace:!0}).catch(console.error)}})),t.setAttribute("hasListener","true")))}function St(){return()=>{de(),_e(T,Object.assign(Object.assign({},pe()),ye())),ge($,"1"),jt({toReplace:!0}).catch(console.error)}}function kt(e){const t=re();return n=>{var r,i;const a=document.querySelector(e);a&&(a.innerHTML=null!==(i=null===(r=t.format_money)||void 0===r?void 0:r.call(t,100*Number(n.target.value)))&&void 0!==i?i:n.target.value)}}function Et(){var e,t;const n=re();if((null===(e=n.search)||void 0===e?void 0:e.infinite_scroll)&&!document.querySelector(".blm-scroll-indicator")){const e=ue(),r=document.createElement("div");r.classList.add("blm-scroll-indicator");const i=document.createElement("div");i.classList.add("blm-scroll-indicator__loading"),r.appendChild(i),null===(t=null==e?void 0:e.parentNode)||void 0===t||t.insertBefore(r,e.nextSibling);const a=document.querySelector(".blm-scroll-indicator"),o=new IntersectionObserver(function(e){return t=>{var n;if(t[0].intersectionRatio<=0)return;const r=(null===(n=null===window||void 0===window?void 0:window.bloomreachConnector)||void 0===n?void 0:n.config)||{},i=r.start||0;r.start=i+e.search.items_per_page,ve($),jt().catch((e=>{r.start=i,be($),console.error(e)}))}}(n));a&&o.observe(a)}}function xt(){document.querySelectorAll(".blm-product-search-control-button--sidebar").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{const e=document.querySelector(".blm-product-search-sidebar-content");(null==e?void 0:e.classList.contains("blm-open"))?(null==e||e.classList.remove("blm-open"),document.body.classList.remove("blm-out-of-view"),ge(F,"")):(document.body.classList.add("blm-out-of-view"),null==e||e.classList.add("blm-open"),ge(F,"on"))})),e.setAttribute("hasListener","true"))}))}function Ot(){const e=At(),t=document.querySelector(`#sort-by-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{var t;ge(U,null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),de(),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function Lt(){document.querySelectorAll(".blm-product-search__result").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-container").forEach((t=>{const n=t.querySelectorAll(".blm-product-search-swatch-container__swatch");n.forEach(((t,r)=>{t.getAttribute("hasListener")||(t.addEventListener("mouseover",function(e){const{result:t,swatchItems:n,swatchIndex:r}=e;return e=>{n.forEach((e=>{e.classList.remove("active")})),e.target.classList.add("active"),t.querySelectorAll(".blm-product-search-image-container").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-image").forEach(((e,t)=>{e.style.display="none",r===t&&(e.style.display="block")}))})),t.querySelectorAll(".blm-product-search-details-container__price").forEach(((e,t)=>{e.classList.remove("active"),r===t&&e.classList.add("active")}))}}({result:e,swatchItems:n,swatchIndex:r})),t.setAttribute("hasListener","true"))}))}))}))}async function jt(e={toReplace:!1}){var t,n,i,a;Rt({request_id:Math.floor(1e12+9e12*Math.random())});const o=re(),c=function(){var e,t,n,r,i;const a=re(),o=new URLSearchParams(window.location.search),c=At(),s=Object.assign(Object.assign(Object.assign(Object.assign({},(null===(e=a.search)||void 0===e?void 0:e.endpoint)?{endpoint:a.search.endpoint}:{}),(null===(t=a.search)||void 0===t?void 0:t.groupby)?{groupby:a.search.groupby}:{}),(null===(n=a.search)||void 0===n?void 0:n.group_limit)?{group_limit:a.search.group_limit}:{}),{q:o.get(a.default_search_parameter||"")||a.search.category_id||"",rows:null===(r=a.search)||void 0===r?void 0:r.items_per_page,sort:null==a?void 0:a.sort,start:a.start,account_id:a.account_id,domain_key:a.domain_key,request_id:c.request_id,_br_uid_2:a.tracking_cookie,ref_url:a.ref_url,url:a.url,request_type:a.request_type,search_type:a.search_type,fl:null===(i=a.search)||void 0===i?void 0:i.fields,"facet.range":a["facet.range"],"stats.field":a["stats.field"]}),l=o.get($);l&&(a.search.infinite_scroll&&c.is_first_request?(s.start=0,s.rows=Number.parseInt(l,10)*a.search.items_per_page):s.start=(Number.parseInt(l,10)-1)*a.search.items_per_page);const u=we();Object.keys(u).length&&(s.fq=oe(u));for(const[e,t]of o.entries())Object.keys(s).includes(e)||(s[e]=t);const d=B();d&&(s.brSeg=`seg:${d}`,s.segment=`customer_profile:${d}`,s.cdp_segments=d);a.search.force_v3_facets&&(s["facet.version"]="3.0");return s}(),s=await ee(c);if(null==s?void 0:s.keywordRedirect)return void function(e){var t;if(null==e?void 0:e.keywordRedirect){localStorage.setItem("keywordRedirect",JSON.stringify({original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}));const n=(null===(t=e.keywordRedirect)||void 0===t?void 0:t["redirected url"])||"";window.location.href=`${n.startsWith("http")?"":"https://"}${n}`}}(s);const l=function(e){var t;const n=re(),r=it(e),i=JSON.parse(localStorage.getItem("keywordRedirect")||"{}");(null==i?void 0:i.redirected_query)&&(r.keywordRedirect=i,localStorage.removeItem("keywordRedirect"));const a=new URLSearchParams(window.location.search);for(const[e,t]of a.entries())Object.keys(r).includes(e)||(r[e]=t);a.has(D)?r.size=Number.parseInt(a.get(D)||"",10):r.size=Number.parseInt(n.search.items_per_page.toString(),10);r.checkedFacets=we(),r.selectedFilterItems=((null==r?void 0:r.facets)||[]).reduce(((e,t)=>(t.section.length>0&&t.section.forEach((n=>{var i,a,o;r.checkedFacets&&t.original_title in r.checkedFacets&&(null===(o=null===(a=null===(i=r.checkedFacets)||void 0===i?void 0:i[t.original_title])||void 0===a?void 0:a.includes)||void 0===o?void 0:o.call(a,ae(n.id)))&&(e||[]).push({checkbox_id:`${t.original_title}[${ae(n.name)}]`,label:n.name})})),e)),[]);let o=At();"minPrice"in r&&"maxPrice"in r&&0===o.price_range_min_value&&0===o.price_range_max_value&&Rt({price_range_min_value:Math.floor(Number(r.minPrice)),price_range_max_value:Math.ceil(Number(r.maxPrice))});o=At(),r.priceRangeFacet={start:o.price_range_min_value,end:o.price_range_max_value},(null===(t=null==n?void 0:n.search)||void 0===t?void 0:t.infinite_scroll)||(r.paginationData=ie(r));return r.isFiltersPanelOpened=a.has(F),r.defaultMaxColorSwatches=q,r.mobileView=fe,r.escapeSpecialCharacters=ae,r.selectedColors=function(){const e=we();return Object.keys(e).reduce(((t,n)=>("color"===n.toLowerCase()&&(t=(e[n]||[]).map((e=>e.toLowerCase()))),t)),[])}(),r}(s),u=document.querySelector(".blm-scroll-indicator__loading"),d=(null==l?void 0:l.grouped_products)?((null===(t=null==l?void 0:l.grouped_products)||void 0===t?void 0:t.groups)||[]).length{t=e},getCurrentSearchRequestState:()=>t,load:async t=>{e&&t&&Rt({category_to_load:t}),function(){var e;const t=re();k(t.account_id),k(t.domain_key),k(t.default_search_parameter),k(null===(e=null==t?void 0:t.search)||void 0===e?void 0:e.selector),ue();const n=new URLSearchParams(window.location.search),r=t.search.is_search_page&&n.has(t.default_search_parameter),i=t.search.is_category_page&&(n.has(t.default_search_parameter)||t.search.category_id);return r||i}()&&(function(){const e=B();if(e){(window.br_data||{})[E]=e}}(),function(e){const t={childList:!0,subtree:!0};new MutationObserver((t=>{t.find((e=>"childList"===e.type&&Array.from(e.addedNodes).find((e=>e.classList&&e.classList.contains("blm-results")))))&&e()})).observe(ue(),t)}((()=>{ue().classList.add("blm-has-loaded"),window.onbeforeunload=function(){let e;void 0!==window.pageYOffset?e=window.pageYOffset:void 0!==document.compatMode&&"BackCompat"!==document.compatMode?e=document.documentElement.scrollTop:void 0!==document.body&&(e=document.body.scrollTop);const t=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}");window.localStorage.setItem("scrollPositions",JSON.stringify(Object.assign(Object.assign({},t),{[encodeURI(window.location.href)]:{scrollPosition:e}})))},Et(),function(){window.onpopstate=async()=>{await jt({toReplace:!0})},function(){const e=At(),t=document.querySelector(`.blm-price-range-input--lower-${e.request_id}`),n=document.querySelector(`.blm-price-range-input--upper-${e.request_id}`);t&&n&&(t.getAttribute("hasListener")||(t.addEventListener("change",St()),t.addEventListener("input",kt(".blm-range-slider__values--min")),t.setAttribute("hasListener","true")),n.getAttribute("hasListener")||(n.addEventListener("change",St()),n.addEventListener("input",kt(".blm-range-slider__values--max")),n.setAttribute("hasListener","true")))}(),pt(),mt(),ft(),document.querySelector(".blm-product-search-sidebar")&&(xt(),ht(),vt(),bt(),_t(),le());yt(),Ot(),gt(),wt(),Lt()}()})),await jt(),function(){var e;const t=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}"),n=encodeURI(window.location.href);if(n in t){const r=parseInt(null===(e=t[n])||void 0===e?void 0:e.scrollPosition,10);setTimeout((()=>{document.documentElement.scrollTop=r,document.body.scrollTop=r}),250)}delete t[encodeURI(window.location.href)],window.localStorage.setItem("scrollPositions",JSON.stringify(t))}())}}}({isCategoryPage:!0});window.BloomreachModules=Object.assign(Object.assign({},e),{search:qt}),qt.load().catch(console.error)}(); +var t=a,r=v,n=y,i=!1,c=w,o="locals",s=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=s.concat("cache"),u=/^\uFEFF/,d=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function p(r,n){var a;if(n.some((function(n){return a=e.resolveInclude(r,n,!0),t.existsSync(a)})))return a}function m(t,r){var n,a=t.filename,i=arguments.length>1;if(t.cache){if(!a)throw new Error("cache option requires a filename");if(n=e.cache.get(a))return n;i||(r=f(a).toString().replace(u,""))}else if(!i){if(!a)throw new Error("Internal EJS error: no file name or template provided");r=f(a).toString().replace(u,"")}return n=e.compile(r,t),t.cache&&e.cache.set(a,n),n}function f(t){return e.fileLoader(t)}function h(r,a){var i=n.shallowCopy(n.createNullProtoObjWherePossible(),a);if(i.filename=function(r,n){var a,i,c=n.views,o=/^[A-Za-z]+:\\|^\//.exec(r);if(o&&o.length)r=r.replace(/^\/*/,""),a=Array.isArray(n.root)?p(r,n.root):e.resolveInclude(r,n.root||"/",!0);else if(n.filename&&(i=e.resolveInclude(r,n.filename),t.existsSync(i)&&(a=i)),!a&&Array.isArray(c)&&(a=p(r,c)),!a&&"function"!=typeof n.includer)throw new Error('Could not find the include file "'+n.escapeFunction(r)+'"');return a}(r,i),"function"==typeof a.includer){var c=a.includer(r,i.filename);if(c&&(c.filename&&(i.filename=c.filename),c.template))return m(i,c.template)}return m(i)}function _(e,t,r,n,a){var i=t.split("\n"),c=Math.max(n-3,0),o=Math.min(i.length,n+3),s=a(r),l=i.slice(c,o).map((function(e,t){var r=t+c+1;return(r==n?" >> ":" ")+r+"| "+e})).join("\n");throw e.path=s,e.message=(s||"ejs")+":"+n+"\n"+l+"\n\n"+e.message,e}function g(e){return e.replace(/;(\s*$)/,"$1")}function b(t,r){var a=n.hasOwnOnlyObject(r),i=n.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",i.client=a.client||!1,i.escapeFunction=a.escape||a.escapeFunction||n.escapeXML,i.compileDebug=!1!==a.compileDebug,i.debug=!!a.debug,i.filename=a.filename,i.openDelimiter=a.openDelimiter||e.openDelimiter||"<",i.closeDelimiter=a.closeDelimiter||e.closeDelimiter||">",i.delimiter=a.delimiter||e.delimiter||"%",i.strict=a.strict||!1,i.context=a.context,i.cache=a.cache||!1,i.rmWhitespace=a.rmWhitespace,i.root=a.root,i.includer=a.includer,i.outputFunctionName=a.outputFunctionName,i.localsName=a.localsName||e.localsName||o,i.views=a.views,i.async=a.async,i.destructuredLocals=a.destructuredLocals,i.legacyInclude=void 0===a.legacyInclude||!!a.legacyInclude,i.strict?i._with=!1:i._with=void 0===a._with||a._with,this.opts=i,this.regex=this.createRegex()}e.cache=n.cache,e.fileLoader=t.readFileSync,e.localsName=o,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,n){var a=r.dirname,i=r.extname,c=(0,r.resolve)(n?t:a(t),e);return i(e)||(c+=".ejs"),c},e.compile=function(e,t){return t&&t.scope&&(i||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),i=!0),t.context||(t.context=t.scope),delete t.scope),new b(e,t).compile()},e.render=function(e,t,r){var a=t||n.createNullProtoObjWherePossible(),i=r||n.createNullProtoObjWherePossible();return 2==arguments.length&&n.shallowCopyFromList(i,a,s),m(i,e)(a)},e.renderFile=function(){var t,r,a,i=Array.prototype.slice.call(arguments),c=i.shift(),o={filename:c};return"function"==typeof arguments[arguments.length-1]&&(t=i.pop()),i.length?(r=i.shift(),i.length?n.shallowCopy(o,i.pop()):(r.settings&&(r.settings.views&&(o.views=r.settings.views),r.settings["view cache"]&&(o.cache=!0),(a=r.settings["view options"])&&n.shallowCopy(o,a)),n.shallowCopyFromList(o,r,l)),o.filename=c):r=n.createNullProtoObjWherePossible(),function(t,r,n){var a;if(!n){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,n){try{e(a=m(t)(r))}catch(e){n(e)}}));throw new Error("Please provide a callback function")}try{a=m(t)(r)}catch(e){return n(e)}n(null,a)}(o,r,t)},e.Template=b,e.clearCache=function(){e.cache.reset()},b.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},b.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=n.escapeRegExpChars(this.opts.delimiter),r=n.escapeRegExpChars(this.opts.openDelimiter),a=n.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,a),new RegExp(e)},compile:function(){var e,t,a,i=this.opts,c="",o="",s=i.escapeFunction,l=i.filename?JSON.stringify(i.filename):"undefined";if(!this.source){if(this.generateSource(),c+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',i.outputFunctionName){if(!d.test(i.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");c+=" var "+i.outputFunctionName+" = __append;\n"}if(i.localsName&&!d.test(i.localsName))throw new Error("localsName is not a valid JS identifier.");if(i.destructuredLocals&&i.destructuredLocals.length){for(var u=" var __locals = ("+i.localsName+" || {}),\n",p=0;p0&&(u+=",\n "),u+=m+" = __locals."+m}c+=u+";\n"}!1!==i._with&&(c+=" with ("+i.localsName+" || {}) {\n",o+=" }\n"),o+=" return __output;\n",this.source=c+this.source+o}e=i.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,i.client&&(e="escapeFn = escapeFn || "+s.toString()+";\n"+e,i.compileDebug&&(e="rethrow = rethrow || "+_.toString()+";\n"+e)),i.strict&&(e='"use strict";\n'+e),i.debug&&console.log(e),i.compileDebug&&i.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(i.async)try{a=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else a=Function;t=new a(i.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(i.filename&&(e.message+=" in "+i.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",i.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var f=i.client?t:function(e){return t.apply(i.context,[e||n.createNullProtoObjWherePossible(),s,function(t,r){var a=n.shallowCopy(n.createNullProtoObjWherePossible(),e);return r&&(a=n.shallowCopy(a,r)),h(t,i)(a)},_])};if(i.filename&&"function"==typeof Object.defineProperty){var g=i.filename,b=r.basename(g,r.extname(g));try{Object.defineProperty(f,"name",{value:b,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return f},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),r=this.opts.delimiter,n=this.opts.openDelimiter,a=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(i,c){var o;if(0===i.indexOf(n+r)&&0!==i.indexOf(n+r+r)&&(o=t[c+2])!=r+a&&o!="-"+r+a&&o!="_"+r+a)throw new Error('Could not find matching close tag for "'+i+'".');e.scanLine(i)}))},parseTemplateText:function(){for(var e,t=this.templateText,r=this.regex,n=r.exec(t),a=[];n;)0!==(e=n.index)&&(a.push(t.substring(0,e)),t=t.slice(e)),a.push(n[0]),t=t.slice(n[0].length),n=r.exec(t);return t&&a.push(t),a},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,r=this.opts.delimiter,n=this.opts.openDelimiter,a=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case n+r:case n+r+"_":this.mode=b.modes.EVAL;break;case n+r+"=":this.mode=b.modes.ESCAPED;break;case n+r+"-":this.mode=b.modes.RAW;break;case n+r+"#":this.mode=b.modes.COMMENT;break;case n+r+r:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+r+r,n+r)+'")\n';break;case r+r+a:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+r+a,r+a)+'")\n';break;case r+a:case"-"+r+a:case"_"+r+a:this.mode==b.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case b.modes.EVAL:case b.modes.ESCAPED:case b.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case b.modes.EVAL:this.source+=" ; "+e+"\n";break;case b.modes.ESCAPED:this.source+=" ; __append(escapeFn("+g(e)+"))\n";break;case b.modes.RAW:this.source+=" ; __append("+g(e)+")\n";break;case b.modes.COMMENT:break;case b.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=n.escapeXML,e.__express=e.renderFile,e.VERSION=c,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(n);var S="Invariant failed";function k(e,t){if(!e)throw new Error(S)}const E="cdp_segments",x="$",L=16,A="q",R=[{label:"Relevance",value:""},{label:"Price (low - high)",value:"price+asc"},{label:"Price (high - low)",value:"price+desc"},{label:"Name (A - Z)",value:"title+asc"},{label:"Name (Z - A)",value:"title+desc"}],q=0,O="price",N=4,C=2,I=2,P=5,T=6,F="fq",j="filterpanel",M="groupby",$="page",D="size",U="sort",z="search",V="category",W="keyword",J=".main-content";function B(){const e=`${E}=`;return(document.cookie.split("; ").find((t=>t.startsWith(e)))||"").replace(e,"")}const Q={method:"GET",headers:{"Content-Type":"application/json"}};function H(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const X=(e,t="$",r=!0)=>`${r?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${r?"":` ${t}`}`;const Z="https://core.dxpapi.com/api/v1/core/",G=["_br_uid_2","fq","sort"],Y="pid,title,brand,price,sale_price,thumb_image,sku_thumb_images,sku_swatch_images,sku_color_group,url,price_range,sale_price_range,description,is_live,score,skuid,group";function K(e){const t=Object.assign({},e),r=(null==t?void 0:t.endpoint)||Z;return(null==t?void 0:t.endpoint)&&(null==t||delete t.endpoint),(null==t?void 0:t.fl)||(t.fl=Y),`${r}${n=t,`?${Object.keys(n).reduce(((e,t)=>[...e,`${t}=${G.includes(t)?n[t]:encodeURIComponent(n[t])}`]),[]).join("&")}`}`;var n}async function ee(e){return async function(e,t){const r=await fetch(e,t);return await r.json()}(K(e),Q)}var te='<% if (did_you_mean.length) { %>\n
\n<% } %>\n<% if (locals.keywordRedirect && keywordRedirect.redirected_query && did_you_mean.length === 0) { %>\n
\n
\n

Results for <%- keywordRedirect.redirected_query %>

\n
Redirected from "<%- keywordRedirect.original_query %>"
\n
\n
\n<% } %>\n
\n <% if (config.search.facets_included && facets.length) { %>\n \n <% } %>\n
\n
\n <%\n const haveUngroupedResults = locals.number_of_results && number_of_results > 0;\n const haveGroupedResults = locals.grouped_products && grouped_products.groups.length > 0;\n %>\n <% if (haveUngroupedResults || haveGroupedResults) { %>\n <% if (haveUngroupedResults) { %>\n

\n Showing <%- start + 1 %> - <%- Math.min(start + products.length, number_of_results) %> of <%- number_of_results %> products\n

\n <% } %>\n
\n <% if (config.search.groupby) { %>\n \n \n \n <% config.search.groupby_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n <% } %>\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n \n \n \n <% for (let i = (config.search.groupby ? 4 : 16); i <= (config.search.groupby ? 16 : 48); i += 4) { %>\n \n <% } %>\n \n \n <% } %>\n \n \n \n <% config.search.sorting_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n
\n <% } else if (!(locals.grouped_products) || grouped_products.groups.length < 1) { %>\n

\n No results found\n

\n <% } %>\n\n
\n
class="blm-product-search__results"<% } %>>\n <% if (products.length || (locals.grouped_products && grouped_products.groups.length > 0)) { %>\n %%-PRODUCT_LIST_TEMPLATE-%%\n <% } %>\n
\n\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n
\n
    \n <% paginationData.forEach(paginationNode => { %>\n
  • \n
  • \n <% }) %>\n
\n
\n <% } %>\n
\n
\n',re='<% function printProduct(product) { %>\n
title="<%- product.variant_name %>"<% } %>>\n <%\n const matchingVariant = !Array.isArray(product.variants)\n ? null\n : \'variant_index\' in product\n ? product.variants[product.variant_index]\n : product.variants.find(variant => selectedColors.includes(variant.sku_color_group ? variant.sku_color_group.toLowerCase() : null))\n %>\n
\n <% if (product.variants && product.variants.length > 1) { %>\n <% product.variants.forEach(function(variant, index) { %>\n\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n\n
style="display: block"<% } %>\n >\n \n
\n <% }); %>\n <% } else { %>\n
\n \n
\n <% } %>\n
\n \n\n <% if (product.variants && product.variants.length > 1) { %>\n
    \n <% product.variants.slice(0, defaultMaxColorSwatches || 0).forEach(function(variant, index) { %>\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n \n <% }); %>\n
\n\n <% if (product.variants.length > defaultMaxColorSwatches || 0) { %>\n (Colors) <%- product.variants.length %>\n <% } %>\n <% } %>\n
\n<% } %>\n\n<% if (locals.grouped_products && grouped_products && grouped_products.groups) { %>\n\n <% grouped_products.groups.forEach(group => { %>\n
\n

<%- group.title %>

\n\n
\n <% group.products.forEach(printProduct); %>\n
\n
\n <% }); %>\n\n<% } else { %>\n\n <% products.forEach(printProduct); %>\n\n<% } %>\n';function ne(){const e=function(){const e=window?.bloomreachConnector?.config;return{default_search_parameter:A,url:window.location.href,ref_url:window.location.href,tracking_cookie:H(),format_money:e=>X(e,window.bloomreachDefaultCurrency||x),default_currency:window.bloomreachDefaultCurrency||x,...e}}(),t=new URLSearchParams(window.location.search),r=Ct(),n={display_variants:!1,enabled:!0,endpoint:"",items_per_page:L,facets_included:!0,initial_number_of_facets:P,initial_number_of_facet_values:T,infinite_scroll:!1,selector:J,sorting_options:R,template:te,product_list_template:re,...e?.search?e.search:{}},a={...e,request_type:z,search_type:r.is_category_page?V:W,start:q,"facet.range":O,"stats.field":O,sort:t.get(U)||"",search:{...n,...(r.is_category_page?e.category:e.search)||{},...r.category_to_load?{category_id:r.category_to_load}:{}}};return a.search?.sorting_options?.sort?.(((e,t)=>e.value>t.value?1:-1)),a.search&&(a.search={...a.search,items_per_page:Number(t.has(D)?t.get(D):a.search.items_per_page),groupby:t.get(M)||a.search.groupby||""}),a}function ae(e){return"grouped_products"in e?function(e){const t=Number(e.page||1),r=e.size||1,n=(e?.grouped_products?.groups||[]).length;return[{value:"previous",label:"Previous",disabled:t<=1},{value:"next",label:"Next",disabled:nt+1)).slice(-C),i=Array(n-r).fill(null).map(((e,t)=>t+(r+1))).slice(0,I);return[...r>1?[{value:"previous",label:"←"}]:[],...r-1>C?[{label:"…",value:(r-C-1).toString()}]:[],...a.map((e=>({value:e.toString()}))),{value:r.toString(),disabled:!0,active:!0},...i.map((e=>({value:e.toString()}))),...r+Ie.replace(/"/g,""").replace(/,/g,"%%-COMMA-%%"),ce=e=>Object.keys(e).map((t=>"price"===t?encodeURIComponent(`${t}:[${e[t].map((e=>`${e||"*"}`)).join(" TO ")}]`):encodeURIComponent(`${t}:${e[t].map((e=>`"${(e=>e.replace(/%%-COMMA-%%/g,",").replace(/"/g,'"'))(e)}"`)).join(" OR ")}`))).join("&fq=");function oe(e){let t=0,r=0;const n=ne(),a=Number(e||n.search?.initial_number_of_facets);document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').forEach((e=>{const n=e.querySelectorAll('.blm-product-search-filter-item:not([style*="display: none"]');t0&&e.setAttribute("style","display: block"),t++,r+=n.length>0?1:0}));const i=Ct(),c=document.querySelector(`.blm-load-more-facet--${i.request_id}`);0!==document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').length&&0!==r||c?.classList.add("blm-hide")}function se(){const e=Ct(),t=document.querySelector(`.blm-load-more-facet--${e.request_id}`);return k(t),t}function le(){const e=ne(),t=Number(e.search?.initial_number_of_facets),r=Number(e.search?.initial_number_of_facet_values);[".blm-dynamic-filter",".blm-product-search-filter-item",".blm-product-search-load-more"].forEach((e=>{document.querySelectorAll(e).forEach((e=>{e.removeAttribute("style")}))})),oe(t-1),document.querySelectorAll(`.blm-product-search-filter-item:nth-child(-n+${r})`).forEach((e=>e.style.display="block")),se().removeAttribute("style")}function ue(){const e=ne();k(e.search?.selector);return document.querySelector(e.search.selector)}function de(){const e=document.querySelector(".blm-scroll-indicator");if(e){e.innerHTML="";const t=document.createElement("div");t.classList.add("blm-scroll-indicator__loading"),e.appendChild(t)}}function pe(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox:checked");return e?Array.from(e).reduce(((e,t)=>({...e,[t.name]:e[t.name]?[...e[t.name]||[],t.value]:[t.value]})),{}):{}}var me;!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(me||(me={}));const fe=window.matchMedia(`(max-width: ${me.medium})`);function he(e){const t={};for(const r of e.entries())t[r[0]]=r[1];window.history.pushState(t,document.title,`?${e.toString()}`)}function _e(e,t,r){const n={valueSerializer:e=>e.toString().replace(/"/g,'\\"'),nameValueSeparator:":",...r},a=new URLSearchParams(window.location.search);a.delete(e),Array.isArray(t)?t.forEach((t=>{a.append(e,n.valueSerializer(t))})):Object.keys(t).forEach((r=>{a.append(e,`${r}${n.nameValueSeparator}${n.valueSerializer(t[r])}`)})),he(a)}function ge(e,t){const r=new URLSearchParams(window.location.search);"function"==typeof t?r.set(e,t(r.get(e)).replace(/"/g,'\\"')):""===t?r.delete(e):r.set(e,t.replace(/"/g,'\\"')),he(r)}function be(e){ge(e,(e=>{if(!e)return"2";let t=Number.parseInt(e,10);return(++t).toString()}))}function ve(e){ge(e,(e=>{if(!e)return"1";let t=Number.parseInt(e,10);return(--t).toString()}))}function ye(){const e=Ct(),t=we(),r=document.querySelector(".blm-price-range-input--lower"),n=document.querySelector(".blm-price-range-input--upper");let a=parseFloat(r.value),i=parseFloat(n.value);return a>i&&([a,i]=[i,a]),a===i&&(a>e.price_range_min_value||i({...e,[t.split(":")[0]||""]:(t.split(":")[1]||"").split(",")})),{})}window.matchMedia(`(min-width:${me.medium}) and (max-width: ${me.xlarge})`);var Se=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ke="object"==typeof t&&t&&t.Object===Object&&t,Ee="object"==typeof self&&self&&self.Object===Object&&self,xe=ke||Ee||Function("return this")(),Le=xe,Ae=function(){return Le.Date.now()},Re=/\s/;var qe=function(e){for(var t=e.length;t--&&Re.test(e.charAt(t)););return t},Oe=/^\s+/;var Ne=function(e){return e?e.slice(0,qe(e)+1).replace(Oe,""):e},Ce=xe.Symbol,Ie=Ce,Pe=Object.prototype,Te=Pe.hasOwnProperty,Fe=Pe.toString,je=Ie?Ie.toStringTag:void 0;var Me=function(e){var t=Te.call(e,je),r=e[je];try{e[je]=void 0;var n=!0}catch(e){}var a=Fe.call(e);return n&&(t?e[je]=r:delete e[je]),a},$e=Object.prototype.toString;var De=Me,Ue=function(e){return $e.call(e)},ze=Ce?Ce.toStringTag:void 0;var Ve=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ze&&ze in Object(e)?De(e):Ue(e)},We=function(e){return null!=e&&"object"==typeof e};var Je=Ne,Be=Se,Qe=function(e){return"symbol"==typeof e||We(e)&&"[object Symbol]"==Ve(e)},He=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,Ze=/^0o[0-7]+$/i,Ge=parseInt;var Ye=Se,Ke=Ae,et=function(e){if("number"==typeof e)return e;if(Qe(e))return NaN;if(Be(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Be(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Je(e);var r=Xe.test(e);return r||Ze.test(e)?Ge(e.slice(2),r?2:8):He.test(e)?NaN:+e},tt=Math.max,rt=Math.min;var nt=function(e,t,r){var n,a,i,c,o,s,l=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var r=n,i=a;return n=a=void 0,l=t,c=e.apply(i,r)}function f(e){var r=e-s;return void 0===s||r>=t||r<0||d&&e-l>=i}function h(){var e=Ke();if(f(e))return _(e);o=setTimeout(h,function(e){var r=t-(e-s);return d?rt(r,i-(e-l)):r}(e))}function _(e){return o=void 0,p&&n?m(e):(n=a=void 0,c)}function g(){var e=Ke(),r=f(e);if(n=arguments,a=this,s=e,r){if(void 0===o)return function(e){return l=e,o=setTimeout(h,t),u?m(e):c}(s);if(d)return clearTimeout(o),o=setTimeout(h,t),m(s)}return void 0===o&&(o=setTimeout(h,t)),c}return t=et(t)||0,Ye(r)&&(u=!!r.leading,i=(d="maxWait"in r)?tt(et(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p),g.cancel=function(){void 0!==o&&clearTimeout(o),l=0,n=s=a=o=void 0},g.flush=function(){return void 0===o?c:_(Ke())},g};function at(e){const t=ne();return{...e?.facet_counts?"facets"in e.facet_counts?function(e){return{facets:e.facets?.filter((e=>"text"===e.type||"number"===e.type)).filter((e=>e.value.length)).map(lt)??[],...ut(e.facets),...dt(e.facets)}}(e.facet_counts):function(e,t){return{facets:Object.entries(e.facet_fields||{}).filter((e=>e[1].length)).map(it),...ot(e.facet_ranges),...st(t?.stats_fields?.price),...st(t?.stats_fields?.sale_price)}}(e.facet_counts,e.stats):{facets:[]},products:pt(e.response?.docs||[]),...e?.group_response?{grouped_products:Object.keys(e?.group_response).reduce(((t,r)=>({group_category_id:r,...e.group_response?.[r],groups:e.group_response?.[r]?.groups?.map((e=>({title:e.groupValue,products:pt(e?.doclist?.docs||[])})))||[]})),{})}:{},did_you_mean:e.did_you_mean||[],number_of_results:Number(e.response?.numFound),start:Number(e.response?.start),config:t,...e.keywordRedirect?{keywordRedirect:{original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}}:{}}}function it(e){return{original_title:e[0],title:e[0].replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e[1].map(ct)}}function ct(e){if("name"in e){let t=e.name??"";return"true"===e.name?t="Yes":"false"===e.name&&(t="No"),{count:e.count??0,name:t,id:t}}return{count:e.count??0,name:e.cat_name??"",id:e.cat_id??""}}function ot(e){return e?.price?{priceRanges:e.price.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})))}:{}}function st(e){return e?{maxPrice:e.max,minPrice:e.min}:{}}function lt(e){return{original_title:e.name,title:e.name.replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e.value.map(ct)}}function ut(e){const t=e?.filter((e=>"number_range"===e.type)).find((e=>"price"===e.name.toLowerCase()))?.value.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})));return t?{priceRanges:t}:{}}function dt(e){const t=e?.filter((e=>"number_stats"===e.type)).map((e=>({name:e.name.toLowerCase(),value:e.value}))),r=t?.find((e=>"sale price"===e.name||"sale_price"===e.name))??t?.find((e=>"price"===e.name));return r?.value?{maxPrice:r.value.end,minPrice:r.value.start}:{}}function pt(e){const t=ne();return e.reduce(((e,r)=>[...e,...t.search.display_variants?mt(r):[ft(r)]]),[])}function mt(e){return e.variants&&e.variants.length?(ft(e).variants||[]).map(((t,r)=>({...ft(e),...t,variant_index:r}))):[ft(e)]}function ft(e){return{...e,title:e.title,image:e.thumb_image,link:e.url,id:e.pid,price:e.price,sale_price:e.sale_price,...e.variants?{variants:e.variants.map((e=>({...e,sku_color_group:e.sku_color_group,sku_swatch_images:e.sku_swatch_images,sku_thumb_images:e.sku_thumb_images,sku_sale_price:e.sku_sale_price,sku_price:e.sku_price,image:e.sku_thumb_images&&Array.isArray(e.sku_thumb_images)?e.sku_thumb_images[0]:e.sku_swatch_images[0],variant_name:e.sku_color_group})))}:{}}}function ht(){const e=Ct(),t=document.querySelector(`.blm-range-slider__clear-values-button--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(()=>{de(),_e(F,{...pe()}),ge($,"1"),It({price_range_max_value:0,price_range_min_value:0}),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function _t(){document.querySelectorAll(".blm-product-search-selected-filter__clear").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(e=>{const t=e?.target?.parentNode?.dataset?.filterCheckboxId;t&&document.getElementById(t)?.click()})),e.setAttribute("hasListener","true"))}))}function gt(){const e=document.querySelector(".blm-product-search-selected-filters__clear-all");e&&(e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{de(),_e(F,{...ye()}),ge($,"1"),It({price_range_min_value:0,price_range_max_value:0}),Nt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true")))}function bt(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox");e&&e.forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("change",(()=>{de(),_e(F,{...pe(),...ye()}),ge($,"1"),It({price_range_min_value:0,price_range_max_value:0}),Nt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true"))}))}function vt(){const e=document.querySelector("#blm-product-search-search-filters__input");e&&(e.getAttribute("hasInputListener")||(e.addEventListener("input",nt((e=>{const t=(e?.target?.value||"").trim();document.querySelectorAll(".blm-dynamic-filter").forEach((e=>{let r=0;e.querySelectorAll(".blm-product-search-filter-item").forEach((e=>{const n=e.querySelector("label")?.textContent||"",a=!t||n.toLowerCase().includes(t.toLowerCase()),i=a?"block":"none";r+=a?1:0,e.style.display=i})),e.style.display=r?"block":"none"})),document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.style.display="none"})),se().style.display="none",t||le()}),500)),e.setAttribute("hasInputListener","true")))}function yt(){const e=Ct(),t=document.querySelector(`#groupby-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(M,e?.target?.value),de(),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function wt(){const e=se();e&&!e.getAttribute("hasListener")&&(e.addEventListener("click",(()=>{oe()})),e.setAttribute("hasListener","true"))}function St(){document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(){const e=ne(),t=Number(e.search?.initial_number_of_facet_values);let r=t;const n=t;return e=>{const t=e.target.getAttribute("data-item"),a=document.getElementById(`blm-facet-block-item-${t}`).getElementsByTagName("li");for(let e=r;e=a.length&&(e.target.style.display="none")}}()),e.setAttribute("hasListener","true"))}))}function kt(){const e=Ct(),t=document.querySelector(`#sort-size-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(D,e.target.value),ge($,"1"),de(),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function Et(){const e=Ct(),t=document.querySelector(`.blm-product-search-pagination__pages--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(e=>{de();const t=e.target.dataset.value;if(t){switch(e.target.dataset.value){case"previous":ve($);break;case"next":be($);break;default:ge($,t)}Nt({toReplace:!0}).catch(console.error)}})),t.setAttribute("hasListener","true")))}function xt(){return()=>{de(),_e(F,{...pe(),...ye()}),ge($,"1"),Nt({toReplace:!0}).catch(console.error)}}function Lt(e){const t=ne();return r=>{const n=document.querySelector(e);n&&(n.innerHTML=t.format_money?.(100*Number(r.target.value))??r.target.value)}}function At(){const e=ne();if(e.search?.infinite_scroll&&!document.querySelector(".blm-scroll-indicator")){const t=ue(),r=document.createElement("div");r.classList.add("blm-scroll-indicator");const n=document.createElement("div");n.classList.add("blm-scroll-indicator__loading"),r.appendChild(n),t?.parentNode?.insertBefore(r,t.nextSibling);const a=document.querySelector(".blm-scroll-indicator"),i=new IntersectionObserver(function(e){return t=>{if(t[0].intersectionRatio<=0)return;const r=window?.bloomreachConnector?.config||{},n=r.start||0;r.start=n+e.search.items_per_page,be($),Nt().catch((e=>{r.start=n,ve($),console.error(e)}))}}(e));a&&i.observe(a)}}function Rt(){document.querySelectorAll(".blm-product-search-control-button--sidebar").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{const e=document.querySelector(".blm-product-search-sidebar-content");e?.classList.contains("blm-open")?(e?.classList.remove("blm-open"),document.body.classList.remove("blm-out-of-view"),ge(j,"")):(document.body.classList.add("blm-out-of-view"),e?.classList.add("blm-open"),ge(j,"on"))})),e.setAttribute("hasListener","true"))}))}function qt(){const e=Ct(),t=document.querySelector(`#sort-by-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(U,e?.target?.value),de(),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function Ot(){document.querySelectorAll(".blm-product-search__result").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-container").forEach((t=>{const r=t.querySelectorAll(".blm-product-search-swatch-container__swatch");r.forEach(((t,n)=>{t.getAttribute("hasListener")||(t.addEventListener("mouseover",function(e){const{result:t,swatchItems:r,swatchIndex:n}=e;return e=>{r.forEach((e=>{e.classList.remove("active")})),e.target.classList.add("active"),t.querySelectorAll(".blm-product-search-image-container").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-image").forEach(((e,t)=>{e.style.display="none",n===t&&(e.style.display="block")}))})),t.querySelectorAll(".blm-product-search-details-container__price").forEach(((e,t)=>{e.classList.remove("active"),n===t&&e.classList.add("active")}))}}({result:e,swatchItems:r,swatchIndex:n})),t.setAttribute("hasListener","true"))}))}))}))}async function Nt(e={toReplace:!1}){It({request_id:Math.floor(1e12+9e12*Math.random())});const t=ne(),r=function(){const e=ne(),t=new URLSearchParams(window.location.search),r=Ct(),n={...e.search?.endpoint?{endpoint:e.search.endpoint}:{},...e.search?.groupby?{groupby:e.search.groupby}:{},...e.search?.group_limit?{group_limit:e.search.group_limit}:{},q:t.get(e.default_search_parameter||"")||e.search.category_id||"",rows:e.search?.items_per_page,sort:e?.sort,start:e.start,account_id:e.account_id,domain_key:e.domain_key,request_id:r.request_id,_br_uid_2:e.tracking_cookie,ref_url:e.ref_url,url:e.url,request_type:e.request_type,search_type:e.search_type,fl:e.search?.fields,"facet.range":e["facet.range"],"stats.field":e["stats.field"]},a=t.get($);a&&(e.search.infinite_scroll&&r.is_first_request?(n.start=0,n.rows=Number.parseInt(a,10)*e.search.items_per_page):n.start=(Number.parseInt(a,10)-1)*e.search.items_per_page);const i=we();Object.keys(i).length&&(n.fq=ce(i));for(const[e,r]of t.entries())Object.keys(n).includes(e)||(n[e]=r);const c=B();c&&(n.brSeg=`seg:${c}`,n.segment=`customer_profile:${c}`,n.cdp_segments=c);e.search.force_v3_facets&&(n["facet.version"]="3.0");return n}(),a=await ee(r);if(a?.keywordRedirect)return void function(e){if(e?.keywordRedirect){localStorage.setItem("keywordRedirect",JSON.stringify({original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}));const t=e.keywordRedirect?.["redirected url"]||"";window.location.href=`${t.startsWith("http")?"":"https://"}${t}`}}(a);const i=function(e){const t=ne(),r=at(e),n=JSON.parse(localStorage.getItem("keywordRedirect")||"{}");n?.redirected_query&&(r.keywordRedirect=n,localStorage.removeItem("keywordRedirect"));const a=new URLSearchParams(window.location.search);for(const[e,t]of a.entries())Object.keys(r).includes(e)||(r[e]=t);a.has(D)?r.size=Number.parseInt(a.get(D)||"",10):r.size=Number.parseInt(t.search.items_per_page.toString(),10);r.checkedFacets=we(),r.selectedFilterItems=(r?.facets||[]).reduce(((e,t)=>(t.section.length>0&&t.section.forEach((n=>{r.checkedFacets&&t.original_title in r.checkedFacets&&r.checkedFacets?.[t.original_title]?.includes?.(ie(n.id))&&(e||[]).push({checkbox_id:`${t.original_title}[${ie(n.name)}]`,label:n.name})})),e)),[]);let i=Ct();"minPrice"in r&&"maxPrice"in r&&0===i.price_range_min_value&&0===i.price_range_max_value&&It({price_range_min_value:Math.floor(Number(r.minPrice)),price_range_max_value:Math.ceil(Number(r.maxPrice))});i=Ct(),r.priceRangeFacet={start:i.price_range_min_value,end:i.price_range_max_value},t?.search?.infinite_scroll||(r.paginationData=ae(r));return r.isFiltersPanelOpened=a.has(j),r.defaultMaxColorSwatches=N,r.mobileView=fe,r.escapeSpecialCharacters=ie,r.selectedColors=function(){const e=we();return Object.keys(e).reduce(((t,r)=>("color"===r.toLowerCase()&&(t=(e[r]||[]).map((e=>e.toLowerCase()))),t)),[])}(),r}(a),c=document.querySelector(".blm-scroll-indicator__loading"),o=i?.grouped_products?(i?.grouped_products?.groups||[]).length{t=e},getCurrentSearchRequestState:()=>t,load:async t=>{e&&t&&It({category_to_load:t}),function(){const e=ne();k(e.account_id),k(e.domain_key),k(e.default_search_parameter),k(e?.search?.selector),ue();const t=new URLSearchParams(window.location.search),r=e.search.is_search_page&&t.has(e.default_search_parameter),n=e.search.is_category_page&&(t.has(e.default_search_parameter)||e.search.category_id);return r||n}()&&(function(){const e=B();if(e){(window.br_data||{})[E]=e}}(),function(e){const t={childList:!0,subtree:!0};new MutationObserver((t=>{t.find((e=>"childList"===e.type&&Array.from(e.addedNodes).find((e=>e.classList&&e.classList.contains("blm-results")))))&&e()})).observe(ue(),t)}((()=>{ue().classList.add("blm-has-loaded"),window.onbeforeunload=function(){let e;void 0!==window.pageYOffset?e=window.pageYOffset:void 0!==document.compatMode&&"BackCompat"!==document.compatMode?e=document.documentElement.scrollTop:void 0!==document.body&&(e=document.body.scrollTop);const t=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}");window.localStorage.setItem("scrollPositions",JSON.stringify({...t,[encodeURI(window.location.href)]:{scrollPosition:e}}))},At(),function(){window.onpopstate=async()=>{await Nt({toReplace:!0})},function(){const e=Ct(),t=document.querySelector(`.blm-price-range-input--lower-${e.request_id}`),r=document.querySelector(`.blm-price-range-input--upper-${e.request_id}`);t&&r&&(t.getAttribute("hasListener")||(t.addEventListener("change",xt()),t.addEventListener("input",Lt(".blm-range-slider__values--min")),t.setAttribute("hasListener","true")),r.getAttribute("hasListener")||(r.addEventListener("change",xt()),r.addEventListener("input",Lt(".blm-range-slider__values--max")),r.setAttribute("hasListener","true")))}(),ht(),_t(),gt(),document.querySelector(".blm-product-search-sidebar")&&(Rt(),bt(),wt(),St(),vt(),le());kt(),qt(),yt(),Et(),Ot()}()})),await Nt(),function(){const e=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}"),t=encodeURI(window.location.href);if(t in e){const r=parseInt(e[t]?.scrollPosition,10);setTimeout((()=>{document.documentElement.scrollTop=r,document.body.scrollTop=r}),250)}delete e[encodeURI(window.location.href)],window.localStorage.setItem("scrollPositions",JSON.stringify(e))}())}}}({isCategoryPage:!0});window.BloomreachModules={...e,search:Pt},Pt.load().catch(console.error)}(); //# sourceMappingURL=category.js.map diff --git a/view/frontend/web/js/events.js b/view/frontend/web/js/events.js index 10c72ac..cba464f 100644 --- a/view/frontend/web/js/events.js +++ b/view/frontend/web/js/events.js @@ -1,4 +1,4 @@ -!function(){"use strict";const e=Object.assign(Object.assign({},window.BloomreachModules?window.BloomreachModules:{}),{version:"3.1.1"});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var r=n(Object.freeze({__proto__:null,default:{}}));function i(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return o.exec(e).slice(1)};function s(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function c(e){var t=l(e),n="/"===v(e,-1);return(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function l(e){return"/"===e.charAt(0)}function u(){return c(g(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=s(e).substr(1),t=s(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),o=Math.min(r.length,i.length),a=o,c=0;c":">",'"':""","'":"'"},o=/[&<>'"]/g;function a(e){return i[e]||e}function s(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(o,a)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:s}):e.escapeXML.toString=s}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return o.exec(e).slice(1)};function s(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function c(e){var t=l(e),n="/"===b(e,-1);return(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function l(e){return"/"===e.charAt(0)}function u(){return c(g(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=s(e).substr(1),t=s(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),o=Math.min(r.length,i.length),a=o,c=0;c":">",'"':""","'":"'"},o=/[&<>'"]/g;function a(e){return i[e]||e}function s(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(o,a)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:s}):e.escapeXML.toString=s}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i @@ -6,5 +6,5 @@ * @project EJS * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} */ -var t=r,n=b,i=_,o=!1,a=y,s="locals",c=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=c.concat("cache"),u=/^\uFEFF/,p=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function f(n,r){var i;if(r.some((function(r){return i=e.resolveInclude(n,r,!0),t.existsSync(i)})))return i}function h(t,n){var r,i=t.filename,o=arguments.length>1;if(t.cache){if(!i)throw new Error("cache option requires a filename");if(r=e.cache.get(i))return r;o||(n=d(i).toString().replace(u,""))}else if(!o){if(!i)throw new Error("Internal EJS error: no file name or template provided");n=d(i).toString().replace(u,"")}return r=e.compile(n,t),t.cache&&e.cache.set(i,r),r}function d(t){return e.fileLoader(t)}function m(n,r){var o=i.shallowCopy(i.createNullProtoObjWherePossible(),r);if(o.filename=function(n,r){var i,o,a=r.views,s=/^[A-Za-z]+:\\|^\//.exec(n);if(s&&s.length)n=n.replace(/^\/*/,""),i=Array.isArray(r.root)?f(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(o=e.resolveInclude(n,r.filename),t.existsSync(o)&&(i=o)),!i&&Array.isArray(a)&&(i=f(n,a)),!i&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return i}(n,o),"function"==typeof r.includer){var a=r.includer(n,o.filename);if(a&&(a.filename&&(o.filename=a.filename),a.template))return h(o,a.template)}return h(o)}function g(e,t,n,r,i){var o=t.split("\n"),a=Math.max(r-3,0),s=Math.min(o.length,r+3),c=i(n),l=o.slice(a,s).map((function(e,t){var n=t+a+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=c,e.message=(c||"ejs")+":"+r+"\n"+l+"\n\n"+e.message,e}function v(e){return e.replace(/;(\s*$)/,"$1")}function w(t,n){var r=i.hasOwnOnlyObject(n),o=i.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",o.client=r.client||!1,o.escapeFunction=r.escape||r.escapeFunction||i.escapeXML,o.compileDebug=!1!==r.compileDebug,o.debug=!!r.debug,o.filename=r.filename,o.openDelimiter=r.openDelimiter||e.openDelimiter||"<",o.closeDelimiter=r.closeDelimiter||e.closeDelimiter||">",o.delimiter=r.delimiter||e.delimiter||"%",o.strict=r.strict||!1,o.context=r.context,o.cache=r.cache||!1,o.rmWhitespace=r.rmWhitespace,o.root=r.root,o.includer=r.includer,o.outputFunctionName=r.outputFunctionName,o.localsName=r.localsName||e.localsName||s,o.views=r.views,o.async=r.async,o.destructuredLocals=r.destructuredLocals,o.legacyInclude=void 0===r.legacyInclude||!!r.legacyInclude,o.strict?o._with=!1:o._with=void 0===r._with||r._with,this.opts=o,this.regex=this.createRegex()}e.cache=i.cache,e.fileLoader=t.readFileSync,e.localsName=s,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var i=n.dirname,o=n.extname,a=(0,n.resolve)(r?t:i(t),e);return o(e)||(a+=".ejs"),a},e.compile=function(e,t){return t&&t.scope&&(o||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),o=!0),t.context||(t.context=t.scope),delete t.scope),new w(e,t).compile()},e.render=function(e,t,n){var r=t||i.createNullProtoObjWherePossible(),o=n||i.createNullProtoObjWherePossible();return 2==arguments.length&&i.shallowCopyFromList(o,r,c),h(o,e)(r)},e.renderFile=function(){var t,n,r,o=Array.prototype.slice.call(arguments),a=o.shift(),s={filename:a};return"function"==typeof arguments[arguments.length-1]&&(t=o.pop()),o.length?(n=o.shift(),o.length?i.shallowCopy(s,o.pop()):(n.settings&&(n.settings.views&&(s.views=n.settings.views),n.settings["view cache"]&&(s.cache=!0),(r=n.settings["view options"])&&i.shallowCopy(s,r)),i.shallowCopyFromList(s,n,l)),s.filename=a):n=i.createNullProtoObjWherePossible(),function(t,n,r){var i;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(i=h(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{i=h(t)(n)}catch(e){return r(e)}r(null,i)}(s,n,t)},e.Template=w,e.clearCache=function(){e.cache.reset()},w.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},w.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=i.escapeRegExpChars(this.opts.delimiter),n=i.escapeRegExpChars(this.opts.openDelimiter),r=i.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,r),new RegExp(e)},compile:function(){var e,t,r,o=this.opts,a="",s="",c=o.escapeFunction,l=o.filename?JSON.stringify(o.filename):"undefined";if(!this.source){if(this.generateSource(),a+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',o.outputFunctionName){if(!p.test(o.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");a+=" var "+o.outputFunctionName+" = __append;\n"}if(o.localsName&&!p.test(o.localsName))throw new Error("localsName is not a valid JS identifier.");if(o.destructuredLocals&&o.destructuredLocals.length){for(var u=" var __locals = ("+o.localsName+" || {}),\n",f=0;f0&&(u+=",\n "),u+=h+" = __locals."+h}a+=u+";\n"}!1!==o._with&&(a+=" with ("+o.localsName+" || {}) {\n",s+=" }\n"),s+=" return __output;\n",this.source=a+this.source+s}e=o.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,o.client&&(e="escapeFn = escapeFn || "+c.toString()+";\n"+e,o.compileDebug&&(e="rethrow = rethrow || "+g.toString()+";\n"+e)),o.strict&&(e='"use strict";\n'+e),o.debug&&console.log(e),o.compileDebug&&o.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(o.async)try{r=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else r=Function;t=new r(o.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(o.filename&&(e.message+=" in "+o.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",o.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var d=o.client?t:function(e){return t.apply(o.context,[e||i.createNullProtoObjWherePossible(),c,function(t,n){var r=i.shallowCopy(i.createNullProtoObjWherePossible(),e);return n&&(r=i.shallowCopy(r,n)),m(t,o)(r)},g])};if(o.filename&&"function"==typeof Object.defineProperty){var v=o.filename,b=n.basename(v,n.extname(v));try{Object.defineProperty(d,"name",{value:b,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return d},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(o,a){var s;if(0===o.indexOf(r+n)&&0!==o.indexOf(r+n+n)&&(s=t[a+2])!=n+i&&s!="-"+n+i&&s!="_"+n+i)throw new Error('Could not find matching close tag for "'+o+'".');e.scanLine(o)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),i=[];r;)0!==(e=r.index)&&(i.push(t.substring(0,e)),t=t.slice(e)),i.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&i.push(t),i},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=w.modes.EVAL;break;case r+n+"=":this.mode=w.modes.ESCAPED;break;case r+n+"-":this.mode=w.modes.RAW;break;case r+n+"#":this.mode=w.modes.COMMENT;break;case r+n+n:this.mode=w.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+i:this.mode=w.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+i,n+i)+'")\n';break;case n+i:case"-"+n+i:case"_"+n+i:this.mode==w.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case w.modes.EVAL:case w.modes.ESCAPED:case w.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case w.modes.EVAL:this.source+=" ; "+e+"\n";break;case w.modes.ESCAPED:this.source+=" ; __append(escapeFn("+v(e)+"))\n";break;case w.modes.RAW:this.source+=" ; __append("+v(e)+")\n";break;case w.modes.COMMENT:break;case w.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=i.escapeXML,e.__express=e.renderFile,e.VERSION=a,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}({}),function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(w||(w={})),window.matchMedia(`(max-width: ${w.medium})`),window.matchMedia(`(min-width:${w.medium}) and (max-width: ${w.xlarge})`);var x="object"==typeof t&&t&&t.Object===Object&&t,E="object"==typeof self&&self&&self.Object===Object&&self,O=(x||E||Function("return this")()).Symbol;O&&O.toStringTag;function L(){document.querySelectorAll("[data-blm-add-to-cart]").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(e){const{blmAddToCartSku:t,blmAddToCartProdId:n}=e.dataset;return()=>{var e,r;null===(r=null===(e=window.BrTrk||{})||void 0===e?void 0:e.getTracker())||void 0===r||r.logEvent("cart","click-add",{prod_id:n,sku:t})}}(e)),e.setAttribute("hasListener","true"))}))}function j(){document.querySelectorAll("[data-blm-quickview]").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(e){const{blmQuickviewSku:t,blmQuickviewProdId:n,blmQuickviewProdName:r}=e.dataset;return()=>{var e,i;null===(i=null===(e=window.BrTrk||{})||void 0===e?void 0:e.getTracker())||void 0===i||i.logEvent("product","quickview",{prod_id:n,prod_name:r,sku:t})}}(e)),e.setAttribute("hasListener","true"))}))}O&&O.toStringTag;const A={load:async()=>{L(),j()}};window.BloomreachModules=Object.assign(Object.assign({},e),{events:A}),A.load().catch(console.error)}(); +var t=r,n=_,i=v,o=!1,a=y,s="locals",c=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=c.concat("cache"),u=/^\uFEFF/,p=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function f(n,r){var i;if(r.some((function(r){return i=e.resolveInclude(n,r,!0),t.existsSync(i)})))return i}function h(t,n){var r,i=t.filename,o=arguments.length>1;if(t.cache){if(!i)throw new Error("cache option requires a filename");if(r=e.cache.get(i))return r;o||(n=d(i).toString().replace(u,""))}else if(!o){if(!i)throw new Error("Internal EJS error: no file name or template provided");n=d(i).toString().replace(u,"")}return r=e.compile(n,t),t.cache&&e.cache.set(i,r),r}function d(t){return e.fileLoader(t)}function m(n,r){var o=i.shallowCopy(i.createNullProtoObjWherePossible(),r);if(o.filename=function(n,r){var i,o,a=r.views,s=/^[A-Za-z]+:\\|^\//.exec(n);if(s&&s.length)n=n.replace(/^\/*/,""),i=Array.isArray(r.root)?f(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(o=e.resolveInclude(n,r.filename),t.existsSync(o)&&(i=o)),!i&&Array.isArray(a)&&(i=f(n,a)),!i&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return i}(n,o),"function"==typeof r.includer){var a=r.includer(n,o.filename);if(a&&(a.filename&&(o.filename=a.filename),a.template))return h(o,a.template)}return h(o)}function g(e,t,n,r,i){var o=t.split("\n"),a=Math.max(r-3,0),s=Math.min(o.length,r+3),c=i(n),l=o.slice(a,s).map((function(e,t){var n=t+a+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=c,e.message=(c||"ejs")+":"+r+"\n"+l+"\n\n"+e.message,e}function b(e){return e.replace(/;(\s*$)/,"$1")}function w(t,n){var r=i.hasOwnOnlyObject(n),o=i.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",o.client=r.client||!1,o.escapeFunction=r.escape||r.escapeFunction||i.escapeXML,o.compileDebug=!1!==r.compileDebug,o.debug=!!r.debug,o.filename=r.filename,o.openDelimiter=r.openDelimiter||e.openDelimiter||"<",o.closeDelimiter=r.closeDelimiter||e.closeDelimiter||">",o.delimiter=r.delimiter||e.delimiter||"%",o.strict=r.strict||!1,o.context=r.context,o.cache=r.cache||!1,o.rmWhitespace=r.rmWhitespace,o.root=r.root,o.includer=r.includer,o.outputFunctionName=r.outputFunctionName,o.localsName=r.localsName||e.localsName||s,o.views=r.views,o.async=r.async,o.destructuredLocals=r.destructuredLocals,o.legacyInclude=void 0===r.legacyInclude||!!r.legacyInclude,o.strict?o._with=!1:o._with=void 0===r._with||r._with,this.opts=o,this.regex=this.createRegex()}e.cache=i.cache,e.fileLoader=t.readFileSync,e.localsName=s,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var i=n.dirname,o=n.extname,a=(0,n.resolve)(r?t:i(t),e);return o(e)||(a+=".ejs"),a},e.compile=function(e,t){return t&&t.scope&&(o||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),o=!0),t.context||(t.context=t.scope),delete t.scope),new w(e,t).compile()},e.render=function(e,t,n){var r=t||i.createNullProtoObjWherePossible(),o=n||i.createNullProtoObjWherePossible();return 2==arguments.length&&i.shallowCopyFromList(o,r,c),h(o,e)(r)},e.renderFile=function(){var t,n,r,o=Array.prototype.slice.call(arguments),a=o.shift(),s={filename:a};return"function"==typeof arguments[arguments.length-1]&&(t=o.pop()),o.length?(n=o.shift(),o.length?i.shallowCopy(s,o.pop()):(n.settings&&(n.settings.views&&(s.views=n.settings.views),n.settings["view cache"]&&(s.cache=!0),(r=n.settings["view options"])&&i.shallowCopy(s,r)),i.shallowCopyFromList(s,n,l)),s.filename=a):n=i.createNullProtoObjWherePossible(),function(t,n,r){var i;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(i=h(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{i=h(t)(n)}catch(e){return r(e)}r(null,i)}(s,n,t)},e.Template=w,e.clearCache=function(){e.cache.reset()},w.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},w.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=i.escapeRegExpChars(this.opts.delimiter),n=i.escapeRegExpChars(this.opts.openDelimiter),r=i.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,r),new RegExp(e)},compile:function(){var e,t,r,o=this.opts,a="",s="",c=o.escapeFunction,l=o.filename?JSON.stringify(o.filename):"undefined";if(!this.source){if(this.generateSource(),a+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',o.outputFunctionName){if(!p.test(o.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");a+=" var "+o.outputFunctionName+" = __append;\n"}if(o.localsName&&!p.test(o.localsName))throw new Error("localsName is not a valid JS identifier.");if(o.destructuredLocals&&o.destructuredLocals.length){for(var u=" var __locals = ("+o.localsName+" || {}),\n",f=0;f0&&(u+=",\n "),u+=h+" = __locals."+h}a+=u+";\n"}!1!==o._with&&(a+=" with ("+o.localsName+" || {}) {\n",s+=" }\n"),s+=" return __output;\n",this.source=a+this.source+s}e=o.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,o.client&&(e="escapeFn = escapeFn || "+c.toString()+";\n"+e,o.compileDebug&&(e="rethrow = rethrow || "+g.toString()+";\n"+e)),o.strict&&(e='"use strict";\n'+e),o.debug&&console.log(e),o.compileDebug&&o.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(o.async)try{r=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else r=Function;t=new r(o.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(o.filename&&(e.message+=" in "+o.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",o.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var d=o.client?t:function(e){return t.apply(o.context,[e||i.createNullProtoObjWherePossible(),c,function(t,n){var r=i.shallowCopy(i.createNullProtoObjWherePossible(),e);return n&&(r=i.shallowCopy(r,n)),m(t,o)(r)},g])};if(o.filename&&"function"==typeof Object.defineProperty){var b=o.filename,_=n.basename(b,n.extname(b));try{Object.defineProperty(d,"name",{value:_,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return d},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(o,a){var s;if(0===o.indexOf(r+n)&&0!==o.indexOf(r+n+n)&&(s=t[a+2])!=n+i&&s!="-"+n+i&&s!="_"+n+i)throw new Error('Could not find matching close tag for "'+o+'".');e.scanLine(o)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),i=[];r;)0!==(e=r.index)&&(i.push(t.substring(0,e)),t=t.slice(e)),i.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&i.push(t),i},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=w.modes.EVAL;break;case r+n+"=":this.mode=w.modes.ESCAPED;break;case r+n+"-":this.mode=w.modes.RAW;break;case r+n+"#":this.mode=w.modes.COMMENT;break;case r+n+n:this.mode=w.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+i:this.mode=w.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+i,n+i)+'")\n';break;case n+i:case"-"+n+i:case"_"+n+i:this.mode==w.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case w.modes.EVAL:case w.modes.ESCAPED:case w.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case w.modes.EVAL:this.source+=" ; "+e+"\n";break;case w.modes.ESCAPED:this.source+=" ; __append(escapeFn("+b(e)+"))\n";break;case w.modes.RAW:this.source+=" ; __append("+b(e)+")\n";break;case w.modes.COMMENT:break;case w.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=i.escapeXML,e.__express=e.renderFile,e.VERSION=a,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}({}),function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(w||(w={})),window.matchMedia(`(max-width: ${w.medium})`),window.matchMedia(`(min-width:${w.medium}) and (max-width: ${w.xlarge})`);var x="object"==typeof t&&t&&t.Object===Object&&t,E="object"==typeof self&&self&&self.Object===Object&&self,O=(x||E||Function("return this")()).Symbol;O&&O.toStringTag;function L(){document.querySelectorAll("[data-blm-add-to-cart]").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(e){const{blmAddToCartSku:t,blmAddToCartProdId:n}=e.dataset;return()=>{(window.BrTrk||{})?.getTracker()?.logEvent("cart","click-add",{prod_id:n,sku:t})}}(e)),e.setAttribute("hasListener","true"))}))}function j(){document.querySelectorAll("[data-blm-quickview]").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(e){const{blmQuickviewSku:t,blmQuickviewProdId:n,blmQuickviewProdName:r}=e.dataset;return()=>{(window.BrTrk||{})?.getTracker()?.logEvent("product","quickview",{prod_id:n,prod_name:r,sku:t})}}(e)),e.setAttribute("hasListener","true"))}))}O&&O.toStringTag;const A={load:async()=>{L(),j()}};window.BloomreachModules={...e,events:A},A.load().catch(console.error)}(); //# sourceMappingURL=events.js.map diff --git a/view/frontend/web/js/recommendations.js b/view/frontend/web/js/recommendations.js index 08de0c1..aa16ea4 100644 --- a/view/frontend/web/js/recommendations.js +++ b/view/frontend/web/js/recommendations.js @@ -1,4 +1,4 @@ -!function(){"use strict";const e=Object.assign(Object.assign({},window.BloomreachModules?window.BloomreachModules:{}),{version:"3.1.1"});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,i.get?i:{enumerable:!0,get:function(){return e[t]}})})),n}var i={},r=n(Object.freeze({__proto__:null,default:{}}));function o(e,t){for(var n=0,i=e.length-1;i>=0;i--){var r=e[i];"."===r?e.splice(i,1):".."===r?(e.splice(i,1),n++):n&&(e.splice(i,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return s.exec(e).slice(1)};function c(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var i=n>=0?arguments[n]:"/";if("string"!=typeof i)throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i.charAt(0))}return(t?"/":"")+(e=o(w(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function l(e){var t=u(e),n="/"===b(e,-1);return(e=o(w(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function u(e){return"/"===e.charAt(0)}function d(){return l(w(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=c(e).substr(1),t=c(t).substr(1);for(var i=n(e.split("/")),r=n(t.split("/")),o=Math.min(i.length,r.length),s=o,a=0;a":">",'"':""","'":"'"},o=/[&<>'"]/g;function s(e){return r[e]||e}function a(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(o,s)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:a}):e.escapeXML.toString=a}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)i(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var r=0;r=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var s=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,a=function(e){return s.exec(e).slice(1)};function c(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=o(w(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function l(e){var t=u(e),n="/"===_(e,-1);return(e=o(w(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function u(e){return"/"===e.charAt(0)}function d(){return l(w(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=c(e).substr(1),t=c(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),o=Math.min(r.length,i.length),s=o,a=0;a":">",'"':""","'":"'"},o=/[&<>'"]/g;function s(e){return i[e]||e}function a(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(o,s)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:a}):e.escapeXML.toString=a}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i @@ -6,5 +6,5 @@ * @project EJS * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} */ -var t=r,n=_,i=v,o=!1,s=y,a="locals",c=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=c.concat("cache"),u=/^\uFEFF/,d=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function p(n,i){var r;if(i.some((function(i){return r=e.resolveInclude(n,i,!0),t.existsSync(r)})))return r}function m(t,n){var i,r=t.filename,o=arguments.length>1;if(t.cache){if(!r)throw new Error("cache option requires a filename");if(i=e.cache.get(r))return i;o||(n=f(r).toString().replace(u,""))}else if(!o){if(!r)throw new Error("Internal EJS error: no file name or template provided");n=f(r).toString().replace(u,"")}return i=e.compile(n,t),t.cache&&e.cache.set(r,i),i}function f(t){return e.fileLoader(t)}function h(n,r){var o=i.shallowCopy(i.createNullProtoObjWherePossible(),r);if(o.filename=function(n,i){var r,o,s=i.views,a=/^[A-Za-z]+:\\|^\//.exec(n);if(a&&a.length)n=n.replace(/^\/*/,""),r=Array.isArray(i.root)?p(n,i.root):e.resolveInclude(n,i.root||"/",!0);else if(i.filename&&(o=e.resolveInclude(n,i.filename),t.existsSync(o)&&(r=o)),!r&&Array.isArray(s)&&(r=p(n,s)),!r&&"function"!=typeof i.includer)throw new Error('Could not find the include file "'+i.escapeFunction(n)+'"');return r}(n,o),"function"==typeof r.includer){var s=r.includer(n,o.filename);if(s&&(s.filename&&(o.filename=s.filename),s.template))return m(o,s.template)}return m(o)}function g(e,t,n,i,r){var o=t.split("\n"),s=Math.max(i-3,0),a=Math.min(o.length,i+3),c=r(n),l=o.slice(s,a).map((function(e,t){var n=t+s+1;return(n==i?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=c,e.message=(c||"ejs")+":"+i+"\n"+l+"\n\n"+e.message,e}function w(e){return e.replace(/;(\s*$)/,"$1")}function b(t,n){var r=i.hasOwnOnlyObject(n),o=i.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",o.client=r.client||!1,o.escapeFunction=r.escape||r.escapeFunction||i.escapeXML,o.compileDebug=!1!==r.compileDebug,o.debug=!!r.debug,o.filename=r.filename,o.openDelimiter=r.openDelimiter||e.openDelimiter||"<",o.closeDelimiter=r.closeDelimiter||e.closeDelimiter||">",o.delimiter=r.delimiter||e.delimiter||"%",o.strict=r.strict||!1,o.context=r.context,o.cache=r.cache||!1,o.rmWhitespace=r.rmWhitespace,o.root=r.root,o.includer=r.includer,o.outputFunctionName=r.outputFunctionName,o.localsName=r.localsName||e.localsName||a,o.views=r.views,o.async=r.async,o.destructuredLocals=r.destructuredLocals,o.legacyInclude=void 0===r.legacyInclude||!!r.legacyInclude,o.strict?o._with=!1:o._with=void 0===r._with||r._with,this.opts=o,this.regex=this.createRegex()}e.cache=i.cache,e.fileLoader=t.readFileSync,e.localsName=a,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,i){var r=n.dirname,o=n.extname,s=(0,n.resolve)(i?t:r(t),e);return o(e)||(s+=".ejs"),s},e.compile=function(e,t){return t&&t.scope&&(o||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),o=!0),t.context||(t.context=t.scope),delete t.scope),new b(e,t).compile()},e.render=function(e,t,n){var r=t||i.createNullProtoObjWherePossible(),o=n||i.createNullProtoObjWherePossible();return 2==arguments.length&&i.shallowCopyFromList(o,r,c),m(o,e)(r)},e.renderFile=function(){var t,n,r,o=Array.prototype.slice.call(arguments),s=o.shift(),a={filename:s};return"function"==typeof arguments[arguments.length-1]&&(t=o.pop()),o.length?(n=o.shift(),o.length?i.shallowCopy(a,o.pop()):(n.settings&&(n.settings.views&&(a.views=n.settings.views),n.settings["view cache"]&&(a.cache=!0),(r=n.settings["view options"])&&i.shallowCopy(a,r)),i.shallowCopyFromList(a,n,l)),a.filename=s):n=i.createNullProtoObjWherePossible(),function(t,n,i){var r;if(!i){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,i){try{e(r=m(t)(n))}catch(e){i(e)}}));throw new Error("Please provide a callback function")}try{r=m(t)(n)}catch(e){return i(e)}i(null,r)}(a,n,t)},e.Template=b,e.clearCache=function(){e.cache.reset()},b.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},b.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=i.escapeRegExpChars(this.opts.delimiter),n=i.escapeRegExpChars(this.opts.openDelimiter),r=i.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,r),new RegExp(e)},compile:function(){var e,t,r,o=this.opts,s="",a="",c=o.escapeFunction,l=o.filename?JSON.stringify(o.filename):"undefined";if(!this.source){if(this.generateSource(),s+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',o.outputFunctionName){if(!d.test(o.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");s+=" var "+o.outputFunctionName+" = __append;\n"}if(o.localsName&&!d.test(o.localsName))throw new Error("localsName is not a valid JS identifier.");if(o.destructuredLocals&&o.destructuredLocals.length){for(var u=" var __locals = ("+o.localsName+" || {}),\n",p=0;p0&&(u+=",\n "),u+=m+" = __locals."+m}s+=u+";\n"}!1!==o._with&&(s+=" with ("+o.localsName+" || {}) {\n",a+=" }\n"),a+=" return __output;\n",this.source=s+this.source+a}e=o.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,o.client&&(e="escapeFn = escapeFn || "+c.toString()+";\n"+e,o.compileDebug&&(e="rethrow = rethrow || "+g.toString()+";\n"+e)),o.strict&&(e='"use strict";\n'+e),o.debug&&console.log(e),o.compileDebug&&o.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(o.async)try{r=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else r=Function;t=new r(o.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(o.filename&&(e.message+=" in "+o.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",o.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var f=o.client?t:function(e){return t.apply(o.context,[e||i.createNullProtoObjWherePossible(),c,function(t,n){var r=i.shallowCopy(i.createNullProtoObjWherePossible(),e);return n&&(r=i.shallowCopy(r,n)),h(t,o)(r)},g])};if(o.filename&&"function"==typeof Object.defineProperty){var w=o.filename,b=n.basename(w,n.extname(w));try{Object.defineProperty(f,"name",{value:b,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return f},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,i=this.opts.openDelimiter,r=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(o,s){var a;if(0===o.indexOf(i+n)&&0!==o.indexOf(i+n+n)&&(a=t[s+2])!=n+r&&a!="-"+n+r&&a!="_"+n+r)throw new Error('Could not find matching close tag for "'+o+'".');e.scanLine(o)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,i=n.exec(t),r=[];i;)0!==(e=i.index)&&(r.push(t.substring(0,e)),t=t.slice(e)),r.push(i[0]),t=t.slice(i[0].length),i=n.exec(t);return t&&r.push(t),r},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,i=this.opts.openDelimiter,r=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case i+n:case i+n+"_":this.mode=b.modes.EVAL;break;case i+n+"=":this.mode=b.modes.ESCAPED;break;case i+n+"-":this.mode=b.modes.RAW;break;case i+n+"#":this.mode=b.modes.COMMENT;break;case i+n+n:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(i+n+n,i+n)+'")\n';break;case n+n+r:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+r,n+r)+'")\n';break;case n+r:case"-"+n+r:case"_"+n+r:this.mode==b.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case b.modes.EVAL:case b.modes.ESCAPED:case b.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case b.modes.EVAL:this.source+=" ; "+e+"\n";break;case b.modes.ESCAPED:this.source+=" ; __append(escapeFn("+w(e)+"))\n";break;case b.modes.RAW:this.source+=" ; __append("+w(e)+")\n";break;case b.modes.COMMENT:break;case b.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=i.escapeXML,e.__express=e.renderFile,e.VERSION=s,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(i);const O="cdp_segments",j="customer_profile",x="$",E=16,L="q",S=0;function T(){const e=`${O}=`;return(document.cookie.split("; ").find((t=>t.startsWith(e)))||"").replace(e,"")}async function k(e,t){const n=await fetch(e,t);return await n.json()}const A={method:"GET",headers:{"Content-Type":"application/json"}};function C(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const R=(e,t="$",n=!0)=>`${n?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${n?"":` ${t}`}`;const M="https://pathways.dxpapi.com/api/v2/widgets/",F=["_br_uid_2","fq","sort"],N="pid,price,sale_price,title,thumb_image,url";function P(e){const t=Object.assign({},e),n=`${t.endpoint||M}${t.type}/${t.id}`;return t.endpoint&&delete t.endpoint,t.type&&delete t.type,t.id&&delete t.id,t.fields||(t.fields=N),`${n}${i=t,`?${Object.keys(i).reduce(((e,t)=>[...e,`${t}=${F.includes(t)?i[t]:encodeURIComponent(i[t])}`]),[]).join("&")}`}`;var i}var q,D='
\n <% if (products.length > config.number_of_items_to_show) { %>\n \n \n \n \n \n \n <% } %>\n\n
\n <% products.forEach(function(product) { %>\n
\n
\n \n
\n \n <% if (product.price && product.sale_price) { %>\n

\n <% if (config.format_money) { %>\n <%= config.format_money(product.sale_price.toFixed(2) * 100) %> <%= config.format_money(product.price.toFixed(2) * 100) %>\n <% } else { %>\n <%= config.default_currency %><%= product.sale_price.toFixed(2) %> <%= config.default_currency %><%= product.price.toFixed(2) %>\n <% } %>\n

\n <% } else { %>\n

\n <% if (config.format_money) { %>\n <%= config.format_money(product.price.toFixed(2) * 100) %>\n <% } else { %>\n <%= config.default_currency %><%= product.price.toFixed(2) %>\n <% } %>\n

\n <% } %>\n
\n
\n
\n <% }); %>\n
\n\n <% if (products.length > config.number_of_items_to_show) { %>\n \n \n \n \n \n \n <% } %>\n
\n';function I(){const e=function(){var e;const t=null===(e=null===window||void 0===window?void 0:window.bloomreachConnector)||void 0===e?void 0:e.config;return Object.assign({default_search_parameter:L,url:window.location.href,ref_url:window.location.href,tracking_cookie:C(),format_money:e=>R(e,window.bloomreachDefaultCurrency||x),default_currency:window.bloomreachDefaultCurrency||x},t)}();return Object.assign(Object.assign({},e),{widget:Object.assign({endpoint:"",fields:"",template:D},e.widget)})}!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(q||(q={}));const $=window.matchMedia(`(max-width: ${q.medium})`),W=window.matchMedia(`(min-width:${q.medium}) and (max-width: ${q.xlarge})`);var z="object"==typeof t&&t&&t.Object===Object&&t,B="object"==typeof self&&self&&self.Object===Object&&self,U=(z||B||Function("return this")()).Symbol;U&&U.toStringTag;function J(){V().widgets.forEach((e=>{const t=e.node,n=t.querySelector(".blm-recommendation-widget-content"),{id:i="",type:r="",rid:o=""}=n.dataset;t.querySelectorAll("[data-blm-widget-add-to-cart]").forEach((e=>{var n;const{blmWidgetAddToCartSku:s="",blmWidgetAddToCartProdId:a=""}=e.dataset;e.getAttribute("hasListener")||(e.addEventListener("click",function(e){const t=Object.assign(Object.assign({wrid:e.widgetRid,wid:e.widgetId,wty:e.widgetType,item_id:e.blmWidgetAddToCartProdId},e.query?{wq:e.query}:{}),{sku:e.blmWidgetAddToCartSku});return()=>{var e,n;null===(n=null===(e=window.BrTrk||{})||void 0===e?void 0:e.getTracker())||void 0===n||n.logEvent("cart","widget-add",t)}}({widgetRid:o,widgetId:i,widgetType:r,blmWidgetAddToCartSku:s,blmWidgetAddToCartProdId:a,query:null===(n=null==t?void 0:t.dataset)||void 0===n?void 0:n.query})),e.setAttribute("hasListener","true"))}))}))}function H(){V().widgets.forEach((e=>{const t=e.node,n=t.querySelector(".blm-recommendation-widget-content"),{id:i="",type:r="",rid:o=""}=n.dataset;t.querySelectorAll(".blm-widget-link").forEach((e=>{var n;const s=function(e,t){var n;let i=e;for(;i&&i.parentNode;)if(i=i.parentNode,i&&(null===(n=i.classList)||void 0===n?void 0:n.contains(t)))return i;return null}(e,"blm-recommendation__product"),a=s.dataset.id||"";var c;e.getAttribute("hasListener")||(e.addEventListener("click",(c={widgetRid:o,widgetId:i,widgetType:r,productId:a,query:null===(n=null==t?void 0:t.dataset)||void 0===n?void 0:n.query},()=>{var e,t;const n=Object.assign({wrid:c.widgetRid,wid:c.widgetId,wty:c.widgetType,item_id:c.productId},c.query?{wq:c.query}:{});null===(t=null===(e=window.BrTrk||{})||void 0===e?void 0:e.getTracker())||void 0===t||t.logEvent("widget","widget-click",n,!0)})),e.setAttribute("hasListener","true"))}))}))}function V(){return window.BloomreachModules.pathwaysRecommendations.getCurrentRecommendationsUiState()}function X(){return window.BloomreachModules.pathwaysRecommendations.getCurrentRecommendationsRequestState()}function Z(e){return"keyword"===e.type}function G(e){return"category"===e.type}function K(e){return"item"===e.type}function Q(e){return"personalized"===e.type}U&&U.toStringTag;const Y=function(){let e={request_id:0},t={widgets:[]};return{setCurrentRecommendationsRequestState:t=>{e=t},getCurrentRecommendationsRequestState:()=>e,setCurrentRecommendationsUiState:e=>{t=e},getCurrentRecommendationsUiState:()=>t,load:async()=>{var e;e={request_id:Math.floor(1e12+9e12*Math.random())},window.BloomreachModules.pathwaysRecommendations.setCurrentRecommendationsRequestState(Object.assign(Object.assign({},X()),e)),function(){const e=T();if(e){(window.br_data||{})[j]=e}}(),function(){const e=[];document.querySelectorAll(".blm-recommendations-widget").forEach((t=>{e.push({loaded:!1,node:t})})),function(e){window.BloomreachModules.pathwaysRecommendations.setCurrentRecommendationsUiState(Object.assign(Object.assign({},V()),e))}({widgets:e})}();const t=V().widgets.reduce(((e,t)=>[...e,new Promise(((e,n)=>{try{const n=function(e){var t,n,i,r,o,s,a,c;const l=I(),u=new URLSearchParams(window.location.search),d=X(),p=e.dataset,m=Object.assign(Object.assign(Object.assign({},(null===(t=null==l?void 0:l.widget)||void 0===t?void 0:t.endpoint)?{endpoint:l.widget.endpoint}:{}),(null===(n=null==l?void 0:l.widget)||void 0===n?void 0:n.fields)?{fields:l.widget.fields}:{}),{type:p.type,id:null!==(i=p.id)&&void 0!==i?i:"",account_id:l.account_id,domain_key:l.domain_key,request_id:d.request_id,_br_uid_2:null!==(r=l.tracking_cookie)&&void 0!==r?r:"",ref_url:null!==(o=l.ref_url)&&void 0!==o?o:"",url:null!==(s=l.url)&&void 0!==s?s:"",rows:Number(p.numberOfItemsToFetch)||E,start:S});for(const[e,t]of u.entries())Object.keys(m).includes(e)||(m[e]=t);const f=T();f&&(m.brSeg=`seg:${f}`,m.segment=`customer_profile:${f}`,m.cdp_segments=f);if(Z(m))m.query=null!==(a=p.query)&&void 0!==a?a:"";else if(G(m))m.cat_id=null!==(c=p.categoryId)&&void 0!==c?c:"";else if(K(m))m.item_ids=p.itemIds;else if(Q(m))m.user_id=p.userId;else if(!function(e){return"global"===e.type}(m))throw new Error(`Invalid widget type: "${p.type}"`);return m}(t.node);let i;i=Z(n)?async function(e){return k(P(Object.assign(Object.assign({},e),{type:"keyword"})),A)}(n):G(n)?async function(e){return k(P(Object.assign(Object.assign({},e),{type:"category"})),A)}(n):K(n)?async function(e){return k(P(Object.assign(Object.assign({},e),{type:"item"})),A)}(n):Q(n)?async function(e){return k(P(Object.assign(Object.assign({},e),{type:"personalized"})),A)}(n):async function(e){return k(P(Object.assign(Object.assign({},e),{type:"global"})),A)}(n),e(i)}catch(e){n(e)}})).then((e=>{var n;const r=t.node,o=I(),s=(a=e,{config:I(),products:[...a.response.docs?a.response.docs.map((e=>Object.assign(Object.assign({},e),{id:e.pid,image:e.thumb_image,title:e.title,link:e.url,sale_price:e.sale_price,price:e.price}))):[]],widgetMetadata:a.metadata.widget});var a;const c=r.dataset;return s.config.number_of_items_to_show=Number(c.numberOfItemsToShow),r.innerHTML=i.render((null===(n=o.widget)||void 0===n?void 0:n.template)||"",s),function(e){var t,n;const i=e.querySelector(".blm-recommendation-widget-content"),{id:r="",type:o="",rid:s=""}=i.dataset,a=Object.assign({wrid:s,wid:r,wty:o},e.dataset.query?{wq:e.dataset.query}:{});null===(n=null===(t=window.BrTrk||{})||void 0===t?void 0:t.getTracker())||void 0===n||n.logEvent("widget","widget-view",a,!0)}(r),r.classList.add("blm-widget-loaded"),{widgetElement:r,templateData:s}}))]),[]),n=await Promise.all(t).catch(console.error);J(),H(),(n||[]).forEach((e=>{!function(e,t){const n=e.querySelector(".blm-carousel-previous"),i=e.querySelector(".blm-carousel-next"),r=e.querySelectorAll(".blm-recommendation__product"),o=Number($.matches?1:W.matches?2:t.config.number_of_items_to_show),s=Math.ceil(r.length/o);let a=0;if(r.length){const t=e.querySelector(".blm-recommendation__products"),n=window.getComputedStyle(t);a=Number(n.width.replace("px",""))/o}let c=0;const l=a,u=(r.length-o)*a,d=()=>{var e,t,o,s;"0px"===(null===(t=null===(e=null==r?void 0:r[0])||void 0===e?void 0:e.style)||void 0===t?void 0:t.left)?null==n||n.classList.add("blm-invisible"):null==n||n.classList.remove("blm-invisible"),(null===(s=null===(o=null==r?void 0:r[0])||void 0===o?void 0:o.style)||void 0===s?void 0:s.left)===`-${u}px`?null==i||i.classList.add("blm-invisible"):null==i||i.classList.remove("blm-invisible")},p=()=>{c+=l,1===r.length&&(c=0);for(const e of r)c>u&&(c-=l),e.style.left=`-${c}px`;d()},m=()=>{c-=l,c<=0&&(c=0);for(const e of r)s>1&&(e.style.left=`-${c}px`);d()};null!==n&&null!==i&&(n.addEventListener("click",(()=>{m()})),i.addEventListener("click",(()=>{p()})))}(e.widgetElement,e.templateData)}))}}}();window.BloomreachModules=Object.assign(Object.assign({},e),{pathwaysRecommendations:Y}),Y.load().catch(console.error)}(); +var t=i,n=b,r=y,o=!1,s=v,a="locals",c=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=c.concat("cache"),u=/^\uFEFF/,d=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function p(n,r){var i;if(r.some((function(r){return i=e.resolveInclude(n,r,!0),t.existsSync(i)})))return i}function m(t,n){var r,i=t.filename,o=arguments.length>1;if(t.cache){if(!i)throw new Error("cache option requires a filename");if(r=e.cache.get(i))return r;o||(n=f(i).toString().replace(u,""))}else if(!o){if(!i)throw new Error("Internal EJS error: no file name or template provided");n=f(i).toString().replace(u,"")}return r=e.compile(n,t),t.cache&&e.cache.set(i,r),r}function f(t){return e.fileLoader(t)}function h(n,i){var o=r.shallowCopy(r.createNullProtoObjWherePossible(),i);if(o.filename=function(n,r){var i,o,s=r.views,a=/^[A-Za-z]+:\\|^\//.exec(n);if(a&&a.length)n=n.replace(/^\/*/,""),i=Array.isArray(r.root)?p(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(o=e.resolveInclude(n,r.filename),t.existsSync(o)&&(i=o)),!i&&Array.isArray(s)&&(i=p(n,s)),!i&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return i}(n,o),"function"==typeof i.includer){var s=i.includer(n,o.filename);if(s&&(s.filename&&(o.filename=s.filename),s.template))return m(o,s.template)}return m(o)}function g(e,t,n,r,i){var o=t.split("\n"),s=Math.max(r-3,0),a=Math.min(o.length,r+3),c=i(n),l=o.slice(s,a).map((function(e,t){var n=t+s+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=c,e.message=(c||"ejs")+":"+r+"\n"+l+"\n\n"+e.message,e}function w(e){return e.replace(/;(\s*$)/,"$1")}function _(t,n){var i=r.hasOwnOnlyObject(n),o=r.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",o.client=i.client||!1,o.escapeFunction=i.escape||i.escapeFunction||r.escapeXML,o.compileDebug=!1!==i.compileDebug,o.debug=!!i.debug,o.filename=i.filename,o.openDelimiter=i.openDelimiter||e.openDelimiter||"<",o.closeDelimiter=i.closeDelimiter||e.closeDelimiter||">",o.delimiter=i.delimiter||e.delimiter||"%",o.strict=i.strict||!1,o.context=i.context,o.cache=i.cache||!1,o.rmWhitespace=i.rmWhitespace,o.root=i.root,o.includer=i.includer,o.outputFunctionName=i.outputFunctionName,o.localsName=i.localsName||e.localsName||a,o.views=i.views,o.async=i.async,o.destructuredLocals=i.destructuredLocals,o.legacyInclude=void 0===i.legacyInclude||!!i.legacyInclude,o.strict?o._with=!1:o._with=void 0===i._with||i._with,this.opts=o,this.regex=this.createRegex()}e.cache=r.cache,e.fileLoader=t.readFileSync,e.localsName=a,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var i=n.dirname,o=n.extname,s=(0,n.resolve)(r?t:i(t),e);return o(e)||(s+=".ejs"),s},e.compile=function(e,t){return t&&t.scope&&(o||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),o=!0),t.context||(t.context=t.scope),delete t.scope),new _(e,t).compile()},e.render=function(e,t,n){var i=t||r.createNullProtoObjWherePossible(),o=n||r.createNullProtoObjWherePossible();return 2==arguments.length&&r.shallowCopyFromList(o,i,c),m(o,e)(i)},e.renderFile=function(){var t,n,i,o=Array.prototype.slice.call(arguments),s=o.shift(),a={filename:s};return"function"==typeof arguments[arguments.length-1]&&(t=o.pop()),o.length?(n=o.shift(),o.length?r.shallowCopy(a,o.pop()):(n.settings&&(n.settings.views&&(a.views=n.settings.views),n.settings["view cache"]&&(a.cache=!0),(i=n.settings["view options"])&&r.shallowCopy(a,i)),r.shallowCopyFromList(a,n,l)),a.filename=s):n=r.createNullProtoObjWherePossible(),function(t,n,r){var i;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(i=m(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{i=m(t)(n)}catch(e){return r(e)}r(null,i)}(a,n,t)},e.Template=_,e.clearCache=function(){e.cache.reset()},_.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},_.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=r.escapeRegExpChars(this.opts.delimiter),n=r.escapeRegExpChars(this.opts.openDelimiter),i=r.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,i),new RegExp(e)},compile:function(){var e,t,i,o=this.opts,s="",a="",c=o.escapeFunction,l=o.filename?JSON.stringify(o.filename):"undefined";if(!this.source){if(this.generateSource(),s+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',o.outputFunctionName){if(!d.test(o.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");s+=" var "+o.outputFunctionName+" = __append;\n"}if(o.localsName&&!d.test(o.localsName))throw new Error("localsName is not a valid JS identifier.");if(o.destructuredLocals&&o.destructuredLocals.length){for(var u=" var __locals = ("+o.localsName+" || {}),\n",p=0;p0&&(u+=",\n "),u+=m+" = __locals."+m}s+=u+";\n"}!1!==o._with&&(s+=" with ("+o.localsName+" || {}) {\n",a+=" }\n"),a+=" return __output;\n",this.source=s+this.source+a}e=o.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,o.client&&(e="escapeFn = escapeFn || "+c.toString()+";\n"+e,o.compileDebug&&(e="rethrow = rethrow || "+g.toString()+";\n"+e)),o.strict&&(e='"use strict";\n'+e),o.debug&&console.log(e),o.compileDebug&&o.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(o.async)try{i=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else i=Function;t=new i(o.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(o.filename&&(e.message+=" in "+o.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",o.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var f=o.client?t:function(e){return t.apply(o.context,[e||r.createNullProtoObjWherePossible(),c,function(t,n){var i=r.shallowCopy(r.createNullProtoObjWherePossible(),e);return n&&(i=r.shallowCopy(i,n)),h(t,o)(i)},g])};if(o.filename&&"function"==typeof Object.defineProperty){var w=o.filename,_=n.basename(w,n.extname(w));try{Object.defineProperty(f,"name",{value:_,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return f},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(o,s){var a;if(0===o.indexOf(r+n)&&0!==o.indexOf(r+n+n)&&(a=t[s+2])!=n+i&&a!="-"+n+i&&a!="_"+n+i)throw new Error('Could not find matching close tag for "'+o+'".');e.scanLine(o)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),i=[];r;)0!==(e=r.index)&&(i.push(t.substring(0,e)),t=t.slice(e)),i.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&i.push(t),i},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=_.modes.EVAL;break;case r+n+"=":this.mode=_.modes.ESCAPED;break;case r+n+"-":this.mode=_.modes.RAW;break;case r+n+"#":this.mode=_.modes.COMMENT;break;case r+n+n:this.mode=_.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+i:this.mode=_.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+i,n+i)+'")\n';break;case n+i:case"-"+n+i:case"_"+n+i:this.mode==_.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case _.modes.EVAL:case _.modes.ESCAPED:case _.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case _.modes.EVAL:this.source+=" ; "+e+"\n";break;case _.modes.ESCAPED:this.source+=" ; __append(escapeFn("+w(e)+"))\n";break;case _.modes.RAW:this.source+=" ; __append("+w(e)+")\n";break;case _.modes.COMMENT:break;case _.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=r.escapeXML,e.__express=e.renderFile,e.VERSION=s,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(r);const x="cdp_segments",E="customer_profile",O="$",L=16,S="q",j=0;function A(){const e=`${x}=`;return(document.cookie.split("; ").find((t=>t.startsWith(e)))||"").replace(e,"")}async function T(e,t){const n=await fetch(e,t);return await n.json()}const k={method:"GET",headers:{"Content-Type":"application/json"}};function C(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const R=(e,t="$",n=!0)=>`${n?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${n?"":` ${t}`}`;const M="https://pathways.dxpapi.com/api/v2/widgets/",F=["_br_uid_2","fq","sort"],P="pid,price,sale_price,title,thumb_image,url";function N(e){const t=Object.assign({},e),n=`${t.endpoint||M}${t.type}/${t.id}`;return t.endpoint&&delete t.endpoint,t.type&&delete t.type,t.id&&delete t.id,t.fields||(t.fields=P),`${n}${r=t,`?${Object.keys(r).reduce(((e,t)=>[...e,`${t}=${F.includes(t)?r[t]:encodeURIComponent(r[t])}`]),[]).join("&")}`}`;var r}var q,D='
\n <% if (products.length > config.number_of_items_to_show) { %>\n \n \n \n \n \n \n <% } %>\n\n
\n <% products.forEach(function(product) { %>\n
\n
\n
\n \n \n \n
\n
\n \n <% if (product.price && product.sale_price) { %>\n

\n <% if (config.format_money) { %>\n <%= config.format_money(product.sale_price.toFixed(2) * 100) %> <%= config.format_money(product.price.toFixed(2) * 100) %>\n <% } else { %>\n <%= config.default_currency %><%= product.sale_price.toFixed(2) %> <%= config.default_currency %><%= product.price.toFixed(2) %>\n <% } %>\n

\n <% } else { %>\n

\n <% if (config.format_money) { %>\n <%= config.format_money(product.price.toFixed(2) * 100) %>\n <% } else { %>\n <%= config.default_currency %><%= product.price.toFixed(2) %>\n <% } %>\n

\n <% } %>\n
\n
\n
\n <% }); %>\n
\n\n <% if (products.length > config.number_of_items_to_show) { %>\n \n \n \n \n \n \n <% } %>\n
\n';function I(){const e=function(){const e=window?.bloomreachConnector?.config;return{default_search_parameter:S,url:window.location.href,ref_url:window.location.href,tracking_cookie:C(),format_money:e=>R(e,window.bloomreachDefaultCurrency||O),default_currency:window.bloomreachDefaultCurrency||O,...e}}();return{...e,widget:{endpoint:"",fields:"",template:D,...e?.widget??{}}}}!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(q||(q={}));const $=window.matchMedia(`(max-width: ${q.medium})`),W=window.matchMedia(`(min-width:${q.medium}) and (max-width: ${q.xlarge})`);function z(e){return e?.replaceAll(""",'"').split(/&(?!#\d+;|#x[\da-fA-F]+;|[a-zA-Z]+;)/).reduce(((e,t)=>{const n=t.indexOf("=");if(n>0){const r=t.slice(0,n),i=t.slice(n+1);e[r]=i}return e}),{})??{}}var B="object"==typeof t&&t&&t.Object===Object&&t,U="object"==typeof self&&self&&self.Object===Object&&self,J=(B||U||Function("return this")()).Symbol;J&&J.toStringTag;function H(){X().widgets.forEach((e=>{const t=e.node,n=t.querySelector(".blm-recommendation-widget-content"),{id:r="",type:i="",rid:o=""}=n.dataset;t.querySelectorAll("[data-blm-widget-add-to-cart]").forEach((e=>{const{blmWidgetAddToCartSku:n="",blmWidgetAddToCartProdId:s=""}=e.dataset;e.getAttribute("hasListener")||(e.addEventListener("click",function(e){const t={wrid:e.widgetRid,wid:e.widgetId,wty:e.widgetType,item_id:e.blmWidgetAddToCartProdId,...e.query?{wq:e.query}:{},sku:e.blmWidgetAddToCartSku};return()=>{(window.BrTrk||{})?.getTracker()?.logEvent("cart","widget-add",t)}}({widgetRid:o,widgetId:r,widgetType:i,blmWidgetAddToCartSku:n,blmWidgetAddToCartProdId:s,query:t?.dataset?.query})),e.setAttribute("hasListener","true"))}))}))}function V(){X().widgets.forEach((e=>{const t=e.node,n=t.querySelector(".blm-recommendation-widget-content"),{id:r="",type:i="",rid:o=""}=n.dataset;t.querySelectorAll(".blm-widget-link").forEach((e=>{const n=function(e,t){let n=e;for(;n&&n.parentElement;)if(n=n.parentElement,n&&n.classList?.contains(t))return n;return console.warn(`CSS class '${t}' not found in ancestors of ${e.nodeName}`),null}(e,"blm-recommendation__product").dataset.id||"";var s;e.getAttribute("hasListener")||(e.addEventListener("click",(s={widgetRid:o,widgetId:r,widgetType:i,productId:n,query:t?.dataset?.query},()=>{const e={wrid:s.widgetRid,wid:s.widgetId,wty:s.widgetType,item_id:s.productId,...s.query?{wq:s.query}:{}};(window.BrTrk||{})?.getTracker()?.logEvent("widget","widget-click",e,!0)})),e.setAttribute("hasListener","true"))}))}))}function X(){return window.BloomreachModules.pathwaysRecommendations.getCurrentRecommendationsUiState()}function Z(){return window.BloomreachModules.pathwaysRecommendations.getCurrentRecommendationsRequestState()}function G(e){return"keyword"===e.type}function K(e){return"category"===e.type}function Q(e){return"item"===e.type}function Y(e){return"personalized"===e.type}J&&J.toStringTag;const ee=function(){let e={request_id:0},t={widgets:[]};return{setCurrentRecommendationsRequestState:t=>{e=t},getCurrentRecommendationsRequestState:()=>e,setCurrentRecommendationsUiState:e=>{t=e},getCurrentRecommendationsUiState:()=>t,load:async()=>{var e;e={request_id:Math.floor(1e12+9e12*Math.random())},window.BloomreachModules.pathwaysRecommendations.setCurrentRecommendationsRequestState({...Z(),...e}),function(){const e=A();if(e){(window.br_data||{})[E]=e}}(),function(){const e=[];document.querySelectorAll(".blm-recommendations-widget").forEach((t=>{e.push({loaded:!1,node:t})})),function(e){window.BloomreachModules.pathwaysRecommendations.setCurrentRecommendationsUiState({...X(),...e})}({widgets:e})}();const t=X().widgets.reduce(((e,t)=>[...e,new Promise(((e,n)=>{try{const n=function(e){const t=I(),n=new URLSearchParams(window.location.search),r=Z(),{id:i,type:o,categoryId:s,query:a,itemIds:c,userId:l,numberOfItemsToFetch:u,additionalParams:d}=e.dataset,p={...t?.widget?.endpoint?{endpoint:t.widget.endpoint}:{},...t?.widget?.fields?{fields:t.widget.fields}:{},type:o,id:i??"",account_id:t.account_id,domain_key:t.domain_key,request_id:r.request_id,_br_uid_2:t.tracking_cookie??"",ref_url:t.ref_url??"",url:t.url??"",rows:Number(u)||L,start:j,...z(d)};for(const[e,t]of n.entries())Object.keys(p).includes(e)||(p[e]=t);const m=A();m&&(p.brSeg=`seg:${m}`,p.segment=`customer_profile:${m}`,p.cdp_segments=m);if(G(p))p.query=a??"";else if(K(p))p.cat_id=s??"";else if(Q(p))p.item_ids=c;else if(Y(p))p.user_id=l;else if(!function(e){return"global"===e.type}(p))throw new Error(`Invalid widget type: "${o}"`);return p}(t.node);let r;r=G(n)?async function(e){return T(N(Object.assign(Object.assign({},e),{type:"keyword"})),k)}(n):K(n)?async function(e){return T(N(Object.assign(Object.assign({},e),{type:"category"})),k)}(n):Q(n)?async function(e){return T(N(Object.assign(Object.assign({},e),{type:"item"})),k)}(n):Y(n)?async function(e){return T(N(Object.assign(Object.assign({},e),{type:"personalized"})),k)}(n):async function(e){return T(N(Object.assign(Object.assign({},e),{type:"global"})),k)}(n),e(r)}catch(e){n(e)}})).then((e=>{const n=t.node,i=I(),o=(s=e,{config:I(),products:[...s.response.docs?s.response.docs.map((e=>({...e,id:e.pid,image:e.thumb_image,title:e.title,link:e.url,sale_price:e.sale_price,price:e.price}))):[]],widgetMetadata:s.metadata.widget});var s;const a=n.dataset;return o.config.number_of_items_to_show=Number(a.numberOfItemsToShow),n.innerHTML=r.render(i.widget?.template||"",o),function(e){const t=e.querySelector(".blm-recommendation-widget-content"),{id:n="",type:r="",rid:i=""}=t.dataset,o={wrid:i,wid:n,wty:r,...e.dataset.query?{wq:e.dataset.query}:{}};(window.BrTrk||{})?.getTracker()?.logEvent("widget","widget-view",o,!0)}(n),n.classList.add("blm-widget-loaded"),{widgetElement:n,templateData:o}}))]),[]),n=await Promise.all(t).catch(console.error);H(),V(),(n||[]).forEach((e=>{!function(e,t){const n=e.querySelector(".blm-carousel-previous"),r=e.querySelector(".blm-carousel-next"),i=e.querySelectorAll(".blm-recommendation__product"),o=Number($.matches?1:W.matches?2:t.config.number_of_items_to_show),s=Math.ceil(i.length/o);let a=0;if(i.length){const t=e.querySelector(".blm-recommendation__products"),n=window.getComputedStyle(t);a=Number(n.width.replace("px",""))/o}let c=0;const l=a,u=(i.length-o)*a,d=()=>{"0px"===i?.[0]?.style?.left?n?.classList.add("blm-invisible"):n?.classList.remove("blm-invisible"),i?.[0]?.style?.left===`-${u}px`?r?.classList.add("blm-invisible"):r?.classList.remove("blm-invisible")},p=()=>{c+=l,1===i.length&&(c=0);for(const e of i)c>u&&(c-=l),e.style.left=`-${c}px`;d()},m=()=>{c-=l,c<=0&&(c=0);for(const e of i)s>1&&(e.style.left=`-${c}px`);d()};null!==n&&null!==r&&(n.addEventListener("click",(()=>{m()})),r.addEventListener("click",(()=>{p()})))}(e.widgetElement,e.templateData)}))}}}();window.BloomreachModules={...e,pathwaysRecommendations:ee},ee.load().catch(console.error)}(); //# sourceMappingURL=recommendations.js.map diff --git a/view/frontend/web/js/search.js b/view/frontend/web/js/search.js index 218565e..83d902a 100644 --- a/view/frontend/web/js/search.js +++ b/view/frontend/web/js/search.js @@ -1,4 +1,4 @@ -!function(){"use strict";const e=Object.assign(Object.assign({},window.BloomreachModules?window.BloomreachModules:{}),{version:"3.1.1"});var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function n(e){var t=e.default;if("function"==typeof t){var n=function(){return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var r={},i=n(Object.freeze({__proto__:null,default:{}}));function a(e,t){for(var n=0,r=e.length-1;r>=0;r--){var i=e[r];"."===i?e.splice(r,1):".."===i?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var o=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,c=function(e){return o.exec(e).slice(1)};function s(){for(var e="",t=!1,n=arguments.length-1;n>=-1&&!t;n--){var r=n>=0?arguments[n]:"/";if("string"!=typeof r)throw new TypeError("Arguments to path.resolve must be strings");r&&(e=r+"/"+e,t="/"===r.charAt(0))}return(t?"/":"")+(e=a(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function l(e){var t=u(e),n="/"===v(e,-1);return(e=a(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&n&&(e+="/"),(t?"/":"")+e}function u(e){return"/"===e.charAt(0)}function d(){return l(g(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function n(e){for(var t=0;t=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}e=s(e).substr(1),t=s(t).substr(1);for(var r=n(e.split("/")),i=n(t.split("/")),a=Math.min(r.length,i.length),o=a,c=0;c":">",'"':""","'":"'"},a=/[&<>'"]/g;function o(e){return i[e]||e}function c(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(a,o)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:c}):e.escapeXML.toString=c}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var n in t)r(t,n)&&"__proto__"!==n&&"constructor"!==n&&(e[n]=t[n]);return e},e.shallowCopyFromList=function(e,t,n){if(n=n||[],t=t||{},null!=e)for(var i=0;i=0;n--){var a=e[n];"."===a?e.splice(n,1):".."===a?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}var c=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/,o=function(e){return c.exec(e).slice(1)};function s(){for(var e="",t=!1,r=arguments.length-1;r>=-1&&!t;r--){var n=r>=0?arguments[r]:"/";if("string"!=typeof n)throw new TypeError("Arguments to path.resolve must be strings");n&&(e=n+"/"+e,t="/"===n.charAt(0))}return(t?"/":"")+(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||"."}function l(e){var t=u(e),r="/"===b(e,-1);return(e=i(g(e.split("/"),(function(e){return!!e})),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e}function u(e){return"/"===e.charAt(0)}function d(){return l(g(Array.prototype.slice.call(arguments,0),(function(e,t){if("string"!=typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))}function p(e,t){function r(e){for(var t=0;t=0&&""===e[r];r--);return t>r?[]:e.slice(t,r-t+1)}e=s(e).substr(1),t=s(t).substr(1);for(var n=r(e.split("/")),a=r(t.split("/")),i=Math.min(n.length,a.length),c=i,o=0;o":">",'"':""","'":"'"},i=/[&<>'"]/g;function c(e){return a[e]||e}function o(){return Function.prototype.toString.call(this)+';\nvar _ENCODE_HTML_RULES = {\n "&": "&"\n , "<": "<"\n , ">": ">"\n , \'"\': """\n , "\'": "'"\n }\n , _MATCH_HTML = /[&<>\'"]/g;\nfunction encode_char(c) {\n return _ENCODE_HTML_RULES[c] || c;\n};\n'}e.escapeXML=function(e){return null==e?"":String(e).replace(i,c)};try{"function"==typeof Object.defineProperty?Object.defineProperty(e.escapeXML,"toString",{value:o}):e.escapeXML.toString=o}catch(e){console.warn("Unable to set escapeXML.toString (is the Function prototype frozen?)")}e.shallowCopy=function(e,t){if(t=t||{},null!=e)for(var r in t)n(t,r)&&"__proto__"!==r&&"constructor"!==r&&(e[r]=t[r]);return e},e.shallowCopyFromList=function(e,t,r){if(r=r||[],t=t||{},null!=e)for(var a=0;a @@ -6,5 +6,5 @@ * @project EJS * @license {@link http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0} */ -var t=i,n=b,r=y,a=!1,o=w,c="locals",s=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=s.concat("cache"),u=/^\uFEFF/,d=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function p(n,r){var i;if(r.some((function(r){return i=e.resolveInclude(n,r,!0),t.existsSync(i)})))return i}function m(t,n){var r,i=t.filename,a=arguments.length>1;if(t.cache){if(!i)throw new Error("cache option requires a filename");if(r=e.cache.get(i))return r;a||(n=f(i).toString().replace(u,""))}else if(!a){if(!i)throw new Error("Internal EJS error: no file name or template provided");n=f(i).toString().replace(u,"")}return r=e.compile(n,t),t.cache&&e.cache.set(i,r),r}function f(t){return e.fileLoader(t)}function h(n,i){var a=r.shallowCopy(r.createNullProtoObjWherePossible(),i);if(a.filename=function(n,r){var i,a,o=r.views,c=/^[A-Za-z]+:\\|^\//.exec(n);if(c&&c.length)n=n.replace(/^\/*/,""),i=Array.isArray(r.root)?p(n,r.root):e.resolveInclude(n,r.root||"/",!0);else if(r.filename&&(a=e.resolveInclude(n,r.filename),t.existsSync(a)&&(i=a)),!i&&Array.isArray(o)&&(i=p(n,o)),!i&&"function"!=typeof r.includer)throw new Error('Could not find the include file "'+r.escapeFunction(n)+'"');return i}(n,a),"function"==typeof i.includer){var o=i.includer(n,a.filename);if(o&&(o.filename&&(a.filename=o.filename),o.template))return m(a,o.template)}return m(a)}function _(e,t,n,r,i){var a=t.split("\n"),o=Math.max(r-3,0),c=Math.min(a.length,r+3),s=i(n),l=a.slice(o,c).map((function(e,t){var n=t+o+1;return(n==r?" >> ":" ")+n+"| "+e})).join("\n");throw e.path=s,e.message=(s||"ejs")+":"+r+"\n"+l+"\n\n"+e.message,e}function g(e){return e.replace(/;(\s*$)/,"$1")}function v(t,n){var i=r.hasOwnOnlyObject(n),a=r.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",a.client=i.client||!1,a.escapeFunction=i.escape||i.escapeFunction||r.escapeXML,a.compileDebug=!1!==i.compileDebug,a.debug=!!i.debug,a.filename=i.filename,a.openDelimiter=i.openDelimiter||e.openDelimiter||"<",a.closeDelimiter=i.closeDelimiter||e.closeDelimiter||">",a.delimiter=i.delimiter||e.delimiter||"%",a.strict=i.strict||!1,a.context=i.context,a.cache=i.cache||!1,a.rmWhitespace=i.rmWhitespace,a.root=i.root,a.includer=i.includer,a.outputFunctionName=i.outputFunctionName,a.localsName=i.localsName||e.localsName||c,a.views=i.views,a.async=i.async,a.destructuredLocals=i.destructuredLocals,a.legacyInclude=void 0===i.legacyInclude||!!i.legacyInclude,a.strict?a._with=!1:a._with=void 0===i._with||i._with,this.opts=a,this.regex=this.createRegex()}e.cache=r.cache,e.fileLoader=t.readFileSync,e.localsName=c,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,r){var i=n.dirname,a=n.extname,o=(0,n.resolve)(r?t:i(t),e);return a(e)||(o+=".ejs"),o},e.compile=function(e,t){return t&&t.scope&&(a||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),a=!0),t.context||(t.context=t.scope),delete t.scope),new v(e,t).compile()},e.render=function(e,t,n){var i=t||r.createNullProtoObjWherePossible(),a=n||r.createNullProtoObjWherePossible();return 2==arguments.length&&r.shallowCopyFromList(a,i,s),m(a,e)(i)},e.renderFile=function(){var t,n,i,a=Array.prototype.slice.call(arguments),o=a.shift(),c={filename:o};return"function"==typeof arguments[arguments.length-1]&&(t=a.pop()),a.length?(n=a.shift(),a.length?r.shallowCopy(c,a.pop()):(n.settings&&(n.settings.views&&(c.views=n.settings.views),n.settings["view cache"]&&(c.cache=!0),(i=n.settings["view options"])&&r.shallowCopy(c,i)),r.shallowCopyFromList(c,n,l)),c.filename=o):n=r.createNullProtoObjWherePossible(),function(t,n,r){var i;if(!r){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,r){try{e(i=m(t)(n))}catch(e){r(e)}}));throw new Error("Please provide a callback function")}try{i=m(t)(n)}catch(e){return r(e)}r(null,i)}(c,n,t)},e.Template=v,e.clearCache=function(){e.cache.reset()},v.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},v.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=r.escapeRegExpChars(this.opts.delimiter),n=r.escapeRegExpChars(this.opts.openDelimiter),i=r.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,i),new RegExp(e)},compile:function(){var e,t,i,a=this.opts,o="",c="",s=a.escapeFunction,l=a.filename?JSON.stringify(a.filename):"undefined";if(!this.source){if(this.generateSource(),o+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',a.outputFunctionName){if(!d.test(a.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");o+=" var "+a.outputFunctionName+" = __append;\n"}if(a.localsName&&!d.test(a.localsName))throw new Error("localsName is not a valid JS identifier.");if(a.destructuredLocals&&a.destructuredLocals.length){for(var u=" var __locals = ("+a.localsName+" || {}),\n",p=0;p0&&(u+=",\n "),u+=m+" = __locals."+m}o+=u+";\n"}!1!==a._with&&(o+=" with ("+a.localsName+" || {}) {\n",c+=" }\n"),c+=" return __output;\n",this.source=o+this.source+c}e=a.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,a.client&&(e="escapeFn = escapeFn || "+s.toString()+";\n"+e,a.compileDebug&&(e="rethrow = rethrow || "+_.toString()+";\n"+e)),a.strict&&(e='"use strict";\n'+e),a.debug&&console.log(e),a.compileDebug&&a.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(a.async)try{i=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else i=Function;t=new i(a.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(a.filename&&(e.message+=" in "+a.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",a.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var f=a.client?t:function(e){return t.apply(a.context,[e||r.createNullProtoObjWherePossible(),s,function(t,n){var i=r.shallowCopy(r.createNullProtoObjWherePossible(),e);return n&&(i=r.shallowCopy(i,n)),h(t,a)(i)},_])};if(a.filename&&"function"==typeof Object.defineProperty){var g=a.filename,v=n.basename(g,n.extname(g));try{Object.defineProperty(f,"name",{value:v,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return f},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(a,o){var c;if(0===a.indexOf(r+n)&&0!==a.indexOf(r+n+n)&&(c=t[o+2])!=n+i&&c!="-"+n+i&&c!="_"+n+i)throw new Error('Could not find matching close tag for "'+a+'".');e.scanLine(a)}))},parseTemplateText:function(){for(var e,t=this.templateText,n=this.regex,r=n.exec(t),i=[];r;)0!==(e=r.index)&&(i.push(t.substring(0,e)),t=t.slice(e)),i.push(r[0]),t=t.slice(r[0].length),r=n.exec(t);return t&&i.push(t),i},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,n=this.opts.delimiter,r=this.opts.openDelimiter,i=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case r+n:case r+n+"_":this.mode=v.modes.EVAL;break;case r+n+"=":this.mode=v.modes.ESCAPED;break;case r+n+"-":this.mode=v.modes.RAW;break;case r+n+"#":this.mode=v.modes.COMMENT;break;case r+n+n:this.mode=v.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+n+n,r+n)+'")\n';break;case n+n+i:this.mode=v.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+n+i,n+i)+'")\n';break;case n+i:case"-"+n+i:case"_"+n+i:this.mode==v.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case v.modes.EVAL:case v.modes.ESCAPED:case v.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case v.modes.EVAL:this.source+=" ; "+e+"\n";break;case v.modes.ESCAPED:this.source+=" ; __append(escapeFn("+g(e)+"))\n";break;case v.modes.RAW:this.source+=" ; __append("+g(e)+")\n";break;case v.modes.COMMENT:break;case v.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=r.escapeXML,e.__express=e.renderFile,e.VERSION=o,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(r);var S="Invariant failed";function k(e,t){if(!e)throw new Error(S)}const E="cdp_segments",x="$",O=16,L="q",j=[{label:"Relevance",value:""},{label:"Price (low - high)",value:"price+asc"},{label:"Price (high - low)",value:"price+desc"},{label:"Name (A - Z)",value:"title+asc"},{label:"Name (Z - A)",value:"title+desc"}],A=0,R="price",q=4,N=2,C=2,I=5,P=6,T="fq",F="filterpanel",M="groupby",$="page",D="size",U="sort",z="search",V="category",W="keyword",J=".main-content";function B(){const e=`${E}=`;return(document.cookie.split("; ").find((t=>t.startsWith(e)))||"").replace(e,"")}const Q={method:"GET",headers:{"Content-Type":"application/json"}};function H(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const X=(e,t="$",n=!0)=>`${n?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${n?"":` ${t}`}`;const Z="https://core.dxpapi.com/api/v1/core/",G=["_br_uid_2","fq","sort"],Y="pid,title,brand,price,sale_price,thumb_image,sku_thumb_images,sku_swatch_images,sku_color_group,url,price_range,sale_price_range,description,is_live,score,skuid,group";function K(e){const t=Object.assign({},e),n=(null==t?void 0:t.endpoint)||Z;return(null==t?void 0:t.endpoint)&&(null==t||delete t.endpoint),(null==t?void 0:t.fl)||(t.fl=Y),`${n}${r=t,`?${Object.keys(r).reduce(((e,t)=>[...e,`${t}=${G.includes(t)?r[t]:encodeURIComponent(r[t])}`]),[]).join("&")}`}`;var r}async function ee(e){return async function(e,t){const n=await fetch(e,t);return await n.json()}(K(e),Q)}var te='<% if (did_you_mean.length) { %>\n
\n
\n

Results for\n <% if (locals.keywordRedirect && keywordRedirect.redirected_url) { %>\n <%- keywordRedirect.redirected_url %>\n <% } else { %>\n <%- did_you_mean[0] %>\n <% } %>\n instead of <%- locals[config.default_search_parameter] %>

\n
\n \n <% did_you_mean.forEach(function(word) { %>\n <%- word %>\n <% }); %>\n
\n <% if (locals.keywordRedirect && keywordRedirect.redirected_query) { %>\n
Redirected from "<%- keywordRedirect.redirected_query %>".
\n <% } %>\n
\n
\n<% } %>\n<% if (locals.keywordRedirect && keywordRedirect.redirected_query && did_you_mean.length === 0) { %>\n
\n
\n

Results for <%- keywordRedirect.redirected_query %>

\n
Redirected from "<%- keywordRedirect.original_query %>"
\n
\n
\n<% } %>\n
\n <% if (config.search.facets_included && facets.length) { %>\n \n <% } %>\n
\n
\n <%\n const haveUngroupedResults = locals.number_of_results && number_of_results > 0;\n const haveGroupedResults = locals.grouped_products && grouped_products.groups.length > 0;\n %>\n <% if (haveUngroupedResults || haveGroupedResults) { %>\n <% if (haveUngroupedResults) { %>\n

\n Showing <%- start + 1 %> - <%- Math.min(start + products.length, number_of_results) %> of <%- number_of_results %> products\n

\n <% } %>\n
\n <% if (config.search.groupby) { %>\n \n \n \n <% config.search.groupby_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n <% } %>\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n \n \n \n <% for (let i = (config.search.groupby ? 4 : 16); i <= (config.search.groupby ? 16 : 48); i += 4) { %>\n \n <% } %>\n \n \n <% } %>\n \n \n \n <% config.search.sorting_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n
\n <% } else if (!(locals.grouped_products) || grouped_products.groups.length < 1) { %>\n

\n No results found\n

\n <% } %>\n\n
\n
class="blm-product-search__results"<% } %>>\n <% if (products.length || (locals.grouped_products && grouped_products.groups.length > 0)) { %>\n %%-PRODUCT_LIST_TEMPLATE-%%\n <% } %>\n
\n\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n
\n
    \n <% paginationData.forEach(paginationNode => { %>\n
  • \n
  • \n <% }) %>\n
\n
\n <% } %>\n
\n
\n',ne='<% function printProduct(product) { %>\n
title="<%- product.variant_name %>"<% } %>>\n <%\n const matchingVariant = !Array.isArray(product.variants)\n ? null\n : \'variant_index\' in product\n ? product.variants[product.variant_index]\n : product.variants.find(variant => selectedColors.includes(variant.sku_color_group ? variant.sku_color_group.toLowerCase() : null))\n %>\n
\n <% if (product.variants && product.variants.length > 1) { %>\n <% product.variants.forEach(function(variant, index) { %>\n\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n\n
style="display: block"<% } %>\n >\n \n
\n <% }); %>\n <% } else { %>\n
\n \n
\n <% } %>\n
\n \n\n <% if (product.variants && product.variants.length > 1) { %>\n
    \n <% product.variants.slice(0, defaultMaxColorSwatches || 0).forEach(function(variant, index) { %>\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n \n <% }); %>\n
\n\n <% if (product.variants.length > defaultMaxColorSwatches || 0) { %>\n (Colors) <%- product.variants.length %>\n <% } %>\n <% } %>\n
\n<% } %>\n\n<% if (locals.grouped_products && grouped_products && grouped_products.groups) { %>\n\n <% grouped_products.groups.forEach(group => { %>\n
\n

<%- group.title %>

\n\n
\n <% group.products.forEach(printProduct); %>\n
\n
\n <% }); %>\n\n<% } else { %>\n\n <% products.forEach(printProduct); %>\n\n<% } %>\n';function re(){var e,t,n;const r=function(){var e;const t=null===(e=null===window||void 0===window?void 0:window.bloomreachConnector)||void 0===e?void 0:e.config;return Object.assign({default_search_parameter:L,url:window.location.href,ref_url:window.location.href,tracking_cookie:H(),format_money:e=>X(e,window.bloomreachDefaultCurrency||x),default_currency:window.bloomreachDefaultCurrency||x},t)}(),i=new URLSearchParams(window.location.search),a=At(),o=Object.assign({display_variants:!1,enabled:!0,endpoint:"",items_per_page:O,facets_included:!0,initial_number_of_facets:I,initial_number_of_facet_values:P,infinite_scroll:!1,selector:J,sorting_options:j,template:te,product_list_template:ne},(null==r?void 0:r.search)?r.search:{}),c=Object.assign(Object.assign({},r),{request_type:z,search_type:a.is_category_page?V:W,start:A,"facet.range":R,"stats.field":R,sort:i.get(U)||"",search:Object.assign(Object.assign(Object.assign({},o),(a.is_category_page?r.category:r.search)||{}),a.category_to_load?{category_id:a.category_to_load}:{})});return null===(n=null===(t=null===(e=c.search)||void 0===e?void 0:e.sorting_options)||void 0===t?void 0:t.sort)||void 0===n||n.call(t,((e,t)=>e.value>t.value?1:-1)),c.search&&(c.search=Object.assign(Object.assign({},c.search),{items_per_page:Number(i.has(D)?i.get(D):c.search.items_per_page),groupby:i.get(M)||c.search.groupby||""})),c}function ie(e){return"grouped_products"in e?function(e){var t;const n=Number(e.page||1),r=e.size||1,i=((null===(t=null==e?void 0:e.grouped_products)||void 0===t?void 0:t.groups)||[]).length;return[{value:"previous",label:"Previous",disabled:n<=1},{value:"next",label:"Next",disabled:it+1)).slice(-N),a=Array(r-n).fill(null).map(((e,t)=>t+(n+1))).slice(0,C);return[...n>1?[{value:"previous",label:"←"}]:[],...n-1>N?[{label:"…",value:(n-N-1).toString()}]:[],...i.map((e=>({value:e.toString()}))),{value:n.toString(),disabled:!0,active:!0},...a.map((e=>({value:e.toString()}))),...n+Ce.replace(/"/g,""").replace(/,/g,"%%-COMMA-%%"),oe=e=>Object.keys(e).map((t=>"price"===t?encodeURIComponent(`${t}:[${e[t].map((e=>`${e||"*"}`)).join(" TO ")}]`):encodeURIComponent(`${t}:${e[t].map((e=>`"${(e=>e.replace(/%%-COMMA-%%/g,",").replace(/"/g,'"'))(e)}"`)).join(" OR ")}`))).join("&fq=");function ce(e){var t;let n=0,r=0;const i=re(),a=Number(e||(null===(t=i.search)||void 0===t?void 0:t.initial_number_of_facets));document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').forEach((e=>{const t=e.querySelectorAll('.blm-product-search-filter-item:not([style*="display: none"]');n0&&e.setAttribute("style","display: block"),n++,r+=t.length>0?1:0}));const o=At(),c=document.querySelector(`.blm-load-more-facet--${o.request_id}`);0!==document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').length&&0!==r||null==c||c.classList.add("blm-hide")}function se(){const e=At(),t=document.querySelector(`.blm-load-more-facet--${e.request_id}`);return k(t),t}function le(){var e,t;const n=re(),r=Number(null===(e=n.search)||void 0===e?void 0:e.initial_number_of_facets),i=Number(null===(t=n.search)||void 0===t?void 0:t.initial_number_of_facet_values);[".blm-dynamic-filter",".blm-product-search-filter-item",".blm-product-search-load-more"].forEach((e=>{document.querySelectorAll(e).forEach((e=>{e.removeAttribute("style")}))})),ce(r-1),document.querySelectorAll(`.blm-product-search-filter-item:nth-child(-n+${i})`).forEach((e=>e.style.display="block")),se().removeAttribute("style")}function ue(){var e;const t=re();k(null===(e=t.search)||void 0===e?void 0:e.selector);return document.querySelector(t.search.selector)}function de(){const e=document.querySelector(".blm-scroll-indicator");if(e){e.innerHTML="";const t=document.createElement("div");t.classList.add("blm-scroll-indicator__loading"),e.appendChild(t)}}function pe(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox:checked");return e?Array.from(e).reduce(((e,t)=>Object.assign(Object.assign({},e),{[t.name]:e[t.name]?[...e[t.name]||[],t.value]:[t.value]})),{}):{}}var me;!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(me||(me={}));const fe=window.matchMedia(`(max-width: ${me.medium})`);function he(e){const t={};for(const n of e.entries())t[n[0]]=n[1];window.history.pushState(t,document.title,`?${e.toString()}`)}function _e(e,t,n){const r=Object.assign(Object.assign({},{valueSerializer:e=>e.toString().replace(/"/g,'\\"'),nameValueSeparator:":"}),n),i=new URLSearchParams(window.location.search);i.delete(e),Array.isArray(t)?t.forEach((t=>{i.append(e,r.valueSerializer(t))})):Object.keys(t).forEach((n=>{i.append(e,`${n}${r.nameValueSeparator}${r.valueSerializer(t[n])}`)})),he(i)}function ge(e,t){const n=new URLSearchParams(window.location.search);"function"==typeof t?n.set(e,t(n.get(e)).replace(/"/g,'\\"')):""===t?n.delete(e):n.set(e,t.replace(/"/g,'\\"')),he(n)}function ve(e){ge(e,(e=>{if(!e)return"2";let t=Number.parseInt(e,10);return(++t).toString()}))}function be(e){ge(e,(e=>{if(!e)return"1";let t=Number.parseInt(e,10);return(--t).toString()}))}function ye(){const e=At(),t=we(),n=document.querySelector(".blm-price-range-input--lower"),r=document.querySelector(".blm-price-range-input--upper");let i=parseFloat(n.value),a=parseFloat(r.value);return i>a&&([i,a]=[a,i]),i===a&&(i>e.price_range_min_value||aObject.assign(Object.assign({},e),{[t.split(":")[0]||""]:(t.split(":")[1]||"").split(",")})),{})}window.matchMedia(`(min-width:${me.medium}) and (max-width: ${me.xlarge})`);var Se=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ke="object"==typeof t&&t&&t.Object===Object&&t,Ee="object"==typeof self&&self&&self.Object===Object&&self,xe=ke||Ee||Function("return this")(),Oe=xe,Le=function(){return Oe.Date.now()},je=/\s/;var Ae=function(e){for(var t=e.length;t--&&je.test(e.charAt(t)););return t},Re=/^\s+/;var qe=function(e){return e?e.slice(0,Ae(e)+1).replace(Re,""):e},Ne=xe.Symbol,Ce=Ne,Ie=Object.prototype,Pe=Ie.hasOwnProperty,Te=Ie.toString,Fe=Ce?Ce.toStringTag:void 0;var Me=function(e){var t=Pe.call(e,Fe),n=e[Fe];try{e[Fe]=void 0;var r=!0}catch(e){}var i=Te.call(e);return r&&(t?e[Fe]=n:delete e[Fe]),i},$e=Object.prototype.toString;var De=Me,Ue=function(e){return $e.call(e)},ze=Ne?Ne.toStringTag:void 0;var Ve=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ze&&ze in Object(e)?De(e):Ue(e)},We=function(e){return null!=e&&"object"==typeof e};var Je=qe,Be=Se,Qe=function(e){return"symbol"==typeof e||We(e)&&"[object Symbol]"==Ve(e)},He=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,Ze=/^0o[0-7]+$/i,Ge=parseInt;var Ye=Se,Ke=Le,et=function(e){if("number"==typeof e)return e;if(Qe(e))return NaN;if(Be(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Be(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Je(e);var n=Xe.test(e);return n||Ze.test(e)?Ge(e.slice(2),n?2:8):He.test(e)?NaN:+e},tt=Math.max,nt=Math.min;var rt=function(e,t,n){var r,i,a,o,c,s,l=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n)}function f(e){var n=e-s;return void 0===s||n>=t||n<0||d&&e-l>=a}function h(){var e=Ke();if(f(e))return _(e);c=setTimeout(h,function(e){var n=t-(e-s);return d?nt(n,a-(e-l)):n}(e))}function _(e){return c=void 0,p&&r?m(e):(r=i=void 0,o)}function g(){var e=Ke(),n=f(e);if(r=arguments,i=this,s=e,n){if(void 0===c)return function(e){return l=e,c=setTimeout(h,t),u?m(e):o}(s);if(d)return clearTimeout(c),c=setTimeout(h,t),m(s)}return void 0===c&&(c=setTimeout(h,t)),o}return t=et(t)||0,Ye(n)&&(u=!!n.leading,a=(d="maxWait"in n)?tt(et(n.maxWait)||0,t):a,p="trailing"in n?!!n.trailing:p),g.cancel=function(){void 0!==c&&clearTimeout(c),l=0,r=s=i=c=void 0},g.flush=function(){return void 0===c?o:_(Ke())},g};function it(e){var t,n,r;const i=re(),a=(null==e?void 0:e.facet_counts)?"facets"in e.facet_counts?function(e){var t,n;return Object.assign(Object.assign({facets:null!==(n=null===(t=e.facets)||void 0===t?void 0:t.filter((e=>"text"===e.type||"number"===e.type)).filter((e=>e.value.length)).map(st))&&void 0!==n?n:[]},function(e){var t;const n=null===(t=null==e?void 0:e.filter((e=>"number_range"===e.type)).find((e=>"price"===e.name.toLowerCase())))||void 0===t?void 0:t.value.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})));return n?{priceRanges:n}:{}}(e.facets)),function(e){var t;const n=null==e?void 0:e.filter((e=>"number_stats"===e.type)).map((e=>({name:e.name.toLowerCase(),value:e.value}))),r=null!==(t=null==n?void 0:n.find((e=>"sale price"===e.name||"sale_price"===e.name)))&&void 0!==t?t:null==n?void 0:n.find((e=>"price"===e.name));return(null==r?void 0:r.value)?{maxPrice:r.value.end,minPrice:r.value.start}:{}}(e.facets))}(e.facet_counts):function(e,t){var n,r;return Object.assign(Object.assign(Object.assign({facets:Object.entries(e.facet_fields||{}).filter((e=>e[1].length)).map(at)},function(e){if(null==e?void 0:e.price)return{priceRanges:e.price.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})))};return{}}(e.facet_ranges)),ct(null===(n=null==t?void 0:t.stats_fields)||void 0===n?void 0:n.price)),ct(null===(r=null==t?void 0:t.stats_fields)||void 0===r?void 0:r.sale_price))}(e.facet_counts,e.stats):{facets:[]};return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},a),{products:lt((null===(t=e.response)||void 0===t?void 0:t.docs)||[])}),(null==e?void 0:e.group_response)?{grouped_products:Object.keys(null==e?void 0:e.group_response).reduce(((t,n)=>{var r,i,a,o;return Object.assign(Object.assign({group_category_id:n},null===(r=e.group_response)||void 0===r?void 0:r[n]),{groups:(null===(o=null===(a=null===(i=e.group_response)||void 0===i?void 0:i[n])||void 0===a?void 0:a.groups)||void 0===o?void 0:o.map((e=>{var t;return{title:e.groupValue,products:lt((null===(t=null==e?void 0:e.doclist)||void 0===t?void 0:t.docs)||[])}})))||[]})}),{})}:{}),{did_you_mean:e.did_you_mean||[],number_of_results:Number(null===(n=e.response)||void 0===n?void 0:n.numFound),start:Number(null===(r=e.response)||void 0===r?void 0:r.start),config:i}),e.keywordRedirect?{keywordRedirect:{original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}}:{})}function at(e){return{original_title:e[0],title:e[0].replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e[1].map(ot)}}function ot(e){var t,n,r,i,a;if("name"in e){let r=null!==(t=e.name)&&void 0!==t?t:"";return"true"===e.name?r="Yes":"false"===e.name&&(r="No"),{count:null!==(n=e.count)&&void 0!==n?n:0,name:r,id:r}}return{count:null!==(r=e.count)&&void 0!==r?r:0,name:null!==(i=e.cat_name)&&void 0!==i?i:"",id:null!==(a=e.cat_id)&&void 0!==a?a:""}}function ct(e){return e?{maxPrice:e.max,minPrice:e.min}:{}}function st(e){return{original_title:e.name,title:e.name.replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e.value.map(ot)}}function lt(e){const t=re();return e.reduce(((e,n)=>[...e,...t.search.display_variants?ut(n):[dt(n)]]),[])}function ut(e){return e.variants&&e.variants.length?(dt(e).variants||[]).map(((t,n)=>Object.assign(Object.assign(Object.assign({},dt(e)),t),{variant_index:n}))):[dt(e)]}function dt(e){return Object.assign(Object.assign(Object.assign({},e),{title:e.title,image:e.thumb_image,link:e.url,id:e.pid,price:e.price,sale_price:e.sale_price}),e.variants?{variants:e.variants.map((e=>Object.assign(Object.assign({},e),{sku_color_group:e.sku_color_group,sku_swatch_images:e.sku_swatch_images,sku_thumb_images:e.sku_thumb_images,sku_sale_price:e.sku_sale_price,sku_price:e.sku_price,image:e.sku_thumb_images&&Array.isArray(e.sku_thumb_images)?e.sku_thumb_images[0]:e.sku_swatch_images[0],variant_name:e.sku_color_group})))}:{})}function pt(){const e=At(),t=document.querySelector(`.blm-range-slider__clear-values-button--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(()=>{de(),_e(T,Object.assign({},pe())),ge($,"1"),Rt({price_range_max_value:0,price_range_min_value:0}),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function mt(){document.querySelectorAll(".blm-product-search-selected-filter__clear").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(e=>{var t,n,r,i;const a=null===(r=null===(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.parentNode)||void 0===n?void 0:n.dataset)||void 0===r?void 0:r.filterCheckboxId;a&&(null===(i=document.getElementById(a))||void 0===i||i.click())})),e.setAttribute("hasListener","true"))}))}function ft(){const e=document.querySelector(".blm-product-search-selected-filters__clear-all");e&&(e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{de(),_e(T,Object.assign({},ye())),ge($,"1"),Rt({price_range_min_value:0,price_range_max_value:0}),jt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true")))}function ht(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox");e&&e.forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("change",(()=>{de(),_e(T,Object.assign(Object.assign({},pe()),ye())),ge($,"1"),Rt({price_range_min_value:0,price_range_max_value:0}),jt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true"))}))}function _t(){const e=document.querySelector("#blm-product-search-search-filters__input");e&&(e.getAttribute("hasInputListener")||(e.addEventListener("input",rt((e=>{var t;const n=((null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)||"").trim();document.querySelectorAll(".blm-dynamic-filter").forEach((e=>{let t=0;e.querySelectorAll(".blm-product-search-filter-item").forEach((e=>{var r;const i=(null===(r=e.querySelector("label"))||void 0===r?void 0:r.textContent)||"",a=!n||i.toLowerCase().includes(n.toLowerCase()),o=a?"block":"none";t+=a?1:0,e.style.display=o})),e.style.display=t?"block":"none"})),document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.style.display="none"})),se().style.display="none",n||le()}),500)),e.setAttribute("hasInputListener","true")))}function gt(){const e=At(),t=document.querySelector(`#groupby-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{var t;ge(M,null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),de(),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function vt(){const e=se();e&&!e.getAttribute("hasListener")&&(e.addEventListener("click",(()=>{ce()})),e.setAttribute("hasListener","true"))}function bt(){document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(){var e;const t=re(),n=Number(null===(e=t.search)||void 0===e?void 0:e.initial_number_of_facet_values);let r=n;const i=n;return e=>{const t=e.target.getAttribute("data-item"),n=document.getElementById(`blm-facet-block-item-${t}`).getElementsByTagName("li");for(let e=r;e=n.length&&(e.target.style.display="none")}}()),e.setAttribute("hasListener","true"))}))}function yt(){const e=At(),t=document.querySelector(`#sort-size-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(D,e.target.value),ge($,"1"),de(),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function wt(){const e=At(),t=document.querySelector(`.blm-product-search-pagination__pages--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(e=>{de();const t=e.target.dataset.value;if(t){switch(e.target.dataset.value){case"previous":be($);break;case"next":ve($);break;default:ge($,t)}jt({toReplace:!0}).catch(console.error)}})),t.setAttribute("hasListener","true")))}function St(){return()=>{de(),_e(T,Object.assign(Object.assign({},pe()),ye())),ge($,"1"),jt({toReplace:!0}).catch(console.error)}}function kt(e){const t=re();return n=>{var r,i;const a=document.querySelector(e);a&&(a.innerHTML=null!==(i=null===(r=t.format_money)||void 0===r?void 0:r.call(t,100*Number(n.target.value)))&&void 0!==i?i:n.target.value)}}function Et(){var e,t;const n=re();if((null===(e=n.search)||void 0===e?void 0:e.infinite_scroll)&&!document.querySelector(".blm-scroll-indicator")){const e=ue(),r=document.createElement("div");r.classList.add("blm-scroll-indicator");const i=document.createElement("div");i.classList.add("blm-scroll-indicator__loading"),r.appendChild(i),null===(t=null==e?void 0:e.parentNode)||void 0===t||t.insertBefore(r,e.nextSibling);const a=document.querySelector(".blm-scroll-indicator"),o=new IntersectionObserver(function(e){return t=>{var n;if(t[0].intersectionRatio<=0)return;const r=(null===(n=null===window||void 0===window?void 0:window.bloomreachConnector)||void 0===n?void 0:n.config)||{},i=r.start||0;r.start=i+e.search.items_per_page,ve($),jt().catch((e=>{r.start=i,be($),console.error(e)}))}}(n));a&&o.observe(a)}}function xt(){document.querySelectorAll(".blm-product-search-control-button--sidebar").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{const e=document.querySelector(".blm-product-search-sidebar-content");(null==e?void 0:e.classList.contains("blm-open"))?(null==e||e.classList.remove("blm-open"),document.body.classList.remove("blm-out-of-view"),ge(F,"")):(document.body.classList.add("blm-out-of-view"),null==e||e.classList.add("blm-open"),ge(F,"on"))})),e.setAttribute("hasListener","true"))}))}function Ot(){const e=At(),t=document.querySelector(`#sort-by-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{var t;ge(U,null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value),de(),jt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function Lt(){document.querySelectorAll(".blm-product-search__result").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-container").forEach((t=>{const n=t.querySelectorAll(".blm-product-search-swatch-container__swatch");n.forEach(((t,r)=>{t.getAttribute("hasListener")||(t.addEventListener("mouseover",function(e){const{result:t,swatchItems:n,swatchIndex:r}=e;return e=>{n.forEach((e=>{e.classList.remove("active")})),e.target.classList.add("active"),t.querySelectorAll(".blm-product-search-image-container").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-image").forEach(((e,t)=>{e.style.display="none",r===t&&(e.style.display="block")}))})),t.querySelectorAll(".blm-product-search-details-container__price").forEach(((e,t)=>{e.classList.remove("active"),r===t&&e.classList.add("active")}))}}({result:e,swatchItems:n,swatchIndex:r})),t.setAttribute("hasListener","true"))}))}))}))}async function jt(e={toReplace:!1}){var t,n,i,a;Rt({request_id:Math.floor(1e12+9e12*Math.random())});const o=re(),c=function(){var e,t,n,r,i;const a=re(),o=new URLSearchParams(window.location.search),c=At(),s=Object.assign(Object.assign(Object.assign(Object.assign({},(null===(e=a.search)||void 0===e?void 0:e.endpoint)?{endpoint:a.search.endpoint}:{}),(null===(t=a.search)||void 0===t?void 0:t.groupby)?{groupby:a.search.groupby}:{}),(null===(n=a.search)||void 0===n?void 0:n.group_limit)?{group_limit:a.search.group_limit}:{}),{q:o.get(a.default_search_parameter||"")||a.search.category_id||"",rows:null===(r=a.search)||void 0===r?void 0:r.items_per_page,sort:null==a?void 0:a.sort,start:a.start,account_id:a.account_id,domain_key:a.domain_key,request_id:c.request_id,_br_uid_2:a.tracking_cookie,ref_url:a.ref_url,url:a.url,request_type:a.request_type,search_type:a.search_type,fl:null===(i=a.search)||void 0===i?void 0:i.fields,"facet.range":a["facet.range"],"stats.field":a["stats.field"]}),l=o.get($);l&&(a.search.infinite_scroll&&c.is_first_request?(s.start=0,s.rows=Number.parseInt(l,10)*a.search.items_per_page):s.start=(Number.parseInt(l,10)-1)*a.search.items_per_page);const u=we();Object.keys(u).length&&(s.fq=oe(u));for(const[e,t]of o.entries())Object.keys(s).includes(e)||(s[e]=t);const d=B();d&&(s.brSeg=`seg:${d}`,s.segment=`customer_profile:${d}`,s.cdp_segments=d);a.search.force_v3_facets&&(s["facet.version"]="3.0");return s}(),s=await ee(c);if(null==s?void 0:s.keywordRedirect)return void function(e){var t;if(null==e?void 0:e.keywordRedirect){localStorage.setItem("keywordRedirect",JSON.stringify({original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}));const n=(null===(t=e.keywordRedirect)||void 0===t?void 0:t["redirected url"])||"";window.location.href=`${n.startsWith("http")?"":"https://"}${n}`}}(s);const l=function(e){var t;const n=re(),r=it(e),i=JSON.parse(localStorage.getItem("keywordRedirect")||"{}");(null==i?void 0:i.redirected_query)&&(r.keywordRedirect=i,localStorage.removeItem("keywordRedirect"));const a=new URLSearchParams(window.location.search);for(const[e,t]of a.entries())Object.keys(r).includes(e)||(r[e]=t);a.has(D)?r.size=Number.parseInt(a.get(D)||"",10):r.size=Number.parseInt(n.search.items_per_page.toString(),10);r.checkedFacets=we(),r.selectedFilterItems=((null==r?void 0:r.facets)||[]).reduce(((e,t)=>(t.section.length>0&&t.section.forEach((n=>{var i,a,o;r.checkedFacets&&t.original_title in r.checkedFacets&&(null===(o=null===(a=null===(i=r.checkedFacets)||void 0===i?void 0:i[t.original_title])||void 0===a?void 0:a.includes)||void 0===o?void 0:o.call(a,ae(n.id)))&&(e||[]).push({checkbox_id:`${t.original_title}[${ae(n.name)}]`,label:n.name})})),e)),[]);let o=At();"minPrice"in r&&"maxPrice"in r&&0===o.price_range_min_value&&0===o.price_range_max_value&&Rt({price_range_min_value:Math.floor(Number(r.minPrice)),price_range_max_value:Math.ceil(Number(r.maxPrice))});o=At(),r.priceRangeFacet={start:o.price_range_min_value,end:o.price_range_max_value},(null===(t=null==n?void 0:n.search)||void 0===t?void 0:t.infinite_scroll)||(r.paginationData=ie(r));return r.isFiltersPanelOpened=a.has(F),r.defaultMaxColorSwatches=q,r.mobileView=fe,r.escapeSpecialCharacters=ae,r.selectedColors=function(){const e=we();return Object.keys(e).reduce(((t,n)=>("color"===n.toLowerCase()&&(t=(e[n]||[]).map((e=>e.toLowerCase()))),t)),[])}(),r}(s),u=document.querySelector(".blm-scroll-indicator__loading"),d=(null==l?void 0:l.grouped_products)?((null===(t=null==l?void 0:l.grouped_products)||void 0===t?void 0:t.groups)||[]).length{t=e},getCurrentSearchRequestState:()=>t,load:async t=>{e&&t&&Rt({category_to_load:t}),function(){var e;const t=re();k(t.account_id),k(t.domain_key),k(t.default_search_parameter),k(null===(e=null==t?void 0:t.search)||void 0===e?void 0:e.selector),ue();const n=new URLSearchParams(window.location.search),r=t.search.is_search_page&&n.has(t.default_search_parameter),i=t.search.is_category_page&&(n.has(t.default_search_parameter)||t.search.category_id);return r||i}()&&(function(){const e=B();if(e){(window.br_data||{})[E]=e}}(),function(e){const t={childList:!0,subtree:!0};new MutationObserver((t=>{t.find((e=>"childList"===e.type&&Array.from(e.addedNodes).find((e=>e.classList&&e.classList.contains("blm-results")))))&&e()})).observe(ue(),t)}((()=>{ue().classList.add("blm-has-loaded"),window.onbeforeunload=function(){let e;void 0!==window.pageYOffset?e=window.pageYOffset:void 0!==document.compatMode&&"BackCompat"!==document.compatMode?e=document.documentElement.scrollTop:void 0!==document.body&&(e=document.body.scrollTop);const t=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}");window.localStorage.setItem("scrollPositions",JSON.stringify(Object.assign(Object.assign({},t),{[encodeURI(window.location.href)]:{scrollPosition:e}})))},Et(),function(){window.onpopstate=async()=>{await jt({toReplace:!0})},function(){const e=At(),t=document.querySelector(`.blm-price-range-input--lower-${e.request_id}`),n=document.querySelector(`.blm-price-range-input--upper-${e.request_id}`);t&&n&&(t.getAttribute("hasListener")||(t.addEventListener("change",St()),t.addEventListener("input",kt(".blm-range-slider__values--min")),t.setAttribute("hasListener","true")),n.getAttribute("hasListener")||(n.addEventListener("change",St()),n.addEventListener("input",kt(".blm-range-slider__values--max")),n.setAttribute("hasListener","true")))}(),pt(),mt(),ft(),document.querySelector(".blm-product-search-sidebar")&&(xt(),ht(),vt(),bt(),_t(),le());yt(),Ot(),gt(),wt(),Lt()}()})),await jt(),function(){var e;const t=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}"),n=encodeURI(window.location.href);if(n in t){const r=parseInt(null===(e=t[n])||void 0===e?void 0:e.scrollPosition,10);setTimeout((()=>{document.documentElement.scrollTop=r,document.body.scrollTop=r}),250)}delete t[encodeURI(window.location.href)],window.localStorage.setItem("scrollPositions",JSON.stringify(t))}())}}}();window.BloomreachModules=Object.assign(Object.assign({},e),{search:qt}),qt.load().catch(console.error)}(); +var t=a,r=v,n=y,i=!1,c=w,o="locals",s=["delimiter","scope","context","debug","compileDebug","client","_with","rmWhitespace","strict","filename","async"],l=s.concat("cache"),u=/^\uFEFF/,d=/^[a-zA-Z_$][0-9a-zA-Z_$]*$/;function p(r,n){var a;if(n.some((function(n){return a=e.resolveInclude(r,n,!0),t.existsSync(a)})))return a}function m(t,r){var n,a=t.filename,i=arguments.length>1;if(t.cache){if(!a)throw new Error("cache option requires a filename");if(n=e.cache.get(a))return n;i||(r=f(a).toString().replace(u,""))}else if(!i){if(!a)throw new Error("Internal EJS error: no file name or template provided");r=f(a).toString().replace(u,"")}return n=e.compile(r,t),t.cache&&e.cache.set(a,n),n}function f(t){return e.fileLoader(t)}function h(r,a){var i=n.shallowCopy(n.createNullProtoObjWherePossible(),a);if(i.filename=function(r,n){var a,i,c=n.views,o=/^[A-Za-z]+:\\|^\//.exec(r);if(o&&o.length)r=r.replace(/^\/*/,""),a=Array.isArray(n.root)?p(r,n.root):e.resolveInclude(r,n.root||"/",!0);else if(n.filename&&(i=e.resolveInclude(r,n.filename),t.existsSync(i)&&(a=i)),!a&&Array.isArray(c)&&(a=p(r,c)),!a&&"function"!=typeof n.includer)throw new Error('Could not find the include file "'+n.escapeFunction(r)+'"');return a}(r,i),"function"==typeof a.includer){var c=a.includer(r,i.filename);if(c&&(c.filename&&(i.filename=c.filename),c.template))return m(i,c.template)}return m(i)}function _(e,t,r,n,a){var i=t.split("\n"),c=Math.max(n-3,0),o=Math.min(i.length,n+3),s=a(r),l=i.slice(c,o).map((function(e,t){var r=t+c+1;return(r==n?" >> ":" ")+r+"| "+e})).join("\n");throw e.path=s,e.message=(s||"ejs")+":"+n+"\n"+l+"\n\n"+e.message,e}function g(e){return e.replace(/;(\s*$)/,"$1")}function b(t,r){var a=n.hasOwnOnlyObject(r),i=n.createNullProtoObjWherePossible();this.templateText=t,this.mode=null,this.truncate=!1,this.currentLine=1,this.source="",i.client=a.client||!1,i.escapeFunction=a.escape||a.escapeFunction||n.escapeXML,i.compileDebug=!1!==a.compileDebug,i.debug=!!a.debug,i.filename=a.filename,i.openDelimiter=a.openDelimiter||e.openDelimiter||"<",i.closeDelimiter=a.closeDelimiter||e.closeDelimiter||">",i.delimiter=a.delimiter||e.delimiter||"%",i.strict=a.strict||!1,i.context=a.context,i.cache=a.cache||!1,i.rmWhitespace=a.rmWhitespace,i.root=a.root,i.includer=a.includer,i.outputFunctionName=a.outputFunctionName,i.localsName=a.localsName||e.localsName||o,i.views=a.views,i.async=a.async,i.destructuredLocals=a.destructuredLocals,i.legacyInclude=void 0===a.legacyInclude||!!a.legacyInclude,i.strict?i._with=!1:i._with=void 0===a._with||a._with,this.opts=i,this.regex=this.createRegex()}e.cache=n.cache,e.fileLoader=t.readFileSync,e.localsName=o,e.promiseImpl=new Function("return this;")().Promise,e.resolveInclude=function(e,t,n){var a=r.dirname,i=r.extname,c=(0,r.resolve)(n?t:a(t),e);return i(e)||(c+=".ejs"),c},e.compile=function(e,t){return t&&t.scope&&(i||(console.warn("`scope` option is deprecated and will be removed in EJS 3"),i=!0),t.context||(t.context=t.scope),delete t.scope),new b(e,t).compile()},e.render=function(e,t,r){var a=t||n.createNullProtoObjWherePossible(),i=r||n.createNullProtoObjWherePossible();return 2==arguments.length&&n.shallowCopyFromList(i,a,s),m(i,e)(a)},e.renderFile=function(){var t,r,a,i=Array.prototype.slice.call(arguments),c=i.shift(),o={filename:c};return"function"==typeof arguments[arguments.length-1]&&(t=i.pop()),i.length?(r=i.shift(),i.length?n.shallowCopy(o,i.pop()):(r.settings&&(r.settings.views&&(o.views=r.settings.views),r.settings["view cache"]&&(o.cache=!0),(a=r.settings["view options"])&&n.shallowCopy(o,a)),n.shallowCopyFromList(o,r,l)),o.filename=c):r=n.createNullProtoObjWherePossible(),function(t,r,n){var a;if(!n){if("function"==typeof e.promiseImpl)return new e.promiseImpl((function(e,n){try{e(a=m(t)(r))}catch(e){n(e)}}));throw new Error("Please provide a callback function")}try{a=m(t)(r)}catch(e){return n(e)}n(null,a)}(o,r,t)},e.Template=b,e.clearCache=function(){e.cache.reset()},b.modes={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"},b.prototype={createRegex:function(){var e="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",t=n.escapeRegExpChars(this.opts.delimiter),r=n.escapeRegExpChars(this.opts.openDelimiter),a=n.escapeRegExpChars(this.opts.closeDelimiter);return e=e.replace(/%/g,t).replace(//g,a),new RegExp(e)},compile:function(){var e,t,a,i=this.opts,c="",o="",s=i.escapeFunction,l=i.filename?JSON.stringify(i.filename):"undefined";if(!this.source){if(this.generateSource(),c+=' var __output = "";\n function __append(s) { if (s !== undefined && s !== null) __output += s }\n',i.outputFunctionName){if(!d.test(i.outputFunctionName))throw new Error("outputFunctionName is not a valid JS identifier.");c+=" var "+i.outputFunctionName+" = __append;\n"}if(i.localsName&&!d.test(i.localsName))throw new Error("localsName is not a valid JS identifier.");if(i.destructuredLocals&&i.destructuredLocals.length){for(var u=" var __locals = ("+i.localsName+" || {}),\n",p=0;p0&&(u+=",\n "),u+=m+" = __locals."+m}c+=u+";\n"}!1!==i._with&&(c+=" with ("+i.localsName+" || {}) {\n",o+=" }\n"),o+=" return __output;\n",this.source=c+this.source+o}e=i.compileDebug?"var __line = 1\n , __lines = "+JSON.stringify(this.templateText)+"\n , __filename = "+l+";\ntry {\n"+this.source+"} catch (e) {\n rethrow(e, __lines, __filename, __line, escapeFn);\n}\n":this.source,i.client&&(e="escapeFn = escapeFn || "+s.toString()+";\n"+e,i.compileDebug&&(e="rethrow = rethrow || "+_.toString()+";\n"+e)),i.strict&&(e='"use strict";\n'+e),i.debug&&console.log(e),i.compileDebug&&i.filename&&(e=e+"\n//# sourceURL="+l+"\n");try{if(i.async)try{a=new Function("return (async function(){}).constructor;")()}catch(e){throw e instanceof SyntaxError?new Error("This environment does not support async/await"):e}else a=Function;t=new a(i.localsName+", escapeFn, include, rethrow",e)}catch(e){throw e instanceof SyntaxError&&(i.filename&&(e.message+=" in "+i.filename),e.message+=" while compiling ejs\n\n",e.message+="If the above error is not helpful, you may want to try EJS-Lint:\n",e.message+="https://github.com/RyanZim/EJS-Lint",i.async||(e.message+="\n",e.message+="Or, if you meant to create an async function, pass `async: true` as an option.")),e}var f=i.client?t:function(e){return t.apply(i.context,[e||n.createNullProtoObjWherePossible(),s,function(t,r){var a=n.shallowCopy(n.createNullProtoObjWherePossible(),e);return r&&(a=n.shallowCopy(a,r)),h(t,i)(a)},_])};if(i.filename&&"function"==typeof Object.defineProperty){var g=i.filename,b=r.basename(g,r.extname(g));try{Object.defineProperty(f,"name",{value:b,writable:!1,enumerable:!1,configurable:!0})}catch(e){}}return f},generateSource:function(){this.opts.rmWhitespace&&(this.templateText=this.templateText.replace(/[\r\n]+/g,"\n").replace(/^\s+|\s+$/gm,"")),this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");var e=this,t=this.parseTemplateText(),r=this.opts.delimiter,n=this.opts.openDelimiter,a=this.opts.closeDelimiter;t&&t.length&&t.forEach((function(i,c){var o;if(0===i.indexOf(n+r)&&0!==i.indexOf(n+r+r)&&(o=t[c+2])!=r+a&&o!="-"+r+a&&o!="_"+r+a)throw new Error('Could not find matching close tag for "'+i+'".');e.scanLine(i)}))},parseTemplateText:function(){for(var e,t=this.templateText,r=this.regex,n=r.exec(t),a=[];n;)0!==(e=n.index)&&(a.push(t.substring(0,e)),t=t.slice(e)),a.push(n[0]),t=t.slice(n[0].length),n=r.exec(t);return t&&a.push(t),a},_addOutput:function(e){if(this.truncate&&(e=e.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!e)return e;e=(e=(e=(e=e.replace(/\\/g,"\\\\")).replace(/\n/g,"\\n")).replace(/\r/g,"\\r")).replace(/"/g,'\\"'),this.source+=' ; __append("'+e+'")\n'},scanLine:function(e){var t,r=this.opts.delimiter,n=this.opts.openDelimiter,a=this.opts.closeDelimiter;switch(t=e.split("\n").length-1,e){case n+r:case n+r+"_":this.mode=b.modes.EVAL;break;case n+r+"=":this.mode=b.modes.ESCAPED;break;case n+r+"-":this.mode=b.modes.RAW;break;case n+r+"#":this.mode=b.modes.COMMENT;break;case n+r+r:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(n+r+r,n+r)+'")\n';break;case r+r+a:this.mode=b.modes.LITERAL,this.source+=' ; __append("'+e.replace(r+r+a,r+a)+'")\n';break;case r+a:case"-"+r+a:case"_"+r+a:this.mode==b.modes.LITERAL&&this._addOutput(e),this.mode=null,this.truncate=0===e.indexOf("-")||0===e.indexOf("_");break;default:if(this.mode){switch(this.mode){case b.modes.EVAL:case b.modes.ESCAPED:case b.modes.RAW:e.lastIndexOf("//")>e.lastIndexOf("\n")&&(e+="\n")}switch(this.mode){case b.modes.EVAL:this.source+=" ; "+e+"\n";break;case b.modes.ESCAPED:this.source+=" ; __append(escapeFn("+g(e)+"))\n";break;case b.modes.RAW:this.source+=" ; __append("+g(e)+")\n";break;case b.modes.COMMENT:break;case b.modes.LITERAL:this._addOutput(e)}}else this._addOutput(e)}this.opts.compileDebug&&t&&(this.currentLine+=t,this.source+=" ; __line = "+this.currentLine+"\n")}},e.escapeXML=n.escapeXML,e.__express=e.renderFile,e.VERSION=c,e.name="ejs","undefined"!=typeof window&&(window.ejs=e)}(n);var S="Invariant failed";function k(e,t){if(!e)throw new Error(S)}const E="cdp_segments",x="$",L=16,A="q",R=[{label:"Relevance",value:""},{label:"Price (low - high)",value:"price+asc"},{label:"Price (high - low)",value:"price+desc"},{label:"Name (A - Z)",value:"title+asc"},{label:"Name (Z - A)",value:"title+desc"}],q=0,O="price",N=4,C=2,I=2,P=5,T=6,F="fq",j="filterpanel",M="groupby",$="page",D="size",U="sort",z="search",V="category",W="keyword",J=".main-content";function B(){const e=`${E}=`;return(document.cookie.split("; ").find((t=>t.startsWith(e)))||"").replace(e,"")}const Q={method:"GET",headers:{"Content-Type":"application/json"}};function H(){const e=document.cookie.split("; ").find((e=>e.startsWith("_br_uid_2=")));return e?e.replace("_br_uid_2=",""):"uid%3D7797686432023%3Av%3D11.5%3Ats%3D1428617911187%3Ahc%3D55"}const X=(e,t="$",r=!0)=>`${r?t:""}${(e/100).toLocaleString(void 0,{minimumFractionDigits:2,maximumFractionDigits:2})}${r?"":` ${t}`}`;const Z="https://core.dxpapi.com/api/v1/core/",G=["_br_uid_2","fq","sort"],Y="pid,title,brand,price,sale_price,thumb_image,sku_thumb_images,sku_swatch_images,sku_color_group,url,price_range,sale_price_range,description,is_live,score,skuid,group";function K(e){const t=Object.assign({},e),r=(null==t?void 0:t.endpoint)||Z;return(null==t?void 0:t.endpoint)&&(null==t||delete t.endpoint),(null==t?void 0:t.fl)||(t.fl=Y),`${r}${n=t,`?${Object.keys(n).reduce(((e,t)=>[...e,`${t}=${G.includes(t)?n[t]:encodeURIComponent(n[t])}`]),[]).join("&")}`}`;var n}async function ee(e){return async function(e,t){const r=await fetch(e,t);return await r.json()}(K(e),Q)}var te='<% if (did_you_mean.length) { %>\n
\n<% } %>\n<% if (locals.keywordRedirect && keywordRedirect.redirected_query && did_you_mean.length === 0) { %>\n
\n
\n

Results for <%- keywordRedirect.redirected_query %>

\n
Redirected from "<%- keywordRedirect.original_query %>"
\n
\n
\n<% } %>\n
\n <% if (config.search.facets_included && facets.length) { %>\n \n <% } %>\n
\n
\n <%\n const haveUngroupedResults = locals.number_of_results && number_of_results > 0;\n const haveGroupedResults = locals.grouped_products && grouped_products.groups.length > 0;\n %>\n <% if (haveUngroupedResults || haveGroupedResults) { %>\n <% if (haveUngroupedResults) { %>\n

\n Showing <%- start + 1 %> - <%- Math.min(start + products.length, number_of_results) %> of <%- number_of_results %> products\n

\n <% } %>\n
\n <% if (config.search.groupby) { %>\n \n \n \n <% config.search.groupby_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n <% } %>\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n \n \n \n <% for (let i = (config.search.groupby ? 4 : 16); i <= (config.search.groupby ? 16 : 48); i += 4) { %>\n \n <% } %>\n \n \n <% } %>\n \n \n \n <% config.search.sorting_options.forEach(function(option) { %>\n \n <% }) %>\n \n \n
\n <% } else if (!(locals.grouped_products) || grouped_products.groups.length < 1) { %>\n

\n No results found\n

\n <% } %>\n\n
\n
class="blm-product-search__results"<% } %>>\n <% if (products.length || (locals.grouped_products && grouped_products.groups.length > 0)) { %>\n %%-PRODUCT_LIST_TEMPLATE-%%\n <% } %>\n
\n\n <% if (!config.search.infinite_scroll && paginationData.length > 0) { %>\n
\n
    \n <% paginationData.forEach(paginationNode => { %>\n
  • \n
  • \n <% }) %>\n
\n
\n <% } %>\n
\n
\n',re='<% function printProduct(product) { %>\n
title="<%- product.variant_name %>"<% } %>>\n <%\n const matchingVariant = !Array.isArray(product.variants)\n ? null\n : \'variant_index\' in product\n ? product.variants[product.variant_index]\n : product.variants.find(variant => selectedColors.includes(variant.sku_color_group ? variant.sku_color_group.toLowerCase() : null))\n %>\n
\n <% if (product.variants && product.variants.length > 1) { %>\n <% product.variants.forEach(function(variant, index) { %>\n\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n\n
style="display: block"<% } %>\n >\n \n
\n <% }); %>\n <% } else { %>\n
\n \n
\n <% } %>\n
\n \n\n <% if (product.variants && product.variants.length > 1) { %>\n
    \n <% product.variants.slice(0, defaultMaxColorSwatches || 0).forEach(function(variant, index) { %>\n <%\n const isActiveVariant =\n !(\'variant_index\' in product) && !selectedColors.length\n ? index === 0\n : \'variant_index\' in product\n ? product.variant_index === index\n : matchingVariant == variant\n %>\n \n <% }); %>\n
\n\n <% if (product.variants.length > defaultMaxColorSwatches || 0) { %>\n (Colors) <%- product.variants.length %>\n <% } %>\n <% } %>\n
\n<% } %>\n\n<% if (locals.grouped_products && grouped_products && grouped_products.groups) { %>\n\n <% grouped_products.groups.forEach(group => { %>\n
\n

<%- group.title %>

\n\n
\n <% group.products.forEach(printProduct); %>\n
\n
\n <% }); %>\n\n<% } else { %>\n\n <% products.forEach(printProduct); %>\n\n<% } %>\n';function ne(){const e=function(){const e=window?.bloomreachConnector?.config;return{default_search_parameter:A,url:window.location.href,ref_url:window.location.href,tracking_cookie:H(),format_money:e=>X(e,window.bloomreachDefaultCurrency||x),default_currency:window.bloomreachDefaultCurrency||x,...e}}(),t=new URLSearchParams(window.location.search),r=Ct(),n={display_variants:!1,enabled:!0,endpoint:"",items_per_page:L,facets_included:!0,initial_number_of_facets:P,initial_number_of_facet_values:T,infinite_scroll:!1,selector:J,sorting_options:R,template:te,product_list_template:re,...e?.search?e.search:{}},a={...e,request_type:z,search_type:r.is_category_page?V:W,start:q,"facet.range":O,"stats.field":O,sort:t.get(U)||"",search:{...n,...(r.is_category_page?e.category:e.search)||{},...r.category_to_load?{category_id:r.category_to_load}:{}}};return a.search?.sorting_options?.sort?.(((e,t)=>e.value>t.value?1:-1)),a.search&&(a.search={...a.search,items_per_page:Number(t.has(D)?t.get(D):a.search.items_per_page),groupby:t.get(M)||a.search.groupby||""}),a}function ae(e){return"grouped_products"in e?function(e){const t=Number(e.page||1),r=e.size||1,n=(e?.grouped_products?.groups||[]).length;return[{value:"previous",label:"Previous",disabled:t<=1},{value:"next",label:"Next",disabled:nt+1)).slice(-C),i=Array(n-r).fill(null).map(((e,t)=>t+(r+1))).slice(0,I);return[...r>1?[{value:"previous",label:"←"}]:[],...r-1>C?[{label:"…",value:(r-C-1).toString()}]:[],...a.map((e=>({value:e.toString()}))),{value:r.toString(),disabled:!0,active:!0},...i.map((e=>({value:e.toString()}))),...r+Ie.replace(/"/g,""").replace(/,/g,"%%-COMMA-%%"),ce=e=>Object.keys(e).map((t=>"price"===t?encodeURIComponent(`${t}:[${e[t].map((e=>`${e||"*"}`)).join(" TO ")}]`):encodeURIComponent(`${t}:${e[t].map((e=>`"${(e=>e.replace(/%%-COMMA-%%/g,",").replace(/"/g,'"'))(e)}"`)).join(" OR ")}`))).join("&fq=");function oe(e){let t=0,r=0;const n=ne(),a=Number(e||n.search?.initial_number_of_facets);document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').forEach((e=>{const n=e.querySelectorAll('.blm-product-search-filter-item:not([style*="display: none"]');t0&&e.setAttribute("style","display: block"),t++,r+=n.length>0?1:0}));const i=Ct(),c=document.querySelector(`.blm-load-more-facet--${i.request_id}`);0!==document.querySelectorAll('.blm-dynamic-filter:not([style*="display: block"])').length&&0!==r||c?.classList.add("blm-hide")}function se(){const e=Ct(),t=document.querySelector(`.blm-load-more-facet--${e.request_id}`);return k(t),t}function le(){const e=ne(),t=Number(e.search?.initial_number_of_facets),r=Number(e.search?.initial_number_of_facet_values);[".blm-dynamic-filter",".blm-product-search-filter-item",".blm-product-search-load-more"].forEach((e=>{document.querySelectorAll(e).forEach((e=>{e.removeAttribute("style")}))})),oe(t-1),document.querySelectorAll(`.blm-product-search-filter-item:nth-child(-n+${r})`).forEach((e=>e.style.display="block")),se().removeAttribute("style")}function ue(){const e=ne();k(e.search?.selector);return document.querySelector(e.search.selector)}function de(){const e=document.querySelector(".blm-scroll-indicator");if(e){e.innerHTML="";const t=document.createElement("div");t.classList.add("blm-scroll-indicator__loading"),e.appendChild(t)}}function pe(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox:checked");return e?Array.from(e).reduce(((e,t)=>({...e,[t.name]:e[t.name]?[...e[t.name]||[],t.value]:[t.value]})),{}):{}}var me;!function(e){e.small="480px",e.medium="680px",e.large="750px",e.xlarge="875px",e.xxlarge="1000px",e.xxxlarge="1200px"}(me||(me={}));const fe=window.matchMedia(`(max-width: ${me.medium})`);function he(e){const t={};for(const r of e.entries())t[r[0]]=r[1];window.history.pushState(t,document.title,`?${e.toString()}`)}function _e(e,t,r){const n={valueSerializer:e=>e.toString().replace(/"/g,'\\"'),nameValueSeparator:":",...r},a=new URLSearchParams(window.location.search);a.delete(e),Array.isArray(t)?t.forEach((t=>{a.append(e,n.valueSerializer(t))})):Object.keys(t).forEach((r=>{a.append(e,`${r}${n.nameValueSeparator}${n.valueSerializer(t[r])}`)})),he(a)}function ge(e,t){const r=new URLSearchParams(window.location.search);"function"==typeof t?r.set(e,t(r.get(e)).replace(/"/g,'\\"')):""===t?r.delete(e):r.set(e,t.replace(/"/g,'\\"')),he(r)}function be(e){ge(e,(e=>{if(!e)return"2";let t=Number.parseInt(e,10);return(++t).toString()}))}function ve(e){ge(e,(e=>{if(!e)return"1";let t=Number.parseInt(e,10);return(--t).toString()}))}function ye(){const e=Ct(),t=we(),r=document.querySelector(".blm-price-range-input--lower"),n=document.querySelector(".blm-price-range-input--upper");let a=parseFloat(r.value),i=parseFloat(n.value);return a>i&&([a,i]=[i,a]),a===i&&(a>e.price_range_min_value||i({...e,[t.split(":")[0]||""]:(t.split(":")[1]||"").split(",")})),{})}window.matchMedia(`(min-width:${me.medium}) and (max-width: ${me.xlarge})`);var Se=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},ke="object"==typeof t&&t&&t.Object===Object&&t,Ee="object"==typeof self&&self&&self.Object===Object&&self,xe=ke||Ee||Function("return this")(),Le=xe,Ae=function(){return Le.Date.now()},Re=/\s/;var qe=function(e){for(var t=e.length;t--&&Re.test(e.charAt(t)););return t},Oe=/^\s+/;var Ne=function(e){return e?e.slice(0,qe(e)+1).replace(Oe,""):e},Ce=xe.Symbol,Ie=Ce,Pe=Object.prototype,Te=Pe.hasOwnProperty,Fe=Pe.toString,je=Ie?Ie.toStringTag:void 0;var Me=function(e){var t=Te.call(e,je),r=e[je];try{e[je]=void 0;var n=!0}catch(e){}var a=Fe.call(e);return n&&(t?e[je]=r:delete e[je]),a},$e=Object.prototype.toString;var De=Me,Ue=function(e){return $e.call(e)},ze=Ce?Ce.toStringTag:void 0;var Ve=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":ze&&ze in Object(e)?De(e):Ue(e)},We=function(e){return null!=e&&"object"==typeof e};var Je=Ne,Be=Se,Qe=function(e){return"symbol"==typeof e||We(e)&&"[object Symbol]"==Ve(e)},He=/^[-+]0x[0-9a-f]+$/i,Xe=/^0b[01]+$/i,Ze=/^0o[0-7]+$/i,Ge=parseInt;var Ye=Se,Ke=Ae,et=function(e){if("number"==typeof e)return e;if(Qe(e))return NaN;if(Be(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Be(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Je(e);var r=Xe.test(e);return r||Ze.test(e)?Ge(e.slice(2),r?2:8):He.test(e)?NaN:+e},tt=Math.max,rt=Math.min;var nt=function(e,t,r){var n,a,i,c,o,s,l=0,u=!1,d=!1,p=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function m(t){var r=n,i=a;return n=a=void 0,l=t,c=e.apply(i,r)}function f(e){var r=e-s;return void 0===s||r>=t||r<0||d&&e-l>=i}function h(){var e=Ke();if(f(e))return _(e);o=setTimeout(h,function(e){var r=t-(e-s);return d?rt(r,i-(e-l)):r}(e))}function _(e){return o=void 0,p&&n?m(e):(n=a=void 0,c)}function g(){var e=Ke(),r=f(e);if(n=arguments,a=this,s=e,r){if(void 0===o)return function(e){return l=e,o=setTimeout(h,t),u?m(e):c}(s);if(d)return clearTimeout(o),o=setTimeout(h,t),m(s)}return void 0===o&&(o=setTimeout(h,t)),c}return t=et(t)||0,Ye(r)&&(u=!!r.leading,i=(d="maxWait"in r)?tt(et(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p),g.cancel=function(){void 0!==o&&clearTimeout(o),l=0,n=s=a=o=void 0},g.flush=function(){return void 0===o?c:_(Ke())},g};function at(e){const t=ne();return{...e?.facet_counts?"facets"in e.facet_counts?function(e){return{facets:e.facets?.filter((e=>"text"===e.type||"number"===e.type)).filter((e=>e.value.length)).map(lt)??[],...ut(e.facets),...dt(e.facets)}}(e.facet_counts):function(e,t){return{facets:Object.entries(e.facet_fields||{}).filter((e=>e[1].length)).map(it),...ot(e.facet_ranges),...st(t?.stats_fields?.price),...st(t?.stats_fields?.sale_price)}}(e.facet_counts,e.stats):{facets:[]},products:pt(e.response?.docs||[]),...e?.group_response?{grouped_products:Object.keys(e?.group_response).reduce(((t,r)=>({group_category_id:r,...e.group_response?.[r],groups:e.group_response?.[r]?.groups?.map((e=>({title:e.groupValue,products:pt(e?.doclist?.docs||[])})))||[]})),{})}:{},did_you_mean:e.did_you_mean||[],number_of_results:Number(e.response?.numFound),start:Number(e.response?.start),config:t,...e.keywordRedirect?{keywordRedirect:{original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}}:{}}}function it(e){return{original_title:e[0],title:e[0].replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e[1].map(ct)}}function ct(e){if("name"in e){let t=e.name??"";return"true"===e.name?t="Yes":"false"===e.name&&(t="No"),{count:e.count??0,name:t,id:t}}return{count:e.count??0,name:e.cat_name??"",id:e.cat_id??""}}function ot(e){return e?.price?{priceRanges:e.price.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})))}:{}}function st(e){return e?{maxPrice:e.max,minPrice:e.min}:{}}function lt(e){return{original_title:e.name,title:e.name.replace("_"," ").replace(/\b\w/g,(e=>e.toUpperCase())),section:e.value.map(ct)}}function ut(e){const t=e?.filter((e=>"number_range"===e.type)).find((e=>"price"===e.name.toLowerCase()))?.value.map((e=>({count:e.count,start:e.start.toString(),end:e.end.toString()})));return t?{priceRanges:t}:{}}function dt(e){const t=e?.filter((e=>"number_stats"===e.type)).map((e=>({name:e.name.toLowerCase(),value:e.value}))),r=t?.find((e=>"sale price"===e.name||"sale_price"===e.name))??t?.find((e=>"price"===e.name));return r?.value?{maxPrice:r.value.end,minPrice:r.value.start}:{}}function pt(e){const t=ne();return e.reduce(((e,r)=>[...e,...t.search.display_variants?mt(r):[ft(r)]]),[])}function mt(e){return e.variants&&e.variants.length?(ft(e).variants||[]).map(((t,r)=>({...ft(e),...t,variant_index:r}))):[ft(e)]}function ft(e){return{...e,title:e.title,image:e.thumb_image,link:e.url,id:e.pid,price:e.price,sale_price:e.sale_price,...e.variants?{variants:e.variants.map((e=>({...e,sku_color_group:e.sku_color_group,sku_swatch_images:e.sku_swatch_images,sku_thumb_images:e.sku_thumb_images,sku_sale_price:e.sku_sale_price,sku_price:e.sku_price,image:e.sku_thumb_images&&Array.isArray(e.sku_thumb_images)?e.sku_thumb_images[0]:e.sku_swatch_images[0],variant_name:e.sku_color_group})))}:{}}}function ht(){const e=Ct(),t=document.querySelector(`.blm-range-slider__clear-values-button--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(()=>{de(),_e(F,{...pe()}),ge($,"1"),It({price_range_max_value:0,price_range_min_value:0}),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function _t(){document.querySelectorAll(".blm-product-search-selected-filter__clear").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(e=>{const t=e?.target?.parentNode?.dataset?.filterCheckboxId;t&&document.getElementById(t)?.click()})),e.setAttribute("hasListener","true"))}))}function gt(){const e=document.querySelector(".blm-product-search-selected-filters__clear-all");e&&(e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{de(),_e(F,{...ye()}),ge($,"1"),It({price_range_min_value:0,price_range_max_value:0}),Nt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true")))}function bt(){const e=document.querySelectorAll(".blm-product-search-filter-item__checkbox");e&&e.forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("change",(()=>{de(),_e(F,{...pe(),...ye()}),ge($,"1"),It({price_range_min_value:0,price_range_max_value:0}),Nt({toReplace:!0}).catch(console.error)})),e.setAttribute("hasListener","true"))}))}function vt(){const e=document.querySelector("#blm-product-search-search-filters__input");e&&(e.getAttribute("hasInputListener")||(e.addEventListener("input",nt((e=>{const t=(e?.target?.value||"").trim();document.querySelectorAll(".blm-dynamic-filter").forEach((e=>{let r=0;e.querySelectorAll(".blm-product-search-filter-item").forEach((e=>{const n=e.querySelector("label")?.textContent||"",a=!t||n.toLowerCase().includes(t.toLowerCase()),i=a?"block":"none";r+=a?1:0,e.style.display=i})),e.style.display=r?"block":"none"})),document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.style.display="none"})),se().style.display="none",t||le()}),500)),e.setAttribute("hasInputListener","true")))}function yt(){const e=Ct(),t=document.querySelector(`#groupby-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(M,e?.target?.value),de(),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function wt(){const e=se();e&&!e.getAttribute("hasListener")&&(e.addEventListener("click",(()=>{oe()})),e.setAttribute("hasListener","true"))}function St(){document.querySelectorAll(".blm-product-search-load-more").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",function(){const e=ne(),t=Number(e.search?.initial_number_of_facet_values);let r=t;const n=t;return e=>{const t=e.target.getAttribute("data-item"),a=document.getElementById(`blm-facet-block-item-${t}`).getElementsByTagName("li");for(let e=r;e=a.length&&(e.target.style.display="none")}}()),e.setAttribute("hasListener","true"))}))}function kt(){const e=Ct(),t=document.querySelector(`#sort-size-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(D,e.target.value),ge($,"1"),de(),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function Et(){const e=Ct(),t=document.querySelector(`.blm-product-search-pagination__pages--${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("click",(e=>{de();const t=e.target.dataset.value;if(t){switch(e.target.dataset.value){case"previous":ve($);break;case"next":be($);break;default:ge($,t)}Nt({toReplace:!0}).catch(console.error)}})),t.setAttribute("hasListener","true")))}function xt(){return()=>{de(),_e(F,{...pe(),...ye()}),ge($,"1"),Nt({toReplace:!0}).catch(console.error)}}function Lt(e){const t=ne();return r=>{const n=document.querySelector(e);n&&(n.innerHTML=t.format_money?.(100*Number(r.target.value))??r.target.value)}}function At(){const e=ne();if(e.search?.infinite_scroll&&!document.querySelector(".blm-scroll-indicator")){const t=ue(),r=document.createElement("div");r.classList.add("blm-scroll-indicator");const n=document.createElement("div");n.classList.add("blm-scroll-indicator__loading"),r.appendChild(n),t?.parentNode?.insertBefore(r,t.nextSibling);const a=document.querySelector(".blm-scroll-indicator"),i=new IntersectionObserver(function(e){return t=>{if(t[0].intersectionRatio<=0)return;const r=window?.bloomreachConnector?.config||{},n=r.start||0;r.start=n+e.search.items_per_page,be($),Nt().catch((e=>{r.start=n,ve($),console.error(e)}))}}(e));a&&i.observe(a)}}function Rt(){document.querySelectorAll(".blm-product-search-control-button--sidebar").forEach((e=>{e.getAttribute("hasListener")||(e.addEventListener("click",(()=>{const e=document.querySelector(".blm-product-search-sidebar-content");e?.classList.contains("blm-open")?(e?.classList.remove("blm-open"),document.body.classList.remove("blm-out-of-view"),ge(j,"")):(document.body.classList.add("blm-out-of-view"),e?.classList.add("blm-open"),ge(j,"on"))})),e.setAttribute("hasListener","true"))}))}function qt(){const e=Ct(),t=document.querySelector(`#sort-by-${e.request_id}`);t&&(t.getAttribute("hasListener")||(t.addEventListener("change",(e=>{ge(U,e?.target?.value),de(),Nt({toReplace:!0}).catch(console.error)})),t.setAttribute("hasListener","true")))}function Ot(){document.querySelectorAll(".blm-product-search__result").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-container").forEach((t=>{const r=t.querySelectorAll(".blm-product-search-swatch-container__swatch");r.forEach(((t,n)=>{t.getAttribute("hasListener")||(t.addEventListener("mouseover",function(e){const{result:t,swatchItems:r,swatchIndex:n}=e;return e=>{r.forEach((e=>{e.classList.remove("active")})),e.target.classList.add("active"),t.querySelectorAll(".blm-product-search-image-container").forEach((e=>{e.querySelectorAll(".blm-product-search-swatch-image").forEach(((e,t)=>{e.style.display="none",n===t&&(e.style.display="block")}))})),t.querySelectorAll(".blm-product-search-details-container__price").forEach(((e,t)=>{e.classList.remove("active"),n===t&&e.classList.add("active")}))}}({result:e,swatchItems:r,swatchIndex:n})),t.setAttribute("hasListener","true"))}))}))}))}async function Nt(e={toReplace:!1}){It({request_id:Math.floor(1e12+9e12*Math.random())});const t=ne(),r=function(){const e=ne(),t=new URLSearchParams(window.location.search),r=Ct(),n={...e.search?.endpoint?{endpoint:e.search.endpoint}:{},...e.search?.groupby?{groupby:e.search.groupby}:{},...e.search?.group_limit?{group_limit:e.search.group_limit}:{},q:t.get(e.default_search_parameter||"")||e.search.category_id||"",rows:e.search?.items_per_page,sort:e?.sort,start:e.start,account_id:e.account_id,domain_key:e.domain_key,request_id:r.request_id,_br_uid_2:e.tracking_cookie,ref_url:e.ref_url,url:e.url,request_type:e.request_type,search_type:e.search_type,fl:e.search?.fields,"facet.range":e["facet.range"],"stats.field":e["stats.field"]},a=t.get($);a&&(e.search.infinite_scroll&&r.is_first_request?(n.start=0,n.rows=Number.parseInt(a,10)*e.search.items_per_page):n.start=(Number.parseInt(a,10)-1)*e.search.items_per_page);const i=we();Object.keys(i).length&&(n.fq=ce(i));for(const[e,r]of t.entries())Object.keys(n).includes(e)||(n[e]=r);const c=B();c&&(n.brSeg=`seg:${c}`,n.segment=`customer_profile:${c}`,n.cdp_segments=c);e.search.force_v3_facets&&(n["facet.version"]="3.0");return n}(),a=await ee(r);if(a?.keywordRedirect)return void function(e){if(e?.keywordRedirect){localStorage.setItem("keywordRedirect",JSON.stringify({original_query:e.keywordRedirect["original query"],redirected_query:e.keywordRedirect["redirected query"],redirected_url:e.keywordRedirect["redirected url"]}));const t=e.keywordRedirect?.["redirected url"]||"";window.location.href=`${t.startsWith("http")?"":"https://"}${t}`}}(a);const i=function(e){const t=ne(),r=at(e),n=JSON.parse(localStorage.getItem("keywordRedirect")||"{}");n?.redirected_query&&(r.keywordRedirect=n,localStorage.removeItem("keywordRedirect"));const a=new URLSearchParams(window.location.search);for(const[e,t]of a.entries())Object.keys(r).includes(e)||(r[e]=t);a.has(D)?r.size=Number.parseInt(a.get(D)||"",10):r.size=Number.parseInt(t.search.items_per_page.toString(),10);r.checkedFacets=we(),r.selectedFilterItems=(r?.facets||[]).reduce(((e,t)=>(t.section.length>0&&t.section.forEach((n=>{r.checkedFacets&&t.original_title in r.checkedFacets&&r.checkedFacets?.[t.original_title]?.includes?.(ie(n.id))&&(e||[]).push({checkbox_id:`${t.original_title}[${ie(n.name)}]`,label:n.name})})),e)),[]);let i=Ct();"minPrice"in r&&"maxPrice"in r&&0===i.price_range_min_value&&0===i.price_range_max_value&&It({price_range_min_value:Math.floor(Number(r.minPrice)),price_range_max_value:Math.ceil(Number(r.maxPrice))});i=Ct(),r.priceRangeFacet={start:i.price_range_min_value,end:i.price_range_max_value},t?.search?.infinite_scroll||(r.paginationData=ae(r));return r.isFiltersPanelOpened=a.has(j),r.defaultMaxColorSwatches=N,r.mobileView=fe,r.escapeSpecialCharacters=ie,r.selectedColors=function(){const e=we();return Object.keys(e).reduce(((t,r)=>("color"===r.toLowerCase()&&(t=(e[r]||[]).map((e=>e.toLowerCase()))),t)),[])}(),r}(a),c=document.querySelector(".blm-scroll-indicator__loading"),o=i?.grouped_products?(i?.grouped_products?.groups||[]).length{t=e},getCurrentSearchRequestState:()=>t,load:async t=>{e&&t&&It({category_to_load:t}),function(){const e=ne();k(e.account_id),k(e.domain_key),k(e.default_search_parameter),k(e?.search?.selector),ue();const t=new URLSearchParams(window.location.search),r=e.search.is_search_page&&t.has(e.default_search_parameter),n=e.search.is_category_page&&(t.has(e.default_search_parameter)||e.search.category_id);return r||n}()&&(function(){const e=B();if(e){(window.br_data||{})[E]=e}}(),function(e){const t={childList:!0,subtree:!0};new MutationObserver((t=>{t.find((e=>"childList"===e.type&&Array.from(e.addedNodes).find((e=>e.classList&&e.classList.contains("blm-results")))))&&e()})).observe(ue(),t)}((()=>{ue().classList.add("blm-has-loaded"),window.onbeforeunload=function(){let e;void 0!==window.pageYOffset?e=window.pageYOffset:void 0!==document.compatMode&&"BackCompat"!==document.compatMode?e=document.documentElement.scrollTop:void 0!==document.body&&(e=document.body.scrollTop);const t=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}");window.localStorage.setItem("scrollPositions",JSON.stringify({...t,[encodeURI(window.location.href)]:{scrollPosition:e}}))},At(),function(){window.onpopstate=async()=>{await Nt({toReplace:!0})},function(){const e=Ct(),t=document.querySelector(`.blm-price-range-input--lower-${e.request_id}`),r=document.querySelector(`.blm-price-range-input--upper-${e.request_id}`);t&&r&&(t.getAttribute("hasListener")||(t.addEventListener("change",xt()),t.addEventListener("input",Lt(".blm-range-slider__values--min")),t.setAttribute("hasListener","true")),r.getAttribute("hasListener")||(r.addEventListener("change",xt()),r.addEventListener("input",Lt(".blm-range-slider__values--max")),r.setAttribute("hasListener","true")))}(),ht(),_t(),gt(),document.querySelector(".blm-product-search-sidebar")&&(Rt(),bt(),wt(),St(),vt(),le());kt(),qt(),yt(),Et(),Ot()}()})),await Nt(),function(){const e=JSON.parse(window.localStorage.getItem("scrollPositions")||"{}"),t=encodeURI(window.location.href);if(t in e){const r=parseInt(e[t]?.scrollPosition,10);setTimeout((()=>{document.documentElement.scrollTop=r,document.body.scrollTop=r}),250)}delete e[encodeURI(window.location.href)],window.localStorage.setItem("scrollPositions",JSON.stringify(e))}())}}}();window.BloomreachModules={...e,search:Pt},Pt.load().catch(console.error)}(); //# sourceMappingURL=search.js.map diff --git a/view/frontend/web/js/view/recommendation.js b/view/frontend/web/js/view/recommendation.js index 17906b8..76af14b 100644 --- a/view/frontend/web/js/view/recommendation.js +++ b/view/frontend/web/js/view/recommendation.js @@ -26,6 +26,28 @@ define(["uiComponent", "Magento_Customer/js/customer-data","pathwaysRecomSdk"], getWidgetConfig: function () { return this.widgetConfig; }, + getWidgetDataAttrs: function () { + const attrs = { + 'data-id': this.widgetConfig.widget_id, + 'data-type': this.widgetConfig.widget_type, + 'data-title': this.getWidgetTitle(), + 'data-category-id': this.widgetConfig.category_id, + 'data-query': this.widgetConfig.query, + 'data-item-ids': this.widgetConfig.item_ids, + 'data-user-id': this.getCustomer().uniqueId, + 'data-number-of-items-to-show': this.widgetConfig.products_visible, + 'data-number-of-items-to-fetch': this.widgetConfig.products_to_fetch, + }; + if (this.widgetConfig.additional_parameters) { + //decode html entities except double quotes + attrs['data-additional-params'] = this.widgetConfig.additional_parameters + .replaceAll('&', '&') + .replaceAll(''', "'") + .replaceAll('<', '<') + .replaceAll('>', '>'); + } + return attrs; + }, getCustomer: function () { return this.customer(); }, diff --git a/view/frontend/web/template/widget/recommendation.html b/view/frontend/web/template/widget/recommendation.html index ffd427c..bc601cf 100644 --- a/view/frontend/web/template/widget/recommendation.html +++ b/view/frontend/web/template/widget/recommendation.html @@ -7,17 +7,7 @@

+ data-bind="attr: getWidgetDataAttrs()">
...