{"version":3,"file":"tenantStore.mjs","names":["create","devtools","TenantTypeEnums","TenantView","tenantId","name","tenantType","theme","TenantState","currentTenant","setCurrentTenant","isProductTenant","useTenantStore","set","state","Product"],"sources":["../../src/stores/tenantStore.ts"],"sourcesContent":["import { create } from 'zustand';\nimport { devtools } from 'zustand/middleware';\nimport { TenantTypeEnums } from '../enums/unitySystemEnums';\n\ninterface TenantView {\n  tenantId: string;\n  name: string | null | undefined;\n  tenantType: TenantTypeEnums;\n  theme?: string | null;\n}\n\ninterface TenantState {\n  currentTenant: TenantView | null | undefined;\n  setCurrentTenant: (currentTenant: TenantView) => void;\n  isProductTenant: boolean;\n}\n\nexport const useTenantStore: () => TenantState = create<TenantState>()(\n  devtools((set) => ({\n    currentTenant: null,\n    setCurrentTenant: (currentTenant: TenantView) =>\n      set((state) => {\n        const isProductTenant =\n          currentTenant?.tenantType === TenantTypeEnums.Product;\n        return { currentTenant, isProductTenant };\n      }),\n    isProductTenant: false\n  }))\n);\n"],"mappings":";;;;AAiBA,MAAaY,iBAAoCZ,QAAqB,CACpEC,UAAUY,SAAS;CACjBJ,eAAe;CACfC,mBAAmBD,kBACjBI,KAAKC,UAAU;AAGb,SAAO;GAAEL;GAAeE,iBADtBF,eAAeH,eAAeJ,gBAAgBa;GACP;GACzC;CACJJ,iBAAiB;CAClB,EACH,CAAC"}