"use strict";(self.webpackChunkcentreon=self.webpackChunkcentreon||[]).push([["2847"],{37524:function(e,t,n){n.r(t),n.d(t,{Provider:()=>u.zt,atom:()=>r.cn,createStore:()=>r.MT,getDefaultStore:()=>r.K7,useAtom:()=>u.KO,useAtomValue:()=>u.Dv,useSetAtom:()=>u.b9,useStore:()=>u.oR});var r=n(85045),u=n(36871)},36871:function(e,t,n){n.d(t,{Dv:()=>v,KO:()=>p,b9:()=>h,oR:()=>l,zt:()=>s});var r=n(69971),u=n(85045);let o=(0,r.createContext)(void 0),l=e=>{let t=(0,r.useContext)(o);return(null==e?void 0:e.store)||t||(0,u.K7)()},s=({children:e,store:t})=>{let n=(0,r.useRef)(void 0);return t||n.current||(n.current=(0,u.MT)()),(0,r.createElement)(o.Provider,{value:t||n.current},e)},a=e=>"function"==typeof(null==e?void 0:e.then),i=e=>{e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t})},c=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;if("rejected"===e.status)throw e.reason;throw i(e),e}),f=new WeakMap,d=e=>{let t=f.get(e);return t||(t=new Promise((n,r)=>{let u=e,o=e=>t=>{u===e&&n(t)},l=e=>t=>{u===e&&r(t)},s=e=>{"onCancel"in e&&"function"==typeof e.onCancel&&e.onCancel(r=>{if(r===e)throw Error("[Bug] p is not updated even after cancelation");a(r)?(f.set(r,t),u=r,r.then(o(r),l(r)),s(r)):n(r)})};e.then(o(e),l(e)),s(e)}),f.set(e,t)),t};function v(e,t){let n=l(t),[[u,o,s],f]=(0,r.useReducer)(t=>{let r=n.get(e);return Object.is(t[0],r)&&t[1]===n&&t[2]===e?t:[r,n,e]},void 0,()=>[n.get(e),n,e]),v=u;(o!==n||s!==e)&&(f(),v=n.get(e));let h=null==t?void 0:t.delay;return((0,r.useEffect)(()=>{let t=n.sub(e,()=>{if("number"==typeof h){let t=n.get(e);a(t)&&i(d(t)),setTimeout(f,h);return}f()});return f(),t},[n,e,h]),(0,r.useDebugValue)(v),a(v))?c(d(v)):v}function h(e,t){let n=l(t);return(0,r.useCallback)((...t)=>{if(!("write"in e))throw Error("not writable atom");return n.set(e,...t)},[n,e])}function p(e,t){return[v(e,t),h(e,t)]}}}]);
//# sourceMappingURL=2847.14c6a0ffee462c76.b9f3c476dc004fe9.2e0808560de9b2c0.js.map