import{F as S,b as _,eh as g,ei as v,a as w,fv as j,r as n,f as M,i as b,fw as C,ej as x,j as o,S as z,K as k}from"./index-76d4793e.js";import{S as E}from"./SideMenuDetailLayout-40bcd75f.js";import"./index-65d3234b.js";import"./index.esm-3adfd9f7.js";import"./index.esm-ad8a7c9f.js";import"./yup-688ec4f6.js";import"./SelectComponent-3c1140e6.js";import"./objectSpread2-51b6810f.js";import"./floating-ui.dom-e7d69f3b.js";import"./InputLabel-5ed57f0e.js";import"./useFormControl-c8d490e1.js";import"./TextArea-f4ef1e8b.js";import"./TextField-9c64a4a2.js";import"./FormControl-c671c595.js";import"./OutlinedInput-ac933786.js";import"./List-4c24b3e8.js";import"./Select-338083eb.js";import"./Menu-ed7c6894.js";import"./Grow-84b30c0e.js";import"./useControlled-e03384de.js";import"./createSvgIcon-01ec10fc.js";import"./AvatarGroup-95c17048.js";import"./Avatar-ff1026d1.js";import"./Tooltip-0a59b9eb.js";import"./ScrollableList-4dae3697.js";import"./Loader-9f443a4c.js";import"./CardContent-2f10f9e9.js";import"./Chip-456ce28e.js";import"./DialogContent-7bd8dd8f.js";import"./DialogTitle-71dd5b3a.js";import"./LoadingButton-89ba2db7.js";import"./index-ecea5cfc.js";import"./useMediaQuery-8cb39c65.js";import"./composeClasses-b42b2e69.js";import"./useToggle-025d2f61.js";import"./useViewPort-c21c3885.js";import"./index-f75e50cb.js";import"./AntdIcon-55dc1b5f.js";import"./FilterFilled-aa7d40e4.js";import"./FilterOutlined-91aa15e3.js";import"./InfoCircleOutlined-c8b96a94.js";import"./SolutionOutlined-533d9063.js";const ge=()=>{const p=S(),a=_(),{id:r,tab:T}=g(),{tenders:{selectedData:t},system:{tenderMenuItemsList:m,userAccessList:s}}=v(),{caseSheet:{caseSheetList:c,pageParams:l}}=w(e=>j(e)),[h,f]=n.useState(!1);return n.useEffect(()=>{a(M({showMobileMenu:!1})),a(b({code:"MENU0009",from:"tendermenu"})),a(C({...l,search:"",page:1,page_size:10,tender:r}))},[]),n.useEffect(()=>{r&&a(x({id:r||""}))},[r]),o.jsx(o.Fragment,{children:o.jsx(E,{menuCode:"MENU0009",fromScreen:"tendermenu",data:t,app_label:"TenderManagement",model_name:"tender",goBackUrl:"/tenders",assignUserCallback:e=>{f((e==null?void 0:e.length)>0)},tabsData:m&&[{key:"overview",label:"Over View",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...m.filter(e=>{var i;return!(t.authorized_status!==2&&t.authorized_status!==5&&e.url!=="/tender_items"||!((i=t==null?void 0:t.is_reverse_auction)!=null&&i.id)&&e.url==="/reverse_auction"||!h&&e.url==="/case_sheet"||!c.some(d=>d.authorized_status===4||d.authorized_status===2)&&e.url!=="/tender_items"&&e.url!=="/case_sheet")})],headerContent:o.jsx(z,{direction:"row",spacing:1,children:(s==null?void 0:s.indexOf("ProjectManagement.change_project"))!==-1&&t.authorized_status!=1&&t.authorized_status!=5&&o.jsx(k,{variant:"contained",size:"large",onClick:()=>{var e;p(`/work_order/${r}/${(e=t==null?void 0:t.project)==null?void 0:e.id}`)},children:"Convert To Project"})}),onTabClick:(e,u,i)=>{p(`/tenders/view/${e}/${u}${i}`)}})})};export{ge as default};
