1import{$ as oa,b as Vs,w as Bs,e as qs,T as Ks}from"./actionConstants-C5uiKSe-.js";import{r as F,a as Ce,j as S,g as cn,R as Gs}from"./react-DV1t-RFr.js";import{bj as zs,U as ua,W as Js,Y as Xt,y as Yt,ad as yr,d as Qe,n as Zt,V as ca,K as er,ac as ar,l as On,k as vt,bk as Xs,q as Re,ax as qe,aA as sr,aq as Ys,a3 as dt,aj as Pe,u as la,B as Zs,D as eo,H as to,an as fa,G as ro,bl as no,b0 as io,I as ao}from"./User-DHinwHkO.js";import{T as ge,b as so,c as oo,g as Pr,a as da,d as br,e as uo,f as co,h as lo}from"./noop-CHqUgUQY.js";import{c as hr,a as fo,t as ho}from"./Trash-C9p4crdT.js";import{u as Ve}from"./Tick-kzBn0Rae.js";import{c as ha,G as ma,a as mo}from"./TrustpilotWidget-BhZ9u-TD.js";import{X as po,x as go,L as vo}from"./GDDisclosure-TLcJknQw.js";import{A as yo,m as xn}from"./GDLoadingMask-DSFILG4m.js";import{g as bo}from"./get-oSic4u4X.js";import{b as So,F as pa,c as Ro,G as Po,a as ga,e as jo,m as wo,d as va,u as ya,f as Oo}from"./GDSortBar-CheIF4vo.js";import{G as ba}from"./GDCheckBox-CNlNe6Oq.js";import{b as xo,P as _n}from"./montage-4uOljcrL.js";import{c as _o}from"./GDRichText-Dsy30Gn5.js";import{d as Fo,e as $o}from"./GDFlashMessage-fHnnJoCs.js";import{G as Eo}from"./GDCarousel-CAlGp2TM.js";import{j as Io,P as mr,u as To,i as Ae,c as Qr}from"./toNumber-Bbqz12ug.js";import{p as Ao}from"./isNil-B9F4LKsw.js";import{G as Sa,c as Do}from"./Tree-l_KdbifF.js";import{u as Co}from"./useLocation-Bkvy6h3b.js";function No({onFocus:e}){let[t,r]=F.useState(!0),n=zs();return t?Ce.createElement(ua,{as:"button",type:"button",features:Js.Focusable,onFocus:i=>{i.preventDefault();let a,s=50;function o(){if(s--<=0){a&&cancelAnimationFrame(a);return}if(e()){if(cancelAnimationFrame(a),!n.current)return;r(!1);return}a=requestAnimationFrame(o)}a=requestAnimationFrame(o)}}):null}const Ra=F.createContext(null);function Ho(){return{groups:new Map,get(e,t){var r;let n=this.groups.get(e);n||(n=new Map,this.groups.set(e,n));let i=(r=n.get(t))!=null?r:0;n.set(t,i+1);let a=Array.from(n.keys()).indexOf(t);function s(){let o=n.get(t);o>1?n.set(t,o-1):n.delete(t)}return[a,s]}}}function Wo({children:e}){let t=F.useRef(Ho());return F.createElement(Ra.Provider,{value:t},e)}function Pa(e){let t=F.useContext(Ra);if(!t)throw new Error("You must wrap your component in a <StableCollection>");let r=F.useId(),[n,i]=t.current.get(e,r);return F.useEffect(()=>i,[]),n}var Lo=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Lo||{}),Uo=(e=>(e[e.Less=-1]="Less",e[e.Equal=0]="Equal",e[e.Greater=1]="Greater",e))(Uo||{}),Mo=(e=>(e[e.SetSelectedIndex=0]="SetSelectedIndex",e[e.RegisterTab=1]="RegisterTab",e[e.UnregisterTab=2]="UnregisterTab",e[e.RegisterPanel=3]="RegisterPanel",e[e.UnregisterPanel=4]="UnregisterPanel",e))(Mo||{});let Qo={0(e,t){var r;let n=dt(e.tabs,l=>l.current),i=dt(e.panels,l=>l.current),a=n.filter(l=>{var f;return!((f=l.current)!=null&&f.hasAttribute("disabled"))}),s={...e,tabs:n,panels:i};if(t.index<0||t.index>n.length-1){let l=vt(Math.sign(t.index-e.selectedIndex),{[-1]:()=>1,0:()=>vt(Math.sign(t.index),{[-1]:()=>0,0:()=>0,1:()=>1}),1:()=>0});if(a.length===0)return s;let f=vt(l,{0:()=>n.indexOf(a[0]),1:()=>n.indexOf(a[a.length-1])});return{...s,selectedIndex:f===-1?e.selectedIndex:f}}let o=n.slice(0,t.index),c=[...n.slice(t.index),...o].find(l=>a.includes(l));if(!c)return s;let u=(r=n.indexOf(c))!=null?r:e.selectedIndex;return u===-1&&(u=e.selectedIndex),{...s,selectedIndex:u}},1(e,t){if(e.tabs.includes(t.tab))return e;let r=e.tabs[e.selectedIndex],n=dt([...e.tabs,t.tab],a=>a.current),i=e.selectedIndex;return e.info.current.isControlled||(i=n.indexOf(r),i===-1&&(i=e.selectedIndex)),{...e,tabs:n,selectedIndex:i}},2(e,t){return{...e,tabs:e.tabs.filter(r=>r!==t.tab)}},3(e,t){return e.panels.includes(t.panel)?e:{...e,panels:dt([...e.panels,t.panel],r=>r.current)}},4(e,t){return{...e,panels:e.panels.filter(r=>r!==t.panel)}}},ln=F.createContext(null);ln.displayName="TabsDataContext";function Ye(e){let t=F.useContext(ln);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Ye),r}return t}let fn=F.createContext(null);fn.displayName="TabsActionsContext";function dn(e){let t=F.useContext(fn);if(t===null){let r=new Error(`<${e} /> is missing a parent <Tab.Group /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,dn),r}return t}function ko(e,t){return vt(t.type,Qo,e,t)}let Vo="div";function Bo(e,t){let{defaultIndex:r=0,vertical:n=!1,manual:i=!1,onChange:a,selectedIndex:s=null,...o}=e;const c=n?"vertical":"horizontal",u=i?"manual":"auto";let l=s!==null,f=ar({isControlled:l}),d=Yt(t),[m,p]=F.useReducer(ko,{info:f,selectedIndex:s??r,tabs:[],panels:[]}),h=Zt({selectedIndex:m.selectedIndex}),y=ar(a||(()=>{})),v=ar(m.tabs),g=F.useMemo(()=>({orientation:c,activation:u,...m}),[c,u,m]),b=Qe(_=>(p({type:1,tab:_}),()=>p({type:2,tab:_}))),R=Qe(_=>(p({type:3,panel:_}),()=>p({type:4,panel:_}))),P=Qe(_=>{w.current!==_&&y.current(_),l||p({type:0,index:_})}),w=ar(l?e.selectedIndex:m.selectedIndex),j=F.useMemo(()=>({registerTab:b,registerPanel:R,change:P}),[]);yr(()=>{p({type:0,index:s??r})},[s]),yr(()=>{if(w.current===void 0||m.tabs.length<=0)return;let _=dt(m.tabs,$=>$.current);_.some(($,A)=>m.tabs[A]!==$)&&P(_.indexOf(m.tabs[w.current]))});let O={ref:d},T=er();return Ce.createElement(Wo,null,Ce.createElement(fn.Provider,{value:j},Ce.createElement(ln.Provider,{value:g},g.tabs.length<=0&&Ce.createElement(No,{onFocus:()=>{var _,$;for(let A of v.current)if(((_=A.current)==null?void 0:_.tabIndex)===0)return($=A.current)==null||$.focus(),!0;return!1}}),T({ourProps:O,theirProps:o,slot:h,defaultTag:Vo,name:"Tabs"}))))}let qo="div";function Ko(e,t){let{orientation:r,selectedIndex:n}=Ye("Tab.List"),i=Yt(t),a=Zt({selectedIndex:n}),s=e,o={ref:i,role:"tablist","aria-orientation":r};return er()({ourProps:o,theirProps:s,slot:a,defaultTag:qo,name:"Tabs.List"})}let Go="button";function zo(e,t){var r,n;let i=F.useId(),{id:a=`headlessui-tabs-tab-${i}`,disabled:s=!1,autoFocus:o=!1,...c}=e,{orientation:u,activation:l,selectedIndex:f,tabs:d,panels:m}=Ye("Tab"),p=dn("Tab"),h=Ye("Tab"),[y,v]=F.useState(null),g=F.useRef(null),b=Yt(g,t,v);yr(()=>p.registerTab(g),[p,g]);let R=Pa("tabs"),P=d.indexOf(g);P===-1&&(P=R);let w=P===f,j=Qe(I=>{let N=I();if(N===sr.Success&&l==="auto"){let U=Ys(g.current),Z=h.tabs.findIndex(J=>J.current===U);Z!==-1&&p.change(Z)}return N}),O=Qe(I=>{let N=d.map(U=>
1U.current).filter(Boolean);if(I.key===Re.Space||I.key===Re.Enter){I.preventDefault(),I.stopPropagation(),p.change(P);return}switch(I.key){case Re.Home:case Re.PageUp:return I.preventDefault(),I.stopPropagation(),j(()=>qe(N,Pe.First));case Re.End:case Re.PageDown:return I.preventDefault(),I.stopPropagation(),j(()=>qe(N,Pe.Last))}if(j(()=>vt(u,{vertical(){return I.key===Re.ArrowUp?qe(N,Pe.Previous|Pe.WrapAround):I.key===Re.ArrowDown?qe(N,Pe.Next|Pe.WrapAround):sr.Error},horizontal(){return I.key===Re.ArrowLeft?qe(N,Pe.Previous|Pe.WrapAround):I.key===Re.ArrowRight?qe(N,Pe.Next|Pe.WrapAround):sr.Error}}))===sr.Success)return I.preventDefault()}),T=F.useRef(!1),_=Qe(()=>{var I;T.current||(T.current=!0,(I=g.current)==null||I.focus({preventScroll:!0}),p.change(P),Xs(()=>{T.current=!1}))}),$=Qe(I=>{I.preventDefault()}),{isFocusVisible:A,focusProps:B}=oa({autoFocus:o}),{isHovered:C,hoverProps:L}=Vs({isDisabled:s}),{pressed:k,pressProps:D}=Bs({disabled:s}),E=Zt({selected:w,hover:C,active:k,focus:A,autofocus:o,disabled:s}),W=ca({ref:b,onKeyDown:O,onMouseDown:$,onClick:_,id:a,role:"tab",type:qs(e,y),"aria-controls":(n=(r=m[P])==null?void 0:r.current)==null?void 0:n.id,"aria-selected":w,tabIndex:w?0:-1,disabled:s||void 0,autoFocus:o},B,L,D);return er()({ourProps:W,theirProps:c,slot:E,defaultTag:Go,name:"Tabs.Tab"})}let Jo="div";function Xo(e,t){let{selectedIndex:r}=Ye("Tab.Panels"),n=Yt(t),i=Zt({selectedIndex:r}),a=e,s={ref:n};return er()({ourProps:s,theirProps:a,slot:i,defaultTag:Jo,name:"Tabs.Panels"})}let Yo="div",Zo=On.RenderStrategy|On.Static;function eu(e,t){var r,n,i,a;let s=F.useId(),{id:o=`headlessui-tabs-panel-${s}`,tabIndex:c=0,...u}=e,{selectedIndex:l,tabs:f,panels:d}=Ye("Tab.Panel"),m=dn("Tab.Panel"),p=F.useRef(null),h=Yt(p,t);yr(()=>m.registerPanel(p),[m,p]);let y=Pa("panels"),v=d.indexOf(p);v===-1&&(v=y);let g=v===l,{isFocusVisible:b,focusProps:R}=oa(),P=Zt({selected:g,focus:b}),w=ca({ref:h,id:o,role:"tabpanel","aria-labelledby":(n=(r=f[v])==null?void 0:r.current)==null?void 0:n.id,tabIndex:g?c:-1},R),j=er();return!g&&((i=u.unmount)==null||i)&&!((a=u.static)!=null&&a)?Ce.createElement(ua,{"aria-hidden":"true",...w}):j({ourProps:w,theirProps:u,slot:P,defaultTag:Yo,features:Zo,visible:g,name:"Tabs.Panel"})}let tu=Xt(zo),ru=Xt(Bo),nu=Xt(Ko),iu=Xt(Xo),au=Xt(eu),Dg=Object.assign(tu,{Group:ru,List:nu,Panels:iu,Panel:au});function su(e){const{title:t,...r}=e,n="px-4 py-2 rounded border gd-border--primary hover:border-stone-400 transition-colors duration-200 bg-white text-sm whitespace-nowrap",i=S.jsx("span",{title:typeof t=="string"?t:void 0,children:t}),a=F.useCallback(()=>{if(r.linkId){const s=document.getElementById(r.linkId);s&&s.scrollIntoView({block:"center",behavior:"smooth"})}},[r.linkId]);return r.link?S.jsx(ha,{className:n,to:r.link,prefetch:"none",children:i}):r.linkId?S.jsx("button",{className:n,onClick:a,children:i}):null}function ou({items:e,...t}){return S.jsx(Eo,{items:e||[],listCls:"gap-x-1",renderItem:r=>S.jsx(su,{...r}),keyExtractor:r=>r.id,nextIconProps:{className:"hover:text-red-400"},prevIconProps:{className:"hover:text-red-400"},...t})}const kr="7.15.5";function ue(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}var hn=ue;ue.prototype._events=void 0;ue.prototype._maxListeners=void 0;ue.defaultMaxListeners=10;ue.prototype.setMaxListeners=function(e){if(!uu(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this};ue.prototype.emit=function(e){var t,r,n,i,a,s;if(this._events||(this._events={}),e==="error"&&(!this._events.error||Rt(this._events.error)&&!this._events.error.length)){if(t=arguments[1],t instanceof Error)throw t;var o=new Error('Uncaught, unspecified "error" event. ('+t+")");throw o.context=t,o}if(r=this._events[e],ja(r))return!1;if(Fe(r))switch(arguments.length){case 1:r.call(this);break;case 2:r.call(this,arguments[1]);break;case 3:r.call(this,arguments[1],arguments[2]);break;default:i=Array.prototype.slice.call(arguments,1),r.apply(this,i)}else if(Rt(r))for(i=Array.prototype.slice.call(arguments,1),s=r.slice(),n=s.length,a=0;a<n;a++)s[a].apply(this,i);return!0};ue.prototype.addListener=function(e,t){var r;if(!Fe(t))throw TypeError("listener must be a function");return this._events||(this._events={}
1),this._events.newListener&&this.emit("newListener",e,Fe(t.listener)?t.listener:t),this._events[e]?Rt(this._events[e])?this._events[e].push(t):this._events[e]=[this._events[e],t]:this._events[e]=t,Rt(this._events[e])&&!this._events[e].warned&&(ja(this._maxListeners)?r=ue.defaultMaxListeners:r=this._maxListeners,r&&r>0&&this._events[e].length>r&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),typeof console.trace=="function"&&console.trace())),this};ue.prototype.on=ue.prototype.addListener;ue.prototype.once=function(e,t){if(!Fe(t))throw TypeError("listener must be a function");var r=!1;function n(){this.removeListener(e,n),r||(r=!0,t.apply(this,arguments))}return n.listener=t,this.on(e,n),this};ue.prototype.removeListener=function(e,t){var r,n,i,a;if(!Fe(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(r=this._events[e],i=r.length,n=-1,r===t||Fe(r.listener)&&r.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(Rt(r)){for(a=i;a-- >0;
1)if(r[a]===t||r[a].listener&&r[a].listener===t){n=a;break}if(n<0)return this;r.length===1?(r.length=0,delete this._events[e]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this};ue.prototype.removeAllListeners=function(e){var t,r;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[e]&&delete this._events[e],this;if(arguments.length===0){for(t in this._events)t!=="removeListener"&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[e],Fe(r))this.removeListener(e,r);else if(r)for(;r.length;)this.removeListener(e,r[r.length-1]);return delete this._events[e],this};ue.prototype.listeners=function(e){var t;return!this._events||!this._events[e]?t=[]:Fe(this._events[e])?t=[this._events[e]]:t=this._events[e].slice(),t};ue.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(Fe(t))return 1;if(t)return t.length}return 0};ue.listenerCount=function(e,t){return e.listenerCount(t)};function Fe(e){return typeof e=="function"}function uu(e){return typeof e=="number"}function Rt(e){return typeof e=="object"&&e!==null}function ja(e){return e===void 0}const cu=cn(hn);function lu(e,t){e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}var wa=lu,fu=hn,du=wa;function tr(e,t,r){this.main=e,this.fn=t,this.recommendFn=r,this.lastResults=null,this.lastRecommendResults=null}du(tr,fu);tr.prototype.detach=function(){this.removeAllListeners(),this.main.detachDerivedHelper(this)};tr.prototype.getModifiedState=function(e){return this.fn(e)};tr.prototype.getModifiedRecommendState=function(e){return this.recommendFn(e)};var hu=tr;function mu(e){return typeof e!="string"?e:String(e).replace(/^-/,"\\-")}function pu(e){return typeof e!="string"?e:e.replace(/^\\-/,"-")}var mn={escapeFacetValue:mu,unescapeFacetValue:pu};function gu(e){return typeof e=="object"&&e!==null?pn(Array.isArray(e)?[]:{},e):e}function Sr(e){return typeof e=="function"||Array.isArray(e)||Object.prototype.toString.call(e)==="[object Object]"}function pn(e,t){if(e===t)return e;for(var r in t)if(!(!Object.prototype.hasOwnProperty.call(t,r)||r==="__proto__"||r==="constructor")){var n=t[r],i=e[r];typeof i<"u"&&typeof n>"u"||(Sr(i)&&Sr(n)?e[r]=pn(i,n):e[r]=gu(n))}return e}function vu(e){Sr(e)||(e={});for(var t=1,r=arguments.length;t<r;t++){var n=arguments[t];Sr(n)&&pn(e,n)}return e}var gn=vu;function yu(e){return e&&Object.keys(e).length>0}var vn=yu;function bu(e,t){if(e===null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var yn=bu;function ht(e){e=e||{},this.params=e.params||[]}ht.prototype={constructor:ht,addParams:function(e){var t=this.params.slice();return t.push(e),new ht({params:t})},removeParams:function(e){return new ht({params:this.params.filter(function(t){return t.$$id!==e})})},addFrequentlyBoughtTogether:function(e){return this.addParams(Object.assign({},e,{model:"bought-together"}))},addRelatedProducts:function(e){return this.addParams(Object.assign({},e,{model:"related-products"}))},addTrendingItems:function(e){return this.addParams(Object.assign({},e,{model:"trending-items"}))},addTrendingFacets:function(e){return this.addParams(Object.assign({},e,{model:"trending-facets"}))},addLookingSimilar:function(e){return this.addParams(Object.assign({},e,{model:"looking-similar"}))},_buildQueries:function(e,t){return this.params.filter(function(r){return t[r.$$id]===void 0}).map(function(r){var n=Object.assign({},r,{indexName:e,threshold:r.threshold||0});return delete n.$$id,n})}};var Oa=ht;function Vr(e,t){this._state=e,this._rawResults={};var r=this;e.params.forEach(function(n){var i=n.$$id;r[i]=t[i],r._rawResults[i]=t[i]})}Vr.prototype={constructor:Vr};var xa=Vr,or=gn;function ur(e){return Object.keys(e).sort().reduce(function(t,r){return t[r]=e[r],t},{})}var ee={_getQueries:function(t,r){var n=[];return n.push({indexName:t,params:ee._getHitsSearchParams(r)}
1),r.getRefinedDisjunctiveFacets().forEach(function(i){n.push({indexName:t,params:ee._getDisjunctiveFacetSearchParams(r,i)})}),r.getRefinedHierarchicalFacets().forEach(function(i){var a=r.getHierarchicalFacetByName(i),s=r.getHierarchicalRefinement(i),o=r._getHierarchicalFacetSeparator(a);if(s.length>0&&s[0].split(o).length>1){var c=s[0].split(o).slice(0,-1).reduce(function(l,f,d){return l.concat({attribute:a.attributes[d],value:d===0?f:[l[l.length-1].value,f].join(o)})},[]);c.forEach(function(u,l){var f=ee._getDisjunctiveFacetSearchParams(r,u.attribute,l===0);function d(h){return a.attributes.some(function(y){return y===h.split(":")[0]})}var m=(f.facetFilters||[]).reduce(function(h,y){if(Array.isArray(y)){var v=y.filter(function(g){return!d(g)});v.length>0&&h.push(v)}return typeof y=="string"&&!d(y)&&h.push(y),h},[]),p=c[l-1];l>0?f.facetFilters=m.concat(p.attribute+":"+p.value):m.length>0?f.facetFilters=m:delete f.facetFilters,n.push({indexName:t,params:f})})}}),n},_getCompositionQueries:function(t){return[{compositionID:t.index,requestBody:{params:ee._getCompositionHitsSearchParams(t)}}]},_getHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets).concat(ee._getHitsHierarchicalFacetsAttributes(e)).sort(),r=ee._getFacetFilters(e),n=ee._getNumericFilters(e),i=ee._getTagFilters(e),a={};return t.length>0&&(a.facets=t.indexOf("*")>-1?["*"]:t),i.length>0&&(a.tagFilters=i),r.length>0&&(a.facetFilters=r),n.length>0&&(a.numericFilters=n),ur(or({},e.getQueryParams(),a))},_getCompositionHitsSearchParams:function(e){var t=e.facets.concat(e.disjunctiveFacets.map(function(o){return e.disjunctiveFacetsRefinements&&e.disjunctiveFacetsRefinements[o]&&e.disjunctiveFacetsRefinements[o].length>0?"disjunctive("+o+")":o})).concat(ee._getHitsHierarchicalFacetsAttributes(e)).sort(),r=ee._getFacetFilters(e),n=ee._getNumericFilters(e),i=ee._getTagFilters(e),a={};t.length>0&&(a.facets=t.indexOf("*")>-1?["*"]:t),i.length>0&&(a.tagFilters=i),r.length>0&&(a.facetFilters=r),n.length>0&&(a.numericFilters=n);var s=e.getQueryParams();return delete s.highlightPreTag,delete s.highlightPostTag,delete s.index,ur(or({},s,a))},_getDisjunctiveFacetSearchParams:function(e,t,r){var n=ee._getFacetFilters(e,t,r),i=ee._getNumericFilters(e,t),a=ee._getTagFilters(e),s={hitsPerPage:0,page:0,analytics:!1,clickAnalytics:!1};a.length>0&&(s.tagFilters=a);var o=e.getHierarchicalFacetByName(t);return o?s.facets=ee._getDisjunctiveHierarchicalFacetAttribute(e,o,r):s.facets=t,i.length>0&&(s.numericFilters=i),n.length>0&&(s.facetFilters=n),ur(or({},e.getQueryParams(),s))},_getNumericFilters:function(e,t){if(e.numericFilters)return e.numericFilters;var r=[];return Object.keys(e.numericRefinements).forEach(function(n){var i=e.numericRefinements[n]||{};
1Object.keys(i).forEach(function(a){var s=i[a]||[];t!==n&&s.forEach(function(o){if(Array.isArray(o)){var c=o.map(function(u){return n+a+u});r.push(c)}else r.push(n+a+o)})})}),r},_getTagFilters:function(e){return e.tagFilters?e.tagFilters:e.tagRefinements.join(",")},_getFacetFilters:function(e,t,r){var n=[],i=e.facetsRefinements||{};Object.keys(i).sort().forEach(function(c){var u=i[c]||[];u.slice().sort().forEach(function(l){n.push(c+":"+l)})});var a=e.facetsExcludes||{};Object.keys(a).sort().forEach(function(c){var u=a[c]||[];u.sort().forEach(function(l){n.push(c+":-"+l)})});var s=e.disjunctiveFacetsRefinements||{};Object.keys(s).sort().forEach(function(c){var u=s[c]||[];if(!(c===t||!u||u.length===0)){var l=[];u.slice().sort().forEach(function(f){l.push(c+":"+f)}),n.push(l)}});var o=e.hierarchicalFacetsRefinements||{};return Object.keys(o).sort().forEach(function(c){var u=o[c]||[],l=u[0];if(l!==void 0){var f=e.getHierarchicalFacetByName(c),d=e._getHierarchicalFacetSeparator(f),m=e._getHierarchicalRootPath(f),p,h;if(t===c){if(l.indexOf(d)===-1||!m&&r===!0||m&&m.split(d).length===l.split(d).length)return;m?(h=m.split(d).length-1,l=m):(h=l.split(d).length-2,l=l.slice(0,l.lastIndexOf(d))),p=f.attributes[h]}else h=l.split(d).length-1,p=f.attributes[h];p&&n.push([p+":"+l])}}),n},_getHitsHierarchicalFacetsAttributes:function(e){var t=[];return e.hierarchicalFacets.reduce(function(n,i){var a=e.getHierarchicalRefinement(i.name)[0];if(!a)return n.push(i.attributes[0]),n;var s=e._getHierarchicalFacetSeparator(i),o=a.split(s).length,c=i.attributes.slice(0,o+1);return n.concat(c)},t)},_getDisjunctiveHierarchicalFacetAttribute:function(e,t,r){var n=e._getHierarchicalFacetSeparator(t);if(r===!0){var i=e._getHierarchicalRootPath(t),a=0;return i&&(a=i.split(n).length),[t.attributes[a]]}var s=e.getHierarchicalRefinement(t.name)[0]||"",o=s.split(n).length-1;return t.attributes.slice(0,o+1)},getSearchForFacetQuery:function(e,t,r,n){var i=n.isDisjunctiveFacet(e)?n.clearRefinements(e):n,a={facetQuery:t,facetName:e};return typeof r=="number"&&(a.maxFacetHits=r),ur(or({},ee._getHitsSearchParams(i),a))}},Su=ee,bn=function(){var t=Array.prototype.slice.call(arguments);return t.reduceRight(function(r,n){return Object.keys(Object(n)).forEach(function(i){n[i]!==void 0&&(r[i]!==void 0&&delete r[i],r[i]=n[i])}),r},{})},rr=function(t,r){if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(r(t[n]))return t[n]}};function Ru(e,t){return e.filter(function(r,n){return t.indexOf(r)>-1&&e.indexOf(r)===n})}var Pu=Ru;function _a(e){if(typeof e=="number")return e;if(typeof e=="string")return parseFloat(e);if(Array.isArray(e))return e.map(_a);throw new Error("The value should be a number, a parsable string or an array of those.")}var ju=_a,wu=function(t){return t===null?!1:/^[a-zA-Z0-9_-]{1,64}$/.test(t)},Ou=bn,xu=vn,_u=yn,Ue={addRefinement:function(t,r,n){if(Ue.isRefined(t,r,n))return t;var i=""+n,a=t[r]?t[r].concat(i):[i],s={};return s[r]=a,Ou(s,t)},removeRefinement:function(t,r,n){if(n===void 0)return Ue.clearRefinement(t,function(a,s){return r===s});var i=""+n;return Ue.clearRefinement(t,function(a,s){return r===s&&i===a})},toggleRefinement:function(t,r,n){if(n===void 0)throw new Error("toggleRefinement should be used with a value");return Ue.isRefined(t,r,n)?Ue.removeRefinement(t,r,n):Ue.addRefinement(t,r,n)},clearRefinement:function(t,r,n){if(r===void 0)return xu(t)?{}:t;if(typeof r=="string")return _u(t,[r]);if(typeof r=="function"){var i=!1,a=Object.keys(t).reduce(function(s,o){var c=t[o]||[],u=c.filter(function(l){return!r(l,o,n)});return u.length!==c.length&&(i=!0),s[o]=u,s},{});return i?a:t}},isRefined:function(t,r,n){var i=!!t[r]&&t[r].length>0;if(n===void 0||!i)return i;var a=""+n;return t[r].indexOf(a)!==-1}},Fu=Ue,Or=bn,Fa=rr,Fn=Pu,Br=gn,qr=vn,$n=yn,xr=ju,$u=wu,Y=Fu;function Sn(e,t){return Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every(function(r,n){return Sn(t[n],r)}):e===t}function Eu(e,t){return Fa(e,function(r){return Sn(r,t)})}function fe(e){var t=e?fe._parseNumbers(e):{};t.userToken!==void 0&&!$u(t.userToken)&&console.warn("[algoliasearch-helper] The `userToken` parameter is invali
1d. This can lead to wrong analytics.\n - Format: [a-zA-Z0-9_-]{1,64}"),this.facets=t.facets||[],this.disjunctiveFacets=t.disjunctiveFacets||[],this.hierarchicalFacets=t.hierarchicalFacets||[],this.facetsRefinements=t.facetsRefinements||{},this.facetsExcludes=t.facetsExcludes||{},this.disjunctiveFacetsRefinements=t.disjunctiveFacetsRefinements||{},this.numericRefinements=t.numericRefinements||{},this.tagRefinements=t.tagRefinements||[],this.hierarchicalFacetsRefinements=t.hierarchicalFacetsRefinements||{};var r=this;Object.keys(t).forEach(function(n){var i=fe.PARAMETERS.indexOf(n)!==-1,a=t[n]!==void 0;!i&&a&&(r[n]=t[n])})}fe.PARAMETERS=Object.keys(new fe);fe._parseNumbers=function(e){if(e instanceof fe)return e;var t={},r=["aroundPrecision","aroundRadius","getRankingInfo","minWordSizefor2Typos","minWordSizefor1Typo","page","maxValuesPerFacet","distinct","minimumAroundRadius","hitsPerPage","minProximity"];if(r.forEach(function(i){var a=e[i];if(typeof a=="string"){var s=parseFloat(a);t[i]=isNaN(s)?a:s}}),Array.isArray(e.insideBoundingBox)&&(t.insideBoundingBox=e.insideBoundingBox.map(function(i){return Array.isArray(i)?i.map(function(a){return parseFloat(a)}):i})),e.numericRefinements){var n={};Object.keys(e.numericRefinements).forEach(function(i){var a=e.numericRefinements[i]||{};n[i]={},Object.keys(a).forEach(function(s){var o=a[s],c=o.map(function(u){return Array.isArray(u)?u.map(function(l){return typeof l=="string"?parseFloat(l):l}):typeof u=="string"?parseFloat(u):u});n[i][s]=c})}),t.numericRefinements=n}return Br(e,t)};fe.make=function(t){var r=new fe(t),n=t.hierarchicalFacets||[];return n.forEach(function(i){if(i.rootPath){var a=r.getHierarchicalRefinement(i.name);a.length>0&&a[0].indexOf(i.rootPath)!==0&&(r=r.clearRefinements(i.name)),a=r.getHierarchicalRefinement(i.name),a.length===0&&(r=r.toggleHierarchicalFacetRefinement(i.name,i.rootPath))}}),r};fe.validate=function(e,t){var r=t||{};return e.tagFilters&&r.tagRefinements&&r.tagRefinements.length>0?new Error("[Tags] Cannot switch from the managed tag API to the advanced API. It is probably an error, if it is really what you want, you should first clear the tags with clearTags method."):e.tagRefinements.length>0&&r.tagFilters?new Error("[Tags] Cannot switch from the advanced tag API to the managed API. It is probably an error, if it is not, you should first clear the tags with clearTags method."):e.numericFilters&&r.numericRefinements&&qr(r.numericRefinements)?new Error("[Numeric filters] Can't switch from the advanced to the managed API. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):qr(e.numericRefinements)&&r.numericFilters?new Error("[Numeric filters] Can't switch from the managed API to the advanced. It is probably an error, if this is really what you want, you have to first clear the numeric filters."):null};fe.prototype={constructor:fe,clearRefinements:function(t){var r={numericRefinements:this._clearNumericRefinements(t),facetsRefinements:Y.clearRefinement(this.facetsRefinements,t,"conjunctiveFacet"),facetsExcludes:Y.clearRefinement(this.facetsExcludes,t,"exclude"),disjunctiveFacetsRefinements:Y.clearRefinement(this.disjunctiveFacetsRefinements,t,"disjunctiveFacet"),hierarchicalFacetsRefinements:Y.clearRefinement(this.hierarchicalFacetsRefinements,t,"hierarchicalFacet")};return r.numericRefinements===this.numericRefinements&&r.facetsRefinements===this.facetsRefinements&&r.facetsExcludes===this.facetsExcludes&&r.disjunctiveFacetsRefinements===this.disjunctiveFacetsRefinements&&r.hierarchicalFacetsRefinements===this.hierarchicalFacetsRefinements?this:this.setQueryParameters(r)},clearTags:function(){return this.tagFilters===void 0&&this.tagRefinements.length===0?this:this.setQueryParameters({tagFilters:void 0,tagRefinements:[]})},setIndex:function(t){return t===this.index?this:this.setQueryParameters({index:t})},setQuery:function(t){return t===this.query?this:this.setQueryParameters({query:t})},setPage:function(t){return t===this.page?this:this.setQueryParameters({page:t})},setFacets:function(t){return this.setQueryParameters({facets:t})},setDisjunctiveFacets:function(t){return this.setQueryParameters({disjunctiveFacets:t})},setHitsPerPage:function(t){return this.hitsPerPage===t?this:this.setQueryParameters({hitsPerPage:t})},setTypoTolerance:function(t){return this.typoTolerance===t?this:this.setQueryParameters({typoTolerance:t})},addNumericRefinement:function(e,t,r){var n=xr(r);if(this.isNumericRefined(e,t,n))return this;var i=Br({},this.numericRefinements);return i[e]=Br({},i[e]),i[e][t]?(i[e][t]=i[e][t].slice(),i[e][t].push(n)):i[e][t]=[n],this.setQueryParameters({numericRefinements:i})},getConjunctiveRefinements:function(e){return this.isConjunctiveFacet(e)?this.facetsRefinements[e]||[]:[]},getDisjunctiveRefinements:function(e){return this.isDisjunctiveFacet(e)?this.disjunctiveFacetsRefinements[e]||[]:[]},getHierarchicalRefinement:function(e){return this.hierarchicalFacetsRefinements[e]||[]},getExcludeRefinements:function(e){return this.isConjunctiveFacet(e)?this.facetsExcludes[e]||[]:[]},removeNumericRefinement:function(e,t,r){var n=r;return n!==void 0?this.isNumericRefined(e,t,n)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,a){return a===e&&i.op===t&&Sn(i.val,xr(n))})}):this:t!==void 0?this.isNumericRefined(e,t)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,a){return a===e&&i.op===t})}):this:this.isNumericRefined(e)?this.setQueryParameters({numericRefinements:this._clearNumericRefinements(function(i,a){return a===e})}):this},getNumericRefinements:function(e){return this.numericRefinements[e]||{}},getNumericRefinement:function(e,t){return this.numericRefinements[e]&&this.numericRefinements[e][t]},_clearNumericRefinements:function(t){if(t===void 0)return qr(this.numericRefinements)?{}:this.numericRefinements;if(typeof t=="string")return $n(this.numericRefinements,[t]);if(typeof t=="function"){var r=!1,n=this.numericRefinements,i=Object.keys(n).reduce(function(a,s){var o=n[s],c={};return o=o||{}
1,Object.keys(o).forEach(function(u){var l=o[u]||[],f=[];l.forEach(function(d){var m=t({val:d,op:u},s,"numeric");m||f.push(d)}),f.length!==l.length&&(r=!0),c[u]=f}),a[s]=c,a},{});return r?i:this.numericRefinements}},addFacet:function(t){return this.isConjunctiveFacet(t)?this:this.setQueryParameters({facets:this.facets.concat([t])})},addDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this:this.setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.concat([t])})},addHierarchicalFacet:function(t){if(this.isHierarchicalFacet(t.name))throw new Error("Cannot declare two hierarchical facets with the same name: `"+t.name+"`");return this.setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.concat([t])})},addFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return Y.isRefined(this.facetsRefinements,t,r)?this:this.setQueryParameters({facetsRefinements:Y.addRefinement(this.facetsRefinements,t,r)})},addExcludeRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return Y.isRefined(this.facetsExcludes,t,r)?this:this.setQueryParameters({facetsExcludes:Y.addRefinement(this.facetsExcludes,t,r)})},addDisjunctiveFacetRefinement:function(t,r){if(!this.isDisjunctiveFacet(t))throw new Error(t+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Y.isRefined(this.disjunctiveFacetsRefinements,t,r)?this:this.setQueryParameters({disjunctiveFacetsRefinements:Y.addRefinement(this.disjunctiveFacetsRefinements,t,r)})},addTagRefinement:function(t){if(this.isTagRefined(t))return this;var r={tagRefinements:this.tagRefinements.concat(t)};return this.setQueryParameters(r)},removeFacet:function(t){return this.isConjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({facets:this.facets.filter(function(r){return r!==t})}):this},removeDisjunctiveFacet:function(t){return this.isDisjunctiveFacet(t)?this.clearRefinements(t).setQueryParameters({disjunctiveFacets:this.disjunctiveFacets.filter(function(r){return r!==t})}):this},removeHierarchicalFacet:function(t){return this.isHierarchicalFacet(t)?this.clearRefinements(t).setQueryParameters({hierarchicalFacets:this.hierarchicalFacets.filter(function(r){return r.name!==t})}):this},removeFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return Y.isRefined(this.facetsRefinements,t,r)?this.setQueryParameters({facetsRefinements:Y.removeRefinement(this.facetsRefinements,t,r)}):this},removeExcludeRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return Y.isRefined(this.facetsExcludes,t,r)?this.setQueryParameters({facetsExcludes:Y.removeRefinement(this.facetsExcludes,t,r)}):this},removeDisjunctiveFacetRefinement:function(t,r){if(!this.isDisjunctiveFacet(t))throw new Error(t+" is not defined in the disjunctiveFacets attribute of the helper configuration");return Y.isRefined(this.disjunctiveFacetsRefinements,t,r)?this.setQueryParameters({disjunctiveFacetsRefinements:Y.removeRefinement(this.disjunctiveFacetsRefinements,t,r)}):this},removeTagRefinement:function(t){if(!this.isTagRefined(t))return this;var r={tagRefinements:this.tagRefinements.filter(function(n){return n!==t})};return this.setQueryParameters(r)},toggleRefinement:function(t,r){return this.toggleFacetRefinement(t,r)},toggleFacetRefinement:function(t,r){if(this.isHierarchicalFacet(t))return this.toggleHierarchicalFacetRefinement(t,r);if(this.isConjunctiveFacet(t))return this.toggleConjunctiveFacetRefinement(t,r);if(this.isDisjunctiveFacet(t))return this.toggleDisjunctiveFacetRefinement(t,r);throw new Error("Cannot refine the undeclared facet "+t+"; it should be added to the helper options facets, disjunctiveFacets or hierarchicalFacets")},toggleConjunctiveFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsRefinements:Y.toggleRefinement(this.facetsRefinements,t,r)})},toggleExcludeFacetRefinement:function(t,r){if(!this.isConjunctiveFacet(t))throw new Error(t+" is not defined in the facets attribute of the helper configuration");return this.setQueryParameters({facetsExcludes:Y.toggleRefinement(this.facetsExcludes,t,r)})},toggleDisjunctiveFacetRefinement:function(t,r){if(!this.isDisjunctiveFacet(t))throw new Error(t+" is not defined in the disjunctiveFacets attribute of the helper configuration");return this.setQueryParameters({disjunctiveFacetsRefinements:Y.toggleRefinement(this.disjunctiveFacetsRefinements,t,r)})},toggleHierarchicalFacetRefinement:function(t,r){if(!this.isHierarchicalFacet(t))throw new Error(t+" is not defined in the hierarchicalFacets attribute of the helper configuration");var n=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(t)),i={},a=this.hierarchicalFacetsRefinements[t]!==void 0&&this.hierarchicalFacetsRefinements[t].length>0&&(this.hierarchicalFacetsRefinements[t][0]===r||this.hierarchicalFacetsRefinements[t][0].indexOf(r+n)===0);return a?r.indexOf(n)===-1?i[t]=[]:i[t]=[r.slice(0,r.lastIndexOf(n))]:i[t]=[r],this.setQueryParameters({hierarchicalFacetsRefinements:Or(i,this.hierarchicalFacetsRefinements)})},addHierarchicalFacetRefinement:function(e,t){if(this.isHierarchicalFacetRefined(e))throw new Error(e+" is already refined.");if(!this.isHierarchicalFacet(e))throw new Error(e+" is not defined in the hierarchicalFacets attribute of the helper configuration.");var r={};return r[e]=[t],this.setQueryParameters({hierarchicalFacetsRefinements:Or(r,this.hierarchicalFacetsRefinements)})},removeHierarchicalFacetRefinement:function(e){if(!this.isHierarchicalFacetRefined(e))return this;var t={};return t[e]=[],this.setQueryParameters({hierarchicalFacetsRefinements:Or(t,this.hierarchicalFacetsRefinements)})},toggleTagRefinement:function(t){return this.isTagRefined(t)?this.removeTagRefinement(t):this.addTagRefinement(t)},isDisjunctiveFacet:function(e){return this.disjunctiveFacets.indexOf(e)>-1},isHierarchicalFacet:function(e){return this.getHierarchicalFacetByName(e)!==void 0},isConjunctiveFacet:function(e){return this.facets.indexOf(e)>-1},isFacetRefined:function(t,r){return this.isConjunctiveFacet(t)?Y.isRefined(this.facetsRefinements,t,r):!1},isExcludeRefined:function(t,r){return this.isConjunctiveFacet(t)?Y.isRefined(this.facetsExcludes,t,r):!1},isDisjunctiveFacetRefined:function(t,r){return this.isDisjunctiveFacet(t)?Y.isRefined(this.disjunctiveFacetsRefinements,t,r):!1},isHierarchicalFacetRefined:function(t,r){if(!this.isHierarchicalFacet(t))return!1;var n=this.getHierarchicalRefinement(t);return r?n.indexOf(r)!==-1:n.length>0},isNumericRefined:function(t,r,n){if(n===void 0&&r===void 0)return!!this.numericRefinements[t];var i=this.numericRefinements[t]&&this.numericRefinements[t][r]!==void 0;if(n===void 0||!i)return i;var a=xr(n),s=Eu(this.numericRefinements[t][r],a)!==void 0;return i&&s},isTagRefined:function(t){return this.tagRefinements.indexOf(t)!==-1},getRefinedDisjunctiveFacets:function(){var t=this,r=Fn(Object.keys(this.numericRefinements).filter(function(n){return Object.keys(t.numericRefinements[n]).length>0}),this.disjunctiveFacets);return Object.keys(this.disjunctiveFacetsRefinements).filter(function(n){return t.disjunctiveFacetsRefinements[n].length>0}).concat(r).concat(this.getRefinedHierarchicalFacets()).sort()},getRefinedHierarchicalFacets:function(){var t=this;return Fn(this.hierarchicalFacets.map(function(r){return r.name}),Object.keys(this.hierarchicalFacetsRefinements).filter(function(r){return t.hierarchicalFacetsRefinements[r].length>0})).sort()},getUnrefinedDisjunctiveFacets:function(){var e=this.getRefinedDisjunctiveFacets();return this.disjunctiveFacets.filter(function(t){return e.indexOf(t)===-1})},managedParameters:["index","facets","disjunctiveFacets","facetsRefinements","hierarchicalFacets","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacetsRefinements"],getQueryParams:function(){var t=this.managedParameters,r={},n=this;
1return Object.keys(this).forEach(function(i){var a=n[i];t.indexOf(i)===-1&&a!==void 0&&(r[i]=a)}),r},setQueryParameter:function(t,r){if(this[t]===r)return this;var n={};return n[t]=r,this.setQueryParameters(n)},setQueryParameters:function(t){if(!t)return this;var r=fe.validate(this,t);if(r)throw r;var n=this,i=fe._parseNumbers(t),a=Object.keys(this).reduce(function(o,c){return o[c]=n[c],o},{}),s=Object.keys(i).reduce(function(o,c){var u=o[c]!==void 0,l=i[c]!==void 0;return u&&!l?$n(o,[c]):(l&&(o[c]=i[c]),o)},a);return new this.constructor(s)},resetPage:function(){return this.page===void 0?this:this.setPage(0)},_getHierarchicalFacetSortBy:function(e){return e.sortBy||["isRefined:desc","name:asc"]},_getHierarchicalFacetSeparator:function(e){return e.separator||" > "},_getHierarchicalRootPath:function(e){return e.rootPath||null},_getHierarchicalShowParentLevel:function(e){return typeof e.showParentLevel=="boolean"?e.showParentLevel:!0},getHierarchicalFacetByName:function(e){return Fa(this.hierarchicalFacets,function(t){return t.name===e})},getHierarchicalFacetBreadcrumb:function(e){if(!this.isHierarchicalFacet(e))return[];var t=this.getHierarchicalRefinement(e)[0];if(!t)return[];var r=this._getHierarchicalFacetSeparator(this.getHierarchicalFacetByName(e)),n=t.split(r);return n.map(function(i){return i.trim()})},toString:function(){return JSON.stringify(this,null,2)}};var $a=fe,Iu=function(t){return Array.isArray(t)?t.filter(Boolean):[]},Tu=function(t,r){if(!Array.isArray(t))return-1;for(var n=0;n<t.length;n++)if(r(t[n]))return n;return-1},Au=rr,Ea=function(t,r){var n=(r||[]).map(function(i){return i.split(":")});return t.reduce(function(a,s){var o=s.split(":"),c=Au(n,function(u){return u[0]===o[0]});return o.length>1||!c?(a[0].push(o[0]),a[1].push(o[1]),a):(a[0].push(c[0]),a[1].push(c[1]),a)},[[],[]])};function Du(){var e=Array.prototype.slice.call(arguments);return e.reduceRight(function(t,r){return Object.keys(Object(r)).forEach(function(n){var i=typeof t[n]=="number"?t[n]:0,a=r[n];a!==void 0&&a>=i&&(t[n]!==void 0&&delete t[n],t[n]=a)}),t},{})}var Cu=Du;function Nu(e,t){if(e!==t){var r=e!==void 0,n=e===null,i=t!==void 0,a=t===null;if(!a&&e>t||n&&i||!r)return 1;if(!n&&e<t||a&&r||!i)return-1}return 0}function Hu(e,t,r){if(!Array.isArray(e))return[];Array.isArray(r)||(r=[]);var n=e.map(function(i,a){return{criteria:t.map(function(s){return i[s]}),index:a,value:i}});return n.sort(function(a,s){for(var o=-1;++o<a.criteria.length;){var c=Nu(a.criteria[o],s.criteria[o]);if(c)return o>=r.length?c:r[o]==="desc"?-c:c}return a.index-s.index}),n.map(function(i){return i.value})}var Ia=Hu,Wu=Vu,Ta=mn,Lu=rr,Uu=Ea,Mu=Ia,Qu=Ta.escapeFacetValue,ku=Ta.unescapeFacetValue;function Vu(e){return function(r,n){var i=e.hierarchicalFacets[n],a=e.hierarchicalFacetsRefinements[i.name]&&e.hierarchicalFacetsRefinements[i.name][0]||"",s=e._getHierarchicalFacetSeparator(i),o=e._getHierarchicalRootPath(i),c=e._getHierarchicalShowParentLevel(i),u=Uu(e._getHierarchicalFacetSortBy(i)),l=r.every(function(m){return m.exhaustive}),f=Bu(u,s,o,c,a),d=r;return o&&(d=r.slice(o.split(s).length)),d.reduce(f,{name:e.hierarchicalFacets[n].name,count:null,isRefined:!0,path:null,escapedValue:null,exhaustive:l,data:null})}}function Bu(e,t,r,n,i){return function(s,o,c){var u=s;if(c>0){var l=0;for(u=s;l<c;){var f=u&&Array.isArray(u.data)?u.data:[];u=Lu(f,function(m){return m.isRefined}),l++}}if(u){var d=Object.keys(o.data).map(function(m){return[m,o.data[m]]}).filter(function(m){var p=m[0];return qu(p,u.path||r,i,t,r,n)});u.data=Mu(d.map(function(m){var p=m[0],h=m[1];return Ku(h,p,t,ku(i),o.exhaustive)}),e[0],e[1])}return s}}function qu(e,t,r,n,i,a){return i&&(e.indexOf(i)!==0||i===e)?!1:!i&&e.indexOf(n)===-1||i&&e.split(n).length-i.split(n).length===1||e.indexOf(n)===-1&&r.indexOf(n)===-1||r.indexOf(e)===0||e.indexOf(t+n)===0&&(a||e.indexOf(r)===0)}function Ku(e,t,r,n,i){var a=t.split(r);return{name:a[a.length-1].trim(),path:t,escapedValue:Qu(t),count:e,isRefined:n===t||n.indexOf(t+r)===0,exhaustive:i,data:null}}var _r=Iu,yt=bn,Aa=mn,be=rr,st=Tu,Gu=Ea,En=Cu,Da=Ia,In=Aa.escapeFacetValue,Ca=Aa.unescapeFacetValue,zu=Wu;function Tn(e){var t={};return e.forEach(function(r,n){t[r]=n}),t}function Fr(e,t,r){t&&t[r]&&(e.stats=t[r])}function Ju(e,t){return be(e,function(n){var i=n.attributes||[];return i.indexOf(t)>-1})}function Ne(e,t,r){var n=t[0]||{};this._rawResults=t;var i=this;
1Object.keys(n).forEach(function(f){i[f]=n[f]});var a=yt(r,{persistHierarchicalRootCount:!1});Object.keys(a).forEach(function(f){i[f]=a[f]}),this.processingTimeMS=t.reduce(function(f,d){return d.processingTimeMS===void 0?f:f+d.processingTimeMS},0),this.disjunctiveFacets=[],this.hierarchicalFacets=e.hierarchicalFacets.map(function(){return[]}),this.facets=[];var s=e.getRefinedDisjunctiveFacets(),o=Tn(e.facets),c=Tn(e.disjunctiveFacets),u=1,l=n.facets||{};Object.keys(l).forEach(function(f){var d=l[f],m=Ju(e.hierarchicalFacets,f);if(m){var p=m.attributes.indexOf(f),h=st(e.hierarchicalFacets,function(b){return b.name===m.name});i.hierarchicalFacets[h][p]={attribute:f,data:d,exhaustive:n.exhaustiveFacetsCount}}else{var y=e.disjunctiveFacets.indexOf(f)!==-1,v=e.facets.indexOf(f)!==-1,g;y&&(g=c[f],i.disjunctiveFacets[g]={name:f,data:d,exhaustive:n.exhaustiveFacetsCount},Fr(i.disjunctiveFacets[g],n.facets_stats,f)),v&&(g=o[f],i.facets[g]={name:f,data:d,exhaustive:n.exhaustiveFacetsCount},Fr(i.facets[g],n.facets_stats,f))}}),this.hierarchicalFacets=_r(this.hierarchicalFacets),s.forEach(function(f){var d=t[u],m=d&&d.facets?d.facets:{},p=e.getHierarchicalFacetByName(f);Object.keys(m).forEach(function(h){var y=m[h],v;if(p){v=st(e.hierarchicalFacets,function(R){return R.name===p.name});var g=st(i.hierarchicalFacets[v],function(R){return R.attribute===h});if(g===-1)return;i.hierarchicalFacets[v][g].data=i.persistHierarchicalRootCount?En(i.hierarchicalFacets[v][g].data,y):yt(y,i.hierarchicalFacets[v][g].data)}else{v=c[h];var b=n.facets&&n.facets[h]||{};i.disjunctiveFacets[v]={name:h,data:En(b,y),exhaustive:d.exhaustiveFacetsCount},Fr(i.disjunctiveFacets[v],d.facets_stats,h),e.disjunctiveFacetsRefinements[h]&&e.disjunctiveFacetsRefinements[h].forEach(function(R){!i.disjunctiveFacets[v].data[R]&&e.disjunctiveFacetsRefinements[h].indexOf(Ca(R))>-1&&(i.disjunctiveFacets[v].data[R]=0)})}}),u++}),e.getRefinedHierarchicalFacets().forEach(function(f){var d=e.getHierarchicalFacetByName(f),m=e._getHierarchicalFacetSeparator(d),p=e.getHierarchicalRefinement(f);p.length===0||p[0].split(m).length<2||t.slice(u).forEach(function(h){var y=h&&h.facets?h.facets:{};Object.keys(y).forEach(function(v){var g=y[v],b=st(e.hierarchicalFacets,function(j){return j.name===d.name}),R=st(i.hierarchicalFacets[b],function(j){return j.attribute===v});if(R!==-1){var P={};if(p.length>0&&!i.persistHierarchicalRootCount){var w=p[0].split(m)[0];P[w]=i.hierarchicalFacets[b][R].data[w]}i.hierarchicalFacets[b][R].data=yt(P,g,i.hierarchicalFacets[b][R].data)}}),u++})}),Object.keys(e.facetsExcludes).forEach(function(f){var d=e.facetsExcludes[f],m=o[f];i.facets[m]={name:f,data:l[f],exhaustive:n.exhaustiveFacetsCount},d.forEach(function(p){i.facets[m]=i.facets[m]||{name:f},i.facets[m].data=i.facets[m].data||{},i.facets[m].data[p]=0})}),this.hierarchicalFacets=this.hierarchicalFacets.map(zu(e)),this.facets=_r(this.facets),this.disjunctiveFacets=_r(this.disjunctiveFacets),this._state=e}Ne.prototype.getFacetByName=function(e){function t(r){return r.name===e}return be(this.facets,t)||be(this.disjunctiveFacets,t)||be(this.hierarchicalFacets,t)};function Xu(e,t){function r(l){return l.name===t}if(e._state.isConjunctiveFacet(t)){var n=be(e.facets,r);return n?Object.keys(n.data).map(function(l){var f=In(l);return{name:l,escapedValue:f,count:n.data[l],isRefined:e._state.isFacetRefined(t,f),isExcluded:e._state.isExcludeRefined(t,l)}}):[]}else if(e._state.isDisjunctiveFacet(t)){var i=be(e.disjunctiveFacets,r);return i?Object.keys(i.data).map(function(l){var f=In(l);return{name:l,escapedValue:f,count:i.data[l],isRefined:e._state.isDisjunctiveFacetRefined(t,f)}}):[]}else if(e._state.isHierarchicalFacet(t)){var a=be(e.hierarchicalFacets,r);if(!a)return a;var s=e._state.getHierarchicalFacetByName(t),o=e._state._getHierarchicalFacetSeparator(s),c=Ca(e._state.getHierarchicalRefinement(t)[0]||"");c.indexOf(s.rootPath)===0&&(c=c.replace(s.rootPath+o,""));var u=c.split(o);return u.unshift(t),Na(a,u,0),a}}function Na(e,t,r){e.isRefined=e.name===(t[r]&&t[r].trim()),e.data&&e.data.forEach(function(n){Na(n,t,r+1)})}function Ha(e,t,r,n){if(n=n||0,Array.isArray(t))return e(t,r[n]);if(!t.data||t.data.length===0)return t;var i=t.data.map(function(o){return Ha(e,o,r,n+1)}),a=e(i,r[n]),s=yt({data:a},t);return s}
1Ne.DEFAULT_SORT=["isRefined:desc","count:desc","name:asc"];function Yu(e,t){return t.sort(e)}function Zu(e,t){var r=[],n=[],i=t.hide||[],a=t.order||[],s=a.reduce(function(u,l,f){return u[l]=f,u},{});e.forEach(function(u){var l=u.path||u.name,f=i.indexOf(l)>-1;!f&&s[l]!==void 0?r[s[l]]=u:f||n.push(u)}),r=r.filter(function(u){return u});var o=t.sortRemainingBy,c;return o==="hidden"?r:(o==="alpha"?c=[["path","name"],["asc","asc"]]:c=[["count"],["desc"]],r.concat(Da(n,c[0],c[1])))}function ec(e,t){return e.renderingContent&&e.renderingContent.facetOrdering&&e.renderingContent.facetOrdering.values&&e.renderingContent.facetOrdering.values[t]}Ne.prototype.getFacetValues=function(e,t){var r=Xu(this,e);if(r){var n=yt(t,{sortBy:Ne.DEFAULT_SORT,facetOrdering:!(t&&t.sortBy)}),i=this,a;if(Array.isArray(r))a=[e];else{var s=i._state.getHierarchicalFacetByName(r.name);a=s.attributes}return Ha(function(o,c){if(n.facetOrdering){var u=ec(i,c);if(u)return Zu(o,u)}if(Array.isArray(n.sortBy)){var l=Gu(n.sortBy,Ne.DEFAULT_SORT);return Da(o,l[0],l[1])}else if(typeof n.sortBy=="function")return Yu(n.sortBy,o);throw new Error("options.sortBy is optional but if defined it must be either an array of string (predicates) or a sorting function")},r,a)}};Ne.prototype.getFacetStats=function(e){if(this._state.isConjunctiveFacet(e))return An(this.facets,e);if(this._state.isDisjunctiveFacet(e))return An(this.disjunctiveFacets,e)};function An(e,t){var r=be(e,function(n){return n.name===t});return r&&r.stats}Ne.prototype.getRefinements=function(){var e=this._state,t=this,r=[];return Object.keys(e.facetsRefinements).forEach(function(n){e.facetsRefinements[n].forEac
1h(function(i){r.push($r(e,"facet",n,i,t.facets))})}),Object.keys(e.facetsExcludes).forEach(function(n){e.facetsExcludes[n].forEach(function(i){r.push($r(e,"exclude",n,i,t.facets))})}),Object.keys(e.disjunctiveFacetsRefinements).forEach(function(n){e.disjunctiveFacetsRefinements[n].forEach(function(i){r.push($r(e,"disjunctive",n,i,t.disjunctiveFacets))})}),Object.keys(e.hierarchicalFacetsRefinements).forEach(function(n){e.hierarchicalFacetsRefinements[n].forEach(function(i){r.push(tc(e,n,i,t.hierarchicalFacets))})}),Object.keys(e.numericRefinements).forEach(function(n){var i=e.numericRefinements[n];Object.keys(i).forEach(function(a){i[a].forEach(function(s){r.push({type:"numeric",attributeName:n,name:s,numericValue:s,operator:a})})})}),e.tagRefinements.forEach(function(n){r.push({type:"tag",attributeName:"_tags",name:n})}),r};function $r(e,t,r,n,i){var a=be(i,function(c){return c.name===r}),s=a&&a.data&&a.data[n]?a.data[n]:0,o=a&&a.exhaustive||!1;return{type:t,attributeName:r,name:n,count:s,exhaustive:o}}function tc(e,t,r,n){var i=e.getHierarchicalFacetByName(t),a=e._getHierarchicalFacetSeparator(i),s=r.split(a),o=be(n,function(d){return d.name===t}),c=s.reduce(function(d,m){var p=d&&be(d.data,function(h){return h.name===m});return p!==void 0?p:d},o),u=c&&c.count||0,l=c&&c.exhaustive||!1,f=c&&c.path||"";return{type:"hierarchical",attributeName:t,name:f,count:u,exhaustive:l}}var Wa=Ne,rc=function(t){return t.reduce(function(r,n){return r.concat(n)},[])},nc=rr,ic=rc;function ac(e,t){var r=[];return Object.keys(e).forEach(function(n){e[n].count<2&&(e[n].indexSum+=100),r.push({objectID:n,avgOfIndices:e[n].indexSum/t})}),r.sort(function(n,i){return n.avgOfIndices>i.avgOfIndices?1:-1})}function sc(e){var t={};e.forEach(function(i){i.forEach(function(a,s){t[a.objectID]?t[a.objectID]={indexSum:t[a.objectID].indexSum+s,count:t[a.objectID].count+1}:t[a.objectID]={indexSum:s,count:1}})});var r=ac(t,e.length),n=r.reduce(function(i,a){var s=nc(ic(e),function(o){return o.objectID===a.objectID});return s?i.concat(s):i},[]);return n}var oc=sc,La="3.24.3",uc=hn,cc=hu,Ua=mn.escapeFacetValue,lc=wa,fc=gn,dc=vn,hc=yn,Ma=Oa,mc=xa,He=Su,Rn=$a,Kr=Wa,pc=oc,Qa=La;function x(e,t,r,n){typeof e.addAlgoliaAgent=="function"&&e.addAlgoliaAgent("JS Helper ("+Qa+")"),this.setClient(e);var i=r||{};i.index=t,this.state=Rn.make(i),this.recommendState=new Ma({params:i.recommendState}),this.lastResults=null,this.lastRecommendResults=null,this._queryId=0,this._recommendQueryId=0,this._lastQueryIdReceived=-1,this._lastRecommendQueryIdReceived=-1,this.derivedHelpers=[],this._currentNbQueries=0,this._currentNbRecommendQueries=0,this._searchResultsOptions=n,this._recommendCache={}}lc(x,uc);x.prototype.search=function(){return this._search({onlyWithDerivedHelpers:!1}),this};x.prototype.searchOnlyWithDerivedHelpers=function(){return this._search({onlyWithDerivedHelpers:!0}),this};x.prototype.searchWithComposition=function(){return this._runComposition({onlyWithDerivedHelpers:!0}),this};x.prototype.recommend=function(){return this._recommend(),this};x.prototype.getQuery=function(){var e=this.state;return He._getHitsSearchParams(e)};x.prototype.searchOnce=function(e,t){var r=e?this.state.setQueryParameters(e):this.state,n=He._getQueries(r.index,r),i=this;if(this._currentNbQueries++,this.emit("searchOnce",{state:r}),t){this.client.search(n).then(function(a){i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),t(null,new Kr(r,a.results),r)}).catch(function(a){i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),t(a,null,r)});return}return this.client.search(n).then(function(a){return i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),{content:new Kr(r,a.results),state:r,_originalResponse:a}},function(a){throw i._currentNbQueries--,i._currentNbQueries===0&&i.emit("searchQueueEmpty"),a})};x.prototype.findAnswers=function(e){console.warn("[algoliasearch-helper] answers is no longer supported");var t=this.state,r=this.derivedHelpers[0];if(!r)return Promise.resolve([]);var n=r.getModifiedState(t),i=fc({attributesForPrediction:e.attributesForPrediction,nbHits:e.nbHits},{params:hc(He._getHitsSearchParams(n),["attributesToSnippet","hitsPerPage","restrictSearchableAttributes","snippetEllipsisText"])}),a="search for answers was called, but this client does not have a function client.initIndex(index).findAnswers";if(typeof this.client.initIndex!="function")throw new Error(a);var s=this.client.initIndex(n.index);if(typeof s.findAnswers!="function")throw new Error(a);return s.findAnswers(n.query,e.queryLanguages,i)};x.prototype.searchForFacetValues=function(e,t,r,n){var i=typeof this.client.searchForFacetValues=="function"&&typeof this.client.searchForFacets!="function",a=typeof this.client.initIndex=="function";if(!i&&!a&&typeof this.client.search!="function")throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues or client.initIndex(index).searchForFacetValues");var s=this.state.setQueryParameters(n||{}),o=s.isDisjunctiveFacet(e),c=He.getSearchForFacetQuery(e,t,r,s);this._currentNbQueries++;var u=this,l;return i?l=this.client.searchForFacetValues([{indexName:s.index,params:c}]):a?l=this.client.initIndex(s.index).searchForFacetValues(c):(delete c.facetName,l=this.client.search([{type:"facet",facet:e,indexName:s.index,params:c}]).then(function(d){return d.results[0]}
1)),this.emit("searchForFacetValues",{state:s,facet:e,query:t}),l.then(function(d){return u._currentNbQueries--,u._currentNbQueries===0&&u.emit("searchQueueEmpty"),d=Array.isArray(d)?d[0]:d,d.facetHits.forEach(function(m){m.escapedValue=Ua(m.value),m.isRefined=o?s.isDisjunctiveFacetRefined(e,m.escapedValue):s.isFacetRefined(e,m.escapedValue)}),d},function(f){throw u._currentNbQueries--,u._currentNbQueries===0&&u.emit("searchQueueEmpty"),f})};x.prototype.searchForCompositionFacetValues=function(e,t,r,n){if(typeof this.client.searchForFacetValues!="function")throw new Error("search for facet values (searchable) was called, but this client does not have a function client.searchForFacetValues");var i=this.state.setQueryParameters(n||{}),a=i.isDisjunctiveFacet(e);this._currentNbQueries++;var s=this,o;return o=this.client.searchForFacetValues({compositionID:i.index,facetName:e,searchForFacetValuesRequest:{params:{query:t,maxFacetHits:r,searchQuery:He._getCompositionHitsSearchParams(i)}}}),this.emit("searchForFacetValues",{state:i,facet:e,query:t}),o.then(function(u){return s._currentNbQueries--,s._currentNbQueries===0&&s.emit("searchQueueEmpty"),u=u.results[0],u.facetHits.forEach(function(l){l.escapedValue=Ua(l.value),l.isRefined=a?i.isDisjunctiveFacetRefined(e,l.escapedValue):i.isFacetRefined(e,l.escapedValue)}),u},function(c){throw s._currentNbQueries--,s._currentNbQueries===0&&s.emit("searchQueueEmpty"),c})};x.prototype.setQuery=function(e){return this._change({state:this.state.resetPage().setQuery(e),isPageReset:!0}),this};x.prototype.clearRefinements=function(e){return this._change({state:this.state.resetPage().clearRefinements(e),isPageReset:!0}),this};x.prototype.clearTags=function(){return this._change({state:this.state.resetPage().clearTags(),isPageReset:!0}),this};x.prototype.addDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.addDisjunctiveRefine=function(){return this.addDisjunctiveFacetRefinement.apply(this,arguments)};x.prototype.addHierarchicalFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addHierarchicalFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.addNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().addNumericRefinement(e,t,r),isPageReset:!0}),this};x.prototype.addFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().addFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.addRefine=function(){return this.addFacetRefinement.apply(this,arguments)};x.prototype.addFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().addExcludeRefinement(e,t),isPageReset:!0}),this};x.prototype.addExclude=function(){return this.addFacetExclusion.apply(this,arguments)};x.prototype.addTag=function(e){return this._change({state:this.state.resetPage().addTagRefinement(e),isPageReset:!0}),this};x.prototype.addFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.addFrequentlyBoughtTogether(e)}),this};x.prototype.addRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.addRelatedProducts(e)}),this};x.prototype.addTrendingItems=function(e){return this._recommendChange({state:this.recommendState.addTrendingItems(e)}),this};x.prototype.addTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.addTrendingFacets(e)}),this};x.prototype.addLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.addLookingSimilar(e)}),this};x.prototype.removeNumericRefinement=function(e,t,r){return this._change({state:this.state.resetPage().removeNumericRefinement(e,t,r),isPageReset:!0}),this};x.prototype.removeDisjunctiveFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeDisjunctiveFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.removeDisjunctiveRefine=function(){return this.removeDisjunctiveFacetRefinement.apply(this,arguments)};x.prototype.removeHierarchicalFacetRefinement=function(e){return this._change({state:this.state.resetPage().removeHierarchicalFacetRefinement(e),isPageReset:!0}),this};x.prototype.removeFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().removeFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.removeRefine=function(){return this.removeFacetRefinement.apply(this,arguments)};x.prototype.removeFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().removeExcludeRefinement(e,t),isPageReset:!0}),this};x.prototype.removeExclude=function(){return this.removeFacetExclusion.apply(this,arguments)};x.prototype.removeTag=function(e){return this._change({state:this.state.resetPage().removeTagRefinement(e),isPageReset:!0}),this};x.prototype.removeFrequentlyBoughtTogether=function(e){return this._recommendChange({state:this.recommendState.removeParam
1s(e)}),this};x.prototype.removeRelatedProducts=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};x.prototype.removeTrendingItems=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};x.prototype.removeTrendingFacets=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};x.prototype.removeLookingSimilar=function(e){return this._recommendChange({state:this.recommendState.removeParams(e)}),this};x.prototype.toggleFacetExclusion=function(e,t){return this._change({state:this.state.resetPage().toggleExcludeFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.toggleExclude=function(){return this.toggleFacetExclusion.apply(this,arguments)};x.prototype.toggleRefinement=function(e,t){return this.toggleFacetRefinement(e,t)};x.prototype.toggleFacetRefinement=function(e,t){return this._change({state:this.state.resetPage().toggleFacetRefinement(e,t),isPageReset:!0}),this};x.prototype.toggleRefine=function(){return this.toggleFacetRefinement.apply(this,arguments)};x.prototype.toggleTag=function(e){return this._change({state:this.state.resetPage().toggleTagRefinement(e),isPageReset:!0}),this};x.prototype.nextPage=function(){var e=this.state.page||0;return this.setPage(e+1)};x.prototype.previousPage=function(){var e=this.state.page||0;return this.setPage(e-1)};function ka(e){if(e<0)throw new Error("Page requested below 0.");return this._change({state:this.state.setPage(e),isPageReset:!1}),this}x.prototype.setCurrentPage=ka;x.prototype.setPage=ka;x.prototype.setIndex=function(e){return this._change({state:this.state.resetPage().setIndex(e),isPageReset:!0}),this};x.prototype.setQueryParameter=function(e,t){return this._change({state:this.state.resetPage().setQueryParameter(e,t),isPageReset:!0}),this};x.prototype.setState=function(e){return this._change({state:Rn.make(e),isPageReset:!1}),this};x.prototype.overrideStateWithoutTriggeringChangeEvent=function(e){return this.state=new Rn(e),this};x.prototype.hasRefinements=function(e){return dc(this.state.getNumericRefinements(e))?!0:this.state.isConjunctiveFacet(e)?this.state.isFacetRefined(e):this.state.isDisjunctiveFacet(e)?this.state.isDisjunctiveFacetRefined(e):this.state.isHierarchicalFacet(e)?this.state.isHierarchicalFacetRefined(e):!1}
1;x.prototype.isExcluded=function(e,t){return this.state.isExcludeRefined(e,t)};x.prototype.isDisjunctiveRefined=function(e,t){return this.state.isDisjunctiveFacetRefined(e,t)};x.prototype.hasTag=function(e){return this.state.isTagRefined(e)};x.prototype.isTagRefined=function(){return this.hasTagRefinements.apply(this,arguments)};x.prototype.getIndex=function(){return this.state.index};function Va(){return this.state.page}x.prototype.getCurrentPage=Va;x.prototype.getPage=Va;x.prototype.getTags=function(){return this.state.tagRefinements};x.prototype.getRefinements=function(e){var t=[];if(this.state.isConjunctiveFacet(e)){var r=this.state.getConjunctiveRefinements(e);r.forEach(function(s){t.push({value:s,type:"conjunctive"})});var n=this.state.getExcludeRefinements(e);n.forEach(function(s){t.push({value:s,type:"exclude"})})}else if(this.state.isDisjunctiveFacet(e)){var i=this.state.getDisjunctiveRefinements(e);i.forEach(function(s){t.push({value:s,type:"disjunctive"})})}var a=this.state.getNumericRefinements(e);return Object.keys(a).forEach(function(s){var o=a[s];t.push({value:o,operator:s,type:"numeric"})}),t};x.prototype.getNumericRefinement=function(e,t){return this.state.getNumericRefinement(e,t)};x.prototype.getHierarchicalFacetBreadcrumb=function(e){return this.state.getHierarchicalFacetBreadcrumb(e)};x.prototype._search=function(e){var t=this.state,r=[],n=[];e.onlyWithDerivedHelpers||(n=He._getQueries(t.index,t),r.push({state:t,queriesCount:n.length,helper:this}),this.emit("search",{state:t,results:this.lastResults}));var i=this.derivedHelpers.map(function(o){var c=o.getModifiedState(t),u=c.index?He._getQueries(c.index,c):[];return r.push({state:c,queriesCount:u.length,helper:o}),o.emit("search",{state:c,results:o.lastResults}),u}),a=Array.prototype.concat.apply(n,i),s=this._queryId++;if(this._currentNbQueries++,!a.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,r,s));try{this.client.search(a).then(this._dispatchAlgoliaResponse.bind(this,r,s)).catch(this._dispatchAlgoliaError.bind(this,s))}catch(o){this.emit("error",{error:o})}};x.prototype._runComposition=function(){var e=this.state,t=[],r=[],n=this.derivedHelpers.map(function(o){var c=o.getModifiedState(e),u=He._getCompositionQueries(c);return t.push({state:c,queriesCount:u.length,helper:o}),o.emit("search",{state:c,results:o.lastResults}),u}),i=Array.prototype.concat.apply(r,n),a=this._queryId++;if(this._currentNbQueries++,!i.length)return Promise.resolve({results:[]}).then(this._dispatchAlgoliaResponse.bind(this,t,a));if(i.length>1)throw new Error("Only one query is allowed when using a composition.");var s=i[0];try{this.client.search(s).then(this._dispatchAlgoliaResponse.bind(this,t,a)).catch(this._dispatchAlgoliaError.bind(this,a))}catch(o){this.emit("error",{error:o})}};x.prototype._recommend=function(){var e=this.state,t=this.recommendState,r=this.getIndex(),n=[{state:t,index:r,helper:this}],i=t.params.map(function(u){return u.$$id});this.emit("fetch",{recommend:{state:t,results:this.lastRecommendResults}});var a=this._recommendCache,s=this.derivedHelpers.map(function(u){var l=u.getModifiedState(e).index;if(!l)return[];var f=u.getModifiedRecommendState(new Ma);return n.push({state:f,index:l,helper:u}),i=Array.prototype.concat.apply(i,f.params.map(function(d){return d.$$id})),u.emit("fetch",{recommend:{state:f,results:u.lastRecommendResults}}),f._buildQueries(l,a)}),o=Array.prototype.concat.apply(this.recommendState._buildQueries(r,a),s);if(o.length!==0){if(o.length>0&&typeof this.client.getRecommendations>"u"){console.warn("Please update algoliasearch/lite to the latest version in order to use recommend widgets.");return}var c=this._recommendQueryId++;this._currentNbRecommendQueries++;try{this.client.getRecommendations(o).then(this._dispatchRecommendResponse.bind(this,c,n,i)).catch(this._dispatchRecommendError.bind(this,c))}catch(u){this.emit("error",{error:u})}}};x.prototype._dispatchAlgoliaResponse=function(e,t,r){var n=this;if(!(t<this._lastQueryIdReceived)){this._currentNbQueries-=t-this._lastQueryIdReceived,this._lastQueryIdReceived=t,this._currentNbQueries===0&&this.emit
1("searchQueueEmpty");var i=r.results.slice(),a=Object.keys(r).reduce(function(s,o){return o!=="results"&&(s[o]=r[o]),s},{});Object.keys(a).length<=0&&(a=void 0),e.forEach(function(s){var o=s.state,c=s.queriesCount,u=s.helper,l=i.splice(0,c);if(!o.index){u.emit("result",{results:null,state:o});return}u.lastResults=new Kr(o,l,n._searchResultsOptions),a!==void 0&&(u.lastResults._rawContent=a),u.emit("result",{results:u.lastResults,state:o})})}};x.prototype._dispatchRecommendResponse=function(e,t,r,n){if(!(e<this._lastRecommendQueryIdReceived)){this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty");var i=this._recommendCache,a={};r.filter(function(o){return i[o]===void 0}).forEach(function(o,c){a[o]||(a[o]=[]),a[o].push(c)}),Object.keys(a).forEach(function(o){var c=a[o],u=n.results[c[0]];if(c.length===1){i[o]=u;return}i[o]=Object.assign({},u,{hits:pc(c.map(function(l){return n.results[l].hits}))})});var s={};r.forEach(function(o){s[o]=i[o]}),t.forEach(function(o){var c=o.state,u=o.helper;if(!o.index){u.emit("recommend:result",{results:null,state:c});return}u.lastRecommendResults=new mc(c,s),u.emit("recommend:result",{recommend:{results:u.lastRecommendResults,state:c}})})}};x.prototype._dispatchAlgoliaError=function(e,t){e<this._lastQueryIdReceived||(this._currentNbQueries-=e-this._lastQueryIdReceived,this._lastQueryIdReceived=e,this.emit("error",{error:t}),this._currentNbQueries===0&&this.emit("searchQueueEmpty"))};x.prototype._dispatchRecommendError=function(e,t){e<this._lastRecommendQueryIdReceived||(this._currentNbRecommendQueries-=e-this._lastRecommendQueryIdReceived,this._lastRecommendQueryIdReceived=e,this.emit("error",{error:t}),this._currentNbRecommendQueries===0&&this.emit("recommendQueueEmpty"))};x.prototype.containsRefinement=function(e,t,r,n){return e||t.length!==0||r.length!==0||n.length!==0};x.prototype._hasDisjunctiveRefinements=function(e){return this.state.disjunctiveRefinements[e]&&this.state.disjunctiveRefinements[e].length>0};x.prototype._change=function(e){var t=e.state,r=e.isPageReset;t!==this.state&&(this.state=t,this.emit("change",{state:this.state,results:this.lastResults,isPageReset:r}))};x.prototype._recommendChange=function(e){var t=e.state;t!==this.recommendState&&(this.recommendState=t,this.emit("recommend:change",{search:{results:this.lastResults,state:this.state},recommend:{results:this.lastRecommendResults,state:this.recommendState}}))};x.prototype.clearCache=function(){return this.client.clearCache&&this.client.clearCache(),this};x.prototype.setClient=function(e){return this.client===e?this:(typeof e.addAlgoliaAgent=="function"&&e.addAlgoliaAgent("JS Helper ("+Qa+")"),this.client=e,this)};x.prototype.getClient=function(){return this.client};x.prototype.derive=function(e,t){var r=new cc(this,e,t);return this.derivedHelpers.push(r),r};x.prototype.detachDerivedHelper=function(e){var t=this.derivedHelpers.indexOf(e);if(t===-1)throw new Error("Derived helper already detached");this.derivedHelpers.splice(t,1)};x.prototype.hasPendingRequests=function(){return this._currentNbQueries>0};var gc=x,Ba=gc,vc=Oa,yc=xa,bc=$a,Sc=Wa;function Be(e,t,r,n){return new Ba(e,t,r,n)}Be.version=La;Be.AlgoliaSearchHelper=Ba;Be.SearchParameters=bc;Be.RecommendParameters=vc;Be.SearchResults=Sc;Be.RecommendResults=yc;var Rc=Be;const oe=cn(Rc);var Pc=0;function jc(e){e.dependsOn==="recommend"&&(e.$$id=Pc++)}function X(){}function wc(e){return Object.prototype.toString.call(e).slice(8,-1)}function Se(e,t){if(e===void 0||typeof e!="function")throw new Error("The render function is not valid (received type ".concat(wc(e),`). 2 3`).concat(t))}function Dn(e){var t=e.helper,r=e.attributesToClear,n=r===void 0?[]:r,i=t.state.setPage(0);return i=n.reduce(function(a,s){return i.isNumericRefined(s)?a.removeNumericRefinement(s):i.isHierarchicalFacet(s)?a.removeHierarchicalFacetRefinement(s):i.isDisjunctiveFacet(s)?a.removeDisjunctiveFacetRefinement(s):i.isConjunctiveFacet(s)?a.removeFacetRefinement(s):a},i),n.indexOf("query")!==-1&&(i=i.setQuery("")),i}function qa(e){var t=ge.highlightPreTag,r=ge.highlightPostTag;return e.map(function(n){return n.isHighlighted?t+n.value+r:n.value}).join("")}function Oc(e,t,r){return e.state.isHierarchicalFacet(t)?e.state.isHierarchicalFacetRefined(t,r):e.state.isConjunctiveFacet(t)?e.state.isFacetRefined(t,r):e.state.isDisjunctiveFacetRefined(t,r)}function Cn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xc(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
3t%2?Cn(Object(r),!0).forEach(function(n){_c(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Cn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function _c(e,t,r){return t=Fc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Fc(e){var t=$c(e,"string");return Ze(t)=="symbol"?t:String(t)}function $c(e,t){if(Ze(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ze(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ze(e){"@babel/helpers - typeof";return Ze=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ze(e)}function Ec(e,t){return Dc(e)||Ac(e,t)||Tc(e,t)||Ic()}function Ic(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 4In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tc(e,t){if(e){if(typeof e=="string")return Nn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Nn(e,t)}}function Nn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ac(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Dc(e){if(Array.isArray(e))return e}function Ka(e){var t=e.instantSearchInstance,r=e.helper,n=e.attribute,i=e.widgetType,a=function(){for(var o=arguments.length,c=new Array(o),u=0;u<o;u++)c[u]=arguments[u];var l=c[1],f=c[2],d=f===void 0?"Filter Applied":f,m=c[3],p=m===void 0?{}:m,h=c[0].split(":"),y=Ec(h,2),v=y[0],g=y[1],b=typeof n=="string"?n:n(l);if(c.length===1&&Ze(c[0])==="object")t.sendEventToInsights(c[0]);else if(v==="click"&&c.length>=2&&c.length<=4&&!Oc(r,b,l)){var R;t.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:i,eventType:v,eventModifier:g,payload:xc({eventName:d,index:((R=r.lastResults)===null||R===void 0?void 0:R.index)||r.state.index,filters:["".concat(b,":").concat(l)]},p),attribute:b})}};return a}function Ga(e){return btoa(encodeURIComponent(JSON.stringify(e)))}function Hn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Er(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Hn(Object(r),!0).forEach(function(n){Cc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Cc(e,t,r){return t=Nc(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Nc(e){var t=Hc(e,"string");return et(t)=="symbol"?t:String(t)}function Hc(e,t){if(et(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(et(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Wc(e,t){return Qc(e)||Mc(e,t)||Uc(e,t)||Lc()}function Lc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 5In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Uc(e,t){if(e){if(typeof e=="string")return Wn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Wn(e,t)}}function Wn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Mc(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}
5finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Qc(e){if(Array.isArray(e))return e}function et(e){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},et(e)}function kc(e){for(var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:20,r=[],n=0;n<Math.ceil(e.length/t);n++)r.push(e.slice(n*t,(n+1)*t));return r}function za(e){var t=e.helper,r=e.widgetType;e.methodName;var n=e.args,i=e.instantSearchInstance;if(n.length===1&&et(n[0])==="object")return[n[0]];var a=n[0].split(":"),s=Wc(a,2),o=s[0],c=s[1],u=n[1],l=n[2],f=n[3]||{};if(!u)return[];if((o==="click"||o==="conversion")&&!l)return[];var d=Array.isArray(u)?u:[u];if(d.length===0)return[];var m=d[0].__queryID,p=kc(d),h=p.map(function(v){return v.map(function(g){return g.objectID})}),y=p.map(function(v){return v.map(function(g){return g.__position})});return o==="view"?i.status!=="idle"?[]:p.map(function(v,g){var b;return{insightsMethod:"viewedObjectIDs",widgetType:r,eventType:o,payload:Er({eventName:l||"Hits Viewed",index:((b=t.lastResults)===null||b===void 0?void 0:b.index)||t.state.index,objectIDs:h[g]},f),hits:v,eventModifier:c}}):o==="click"?p.map(function(v,g){var b;return{insightsMethod:"clickedObjectIDsAfterSearch",widgetType:r,eventType:o,payload:Er({eventName:l||"Hit Clicked",index:((b=t.lastResults)===null||b===void 0?void 0:b.index)||t.state.index,queryID:m,objectIDs:h[g],positions:y[g]},f),hits:v,eventModifier:c}}):o==="conversion"?p.map(function(v,g){var b;return{insightsMethod:"convertedObjectIDsAfterSearch",widgetType:r,eventType:o,payload:Er({eventName:l||"Hit Converted",index:((b=t.lastResults)===null||b===void 0?void 0:b.index)||t.state.index,queryID:m,objectIDs:h[g]},f),hits:v,eventModifier:c}}):[]}function Vc(e){var t=e.instantSearchInstance,r=e.helper,n=e.widgetType,i={},a=void 0,s=function(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];var f=za({widgetType:n,helper:r,methodName:"sendEvent",args:u,instantSearchInstance:t});f.forEach(function(d){d.eventType==="click"&&d.eventModifier==="internal"&&i[d.eventType]||(i[d.eventType]=!0,t.sendEventToInsights(d))}),clearTimeout(a),a=setTimeout(function(){i={}},0)};return s}function Bc(e){var t=e.helper,r=e.widgetType,n=e.instantSearchInstance,i=function(){for(var s=arguments.length,o=new Array(s),c=0;c<s;c++)o[c]=arguments[c];var u=za({widgetType:r,helper:t,methodName:"bindEvent",args:o,instantSearchInstance:n});return u.length?"data-insights-event=".concat(Ga(u)):""};return i}function me(e){return e.$$type==="ais.index"}function Gr(e,t){var r=e[t.getIndexId()]||{};t.getHelper().setState(t.getWidgetSearchParameters(t.getHelper().state,{uiState:r})),t.getWidgets().filter(me).forEach(function(n){return Gr(e,n)})}var qc=Promise.resolve();function ot(e){var t=null,r=!1,n=function(){for(var a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];t===null&&(t=qc.then(function(){if(t=null,r){r=!1;return}e.apply(void 0,s)}))};return n.wait=function(){if(t===null)throw new Error("The deferred function should be called before calling `wait()`");return t},n.cancel=function(){t!==null&&(r=!0)},n}function Kc(e){var t=e.name,r=e.connector,n=r===void 0?!1:r;return["https://www.algolia.com/doc/api-reference/widgets/",t,"/js/",n?"#connector":""].join("")}function de(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.map(function(i){return Kc(i)}).join(", ");return function(i){return[i,"See documentation: ".concat(n)].filter(Boolean).join(` 6 7`)}}function Gc(e){return typeof e=="string"?e.replace(/^\\-/,"-"):e}function mt(e){return typeof e=="number"&&e<0||typeof e=="string"?String(e).replace(/^-/,"\\-"):e}function We(e,t){for(var r,n=0;n<e.length;n++)if(r=e[n],t(r,n,e))return r}function zc(e,t){if(!Array.isArray(e))return-1;for(var r=0;r<e.length;r++)if(t(e[r]))return r;return-1}function Jc(e){if(e.appId&&e.apiKey)return[e.appId,e.apiKey];if(e.transporter){var t=e.transporter,r=t.headers||t.baseHeaders,n=t.queryParameters||t.baseQueryParameters,i="x-algolia-application-id",a="x-algolia-api-key",s=r[i]||n[i],o=r[a]||n[a];return[s,o]}else return[e.applicationID,e.apiKey]}var Xc=new RegExp(/\w/i);function Yc(e,t){var r,n,i=e[t],a=((r=e[t+1])===null||r===void 0?void 0:r.isHighlighted)||!0,s=((n=e[t-1])===null||n===void 0?void 0:n.isHighlighted)||!0;return!Xc.test(so(i.value))&&s===a?s:i.isHighlighted}function Ir(e,t,r,n){var i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:[],a={type:t,attribute:r,name:n,escapedValue:mt(n)},s=We(i,function(m){return m.name===r}),o;if(t==="hierarchical"){for(var c=e.getHierarchicalFacetByName(r),u=n.split(c.separator),l=function(p){return function(h){return p[h]}},f=function(p){s=s&&s.data&&We(Object.keys(s.data).map(l(s.data)),function(h){return h.name===u[p]})},d=0;s!==void 0&&d<u.length;++d)f(d);o=s&&s.count}else o=s&&s.data&&s.data[a.name];return o!==void 0&&(a.count=o),s&&s.exhaustive!==void 0&&(a.exhaustive=s.exhaustive),a}function Ja(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,n=e||{},i=[],a=t.facetsRefinements,s=a===void 0?{}:a,o=t.facetsExcludes,c=o===void 0?{}:o,u=t.disjunctiveFacetsRefinements,l=u===void 0?{}:u,f=t.hierarchicalFacetsRefinements,d=f===void 0?{}:f,m=t.numericRefinements,p=m===void 0?{}:m,h=t.tagRefinements,y=h===void 0?[]:h;
7return Object.keys(s).forEach(function(v){var g=s[v];g.forEach(function(b){i.push(Ir(t,"facet",v,b,n.facets))})}),Object.keys(c).forEach(function(v){var g=c[v];g.forEach(function(b){i.push({type:"exclude",attribute:v,name:b,exclude:!0})})}),Object.keys(l).forEach(function(v){var g=l[v];g.forEach(function(b){i.push(Ir(t,"disjunctive",v,Gc(b),n.disjunctiveFacets))})}),Object.keys(d).forEach(function(v){var g=d[v];g.forEach(function(b){i.push(Ir(t,"hierarchical",v,b,n.hierarchicalFacets))})}),Object.keys(p).forEach(function(v){var g=p[v];Object.keys(g).forEach(function(b){var R=b,P=g[R],w=Array.isArray(P)?P:[P];w.forEach(function(j){i.push({type:"numeric",attribute:v,name:"".concat(j),numericValue:j,operator:R})})})}),y.forEach(function(v){i.push({type:"tag",attribute:"_tags",name:v})}),r&&t.query&&t.query.trim()&&i.push({attribute:"query",type:"query",name:t.query,query:t.query}),i}function Pt(e){"@babel/helpers - typeof";return Pt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Pt(e)}function Ln(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Un(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ln(Object(r),!0).forEach(function(n){Zc(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ln(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Zc(e,t,r){return t=el(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function el(e){var t=tl(e,"string");return Pt(t)=="symbol"?t:String(t)}function tl(e,t){if(Pt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Pt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function rl(e,t,r){return e.map(function(n,i){return Un(Un({},n),{},{__position:r*t+i+1})})}function jt(e){"@babel/helpers - typeof";return jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},jt(e)}function Mn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Qn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Mn(Object(r),!0).forEach(function(n){nl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function nl(e,t,r){return t=il(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function il(e){var t=al(e,"string");return jt(t)=="symbol"?t:String(t)}function al(e,t){if(jt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(jt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function sl(e,t){return t?e.map(function(r){return Qn(Qn({},r),{},{__queryID:t})}):e}function wt(e){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(e)}function kn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Vn(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
7t%2?kn(Object(r),!0).forEach(function(n){ol(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):kn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ol(e,t,r){return t=ul(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ul(e){var t=cl(e,"string");return wt(t)=="symbol"?t:String(t)}function cl(e,t){if(wt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(wt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ll(e,t){var r=Object.keys(t).reduce(function(n,i){var a=t[i];return a.recommendResults?Vn(Vn({},n),a.recommendResults.results):n},{});e._recommendCache=r}function Ot(e){"@babel/helpers - typeof";return Ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ot(e)}function fl(e,t){return pl(e)||ml(e,t)||hl(e,t)||dl()}function dl(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 8In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function hl(e,t){if(e){if(typeof e=="string")return Bn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bn(e,t)}}function Bn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ml(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function pl(e){if(Array.isArray(e))return e}function qn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ut(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?qn(Object(r),!0).forEach(function(n){Xa(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xa(e,t,r){return t=gl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gl(e){var t=vl(e,"string");return Ot(t)=="symbol"?t:String(t)}function vl(e,t){if(Ot(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ot(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yl(e,t){if(t&&!((!("transporter"in e)||e._cacheHydrated)&&(!e._useCache||typeof e.addAlgoliaAgent!="function"))){var r=[Object.keys(t).reduce(function(s,o){var c=t[o],u=c.state,l=c.requestParams,f=c.results,d=f&&u?f.map(function(m,p){return ut({indexName:u.index||m.index},l!=null&&l[p]||m.params?{params:Tr((l==null?void 0:l[p])||bl(m.params))}:{})}):[];return s.concat(d)},[])],n=Object.keys(t).reduce(function(s,o){var c=t[o].results;return c?s.concat(c):s},[]);if("transporter"in e&&!e._cacheHydrated){e._cacheHydrated=!0;var i=e.search.bind(e);e.search=function(s){for(var o=arguments.length,c=new Array(o>1?o-1:0),u=1;u<o;u++)c[u-1]=arguments[u];var l=Array.isArray(s)?s.map(function(f){return ut(ut({},f),{},{params:Tr(f.params)})}):Tr(s.requestBody.params);return e.transporter.responsesCache.get({method:"search",args:[l].concat(c)},function(){return i.apply(void 0,[s].concat(c))})},e.transporter.responsesCache.set({method:"search",args:r},{results:n})}if(!("transporter"in e)){var a="/1/indexes/*/queries_body_".concat(JSON.stringify({requests:r}));e.cache=ut(ut({},e.cache),{},Xa({},a,JSON.stringify({results:Object.keys(t).map(function(s){return t[s].results})})))}}}function bl(e){return e.split("&").reduce(function(t,r){var n=r.split("="),i=fl(n,2),a=i[0],s=i[1];
8return t[a]=s?decodeURIComponent(s):"",t},{})}function Tr(e){var t=function(i){return Object.prototype.toString.call(i)==="[object Object]"||Object.prototype.toString.call(i)==="[object Array]"},r=function(i){for(var a=arguments.length,s=new Array(a>1?a-1:0),o=1;o<a;o++)s[o-1]=arguments[o];var c=0;return i.replace(/%s/g,function(){return encodeURIComponent(s[c++])})};return Object.keys(e).map(function(n){return r("%s=%s",n,t(e[n])?JSON.stringify(e[n]):e[n])}).join("&")}function Kn(e){return e!==Object(e)}function Ya(e,t){if(e===t)return!0;if(Kn(e)||Kn(t)||typeof e=="function"||typeof t=="function")return e===t;if(Object.keys(e).length!==Object.keys(t).length)return!1;for(var r=0,n=Object.keys(e);r<n.length;r++){var i=n[r];if(!(i in t)||!Ya(e[i],t[i]))return!1}return!0}function q(e){return typeof e=="number"&&isFinite(e)}function Za(e){return e.filter(function(t,r,n){return n.indexOf(t)===r})}function xt(e){"@babel/helpers - typeof";return xt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xt(e)}var Sl=["facets","disjunctiveFacets","facetsRefinements","facetsExcludes","disjunctiveFacetsRefinements","numericRefinements","tagRefinements","hierarchicalFacets","hierarchicalFacetsRefinements","ruleContexts"];function Gn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function xe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Gn(Object(r),!0).forEach(function(n){Rl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Rl(e,t,r){return t=Pl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Pl(e){var t=jl(e,"string");return xt(t)=="symbol"?t:String(t)}function jl(e,t){if(xt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(xt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function wl(e,t){if(e==null)return{};var r=Ol(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Ol(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var xl=function(t,r){r.facets,r.disjunctiveFacets,r.facetsRefinements,r.facetsExcludes,r.disjunctiveFacetsRefinements,r.numericRefinements,r.tagRefinements,r.hierarchicalFacets,r.hierarchicalFacetsRefinements,r.ruleContexts;var n=wl(r,Sl);return t.setQueryParameters(n)},_l=function(t,r){return r.facets.reduce(function(n,i){return n.addFacet(i)},t)},Fl=function(t,r){return r.disjunctiveFacets.reduce(function(n,i){return n.addDisjunctiveFacet(i)},t)},$l=function(t,r){return t.setQueryParameters({hierarchicalFacets:r.hierarchicalFacets.reduce(function(n,i){var a=zc(n,function(o){return o.name===i.name});if(a===-1)return n.concat(i);var s=n.slice();return s.splice(a,1,i),s},t.hierarchicalFacets)})},El=function(t,r){return r.tagRefinements.reduce(function(n,i){return n.addTagRefinement(i)},t)},Il=function(t,r){return t.setQueryParameters({facetsRefinements:xe(xe({},t.facetsRefinements),r.facetsRefinements)})},Tl=function(t,r){return t.setQueryParameters({facetsExcludes:xe(xe({},t.facetsExcludes),r.facetsExcludes)})},Al=function(t,r){return t.setQueryParameters({disjunctiveFacetsRefinements:xe(xe({},t.disjunctiveFacetsRefinements),r.disjunctiveFacetsRefinements)})},Dl=function(t,r){return t.setQueryParameters({numericRefinements:xe(xe({},t.numericRefinements),r.numericRefinements)})},Cl=function(t,r){return t.setQueryParameters({hierarchicalFacetsRefinements:xe(xe({},t.hierarchicalFacetsRefinements),r.hierarchicalFacetsRefinements)})},Nl=function(t,r){var n=Za([].concat(t.ruleContexts).concat(r.ruleContexts).filter(
8Boolean));return n.length>0?t.setQueryParameters({ruleContexts:n}):t},bt=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return r.reduce(function(i,a){var s=Cl(i,a),o=$l(s,a),c=El(o,a),u=Dl(c,a),l=Al(u,a),f=Tl(l,a),d=Il(f,a),m=Fl(d,a),p=Nl(m,a),h=_l(p,a);return xl(h,a)})};function Hl(e){return Ml(e)||Ul(e)||Ll(e)||Wl()}function Wl(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 9In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ll(e,t){if(e){if(typeof e=="string")return zr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zr(e,t)}}function Ul(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Ml(e){if(Array.isArray(e))return zr(e)}function zr(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function zn(e){var t=e.start,r=t===void 0?0:t,n=e.end,i=e.step,a=i===void 0?1:i,s=a===0?1:a,o=Math.round((n-r)/s);return Hl(Array(o)).map(function(c,u){return r+u*s})}function pt(e,t,r){var n=t.getHelper();return{uiState:r,helper:n,parent:t,instantSearchInstance:e,state:n.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,scopedResults:[],searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Jn(e,t,r){var n=t.getResultsForWidget(r),i=t.getHelper();return{helper:i,parent:t,instantSearchInstance:e,results:n,scopedResults:t.getScopedResults(),state:n&&"_state"in n?n._state:i.state,renderState:e.renderState,templatesConfig:e.templatesConfig,createURL:t.createURL,searchMetadata:{isSearchStalled:e.status==="stalled"},status:e.status,error:e.error}}function Ql(e){for(var t=e.getParent(),r=[e.getHelper().state];t!==null;)r=[t.getHelper().state].concat(r),t=t.getParent();return r}function _t(e){"@babel/helpers - typeof";return _t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_t(e)}function Xn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function cr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Xn(Object(r),!0).forEach(function(n){kl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Xn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function kl(e,t,r){return t=Vl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vl(e){var t=Bl(e,"string");return _t(t)=="symbol"?t:String(t)}function Bl(e,t){if(_t(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(_t(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function es(e){return e.some(function(t){return t.isHighlighted})?e.map(function(t,r){return cr(cr({},t),{},{isHighlighted:!Yc(e,r)})}):e.map(function(t){return cr(cr({},t),{},{isHighlighted:!1})})}function De(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{fallback:function(){}},r=t.fallback;return typeof window>"u"?r():e({window})}function Ar(e){return Array.isArray(e)?e:[e]}function Ft(e){"@babel/helpers - typeof";return Ft=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ft(e)}function Yn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function te(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
9t%2?Yn(Object(r),!0).forEach(function(n){ts(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yn(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ts(e,t,r){return t=ql(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ql(e){var t=Kl(e,"string");return Ft(t)=="symbol"?t:String(t)}function Kl(e,t){if(Ft(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ft(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Gl=de({name:"configure",connector:!0});function Zn(e,t){return e.setQueryParameters(Object.keys(t.searchParameters).reduce(function(r,n){return te(te({},r),{},ts({},n,void 0))},{}))}var zl=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:X,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return function(n){if(!n||!oo(n.searchParameters))throw new Error(Gl("The `searchParameters` option expects an object."));var i={};function a(s){return function(o){var c=Zn(s.state,n),u=bt(c,new oe.SearchParameters(o));n.searchParameters=o,s.setState(u).search()}}return{$$type:"ais.configure",init:function(o){var c=o.instantSearchInstance;t(te(te({},this.getWidgetRenderState(o)),{},{instantSearchInstance:c}),!0)},render:function(o){var c=o.instantSearchInstance;t(te(te({},this.getWidgetRenderState(o)),{},{instantSearchInstance:c}),!1)},dispose:function(o){var c=o.state;return r(),Zn(c,n)},getRenderState:function(o,c){var u,l=this.getWidgetRenderState(c);return te(te({},o),{},{configure:te(te({},l),{},{widgetParams:te(te({},l.widgetParams),{},{searchParameters:bt(new oe.SearchParameters((u=o.configure)===null||u===void 0?void 0:u.widgetParams.searchParameters),new oe.SearchParameters(l.widgetParams.searchParameters)).getQueryParams()})})})},getWidgetRenderState:function(o){var c=o.helper;return i.refine||(i.refine=a(c)),{refine:i.refine,widgetParams:n}},getWidgetSearchParameters:function(o,c){var u=c.uiState;return bt(o,new oe.SearchParameters(te(te({},u.configure),n.searchParameters)))},getWidgetUiState:function(o){return te(te({},o),{},{configure:te(te({},o.configure),n.searchParameters)})}}}};function Jr(e){"@babel/helpers - typeof";return Jr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jr(e)}var ei=Object.prototype.hasOwnProperty;function tt(e,t,r){if(r!=null&&r(e,t))return!0;var n,i;if(e===t)return!0;if(e&&t&&(n=e.constructor)===t.constructor){if(n===Date)return e.getTime()===t.getTime();if(n===RegExp)return e.toString()===t.toString();if(n===Array){if((i=e.length)===t.length)for(;i--&&tt(e[i],t[i],r););return i===-1}if(!n||Jr(e)==="object"){i=0;for(n in e)if(ei.call(e,n)&&++i&&!ei.call(t,n)||!(n in t)||!tt(e[n],t[n],r))return!1;return Object.keys(t).length===i}}return e!==e&&t!==t}function ti(e){var t,r,n;return new oe.SearchResults(e,[{query:(t=e.query)!==null&&t!==void 0?t:"",page:(r=e.page)!==null&&r!==void 0?r:0,hitsPerPage:(n=e.hitsPerPage)!==null&&n!==void 0?n:20,hits:[],nbHits:0,nbPages:0,params:"",exhaustiveNbHits:!0,exhaustiveFacetsCount:!0,processingTimeMS:0,index:e.index}],{__isArtificial:!0})}function $t(e){"@babel/helpers - typeof";return $t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},$t(e)}function ri(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ni(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ri(Object(r),!0).forEach(function(n){Jl(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ri(Object(r)).forEac
9h(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Jl(e,t,r){return t=Xl(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xl(e){var t=Yl(e,"string");return $t(t)=="symbol"?t:String(t)}function Yl(e,t){if($t(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if($t(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Xr(e){var t=e.getHelper(),r=e.getResults()||ti(t.state),n=e.getScopedResults().map(function(i){var a=i.indexId===e.getIndexId()?r:ti(i.helper.state);return ni(ni({},i),{},{results:i.results||a})});return{results:r,scopedResults:n,recommendResults:t.lastRecommendResults}}var rs=F.createContext(null);function ns(e,t){if(!e)throw new Error("Invariant failed")}function Pn(){var e=F.useContext(rs);return ns(e!==null),e}var is=F.createContext(null);function nr(){var e=F.useContext(is);return ns(e!==null),e}var Zl=F.createContext(null);function as(){return F.useContext(Zl)}var ef=F.createContext(null);function ss(){return F.useContext(ef)}function tf(e,t){return sf(e)||af(e,t)||nf(e,t)||rf()}function rf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 10In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nf(e,t){if(e){if(typeof e=="string")return ii(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ii(e,t)}}function ii(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function af(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function sf(e){if(Array.isArray(e))return e}function ai(e){var t=F.useState(function(){return e}),r=tf(t,2),n=r[0],i=r[1];return tt(n,e)||i(e),n}var of="use",si=Gs[of],os=typeof window<"u"?F.useLayoutEffect:F.useEffect,uf=F.createContext(null);function us(){return F.useContext(uf)}function cf(e){var t,r=e.widget,n=e.parentIndex,i=e.props,a=e.shouldSsr,s=us(),o=F.useRef(i);F.useEffect(function(){o.current=i},[i]);var c=F.useRef(r);F.useEffect(function(){c.current=r},[r]);var u=F.useRef(null),l=a&&!n.getWidgets().includes(r),f=nr();if(os(function(){var m=c.current;if(!u.current)a||n.addWidgets([r]);else{clearTimeout(u.current);var p=tt(i,o.current);p||(n.removeWidgets([m]),n.addWidgets([r]))}return function(){u.current=setTimeout(function(){f._schedule(function(){f._preventWidgetCleanup||n.removeWidgets([m])})})}},[n,r,a,f,i]),(l||(s==null||(t=s.current)===null||t===void 0?void 0:t.status)==="pending")&&n.addWidgets([r]),typeof window>"u"&&s!==null&&s!==void 0&&s.current&&r.$$type!=="ais.index"){var d;si(s.current),r.$$type!=="ais.dynamicWidgets"&&(d=f.helper)!==null&&d!==void 0&&d.lastResults&&si(s.current)}}function Et(e){"@babel/helpers - typeof";return Et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Et(e)}var lf=["instantSearchInstance","widgetParams"],ff=["widgetParams"];function df(e,t){return gf(e)||pf(e,t)||mf(e,t)||hf()}function hf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 11In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function mf(e,t){if(e){if(typeof e=="string")return oi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return oi(e,t)}}function oi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function pf(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}
11finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function gf(e){if(Array.isArray(e))return e}function ui(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ci(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ui(Object(r),!0).forEach(function(n){vf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ui(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vf(e,t,r){return t=yf(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function yf(e){var t=bf(e,"string");return Et(t)=="symbol"?t:String(t)}function bf(e,t){if(Et(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Et(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function li(e,t){if(e==null)return{};var r=Sf(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Sf(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function ve(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=as(),i=ss(),a=nr(),s=Pn(),o=ai(t),c=ai(r),u=F.useRef(!0),l=F.useRef(null),f=F.useRef(a.status),d=F.useMemo(function(){var v=e(function(g,b){if(b){u.current=!0;return}if(u.current){var R=g.instantSearchInstance;g.widgetParams;var P=li(g,lf);(!tt(P,l.current,function(w,j){return(w==null?void 0:w.constructor)===Function&&(j==null?void 0:j.constructor)===Function})||R.status!==f.current)&&(y(P),l.current=P,f.current=R.status)}},function(){u.current=!1});return ci(ci({},v(o)),c)},[e,o,c]),m=F.useState(function(){if(d.getWidgetRenderState){var v,g=s.getHelper(),b=s.getWidgetUiState({})[s.getIndexId()];g.state=((v=d.getWidgetSearchParameters)===null||v===void 0?void 0:v.call(d,g.state,{uiState:b}))||g.state;var R=Xr(s),P=R.results,w=R.scopedResults,j=R.recommendResults,O=d.getWidgetRenderState({helper:g,parent:s,instantSearchInstance:a,results:d.dependsOn==="recommend"&&j&&i?j[i.recommendIdx.current++]:P,scopedResults:w,state:g.state,renderState:a.renderState,templatesConfig:a.templatesConfig,createURL:s.createURL,searchMetadata:{isSearchStalled:a.status==="stalled"},status:a.status,error:a.error});O.widgetParams;var T=li(O,ff);return T}return{}}),p=df(m,2),h=p[0],y=p[1];return cf({widget:d,parentIndex:s,props:o,shouldSsr:!!n}),h}function Rf(e,t){return ve(zl,{searchParameters:e},t)}function It(e){"@babel/helpers - typeof";return It=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},It(e)}function fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Pf(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?fi(Object(r),!0).forEach(function(n){jf(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function jf(e,t,r){return t=wf(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function wf(e){var t=Of(e,"string");return It(t)=="symbol"?t:String(t)}function Of(e,t){if(It(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(It(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xf(e){return Rf(Pf({},e),{$$widgetType:"ais.configure"}),null}function Tt(e){"@babel/helpers - typeof";return Tt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Tt(e)}var _f=["initialSearchParameters"],Ff=["initialRecommendParameters"];function di(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Oe(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
11t%2?di(Object(r),!0).forEach(function(n){Xe(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):di(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Xe(e,t,r){return t=$f(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $f(e){var t=Ef(e,"string");return Tt(t)=="symbol"?t:String(t)}function Ef(e,t){if(Tt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Tt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function cs(e){return Df(e)||Af(e)||Tf(e)||If()}function If(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Tf(e,t){if(e){if(typeof e=="string")return Yr(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Yr(e,t)}}function Af(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Df(e){if(Array.isArray(e))return Yr(e)}function Yr(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ls(e,t){if(e==null)return{};var r=Cf(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function Cf(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var ct=de({name:"index-widget"});function fs(e,t){var r=t.state,n=t.recommendState,i=t.isPageReset,a=t._uiState;r!==e.state&&(e.state=r,e.emit("change",{state:e.state,results:e.lastResults,isPageReset:i,_uiState:a})),n!==e.recommendState&&(e.recommendState=n)}function lt(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return e.reduce(function(n,i){return me(i)||!i.getWidgetUiState&&!i.getWidgetState?n:i.getWidgetUiState?i.getWidgetUiState(n,t):i.getWidgetState(n,t)},r)}function ft(e,t){var r=t.initialSearchParameters,n=ls(t,_f);return e.reduce(function(i,a){return!a.getWidgetSearchParameters||me(a)?i:a.dependsOn==="search"&&a.getWidgetParameters?a.getWidgetParameters(i,n):a.getWidgetSearchParameters(i,n)},r)}function hi(e,t){var r=t.initialRecommendParameters,n=ls(t,Ff);return e.reduce(function(i,a){return!me(a)&&a.dependsOn==="recommend"&&a.getWidgetParameters?a.getWidgetParameters(i,n):i},r)}function ds(e){var t=e.filter(me);t.length!==0&&t.forEach(function(r){var n=r.getHelper();fs(n,{state:n.state.resetPage(),recommendState:n.recommendState,isPageReset:!0}),ds(r.getWidgets())})}function hs(e){var t=e.filter(me);return t.reduce(function(r,n){return r.concat.apply(r,[{indexId:n.getIndexId(),results:n.getResults(),helper:n.getHelper()}].concat(cs(hs(n.getWidgets()))))},[])}var Nf=function(t){if(t===void 0||t.indexName===void 0)throw new Error(ct("The `indexName` option is required."));var r=t.indexName,n=t.indexId,i=n===void 0?r:n,a=[],s={},o=null,c=null,u=null,l=null,f=null,d=!1,m=!1;return{$$type:"ais.index",$$widgetType:"ais.index",getIndexName:function(){return r},getIndexId:function(){return i},getHelper:function(){return u},getResults:function(){var h;return(h=l)!==null&&h!==void 0&&h.lastResults?(l.lastResults._state=u.state,l.lastResults):null},getResultsForWidget:function(h){var y;return h.dependsOn!=="recommend"||me(h)||h.$$id===void 0?this.getResults():(y=u)!==null&&y!==void 0&&y.lastRecommendResults?u.lastRecommendResults[h.$$id]:null},getPreviousState:function(){return f},getScopedResults:function(){var h=this.getParent(),y;return h?y=h.getWidgets():r.length===0?y=this.getWidgets():y=[this],hs(y)},getParent:function(){return c},createURL:function(h){return typeof h=="function"?o._createURL(Xe({},i,h(s))):o._createURL(Xe({},i,lt(a,{searchParameters:h,helper:u})))},getWidgets:function(){return a},addWidgets:function(h){var y=this;if(!Array.isArray(h))throw new Error(ct("The `addWidgets` method expects an array of widgets."));if(h.some(function(v){return typeof v.init!="function"&&typeof v.render!="function"}))throw new Error(ct("The widget definition expects a `render` and/or an `init` method."));return h.forEach(function(v){me(v)||(o&&v.dependsOn==="recommend"?o._hasRecommendWidget=!0:o?o._hasSearchWidget=!0:v.dependsOn==="recommend"?d=!0:m=!0,jc(v))}),a=a.concat(h),o&&h.length&&(fs(u,{state:ft(a,{uiState:s,initialSearchParameters:u.state}),recommendState:hi(a,{uiState:s,initialRecommendParameters:u.recommendState}),_uiState:s}),h.forEach(function(v){if(v.getRenderState){var g=v.getRenderState(o.renderState[y.getIndexId()]||{},pt(o,y,o._initialUiState));
12Dr({renderState:g,instantSearchInstance:o,parent:y})}}),h.forEach(function(v){v.init&&v.init(pt(o,y,o._initialUiState))}),o.scheduleSearch()),this},removeWidgets:function(h){var y=this;if(!Array.isArray(h))throw new Error(ct("The `removeWidgets` method expects an array of widgets."));if(h.some(function(P){return typeof P.dispose!="function"}))throw new Error(ct("The widget definition expects a `dispose` method."));if(a=a.filter(function(P){return h.indexOf(P)===-1}),a.forEach(function(P){me(P)||(o&&P.dependsOn==="recommend"?o._hasRecommendWidget=!0:o?o._hasSearchWidget=!0:P.dependsOn==="recommend"?d=!0:m=!0)}),o&&h.length){var v=h.reduce(function(P,w){var j=w.dispose({helper:u,state:P.cleanedSearchState,recommendState:P.cleanedRecommendState,parent:y});return j instanceof oe.RecommendParameters?P.cleanedRecommendState=j:j&&(P.cleanedSearchState=j),P},{cleanedSearchState:u.state,cleanedRecommendState:u.recommendState}),g=v.cleanedSearchState,b=v.cleanedRecommendState,R=o.future.preserveSharedStateOnUnmount?ft(a,{uiState:s,initialSearchParameters:new oe.SearchParameters({index:this.getIndexName()})}):ft(a,{uiState:lt(a,{searchParameters:g,helper:u}),initialSearchParameters:g});s=lt(a,{searchParameters:R,helper:u}),u.setState(R),u.recommendState=b,a.length&&o.scheduleSearch()}return this},init:function(h){var y=this,v,g=h.instantSearchInstance,b=h.parent,R=h.uiState;if(u===null){o=g,c=b,s=R[i]||{};var P=g.mainHelper,w=ft(a,{uiState:s,initialSearchParameters:new oe.SearchParameters({index:r})}),j=hi(a,{uiState:s,initialRecommendParameters:new oe.RecommendParameters});u=oe({},w.index,w),u.recommendState=j,u.search=function(){return g.onStateChange?(g.onStateChange({uiState:g.mainIndex.getWidgetUiState({}),setUiState:function(A){return g.setUiState(A,!1)}}),P):P.search()},u.searchWithoutTriggeringOnStateChange=function(){return P.search()},u.searchForFacetValues=function($,A,B,C){var L=u.state.setQueryParameters(C);return P.searchForFacetValues($,A,B,L)},l=P.derive(function(){return bt.apply(void 0,[P.state].concat(cs(Ql(y))))},function(){return y.getHelper().recommendState});var O=(v=g._initialResults)===null||v===void 0?void 0:v[this.getIndexId()];if(O!=null&&O.results){var T=new oe.SearchResults(new oe.SearchParameters(O.state),O.results);l.lastResults=T,u.lastResults=T}if(O!=null&&O.recommendResults){var _=new oe.RecommendResults(new oe.RecommendParameters({params:O.recommendResults.params}),O.recommendResults.results);l.lastRecommendResults=_,u.lastRecommendResults=_}u.on("change",function($){var A=$.isPageReset;A&&ds(a)}),l.on("search",function(){g.scheduleStalledRender()}),l.on("result",function($){var A=$.results;g.scheduleRender(),u.lastResults=A,f=A==null?void 0:A._state}),l.on("recommend:result",function($){var A=$.recommend;g.scheduleRender(),u.lastRecommendResults=A.results}),a.forEach(function($){if($.getRenderState){var A=$.getRenderState(g.renderState[y.getIndexId()]||{},pt(g,y,R));Dr({renderState:A,instantSearchInstance:g,parent:y})}}),a.forEach(function($){$.init&&$.init(pt(g,y,R))}),u.on("change",function($){var A=$.state,B=$._uiState;s=lt(a,{searchParameters:A,helper:u},B||{}),g.onStateChange||g.onInternalStateChange()}),O&&g.scheduleRender(),d&&(g._hasRecommendWidget=!0),m&&(g._hasSearchWidget=!0)}},render:function(h){var y,v=this,g=h.instantSearchInstance;g.status==="error"&&!g.mainHelper.hasPendingRequests()&&f&&u.setState(f);var b=this.getResults()||(y=l)!==null&&y!==void 0&&y.lastRecommendResults?a:a.filter(me);b=b.filter(function(R){return R.shouldRender?R.shouldRender({instantSearchInstance:g}):!0}),b.forEach(function(R){if(R.getRenderState){var P=R.getRenderState(g.renderState[v.getIndexId()]||{},Jn(g,v,R));Dr({renderState:P,instantSearchInstance:g,parent:v})}}),b.forEach(function(R){R.render&&R.render(Jn(g,v,R))})},dispose:function(){var h=this,y,v;a.forEach(function(g){g.dispose&&u&&g.dispose({helper:u,state:u.state,recommendState:u.recommendState,parent:h})}),o=null,c=null,(y=u)===null||y===void 0||y.removeAllListeners(),u=null,(v=l)===null||v===void 0||v.detach(),l=null},getWidgetUiState:function(h){return a.filter(me).reduce(function(y,v){return v.getW
12idgetUiState(y)},Oe(Oe({},h),{},Xe({},i,Oe(Oe({},h[i]),s))))},getWidgetState:function(h){return this.getWidgetUiState(h)},getWidgetSearchParameters:function(h,y){var v=y.uiState;return ft(a,{uiState:v,initialSearchParameters:h})},refreshUiState:function(){s=lt(a,{searchParameters:this.getHelper().state,helper:this.getHelper()},s)},setIndexUiState:function(h){var y=typeof h=="function"?h(s):h;o.setUiState(function(v){return Oe(Oe({},v),{},Xe({},i,y))})}}};function Dr(e){var t=e.renderState,r=e.instantSearchInstance,n=e.parent,i=n?n.getIndexId():r.mainIndex.getIndexId();r.renderState=Oe(Oe({},r.renderState),{},Xe({},i,Oe(Oe({},r.renderState[i]),t)))}function Hf(e,t){return Mf(e)||Uf(e,t)||Lf(e,t)||Wf()}function Wf(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 13In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Lf(e,t){if(e){if(typeof e=="string")return mi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return mi(e,t)}}function mi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Uf(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Mf(e){if(Array.isArray(e))return e}function Qf(){var e=F.useReducer(function(n){return n+1},0),t=Hf(e,2),r=t[1];return r}var kf="ais",jr=function(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=r.descendantName,i=r.modifierName,a=n?"-".concat(n):"",s=i?"--".concat(i):"";return"".concat(kf,"-").concat(t).concat(a).concat(s)}},Vf=jr("Highlight");function Bf(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,s=a===void 0?{}:a,o=Pr(i._highlightResult,t),c=o||{},u=c.value,l=u===void 0?"":u,f=Vf({descendantName:"highlighted"})+(s.highlighted?" ".concat(s.highlighted):"");return l.replace(new RegExp(ge.highlightPreTag,"g"),"<".concat(n,' class="').concat(f,'">')).replace(new RegExp(ge.highlightPostTag,"g"),"</".concat(n,">"))}var qf=jr("ReverseHighlight");function Kf(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,s=a===void 0?{}:a,o=Pr(i._highlightResult,t),c=o||{},u=c.value,l=u===void 0?"":u,f=qf({descendantName:"highlighted"})+(s.highlighted?" ".concat(s.highlighted):""),d=qa(es(da(l)));return d.replace(new RegExp(ge.highlightPreTag,"g"),"<".concat(n,' class="').concat(f,'">')).replace(new RegExp(ge.highlightPostTag,"g"),"</".concat(n,">"))}var Gf=jr("Snippet");function zf(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,s=a===void 0?{}:a,o=Pr(i._snippetResult,t),c=o||{},u=c.value,l=u===void 0?"":u,f=Gf({descendantName:"highlighted"})+(s.highlighted?" ".concat(s.highlighted):"");return l.replace(new RegExp(ge.highlightPreTag,"g"),"<".concat(n,' class="').concat(f,'">')).replace(new RegExp(ge.highlightPostTag,"g"),"</".concat(n,">"))}var Jf=jr("ReverseSnippet");function Xf(e){var t=e.attribute,r=e.highlightedTagName,n=r===void 0?"mark":r,i=e.hit,a=e.cssClasses,s=a===void 0?{}:a,o=Pr(i._snippetResult,t),c=o||{},u=c.value,l=u===void 0?"":u,f=Jf({descendantName:"highlighted"})+(s.highlighted?" ".concat(s.highlighted):""),d=qa(es(da(l)));return d.replace(new RegExp(ge.highlightPreTag,"g"),"<".concat(n,' class="').concat(f,'">')).replace(new RegExp(ge.highlightPostTag,"g"),"</".concat(n,">"))}function Zr(e){"@babel/helpers - typeof";return Zr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Zr(e)}function Yf(e){var t=e.method,r=e.payload;if(Zr(r)!=="object")throw new Error("The insights helper expects the payload to be an object.");var n;try{n=Ga(r)}catch{throw new Error("Could not JSON serialize the payload object.")}return'data-insights-method="'.concat(t,'" data-insights-payload="').concat(n,'"')}function Zf(e,t){return Yf({method:e,payload:t})}function en(e){"@babel/helpers - typeof";return en=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},en(e)}var ed="_ALGOLIA";function td(e){if(!((typeof document>"u"?"undefined":en(document))!=="object"||typeof document.cookie!="string"))for(var t="".concat(e,"="),r=
13document.cookie.split(";"),n=0;n<r.length;n++){for(var i=r[n];i.charAt(0)===" ";)i=i.substring(1);if(i.indexOf(t)===0)return i.substring(t.length,i.length)}}function rd(){return td(ed)}function nd(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=Math.random()*16|0,r=e==="x"?t:t&3|8;return r.toString(16)})}function At(e){"@babel/helpers - typeof";return At=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},At(e)}function pi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?pi(Object(r),!0).forEach(function(n){id(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function id(e,t,r){return t=ad(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ad(e){var t=sd(e,"string");return At(t)=="symbol"?t:String(t)}function sd(e,t){if(At(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(At(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Te(e,t){return cd(e)||ud(e,t)||ms(e,t)||od()}function od(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 14In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ud(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function cd(e){if(Array.isArray(e))return e}function ld(e){return hd(e)||dd(e)||ms(e)||fd()}function fd(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 15In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ms(e,t){if(e){if(typeof e=="string")return tn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tn(e,t)}}function dd(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function hd(e){if(Array.isArray(e))return tn(e)}function tn(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var ps="2.17.2",md="https://cdn.jsdelivr.net/npm/search-insights@".concat(ps,"/dist/search-insights.min.js");function gi(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.insightsClient,r=e.insightsInitParams,n=e.onEvent,i=e.$$internal,a=i===void 0?!1:i,s=e.$$automatic,o=s===void 0?!1:s,c=t;!t&&t!==null&&De(function(l){var f=l.window,d=f.AlgoliaAnalyticsObject||"aa";typeof d=="string"&&(c=f[d]),c||(f.AlgoliaAnalyticsObject=d,f[d]||(f[d]=function(){f[d].queue||(f[d].queue=[]);for(var m=arguments.length,p=new Array(m),h=0;h<m;h++)p[h]=arguments[h];f[d].queue.push(p)},f[d].version=ps,f[d].shouldAddScript=!0),c=f[d])});var u=c||X;return function(l){var f=l.instantSearchInstance,d=f.middleware.filter(function(T){return T.instance.$$type==="ais.insights"&&T.instance.$$internal}).map(function(T){return T.creator});f.unuse.apply(f,ld(d));var m=Jc(f.client),p=Te(m,2),h=p[0],y=p[1],v=void 0,g=void 0,b=void 0,R=u.queue;if(Array.isArray(R)){var P=["setUserToken","init"].map(function(T){var _=We(R.slice().reverse(),function(B){var C=Te(B,1),L=C[0];return L===T})||[],$=Te(_,2),A=$[1];return A}),w=Te(P,2);
15g=w[0],v=w[1]}u("getUserToken",null,function(T,_){b=yi(_)}),(r||!vi(u))&&u("init",Le({appId:h,apiKey:y,partial:!0},r));var j,O;return{$$type:"ais.insights",$$internal:a,$$automatic:o,onStateChange:function(){},subscribe:function(){if(u.shouldAddScript){var _="[insights middleware]: could not load search-insights.js. Please load it manually following https://alg.li/insights-init";try{var $=document.createElement("script");$.async=!0,$.src=md,$.onerror=function(){f.emit("error",new Error(_))},document.body.appendChild($),u.shouldAddScript=!1}catch{u.shouldAddScript=!1,f.emit("error",new Error(_))}}},started:function(){u("addAlgoliaAgent","insights-middleware"),O=f.mainHelper;var _=u.queue;if(Array.isArray(_)){var $=["setUserToken","init"].map(function(H){var V=We(_.slice().reverse(),function(re){var he=Te(re,1),pe=he[0];return pe===H})||[],G=Te(V,2),z=G[1];return z}),A=Te($,2);g=A[0],v=A[1]}j=pd(f),o||O.overrideStateWithoutTriggeringChangeEvent(Le(Le({},O.state),{},{clickAnalytics:!0})),a||f.scheduleSearch();var B=function(V){var G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,z=yi(V);if(!z)return;var re=O.state.userToken;function he(){O.overrideStateWithoutTriggeringChangeEvent(Le(Le({},O.state),{},{userToken:z})),re&&re!==V&&f.scheduleSearch()}G?he():setTimeout(he,0)};function C(H){B(H,!0),u("setUserToken",H)}var L=void 0,k=rd();if(k)L=k;else{var D="anonymous-".concat(nd());L=D}var E,W=j.userToken;if(r!=null&&r.userToken&&(E=r.userToken),E)C(E);else if(W)C(W);else if(b)C(b);else if(g)C(g);else if(L){var I;if(C(L),r!=null&&r.useCookie||(I=v)!==null&&I!==void 0&&I.useCookie){var N;gd(L,(r==null?void 0:r.cookieDuration)||((N=v)===null||N===void 0?void 0:N.cookieDuration))}}u("onUserTokenChange",function(H){return B(H,!0)},{immediate:!0});var U=u;vi(u)&&(U=function(V,G){var z={headers:{"X-Algolia-Application-Id":h,"X-Algolia-API-Key":y}};return u(V,G,z)});var Z=new Set,J;f.mainHelper.derivedHelpers[0].on("result",function(H){var V=H.results;V&&(!V.queryID||V.queryID!==J)&&(J=V.queryID,Z.clear())}),f.sendEventToInsights=function(H){if(n)n(H,U);else if(H.insightsMethod){if(H.insightsMethod==="viewedObjectIDs"){var V=H.payload,G=V.objectIDs.filter(function(z){return!Z.has(z)});if(G.length===0)return;G.forEach(function(z){return Z.add(z)}),V.objectIDs=G}H.payload.algoliaSource=["instantsearch"],o&&H.payload.algoliaSource.push("instantsearch-automatic"),H.eventModifier==="internal"&&H.payload.algoliaSource.push("instantsearch-internal"),U(H.insightsMethod,H.payload)}}},unsubscribe:function(){u("onUserTokenChange",void 0),f.sendEventToInsights=X,O&&j&&(O.overrideStateWithoutTriggeringChangeEvent(Le(Le({},O.state),j)),f.scheduleSearch())}}}}function pd(e){var t,r,n=((t=e._initialResults)===null||t===void 0||(r=t[e.indexName])===null||r===void 0?void 0:r.state)||{},i=e.mainHelper.state;return{userToken:n.userToken||i.userToken,clickAnalytics:n.clickAnalytics||i.clickAnalytics}}function gd(e,t){var r=2592e6,n=new Date;n.setTime(n.getTime()+(t||r*6));var i="expires=".concat(n.toUTCString());document.cookie="_ALGOLIA=".concat(e,";").concat(i,";path=/")}
15function vi(e){var t=(e.version||"").split(".").map(Number),r=Te(t,2),n=r[0],i=r[1],a=n>=3,s=n===2&&i>=6,o=n===1&&i>=10;return a||s||o}function yi(e){if(e)return typeof e=="number"?e.toString():e}function gs(e,t,r){var n=pt(t,t.mainIndex,t._initialUiState);e.forEach(function(i){var a={};if(i.getWidgetRenderState){var s=i.getWidgetRenderState(n);s&&s.widgetParams&&(a=s.widgetParams)}var o=Object.keys(a).filter(function(c){return a[c]!==void 0});r.widgets.push({type:i.$$type,widgetType:i.$$widgetType,params:o}),i.$$type==="ais.index"&&gs(i.getWidgets(),t,r)})}function vd(){return De(function(e){var t,r,n=e.window;return((t=n.navigator)===null||t===void 0||(r=t.userAgent)===null||r===void 0?void 0:r.indexOf("Algolia Crawler"))>-1},{fallback:function(){return!1}})}function yd(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.$$internal,r=t===void 0?!1:t;return function(n){var i=n.instantSearchInstance,a={widgets:[]},s=document.createElement("meta"),o=document.querySelector("head");return s.name="instantsearch:widgets",{$$type:"ais.metadata",$$internal:r,onStateChange:function(){},subscribe:function(){setTimeout(function(){var u=i.client;a.ua=u.transporter&&u.transporter.userAgent?u.transporter.userAgent.value:u._ua,gs(i.mainIndex.getWidgets(),i,a),i.middleware.forEach(function(l){return a.widgets.push({middleware:!0,type:l.instance.$$type,internal:l.instance.$$internal})}),s.content=JSON.stringify(a),o.appendChild(s)},0)},started:function(){},unsubscribe:function(){s.remove()}}}}var bd=String.prototype.replace,Sd=/%20/g,Cr={RFC1738:"RFC1738",RFC3986:"RFC3986"},jn={default:Cr.RFC3986,formatters:{RFC1738:function(e){return bd.call(e,Sd,"+")},RFC3986:function(e){return String(e)}},RFC1738:Cr.RFC1738,RFC3986:Cr.RFC3986},Rd=jn,Nr=Object.prototype.hasOwnProperty,Me=Array.isArray,je=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Pd=function(t){for(;t.length>1;){var r=t.pop(),n=r.obj[r.prop];if(Me(n)){for(var i=[],a=0;a<n.length;++a)typeof n[a]<"u"&&i.push(n[a]);r.obj[r.prop]=i}}},vs=function(t,r){for(var n=r&&r.plainObjects?Object.create(null):{},i=0;i<t.length;++i)typeof t[i]<"u"&&(n[i]=t[i]);return n},jd=function e(t,r,n){if(!r)return t;if(typeof r!="object"){if(Me(t))t.push(r);else if(t&&typeof t=="object")(n&&(n.plainObjects||n.allowPrototypes)||!Nr.call(Object.prototype,r))&&(t[r]=!0);else return[t,r];return t}if(!t||typeof t!="object")return[t].concat(r);var i=t;return Me(t)&&!Me(r)&&(i=vs(t,n)),Me(t)&&Me(r)?(r.forEach(function(a,s){if(Nr.call(t,s)){var o=t[s];o&&typeof o=="object"&&a&&typeof a=="object"?t[s]=e(o,a,n):t.push(a)}else t[s]=a}),t):Object.keys(r).reduce(function(a,s){var o=r[s];return Nr.call(a,s)?a[s]=e(a[s],o,n):a[s]=o,a},i)},wd=function(t,r){return Object.keys(r).reduce(function(n,i){return n[i]=r[i],n},t)},Od=function(e,t,r){var n=e.replace(/\+/g," ");if(r==="iso-8859-1")return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch{return n}},xd=function(t,r,n,i,a){if(t.length===0)return t;var s=t;if(typeof t=="symbol"?s=Symbol.prototype.toString.call(t):typeof t!="string"&&(s=String(t)),n==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(l){return"%26%23"+parseInt(l.slice(2),16)+"%3B"});for(var o="",c=0;c<s.length;++c){var u=s.charCodeAt(c);if(u===45||u===46||u===95||u===126||u>=48&&u<=57||u>=65&&u<=90||u>=97&&u<=122||a===Rd.RFC1738&&(u===40||u===41)){o+=s.charAt(c);continue}if(u<128){o=o+je[u];continue}if(u<2048){o=o+(je[192|u>>6]+je[128|u&63]);continue}if(u<55296||u>=57344){o=o+(je[224|u>>12]+je[128|u>>6&63]+je[128|u&63]);continue}c+=1,u=65536+((u&1023)<<10|s.charCodeAt(c)&1023),o+=je[240|u>>18]+je[128|u>>12&63]+je[128|u>>6&63]+je[128|u&63]}return o},_d=function(t){for(var r=[{obj:{o:t},prop:"o"}],n=[],i=0;i<r.length;++i)for(var a=r[i],s=a.obj[a.prop],o=Object.keys(s),c=0;c<o.length;++c){var u=o[c],l=s[u];typeof l=="object"&&l!==null&&n.indexOf(l)===-1&&(r.push({obj:s,prop:u}),n.push(l))}return Pd(r),t},Fd=function(t){return Object.prototype.toString.call(t)==="[object RegExp]"},$d=function(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))},Ed=function(t,r){return[].concat(t,r)},Id=function(t,r){if(Me(t)){for(var n=[],i=0;i<t.length;i+=1)n.push(r(t[i]));return n}return r(t)},ys={arrayToObject:vs,assign:wd,combine:Ed,compact:_d,decode:Od,encode:xd,isBuffer:$d,isRegExp:Fd,maybeMap:Id,merge:jd},rn=ys,St=jn,Td=Object.prototype.hasOwnProperty,bi={brackets:function(t){return t+"[]"},comma:"comma",indices:function(t,r){return t+"["+r+"]"},repeat:function(t){return t}},ke=Array.isArray,Ad=String.prototype.split,Dd=Array.prototype.push,bs=function(e,t){Dd.apply(e,ke(t)?t:[t])}
15,Cd=Date.prototype.toISOString,Si=St.default,ie={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:rn.encode,encodeValuesOnly:!1,format:Si,formatter:St.formatters[Si],indices:!1,serializeDate:function(t){return Cd.call(t)},skipNulls:!1,strictNullHandling:!1},Nd=function(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"},Hd=function e(t,r,n,i,a,s,o,c,u,l,f,d,m,p){var h=t;if(typeof o=="function"?h=o(r,h):h instanceof Date?h=l(h):n==="comma"&&ke(h)&&(h=rn.maybeMap(h,function($){return $ instanceof Date?l($):$})),h===null){if(i)return s&&!m?s(r,ie.encoder,p,"key",f):r;h=""}if(Nd(h)||rn.isBuffer(h)){if(s){var y=m?r:s(r,ie.encoder,p,"key",f);if(n==="comma"&&m){for(var v=Ad.call(String(h),","),g="",b=0;b<v.length;++b)g+=(b===0?"":",")+d(s(v[b],ie.encoder,p,"value",f));return[d(y)+"="+g]}return[d(y)+"="+d(s(h,ie.encoder,p,"value",f))]}return[d(r)+"="+d(String(h))]}var R=[];if(typeof h>"u")return R;var P;if(n==="comma"&&ke(h))P=[{value:h.length>0?h.join(",")||null:void 0}];else if(ke(o))P=o;else{var w=Object.keys(h);P=c?w.sort(c):w}for(var j=0;j<P.length;++j){var O=P[j],T=typeof O=="object"&&typeof O.value<"u"?O.value:h[O];if(!(a&&T===null)){var _=ke(h)?typeof n=="function"?n(r,O):r:r+(u?"."+O:"["+O+"]");bs(R,e(T,_,n,i,a,s,o,c,u,l,f,d,m,p))}}return R},Wd=function(t){if(!t)return ie;if(t.encoder!==null&&typeof t.encoder<"u"&&typeof t.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=t.charset||ie.charset;if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=St.default;if(typeof t.format<"u"){if(!Td.call(St.formatters,t.format))throw new TypeError("Unknown format option provided.");n=t.format}var i=St.formatters[n],a=ie.filter;return(typeof t.filter=="function"||ke(t.filter))&&(a=t.filter),{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:ie.addQueryPrefix,allowDots:typeof t.allowDots>"u"?ie.allowDots:!!t.allowDots,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ie.charsetSentinel,delimiter:typeof t.delimiter>"u"?ie.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:ie.encode,encoder:typeof t.encoder=="function"?t.encoder:ie.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:ie.encodeValuesOnly,filter:a,format:n,formatter:i,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:ie.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:ie.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ie.strictNullHandling}},Ld=function(e,t){var r=e,n=Wd(t),i,a;typeof n.filter=="function"?(a=n.filter,r=a("",r)):ke(n.filter)&&(a=n.filter,i=a);var s=[];if(typeof r!="object"||r===null)return"";var o;t&&t.arrayFormat in bi?o=t.arrayFormat:t&&"indices"in t?o=t.indices?"indices":"repeat":o="indices";var c=bi[o];i||(i=Object.keys(r)),n.sort&&i.sort(n.sort);for(var u=0;u<i.length;++u){var l=i[u];n.skipNulls&&r[l]===null||bs(s,Hd(r[l],l,c,n.strictNullHandling,n.skipNulls,n.encode?n.encoder:null,n.filter,n.sort,n.allowDots,n.serializeDate,n.format,n.formatter,n.encodeValuesOnly,n.charset))}var f=s.join(n.delimiter),d=n.addQueryPrefix===!0?"?":"";return n.charsetSentinel&&(n.charset==="iso-8859-1"?d+="utf8=%26%2310003%3B&":d+="utf8=%E2%9C%93&"),f.length>0?d+f:""},rt=ys,nn=Object.prototype.hasOwnProperty,Ud=Array.isArray,ne={allowDots:!1,allowPrototypes:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decoder:rt.decode,delimiter:"&",depth:5,ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},Md=function(e){return e.replace(/&#(\d+);/g,function(t,r){return String.fromCharCode(parseInt(r,10))})},Ss=function(e,t){return e&&typeof e=="string"&&t.comma&&e.indexOf(",")>-1?e.split(","):e},Qd="utf8=%26%2310003%3B",kd="utf8=%E2%9C%93",Vd=function(t,r){var n={},i=r.ignoreQueryPrefix?t.replace(/^\?/,""):t,a=r.parameterLimit===1/0?void 0:r.parameterLimit,s=i.split(r.delimiter,a),o=-1,c,u=r.charset;if(r.charsetSentinel)for(c=0;c<s.length;++c)s[c].indexOf("utf8=")===0&&(s[c]===kd?u="utf-8":s[c]===Qd&&(u="iso-8859-1"),o=c,c=s.length);for(c=0;c<s.length;++c)if(c!==o){var l=s[c],f=l.indexOf("]="),d=f===-1?l.indexOf("="):f+1,m,p;d===-1?(m=r.decoder(l,ne.decoder,u,"key"),p=r.strictNullHandling?null:""):(m=r.decoder(l.slice(0,d),ne.decoder,u,"key"),p=rt.maybeMap(Ss(l.slice(d+1),r),function(h){return r.decoder(h,ne.decoder,u,"value")})),p&&r.interpretNumericEntities&&u==="iso-8859-1"&&(p=Md(p)),l.indexOf("[]=")>
15-1&&(p=Ud(p)?[p]:p),nn.call(n,m)?n[m]=rt.combine(n[m],p):n[m]=p}return n},Bd=function(e,t,r,n){for(var i=n?t:Ss(t,r),a=e.length-1;a>=0;--a){var s,o=e[a];if(o==="[]"&&r.parseArrays)s=[].concat(i);else{s=r.plainObjects?Object.create(null):{};var c=o.charAt(0)==="["&&o.charAt(o.length-1)==="]"?o.slice(1,-1):o,u=parseInt(c,10);!r.parseArrays&&c===""?s={0:i}:!isNaN(u)&&o!==c&&String(u)===c&&u>=0&&r.parseArrays&&u<=r.arrayLimit?(s=[],s[u]=i):c!=="__proto__"&&(s[c]=i)}i=s}return i},qd=function(t,r,n,i){if(t){var a=n.allowDots?t.replace(/\.([^.[]+)/g,"[$1]"):t,s=/(\[[^[\]]*])/,o=/(\[[^[\]]*])/g,c=n.depth>0&&s.exec(a),u=c?a.slice(0,c.index):a,l=[];if(u){if(!n.plainObjects&&nn.call(Object.prototype,u)&&!n.allowPrototypes)return;l.push(u)}for(var f=0;n.depth>0&&(c=o.exec(a))!==null&&f<n.depth;){if(f+=1,!n.plainObjects&&nn.call(Object.prototype,c[1].slice(1,-1))&&!n.allowPrototypes)return;l.push(c[1])}return c&&l.push("["+a.slice(c.index)+"]"),Bd(l,r,n,i)}},Kd=function(t){if(!t)return ne;if(t.decoder!==null&&t.decoder!==void 0&&typeof t.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof t.charset<"u"&&t.charset!=="utf-8"&&t.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var r=typeof t.charset>"u"?ne.charset:t.charset;return{allowDots:typeof t.allowDots>"u"?ne.allowDots:!!t.allowDots,allowPrototypes:typeof t.allowPrototypes=="boolean"?t.allowPrototypes:ne.allowPrototypes,arrayLimit:typeof t.arrayLimit=="number"?t.arrayLimit:ne.arrayLimit,charset:r,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:ne.charsetSentinel,comma:typeof t.comma=="boolean"?t.comma:ne.comma,decoder:typeof t.decoder=="function"?t.decoder:ne.decoder,delimiter:typeof t.delimiter=="string"||rt.isRegExp(t.delimiter)?t.delimiter:ne.delimiter,depth:typeof t.depth=="number"||t.depth===!1?+t.depth:ne.depth,ignoreQueryPrefix:t.ignoreQueryPrefix===!0,interpretNumericEntities:typeof t.interpretNumericEntities=="boolean"?t.interpretNumericEntities:ne.interpretNumericEntities,parameterLimit:typeof t.parameterLimit=="number"?t.parameterLimit:ne.parameterLimit,parseArrays:t.parseArrays!==!1,plainObjects:typeof t.plainObjects=="boolean"?t.plainObjects:ne.plainObjects,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:ne.strictNullHandling}},Gd=function(e,t){var r=Kd(t);if(e===""||e===null||typeof e>"u")return r.plainObjects?Object.create(null):{};for(var n=typeof e=="string"?Vd(e,r):e,i=r.plainObjects?Object.create(null):{},a=Object.keys(n),s=0;s<a.length;++s){var o=a[s],c=qd(o,n[o],r,typeof e=="string");i=rt.merge(i,c,r)}return rt.compact(i)},zd=Ld,Jd=Gd,Xd=jn,Yd={formats:Xd,parse:Jd,stringify:zd};const Ri=cn(Yd);function Dt(e){"@babel/helpers - typeof";return Dt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Dt(e)}function Zd(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function eh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Rs(n.key),n)}}function th(e,t,r){return t&&eh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function ce(e,t,r){return t=Rs(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rs(e){var t=rh(e,"string");return Dt(t)=="symbol"?t:String(t)}function rh(e,t){if(Dt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Dt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Pi=function(t){t&&(window.document.title=t)},nh=function(){function e(t){var r=this,n=t.windowTitle,i=t.writeDelay,a=i===void 0?400:i,s=t.createURL,o=t.parseURL,c=t.getLocation,u=t.start,l=t.dispose,f=t.push,d=t.cleanUrlOnDispose;Zd(this,e),ce(this,"$$type","ais.browser"),ce(this,"windowTitle",void 0),ce(this,"writeDelay",void 0),ce(this,"_createURL",void 0),ce(this,"parseURL",void 0),ce(this,"getLocation",void 0),ce(this,"writeTimer",void 0),ce(this,"_onPopState",void 0),ce(this,"inPopState",!1),ce(this,"isDisposed",!1),ce(this,"latestAcknowledgedHistory",0),ce(this,"_start",void 0),ce(this,"_dispose",void 0),ce(this,"_push",void 0),ce(this,"_cleanUrlOnDispose",void 0),this.windowTitle=n,this.writeTimer=void 0,this.writeDelay=a,this._createURL=s,this.parseURL=o,this.getLocation=c,this._start=u,this._dispose=l,this._push=f,this._cleanUrlOnDispose=typeof d>"u"?!0:d,De(function(m){var p=m.window,h=r.windowTitle&&r.windowTitle(r.read());Pi(h),r.latestAcknowledgedHistory=p.history.length})}return th(e,[{key:"read",value:function(){return this.parseURL({qsModule:Ri,location:this.getLocation()})}},{key:"write",value:function(r){var n=this;De(function(i){var a=i.window,s=n.createURL(r),o=n.windowTitle&&n.windowTitle(r);n.writeTimer&&clearTimeout(n.writeTimer),n.writeTimer=setTimeout(function(){Pi(o),n.shouldWrite(s)&&(n._push?n._push(s):a.history.pushState(r,o||"",s),n.latestAcknowledgedHistory=a.history.length),n.inPopState=!1,n.writeTimer=void 0},n.writeDelay)})}}
15,{key:"onUpdate",value:function(r){var n=this;this._start&&this._start(function(){r(n.read())}),this._onPopState=function(){n.writeTimer&&(clearTimeout(n.writeTimer),n.writeTimer=void 0),n.inPopState=!0,r(n.read())},De(function(i){var a=i.window;a.addEventListener("popstate",n._onPopState)})}},{key:"createURL",value:function(r){var n=this._createURL({qsModule:Ri,routeState:r,location:this.getLocation()});return n}},{key:"dispose",value:function(){var r=this;this._dispose&&this._dispose(),this.isDisposed=!0,De(function(n){var i=n.window;r._onPopState&&i.removeEventListener("popstate",r._onPopState)}),this.writeTimer&&clearTimeout(this.writeTimer),this._cleanUrlOnDispose&&this.write({})}},{key:"start",value:function(){this.isDisposed=!1}},{key:"shouldWrite",value:function(r){var n=this;return De(function(i){var a=i.window;if(n.isDisposed&&!n._cleanUrlOnDispose)return!1;var s=!(n.isDisposed&&n.latestAcknowledgedHistory!==a.history.length);return!n.inPopState&&s&&r!==a.location.href})}}]),e}();function ih(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.createURL,r=t===void 0?function(p){var h=p.qsModule,y=p.routeState,v=p.location,g=v.protocol,b=v.hostname,R=v.port,P=R===void 0?"":R,w=v.pathname,j=v.hash,O=h.stringify(y),T=P===""?"":":".concat(P);return O?"".concat(g,"//").concat(b).concat(T).concat(w,"?").concat(O).concat(j):"".concat(g,"//").concat(b).concat(T).concat(w).c
15oncat(j)}:t,n=e.parseURL,i=n===void 0?function(p){var h=p.qsModule,y=p.location;return h.parse(y.search.slice(1),{arrayLimit:99})}:n,a=e.writeDelay,s=a===void 0?400:a,o=e.windowTitle,c=e.getLocation,u=c===void 0?function(){return De(function(p){var h=p.window;return h.location},{fallback:function(){throw new Error("You need to provide `getLocation` to the `history` router in environments where `window` does not exist.")}})}:c,l=e.start,f=e.dispose,d=e.push,m=e.cleanUrlOnDispose;return new nh({createURL:r,parseURL:i,writeDelay:s,windowTitle:o,getLocation:u,start:l,dispose:f,push:d,cleanUrlOnDispose:m})}function Ct(e){"@babel/helpers - typeof";return Ct=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ct(e)}var ah=["configure"];function ji(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function lr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ji(Object(r),!0).forEach(function(n){an(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ji(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function an(e,t,r){return t=sh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sh(e){var t=oh(e,"string");return Ct(t)=="symbol"?t:String(t)}function oh(e,t){if(Ct(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ct(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function uh(e,t){if(e==null)return{};var r=ch(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ch(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function wi(e){e.configure;var t=uh(e,ah);return t}function lh(){return{$$type:"ais.simple",stateToRoute:function(t){return Object.keys(t).reduce(function(r,n){return lr(lr({},r),{},an({},n,wi(t[n])))},{})},routeToState:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return Object.keys(t).reduce(function(r,n){return lr(lr({},r),{},an({},n,wi(t[n])))},{})}}}function Nt(e){"@babel/helpers - typeof";return Nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Nt(e)}function Oi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Oi(Object(r),!0).forEach(function(n){Ps(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Oi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Ps(e,t,r){return t=fh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fh(e){var t=dh(e,"string");return Nt(t)=="symbol"?t:String(t)}function dh(e,t){if(Nt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Nt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var hh=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.router,n=r===void 0?ih():r,i=t.stateMapping,a=i===void 0?lh():i,s=t.$$internal,o=s===void 0?!1:s;return function(c){var u=c.instantSearchInstance;function l(m){var p=u.mainIndex.getWidgets().length===0?u._initialUiState:u.mainIndex.getWidgetUiState({}),h=Object.keys(m).reduce(function(v,g){return fr(fr({},v),{},Ps({},g,m[g]))},p),y=a.stateToRoute(h);return n.createURL(y)}u._createURL=l;var f=void 0,d=u._initialUiState;return{$$type:"ais.router({router:".concat(n.$$type||"__unknown__",", stateMapping:").concat(a.$$type||"__unknown__","})"),$$internal:o,onStateChange:function(p){var h=p.uiState,y=a.stateToRoute(h);
15(f===void 0||!Ya(f,y))&&(n.write(y),f=y)},subscribe:function(){u._initialUiState=fr(fr({},d),a.routeToState(n.read())),n.onUpdate(function(p){u.mainIndex.getWidgets().length>0&&u.setUiState(a.routeToState(p))})},started:function(){var p;(p=n.start)===null||p===void 0||p.call(n)},unsubscribe:function(){n.dispose()}}}};function mh(e,t){return e.toLocaleString(t)}function Ht(e){"@babel/helpers - typeof";return Ht=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ht(e)}function xi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function _e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?xi(Object(r),!0).forEach(function(n){ph(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function ph(e,t,r){return t=gh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gh(e){var t=vh(e,"string");return Ht(t)=="symbol"?t:String(t)}function vh(e,t){if(Ht(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ht(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function yh(e){var t=e.numberLocale;return{formatNumber:function(n,i){return mh(Number(i(n)),t)},highlight:function(n,i){try{var a=JSON.parse(n);return i(Bf(_e(_e({},a),{},{hit:this})))}catch{throw new Error(` 16The highlight helper expects a JSON object of the format: 17{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseHighlight:function(n,i){try{var a=JSON.parse(n);return i(Kf(_e(_e({},a),{},{hit:this})))}catch{throw new Error(` 18 The reverseHighlight helper expects a JSON object of the format: 19 { "attribute": "name", "highlightedTagName": "mark" }`)}},snippet:function(n,i){try{var a=JSON.parse(n);return i(zf(_e(_e({},a),{},{hit:this})))}catch{throw new Error(` 20The snippet helper expects a JSON object of the format: 21{ "attribute": "name", "highlightedTagName": "mark" }`)}},reverseSnippet:function(n,i){try{var a=JSON.parse(n);return i(Xf(_e(_e({},a),{},{hit:this})))}catch{throw new Error(` 22 The reverseSnippet helper expects a JSON object of the format: 23 { "attribute": "name", "highlightedTagName": "mark" }`)}},insights:function(n,i){try{var a=JSON.parse(n),s=a.method,o=a.payload;return i(Zf(s,_e({objectIDs:[this.objectID]},o)))}catch{throw new Error(` 24The insights helper expects a JSON object of the format: 25{ "method": "method-name", "payload": { "eventName": "name of the event" } }`)}}}}const bh="4.78.1";function nt(e){"@babel/helpers - typeof";return nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nt(e)}function _i(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Hr(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?_i(Object(r),!0).forEach(function(n){Q(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):_i(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Rh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,js(n.key),n)}}function Ph(e,t,r){return t&&Rh(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function jh(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&sn(e,t)}
25function sn(e,t){return sn=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,i){return n.__proto__=i,n},sn(e,t)}function wh(e){var t=xh();return function(){var n=Rr(e),i;if(t){var a=Rr(this).constructor;i=Reflect.construct(n,arguments,a)}else i=n.apply(this,arguments);return Oh(this,i)}}function Oh(e,t){if(t&&(nt(t)==="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return M(e)}function M(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function xh(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Rr(e){return Rr=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Rr(e)}function Q(e,t,r){return t=js(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function js(e){var t=_h(e,"string");return nt(t)=="symbol"?t:String(t)}function _h(e,t){if(nt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(nt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ye=de({name:"instantsearch"});function Fh(){return"#"}var ws={preserveSharedStateOnUnmount:!1,persistHierarchicalRootCount:!1},$h=function(e){jh(r,e);var t=wh(r);function r(n){var i;Sh(this,r),i=t.call(this),Q(M(i),"client",void 0),Q(M(i),"indexName",void 0),Q(M(i),"compositionID",void 0),Q(M(i),"insightsClient",void 0),Q(M(i),"onStateChange",null),Q(M(i),"future",void 0),Q(M(i),"helper",void 0),Q(M(i),"mainHelper",void 0),Q(M(i),"mainIndex",void 0),Q(M(i),"started",void 0),Q(M(i),"templatesConfig",void 0),Q(M(i),"renderState",{}),Q(M(i),"_stalledSearchDelay",void 0),Q(M(i),"_searchStalledTimer",void 0),Q(M(i),"_initialUiState",void 0),Q(M(i),"_initialResults",void 0),Q(M(i),"_createURL",void 0),Q(M(i),"_searchFunction",void 0),Q(M(i),"_mainHelperSearch",void 0),Q(M(i),"_hasSearchWidget",!1),Q(M(i),"_hasRecommendWidget",!1),Q(M(i),"_insights",void 0),Q(M(i),"middleware",[]),Q(M(i),"sendEventToInsights",void 0),Q(M(i),"status","idle"),Q(M(i),"error",void 0),Q(M(i),"scheduleSearch",ot(function(){i.started&&i.mainHelper.search()})),Q(M(i),"scheduleRender",ot(function(){var A,B=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;(A=i.mainHelper)!==null&&A!==void 0&&A.hasPendingRequests()||(clearTimeout(i._searchStalledTimer),i._searchStalledTimer=null,B&&(i.status="idle",i.error=void 0)),i.mainIndex.render({instantSearchInstance:M(i)}),i.emit("render")})),Q(M(i),"onInternalStateChange",ot(function(){var A=i.mainIndex.getWidgetUiState({});i.middleware.forEach(function(B){var C=B.instance;C.onStateChange({uiState:A})})})),i.setMaxListeners(100);var a=n.indexName,s=a===void 0?"":a,o=n.compositionID,c=n.numberLocale,u=n.initialUiState,l=u===void 0?{}:u,f=n.routing,d=f===void 0?null:f,m=n.insights,p=m===void 0?void 0:m,h=n.searchFunction,y=n.stalledSearchDelay,v=y===void 0?200:y,g=n.searchClient,b=g===void 0?null:g,R=n.insightsClient,P=R===void 0?null:R,w=n.onStateChange,j=w===void 0?null:w,O=n.future,T=O===void 0?Hr(Hr({},ws),n.future||{}):O;if(b===null)throw new Error(ye("The `searchClient` option is required."));if(typeof b.search!="function")throw new Error("The `searchClient` must implement a `search` method.\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/going-further/backend-search/in-depth/backend-instantsearch/js/");if(typeof b.addAlgoliaAgent=="function"&&b.addAlgoliaAgent("instantsearch.js (".concat(bh,")")),P&&typeof P!="function")throw new Error(ye("The `insightsClient` option should be a function."));if(i.client=b,i.future=T,i.insightsClient=P,i.indexName=s,i.compositionID=o,i.helper=null,i.mainHelper=null,i.mainIndex=Nf({indexName:i.compositionID||i.indexName}),i.onStateChange=j,i.started=!1,i.templatesConfig={helpers:yh({numberLocale:c}
25),compileOptions:{}},i._stalledSearchDelay=v,i._searchStalledTimer=null,i._createURL=Fh,i._initialUiState=l,i._initialResults=null,i._insights=p,h&&(i._searchFunction=h),i.sendEventToInsights=X,d){var _=typeof d=="boolean"?{}:d;_.$$internal=!0,i.use(hh(_))}if(p){var $=typeof p=="boolean"?{}:p;$.$$internal=!0,i.use(gi($))}return vd()&&i.use(yd({$$internal:!0})),i}return Ph(r,[{key:"_isSearchStalled",get:function(){return this.status==="stalled"}},{key:"use",value:function(){for(var i=this,a=arguments.length,s=new Array(a),o=0;o<a;o++)s[o]=arguments[o];var c=s.map(function(u){var l=Hr({$$type:"__unknown__",$$internal:!1,subscribe:X,started:X,unsubscribe:X,onStateChange:X},u({instantSearchInstance:i}));return i.middleware.push({creator:u,instance:l}),l});return this.started&&c.forEach(function(u){u.subscribe(),u.started()}),this}},{key:"unuse",value:function(){for(var i=arguments.length,a=new Array(i),s=0;s<i;s++)a[s]=arguments[s];return this.middleware.filter(function(o){return a.includes(o.creator)}).forEach(function(o){return o.instance.unsubscribe()}),this.middleware=this.middleware.filter(function(o){return!a.includes(o.creator)}),this}},{key:"EXPERIMENTAL_use",value:function(){return this.use.apply(this,arguments)}},{key:"addWidget",value:function(i){return this.addWidgets([i])}},{key:"addWidgets",value:function(i){if(!Array.isArray(i))throw new Error(ye("The `addWidgets` method expects an array of widgets. Please use `addWidget`."));if(i.some(function(a){return typeof a.init!="function"&&typeof a.render!="function"}))throw new Error(ye("The widget definition expects a `render` and/or an `init` method."));if(this.compositionID&&i.some(me))throw new Error(ye("The `index` widget cannot be used with a composition-based InstantSearch implementation."));return this.mainIndex.addWidgets(i),this}},{key:"removeWidget",value:function(i){return this.removeWidgets([i])}},{key:"removeWidgets",value:function(i){if(!Array.isArray(i))throw new Error(ye("The `removeWidgets` method expects an array of widgets. Please use `removeWidget`."));if(i.some(function(a){return typeof a.dispose!="function"}))throw new Error(ye("The widget definition expects a `dispose` method."));return this.mainIndex.removeWidgets(i),this}},{key:"start",value:function(){var i=this;if(this.started)throw new Error(ye("The `start` method has already been called once."));var a=this.mainHelper||oe(this.client,this.indexName,void 0,{persistHierarchicalRootCount:this.future.persistHierarchicalRootCount});if(this.compositionID&&(a.searchForFacetValues=a.searchForCompositionFacetValues.bind(a)),a.search=function(){return i.status="loading",i.scheduleRender(!1),i._hasSearchWidget&&(i.compositionID?a.searchWithComposition():a.searchOnlyWithDerivedHelpers()),i._hasRecommendWidget&&a.recommend(),a},this._searchFunction){var s={search:function(){return new Promise(X)}};this._mainHelperSearch=a.search.bind(a),a.search=function(){var c=i.mainIndex.getHelper(),u=oe(s,c.state.index,c.state);return u.once("search",function(l){var f=l.state;c.overrideStateWithoutTriggeringChangeEvent(f),i._mainHelperSearch()}),u.on("change",function(l){var f=l.state;c.setState(f)}),i._searchFunction(u),a}}if(a.on("error",function(c){var u=c.error;if(!(u instanceof Error)){var l=u;u=Object.keys(l).reduce(function(f,d){return f[d]=l[d],f},new Error(l.message))}u.error=u,i.error=u,i.status="error",i.scheduleRender(!1),i.emit("error",u)}),this.mainHelper=a,this.middleware.forEach(function(c){var u=c.instance;u.subscribe()}),this.mainIndex.init({instantSearchInstance:this,parent:null,uiState:this._initialUiState}),this._initialResults){yl(this.client,this._initialResults),ll(this.mainHelper,this._initialResults);var o=this.scheduleSearch;this.scheduleSearch=ot(X),ot(function(){i.scheduleSearch=o})()}else this.mainIndex.getWidgets().length>0&&this.scheduleSearch();this.helper=this.mainIndex.getHelper(),this.started=!0,this.middleware.forEach(function(c){var u=c.instance;u.started()}),typeof this._insights>"u"&&a.derivedHelpers[0].once("result",function(){var c=i.mainIndex.getScopedResults().some(function(u){var l=u.results;return l==null?void 0:l._automaticInsights});c&&i.use(gi({$$internal:!0,$$automatic:!0}))})}},{key:"dispose",value:function(){var i;this.scheduleSearch.cancel(),this.scheduleRender.cancel(),clearTimeout(this._searchStalledTimer),this.removeWidgets(this.mainIndex.getWidgets()),this.mainIndex.dispose(),this.started=!1,this.removeAllListeners(),(i=this.mainHelper)===null||i===void 0||i.removeAllListeners(),this.mainHelper=null,this.helper=null,this.middleware.forEach(function(a){var s=a.instance;s.unsubscribe()})}},{key:"scheduleStalledRender",value:function(){var i=this;this._searchStalledTimer||(this._searchStalledTimer=setTimeout(function(){i.status="stalled",i.scheduleRender()},this._stalledSearchDelay))}},{key:"setUiState",value:function(i){var a=this,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;if(!this.mainHelper)throw new Error(ye("The `start` method needs to be called before `setUiState`."));this.mainIndex.refreshUiState();var o=typeof i=="function"?i(this.mainIndex.getWidgetUiState({})):i;this.onStateChange&&s?this.onStateChange({uiState:o,setUiState:function(u){Gr(typeof u=="function"?u(o):u,a.mainIndex),a.scheduleSearch(),a.onInternalStateChange()}}):(Gr(o,this.mainIndex),this.scheduleSearch(),this.onInternalStateChange())}},{key:"getUiState",value:function(){return this.started&&this.mainIndex.refreshUiState(),this.mainIndex.getWidgetUiState({})}},{key:"createURL",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.started)throw new Error(ye("The `start` method needs to be called before `createURL`."));return this._createURL(i)}},{key:"refresh",value:function(){if(!this.mainHelper)throw new Error(ye("The `start` method needs to be called before `refresh`."));this.mainHelper.clearCache().search()}}]),r}(cu),Os={exports:{}},xs={};/** 26 * @license React 27 * use-sync-external-store-shim.production.js 28 * 29 * Copyright (c) Meta Platforms, Inc. and affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var it=F;function Eh(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Ih=typeof Object.is=="function"?Object.is:Eh,Th=it.useState,Ah=it.useEffect,Dh=it.useLayoutEffect,Ch=it.useDebugValue;function Nh(e,t){var r=t(),n=Th({inst:{value:r,getSnapshot:t}}),i=n[0].inst,a=n[1];return Dh(function(){i.value=r,i.getSnapshot=t,Wr(i)&&a({inst:i})},[e,r,t]),Ah(function(){return Wr(i)&&a({inst:i}),e(function(){Wr(i)&&a({inst:i})})},[e]),Ch(r),r}function Wr(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!Ih(e,r)}catch{return!0}}function Hh(e,t){return t()}var Wh=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Hh:Nh;xs.useSyncExternalStore=it.useSyncExternalStore!==void 0?it.useSyncExternalStore:Wh;Os.exports=xs;var Lh=Os.exports,Uh={};function Wt(e){"@babel/helpers - typeof";return Wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wt(e)}function Fi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $i(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
33t%2?Fi(Object(r),!0).forEach(function(n){Mh(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Fi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Mh(e,t,r){return t=Qh(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qh(e){var t=kh(e,"string");return Wt(t)=="symbol"?t:String(t)}function kh(e,t){if(Wt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Wt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ei=["react (".concat(F.version,")"),"react-instantsearch (".concat(kr,")"),"react-instantsearch-core (".concat(kr,")")],Ii="react-instantsearch-server (".concat(kr,")"),Vh=function(t){return t?"next.js (".concat(t,")"):null};function Bh(e){var t=Qf(),r=as(),n=ss(),i=us(),a=n==null?void 0:n.initialResults,s=F.useRef(e),o=r||a||i,c=F.useRef(null);if(n&&(c=n.ssrSearchRef),c.current===null){var u=new $h(e);u._schedule=function(y){u._schedule.queue.push(y),clearTimeout(u._schedule.timer),u._schedule.timer=setTimeout(function(){u._schedule.queue.forEach(function(v){v()}),u._schedule.queue=[]},0)},u._schedule.queue=[],o&&(u._initialResults=a||{}),Ti(e.searchClient,[].concat(Ei,[r&&Ii,Vh(qh())])),o&&u.start(),r&&r.notifyServer({search:u}),e.routing,c.current=u}{var l=c.current,f=s.current;if(f.indexName!==e.indexName&&(l.helper.setIndex(e.indexName||"").search(),s.current=e),f.searchClient!==e.searchClient&&(Ti(e.searchClient,[].concat(Ei,[r&&Ii])),l.mainHelper.setClient(e.searchClient).search(),s.current=e),f.onStateChange!==e.onStateChange&&(l.onStateChange=e.onStateChange,s.current=e),f.searchFunction!==e.searchFunction&&(l._searchFunction=e.searchFunction,s.current=e),f.stalledSearchDelay!==e.stalledSearchDelay){var d;l._stalledSearchDelay=(d=e.stalledSearchDelay)!==null&&d!==void 0?d:200,s.current=e}tt(f.future,e.future)||(l.future=$i($i({},ws),e.future),s.current=e)}var m=F.useRef(null),p=Lh.useSyncExternalStore(F.useCallback(function(){var h=c.current;return m.current===null?h.started||(h.start(),t()):(clearTimeout(m.current),h._preventWidgetCleanup=!1),function(){function y(){h.dispose()}clearTimeout(h._schedule.timer),m.current=setTimeout(y),h._preventWidgetCleanup=!0}},[t]),function(){return c.current},function(){return c.current});return p}function Ti(e,t){typeof e.addAlgoliaAgent=="function"&&t.filter(Boolean).forEach(function(r){e.addAlgoliaAgent(r)})}function qh(){var e,t;return typeof window<"u"&&((e=window.next)===null||e===void 0?void 0:e.version)||(typeof process<"u"?(t=Uh)===null||t===void 0?void 0:t.NEXT_RUNTIME:void 0)}var Kh=["children"];function Gh(e,t){if(e==null)return{};var r=zh(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function zh(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function Cg(e){var t=e.children,r=Gh(e,Kh),n=Bh(r);return n.started?Ce.createElement(is.Provider,{value:n},Ce.createElement(rs.Provider,{value:n.mainIndex},t)):null}function Lt(e){"@babel/helpers - typeof";return Lt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Lt(e)}function Jh(e){return em(e)||Zh(e)||Yh(e)||Xh()}function Xh(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 34In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Yh(e,t){if(e){if(typeof e=="string")return on(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return on(e,t)}}function Zh(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function em(e){if(Array.isArray(e))return on(e)}function on(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ai(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ke(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
34t%2?Ai(Object(r),!0).forEach(function(n){tm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ai(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function tm(e,t,r){return t=rm(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rm(e){var t=nm(e,"string");return Lt(t)=="symbol"?t:String(t)}function nm(e,t){if(Lt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Lt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Di=de({name:"clear-refinements",connector:!0}),im=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,Di()),function(n){var i=n||{},a=i.includedAttributes,s=a===void 0?[]:a,o=i.excludedAttributes,c=o===void 0?["query"]:o,u=i.transformItems,l=u===void 0?function(p){return p}:u;if(n&&n.includedAttributes&&n.excludedAttributes)throw new Error(Di("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var f={refine:X,createURL:function(){return""},attributesToClear:[]},d=function(){return f.refine()},m=function(){return f.createURL()};return{$$type:"ais.clearRefinements",init:function(h){var y=h.instantSearchInstance;t(Ke(Ke({},this.getWidgetRenderState(h)),{},{instantSearchInstance:y}),!0)},render:function(h){var y=h.instantSearchInstance;t(Ke(Ke({},this.getWidgetRenderState(h)),{},{instantSearchInstance:y}),!1)},dispose:function(){r()},getRenderState:function(h,y){return Ke(Ke({},h),{},{clearRefinements:this.getWidgetRenderState(y)})},getWidgetRenderState:function(h){var y=h.createURL,v=h.scopedResults,g=h.results;f.attributesToClear=v.reduce(function(R,P){return R.concat(am({scopedResult:P,includedAttributes:s,excludedAttributes:c,transformItems:l,results:g}))},[]),f.refine=function(){f.attributesToClear.forEach(function(R){var P=R.helper,w=R.items;P.setState(Dn({helper:P,attributesToClear:w})).search()})},f.createURL=function(){return y(bt.apply(void 0,Jh(f.attributesToClear.map(function(R){var P=R.helper,w=R.items;return Dn({helper:P,attributesToClear:w})}))))};var b=f.attributesToClear.some(function(R){return R.items.length>0});return{canRefine:b,hasRefinements:b,refine:d,createURL:m,widgetParams:n}}}}};function am(e){var t=e.scopedResult,r=e.includedAttributes,n=e.excludedAttributes,i=e.transformItems,a=e.results,s=r.indexOf("query")!==-1||n.indexOf("query")===-1;return{helper:t.helper,items:i(Za(Ja(t.results,t.helper.state,s).map(function(o){return o.attribute}).filter(function(o){return r.length===0||r.indexOf(o)!==-1}).filter(function(o){return o==="query"&&s||n.indexOf(o)===-1})),{results:a})}}function sm(e,t){return ve(im,e,t)}function Ut(e){"@babel/helpers - typeof";return Ut=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Ut(e)}function om(e){return fm(e)||lm(e)||cm(e)||um()}function um(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 35In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function cm(e,t){if(e){if(typeof e=="string")return un(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return un(e,t)}}function lm(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function fm(e){if(Array.isArray(e))return un(e)}function un(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ge(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
35t%2?Ci(Object(r),!0).forEach(function(n){dm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function dm(e,t,r){return t=hm(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hm(e){var t=mm(e,"string");return Ut(t)=="symbol"?t:String(t)}function mm(e,t){if(Ut(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Ut(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ni=de({name:"current-refinements",connector:!0}),pm=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,Ni()),function(n){if((n||{}).includedAttributes&&(n||{}).excludedAttributes)throw new Error(Ni("The options `includedAttributes` and `excludedAttributes` cannot be used together."));var i=n||{},a=i.includedAttributes,s=i.excludedAttributes,o=s===void 0?["query"]:s,c=i.transformItems,u=c===void 0?function(l){return l}:c;return{$$type:"ais.currentRefinements",init:function(f){var d=f.instantSearchInstance;t(Ge(Ge({},this.getWidgetRenderState(f)),{},{instantSearchInstance:d}),!0)},render:function(f){var d=f.instantSearchInstance;t(Ge(Ge({},this.getWidgetRenderState(f)),{},{instantSearchInstance:d}),!1)},dispose:function(){r()},getRenderState:function(f,d){return Ge(Ge({},f),{},{currentRefinements:this.getWidgetRenderState(d)})},getWidgetRenderState:function(f){var d=f.results,m=f.scopedResults,p=f.createURL,h=f.helper;function y(){return d?m.reduce(function(g,b){return g.concat(u(Hi({results:b.results,helper:b.helper,indexId:b.indexId,includedAttributes:a,excludedAttributes:o}),{results:d}))},[]):u(Hi({results:null,helper:h,indexId:h.state.index,includedAttributes:a,excludedAttributes:o}),{results:d})}var v=y();return{items:v,canRefine:v.length>0,refine:function(b){return Fs(h,b)},createURL:function(b){return p(_s(h.state,b))},widgetParams:n}}}}};function Hi(e){var t=e.results,r=e.helper,n=e.indexId,i=e.includedAttributes,a=e.excludedAttributes,s=(i||[]).indexOf("query")!==-1||(a||[]).indexOf("query")===-1,o=i?function(u){return i.indexOf(u.attribute)!==-1}:function(u){return a.indexOf(u.attribute)===-1},c=Ja(t,r.state,s).map(vm).filter(o);return c.reduce(function(u,l){return[].concat(om(u.filter(function(f){return f.attribute!==l.attribute})),[{indexName:r.state.index,indexId:n,attribute:l.attribute,label:l.attribute,refinements:c.filter(function(f){return f.attribute===l.attribute}).sort(function(f,d){return f.type==="numeric"?f.value-d.value:0}),refine:function(d){return Fs(r,d)}}])},[])}function _s(e,t){switch(e=e.resetPage(),t.type){case"facet":return e.removeFacetRefinement(t.attribute,String(t.value));case"disjunctive":return e.removeDisjunctiveFacetRefinement(t.attribute,String(t.value));case"hierarchical":return e.removeHierarchicalFacetRefinement(t.attribute);case"exclude":return e.removeExcludeRefinement(t.attribute,String(t.value));case"numeric":return e.removeNumericRefinement(t.attribute,t.operator,String(t.value));case"tag":return e.removeTagRefinement(String(t.value));case"query":return e.setQueryParameter("query","");default:return e}}function Fs(e,t){e.setState(_s(e.state,t)).search()}function gm(e){switch(e){case">=":return"≥";case"<=":return"≤";default:return e}}function vm(e){var t=ym(e),r=e.operator?"".concat(gm(e.operator)," ").concat(e.name):e.name,n={attribute:e.attribute,type:e.type,value:t,label:r};return e.operator!==void 0&&(n.operator=e.operator),e.count!==void 0&&(n.count=e.count),e.exhaustive!==void 0&&(n.exhaustive=e.exhaustive),n}function ym(e){return e.type==="numeric"?Number(e.name):"escapedValue"in e?e.escapedValue:e.name}function $s(e,t){return ve(pm,e,t)}function Mt(e){"@babel/helpers - typeof";return Mt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mt(e)}var bm=["name","escapedValue","data","path"];function Wi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function ae(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
35t%2?Wi(Object(r),!0).forEach(function(n){pr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pr(e,t,r){return t=Sm(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sm(e){var t=Rm(e,"string");return Mt(t)=="symbol"?t:String(t)}function Rm(e,t){if(Mt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Mt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Pm(e,t){if(e==null)return{};var r=jm(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function jm(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}function wm(e,t){return Fm(e)||_m(e,t)||xm(e,t)||Om()}function Om(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 36In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xm(e,t){if(e){if(typeof e=="string")return Li(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Li(e,t)}}function Li(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _m(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Fm(e){if(Array.isArray(e))return e}var Lr=de({name:"hierarchical-menu",connector:!0}),Ui=["name:asc"],$m=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,Lr()),function(n){var i=n||{},a=i.attributes,s=i.separator,o=s===void 0?" > ":s,c=i.rootPath,u=c===void 0?null:c,l=i.showParentLevel,f=l===void 0?!0:l,d=i.limit,m=d===void 0?10:d,p=i.showMore,h=p===void 0?!1:p,y=i.showMoreLimit,v=y===void 0?20:y,g=i.sortBy,b=g===void 0?Ui:g,R=i.transformItems,P=R===void 0?function(k){return k}:R;if(!a||!Array.isArray(a)||a.length===0)throw new Error(Lr("The `attributes` option expects an array of strings."));if(h===!0&&v<=m)throw new Error(Lr("The `showMoreLimit` option must be greater than `limit`."));var w=wm(a,1),j=w[0],O,T=function(){};function _(){T()}var $,A=!1;function B(k,D){return function(){A=!A,D.render(k)}}function C(){return A?v:m}function L(k){return k.slice(0,C()).map(function(D){var E=D.name,W=D.escapedValue,I=D.data;D.path;var N=Pm(D,bm),U=ae(ae({},N),{},{value:W,label:E,data:null});return Array.isArray(I)&&(U.data=L(I)),U})}return{$$type:"ais.hierarchicalMenu",init:function(D){var E=D.instantSearchInstance;t(ae(ae({},this.getWidgetRenderState(D)),{},{instantSearchInstance:E}),!0)},render:function(D){var E=D.instantSearchInstance;T=B(D,this),t(ae(ae({},this.getWidgetRenderState(D)),{},{instantSearchInstance:E}),!1)},dispose:function(D){var E=D.state;return r(),E.removeHierarchicalFacet(j).setQueryParameter("maxValuesPerFacet",void 0)},getRenderState:function(D,E){return ae(ae({},D),{},{hierarchicalMenu:ae(ae({},D.hierarchicalMenu),{},pr({},j,this.getWidgetRenderState(E)))})},getWidgetRenderState:function(D){var E=this,W=D.results,I=D.state,N=D.createURL,U=D.instantSearchInstance,Z=D.helper,J=[],H=!1,V=function(pe){return N(function(at){return E.getWidgetUiState(at,{searchParameters:I.resetPage().toggleFacetRefinement(j,pe),helper:Z})})};if(O||(O=Ka({instantSearchInstance:U,helper:Z,attribute:function(pe){var at=pe.split(o).length-1;return a[at]},widgetType:this.$$type})),$||($=function(pe){O("click:internal",pe),Z.toggleFacetRefinement(j,pe).search()}),W){var G=W.getFacetValues(j,{sortBy:b,facetOrdering:b===Ui}),z=G&&!Array.isArray(G)&&G.data?G.data:[],re=(I.maxValuesPerFacet||0)>C()?z.length<=C():z.length<C();H=h&&(A||!re),J=P(L(z),{results:W})}return{items:J,refine:$,canRefine:J.length>0,createURL:V,sendEvent:O,widgetParams:n,isShowingMore:A,toggleShowMore:_,canToggleShowMore:H}},getWidgetUiState:function(D,E){var W=E.searchParameters,I=W.getHierarchicalFacetBreadcrumb(j);return Em(ae(ae({},D),{},{hierarchicalMenu:ae(ae({},D.hierarchicalMenu),{},pr({},j,I))}),j)},getWidgetSearchParameters:function(D,E){var W=E.uiState,I=W.hierarchicalMenu&&W.hierarchicalMenu[j];if(D.isConjunctiveFacet(j)||D.isDisjunctiveFacet(j))return D;D.isHierarchicalFacet(j)&&D.getHierarchicalFacetByName(j);var N=D.removeHierarchicalFacet(j).addHierarchicalFacet({name:j,attributes:a,separator:o,rootPath:u,showParentLevel:f}),U=N.maxValuesPerFacet||0,Z=Math.max(U,h?v:m),J=N.setQueryParameter("maxValuesPerFacet",Z);return I?J.addHierarchicalFacetRefinement(j,I.join(o)):J.setQueryParameters({hierarchicalFacetsRefinements:ae(ae({},J.hierarchicalFacetsRefinements),{},pr({},j,[]))})}}}};function Em(e,t){return e.hierarchicalMenu&&((!e.hierarchicalMenu[t]||e.hierarchicalMenu[t].length===0)&&delete e.hierarchicalMenu[t],Object.keys(e.hierarchicalMenu).length===0&&delete e.hierarchicalMenu),e}function Im(e,t){return ve($m,e,t)}function Qt(e){"@babel/helpers - typeof";return Qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Qt(e)}function Mi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function $e(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
36t%2?Mi(Object(r),!0).forEach(function(n){Es(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Mi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Es(e,t,r){return t=Tm(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Tm(e){var t=Am(e,"string");return Qt(t)=="symbol"?t:String(t)}function Am(e,t){if(Qt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Qt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Dm=de({name:"hits",connector:!0});const Cm=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,Dm()),function(n){var i=n||{},a=i.escapeHTML,s=a===void 0?!0:a,o=i.transformItems,c=o===void 0?function(f){return f}:o,u,l;return{$$type:"ais.hits",init:function(d){t($e($e({},this.getWidgetRenderState(d)),{},{instantSearchInstance:d.instantSearchInstance}),!0)},render:function(d){var m=this.getWidgetRenderState(d);t($e($e({},m),{},{instantSearchInstance:d.instantSearchInstance}),!1),m.sendEvent("view:internal",m.items)},getRenderState:function(d,m){return $e($e({},d),{},{hits:this.getWidgetRenderState(m)})},getWidgetRenderState:function(d){var m,p,h,y=d.results,v=d.helper,g=d.instantSearchInstance;if(u||(u=Vc({instantSearchInstance:g,helper:v,widgetType:this.$$type})),l||(l=Bc({helper:v,widgetType:this.$$type,instantSearchInstance:g})),!y)return{hits:[],items:[],results:void 0,banner:void 0,sendEvent:u,bindEvent:l,widgetParams:n};s&&y.hits.length>0&&(y.hits=uo(y.hits));var b=rl(y.hits,y.page,y.hitsPerPage),R=sl(b,y.queryID),P=c(R,{results:y}),w=(m=y.renderingContent)===null||m===void 0||(p=m.widgets)===null||p===void 0||(h=p.banners)===null||h===void 0?void 0:h[0];return{hits:P,items:P,results:y,banner:w,sendEvent:u,bindEvent:l,widgetParams:n}},dispose:function(d){var m=d.state;return r(),s?m.setQueryParameters(Object.keys(br).reduce(function(p,h){return $e($e({},p),{},Es({},h,void 0))},{})):m},getWidgetSearchParameters:function(d,m){return s?d.setQueryParameters(br):d}}}};function Nm(e,t){return ve(Cm,e,t)}function kt(e){"@babel/helpers - typeof";return kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kt(e)}function Hm(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wm(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,Is(n.key),n)}}function Lm(e,t,r){return t&&Wm(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ur(e,t,r){return t=Is(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Is(e){var t=Um(e,"string");return kt(t)=="symbol"?t:String(t)}function Um(e,t){if(kt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(kt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Mm=function(){function e(t){Hm(this,e),Ur(this,"currentPage",void 0),Ur(this,"total",void 0),Ur(this,"padding",void 0),this.currentPage=t.currentPage,this.total=t.total,this.padding=t.padding}return Lm(e,[{key:"pages",value:function(){var r=this.total,n=this.currentPage,i=this.padding;if(r===0)return[0];var a=this.nbPagesDisplayed(i,r);if(a===r)return zn({end:r});var s=this.calculatePaddingLeft(n,i,r,a),o=a-s,c=n-s,u=n+o;return zn({start:c,end:u})}},{key:"nbPagesDisplayed",value:function(r,n){return Math.min(2*r+1,n)}},{key:"calculatePaddingLeft",value:function(r,n,i,a){return r<=n?r:r>=i-n?a-(i-r):n}},{key:"isLastPage",value:function(){return this.currentPage>=this.total-1}},{key:"isFirstPage",value:function(){return this.currentPage<=0}}]),e}();function Vt(e){"@babel/helpers - typeof";return Vt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Vt(e)}function Qi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function we(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
36t%2?Qi(Object(r),!0).forEach(function(n){Qm(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Qi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Qm(e,t,r){return t=km(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function km(e){var t=Vm(e,"string");return Vt(t)=="symbol"?t:String(t)}function Vm(e,t){if(Vt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Vt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bm=de({name:"pagination",connector:!0}),qm=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,Bm()),function(n){var i=n||{},a=i.totalPages,s=i.padding,o=s===void 0?3:s,c=new Mm({currentPage:0,total:0,padding:o}),u={};function l(f){var d=f.nbPages;return a!==void 0?Math.min(a,d):d}return{$$type:"ais.pagination",init:function(d){var m=d.instantSearchInstance;t(we(we({},this.getWidgetRenderState(d)),{},{instantSearchInstance:m}),!0)},render:function(d){var m=d.instantSearchInstance;t(we(we({},this.getWidgetRenderState(d)),{},{instantSearchInstance:m}),!1)},dispose:function(d){var m=d.state;return r(),m.setQueryParameter("page",void 0)},getWidgetUiState:function(d,m){var p=m.searchParameters,h=p.page||0;return h?we(we({},d),{},{page:h+1}):d},getWidgetSearchParameters:function(d,m){var p=m.uiState,h=p.page?p.page-1:0;return d.setQueryParameter("page",h)},getWidgetRenderState:function(d){var m=d.results,p=d.helper,h=d.state,y=d.createURL;u.refine||(u.refine=function(b){p.setPage(b),p.search()}),u.createURL||(u.createURL=function(b){return y(function(R){return we(we({},R),{},{page:b+1})})});var v=h.page||0,g=l(m||{nbPages:0});return c.currentPage=v,c.total=g,{createURL:u.createURL,refine:u.refine,canRefine:g>1,currentRefinement:v,nbHits:(m==null?void 0:m.nbHits)||0,nbPages:g,pages:m?c.pages():[],isFirstPage:c.isFirstPage(),isLastPage:c.isLastPage(),widgetParams:n}},getRenderState:function(d,m){return we(we({},d),{},{pagination:this.getWidgetRenderState(m)})}}}};function Ts(e,t){return ve(qm,e,t)}function Bt(e){"@babel/helpers - typeof";return Bt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Bt(e)}function ki(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function se(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?ki(Object(r),!0).forEach(function(n){gr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ki(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gr(e,t,r){return t=Km(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Km(e){var t=Gm(e,"string");return Bt(t)=="symbol"?t:String(t)}function Gm(e,t){if(Bt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Bt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function ze(e,t){return Ym(e)||Xm(e,t)||Jm(e,t)||zm()}function zm(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 37In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jm(e,t){if(e){if(typeof e=="string")return Vi(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vi(e,t)}}function Vi(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Xm(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}
37finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Ym(e){if(Array.isArray(e))return e}var Mr=de({name:"range-input",connector:!0},{name:"range-slider",connector:!0}),Zm="ais.range";function Bi(e){var t=e.min,r=e.max,n=e.precision,i=Math.pow(10,n);return{min:t&&Math.floor(t*i)/i,max:r&&Math.ceil(r*i)/i}}var ep=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,Mr()),function(n){var i=n||{},a=i.attribute,s=a===void 0?"":a,o=i.min,c=i.max,u=i.precision,l=u===void 0?0:u;if(!s)throw new Error(Mr("The `attribute` option is required."));if(q(o)&&q(c)&&o>c)throw new Error(Mr("The `max` option can't be lower than `min`."));var f=function(b){return Number(Number(b).toFixed(l))},d={from:function(b){return b.toLocaleString()},to:function(b){return f(b).toLocaleString()}},m=function(b,R,P,w){var j=b.state,O=R.min,T=R.max,_=j.getNumericRefinement(s,">=")||[],$=ze(_,1),A=$[0],B=j.getNumericRefinement(s,"<=")||[],C=ze(B,1),L=C[0],k=P===void 0||P==="",D=w===void 0||w==="",E=Bi({min:k?void 0:parseFloat(P),max:D?void 0:parseFloat(w),precision:l}),W=E.min,I=E.max,N;!q(o)&&O===W?N=void 0:q(o)&&k?N=o:N=W;var U;!q(c)&&T===I?U=void 0:q(c)&&D?U=c:U=I;var Z=N===void 0,J=q(O)&&O<=N,H=Z||q(N)&&(!q(O)||J),V=U===void 0,G=q(U)&&T>=U,z=V||q(U)&&(!q(T)||G),re=A!==N,he=L!==U;return(re||he)&&H&&z?(j=j.removeNumericRefinement(s),q(N)&&(j=j.addNumericRefinement(s,">=",N)),q(U)&&(j=j.addNumericRefinement(s,"<=",U)),j.resetPage()):null},p=function(b){return function(){if(arguments.length===1){b.sendEventToInsights(arguments.length<=0?void 0:arguments[0]);return}}};function h(g){var b;q(o)?b=o:q(g.min)?b=g.min:b=0;var R;return q(c)?R=c:q(g.max)?R=g.max:R=0,Bi({min:b,max:R,precision:l})}function y(g){var b=g.getNumericRefinement(s,">=")||[],R=ze(b,1),P=R[0],w=g.getNumericRefinement(s,"<=")||[],j=ze(w,1),O=j[0],T=q(P)?P:-1/0,_=q(O)?O:1/0;return[T,_]}function v(g,b){return function(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[void 0,void 0],P=ze(R,2),w=P[0],j=P[1],O=m(g,b,w,j);O&&g.setState(O).search()}}return{$$type:Zm,init:function(b){t(se(se({},this.getWidgetRenderState(b)),{},{instantSearchInstance:b.instantSearchInstance}),!0)},render:function(b){t(se(se({},this.getWidgetRenderState(b)),{},{instantSearchInstance:b.instantSearchInstance}),!1)},getRenderState:function(b,R){return se(se({},b),{},{range:se(se({},b.range),{},gr({},s,this.getWidgetRenderState(R)))})},getWidgetRenderState:function(b){var R=b.results,P=b.helper,w=b.instantSearchInstance,j=R&&R.disjunctiveFacets||[],O=We(j,function(B){return B.name===s}),T=O&&O.stats||{min:void 0,max:void 0},_=h(T),$=y(P),A;return R?A=v(P,_):A=v(P,{min:void 0,max:void 0}),{refine:A,canRefine:_.min!==_.max,format:d,range:_,sendEvent:p(w),widgetParams:se(se({},n),{},{precision:l}),start:$}},dispose:function(b){var R=b.state;return r(),R.removeDisjunctiveFacet(s).removeNumericRefinement(s)},getWidgetUiState:function(b,R){var P=R.searchParameters,w=P.getNumericRefinements(s),j=w[">="],O=j===void 0?[]:j,T=w["<="],_=T===void 0?[]:T;return O.length===0&&_.length===0?b:se(se({},b),{},{range:se(se({},b.range),{},gr({},s,"".concat(O,":").concat(_)))})},getWidgetSearchParameters:function(b,R){var P=R.uiState,w=b.addDisjunctiveFacet(s).setQueryParameters({numericRefinements:se(se({},b.numericRefinements),{},gr({},s,{}))});q(o)&&(w=w.addNumericRefinement(s,">=",o)),q(c)&&(w=w.addNumericRefinement(s,"<=",c));var j=P.range&&P.range[s];if(!j||j.indexOf(":")===-1)return w;var O=j.split(":").map(parseFloat),T=ze(O,2),_=T[0],$=T[1];return q(_)&&(!q(o)||o<_)&&(w=w.removeNumericRefinement(s,">="),w=w.addNumericRefinement(s,">=",_)),q($)&&(!q(c)||$<c)&&(w=w.removeNumericRefinement(s,"<="),w=w.addNumericRefinement(s,"<=",$)),w}}}};function As(e,t){return ve(ep,e,t)}function qt(e){"@babel/helpers - typeof";return qt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},qt(e)}var tp=["name","escapedValue"],rp=["escapedValue","value"];function qi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function K(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
37t%2?qi(Object(r),!0).forEach(function(n){gt(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function gt(e,t,r){return t=np(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function np(e){var t=ip(e,"string");return qt(t)=="symbol"?t:String(t)}function ip(e,t){if(qt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(qt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Ki(e,t){if(e==null)return{};var r=ap(e,t),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(i=0;i<a.length;i++)n=a[i],!(t.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(e,n)&&(r[n]=e[n])}return r}function ap(e,t){if(e==null)return{};var r={},n=Object.keys(e),i,a;for(a=0;a<n.length;a++)i=n[a],!(t.indexOf(i)>=0)&&(r[i]=e[i]);return r}var dr=de({name:"refinement-list",connector:!0}),Gi=["isRefined","count:desc","name:asc"],sp=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,dr()),function(n){var i=n||{},a=i.attribute,s=i.operator,o=s===void 0?"or":s,c=i.limit,u=c===void 0?10:c,l=i.showMore,f=l===void 0?!1:l,d=i.showMoreLimit,m=d===void 0?20:d,p=i.sortBy,h=p===void 0?Gi:p,y=i.escapeFacetValues,v=y===void 0?!0:y,g=i.transformItems,b=g===void 0?function(D){return D}:g;if(!a)throw new Error(dr("The `attribute` option is required."));if(!/^(and|or)$/.test(o))throw new Error(dr('The `operator` must one of: `"and"`, `"or"` (got "'.concat(o,'").')));if(f===!0&&m<=u)throw new Error(dr("`showMoreLimit` should be greater than `limit`."));var R=function(E){var W=E.name,I=E.escapedValue,N=Ki(E,tp);return K(K({},N),{},{value:I,label:W,highlighted:W})},P,w=[],j=!0,O,T,_=!1,$=function(){};function A(){$()}function B(D,E){return function(){_=!_,E.render(D)}}function C(){return _?m:u}var L=function(){return function(){}},k=function(E,W){return function(I){return function(N){var U=I.instantSearchInstance,Z=I.results;if(N===""&&w)t(K(K({},W.getWidgetRenderState(K(K({},I),{},{results:P}))),{},{instantSearchInstance:U}),!1);else{var J={highlightPreTag:v?br.highlightPreTag:ge.highlightPreTag,highlightPostTag:v?br.highlightPostTag:ge.highlightPostTag};E.searchForFacetValues(a,N,Math.min(C(),100),J).then(function(H){var V=v?co(H.facetHits):H.facetHits,G=b(V.map(function(z){var re=z.escapedValue,he=z.value,pe=Ki(z,rp);return K(K({},pe),{},{value:re,label:he})}),{results:Z});t(K(K({},W.getWidgetRenderState(K(K({},I),{},{results:P}))),{},{items:G,canToggleShowMore:!1,canRefine:!0,isFromSearch:!0,instantSearchInstance:U}),!1)})}}}};return{$$type:"ais.refinementList",init:function(E){t(K(K({},this.getWidgetRenderState(E)),{},{instantSearchInstance:E.instantSearchInstance}),!0)},render:function(E){t(K(K({},this.getWidgetRenderState(E)),{},{instantSearchInstance:E.instantSearchInstance}),!1)},getRenderState:function(E,W){return K(K({},E),{},{refinementList:K(K({},E.refinementList),{},gt({},a,this.getWidgetRenderState(W)))})},getWidgetRenderState:function(E){var W=this,I=E.results,N=E.state,U=E.createURL,Z=E.instantSearchInstance,J=E.helper,H=[],V=[];if((!T||!O||!L)&&(T=Ka({instantSearchInstance:Z,helper:J,attribute:a,widgetType:this.$$type}),O=function(ir){T("click:internal",ir),J.toggleFacetRefinement(a,ir).search()},L=k(J,this)),I){var G=I.getFacetValues(a,{sortBy:h,facetOrdering:h===Gi});V=G&&Array.isArray(G)?G:[],H=b(V.slice(0,C()).map(R),{results:I});var z=N.maxValuesPerFacet,re=C();j=z>re?V.length<=re:V.length<re,P=I,w=H,E.results&&($=B(E,this))}var he=L&&L(E),pe=_&&w.length>u,at=f&&!j,Ms=pe||at;return{createURL:function(ir){return U(function(ks){return W.getWidgetUiState(ks,{searchParameters:N.resetPage().toggleFacetRefinement(a,ir),helper:J})})},items:H,refine:O,searchForItems:he,isFromSearch:!1,canRefine:H.length>0,widgetParams:n,isShowingMore:_,canToggleShowMore:Ms,toggleShowMore:A,sendEvent:T,hasExhaustiveItems:j}},dispose:function(E){var W=E.state;r();var I=W.setQueryParameter("maxValuesPerFacet",void 0);return o==="and"?I.removeFacet(a):I.removeDisjunctiveFacet(a)},getWidgetUiState:function(E,W){var I=W.searchParameters,N=o==="or"?I.getDisjunctiveRefinements(a):I.getConjunctiveRefinements(a);return op(K(K({},E),{},{refinementList:K(K({},E.refinementList),{},gt({},a,N))}),a)},getWidgetSearchParameters:function(E,W){var I=W.uiState,N=o==="or";if(E.isHierarchicalFacet(a)||N&&E.isConjunctiveFacet(a)||!N&&E.isDisjunctiveFacet(a))return E;var U=I.refinementList&&I.refinementList[a],Z=N?E.addDisjunctiveFacet(a).removeDisjunctiveFacetRefinement(a):E.addFacet(a).removeFacetRefinement(a),J=Z.maxValuesPerFacet||0,H=Math.max(J,f?m:u),V=Z.setQueryParameter("maxValuesPerFacet",H);if(!U){var G=N?"disjunctiveFacetsRefinements":"facetsRefinements";return V.setQueryParameters(gt({},G,K(K({},V[G]),{},gt({},a,[]))))}return U.reduce(function(z,re){return N?z.addDisjunctiveFacetRefinement(a,re):z.addFacetRefinement(a,re)},V)}}}};function op(e,t){return e.refinementList&&((!e.refinementList[t]||e.refinementList[t].length===0)&&delete e.refinementList[t],Object.keys(e.refinementList).length===0&&delete e.refinementList),e}function Ds(e,t){return ve(sp,e,t)}function Kt(e){"@babel/helpers - typeof";return Kt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Kt(e)}function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ee(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
37t%2?zi(Object(r),!0).forEach(function(n){up(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function up(e,t,r){return t=cp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function cp(e){var t=lp(e,"string");return Kt(t)=="symbol"?t:String(t)}function lp(e,t){if(Kt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Kt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var fp=de({name:"search-box",connector:!0}),dp=function(t,r){return r(t)},hp=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,fp()),function(n){var i=n||{},a=i.queryHook,s=a===void 0?dp:a,o,c;return{$$type:"ais.searchBox",init:function(l){var f=l.instantSearchInstance;t(Ee(Ee({},this.getWidgetRenderState(l)),{},{instantSearchInstance:f}),!0)},render:function(l){var f=l.instantSearchInstance;t(Ee(Ee({},this.getWidgetRenderState(l)),{},{instantSearchInstance:f}),!1)},dispose:function(l){var f=l.state;return r(),f.setQueryParameter("query",void 0)},getRenderState:function(l,f){return Ee(Ee({},l),{},{searchBox:this.getWidgetRenderState(f)})},getWidgetRenderState:function(l){var f=l.helper,d=l.instantSearchInstance,m=l.state;return o||(o=function(h){s(h,function(y){return f.setQuery(y).search()})},c=function(){f.setQuery("").search()}),{query:m.query||"",refine:o,clear:c,widgetParams:n,isSearchStalled:d.status==="stalled"}},getWidgetUiState:function(l,f){var d=f.searchParameters,m=d.query||"";return m===""||l&&l.query===m?l:Ee(Ee({},l),{},{query:m})},getWidgetSearchParameters:function(l,f){var d=f.uiState;return l.setQueryParameter("query",d.query||"")}}}};function mp(e,t){return ve(hp,e,t)}function Gt(e){"@babel/helpers - typeof";return Gt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gt(e)}function Ji(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Ie(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Ji(Object(r),!0).forEach(function(n){pp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ji(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function pp(e,t,r){return t=gp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gp(e){var t=vp(e,"string");return Gt(t)=="symbol"?t:String(t)}function vp(e,t){if(Gt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Gt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Xi=de({name:"sort-by",connector:!0}),yp=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;Se(t,Xi());var n={};return function(i){var a=i||{},s=a.items,o=a.transformItems,c=o===void 0?function(u){return u}:o;if(!Array.isArray(s))throw new Error(Xi("The `items` option expects an array of objects."));return{$$type:"ais.sortBy",init:function(l){var f=l.instantSearchInstance,d=this.getWidgetRenderState(l),m=d.currentRefinement;We(s,function(p){return p.value===m}),t(Ie(Ie({},d),{},{instantSearchInstance:f}),!0)},render:function(l){var f=l.instantSearchInstance;t(Ie(Ie({},this.getWidgetRenderState(l)),{},{instantSearchInstance:f}),!1)},dispose:function(l){var f=l.state;return r(),n.initialIndex?f.setIndex(n.initialIndex):f},getRenderState:function(l,f){return Ie(Ie({},l),{},{sortBy:this.getWidgetRenderState(f)})},getWidgetRenderState:function(l){var f=l.results,d=l.helper,m=l.state,p=l.parent;!n.initialIndex&&p&&(n.initialIndex=p.getIndexName()),n.setIndex||(n.setIndex=function(y){d.setIndex(y).search()});var h=f?f.nbHits===0:!0;return{currentRefinement:m.index,options:c(s,{results:f}),refine:n.setIndex,hasNoResults:h,canRefine:!h&&s.length>0,widgetParams:i}},getWidgetUiState:function(l,f){var d=f.searchParameters,m=d.index;return Ie(Ie({},l),{},{sortBy:m!==n.initialIndex?m:void 0})},getWidgetSearchParameters:function(l,f){var d=f.uiState;return l.setQueryParameter("index",d.sortBy||n.initialIndex||l.index)}}}};function bp(e,t){return ve(yp,e,t)}function zt(e){"@babel/helpers - typeof";return zt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},zt(e)}function Yi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function Je(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};
37t%2?Yi(Object(r),!0).forEach(function(n){Sp(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Yi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function Sp(e,t,r){return t=Rp(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rp(e){var t=Pp(e,"string");return zt(t)=="symbol"?t:String(t)}function Pp(e,t){if(zt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(zt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var jp=de({name:"stats",connector:!0}),wp=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,jp()),function(n){return{$$type:"ais.stats",init:function(a){var s=a.instantSearchInstance;t(Je(Je({},this.getWidgetRenderState(a)),{},{instantSearchInstance:s}),!0)},render:function(a){var s=a.instantSearchInstance;t(Je(Je({},this.getWidgetRenderState(a)),{},{instantSearchInstance:s}),!1)},dispose:function(){r()},getRenderState:function(a,s){return Je(Je({},a),{},{stats:this.getWidgetRenderState(s)})},getWidgetRenderState:function(a){var s=a.results,o=a.state;return s?{hitsPerPage:s.hitsPerPage,nbHits:s.nbHits,nbSortedHits:s.nbSortedHits,areHitsSorted:typeof s.appliedRelevancyStrictness<"u"&&s.appliedRelevancyStrictness>0&&s.nbSortedHits!==s.nbHits,nbPages:s.nbPages,page:s.page,processingTimeMS:s.processingTimeMS,query:s.query,widgetParams:n}:{hitsPerPage:o.hitsPerPage,nbHits:0,nbSortedHits:void 0,areHitsSorted:!1,nbPages:0,page:o.page||0,processingTimeMS:-1,query:o.query||"",widgetParams:n}}}}};function wn(e,t){return ve(wp,e,t)}function Jt(e){"@babel/helpers - typeof";return Jt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jt(e)}function Zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),r.push.apply(r,n)}return r}function le(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?Zi(Object(r),!0).forEach(function(n){vr(e,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Zi(Object(r)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(r,n))})}return e}function vr(e,t,r){return t=Op(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Op(e){var t=xp(e,"string");return Jt(t)=="symbol"?t:String(t)}function xp(e,t){if(Jt(e)!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(Jt(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function _p(e,t){return Ip(e)||Ep(e,t)||$p(e,t)||Fp()}function Fp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 38In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $p(e,t){if(e){if(typeof e=="string")return ea(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ea(e,t)}}function ea(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Ep(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Ip(e){if(Array.isArray(e))return e}var ta=de({name:"toggle-refinement",connector:!0}
38),Cs="ais.toggleRefinement",Tp=function(t){var r=t.instantSearchInstance,n=t.helper,i=t.attribute,a=t.on,s=function(){for(var c=arguments.length,u=new Array(c),l=0;l<c;l++)u[l]=arguments[l];if(u.length===1){r.sendEventToInsights(u[0]);return}var f=u[1],d=u[2],m=d===void 0?"Filter Applied":d,p=u[0].split(":"),h=_p(p,2),y=h[0],v=h[1];if(!(y!=="click"||a===void 0)&&!f){var g;r.sendEventToInsights({insightsMethod:"clickedFilters",widgetType:Cs,eventType:y,eventModifier:v,payload:{eventName:m,index:((g=n.lastResults)===null||g===void 0?void 0:g.index)||n.state.index,filters:a.map(function(b){return"".concat(i,":").concat(b)})},attribute:i})}};return s},Ap=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:X;return Se(t,ta()),function(n){var i=n||{},a=i.attribute,s=i.on,o=s===void 0?!0:s,c=i.off;if(!a)throw new Error(ta("The `attribute` option is required."));var u=c!==void 0,l=Ar(o).map(mt),f=u?Ar(c).map(mt):void 0,d,m=function(y){return function(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{isRefined:!1},g=v.isRefined;g?(l.forEach(function(b){return y.removeDisjunctiveFacetRefinement(a,b)}),u&&f.forEach(function(b){return y.addDisjunctiveFacetRefinement(a,b)})):(d("click:internal",g),u&&f.forEach(function(b){return y.removeDisjunctiveFacetRefinement(a,b)}),l.forEach(function(b){return y.addDisjunctiveFacetRefinement(a,b)})),y.search()}},p={createURLFactory:function(y,v){var g=v.state,b=v.createURL,R=v.getWidgetUiState,P=v.helper;return function(){g=g.resetPage();var w=y?l:f;w&&w.forEach(function(O){g=g.removeDisjunctiveFacetRefinement(a,O)});var j=y?f:l;return j&&j.forEach(function(O){g=g.addDisjunctiveFacetRefinement(a,O)}),b(function(O){return R(O,{searchParameters:g,helper:P})})}}};return{$$type:Cs,init:function(y){var v=y.instantSearchInstance;t(le(le({},this.getWidgetRenderState(y)),{},{instantSearchInstance:v}),!0)},render:function(y){var v=y.instantSearchInstance;t(le(le({},this.getWidgetRenderState(y)),{},{instantSearchInstance:v}),!1)},dispose:function(y){var v=y.state;return r(),v.removeDisjunctiveFacet(a)},getRenderState:function(y,v){return le(le({},y),{},{toggleRefinement:le(le({},y.toggleRefinement),{},vr({},a,this.getWidgetRenderState(v)))})},getWidgetRenderState:function(y){var v=y.state,g=y.helper,b=y.results,R=y.createURL,P=y.instantSearchInstance,w=b?l.every(function(C){return v.isDisjunctiveFacetRefined(a,C)}):l.every(function(C){return v.isDisjunctiveFacetRefined(a,C)}),j={isRefined:w,count:0},O={isRefined:u&&!w,count:0};if(b){var T=Ar(f||!1),_=b.getFacetValues(a,{})||[],$=l.map(function(C){return We(_,function(L){var k=L.escapedValue;return k===mt(String(C))})}).filter(function(C){return C!==void 0}),A=u?T.map(function(C){return We(_,function(L){var k=L.escapedValue;return k===mt(String(C))})}).filter(function(C){return C!==void 0}):[];j={isRefined:$.length?$.every(function(C){return C.isRefined}):!1,count:$.reduce(function(C,L){return C+L.count},0)||null},O={isRefined:A.length?A.every(function(C){return C.isRefined}):!1,count:A.reduce(function(C,L){return C+L.count},0)||_.reduce(function(C,L){var k=L.count;return C+k},0)}}d||(d=Tp({instantSearchInstance:P,attribute:a,on:l,helper:g}));var B=w?O:j;return{value:{name:a,isRefined:w,count:b?B.count:null,onFacetValue:j,offFacetValue:O},createURL:p.createURLFactory(w,{state:v,createURL:R,helper:g,getWidgetUiState:this.getWidgetUiState}),sendEvent:d,canRefine:!!(b&&B.count),refine:m(g),widgetParams:n}},getWidgetUiState:function(y,v){var g=v.searchParameters,b=l&&l.every(function(P){return g.isDisjunctiveFacetRefined(a,P)});if(!b){var R;return(R=y.toggle)===null||R===void 0||delete R[a],y}return le(le({},y),{},{toggle:le(le({},y.toggle),{},vr({},a,b))})},getWidgetSearchParameters:function(y,v){var g=v.uiState;if(y.isHierarchicalFacet(a)||y.isConjunctiveFacet(a))return y;var b=y.addDisjunctiveFacet(a).removeDisjunctiveFacetRefinement(a),R=!!(g.toggle&&g.toggle[a]);return R?(l&&l.forEach(function(P){b=b.addDisjunctiveFacetRefinement(a,P)}),b):u?(f&&f.forEach(function(P){b=b.addDisjunctiveFacetRefinement(a,P)}),b):b.setQueryParameters({disjunctiveFacetsRefinements:le(le({},y.disjunctiveFacetsRefinements),{},vr({},a,[]))})}}}};function Dp(e,t){return ve(Ap,e,t)}function Cp(e,t){return Lp(e)||Wp(e,t)||Hp(e,t)||Np()}
38function Np(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 39In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Hp(e,t){if(e){if(typeof e=="string")return ra(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ra(e,t)}}function ra(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Wp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Lp(e){if(Array.isArray(e))return e}function Up(){var e=nr(),t=Pn(),r=F.useState(function(){var s=Xr(t);return{results:s.results,scopedResults:s.scopedResults}}),n=Cp(r,2),i=n[0],a=n[1];return F.useEffect(function(){function s(){var o=t.getResults();if(o!==null)a({results:o,scopedResults:t.getScopedResults()});else if(e.mainIndex.getIndexName().length===0){var c=e.mainIndex.getWidgets().find(me);c&&a({results:Xr(t).results,scopedResults:c.getScopedResults()})}}return e.addListener("render",s),function(){e.removeListener("render",s)}},[e,t]),i}function na(e,t){return Vp(e)||kp(e,t)||Qp(e,t)||Mp()}function Mp(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 40In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qp(e,t){if(e){if(typeof e=="string")return ia(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if(r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set")return Array.from(e);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ia(e,t)}}function ia(e,t){(t==null||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function kp(e,t){var r=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(r!=null){var n,i,a,s,o=[],c=!0,u=!1;try{if(a=(r=r.call(e)).next,t!==0)for(;!(c=(n=a.call(r)).done)&&(o.push(n.value),o.length!==t);c=!0);}catch(l){u=!0,i=l}finally{try{if(!c&&r.return!=null&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return o}}function Vp(e){if(Array.isArray(e))return e}function Bp(){var e=nr(),t=Pn(),r=t.getIndexId(),n=F.useState(function(){return e.getUiState()}),i=na(n,2),a=i[0],s=i[1],o=a[r],c=F.useState(function(){return e.renderState}),u=na(c,2),l=u[0],f=u[1],d=l[r]||{},m=F.useCallback(function(h){e.setUiState(h)},[e]),p=F.useCallback(function(h){t.setIndexUiState(h)},[t]);return F.useEffect(function(){function h(){s(e.getUiState()),f(e.renderState)}return e.addListener("render",h),function(){e.removeListener("render",h)}},[e]),{uiState:a,setUiState:m,indexUiState:o,setIndexUiState:p,renderState:l,indexRenderState:d}}function qp(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.catchError,r=nr(),n=Bp(),i=n.uiState,a=n.setUiState,s=n.indexUiState,o=n.setIndexUiState,c=n.renderState,u=n.indexRenderState,l=Up(),f=l.results,d=l.scopedResults,m=F.useCallback(function(){for(var h=arguments.length,y=new Array(h),v=0;v<h;v++)y[v]=arguments[v];return r.use.apply(r,y),function(){r.unuse.apply(r,y)}},[r]),p=F.useCallback(function(){r.refresh()},[r]);return os(function(){if(t){var h=function(){};return r.addListener("error",h),function(){return r.removeListener("error",h)}}return function(){}},[r,t]),{results:f,scopedResults:d,uiState:i,setUiState:a,indexUiState:s,setIndexUiState:o,renderState:c,indexRenderState:u,addMiddlewares:m,refresh:p,status:r.status,error:r.error}}const wr=({name:e,info:t,defaultOpen:r,children:n})=>{const{$t:i}=Ve(),[a,s]=la(!1),o=c=>{s(),c.stopPropagation()};return S.jsx(po,{defaultOpen:r,as:"div",className:"px-5 lg:px-0",children:({open:c})=>S.jsxs(S.Fragment,{children:[S.jsx("div",{}),S.jsxs(go,{className:"flex items-center justify-between w-full font-bold text-base text-left transition-colors focus:outline-none border-b border-b-stone-200 py-3",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("span",{className:"break-all",children:e}),t?S.jsxs("div",{className:"hidden md:block",children:[S.jsx("span",{className:"text-sm font-normal text-red-700 cursor-pointer",onClick:o,children:i("Explanation")}),S.jsxs(Zs,{show:a,onClose:s,title:e,wrapperCls:"!p-0",titleCls:"md:p-8",childrenCl
40s:"!p-0",children:[S.jsx("div",{className:"max-h-[60vh] pb-20 overflow-y-auto",children:t}),S.jsx("div",{className:"fixed bottom-0 left-0 right-0 flex justify-end px-4 md:px-8 py-4.5 rounded-b md:rounded-b-lg bg-white",children:S.jsx(ma,{theme:"secondary",size:"medium",onClick:s,children:eo(i("close"))})})]})]}):null]}),S.jsx(Ks,{state:!c})]}),S.jsx(vo,{unmount:!1,children:S.jsx(yo,{children:n})})]})})},Ns=({as:e="li",canToggleShowMore:t,toggleShowMore:r,isShowingMore:n})=>{const{$t:i}=Ve(),a=bo(xn,e,xn.li);return t&&!n?S.jsx(a,{...to,children:S.jsx(So,{titles:[i("Close more"),i("Show more")],toggle:r,expanded:n,className:"mt-2"})}):null},Hs=({items:e,createURL:t,refine:r,isSub:n,className:i})=>e.length===0?null:S.jsx("ul",{className:hr("space-y-1",i),children:e.map(a=>S.jsxs("li",{children:[S.jsx(pa,{children:S.jsxs(ha,{className:"text-sm leading-5 text-gray-2",to:t(a.value),onClick:s=>{s.preventDefault(),r(a.value)},children:[S.jsx("span",{className:hr(a.isRefined?"font-bold":""),children:a.label}),S.jsxs("span",{className:"ml-1 text-stone-500",children:["(",a.count,")"]})]})}),a.data&&S.jsx(Hs,{className:hr("ml-4",n?"mt-1":""),items:a.data,refine:r,createURL:t,isSub:!0})]},a.value))}),Kp=({defaultOpen:e,...t})=>{const{$t:r}=Ve(),{items:n,refine:i,createURL:a,canToggleShowMore:s,toggleShowMore:o,isShowingMore:c}=Im({...t});return n.length?S.jsx(wr,{name:r("Categories"),defaultOpen:e,children:S.jsxs("div",{className:"mt-3.5 pb-6",children:[S.jsx(Hs,{items:n,refine:i,createURL:a}),S.jsx(Ns,{toggleShowMore:o,isShowingMore:c,canToggleShowMore:s})]})}):null},Gp=({items:e,refine:t})=>S.jsx("li",{children:e.map(r=>S.jsx(pa,{children:S.jsx("div",{className:"flex w-full",children:S.jsx(ba,{label:S.jsxs("span",{className:"text-sm",children:[r.label,r.count>0&&S.jsxs("span",{className:"ml-1 text-stone-500",children:["(",r.count,")"]})]}),theme:"secondary",enabled:r.isRefined,onChange:()=>{t(r.value)},className:"mb-6 md:mb-3"})})},r.value))}),zp=({name:e,defaultOpen:t,info:r,...n})=>{const{items:i,canToggleShowMore:a,isShowingMore:s,toggleShowMore:o,refine:c}=Ds({showMore:!0,limit:5,...n}),u=t||i.some(l=>l.isRefined);return i.length?S.jsx(wr,{name:e,defaultOpen:u,info:r,children:S.jsxs("ul",{className:"mt-3.5 pb-6",children:[S.jsx(Gp,{items:i,refine:c}),S.jsx(Ns,{toggleShowMore:o,isShowingMore:s,canToggleShowMore:a})]})}):null},Jp=({name:e,defaultOpen:t,info:r,attribute:n})=>{const{value:{isRefined:i},refine:a}=Dp({attribute:n}),{items:s}=Ds({attribute:n}),o=s.find(u=>{const l=String(u.value).toLowerCase();return u.count>0&&(l==="true"||l==="1")});if(!o)return null;const c=t||i;return S.jsx(wr,{name:e,defaultOpen:c,info:r,children:S.jsx("div",{className:"mt-3.5 pb-6",children:S.jsx(ba,{label:S.jsxs("span",{className:"text-sm",children:[e,o.count>0&&S.jsxs("span",{className:"ml-1 text-stone-500",children:["(",o.count,")"]})]}),theme:"secondary",enabled:i,onChange:u=>{a({isRefined:!u})},className:"mb-6 md:mb-3"})})})},Xp=e=>{const{range:t,start:r,refine:n}=As({precision:2,...e}),i=t.min||0,a=t.max||0,s=[Math.max(r[0]||0,i),Math.min(r[1]||0,a)],o=F.useCallback(([c,u])=>{n([c,u])},[n]);return S.jsx(Ro,{className:"mt-3.5 pb-6",min:i,max:a,value:s,onChange:o})},Yp=({products:e,categoryId:t,categoryName:r,onClick:n,numberOfColumns:i=3,relatedContents:a=[],relatedContentsPosition:s=[3,12],fetchPriorityOnFirstElement:o=!1})=>{const c=fa("(min-width: 768px)",!0),u=F.useRef(c?6:3),l=Zp({products:e??[],relatedContents:a,relatedContentsPosition:s});return e!=null&&e.length?S.jsx(_o,{children:S.jsx("div",{className:`grid grid-cols-1 sm:grid-cols-2 md:grid-cols-${i} gap-4 sm:mx-0 -mx-4`,"data-item-list-id":t,"data-item-list-name":r,children:l.map((f,d)=>f.itemType==="product"?S.jsx(Fo,{product:f,loading:d<u.current?"eager":"lazy",fetchPriority:o&&d===0?"high":"auto",theme:"card",onClick:()=>{f.agProduct!=null&&(n==null||n(f.agProduct))}},f.id):S.jsx("div",{className:"px-4 sm:px-0",children:S.jsx(xo,{item:f,className:"w-full h-full p-4 !bg-brown-50",themeOfCard:"product"})},f.sys.id))})}):S.jsx(S.Fragment,{})},Zp=({products:e,relatedContents:t,relatedContentsPosition:r})=>F.useMemo(()=>{const i=e.map(a=>({...a,itemType:"product"}));return t.forEach((a,s)=>{const o=r[s]-1;o>=0&&i.splice(o,0,{...a,itemType:"content"})}),i},[e,t,r]),eg=({isOnSale:e,discountLabel:t})=>t&&t.label?{type:"discount",...t}:e?{key:(t==null?void 0:t.key)??"",type:"sale",theme:"Red",i18nKey:"Sale"}:null,Ws=(e,t)=>{var i,a;const r=lo(e),n=Io({customFields:e.customFields});return{isOnSale:r.isOnSale,isExpressDelivery:r.isExpressDelivery??!1,qtyMultiplier:r.qtyMultiplier,stuckPrice:r.stuckPrice,priceUnit:r.priceUnit,priceInclTax:r.priceInclTax??null,priceExclTax:r.priceExclTax??null,salePriceInclTax:r.salePriceInclTax??null,salePriceExclTax:r.salePriceExclTax??null,multiplierPriceInclTax:r.multiplierPriceInclTax,stock:r.stock,availabilityType:r.availabilityType,availableVariantCount:r.availableVariantCount??0,variantsInStock:r.variantsInStock??0,benef
40its:r.benefits||[],isSellable:r.isSellable,productLabel:eg({isOnSale:r.isOnSale,discountLabel:t==null?void 0:t.discountLabel}),discount:r.discount,shippingTimeVal:r.shippingTimeVal,isBestChoice:r.isBestChoice,name:e.name,path:e.path,id:e.id,sku:e.sku,defaultImage:e.defaultImage,customFields:n,financeCategoryId:((a=(i=n.find(s=>s.name===mr.PRODUCT_TYPE))==null?void 0:i.value)==null?void 0:a.stringValue)??void 0}},Ng=(e,t)=>{const r=Ws(e,t),n="productTypeOpt"in e?e.productTypeOpt:void 0;return{...r,productTypeOpt:n}},tg=e=>{const{objectID:t,defaultImage:r,attributes:n,inventory:i=0,name:a,slug:s,key:o,sku:c,priceInclTax:u,priceExclTax:l,salePriceInclTax:f,isInStock:d=!1,variantCount:m=0,availableVariantCount:p=0,variantsInStock:h=0,hasExtraOptions:y=!1,discount:v,benefits:g}=e,b=Object.entries(n).map(([_,$],A)=>({name:_,sortOrder:A,value:{stringValue:$[0],stringValues:$}})),R={availableToSell:i,isInStock:d},{isSellable:P,...w}=Ws({name:a,priceInclTax:u,salePriceInclTax:f,path:s,defaultImage:r,sku:c,id:t,availableVariantCount:p,variantsInStock:h,key:o,customFields:b,priceExclTax:l,salePriceExclTax:null,inventory:R,isPurchasable:!0,categories:[]},{discountLabel:v?{...Ao(v,"key","label","description"),theme:v.theme??"Yellow",enablePromotionTimer:!1,promotionDateEnd:null}:null}),j=()=>{const _=!!u&&(u==null?void 0:u.value)!==0;return P&&_?"available":"temporarilyUnavailable"},T=(()=>{const _=m>=2;return{productType:_||y?"special":"regular",hasExtraOptions:y,isVariant:_,isModel:!0,variantType:null}})();return{...w,__queryID:e.__queryID,agProduct:e,productTypeOpt:T,availabilityType:j(),benefits:g||[]}},Ls=e=>{const{refine:t,canRefine:r}=sm(e);return r?S.jsx(Po,{onReset:t}):null},rg=({attribute:e,title:t})=>{const{range:{min:r,max:n},start:[i,a],refine:s}=As({attribute:e,precision:2}),o=[t,`${Math.max(i||0,r||0)}-${Math.min(a||0,n||0)}`].join(": ");return S.jsx(ga,{title:o,onUnSelected:()=>s([r,n])})},ng=({items:e,rangeAttrs:t})=>S.jsx(S.Fragment,{children:e.map(({attribute:r,refine:n,refinements:i})=>{const a=t==null?void 0:t.find(s=>s.attribute===r);return a?S.jsx(rg,{...a},r):i.map(s=>S.jsx(ga,{title:s.label,onUnSelected:()=>n(s)},s.value))})}),ig=({className:e,rangeAttrs:t,...r})=>{const n=$s(r),{$t:i}=Ve();if(!n.items.length)return null;const a=S.jsx(ng,{...n,rangeAttrs:t}),s=S.jsx(Ls,{includedAttributes:r.includedAttributes,excludedAttributes:r.excludedAttributes});return S.jsxs("div",{className:hr("block lg:flex lg:items-center lg:space-x-8 bg-white lg:pb-6 w-full",e),children:[S.jsxs("div",{children:[S.jsx("div",{className:"hidden lg:flex flex-wrap gap-3.5",children:a}),S.jsx("div",{className:"lg:hidden pb-5",children:S.jsxs("div",{className:"px-5",children:[S.jsx(Sa,{lv:5,className:"mb-2 text-stone-500 font-semibold text-sm",children:i("Checked filters")}),S.jsx("div",{className:"flex flex-wrap gap-3.5 mb-3.5",children:a}),s]})})]}),S.jsx("span",{className:"hidden lg:block shrink-0",children:s})]})},ag=e=>{const{hitsPerPage:t}=wn(),{currentRefinement:r,nbHits:n,createURL:i}=Ts(e),a=Co();return S.jsx(jo,{mode:"link",pagination:{page:r+1,pageSize:t||48,total:n},linkTo:s=>i(s.page-1),location:a})},sg=e=>(mp(e),null),og=({children:e})=>S.jsx("div",{className:"hidden lg:block lg:w-66 mr-6 shrink-0",children:e}),ug=({children:e,selectedFilterCount:t})=>{const[r,n]=la(!1),{$t:i}=Ve(),{nbHits:a}=wn();return S.jsxs(S.Fragment,{children:[S.jsxs(ro,{className:fo("w-full px-4",t?"justify-between":"justify-center"),onClick:()=>n(!0),theme:"secondary",children:[S.jsxs("div",{className:"flex gap-x-2.5",children:[S.jsx(no,{}),S.jsx("span",{children:i("Filters")})]}),S.jsx(Do,{value:t})]}),S.jsx(io,{show:r,onClose:()=>n(!1),animateProps:wo,showMask:!1,unmount:!1,children:S.jsxs("div",{className:"bg-white w-full overflow-y-scroll fixed inset-0",children:[S.jsxs("div",{className:"relative pb-18",children:[S.jsxs("div",{className:"gd-theme gd-theme--secondary relative py-4 flex justify-center items-center mb-4 border-b bg-border--primary",children:[S.jsx(Sa,{lv:2,className:"font-bold",children:i("Filters")}),S.jsx("button",{type:"button",className:"absolute right-0 top-0 bottom-0 h-full px-5 self-end flex items-center justify-center",onClick:()=>n(!1),children:S.jsx(ao,{className:"text-stone-600 w-3 h-3"})})]}),e]}),S.jsxs("div",{className:"fixed bottom-0 left-0 right-0 p-4 bg-white border-t gd-border--primary flex items-center justify-between",children:[S.jsx(ma,{className:"w-max py-2.5 px-4 !rounded !h-10",theme:"secondary",onClick:()=>n(!1),children:i("View {total} results",{total:String(a)})}),S.jsx(Ls,{})]})]})})]})},aa={Desktop:og,Mobile:ug},Us=e=>{const{options:t,refine:r,currentRefinement:n}=bp(e),{nbHits:i}=wn();return{list:F.useMemo(()=>t.map(s=>
40({value:s.value,name:s.label})),[t]),sort:n,onSortChange:r,total:i,totalSuffix:e.totalSuffix}},cg=e=>{const t=Us(e);return S.jsx(va.Desktop,{...t})},lg=e=>{const t=Us(e);return S.jsx(va.Mobile,{...t})},sa={Desktop:cg,Mobile:lg},fg=({onTotalChange:e,filters:t,list:r,sortBarProps:n,includedAttributes:i,excludedAttributes:a,categoryCarousel:s,configureProps:o,transformItems:c,rangeAttrs:u,header:l,navigationLinks:f})=>{const{results:{__isArtificial:d,nbHits:m}}=qp();F.useEffect(()=>{d||e==null||e(m)},[d,e,m]);const p=S.jsx(ig,{includedAttributes:i,excludedAttributes:a,transformItems:c,rangeAttrs:u}),h=$s({includedAttributes:i,excludedAttributes:a,transformItems:c}).items.reduce((v,g)=>v+g.refinements.length,0),y=fa("(min-width: 1024px)",!0);return S.jsxs(S.Fragment,{children:[S.jsx(xf,{hitsPerPage:48,...o}),S.jsx(sg,{}),S.jsxs(aa.Desktop,{selectedFilterCount:h,children:[f?S.jsx("div",{className:"mr-6",children:f}):null,t]}),S.jsxs("div",{className:"grow min-w-0",children:[s?S.jsx("div",{children:s}):null,S.jsxs("div",{children:[l,S.jsx("div",{className:"block lg:hidden",children:f}),S.jsxs("div",{className:"lg:hidden flex gap-x-3.5 pb-6 bg-white",children:[S.jsx("div",{className:"w-1/2",children:S.jsxs(aa.Mobile,{selectedFilterCount:h,children:[p,t]})}),S.jsx("div",{className:"w-1/2",children:S.jsx(sa.Mobile,{...n})})]})]}),S.jsxs("div",{className:"w-full",children:[y?p:null,S.jsx(sa.Desktop,{...n}),r,S.jsx(ag,{})]})]})]})},dg=({name:e,attribute:t,filterInfo:r,defaultOpen:n,info:i})=>{const{formatFilterName:a}=ya(),{getRangeSortVal:s}=Oo(),o=F.useMemo(()=>r.find(l=>l.code===t),[t,r]),c=F.useCallback((l,f)=>l.isRefined===f.isRefined?s(l.name)-s(f.name):l.isRefined?-1:1,[s]),u=F.useCallback(l=>l.map(f=>({...f,label:a(f.value,{groupName:t,formatType:o.type,unit:o.unit||""})})).filter(f=>f.count>0),[t,o,a]);return o?S.jsx(zp,{name:e,attribute:[Qr,t].join("."),sortBy:c,transformItems:u,info:i,defaultOpen:n}):null},hg=({facets:e,attrs:t,filterInfo:r,facetsInfo:n,hideHierarchicalMenu:i,defaultOpen:a})=>{const{$t:s}=Ve(),o=mo("enable_gaderos_choice_label"),c=n[mr.BEST_CHOICE];return S.jsxs(S.Fragment,{children:[i?null:S.jsx(Kp,{attributes:[Ae.RootCategory,Ae.Categorylvl1,Ae.Categorylvl2,Ae.Categorylvl3],defaultOpen:!0}),o&&S.jsx(Jp,{name:t[mr.BEST_CHOICE]??s("Gadero's choice label"),info:c?S.jsx(_n,{contentBlocks:[c],payloads:{contentTypeRichText:{className:"md:!px-8"}}}):null,attribute:`attributes.${mr.BEST_CHOICE}`,defaultOpen:a}),e.map(u=>S.jsx(dg,{attribute:u,name:t[u]||u,filterInfo:r,info:n[u]?S.jsx(_n,{contentBlocks:[n[u]],payloads:{contentTypeRichText:{className:"md:!px-8"}}}):null,defaultOpen:a},u)),S.jsx(wr,{name:s("Price"),defaultOpen:!0,children:S.jsx(Xp,{attribute:Ae.Price})})]})},Hg=({facets:e,attrs:t,filterInfo:r,facetsInfo:n,categoryList:i=[],onTotalChange:a,configureProps:s,hideHierarchicalMenu:o,header:c,navigationLinks:u,mergeProductsOpts:l,openAllFilters:f,relatedContents:d,hasPromotionalBanner:m})=>{const{$t:p}=Ve(),{hits:h,sendEvent:y}=Nm(),{productSortingItems:v}=To(),g=F.useMemo(()=>h.map(O=>tg(O)),[h]);$o(g,l);const b=F.useMemo(()=>({items:v,totalSuffix:p("products")}),[p,v]),R=F.useMemo(()=>[o?null:Ae.RootCategory,...e.map(O=>[Qr,O].join(".")),Ae.Price].filter(ho),[e,o]),{formatFilterName:P}=ya(),w=F.useCallback(O=>O.map(T=>({...T,refinements:T.refinements.map(_=>{const{attribute:$,value:A}=_,B=$.replace(`${Qr}.`,""),C=r.find(L=>L.code===B);return C?{..._,label:P(A,{groupName:B,formatType:C.type,unit:C.unit||""})}:_})})),[r,P]),{currentRefinement:j}=Ts();return S.jsx(fg,{header:c,navigationLinks:u,list:S.jsx(Yp,{onClick:O=>y("click",O,"Product Clicked"),products:g,categoryId:"search",categoryName:"Search",relatedContents:j===0?d:[],fetchPriorityOnFirstElement:!m}),filters:S.jsx(hg,{facets:e,attrs:t,filterInfo:r,facetsInfo:n,hideHierarchicalMenu:o,defaultOpen:f}),categoryCarousel:S.jsx(ou,{className:"mb-4 md:mb-6",items:i}),includedAttributes:R,transformItems:w,rangeAttrs:[{attribute:Ae.Price,title:p("Price").toLowerCase()}],sortBarProps:b,onTotalChange:a,configureProps:s})},Wg=e=>{const[t,r]=F.useState(!1);return F.useEffect(()=>{r(!0)},[]),e?t?{insightsInitParams:{useCookie:!0}}:!0:!1};export{zp as A,ru as B,xf as C,ou as G,rs as I,au as K,fg as S,nu as W,ss as a,Pn as b,ai as c,Qf as d,os as e,cf as f,Dg as g,qp as h,Nf as i,iu as j,Nm as k,Wg as l,Cg as m,Hg as n,ef as o,ih as p,Ds as q,As as r,Ng as s,as as u};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.