class StoreConstructor{constructor(views){this.views=views;this.store={state:this.getStore_state(),mutations:this.getStore_mutations(),getters:this.getStore_getters(),actions:this.getStore_actions(),};}
getStore_state(){return{views:this.views,objects:{},sandbox:{},filters:{},selections:{},widgets:{},};}
getStore_mutations(){return{setQuerySet(state,obj){state.objects[obj.url]=obj.queryset;},deleteQuerySet(state,obj){delete state.objects[obj.url];},setSelection(state,url){state.selections[url]={};},toggleSelectionValue(state,obj){if(state.selections[obj.url][obj.id]==undefined){state.selections[obj.url][obj.id]=true;}else{state.selections[obj.url][obj.id]=!state.selections[obj.url][obj.id];}
state.selections={...state.selections};},setSelectionValuesByIds(state,obj){state.selections[obj.url]=$.extend(true,{},state.selections[obj.url],obj.ids);state.selections={...state.selections};},setViewFieldValue(state,obj){state[obj.store][obj.url].cache.data[obj.field]=obj.value;state[obj.store][obj.url].cache.data={...state[obj.store][obj.url].cache.data};},setViewInstanceData(state,obj){state[obj.store][obj.url].cache.data=obj.data;state[obj.store][obj.url].cache.data={...state[obj.store][obj.url].cache.data};},setQuerySetInSandBox(state,obj){state.sandbox[obj.url]=obj.queryset;},deleteQuerySetFromSandBox(state,obj){delete state.sandbox[obj.url];},setFilters(state,obj){state.filters[obj.url]={cache:{data:obj.filters,}};},setWidgets(state,obj){state.widgets[obj.url]=obj.data;},};}
getStore_getters(){return{getViews:state=>{return state.views;},getView:state=>path=>{return state.views[path];},getQuerySet:state=>url=>{return state.objects[url];},getSelections:state=>url=>{return state.selections[url];},getSelectionById:state=>obj=>{return state.selections[obj.url][obj.id];},getViewFieldValue:state=>obj=>{return state[obj.store][obj.url].cache.data[obj.field];},getViewInstanceData:state=>obj=>{return state[obj.store][obj.url].cache.data;},getQuerySetFromSandBox:state=>url=>{return state.sandbox[url];},getFilters:state=>url=>{return state.filters[url];},getWidgets:state=>url=>{return state.widgets[url];},};}
getStore_actions(){return{};}
getStore(){return new Vuex.Store(this.store);}}