import{A as v,d as y,aA as M,r as x,g as I,i as _,j as e,B as l,T as $,jG as P,P as k,jH as S,a as T,jI as A,jJ as B}from"./index-c3f592b2.js";import{I as E,R as O}from"./index-249d5641.js";import{A as R}from"./index-ce223ada.js";import{T as L,a as U}from"./Tabs-74ee5bca.js";import"./AntdIcon-b07622f5.js";import"./objectSpread2-890c3efa.js";import"./index-78da10f4.js";import"./FilterFilled-90800ccd.js";import"./FilterOutlined-c55dda18.js";import"./InfoCircleOutlined-1893865d.js";import"./SolutionOutlined-93433346.js";import"./index.esm-70dd1c06.js";import"./yup-abb4a026.js";import"./SelectComponent-bc0fff79.js";import"./createClass-c7973e27.js";import"./TextField-7d0d5009.js";import"./Select-9d10c4ab.js";import"./Grow-f61cc5ca.js";import"./isMuiElement-43203123.js";import"./Checkbox-38171bff.js";import"./SwitchBase-38103115.js";import"./TextArea-674a9ec6.js";import"./Avatar-2bf7675d.js";import"./Delete-006e7b7d.js";import"./ScrollableList-ecbfc0f3.js";import"./Container-f8aa2e8b.js";import"./ListItem-06b4e285.js";import"./ListItemText-f275f62e.js";import"./listItemTextClasses-3ff99335.js";import"./DialogContent-b7fc1c43.js";import"./DialogTitle-5d3e2030.js";import"./DialogContentText-c3e782dc.js";import"./DialogActions-6e00f4f1.js";import"./LoadingButton-69b28388.js";import"./Divider-057a9865.js";import"./dividerClasses-03c42ea7.js";import"./KeyboardArrowRight-8b3fa289.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(),j=y(),{id:f,tab:n}=M(),C=`${c}.${i}`;return x.useEffect(()=>{j(I({showMobileMenu:!1})),j(_({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(R,{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,h)=>{const g=E[p.icon];return e.jsx(U,{icon:g?e.jsx(g,{style:{fontSize:16}}):e.jsx(O,{style:{fontSize:16}}),onClick:()=>u(f||"",h,(p==null?void 0:p.url)||""),iconPosition:"start",label:p.label,...D(h)},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,{})})})]})})})},_e=()=>{const o=v(),a=y(),{id:r,tab:t,tenderId:c}=M(),{workOrder:{selectedData:i},system:{projectsMenuItemsList:m,userAccessList:b}}=T(s=>A(s));return x.useEffect(()=>{a(I({showMobileMenu:!1})),a(_({code:"MENU0011",from:"projectsmenu"}))},[]),x.useEffect(()=>{r&&a(B({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{_e as default};
