import t from"@babel/runtime/helpers/defineProperty";import{createStore as e}from"zustand";import{BASE_DEFAULT_FILTERS as r}from"./types.js";import{createFilterCrudActions as i}from"./utils/createFilterCrudActions.js";import{createFilterResetActions as l}from"./utils/createFilterResetActions.js";import{createTempFilterActions as o}from"./utils/createTempFilterActions.js";import{createSelectionActions as n}from"./utils/createSelectionActions.js";function s(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,i)}return r}function u(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?s(Object(i),!0).forEach((function(r){t(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}var a=function(t){var s,a,c,f=u(u({},r),null!==(s=t.filters)&&void 0!==s?s:{}),p=u(u({},r),null!==(a=null!==(c=t.defaultFilters)&&void 0!==c?c:t.filters)&&void 0!==a?a:{}),d=e()((function(e,r){var s,a=function(t,r){e((function(e){return u(u({},t),{},{lastFilterMutationSource:r,filterMutationSeq:e.filterMutationSeq+1})}))};return u(u(u(u({wells:null,companies:[],canViewCompanies:null!==(s=t.canViewCompanies)&&void 0!==s&&s,isAllWellsLoaded:!1,isLoadAllWells:!1,segment:"drilling",filters:f,defaultFilters:p,tempFilters:{},lastFilterMutationSource:"external_sync",filterMutationSeq:0},i({get:r,setWithMutation:a})),l({get:r,setWithMutation:a,defaultFilters:p})),o({set:e,get:r})),n({get:r,setWithMutation:a}))})),m=d.getState().isAllWellsLoaded;return d.subscribe((function(t){if(!m&&t.isAllWellsLoaded)return m=!0,void t.pruneAllCascades();m=t.isAllWellsLoaded})),d};export{a as createFilterStore};
//# sourceMappingURL=createFilterStore.js.map
