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 $,i1 as P,P as k,i2 as S,a as T,i3 as B,i4 as E}from"./index-458d5762.js";import{I as O,R}from"./index-168a5ebe.js";import{A as z}from"./index-6d6b2eb0.js";import{T as A,a as L}from"./Tabs-94de5040.js";import"./AntdIcon-99e065a0.js";import"./objectSpread2-cbe250a0.js";import"./index-3b6e321a.js";import"./index-e5978b8b.js";import"./FilterFilled-c223055e.js";import"./FilterOutlined-41555a07.js";import"./InfoCircleOutlined-a8254853.js";import"./SolutionOutlined-82483a67.js";import"./index.esm-b1b14098.js";import"./yup-536c503d.js";import"./SelectComponent-ac261e08.js";import"./createClass-9305c513.js";import"./TextField-e297d925.js";import"./Select-1c8a1710.js";import"./Grow-1b19ccc0.js";import"./isMuiElement-6ed6867f.js";import"./Checkbox-2fec2521.js";import"./SwitchBase-1c31939b.js";import"./TextArea-233680fc.js";import"./Avatar-1668c365.js";import"./Delete-ffb8ed30.js";import"./ScrollableList-ba92364a.js";import"./CircularProgress-cad31cee.js";import"./Container-da330c6e.js";import"./ListItem-1273a0aa.js";import"./ListItemText-ae223d0d.js";import"./listItemTextClasses-04d37f34.js";import"./DialogContent-2b2d5db0.js";import"./DialogTitle-bda4183d.js";import"./DialogContentText-f6501c39.js";import"./DialogActions-38a5ba62.js";import"./LoadingButton-e2205495.js";import"./composeClasses-b42b2e69.js";import"./Divider-41f4fe7b.js";import"./dividerClasses-eff9af63.js";import"./KeyboardArrowRight-d389d7f9.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(),f=y(),{id:h,tab:n}=M(),C=`${m}.${i}`;return x.useEffect(()=>{f(_({showMobileMenu:!1})),f(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:h||"",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(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(),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};
