@ecomplus/search-engine
Version:
JS lib to handle products search with E-Com Plus stores
8 lines • 40.6 kB
JavaScript
var EcomSearch=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=114)}([function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e,r){var n=r(2),o=r(37),i=r(4),u=r(38),c=r(42),a=r(64),s=o("wks"),f=n.Symbol,l=a?f:f&&f.withoutSetter||u;t.exports=function(t){return i(s,t)||(c&&i(f,t)?s[t]=f[t]:s[t]=l("Symbol."+t)),s[t]}},function(t,e,r){(function(e){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof e&&e)||Function("return this")()}).call(this,r(86))},function(t,e,r){var n=r(2),o=r(34).f,i=r(6),u=r(17),c=r(36),a=r(59),s=r(89);t.exports=function(t,e){var r,f,l,p,d,v=t.target,y=t.global,g=t.stat;if(r=y?n:g?n[v]||c(v,{}):(n[v]||{}).prototype)for(f in e){if(p=e[f],l=t.noTargetGet?(d=o(r,f))&&d.value:r[f],!s(y?f:v+(g?".":"#")+f,t.forced)&&void 0!==l){if(typeof p==typeof l)continue;a(p,l)}(t.sham||l&&l.sham)&&i(p,"sham",!0),u(r,f,p,t)}}},function(t,e){var r={}.hasOwnProperty;t.exports=function(t,e){return r.call(t,e)}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,r){var n=r(9),o=r(7),i=r(15);t.exports=n?function(t,e,r){return o.f(t,e,i(1,r))}:function(t,e,r){return t[e]=r,t}},function(t,e,r){var n=r(9),o=r(55),i=r(8),u=r(22),c=Object.defineProperty;e.f=n?c:function(t,e,r){if(i(t),e=u(e,!0),i(r),o)try{return c(t,e,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[e]=r.value),t}},function(t,e,r){var n=r(5);t.exports=function(t){if(!n(t))throw TypeError(String(t)+" is not an object");return t}},function(t,e,r){var n=r(0);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,e,r){var n=r(35),o=r(21);t.exports=function(t){return n(o(t))}},function(t,e,r){var n=r(21);t.exports=function(t){return Object(n(t))}},function(t,e,r){var n=r(9),o=r(0),i=r(4),u=Object.defineProperty,c={},a=function(t){throw t};t.exports=function(t,e){if(i(c,t))return c[t];e||(e={});var r=[][t],s=!!i(e,"ACCESSORS")&&e.ACCESSORS,f=i(e,0)?e[0]:a,l=i(e,1)?e[1]:void 0;return c[t]=!!r&&!o((function(){if(s&&!n)return!0;var t={length:-1};s?u(t,1,{enumerable:!0,get:a}):t[1]=1,r.call(t,f,l)}))}},function(t,e,r){var n=r(28),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},function(t,e){t.exports=_.merge},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,e,r){var n=r(2),o=r(6),i=r(4),u=r(36),c=r(57),a=r(23),s=a.get,f=a.enforce,l=String(String).split("String");(t.exports=function(t,e,r,c){var a=!!c&&!!c.unsafe,s=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof r&&("string"!=typeof e||i(r,"name")||o(r,"name",e),f(r).source=l.join("string"==typeof e?e:"")),t!==n?(a?!p&&t[e]&&(s=!0):delete t[e],s?t[e]=r:o(t,e,r)):s?t[e]=r:u(e,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&s(this).source||c(this)}))},function(t,e,r){var n=r(101),o=r(35),i=r(11),u=r(13),c=r(47),a=[].push,s=function(t){var e=1==t,r=2==t,s=3==t,f=4==t,l=6==t,p=5==t||l;return function(d,v,y,g){for(var h,m,b=i(d),x=o(b),S=n(v,y,3),O=u(x.length),w=0,j=g||c,_=e?j(d,O):r?j(d,0):void 0;O>w;w++)if((p||w in x)&&(m=S(h=x[w],w,b),t))if(e)_[w]=m;else if(m)switch(t){case 3:return!0;case 5:return h;case 6:return w;case 2:a.call(_,h)}else if(f)return!1;return l?-1:s||f?f:_}};t.exports={forEach:s(0),map:s(1),filter:s(2),some:s(3),every:s(4),find:s(5),findIndex:s(6)}},function(t,e,r){var n=r(0),o=r(1),i=r(80),u=o("species");t.exports=function(t){return i>=51||!n((function(){var e=[];return(e.constructor={})[u]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},function(t,e,r){"use strict";var n=r(3),o=r(40),i=r(28),u=r(13),c=r(11),a=r(47),s=r(52),f=r(19),l=r(12),p=f("splice"),d=l("splice",{ACCESSORS:!0,0:0,1:2}),v=Math.max,y=Math.min;n({target:"Array",proto:!0,forced:!p||!d},{splice:function(t,e){var r,n,f,l,p,d,g=c(this),h=u(g.length),m=o(t,h),b=arguments.length;if(0===b?r=n=0:1===b?(r=0,n=h-m):(r=b-2,n=y(v(i(e),0),h-m)),h+r-n>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(f=a(g,n),l=0;l<n;l++)(p=m+l)in g&&s(f,l,g[p]);if(f.length=n,r<n){for(l=m;l<h-n;l++)d=l+r,(p=l+n)in g?g[d]=g[p]:delete g[d];for(l=h;l>h-n+r;l--)delete g[l-1]}else if(r>n)for(l=h-n;l>m;l--)d=l+r-1,(p=l+n-1)in g?g[d]=g[p]:delete g[d];for(l=0;l<r;l++)g[l+m]=arguments[l+2];return g.length=h-n+r,f}})},function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,e,r){var n=r(5);t.exports=function(t,e){if(!n(t))return t;var r,o;if(e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!n(o=r.call(t)))return o;if(!e&&"function"==typeof(r=t.toString)&&!n(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,e,r){var n,o,i,u=r(87),c=r(2),a=r(5),s=r(6),f=r(4),l=r(24),p=r(26),d=c.WeakMap;if(u){var v=new d,y=v.get,g=v.has,h=v.set;n=function(t,e){return h.call(v,t,e),e},o=function(t){return y.call(v,t)||{}},i=function(t){return g.call(v,t)}}else{var m=l("state");p[m]=!0,n=function(t,e){return s(t,m,e),e},o=function(t){return f(t,m)?t[m]:{}},i=function(t){return f(t,m)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(e){var r;if(!a(e)||(r=o(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,e,r){var n=r(37),o=r(38),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,e){t.exports=!1},function(t,e){t.exports={}},function(t,e,r){var n=r(60),o=r(2),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(n[t])||i(o[t]):n[t]&&n[t][e]||o[t]&&o[t][e]}},function(t,e){var r=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:r)(t)}},function(t,e,r){"use strict";var n,o,i=r(90),u=r(91),c=RegExp.prototype.exec,a=String.prototype.replace,s=c,f=(n=/a/,o=/b*/g,c.call(n,"a"),c.call(o,"a"),0!==n.lastIndex||0!==o.lastIndex),l=u.UNSUPPORTED_Y||u.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(f||p||l)&&(s=function(t){var e,r,n,o,u=this,s=l&&u.sticky,d=i.call(u),v=u.source,y=0,g=t;return s&&(-1===(d=d.replace("y","")).indexOf("g")&&(d+="g"),g=String(t).slice(u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==t[u.lastIndex-1])&&(v="(?: "+v+")",g=" "+g,y++),r=new RegExp("^(?:"+v+")",d)),p&&(r=new RegExp("^"+v+"$(?!\\s)",d)),f&&(e=u.lastIndex),n=c.call(s?r:u,g),s?n?(n.input=n.input.slice(y),n[0]=n[0].slice(y),n.index=u.lastIndex,u.lastIndex+=n[0].length):u.lastIndex=0:f&&n&&(u.lastIndex=u.global?n.index+n[0].length:e),p&&n&&n.length>1&&a.call(n[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(n[o]=void 0)})),n}),t.exports=s},function(t,e,r){var n=r(16);t.exports=Array.isArray||function(t){return"Array"==n(t)}},function(t,e,r){"use strict";var n=r(0);t.exports=function(t,e){var r=[][t];return!!r&&n((function(){r.call(null,e||function(){throw 1},1)}))}},function(t,e){t.exports=ecomUtils},function(t,e){t.exports=_.cloneDeep},function(t,e,r){var n=r(9),o=r(54),i=r(15),u=r(10),c=r(22),a=r(4),s=r(55),f=Object.getOwnPropertyDescriptor;e.f=n?f:function(t,e){if(t=u(t),e=c(e,!0),s)try{return f(t,e)}catch(t){}if(a(t,e))return i(!o.f.call(t,e),t[e])}},function(t,e,r){var n=r(0),o=r(16),i="".split;t.exports=n((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,e,r){var n=r(2),o=r(6);t.exports=function(t,e){try{o(n,t,e)}catch(r){n[t]=e}return e}},function(t,e,r){var n=r(25),o=r(58);(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.4",mode:n?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,e){var r=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+n).toString(36)}},function(t,e,r){var n=r(61),o=r(41).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},function(t,e,r){var n=r(28),o=Math.max,i=Math.min;t.exports=function(t,e){var r=n(t);return r<0?o(r+e,0):i(r,e)}},function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,e,r){var n=r(0);t.exports=!!Object.getOwnPropertySymbols&&!n((function(){return!String(Symbol())}))},function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,e,r){var n,o=r(8),i=r(98),u=r(41),c=r(26),a=r(99),s=r(56),f=r(24),l=f("IE_PROTO"),p=function(){},d=function(t){return"<script>"+t+"<\/script>"},v=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;v=n?function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e}(n):((e=s("iframe")).style.display="none",a.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F);for(var r=u.length;r--;)delete v.prototype[u[r]];return v()};c[l]=!0,t.exports=Object.create||function(t,e){var r;return null!==t?(p.prototype=o(t),r=new p,p.prototype=null,r[l]=t):r=v(),void 0===e?r:i(r,e)}},function(t,e,r){var n=r(61),o=r(41);t.exports=Object.keys||function(t){return n(t,o)}},function(t,e,r){var n=r(7).f,o=r(4),i=r(1)("toStringTag");t.exports=function(t,e,r){t&&!o(t=r?t:t.prototype,i)&&n(t,i,{configurable:!0,value:e})}},function(t,e,r){var n=r(5),o=r(30),i=r(1)("species");t.exports=function(t,e){var r;return o(t)&&("function"!=typeof(r=t.constructor)||r!==Array&&!o(r.prototype)?n(r)&&null===(r=r[i])&&(r=void 0):r=void 0),new(void 0===r?Array:r)(0===e?0:e)}},function(t,e,r){var n={};n[r(1)("toStringTag")]="z",t.exports="[object z]"===String(n)},function(t,e,r){"use strict";var n=r(10),o=r(72),i=r(50),u=r(23),c=r(73),a=u.set,s=u.getterFor("Array Iterator");t.exports=c(Array,"Array",(function(t,e){a(this,{type:"Array Iterator",target:n(t),index:0,kind:e})}),(function(){var t=s(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},function(t,e){t.exports={}},function(t,e,r){var n=r(3),o=r(11),i=r(45);n({target:"Object",stat:!0,forced:r(0)((function(){i(1)}))},{keys:function(t){return i(o(t))}})},function(t,e,r){"use strict";var n=r(22),o=r(7),i=r(15);t.exports=function(t,e,r){var u=n(e);u in t?o.f(t,u,i(0,r)):t[u]=r}},function(t,e,r){"use strict";var n=r(3),o=r(29);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},function(t,e,r){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!n.call({1:2},1);e.f=i?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},function(t,e,r){var n=r(9),o=r(0),i=r(56);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,e,r){var n=r(2),o=r(5),i=n.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,e,r){var n=r(58),o=Function.toString;"function"!=typeof n.inspectSource&&(n.inspectSource=function(t){return o.call(t)}),t.exports=n.inspectSource},function(t,e,r){var n=r(2),o=r(36),i=n["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,e,r){var n=r(4),o=r(88),i=r(34),u=r(7);t.exports=function(t,e){for(var r=o(e),c=u.f,a=i.f,s=0;s<r.length;s++){var f=r[s];n(t,f)||c(t,f,a(e,f))}}},function(t,e,r){var n=r(2);t.exports=n},function(t,e,r){var n=r(4),o=r(10),i=r(62).indexOf,u=r(26);t.exports=function(t,e){var r,c=o(t),a=0,s=[];for(r in c)!n(u,r)&&n(c,r)&&s.push(r);for(;e.length>a;)n(c,r=e[a++])&&(~i(s,r)||s.push(r));return s}},function(t,e,r){var n=r(10),o=r(13),i=r(40),u=function(t){return function(e,r,u){var c,a=n(e),s=o(a.length),f=i(u,s);if(t&&r!=r){for(;s>f;)if((c=a[f++])!=c)return!0}else for(;s>f;f++)if((t||f in a)&&a[f]===r)return t||f||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,r){var n=r(42);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,e,r){var n=r(28),o=r(21),i=function(t){return function(e,r){var i,u,c=String(o(e)),a=n(r),s=c.length;return a<0||a>=s?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===s||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,e,r){"use strict";var n=r(3),o=r(2),i=r(27),u=r(25),c=r(9),a=r(42),s=r(64),f=r(0),l=r(4),p=r(30),d=r(5),v=r(8),y=r(11),g=r(10),h=r(22),m=r(15),b=r(44),x=r(45),S=r(39),O=r(100),w=r(63),j=r(34),_=r(7),A=r(54),E=r(6),P=r(17),T=r(37),I=r(24),k=r(26),C=r(38),R=r(1),L=r(67),M=r(68),N=r(46),F=r(23),q=r(18).forEach,D=I("hidden"),G=R("toPrimitive"),U=F.set,z=F.getterFor("Symbol"),B=Object.prototype,$=o.Symbol,V=i("JSON","stringify"),W=j.f,K=_.f,H=O.f,Y=A.f,J=T("symbols"),X=T("op-symbols"),Q=T("string-to-symbol-registry"),Z=T("symbol-to-string-registry"),tt=T("wks"),et=o.QObject,rt=!et||!et.prototype||!et.prototype.findChild,nt=c&&f((function(){return 7!=b(K({},"a",{get:function(){return K(this,"a",{value:7}).a}})).a}))?function(t,e,r){var n=W(B,e);n&&delete B[e],K(t,e,r),n&&t!==B&&K(B,e,n)}:K,ot=function(t,e){var r=J[t]=b($.prototype);return U(r,{type:"Symbol",tag:t,description:e}),c||(r.description=e),r},it=s?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof $},ut=function(t,e,r){t===B&&ut(X,e,r),v(t);var n=h(e,!0);return v(r),l(J,n)?(r.enumerable?(l(t,D)&&t[D][n]&&(t[D][n]=!1),r=b(r,{enumerable:m(0,!1)})):(l(t,D)||K(t,D,m(1,{})),t[D][n]=!0),nt(t,n,r)):K(t,n,r)},ct=function(t,e){v(t);var r=g(e),n=x(r).concat(lt(r));return q(n,(function(e){c&&!at.call(r,e)||ut(t,e,r[e])})),t},at=function(t){var e=h(t,!0),r=Y.call(this,e);return!(this===B&&l(J,e)&&!l(X,e))&&(!(r||!l(this,e)||!l(J,e)||l(this,D)&&this[D][e])||r)},st=function(t,e){var r=g(t),n=h(e,!0);if(r!==B||!l(J,n)||l(X,n)){var o=W(r,n);return!o||!l(J,n)||l(r,D)&&r[D][n]||(o.enumerable=!0),o}},ft=function(t){var e=H(g(t)),r=[];return q(e,(function(t){l(J,t)||l(k,t)||r.push(t)})),r},lt=function(t){var e=t===B,r=H(e?X:g(t)),n=[];return q(r,(function(t){!l(J,t)||e&&!l(B,t)||n.push(J[t])})),n};(a||(P(($=function(){if(this instanceof $)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=C(t),r=function(t){this===B&&r.call(X,t),l(this,D)&&l(this[D],e)&&(this[D][e]=!1),nt(this,e,m(1,t))};return c&&rt&&nt(B,e,{configurable:!0,set:r}),ot(e,t)}).prototype,"toString",(function(){return z(this).tag})),P($,"withoutSetter",(function(t){return ot(C(t),t)})),A.f=at,_.f=ut,j.f=st,S.f=O.f=ft,w.f=lt,L.f=function(t){return ot(R(t),t)},c&&(K($.prototype,"description",{configurable:!0,get:function(){return z(this).description}}),u||P(B,"propertyIsEnumerable",at,{unsafe:!0}))),n({global:!0,wrap:!0,forced:!a,sham:!a},{Symbol:$}),q(x(tt),(function(t){M(t)})),n({target:"Symbol",stat:!0,forced:!a},{for:function(t){var e=String(t);if(l(Q,e))return Q[e];var r=$(e);return Q[e]=r,Z[r]=e,r},keyFor:function(t){if(!it(t))throw TypeError(t+" is not a symbol");if(l(Z,t))return Z[t]},useSetter:function(){rt=!0},useSimple:function(){rt=!1}}),n({target:"Object",stat:!0,forced:!a,sham:!c},{create:function(t,e){return void 0===e?b(t):ct(b(t),e)},defineProperty:ut,defineProperties:ct,getOwnPropertyDescriptor:st}),n({target:"Object",stat:!0,forced:!a},{getOwnPropertyNames:ft,getOwnPropertySymbols:lt}),n({target:"Object",stat:!0,forced:f((function(){w.f(1)}))},{getOwnPropertySymbols:function(t){return w.f(y(t))}}),V)&&n({target:"JSON",stat:!0,forced:!a||f((function(){var t=$();return"[null]"!=V([t])||"{}"!=V({a:t})||"{}"!=V(Object(t))}))},{stringify:function(t,e,r){for(var n,o=[t],i=1;arguments.length>i;)o.push(arguments[i++]);if(n=e,(d(e)||void 0!==t)&&!it(t))return p(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!it(e))return e}),o[1]=e,V.apply(null,o)}});$.prototype[G]||E($.prototype,G,$.prototype.valueOf),N($,"Symbol"),k[D]=!0},function(t,e,r){var n=r(1);e.f=n},function(t,e,r){var n=r(60),o=r(4),i=r(67),u=r(7).f;t.exports=function(t){var e=n.Symbol||(n.Symbol={});o(e,t)||u(e,t,{value:i.f(t)})}},function(t,e,r){"use strict";var n=r(3),o=r(9),i=r(2),u=r(4),c=r(5),a=r(7).f,s=r(59),f=i.Symbol;if(o&&"function"==typeof f&&(!("description"in f.prototype)||void 0!==f().description)){var l={},p=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof p?new f(t):void 0===t?f():f(t);return""===t&&(l[e]=!0),e};s(p,f);var d=p.prototype=f.prototype;d.constructor=p;var v=d.toString,y="Symbol(test)"==String(f("test")),g=/^Symbol\((.*)\)[^)]+$/;a(d,"description",{configurable:!0,get:function(){var t=c(this)?this.valueOf():this,e=v.call(t);if(u(l,t))return"";var r=y?e.slice(7,-1):e.replace(g,"$1");return""===r?void 0:r}}),n({global:!0,forced:!0},{Symbol:p})}},function(t,e,r){var n=r(48),o=r(17),i=r(102);n||o(Object.prototype,"toString",i,{unsafe:!0})},function(t,e,r){r(68)("iterator")},function(t,e,r){var n=r(1),o=r(44),i=r(7),u=n("unscopables"),c=Array.prototype;null==c[u]&&i.f(c,u,{configurable:!0,value:o(null)}),t.exports=function(t){c[u][t]=!0}},function(t,e,r){"use strict";var n=r(3),o=r(104),i=r(75),u=r(106),c=r(46),a=r(6),s=r(17),f=r(1),l=r(25),p=r(50),d=r(74),v=d.IteratorPrototype,y=d.BUGGY_SAFARI_ITERATORS,g=f("iterator"),h=function(){return this};t.exports=function(t,e,r,f,d,m,b){o(r,e,f);var x,S,O,w=function(t){if(t===d&&P)return P;if(!y&&t in A)return A[t];switch(t){case"keys":case"values":case"entries":return function(){return new r(this,t)}}return function(){return new r(this)}},j=e+" Iterator",_=!1,A=t.prototype,E=A[g]||A["@@iterator"]||d&&A[d],P=!y&&E||w(d),T="Array"==e&&A.entries||E;if(T&&(x=i(T.call(new t)),v!==Object.prototype&&x.next&&(l||i(x)===v||(u?u(x,v):"function"!=typeof x[g]&&a(x,g,h)),c(x,j,!0,!0),l&&(p[j]=h))),"values"==d&&E&&"values"!==E.name&&(_=!0,P=function(){return E.call(this)}),l&&!b||A[g]===P||a(A,g,P),p[e]=P,d)if(S={values:w("values"),keys:m?P:w("keys"),entries:w("entries")},b)for(O in S)(y||_||!(O in A))&&s(A,O,S[O]);else n({target:e,proto:!0,forced:y||_},S);return S}},function(t,e,r){"use strict";var n,o,i,u=r(75),c=r(6),a=r(4),s=r(1),f=r(25),l=s("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(o=u(u(i)))!==Object.prototype&&(n=o):p=!0),null==n&&(n={}),f||a(n,l)||c(n,l,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:p}},function(t,e,r){var n=r(4),o=r(11),i=r(24),u=r(105),c=i("IE_PROTO"),a=Object.prototype;t.exports=u?Object.getPrototypeOf:function(t){return t=o(t),n(t,c)?t[c]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},function(t,e,r){"use strict";var n=r(65).charAt,o=r(23),i=r(73),u=o.set,c=o.getterFor("String Iterator");i(String,"String",(function(t){u(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=c(this),r=e.string,o=e.index;return o>=r.length?{value:void 0,done:!0}:(t=n(r,o),e.index+=t.length,{value:t,done:!1})}))},function(t,e,r){var n=r(2),o=r(78),i=r(49),u=r(6),c=r(1),a=c("iterator"),s=c("toStringTag"),f=i.values;for(var l in o){var p=n[l],d=p&&p.prototype;if(d){if(d[a]!==f)try{u(d,a,f)}catch(t){d[a]=f}if(d[s]||u(d,s,l),o[l])for(var v in i)if(d[v]!==i[v])try{u(d,v,i[v])}catch(t){d[v]=i[v]}}}},function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},function(t,e,r){"use strict";var n=r(3),o=r(18).filter,i=r(19),u=r(12),c=i("filter"),a=u("filter");n({target:"Array",proto:!0,forced:!c||!a},{filter:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){var n,o,i=r(2),u=r(110),c=i.process,a=c&&c.versions,s=a&&a.v8;s?o=(n=s.split("."))[0]+n[1]:u&&(!(n=u.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=u.match(/Chrome\/(\d+)/))&&(o=n[1]),t.exports=o&&+o},function(t,e,r){"use strict";var n=r(3),o=r(0),i=r(30),u=r(5),c=r(11),a=r(13),s=r(52),f=r(47),l=r(19),p=r(1),d=r(80),v=p("isConcatSpreadable"),y=d>=51||!o((function(){var t=[];return t[v]=!1,t.concat()[0]!==t})),g=l("concat"),h=function(t){if(!u(t))return!1;var e=t[v];return void 0!==e?!!e:i(t)};n({target:"Array",proto:!0,forced:!y||!g},{concat:function(t){var e,r,n,o,i,u=c(this),l=f(u,0),p=0;for(e=-1,n=arguments.length;e<n;e++)if(h(i=-1===e?u:arguments[e])){if(p+(o=a(i.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(r=0;r<o;r++,p++)r in i&&s(l,p,i[r])}else{if(p>=9007199254740991)throw TypeError("Maximum allowed index exceeded");s(l,p++,i)}return l.length=p,l}})},function(t,e,r){"use strict";var n=r(3),o=r(5),i=r(30),u=r(40),c=r(13),a=r(10),s=r(52),f=r(1),l=r(19),p=r(12),d=l("slice"),v=p("slice",{ACCESSORS:!0,0:0,1:2}),y=f("species"),g=[].slice,h=Math.max;n({target:"Array",proto:!0,forced:!d||!v},{slice:function(t,e){var r,n,f,l=a(this),p=c(l.length),d=u(t,p),v=u(void 0===e?p:e,p);if(i(l)&&("function"!=typeof(r=l.constructor)||r!==Array&&!i(r.prototype)?o(r)&&null===(r=r[y])&&(r=void 0):r=void 0,r===Array||void 0===r))return g.call(l,d,v);for(n=new(void 0===r?Array:r)(h(v-d,0)),f=0;d<v;d++,f++)d in l&&s(n,f,l[d]);return n.length=f,n}})},function(t,e,r){"use strict";var n=r(3),o=r(43),i=r(11),u=r(0),c=r(31),a=[],s=a.sort,f=u((function(){a.sort(void 0)})),l=u((function(){a.sort(null)})),p=c("sort");n({target:"Array",proto:!0,forced:f||!l||!p},{sort:function(t){return void 0===t?s.call(i(this)):s.call(i(this),o(t))}})},function(t,e,r){"use strict";var n=r(3),o=r(18).find,i=r(72),u=r(12),c=!0,a=u("find");"find"in[]&&Array(1).find((function(){c=!1})),n({target:"Array",proto:!0,forced:c||!a},{find:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),i("find")},function(t,e){t.exports=ecomClient},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e,r){var n=r(2),o=r(57),i=n.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,e,r){var n=r(27),o=r(39),i=r(63),u=r(8);t.exports=n("Reflect","ownKeys")||function(t){var e=o.f(u(t)),r=i.f;return r?e.concat(r(t)):e}},function(t,e,r){var n=r(0),o=/#|\.prototype\./,i=function(t,e){var r=c[u(t)];return r==s||r!=a&&("function"==typeof e?n(e):!!e)},u=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=i.data={},a=i.NATIVE="N",s=i.POLYFILL="P";t.exports=i},function(t,e,r){"use strict";var n=r(8);t.exports=function(){var t=n(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},function(t,e,r){"use strict";var n=r(0);function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=n((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=n((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},function(t,e,r){"use strict";var n=r(93),o=r(94),i=r(8),u=r(21),c=r(95),a=r(96),s=r(13),f=r(97),l=r(29),p=r(0),d=[].push,v=Math.min,y=!p((function(){return!RegExp(4294967295,"y")}));n("split",2,(function(t,e,r){var n;return n="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var n=String(u(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===t)return[n];if(!o(t))return e.call(n,t,i);for(var c,a,s,f=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),v=0,y=new RegExp(t.source,p+"g");(c=l.call(y,n))&&!((a=y.lastIndex)>v&&(f.push(n.slice(v,c.index)),c.length>1&&c.index<n.length&&d.apply(f,c.slice(1)),s=c[0].length,v=a,f.length>=i));)y.lastIndex===c.index&&y.lastIndex++;return v===n.length?!s&&y.test("")||f.push(""):f.push(n.slice(v)),f.length>i?f.slice(0,i):f}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:e.call(this,t,r)}:e,[function(e,r){var o=u(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,o,r):n.call(String(o),e,r)},function(t,o){var u=r(n,t,this,o,n!==e);if(u.done)return u.value;var l=i(t),p=String(this),d=c(l,RegExp),g=l.unicode,h=(l.ignoreCase?"i":"")+(l.multiline?"m":"")+(l.unicode?"u":"")+(y?"y":"g"),m=new d(y?l:"^(?:"+l.source+")",h),b=void 0===o?4294967295:o>>>0;if(0===b)return[];if(0===p.length)return null===f(m,p)?[p]:[];for(var x=0,S=0,O=[];S<p.length;){m.lastIndex=y?S:0;var w,j=f(m,y?p:p.slice(S));if(null===j||(w=v(s(m.lastIndex+(y?0:S)),p.length))===x)S=a(p,S,g);else{if(O.push(p.slice(x,S)),O.length===b)return O;for(var _=1;_<=j.length-1;_++)if(O.push(j[_]),O.length===b)return O;S=x=w}}return O.push(p.slice(x)),O}]}),!y)},function(t,e,r){"use strict";r(53);var n=r(17),o=r(0),i=r(1),u=r(29),c=r(6),a=i("species"),s=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),f="$0"==="a".replace(/./,"$0"),l=i("replace"),p=!!/./[l]&&""===/./[l]("a","$0"),d=!o((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));t.exports=function(t,e,r,l){var v=i(t),y=!o((function(){var e={};return e[v]=function(){return 7},7!=""[t](e)})),g=y&&!o((function(){var e=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[a]=function(){return r},r.flags="",r[v]=/./[v]),r.exec=function(){return e=!0,null},r[v](""),!e}));if(!y||!g||"replace"===t&&(!s||!f||p)||"split"===t&&!d){var h=/./[v],m=r(v,""[t],(function(t,e,r,n,o){return e.exec===u?y&&!o?{done:!0,value:h.call(e,r,n)}:{done:!0,value:t.call(r,e,n)}:{done:!1}}),{REPLACE_KEEPS_$0:f,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=m[0],x=m[1];n(String.prototype,t,b),n(RegExp.prototype,v,2==e?function(t,e){return x.call(t,this,e)}:function(t){return x.call(t,this)})}l&&c(RegExp.prototype[v],"sham",!0)}},function(t,e,r){var n=r(5),o=r(16),i=r(1)("match");t.exports=function(t){var e;return n(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==o(t))}},function(t,e,r){var n=r(8),o=r(43),i=r(1)("species");t.exports=function(t,e){var r,u=n(t).constructor;return void 0===u||null==(r=n(u)[i])?e:o(r)}},function(t,e,r){"use strict";var n=r(65).charAt;t.exports=function(t,e,r){return e+(r?n(t,e).length:1)}},function(t,e,r){var n=r(16),o=r(29);t.exports=function(t,e){var r=t.exec;if("function"==typeof r){var i=r.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==n(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},function(t,e,r){var n=r(9),o=r(7),i=r(8),u=r(45);t.exports=n?Object.defineProperties:function(t,e){i(t);for(var r,n=u(e),c=n.length,a=0;c>a;)o.f(t,r=n[a++],e[r]);return t}},function(t,e,r){var n=r(27);t.exports=n("document","documentElement")},function(t,e,r){var n=r(10),o=r(39).f,i={}.toString,u="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return u&&"[object Window]"==i.call(t)?function(t){try{return o(t)}catch(t){return u.slice()}}(t):o(n(t))}},function(t,e,r){var n=r(43);t.exports=function(t,e,r){if(n(t),void 0===e)return t;switch(r){case 0:return function(){return t.call(e)};case 1:return function(r){return t.call(e,r)};case 2:return function(r,n){return t.call(e,r,n)};case 3:return function(r,n,o){return t.call(e,r,n,o)}}return function(){return t.apply(e,arguments)}}},function(t,e,r){"use strict";var n=r(48),o=r(103);t.exports=n?{}.toString:function(){return"[object "+o(this)+"]"}},function(t,e,r){var n=r(48),o=r(16),i=r(1)("toStringTag"),u="Arguments"==o(function(){return arguments}());t.exports=n?o:function(t){var e,r,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(r=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?r:u?o(e):"Object"==(n=o(e))&&"function"==typeof e.callee?"Arguments":n}},function(t,e,r){"use strict";var n=r(74).IteratorPrototype,o=r(44),i=r(15),u=r(46),c=r(50),a=function(){return this};t.exports=function(t,e,r){var s=e+" Iterator";return t.prototype=o(n,{next:i(1,r)}),u(t,s,!1,!0),c[s]=a,t}},function(t,e,r){var n=r(0);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},function(t,e,r){var n=r(8),o=r(107);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,r={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),e=r instanceof Array}catch(t){}return function(r,i){return n(r),o(i),e?t.call(r,i):r.__proto__=i,r}}():void 0)},function(t,e,r){var n=r(5);t.exports=function(t){if(!n(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},function(t,e,r){var n=r(2),o=r(78),i=r(109),u=r(6);for(var c in o){var a=n[c],s=a&&a.prototype;if(s&&s.forEach!==i)try{u(s,"forEach",i)}catch(t){s.forEach=i}}},function(t,e,r){"use strict";var n=r(18).forEach,o=r(31),i=r(12),u=o("forEach"),c=i("forEach");t.exports=u&&c?[].forEach:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}},function(t,e,r){var n=r(27);t.exports=n("navigator","userAgent")||""},function(t,e,r){"use strict";var n=r(3),o=r(35),i=r(10),u=r(31),c=[].join,a=o!=Object,s=u("join",",");n({target:"Array",proto:!0,forced:a||!s},{join:function(t){return c.call(i(this),void 0===t?",":t)}})},function(t,e,r){"use strict";var n=r(3),o=r(62).indexOf,i=r(31),u=r(12),c=[].indexOf,a=!!c&&1/[1].indexOf(1,-0)<0,s=i("indexOf"),f=u("indexOf",{ACCESSORS:!0,1:0});n({target:"Array",proto:!0,forced:a||!s||!f},{indexOf:function(t){return a?c.apply(this,arguments)||0:o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){"use strict";var n=r(3),o=r(18).map,i=r(19),u=r(12),c=i("map"),a=u("map");n({target:"Array",proto:!0,forced:!c||!a},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},function(t,e,r){"use strict";r.r(e),r.d(e,"EcomSearch",(function(){return G})),r.d(e,"dslMiddlewares",(function(){return u})),r.d(e,"addGlobalFilter",(function(){return z})),r.d(e,"setSalesChannel",(function(){return B})),r.d(e,"setWarehouse",(function(){return $}));r(53),r(92),r(66),r(69),r(70),r(71),r(49),r(76),r(77);var n=r(32),o=(r(108),r(79),r(51),r(81),r(111),r(112),r(20),r(82),r(85)),i=r(33),u=[],c=function(t,e,r){var n={url:"/items.json",storeId:t.storeId,axiosConfig:r},c=i(t.dsl);if(u.forEach((function(t){if("function"==typeof t){var e=t(c);e&&(c=e)}})),!0===e){var a=c.query;if(n.url+="?q=",a&&a.bool&&Array.isArray(a.bool.filter)){var s="";a.bool.filter.forEach((function(t,e){var r=t.term,n=t.terms;e>0&&(s+=" AND ");var o=r||n;if(o){var i=Object.keys(o)[0],u=o[i];s+="".concat(i,":").concat(Array.isArray(u)?'("'.concat(u.join('" "'),'")'):u)}})),n.url+=encodeURIComponent(s)}["from","size"].forEach((function(t){c[t]&&(n.url+="&".concat(t,"=").concat(c[t]))}))}else n.method="post",n.data=c,e&&!r&&(n.axiosConfig=e);return Object(o.search)(n).then((function(e){var r=e.data;t.result=r;var n=t.dsl,o=t.history,i=t.localStorage,u=t.storageKey;if(r.hits.total&&n&&n.suggest){var c=n.suggest.text;if(c){var a=o.indexOf(c);a>-1&&o.splice(a,1),o.unshift(c),i&&u&&i.setItem(u,o.slice(0,20).join("||"))}}return r}))},a={query:{bool:{filter:[{term:{visible:!0}}]}},sort:[{in_stock:{order:"desc"}},{ad_relevance:{order:"desc"}},"_score"],aggs:{brands:{terms:{field:"brands.name"}},categories:{terms:{field:"categories.name"}},specs:{nested:{path:"specs"},aggs:{grid:{terms:{field:"specs.grid",size:30},aggs:{text:{terms:{field:"specs.text"}}}}}},min_price:{min:{field:"price"}},max_price:{max:{field:"price"}},avg_price:{avg:{field:"price"}}}},s=function(t){return t.dsl=i(a),t.result=void 0,t.setPageSize().setSortOrder()},f=r(14),l=function(t,e){return t.mergeFilter({multi_match:{query:e,fields:["name","keywords"]}},"must"),f(t.dsl,{suggest:{text:e,words:{term:{field:"name"}}}}),t},p=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return t.dsl.from=t.dsl.size*(e-1),t},d=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:24;return t.dsl.size=e,t};r(83);var v=function(t,e){var r,n,o,i,u=a.sort.slice();switch(e){case"sales":u.splice(2,0,{sales:{order:"desc"}});break;case"news":u[u.length-1]={_id:{order:"desc"}};break;case"lowest_price":case"highest_price":u.splice(1,0,{price:{order:"lowest_price"===e?"asc":"desc"}});break;case"offers":r=Date.now(),u.splice(1,0,{_script:{type:"number",script:{lang:"painless",source:"doc['price'].value > 0 && doc['base_price'].value > 0 && (doc['price_effective_date.start'].empty || "+"doc['price_effective_date.start'].date.millis <= ".concat(r,"L)")+" && (doc['price_effective_date.end'].empty || "+"doc['price_effective_date.end'].date.millis >= ".concat(r,"L)")+" ? doc['base_price'].value / doc['price'].value : 0"},order:"desc"}});break;case"views":case"":case void 0:case null:u.push({views:{order:"desc"}});break;default:u.splice(1,0,(i={order:"asc"},(o=e)in(n={})?Object.defineProperty(n,o,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[o]=i,n))}return t.dsl.sort=u,t};r(84);function y(t){return(y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function g(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var h=function(t,e){var r=t&&t.nested&&t.nested.query;if(r&&r.bool&&Array.isArray(r.bool[e]))return r.bool[e].find((function(t){return t.term}))},m=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"filter",n=Object.keys(e)[0];f(t.dsl,{query:{bool:g({},r,[])}});var o,i=t.dsl.query.bool[r];switch(n){case"terms":case"term":case"multi_match":case"range":if("object"===y(e[n])&&null!==e[n])for(var u=Object.keys(e[n])[0],c=0;c<i.length;c++){var a=i[c][Object.keys(i[c])[0]];if("object"===y(a)&&null!==a&&Object.keys(a)[0]===u)return i[c]=e,t}break;case"nested":if(o=h(e,r))for(var s=Object.keys(o.term)[0],l=o.term[s],p=0;p<i.length;p++){var d=h(i[p],r);if(d&&d.term[s]===l)return i[p]=e,t}}return i.push(e),t},b=function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"filter",n=t.dsl.query&&t.dsl.query.bool&&t.dsl.query.bool[r];if(Array.isArray(n))for(var o=0;o<n.length;o++){var i=n[o];if(i.nested&&i.nested.path===e||i[Object.keys(i)[0]][e]){n.splice(o,1);break}}return t},x=function(t,e,r){if(Array.isArray(r))return t.mergeFilter({nested:{path:"specs",query:{bool:{filter:[{term:{"specs.grid":e}},{terms:{"specs.text":r}}]}}}});if(null===r){var n=t.dsl.query&&t.dsl.query.bool&&t.dsl.query.bool.filter;if(Array.isArray(n))for(var o=0;o<n.length;o++)if(n[o]&&n[o].nested){var i=n[o].nested,u=i.path,c=i.query;if("specs"===u&&c&&c.bool){var a=c.bool.filter;if(Array.isArray(a)&&a.find((function(t){var r=t.term;return r&&r["specs.grid"]===e})))return n.splice(o,1),t}}}return t},S=function(t,e,r,n,o){var i=null!==e?"".concat(e,".").concat(r):r;if(Array.isArray(n)){var u,c={terms:{}};return c.terms[i]=n,u=null!==e?"".concat(e,".").concat("_id"===r?"name":"_id"):"_id"===r?"sku":"_id",t.removeFilter(u,o).mergeFilter(c,o)}return null===n?t.removeFilter(i,o):t},O=function(t,e){return S(t,"categories","name",e,"must")},w=function(t,e){return S(t,"categories","_id",e,"must")},j=function(t,e){return S(t,"brands","name",e)},_=function(t,e){return S(t,"brands","_id",e)},A=function(t,e){return S(t,null,"sku",e)},E=function(t,e){return S(t,null,"_id",e)},P=function(t,e,r){var n={};return"number"!=typeof e||isNaN(e)||(n.gte=e),"number"!=typeof r||isNaN(r)||(n.lte=r),t.mergeFilter({range:{price:n}})},T=function(t,e){return e||(e=t.result),Object(n.searchedItems)(e)},I=function(t,e){return e||(e=t.result||{}),e.hits?e.hits.total:void 0},k=function(t,e){return e||(e=t.result||{}),e.suggest&&e.suggest.words||[]},C=function(t,e){var r,n=t.aggregations;return n&&n[e]&&(r=n[e].buckets),Array.isArray(r)&&r||[]},R=function(t,e){return C(e||t.result||{},"brands")},L=function(t,e){return C(e||t.result||{},"categories")},M=function(t,e){e||(e=t.result||{});var r=e.aggregations;return r?{min:r.min_price&&r.min_price.value||0,avg:r.avg_price&&r.avg_price.value||0,max:r.max_price&&r.max_price.value||0}:{min:0,avg:0,max:0}},N=(r(113),function(t,e){if(e||(e=t.result||{}),e.aggregations){var r=e.aggregations.specs;if(r&&r.grid&&Array.isArray(r.grid.buckets))return r.grid.buckets.map((function(t){return{key:t.key,doc_count:t.doc_count,options:t.text&&t.text.buckets||[]}}))}return[]});function F(t){return(F="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var q="ecomSeachHistory",D="object"===("undefined"==typeof window?"undefined":F(window))&&window.localStorage,G=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:q,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:D,o=this;if(this.storeId=t||n.$ecomConfig.get("store_id"),this.storageKey=e,this.localStorage=r,this.history=[],this.dsl={},this.result=void 0,this.fetch=function(t,e){return c(o,t,e)},this.reset=function(){return s(o)},this.setSearchTerm=function(t){return l(o,t)},this.setPageNumber=function(t){return p(o,t)},this.setPageSize=function(t){return d(o,t)},this.setSortOrder=function(t){return v(o,t)},this.mergeFilter=function(t,e){return m(o,t,e)},this.removeFilter=function(t,e){return b(o,t,e)},this.setSpec=function(t,e){return x(o,t,e)},this.setCategoryNames=function(t){return O(o,t)},this.setCategoryIds=function(t){return w(o,t)},this.setBrandNames=function(t){return j(o,t)},this.setBrandIds=function(t){return _(o,t)},this.setSkus=function(t){return A(o,t)},this.setProductIds=function(t){return E(o,t)},this.setPriceRange=function(t,e){return P(o,t,e)},this.getItems=function(t){return T(o,t)},this.getTotalCount=function(t){return I(o,t)},this.getTermSuggestions=function(t){return k(o,t)},this.getBrands=function(t){return R(o,t)},this.getCategories=function(t){return L(o,t)},this.getPriceRange=function(t){return M(o,t)},this.getSpecs=function(t){return N(o,t)},s(o),r&&e){var i=r.getItem(e);"string"==typeof i&&(o.history=i.split("||"))}};function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var z=function(t,e){u.push((function(r){f(r,{query:{bool:{filter:[{term:U({},t,e)}]}}})}))},B=function(t){return z("channel_id",t)},$=function(t){u.push((function(e){e.sort||(e.sort=[]),e.sort.splice(1,0,{"warehouses.in_stock":{order:"desc",nested:{path:"warehouses",filter:{term:{"warehouses.code":t}}}}})}))};
/*!
* @ecomplus/search-engine
* (c) E-Com Club <ti@e-com.club>
* Released under the MIT License.
*/
G.dslMiddlewares=u,G.addGlobalFilter=z,G.setSalesChannel=B,G.setWarehouse=$;e.default=G}]).default;
//# sourceMappingURL=ecom-search.var.min.js.map