import{k as v,d as y,ak as M,r as x,g as _,i as I,j as e,B as l,T as $,hi as P,P as k,hj as S,a as T,hk as B,hl as E}from"./index-4dfc510b.js";import{I as O,R}from"./index-ab5f5c27.js";import{A}from"./index-bb89f204.js";import{T as L,a as U}from"./Tabs-8a7a208d.js";import"./AntdIcon-90a37458.js";import"./objectSpread2-66550f90.js";import"./index-9a385720.js";import"./index-e5978b8b.js";import"./FilterFilled-dc66781c.js";import"./FilterOutlined-6c52d192.js";import"./InfoCircleOutlined-7cf818df.js";import"./SolutionOutlined-20d5a854.js";import"./index.esm-0a454763.js";import"./yup-80def618.js";import"./SelectComponent-bfde3322.js";import"./TextField-c0d4022e.js";import"./Menu-0f556e12.js";import"./Grow-a7315f12.js";import"./isMuiElement-7be61a21.js";import"./Select-c8503f85.js";import"./TextArea-a0cc14f3.js";import"./Avatar-dec2611f.js";import"./Delete-b999d5b7.js";import"./ScrollableList-bef4a518.js";import"./CircularProgress-d36b5e75.js";import"./Container-0197d02a.js";import"./ListItem-af6558ef.js";import"./ListItemText-08043c6e.js";import"./listItemTextClasses-e85f7ff0.js";import"./DialogContent-3bf4ff27.js";import"./DialogTitle-248b1818.js";import"./DialogContentText-a6ab23a2.js";import"./DialogActions-49286e71.js";import"./LoadingButton-09ba23cd.js";import"./composeClasses-b42b2e69.js";import"./Divider-1794f57d.js";import"./dividerClasses-26c2a6d6.js";import"./KeyboardArrowRight-605c8352.js";function W(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 D(o){return{id:`simple-tab-${o}`,"aria-controls":`simple-tabpanel-${o}`}}const z=({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(),h=y(),{id:f,tab:n}=M(),C=`${c}.${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(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(A,{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(L,{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(U,{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,...D(j)},p.key)})})})}),e.jsx(W,{value:n?+n:0,index:n?+n:0,children:e.jsx(k,{variant:"elevation",sx:{p:2,borderRadius:"10px"},children:e.jsx(S,{})})})]})})})},we=()=>{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(z,{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{we as default};
