import{z as v,d as y,az as M,r as x,g as _,i as I,j as e,B as l,T as $,j1 as P,P as k,j2 as S,a as T,j3 as B,j4 as E}from"./index-952e178b.js";import{I as O,R}from"./index-ff1099c3.js";import{A as z}from"./index-114ce137.js";import{T as A,a as L}from"./Tabs-1d1e6950.js";import"./AntdIcon-54006664.js";import"./objectSpread2-a71852a2.js";import"./index-22eb3e7f.js";import"./index-e5978b8b.js";import"./FilterFilled-1ab4da14.js";import"./FilterOutlined-95879914.js";import"./InfoCircleOutlined-337262c5.js";import"./SolutionOutlined-d604bcd7.js";import"./index.esm-6feddb16.js";import"./yup-d92565dd.js";import"./SelectComponent-16c4ed7a.js";import"./createClass-5a32667f.js";import"./TextField-d1a887ff.js";import"./Select-41d78585.js";import"./isMuiElement-f03a71e4.js";import"./Checkbox-6c7c4dc0.js";import"./SwitchBase-bd5cc4c6.js";import"./TextArea-ce7716c9.js";import"./Avatar-d2c68597.js";import"./Delete-ecf133a8.js";import"./ScrollableList-cd5816a8.js";import"./CircularProgress-3b605689.js";import"./Container-198d6c5c.js";import"./ListItem-0cf1ccac.js";import"./ListItemText-16e87975.js";import"./listItemTextClasses-ca40551b.js";import"./DialogContent-4facb916.js";import"./DialogTitle-3aa960f8.js";import"./DialogContentText-54d95680.js";import"./DialogActions-bd200b72.js";import"./LoadingButton-404f8a68.js";import"./composeClasses-b42b2e69.js";import"./Divider-342f1cfc.js";import"./dividerClasses-8e897c94.js";import"./KeyboardArrowRight-c3d685e2.js";function U(o){const{children:a,value:r,index:t,...c}=o;return e.jsx("div",{role:"tabpanel",hidden:r!==t,id:`simple-tabpanel-${t}`,"aria-labelledby":`simple-tab-${t}`,...c,children:r===t&&e.jsx(l,{mt:2,children:a})})}function W(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const D=({menuCode:o,fromScreen:a,callback:r,data:t,app_label:c,model_name:i,goBackUrl:m,assignUserCallback:b,headerContent:s,tabsData:d,onTabClick:u})=>{const w=v(),j=y(),{id:f,tab:n}=M(),C=`${c}.${i}`;return x.useEffect(()=>{j(_({showMobileMenu:!1})),j(I({code:o,from:a}))},[]),e.jsx(e.Fragment,{children:e.jsx(l,{sx:{width:"100%"},children:e.jsxs(l,{sx:{mt:1},children:[e.jsxs(l,{sx:{py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[e.jsxs($,{variant:"h4",sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",fontWeight:"500"},onClick:()=>{w(m,{relative:"path"})},children:[e.jsx(P,{size:24}),`${t==null?void 0:t.code}`]}),e.jsxs(l,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(z,{instance_id:f||"",modal_path:C,callback:b}),s&&s]})]}),e.jsx(l,{sx:{borderColor:"divider",mt:1},children:e.jsx(k,{sx:{boxShadow:"none",borderRadius:"10px",pb:"10px",pt:"3px"},children:e.jsx(A,{value:n?+n:0,sx:{".MuiButtonBase-root":{m:0,p:0},".MuiTabs-flexContainer":{p:0,m:0,px:0,gap:"0px"},".MuiTab-root":{minHeight:"18px",padding:"12px !important",minWidth:"18px !important",boxShadow:"none",borderRadius:"6px",mt:"5px"}},"aria-label":"scrollable auto tabs example",variant:"scrollable",scrollButtons:"auto",children:d&&d.map((p,h)=>{const g=O[p.icon];return e.jsx(L,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(R,{style:{fontSize:16}}),onClick:()=>u(f||"",h,(p==null?void 0:p.url)||""),iconPosition:"start",label:p.label,...W(h)},p.key)})})})}),e.jsx(U,{value:n?+n:0,index:n?+n:0,children:e.jsx(k,{variant:"elevation",sx:{p:2,borderRadius:"10px"},children:e.jsx(S,{})})})]})})})},Ce=()=>{const o=v(),a=y(),{id:r,tab:t,tenderId:c}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:m,userAccessList:b}}=T(s=>B(s));return x.useEffect(()=>{a(_({showMobileMenu:!1})),a(I({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&a(E({id:r||""}))},[r]),e.jsx(e.Fragment,{children:e.jsx(D,{menuCode:"MENU0011",fromScreen:"projectsmenu",data:i,app_label:"ProjectManagement",model_name:"project",goBackUrl:"/work_order",assignUserCallback:()=>{},tabsData:m&&[{key:"project_details",label:"Details",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...m.filter(s=>!(!(i!=null&&i.is_performace_bank_guarantee)&&s.url==="/project/performance_bank_guarantee"))],onTabClick:(s,d,u)=>{o(`/work_order/view/${s}/${d}${u}`)}})})};export{Ce as default};
