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 $,ig as P,P as k,ih as S,a as T,ii as B,ij as E}from"./index-c121b02d.js";import{I as O,R}from"./index-f2b525d0.js";import{A as z}from"./index-88dd53ce.js";import{T as A,a as L}from"./Tabs-e031f9f3.js";import"./AntdIcon-28682171.js";import"./objectSpread2-d754d5ed.js";import"./index-2d756126.js";import"./index-e5978b8b.js";import"./FilterFilled-a045b23e.js";import"./FilterOutlined-2ca7e07d.js";import"./InfoCircleOutlined-a357e936.js";import"./SolutionOutlined-33f59577.js";import"./index.esm-0c6778ff.js";import"./yup-1361ecb6.js";import"./SelectComponent-3fc34547.js";import"./createClass-66eb0661.js";import"./TextField-f9d2a024.js";import"./Select-dd7adaf8.js";import"./Grow-9a484472.js";import"./isMuiElement-d52f64c2.js";import"./Checkbox-a6136302.js";import"./SwitchBase-9f520d13.js";import"./TextArea-dfbfc4f6.js";import"./Avatar-da325e72.js";import"./Delete-00bd797b.js";import"./ScrollableList-dc408f1e.js";import"./CircularProgress-fa872e62.js";import"./Container-c454d189.js";import"./ListItem-2f74971c.js";import"./ListItemText-aa4fc0a3.js";import"./listItemTextClasses-27b4ea1b.js";import"./DialogContent-caa035c8.js";import"./DialogTitle-9f04a88b.js";import"./DialogContentText-e68ec1be.js";import"./DialogActions-1901dd11.js";import"./LoadingButton-66be9360.js";import"./composeClasses-b42b2e69.js";import"./Divider-6da4bf5c.js";import"./dividerClasses-81752629.js";import"./KeyboardArrowRight-87bf88d8.js";function U(o){const{children:a,value:r,index:t,...m}=o;return e.jsx("div",{role:"tabpanel",hidden:r!==t,id:`simple-tabpanel-${t}`,"aria-labelledby":`simple-tab-${t}`,...m,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:m,model_name:i,goBackUrl:c,assignUserCallback:b,headerContent:s,tabsData:d,onTabClick:u})=>{const w=v(),h=y(),{id:f,tab:n}=M(),C=`${m}.${i}`;return x.useEffect(()=>{h(_({showMobileMenu:!1})),h(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(c,{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,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(f||"",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(),a=y(),{id:r,tab:t,tenderId:m}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:c,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:c&&[{key:"project_details",label:"Details",icon:"DashboardOutlined",url:"/",urlParams:{id:r}},...c.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{$e as default};
