import{z as y,d as v,az as M,r as x,g as _,i as I,j as e,B as l,T as $,jy as P,P as k,jz as S,a as T,jA as B,jB as E}from"./index-e79f7aad.js";import{I as z,R as A}from"./index-af2d2f26.js";import{A as O}from"./index-9b4f512f.js";import{T as R,a as L}from"./Tabs-37ab2641.js";import"./AntdIcon-1cfbd840.js";import"./objectSpread2-d56e1476.js";import"./index-310d07a1.js";import"./index-e5978b8b.js";import"./FilterFilled-8d538f67.js";import"./FilterOutlined-c331cda0.js";import"./InfoCircleOutlined-be2aa973.js";import"./SolutionOutlined-9eea2c79.js";import"./index.esm-1ca67d65.js";import"./yup-96f14780.js";import"./SelectComponent-1ba596ac.js";import"./createClass-b86a4c8d.js";import"./TextField-21e22d39.js";import"./Select-8a61e5a6.js";import"./isMuiElement-db2b7d4c.js";import"./Checkbox-b895334d.js";import"./SwitchBase-e7cea42d.js";import"./TextArea-ec29d1d5.js";import"./Avatar-b1f10e62.js";import"./Delete-9842b85d.js";import"./ScrollableList-5929779e.js";import"./CircularProgress-8c35778c.js";import"./Container-4c26fb0d.js";import"./ListItem-b45414cf.js";import"./ListItemText-f54fc7e4.js";import"./listItemTextClasses-d3a968ad.js";import"./DialogContent-6a297cef.js";import"./DialogTitle-62595023.js";import"./DialogContentText-0c5306f9.js";import"./DialogActions-edd1d02f.js";import"./LoadingButton-2d3ef2e0.js";import"./composeClasses-b42b2e69.js";import"./Divider-d5c2dff6.js";import"./dividerClasses-691b251c.js";import"./KeyboardArrowRight-4ee9435c.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=y(),j=v(),{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(O,{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(R,{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=z[p.icon];return e.jsx(L,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(A,{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=y(),a=v(),{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};
