"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9399],{6393:function(e,t,n){n.r(t),n.d(t,{ANALYTICS_EVENT_TYPE:function(){return r.vi},STORE_EVENT_PREFIX:function(){return r.Mi},SearchProvider:function(){return s.z},UIContext:function(){return S},UIProvider:function(){return Provider_Provider},compose:function(){return N.q},createBaseStore:function(){return I.M},createCartStore:function(){return C.n},createSessionStore:function(){return p.S},createStore:function(){return M.M},formatSearchState:function(){return i.Z},initSearchState:function(){return c.j},isSearchSort:function(){return a.wb},optimistic:function(){return h.A},parseSearchState:function(){return o.Q},persisted:function(){return _.R},removeFacet:function(){return a.Ru},sendAnalyticsEvent:function(){return sendAnalyticsEvent},setFacet:function(){return a.uL},singleton:function(){return y.r},toggleFacet:function(){return a.wB},toggleFacets:function(){return a.a2},useAnalyticsEvent:function(){return u.W},useGlobalUIState:function(){return useGlobalUIState},usePagination:function(){return l.h},useSearch:function(){return f.R}});var r=n(4950);let sendAnalyticsEvent=e=>{try{window.postMessage((0,r.re)(e),window.origin)}catch(e){console.error(e)}};var u=n(8529),o=n(6142),i=n(2339),c=n(2489),a=n(9664),s=n(6763),f=n(9029),l=n(1341),d=n(4194);let S=(0,d.createContext)(void 0);S.displayName="UIContext";let E={displayMinicart:!1},reducer=e=>{let t={OPEN_MINICART:e=>({...e,displayMinicart:!0}),CLOSE_MINICART:e=>({...e,displayMinicart:!1}),...e};return(e,{type:n,data:r})=>{let u=t[n];if("function"==typeof u)return u(e,r);throw Error("Unknown UI state")}},defaultEffects=()=>({}),Provider_Provider=({children:e,actions:t={},effects:n=defaultEffects,initialState:r={}})=>{let[u,o]=(0,d.useReducer)(reducer(t),{...E,...r}),i=(0,d.useMemo)(()=>({...n(o),openMinicart:()=>o({type:"OPEN_MINICART"}),closeMinicart:()=>o({type:"CLOSE_MINICART"})}),[n]),c=(0,d.useMemo)(()=>({...u,...i}),[i,u]);return d.createElement(S.Provider,{value:c},e)};var v=n(2254);let useContext=e=>{let t=(0,d.useContext)(e);if(void 0===t)throw new v.q(`${e.displayName??"Context"} needs to be on the React tree`);return t},useGlobalUIState=()=>useContext(S);var p=n(8987),C=n(9380),I=n(3365),M=n(9578),h=n(5214),_=n(3169),y=n(8901),N=n(8956)}}]);