"use strict";var __rest=this&&this.__rest||function(e,t){var o={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(o[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(r=Object.getOwnPropertySymbols(e);a<r.length;a++)t.indexOf(r[a])<0&&Object.prototype.propertyIsEnumerable.call(e,r[a])&&(o[r[a]]=e[r[a]])}return o};Object.defineProperty(exports,"__esModule",{value:!0}),exports.withStore=void 0;const jsx_runtime_1=require("react/jsx-runtime"),react_1=require("react"),jotai_1=require("jotai"),app_1=require("../jotai/app"),store_1=require("../jotai/store");function withStore(e){return t=>{var{portalOptions:o}=t,r=__rest(t,["portalOptions"]);const[a,i]=(0,jotai_1.useAtom)(app_1.layoutAtom),[l,s]=(0,jotai_1.useAtom)(app_1.collapsedSidebarAtom),{options:p,parser:n}=(0,jotai_1.useAtomValue)(store_1.globalStoreAtom);return(0,react_1.useEffect)((()=>{(null==o?void 0:o.layout)&&i(o.layout)}),[null==o?void 0:o.layout,i]),(0,react_1.useEffect)((()=>{"boolean"==typeof(null==o?void 0:o.collapsedSidebar)&&s(o.collapsedSidebar)}),[null==o?void 0:o.collapsedSidebar,s]),n?(0,jsx_runtime_1.jsx)(e,Object.assign({},r,{options:p,layout:a,collapsedSidebar:l,parser:n})):null}}exports.withStore=withStore;
//# sourceMappingURL=withStore.js.map