import e from"@babel/runtime/helpers/slicedToArray";import{useEffect as t}from"react";import{scheduleIdleWork as r,cancelIdleWork as o}from"../cache-utils/idle-callback.js";import{STORAGE_KEY as a}from"./constants.js";import{validateEnvelope as i}from"./validateEnvelope.js";var n=function(n,s){t((function(){var t=s.current,m=r((function(){t.delete(m);try{var r=sessionStorage.getItem(a);if(!r)return;var o=JSON.parse(r),s=i(o);s&&Object.entries(s.state).forEach((function(t){var r=e(t,2),o=r[0],a=r[1];n.current.set(o,{wellIds:a,timestamp:s.timestamp})}))}catch(e){sessionStorage.removeItem(a)}}),{timeout:2e3});return t.add(m),function(){o(m),t.delete(m)}}),[n,s])};export{n as useTileCacheHydration};
//# sourceMappingURL=useTileCacheHydration.js.map
