import{j as o,C as r}from"./index-B1H8BCL7.js";import{D as a,E as i,F as n,G as s}from"./stockApi-D1nxeMJU.js";import{M as d}from"./MasterCrudPage-CDZ3AmII.js";import"./Add-DvXlrcIU.js";import"./EditOutlined-DJ1zS7Rv.js";import"./DeleteOutline-DENqzAfR.js";import"./Search-B5Qac1u3.js";import"./snackbarUtils-DGP0fyXd.js";import"./DialogBox-CKrZZv0I.js";import"./Close-CR51dqFW.js";import"./Stack-BIAbaqpj.js";import"./useThemeProps-DL_l3A7P.js";import"./InputAdornment-BMBVR6Ec.js";import"./TableContainer-CXAjhAg6.js";import"./TableRow-BfKE_xn9.js";import"./TableCell-D8CotAsC.js";import"./Grid-CTEl0Elf.js";const c={MAIN:{bg:"#eff6ff",fg:"#1d4ed8"},DEPARTMENT:{bg:"#ecfdf5",fg:"#059669"},IN_TRANSIT:{bg:"#fef3c7",fg:"#b45309"}},l=[{key:"code",header:"Code",width:140},{key:"name",header:"Name"},{key:"locationKind",header:"Kind",width:130,format:e=>{const t=c[e]??{bg:"#f1f5f9",fg:"#475569"};return e?o.jsx(r,{size:"small",label:e.replaceAll("_"," "),sx:{height:20,fontSize:"0.65rem",fontWeight:700,backgroundColor:t.bg,color:t.fg,borderRadius:"6px"}}):"—"}},{key:"parentLocationId",header:"Parent #",width:100,align:"right"}],m=[{key:"code",label:"Code",required:!0,helperText:"Branch-unique. e.g. DEPT_BIOCHEM, COLD_ROOM_1"},{key:"name",label:"Name",required:!0},{key:"locationKind",label:"Kind",required:!0,helperText:"MAIN / DEPARTMENT / IN_TRANSIT"},{key:"parentLocationId",label:"Parent Location ID",type:"number",helperText:"Optional. For sub-locations."}],p={code:"",name:"",locationKind:"DEPARTMENT",parentLocationId:null,active:!0},A=()=>o.jsx(d,{title:"Store Locations",subtitle:"Branch-scoped. Each branch auto-seeds MAIN_STORE + IN_TRANSIT — those two are protected from rename / disable. Add DEPT_BIOCHEM, COLD_ROOM_1, etc. as DEPARTMENT kind.",hooks:{useList:s,useCreate:n,useUpdate:i,useDeactivate:a},columns:l,formFields:m,defaultRow:p,searchKeys:["code","name"]});export{A as default};
