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 $,ia as P,P as k,ib as S,a as T,ic as B,id as E}from"./index-7b9530f9.js";import{I as O,R}from"./index-fa74e94c.js";import{A as z}from"./index-f583b8f3.js";import{T as A,a as L}from"./Tabs-d9c2813a.js";import"./AntdIcon-682f2518.js";import"./objectSpread2-12329e58.js";import"./index-1f83e1d2.js";import"./index-e5978b8b.js";import"./FilterFilled-70c51a7c.js";import"./FilterOutlined-ae23dbc1.js";import"./InfoCircleOutlined-7b2d51dc.js";import"./SolutionOutlined-2052de7c.js";import"./index.esm-9b014892.js";import"./yup-07ccc04e.js";import"./SelectComponent-6479c32c.js";import"./createClass-b83ea73b.js";import"./TextField-a16050c5.js";import"./Select-71d7c76c.js";import"./Grow-ac96e569.js";import"./isMuiElement-a5b21fef.js";import"./Checkbox-635c9303.js";import"./SwitchBase-d816118b.js";import"./TextArea-d5cded1f.js";import"./Avatar-c3796022.js";import"./Delete-cabc3677.js";import"./ScrollableList-a1f8f012.js";import"./CircularProgress-ad60dd95.js";import"./Container-e8225976.js";import"./ListItem-0e77aded.js";import"./ListItemText-fb27512e.js";import"./listItemTextClasses-e5cedc04.js";import"./DialogContent-f3059d44.js";import"./DialogTitle-880d15fb.js";import"./DialogContentText-f1aa6d98.js";import"./DialogActions-83e50cce.js";import"./LoadingButton-c542431a.js";import"./composeClasses-b42b2e69.js";import"./Divider-1817c9fa.js";import"./dividerClasses-be6617be.js";import"./KeyboardArrowRight-8531b083.js";function U(o){const{children:s,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:s})})}function W(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const D=({menuCode:o,fromScreen:s,callback:r,data:t,app_label:c,model_name:i,goBackUrl:m,assignUserCallback:b,headerContent:a,tabsData:d,onTabClick:u})=>{const w=v(),f=y(),{id:h,tab:n}=M(),C=`${c}.${i}`;return x.useEffect(()=>{f(_({showMobileMenu:!1})),f(I({code:o,from:s}))},[]),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:h||"",modal_path:C,callback:b}),a&&a]})]}),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,j)=>{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(h||"",j,(p==null?void 0:p.url)||""),iconPosition:"start",label:p.label,...W(j)},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,{})})})]})})})},$e=()=>{const o=v(),s=y(),{id:r,tab:t,tenderId:c}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:m,userAccessList:b}}=T(a=>B(a));return x.useEffect(()=>{s(_({showMobileMenu:!1})),s(I({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&s(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(a=>!(!(i!=null&&i.is_performace_bank_guarantee)&&a.url==="/project/performance_bank_guarantee"))],onTabClick:(a,d,u)=>{o(`/work_order/view/${a}/${d}${u}`)}})})};export{$e as default};
