1var e=new Map,t=t=>{let n=e.get(t);return n?Object.fromEntries(Object.entries(n.stores).map(([e,t])=>[e,t.getState()])):{}},n=(t,n,r)=>{if(t===void 0)return{type:`untracked`,connection:n.connect(r)};let i=e.get(r.name);if(i)return{type:`tracked`,store:t,...i};let a={connection:n.connect(r),stores:{}};return e.set(r.name,a),{type:`tracked`,store:t,...a}},r=(t,n)=>{if(n===void 0)return;let r=e.get(t);r&&(delete r.stores[n],Object.keys(r.stores).length===0&&e.delete(t))},i=e=>{if(!e)return;let t=e.split(` 2`),n=t.findIndex(e=>e.includes(`api.setState`));if(n<0)return;let r=t[n+1]?.trim()||``;return/.+ (.+) .+/.exec(r)?.[1]},a=(e,a={})=>(s,c,l)=>{let{enabled:u,anonymousActionType:d,store:f,...p}=a,m;try{m=(u??!1)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch{}if(!m)return e(s,c,l);let{connection:h,...g}=n(f,m,p),_=!0;l.setState=((e,n,r)=>{let a=s(e,n);if(!_)return a;let o=r===void 0?{type:d||i(Error().stack)||`anonymous`}:typeof r==`string`?{type:r}:r;return f===void 0?(h?.send(o,c()),a):(h?.send({...o,type:`${f}/${o.type}`},{...t(p.name),[f]:l.getState()}),a)}),l.devtools={cleanup:()=>{h&&typeof h.unsubscribe==`function`&&h.unsubscribe(),r(p.name,f)}};let v=(...e)=>{let t=_;_=!1,s(...e),_=t},y=e(l.setState,c,l);if(g.type===`untracked`?h?.init(y):(g.stores[g.store]=l,h?.init(Object.fromEntries(Object.entries(g.stores).map(([e,t])=>[e,e===g.store?y:t.getState()])))),l.dispatchFromDevtools&&typeof l.dispatch==`function`){let e=l.dispatch;l.dispatch=(...t)=>{e(...t)}}return h.subscribe(e=>{switch(e.type){case`ACTION`:if(typeof e.payload!=`string`){console.error(`[zustand devtools middleware] Unsupported action format`);return}return o(e.payload,e=>{if(e.type===`__setState`){if(f===void 0){v(e.state);return}Object.keys(e.state).length!==1&&console.error(` 3 [zustand devtools middleware] Unsupported __setState action format. 4 When using 'store' option in devtools(), the 'state' should have only one key, which is a value of 'store' that was passed in devtools(), 5 and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } } 6 `);let t=e.state[f];if(t==null)return;JSON.stringify(l.getState())!==JSON.stringify(t)&&v(t);return}l.dispatchFromDevtools&&typeof l.dispatch==`function`&&l.dispatch(e)});case`DISPATCH`:switch(e.payload.type){case`RESET`:return v(y),f===void 0?h?.init(l.getState()):h?.init(t(p.name));case`COMMIT`:if(f===void 0){h?.init(l.getState());return}return h?.init(t(p.name));case`ROLLBACK`:return o(e.state,e=>{if(f===void 0){v(e),h?.init(l.getState());return}v(e[f]),h?.init(t(p.name))});case`JUMP_TO_STATE`:case`JUMP_TO_ACTION`:return o(e.state,e=>{if(f===void 0){v(e);return}JSON.stringify(l.getState())!==JSON.stringify(e[f])&&v(e[f])});case`IMPORT_STATE`:{let{nextLiftedState:t}=e.payload,n=t.computedStates.slice(-1)[0]?.state;if(!n)return;v(f===void 0?n:n[f]),h?.send(null,t);return}case`PAUSE_RECORDING`:return _=!_}return}}),y},o=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error(`[zustand devtools middleware] Could not parse the received json`,e)}n!==void 0&&t(n)};function s(e,t){let n;try{n=e()}catch{return}return{getItem:e=>{let r=e=>e===null?null:JSON.parse(e,t?.reviver),i=n.getItem(e)??null;return i instanceof Promise?i.then(r):r(i)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,t?.replacer)),removeItem:e=>n.removeItem(e)}}var c=e=>t=>{try{let n=e(t);return n instanceof Promise?n:{then(e){return c(e)(n)},catch(e){return this}}}catch(e){return{then(e){return this},catch(t){return c(t)(e)}}}},l=(e,t)=>(n,r,i)=>{let a={storage:s(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1,l=new Set,u=new Set,d=a.storage;if(!d)return e((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...e)},r,i);let f=()=>{let e=a.partialize({...r()});return d.setItem(a.name,{state:e,version:a.version})},p=i.setState;i.setState=(e,t)=>(p(e,t),f());let m=e((...e)=>(n(...e),f()),r,i);i.getInitialState=()=>m;let h,g=()=>{if(!d)return;
6o=!1,l.forEach(e=>e(r()??m));let e=a.onRehydrateStorage?.call(a,r()??m)||void 0;return c(d.getItem.bind(d))(a.name).then(e=>{if(e){if(typeof e.version==`number`&&e.version!==a.version){if(a.migrate){let t=a.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}console.error(`State loaded from storage couldn't be migrated since no migrate function was provided`)}else return[!1,e.state]}return[!1,void 0]}).then(e=>{let[t,i]=e;if(h=a.merge(i,r()??m),n(h,!0),t)return f()}).then(()=>{e?.(h,void 0),h=r(),o=!0,u.forEach(e=>e(h))}).catch(t=>{e?.(void 0,t)})};return i.persist={setOptions:e=>{a={...a,...e},e.storage&&(d=e.storage)},clearStorage:()=>{d?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>g(),hasHydrated:()=>o,onHydrate:e=>(l.add(e),()=>{l.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},a.skipHydration||g(),h||m};export{l as n,a as t};
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.