@asaleh37/ui-base 25.10.22 → 25.10.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("@mui/x-data-grid-premium"),t=require("react/jsx-runtime"),o=require("react-redux"),i=require("@fortawesome/fontawesome-svg-core"),r=require("@fortawesome/free-brands-svg-icons"),n=require("@fortawesome/free-regular-svg-icons"),a=require("@fortawesome/free-solid-svg-icons");require("react-toastify/dist/ReactToastify.css");var s=require("@mui/material"),l=require("@emotion/react"),d=require("react"),c=require("@mui/material/styles"),u=require("@mui/material/CssBaseline"),p=require("@mui/material/AppBar"),h=require("@mui/material/Toolbar"),m=require("@fortawesome/react-fontawesome"),f=require("@reduxjs/toolkit"),g=require("react-toastify"),T=require("axios"),A=require("i18next"),y=require("react-i18next"),I=require("react-hook-form"),_=require("react-router-dom"),E=require("@hookform/resolvers/zod"),O=require("zod"),C=require("@mui/material/List"),N=require("@mui/material/Card"),R=require("@mui/material/CardHeader"),b=require("@mui/material/ListItemText"),w=require("@mui/material/ListItemIcon"),S=require("@mui/material/Checkbox"),P=require("@mui/material/Button"),v=require("@mui/material/Divider"),L=require("@mui/x-date-pickers"),M=require("@mui/x-date-pickers/AdapterMoment"),x=require("moment"),D=require("@mui/material/CardActions"),k=require("@mui/material/CardContent"),U=require("@mui/material/CardMedia"),F=require("@mui/material/Typography"),B=require("@mui/lab"),q=require("@mui/x-tree-view/models"),j=require("@mui/x-charts"),G=require("@mui/material/LinearProgress"),W=require("@mui/material/Box"),H=require("@mui/x-charts/PieChart"),Y=require("@mui/material/IconButton"),K=require("@mui/material/Drawer"),V=require("@react-spring/web"),z=require("@mui/material/Collapse"),Q=require("@mui/x-tree-view/RichTreeView"),$=require("@mui/x-tree-view/TreeItem"),Z=require("@mui/x-tree-view/useTreeItem2"),J=require("@mui/x-tree-view/TreeItem2"),X=require("@mui/x-tree-view/TreeItem2Icon"),ee=require("@mui/x-tree-view/TreeItem2Provider"),te=require("@mui/x-tree-view/TreeItem2DragAndDropOverlay"),oe=require("stylis-plugin-rtl"),ie=require("stylis"),re=require("@emotion/cache"),ne=require("@emotion/styled"),ae=require("@mui/material/colors"),se=require("@mui/material/SwipeableDrawer"),le=require("@mui/x-license");function de(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var ce=de(d),ue=de(O);!function(e,t){void 0===t&&(t={});var o=t.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("html,\nbody {\n height: 100vh;\n margin: 0;\n padding: 0;\n}\n\n#root {\n height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n}\n\n.red-row {\n background-color: #f0d8d8;\n}\n");const pe=(e=768)=>{const[t,o]=d.useState(window.innerWidth<e);return d.useEffect(()=>{const t=()=>o(window.innerWidth<e);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t},he=350,me={themeMode:localStorage.getItem("themeMode")||"light",appDirection:"ar"==localStorage.getItem("language")?"rtl":"ltr"},fe=f.createSlice({name:"AppLayout",initialState:me,reducers:{setThemeMode:(e,t)=>{e.themeMode=t.payload},setAppDirection:(e,t)=>{e.appDirection=t.payload}}}),ge=fe.actions;var Te=fe.reducer;const Ae=f.createSlice({name:"loadingMask",initialState:{value:{isOpened:!1,message:null}},reducers:{showLoadingMask:(e,t)=>{e.value.isOpened=!0,e.value.message=t.payload},hideLoadingMask:e=>{e.value.isOpened=!1,e.value.message=null}}}),{showLoadingMask:ye,hideLoadingMask:Ie}=Ae.actions;var _e=Ae.reducer;const Ee=()=>{const e=o.useDispatch();return{show:t=>{e(ye(t))},hide:()=>{e(Ie())}}},Oe=f.createSlice({name:"UserSession",initialState:{value:{isAuthenticated:null,authorities:[]}},reducers:{setAuthenticated:(e,t)=>{e.value=t.payload},setUnAuthenticated:e=>{e.value={isAuthenticated:!1,authorities:[]}}}}),Ce=Oe.actions;var Ne=Oe.reducer;const Re=()=>{const e=Ee(),t=o.useDispatch(),i=o.useSelector(e=>e.AppInfo.value.apiBaseUrl),r=T.create({baseURL:i,timeout:6e5,withCredentials:!0});r.defaults.withCredentials=!0,r.interceptors.request.use(e=>{const t=localStorage.getItem("TOKEN");return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e)),r.interceptors.response.use(e=>e,e=>{if(e&&(e.response&&(e.response.status&&401===e.response.status)))t(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN"),g.toast.error("your session is now expired, you need to login again",{autoClose:!1});else if(e&&(e.response&&(e.response.status&&402===e.response.status)))t(Ce.setUnAuthenticated()),g.toast.error("Your license is missing or has expired,Please reach out to your vendor for assistance.");else if(e&&(e.response&&(e.response.status&&403===e.response.status)))g.toast.error("you aren't authorized to process this request");else if(e&&(e.response&&(e.response.status&&500===e.response.status)))if(e.response.data instanceof Blob){e.response.data.text().then(e=>{g.toast.error(e)})}else g.toast.error(e.response.data);else g.toast.error("failed to communicate with the server ... try again later");return"ERROR"});return{handleGetRequest:async t=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);const o=await r.get(t.endPointURI,{params:{...t.parameters},withCredentials:!0,headers:t.headers,responseType:t?.responseType});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},handlePostRequest:async t=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);let o=await r.post(t.endPointURI,t.data,{params:t.parameters,responseType:t?.responseType,headers:t?.headers});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},handleDeleteRequest:async t=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);let o=await r.delete(t.endPointURI,{params:{...t.parameters},responseType:t?.responseType,headers:t?.headers});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},HandleDownloadHTTPPostPDF:async(t={endPointURI:"",parameters:{},data:{}})=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);const o=await r.post(t.endPointURI,t.data,{responseType:"blob"});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},handleUploadRequest:async t=>{if(null===t.files||0===t.files.length)return g.toast.error("You must add files to upload"),"ERROR";const o=new FormData;for(const e of t.files)o.append("files",e);void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);let i=await r.post(t.endPointURI,o,{params:t?.parameters,headers:{"Content-Type":"multipart/form-data"}});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==i?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(i),i):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(i),"ERROR")}}},be=e=>{const[o,i]=d.useState(!1),{t:r}=y.useTranslation();return{ConfirmationWindow:()=>t.jsxs(s.Dialog,{open:o,children:[t.jsx(s.DialogTitle,{children:e.title}),t.jsx(s.DialogContent,{children:t.jsx(s.DialogContentText,{children:e.body})}),t.jsxs(s.DialogActions,{children:[t.jsx(s.Button,{variant:"contained",sx:{marginRight:2,marginLeft:2},color:"primary",onClick:()=>{i(!1)},children:r("NO_LABEL")}),t.jsx(s.Button,{variant:"contained",sx:{marginRight:2,marginLeft:2},color:"error",onClick:()=>{e.onConfirmationCallBk(),i(!1)},autoFocus:!0,children:r("YES_LABEL")})]})]}),open:o,setOpen:i}},we=()=>{const e=o.useSelector(e=>e.UserSession),t=e.value;return{UserSession:e,isUserAuthorized:t=>{if(e?.value?.authorities)for(let o of e.value.authorities){if("DEVELOPMENT_ADMIN"===t&&("DEVELOPMENT_ADMIN"===o?.authority||"ORGANIZATION_ADMIN"===o?.authority))return!0;if("ORGANIZATION_ADMIN"===t&&"ORGANIZATION_ADMIN"===o?.authority)return!0;if("DEVELOPMENT_ADMIN"!==t&&"ORGANIZATION_ADMIN"!==t&&("ORGANIZATION_ADMIN"===o?.authority||"DEVELOPMENT_ADMIN"===o?.authority||"SYSTEM_ADMIN"===o?.authority||o?.authority===t))return!0}return!1},isCurrentOrganizationAuthorizedToModule:e=>{if(t?.currentOrganization?.systemApplicationModules)for(const o of t.currentOrganization.systemApplicationModules)if(o.toLowerCase()==e.toLowerCase())return!0;return!1},UserInfo:t}},Se=e=>{const[i,r]=d.useState(!1),n=o.useSelector(e=>e.AppLayout.appDirection);return{windowState:i,setWindowState:r,Window:o=>t.jsx(s.Modal,{open:i,sx:{zIndex:e=>e.zIndex.drawer},onClose:()=>{!i&&e?.onCloseCallBack&&e.onCloseCallBack()},children:t.jsxs(s.Box,{dir:n,sx:{position:"absolute",top:"50%",left:"50%",maxHeight:"90%",transform:"translate(-50%, -50%)",height:e?.height||"80%",width:e?.width||"90%",minWidth:e.minWidth||400,minHeight:e.minHeight||200,overflow:"hidden",bgcolor:"modalBackground.main",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start"},children:[t.jsx(s.AppBar,{position:"static",children:t.jsxs(s.Toolbar,{variant:"dense",children:[t.jsx(m.FontAwesomeIcon,{icon:e?.windowIcon||"window-maximize",style:{marginRight:5}}),t.jsx(s.Typography,{variant:"h6",color:"inherit",component:"div",children:e?.windowTitle||"window"}),t.jsx("div",{style:{flexGrow:1}}),t.jsx(s.IconButton,{onClick:()=>{r(!1),null!=e.onCloseCallBack&&null!=e.onCloseCallBack&&e.onCloseCallBack()},color:"secondary",children:t.jsx(m.FontAwesomeIcon,{icon:"xmark-square"})})]})}),t.jsx(s.Paper,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"100%",padding:1,overflow:"hidden"},children:o?.children})]})})}},Pe=f.createSlice({name:"commonStores",initialState:{stores:{},storeKeys:[]},reducers:{setStoresMetaData:(e,t)=>{e.stores=t.payload,e.storeKeys=Object.keys(t.payload)},setStoreData:(e,t)=>{e.stores[t.payload.storeKey].data=t.payload.data}}}),{setStoreData:ve,setStoresMetaData:Le}=Pe.actions;var Me=Pe.reducer;const xe=e=>{const t=o.useSelector(e=>e.commonStores.stores),i=o.useDispatch(),r=we(),{handleGetRequest:n,handlePostRequest:a,handleDeleteRequest:s}=Re();return{reloadData:async o=>{if(e?.commonStoreKey){const o=Object.keys(t);for(const a of o)if(a===e.commonStoreKey&&(void 0===t[a]?.authority||null===t[a]?.authority||r.isUserAuthorized(t[a]?.authority))&&""!=t[a]?.url){await n({endPointURI:t[a].url,showMask:!1,successCallBkFn:t=>{i(ve({storeKey:a,data:t.data})),e.setData(t.data)},failureCallBkFn:()=>{i(ve({storeKey:a,data:[]})),e.setData([])}});break}}else e?.findAll&&await n({endPointURI:e.findAll,showMask:!0,parameters:o||{},successCallBkFn:t=>{e.setData(t.data)}})},loadRecordById:async t=>{let o=null;if(e?.findById){const i={};i[e?.findByIdParamName||"id"]=t,await n({endPointURI:e.findById,showMask:!0,parameters:i,successCallBkFn:e=>{o=e.data}})}return o},saveRecord:async t=>{let o=null;return e?.save&&await a({endPointURI:e.save,data:t,showMask:!0,successCallBkFn:e=>{o=e.data}}),o},deleteRecordById:async t=>{let o=!0;if(e?.deleteById){const i={};i[e?.deleteByIdParamName||"id"]=t,await s({endPointURI:e.deleteById,showMask:!0,parameters:i,successCallBkFn:()=>{o=!0},failureCallBkFn:()=>{o=!1}})}return o}}},De=e=>{const{t:o}=y.useTranslation();return t.jsx(s.TextField,{...e,hidden:!0,slotProps:{inputLabel:{shrink:!0,sx:{fontWeight:"bold"}}},label:t.jsx(t.Fragment,{children:e?.label?o(e.label):""}),error:e?.error,helperText:e?.helperText?o(e.helperText):void 0})};function ke(e,t){return e.filter(e=>-1===t.indexOf(e))}function Ue(e,t){return e.filter(e=>-1!==t.indexOf(e))}const Fe=({valueField:e="id",displayField:o="name",options:i=[],selectedOptions:r=[],setSelection:n})=>{const[a,l]=ce.useState([]),[d,c]=ce.useState([]),[u,p]=ce.useState([]),[h,m]=ce.useState(""),[f,g]=ce.useState(""),T=Ue(a,d),A=Ue(a,u);ce.useEffect(()=>{i&&c([...i])},[i]),ce.useEffect(()=>{r&&p([...r])},[r]);const y=e=>()=>{const t=a.indexOf(e),o=[...a];-1===t?o.push(e):o.splice(t,1),l(o)},I=e=>Ue(a,e).length,_=e=>()=>{var t,o;I(e)===e.length?l(ke(a,e)):l((t=a,o=e,[...t,...ke(o,t)]))},E=(i,r,n)=>{const l=r.filter(e=>{if(e[o]){const t=e[o];if("left"===n&&t.toLocaleLowerCase().includes(h.toLocaleLowerCase()))return!0;if("right"===n&&t.toLocaleLowerCase().includes(f.toLocaleLowerCase()))return!0}return!1});return t.jsxs(N,{sx:{height:"100%"},children:[t.jsx(R,{sx:{px:2,py:1},avatar:t.jsx(S,{onClick:_(l),checked:I(l)===l.length&&0!==l.length,indeterminate:I(l)!==l.length&&0!==I(l),disabled:0===l.length,inputProps:{"aria-label":"all items selected"}}),title:i,subheader:`${I(r)} / ${r.length} Selected`}),t.jsx(s.Box,{sx:{width:"100%",padding:1},children:t.jsx(De,{fullWidth:!0,label:"search",value:"left"===n?h:f,onChange:e=>{"left"===n?m(e.target.value):g(e.target.value)}})}),t.jsx(v,{}),t.jsx(C,{sx:{width:"100%",height:"80%",bgcolor:"secondary",overflow:"auto"},dense:!0,component:"div",role:"list",children:l.map(i=>(i[e],t.jsxs(s.ListItemButton,{role:"listitem",onClick:y(i),sx:{cursor:"pointer"},children:[t.jsx(w,{children:t.jsx(S,{checked:-1!==a.indexOf(i),tabIndex:-1,disableRipple:!0})}),t.jsx(b,{id:i[e],primary:i[o]})]},i[e])))})]})};return t.jsxs(s.Grid2,{container:!0,spacing:2,sx:{flexGrow:1,overflow:"auto",margin:1,display:"flex",width:"100%"},justifyContent:"center",alignItems:"center",children:[t.jsx(s.Grid2,{sx:{height:"100%",flex:1},children:E("Available Items",d,"left")}),t.jsx(s.Grid2,{children:t.jsxs(s.Grid2,{container:!0,direction:"column",alignItems:"center",children:[t.jsx(P,{sx:{my:.5},variant:"outlined",size:"small",onClick:()=>{p(e=>{let t=u.concat(T);return n(t),t}),c(ke(d,T)),l(ke(a,T))},disabled:0===T.length,"aria-label":"move selected right",children:">"}),t.jsx(P,{sx:{my:.5},variant:"outlined",size:"small",onClick:()=>{c(d.concat(A)),p(e=>{let t=ke(u,A);return n(t),t}),l(ke(a,A))},disabled:0===A.length,"aria-label":"move selected left",children:"<"})]})}),t.jsx(s.Grid2,{sx:{height:"100%",flex:1},children:E("Currently Selected",u,"right")})]})},Be=e=>{const{t:o}=y.useTranslation();return t.jsx(s.FormControlLabel,{sx:e.sx,hidden:e?.hidden||!1,disabled:e.disabled||!1,required:e.required||!1,control:t.jsx(s.Checkbox,{checked:e?.checkedValue==e.value||"true"===e.value||"1"==e.value,onChange:t=>{void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack&&(t.target.checked?void 0!==e.checkedValue&&null!=e.checkedValue?e.onChangeCallBack(e.checkedValue):e.onChangeCallBack(!0):void 0!==e.unCheckedValue&&null!=e.unCheckedValue?e.onChangeCallBack(e.unCheckedValue):e.onChangeCallBack(!1))}}),label:o(e.label)})},qe=e=>{const i=o.useSelector(e=>e.AppLayout),[r,n]=d.useState(e?.options||[]),a=o.useSelector(t=>t?.commonStores?.stores[e?.commonStoreKey]?.data),{handleGetRequest:l}=Re();d.useEffect(()=>{e?.commonStoreKey?n(a):(async()=>{e?.storeUrl?await l({endPointURI:e.storeUrl,showMask:!1,parameters:e?.storeLoadParam,successCallBkFn:e=>{n(e.data)},failureCallBkFn:()=>{n([])}}):e?.dataQueryId?await l({endPointURI:"api/v1/dev/query/result",showMask:!1,parameters:{queryId:e.dataQueryId,...e?.storeLoadParam},successCallBkFn:e=>{n(e.data)},failureCallBkFn:()=>{n([])}}):e?.options&&n(e.options)})()},[e?.storeUrl,e?.storeLoadParam,e?.dataQueryId,e?.commonStoreKey,e?.options,a]);const{t:c}=y.useTranslation();return t.jsx(s.Autocomplete,{sx:e.sx,value:(t=>{for(let o of r)if(o[e.valueField]==t)return o;return null})(e.value),options:r,disabled:e.disabled,hidden:e?.hidden||!1,onChange:(t,o)=>{if(void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack)if(null!=o){let t=o[e.valueField];e.onChangeCallBack(t,o)}else e.onChangeCallBack(null,null)},clearOnBlur:!0,handleHomeEndKeys:!0,getOptionLabel:t=>null!=t?c(t[e.displayField]):"",renderOption:(o,i)=>t.jsx("li",{...o,children:null!=i?c(i[e.displayField]):""}),slots:{popper:e=>t.jsx(s.Popper,{...e,style:{...e.style,direction:i.appDirection}})},renderInput:o=>t.jsx(s.TextField,{...o,required:e.required||!1,variant:"outlined",slotProps:{inputLabel:{shrink:!0,sx:{fontWeight:"bold"}}},label:c(e.label),error:null!=e.errorMessage&&void 0!==e.errorMessage,helperText:null!=e.errorMessage&&void 0!==e.errorMessage?c(e.errorMessage):""})})},je="YYYY-MM-DD",Ge="YYYY-MM-DD HH:mm:ss",We="#37505C",He="#ff6d00",Ye="#ea690e",Ke="#74776B",Ve=e=>{const{t:o}=y.useTranslation();return e?.hidden?t.jsx(t.Fragment,{}):t.jsx(L.LocalizationProvider,{dateAdapter:M.AdapterMoment,children:t.jsx(L.DatePicker,{value:null!=e.value&&void 0!==e.value&&""!==e.value?x(e.value,e?.format||je):null,sx:{...e.sx,display:e?.hidden?"none":void 0},label:o(e.label),format:e?.format||je,disabled:e.disabled,onChange:t=>{let o=null;null!=t&&t.isValid()&&(o=t.format(e?.format||je)),void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack&&e.onChangeCallBack(o)},slotProps:{textField:{InputLabelProps:{shrink:!0,sx:{fontWeight:"bold"}},variant:"outlined",required:e.required,error:void 0!==e.errorMessage&&null!=e.errorMessage,helperText:void 0!==e.errorMessage&&null!=e.errorMessage?t.jsx(t.Fragment,{children:o(e.errorMessage)}):t.jsx(t.Fragment,{})}}})})},ze=e=>{const{t:o}=y.useTranslation();return e?.hidden?t.jsx(t.Fragment,{}):t.jsx(L.LocalizationProvider,{dateAdapter:M.AdapterMoment,children:t.jsx(L.DateTimePicker,{value:null!=e.value&&void 0!==e.value&&""!==e.value?x(e.value,e?.format||Ge):null,label:o(e.label),sx:{...e.sx,display:e?.hidden?"none":void 0},format:e?.format||Ge,disabled:e.disabled,onChange:t=>{let o=null;null!=t&&t.isValid()&&(o=t.format(e?.format||Ge)),void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack&&e.onChangeCallBack(o)},slotProps:{textField:{InputLabelProps:{shrink:!0,sx:{fontWeight:"bold"}},variant:"outlined",required:e.required,error:void 0!==e.errorMessage&&null!=e.errorMessage,helperText:void 0!==e.errorMessage&&null!=e.errorMessage?t.jsx(t.Fragment,{children:o(e.errorMessage)}):t.jsx(t.Fragment,{})}}})})},Qe=e=>{const i=o.useSelector(e=>e.AppLayout),r=we(),[n,a]=d.useState([]),{handleGetRequest:s}=Re();return d.useEffect(()=>{e.lookupType&&(async()=>{await s({endPointURI:"api/v1/public/system/lookup",showMask:!0,parameters:{lookupType:e.lookupType},successCallBkFn:e=>{a(e.data)},failureCallBkFn:()=>{a([])}})})()},[e.lookupType,r.UserSession]),t.jsx(qe,{...e,options:n,displayField:"ltr"===i.appDirection?"lookupEnDisplay":"lookupArDisplay",valueField:"lookupValue"})},$e=e=>({...e,type:"string",renderEditCell:e=>t.jsx(Ve,{sx:{width:"100%"},label:"",value:e.value,onChangeCallBack:t=>{e.api.setEditCellValue({id:e.id,field:e.field,value:t})}}),valueParser:(e,t,o)=>{let i=null;return null!==e&&(i=x(e).format(je)),i},valueFormatter:(e,t,o)=>t[o.field]}),Ze=e=>({...e,type:"string",renderEditCell:e=>t.jsx(ze,{sx:{width:"100%"},label:"",value:e.value,onChangeCallBack:t=>{e.api.setEditCellValue({id:e.id,field:e.field,value:t})}}),valueParser:(e,t,o)=>{let i=null;return null!==e&&(i=x(e).format(Ge)),i},valueFormatter:(e,t,o)=>t[o.field]}),Je=e=>({...e,type:"custom",valueGetter:e=>e||e,renderCell:e=>{let o=null;try{o=e.colDef.options.find(t=>t[e.colDef.valueField]==e.value)}catch(e){}return t.jsx("div",{children:null!=o?o[e.colDef.displayField]:e.value})},commonStoreKey:e?.commonStoreKey,dataQueryId:e?.dataQueryId,storeUrl:e?.storeUrl,storeLoadParam:e?.storeLoadParam,renderEditCell:e=>t.jsx(qe,{...e,sx:{width:"100%"},options:e?.colDef?.options,valueField:e?.colDef?.valueField,displayField:e?.colDef?.displayField,onChangeCallBack:(t,o)=>{null===t&&e.api.setEditCellValue({id:e.id,field:e.field,value:null}),e.api.setEditCellValue({id:e.id,field:e.field,value:t})}})}),Xe=e=>({...e,type:"custom",valueGetter:e=>null==e||null==e?null:e,renderCell:o=>{const i=o?.value;return i===e.checkedValue||"true"===i||1===i||!0===i?t.jsx(m.FontAwesomeIcon,{icon:"check",color:"green"}):t.jsx(m.FontAwesomeIcon,{icon:"xmark",color:"red"})},renderEditCell:o=>t.jsx(Be,{...o,checkedValue:e?.checkedValue||!0,unCheckedValue:e?.unCheckedValue||!1,onChangeCallBack:e=>{o.api.setEditCellValue({id:o.id,field:o.field,value:e})}})}),et=e=>{const t=[];if("field"===e.type&&"props"===e.mode&&e?.props)t.push(e.props);else if("group"===e.type&&e?.props&&e?.props?.elements)for(const o of e.props.elements)t.push(...et(o));return t},tt=e=>{const t=[];for(const o of e)t.push(...et(o));return t},ot=(e,t,o)=>{const i=[];for(const r of e)if("text"===r?.fieldType||"number"===r?.fieldType){const e={...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,type:"number"==r?.fieldType?"number":"string",field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200};i.push(e)}else if("date"===r?.fieldType){const e=$e({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else if("datetime"===r?.fieldType){const e=Ze({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else if("checkbox"===r?.fieldType){const e=Xe({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,checkedValue:r?.checkedValue,unCheckedValue:r?.unCheckedValue,width:150});i.push(e)}else if("combobox"===r?.fieldType){const e=Je({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,valueField:r?.optionValueField||"value",displayField:r?.optionDisplayField||"display",options:r?.options,commonStoreKey:r?.commonStoreKey,dataQueryId:r?.dataQueryId,storeUrl:r?.storeUrl,storeLoadParam:r?.storeLoadParam,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else if("lookup"===r?.fieldType){const e=Je({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,lookupType:r?.lookupType,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",commonStoreKey:r?.commonStoreKey,dataQueryId:r?.dataQueryId,storeUrl:r?.storeUrl,storeLoadParam:r?.storeLoadParam,hidden:r?.hidden,searchable:r?.gridProps?.searchable,valueField:r?.optionValueField||"value",displayField:r?.optionDisplayField||"display",options:r?.options||[],flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else{const e={field:r.fieldName,...r?.gridProps?.muiProps};i.push(e)}return i},it=e=>{const t={};for(const o of e)if(o?.fieldName){const e=o.fieldName;"number"===o.fieldType?t[e]=!0===o?.required?ue.number({required_error:"This field is required",invalid_type_error:"This field must be a number"}):ue.number().optional().nullable():"checkbox"===o.fieldType?t[e]=!0===o?.required?ue.boolean({required_error:"This field is required"}):ue.boolean().optional().nullable():"combobox"===o.fieldType?o?.comboboxValueDataType?"number"===o?.comboboxValueDataType?t[e]=!0===o?.required?ue.number({required_error:"This field is required",invalid_type_error:"This field must be a number"}):ue.number().optional().nullable():"string"===o?.comboboxValueDataType&&(t[e]=!0===o?.required?ue.string({message:"This field is required"}).min(1,"This field is required"):ue.string().optional().nullable()):t[e]=!0===o?.required?ue.number({required_error:"This field is required",invalid_type_error:"This field must be a number"}):ue.number().optional().nullable():t[e]=!0===o?.required?ue.string({message:"This field is required"}).min(1,"This field is required"):ue.string().optional().nullable()}return t},rt=(e,t,o)=>{const i=[],r=[];if("exclude"===e.type&&0===e.ids.size)for(const e of t)i.push(e),r.push(e[o]);else if(e?.ids)for(const n of e.ids){const e=t.find(e=>e[o]===n);i.push(e),r.push(n)}return{selectedRecords:i,selectedRecordIds:r}};function nt(e,...t){const o=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>o.searchParams.append("args[]",e)),`Minified MUI error #${e}; visit ${o} for the full message.`}function at(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var st,lt={exports:{}},dt={exports:{}},ct={};var ut,pt,ht,mt,ft,gt,Tt,At,yt,It,_t,Et,Ot,Ct,Nt,Rt={};
1
+ "use strict";var e=require("@mui/x-data-grid-premium"),t=require("react/jsx-runtime"),o=require("react-redux"),i=require("@fortawesome/fontawesome-svg-core"),r=require("@fortawesome/free-brands-svg-icons"),n=require("@fortawesome/free-regular-svg-icons"),a=require("@fortawesome/free-solid-svg-icons");require("react-toastify/dist/ReactToastify.css");var s=require("@mui/material"),l=require("@emotion/react"),d=require("react"),c=require("@mui/material/styles"),u=require("@mui/material/CssBaseline"),p=require("@mui/material/AppBar"),h=require("@mui/material/Toolbar"),m=require("@fortawesome/react-fontawesome"),f=require("@reduxjs/toolkit"),g=require("react-toastify"),T=require("axios"),A=require("i18next"),y=require("react-i18next"),I=require("react-hook-form"),_=require("react-router-dom"),E=require("@hookform/resolvers/zod"),O=require("zod"),C=require("@mui/material/List"),N=require("@mui/material/Card"),R=require("@mui/material/CardHeader"),b=require("@mui/material/ListItemText"),w=require("@mui/material/ListItemIcon"),S=require("@mui/material/Checkbox"),P=require("@mui/material/Button"),v=require("@mui/material/Divider"),L=require("@mui/x-date-pickers"),M=require("@mui/x-date-pickers/AdapterMoment"),x=require("moment"),D=require("@mui/material/CardActions"),k=require("@mui/material/CardContent"),U=require("@mui/material/CardMedia"),F=require("@mui/material/Typography"),B=require("@mui/lab"),q=require("@mui/x-tree-view/models"),j=require("@mui/x-charts"),G=require("@mui/material/LinearProgress"),W=require("@mui/material/Box"),H=require("@mui/x-charts/PieChart"),Y=require("@mui/material/IconButton"),K=require("@mui/material/Drawer"),V=require("@react-spring/web"),z=require("@mui/material/Collapse"),Q=require("@mui/x-tree-view/RichTreeView"),$=require("@mui/x-tree-view/TreeItem"),Z=require("@mui/x-tree-view/useTreeItem2"),J=require("@mui/x-tree-view/TreeItem2"),X=require("@mui/x-tree-view/TreeItem2Icon"),ee=require("@mui/x-tree-view/TreeItem2Provider"),te=require("@mui/x-tree-view/TreeItem2DragAndDropOverlay"),oe=require("stylis-plugin-rtl"),ie=require("stylis"),re=require("@emotion/cache"),ne=require("@emotion/styled"),ae=require("@mui/material/colors"),se=require("@mui/material/SwipeableDrawer"),le=require("@mui/x-license");function de(e){var t=Object.create(null);return e&&Object.keys(e).forEach(function(o){if("default"!==o){var i=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,i.get?i:{enumerable:!0,get:function(){return e[o]}})}}),t.default=e,Object.freeze(t)}var ce=de(d),ue=de(O);!function(e,t){void 0===t&&(t={});var o=t.insertAt;if("undefined"!=typeof document){var i=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css","top"===o&&i.firstChild?i.insertBefore(r,i.firstChild):i.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}}("html,\nbody {\n height: 100vh;\n margin: 0;\n padding: 0;\n}\n\n#root {\n height: 100vh;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n overflow: hidden;\n}\n\n.red-row {\n background-color: #f0d8d8;\n}\n");const pe=(e=768)=>{const[t,o]=d.useState(window.innerWidth<e);return d.useEffect(()=>{const t=()=>o(window.innerWidth<e);return window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[e]),t},he=350,me={themeMode:localStorage.getItem("themeMode")||"light",appDirection:"ar"==localStorage.getItem("language")?"rtl":"ltr"},fe=f.createSlice({name:"AppLayout",initialState:me,reducers:{setThemeMode:(e,t)=>{e.themeMode=t.payload},setAppDirection:(e,t)=>{e.appDirection=t.payload}}}),ge=fe.actions;var Te=fe.reducer;const Ae=f.createSlice({name:"loadingMask",initialState:{value:{isOpened:!1,message:null}},reducers:{showLoadingMask:(e,t)=>{e.value.isOpened=!0,e.value.message=t.payload},hideLoadingMask:e=>{e.value.isOpened=!1,e.value.message=null}}}),{showLoadingMask:ye,hideLoadingMask:Ie}=Ae.actions;var _e=Ae.reducer;const Ee=()=>{const e=o.useDispatch();return{show:t=>{e(ye(t))},hide:()=>{e(Ie())}}},Oe=f.createSlice({name:"UserSession",initialState:{value:{isAuthenticated:null,authorities:[]}},reducers:{setAuthenticated:(e,t)=>{e.value=t.payload},setUnAuthenticated:e=>{e.value={isAuthenticated:!1,authorities:[]}}}}),Ce=Oe.actions;var Ne=Oe.reducer;const Re=()=>{const e=Ee(),t=o.useDispatch(),i=o.useSelector(e=>e.AppInfo.value.apiBaseUrl),r=T.create({baseURL:i,timeout:6e5,withCredentials:!0});r.defaults.withCredentials=!0,r.interceptors.request.use(e=>{const t=localStorage.getItem("TOKEN");return t&&(e.headers.Authorization=`Bearer ${t}`),e},e=>Promise.reject(e)),r.interceptors.response.use(e=>e,e=>{if(e&&(e.response&&(e.response.status&&401===e.response.status)))t(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN"),g.toast.error("your session is now expired, you need to login again",{autoClose:!1});else if(e&&(e.response&&(e.response.status&&402===e.response.status)))t(Ce.setUnAuthenticated()),g.toast.error("Your license is missing or has expired,Please reach out to your vendor for assistance.");else if(e&&(e.response&&(e.response.status&&403===e.response.status)))g.toast.error("you aren't authorized to process this request");else if(e&&(e.response&&(e.response.status&&500===e.response.status)))if(e.response.data instanceof Blob){e.response.data.text().then(e=>{g.toast.error(e)})}else g.toast.error(e.response.data);else g.toast.error("failed to communicate with the server ... try again later");return"ERROR"});return{handleGetRequest:async t=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);const o=await r.get(t.endPointURI,{params:{...t.parameters},withCredentials:!0,headers:t.headers,responseType:t?.responseType});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},handlePostRequest:async t=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);let o=await r.post(t.endPointURI,t.data,{params:t.parameters,responseType:t?.responseType,headers:t?.headers});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},handleDeleteRequest:async t=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);let o=await r.delete(t.endPointURI,{params:{...t.parameters},responseType:t?.responseType,headers:t?.headers});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},HandleDownloadHTTPPostPDF:async(t={endPointURI:"",parameters:{},data:{}})=>{void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);const o=await r.post(t.endPointURI,t.data,{responseType:"blob"});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==o?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(o),o):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(o),"ERROR")},handleUploadRequest:async t=>{if(null===t.files||0===t.files.length)return g.toast.error("You must add files to upload"),"ERROR";const o=new FormData;for(const e of t.files)o.append("files",e);void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.show(t.loadingMessage);let i=await r.post(t.endPointURI,o,{params:t?.parameters,headers:{"Content-Type":"multipart/form-data"}});return void 0!==t.showMask&&null!=t.showMask&&!0===t.showMask&&e.hide(),"ERROR"!==i?(void 0!==t.successCallBkFn&&null!=t.successCallBkFn&&t.successCallBkFn(i),i):(void 0!==t.failureCallBkFn&&null!=t.failureCallBkFn&&t.failureCallBkFn(i),"ERROR")}}},be=e=>{const[o,i]=d.useState(!1),{t:r}=y.useTranslation();return{ConfirmationWindow:()=>t.jsxs(s.Dialog,{open:o,children:[t.jsx(s.DialogTitle,{children:e.title}),t.jsx(s.DialogContent,{children:t.jsx(s.DialogContentText,{children:e.body})}),t.jsxs(s.DialogActions,{children:[t.jsx(s.Button,{variant:"contained",sx:{marginRight:2,marginLeft:2},color:"primary",onClick:()=>{i(!1)},children:r("NO_LABEL")}),t.jsx(s.Button,{variant:"contained",sx:{marginRight:2,marginLeft:2},color:"error",onClick:()=>{e.onConfirmationCallBk(),i(!1)},autoFocus:!0,children:r("YES_LABEL")})]})]}),open:o,setOpen:i}},we=()=>{const e=o.useSelector(e=>e.UserSession),t=e.value;return{UserSession:e,isUserAuthorized:t=>{if(e?.value?.authorities)for(let o of e.value.authorities){if("DEVELOPMENT_ADMIN"===t&&("DEVELOPMENT_ADMIN"===o?.authority||"ORGANIZATION_ADMIN"===o?.authority))return!0;if("ORGANIZATION_ADMIN"===t&&"ORGANIZATION_ADMIN"===o?.authority)return!0;if("DEVELOPMENT_ADMIN"!==t&&"ORGANIZATION_ADMIN"!==t&&("ORGANIZATION_ADMIN"===o?.authority||"DEVELOPMENT_ADMIN"===o?.authority||"SYSTEM_ADMIN"===o?.authority||o?.authority===t))return!0}return!1},isCurrentOrganizationAuthorizedToModule:e=>{if(t?.currentOrganization?.systemApplicationModules)for(const o of t.currentOrganization.systemApplicationModules)if(o.toLowerCase()==e.toLowerCase())return!0;return!1},UserInfo:t}},Se=e=>{const[i,r]=d.useState(!1),n=o.useSelector(e=>e.AppLayout.appDirection);return{windowState:i,setWindowState:r,Window:o=>t.jsx(s.Modal,{open:i,sx:{zIndex:e=>e.zIndex.drawer},onClose:()=>{!i&&e?.onCloseCallBack&&e.onCloseCallBack()},children:t.jsxs(s.Box,{dir:n,sx:{position:"absolute",top:"50%",left:"50%",maxHeight:"90%",transform:"translate(-50%, -50%)",height:e?.height||"80%",width:e?.width||"90%",minWidth:e.minWidth||400,minHeight:e.minHeight||200,overflow:"hidden",bgcolor:"modalBackground.main",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start"},children:[t.jsx(s.AppBar,{position:"static",children:t.jsxs(s.Toolbar,{variant:"dense",children:[t.jsx(m.FontAwesomeIcon,{icon:e?.windowIcon||"window-maximize",style:{marginRight:5}}),t.jsx(s.Typography,{variant:"h6",color:"inherit",component:"div",children:e?.windowTitle||"window"}),t.jsx("div",{style:{flexGrow:1}}),t.jsx(s.IconButton,{onClick:()=>{r(!1),null!=e.onCloseCallBack&&null!=e.onCloseCallBack&&e.onCloseCallBack()},color:"secondary",children:t.jsx(m.FontAwesomeIcon,{icon:"xmark-square"})})]})}),t.jsx(s.Paper,{sx:{display:"flex",flexDirection:"column",alignItems:"center",width:"100%",height:"100%",padding:1,overflow:"hidden"},children:o?.children})]})})}},Pe=f.createSlice({name:"commonStores",initialState:{stores:{},storeKeys:[]},reducers:{setStoresMetaData:(e,t)=>{e.stores=t.payload,e.storeKeys=Object.keys(t.payload)},setStoreData:(e,t)=>{e.stores[t.payload.storeKey].data=t.payload.data}}}),{setStoreData:ve,setStoresMetaData:Le}=Pe.actions;var Me=Pe.reducer;const xe=e=>{const t=o.useSelector(e=>e.commonStores.stores),i=o.useDispatch(),r=we(),{handleGetRequest:n,handlePostRequest:a,handleDeleteRequest:s}=Re();return{reloadData:async o=>{if(e?.commonStoreKey){const o=Object.keys(t);for(const a of o)if(a===e.commonStoreKey&&(void 0===t[a]?.authority||null===t[a]?.authority||r.isUserAuthorized(t[a]?.authority))&&""!=t[a]?.url){await n({endPointURI:t[a].url,showMask:!1,successCallBkFn:t=>{i(ve({storeKey:a,data:t.data})),e.setData(t.data)},failureCallBkFn:()=>{i(ve({storeKey:a,data:[]})),e.setData([])}});break}}else e?.findAll&&await n({endPointURI:e.findAll,showMask:!0,parameters:o||{},successCallBkFn:t=>{e.setData(t.data)}})},loadRecordById:async t=>{let o=null;if(e?.findById){const i={};i[e?.findByIdParamName||"id"]=t,await n({endPointURI:e.findById,showMask:!0,parameters:i,successCallBkFn:e=>{o=e.data}})}return o},saveRecord:async t=>{let o=null;return e?.save&&await a({endPointURI:e.save,data:t,showMask:!0,successCallBkFn:e=>{o=e.data}}),o},deleteRecordById:async t=>{let o=!0;if(e?.deleteById){const i={};i[e?.deleteByIdParamName||"id"]=t,await s({endPointURI:e.deleteById,showMask:!0,parameters:i,successCallBkFn:()=>{o=!0},failureCallBkFn:()=>{o=!1}})}return o}}},De=e=>{const{t:o}=y.useTranslation();return t.jsx(s.TextField,{...e,hidden:!0,slotProps:{inputLabel:{shrink:!0,sx:{fontWeight:"bold"}}},label:t.jsx(t.Fragment,{children:e?.label?o(e.label):""}),error:e?.error,helperText:e?.helperText?o(e.helperText):void 0})};function ke(e,t){return e.filter(e=>-1===t.indexOf(e))}function Ue(e,t){return e.filter(e=>-1!==t.indexOf(e))}const Fe=({valueField:e="id",displayField:o="name",options:i=[],selectedOptions:r=[],setSelection:n})=>{const[a,l]=ce.useState([]),[d,c]=ce.useState([]),[u,p]=ce.useState([]),[h,m]=ce.useState(""),[f,g]=ce.useState(""),T=Ue(a,d),A=Ue(a,u);ce.useEffect(()=>{i&&c([...i])},[i]),ce.useEffect(()=>{r&&p([...r])},[r]);const y=e=>()=>{const t=a.indexOf(e),o=[...a];-1===t?o.push(e):o.splice(t,1),l(o)},I=e=>Ue(a,e).length,_=e=>()=>{var t,o;I(e)===e.length?l(ke(a,e)):l((t=a,o=e,[...t,...ke(o,t)]))},E=(i,r,n)=>{const l=r.filter(e=>{if(e[o]){const t=e[o];if("left"===n&&t.toLocaleLowerCase().includes(h.toLocaleLowerCase()))return!0;if("right"===n&&t.toLocaleLowerCase().includes(f.toLocaleLowerCase()))return!0}return!1});return t.jsxs(N,{sx:{height:"100%"},children:[t.jsx(R,{sx:{px:2,py:1},avatar:t.jsx(S,{onClick:_(l),checked:I(l)===l.length&&0!==l.length,indeterminate:I(l)!==l.length&&0!==I(l),disabled:0===l.length,inputProps:{"aria-label":"all items selected"}}),title:i,subheader:`${I(r)} / ${r.length} Selected`}),t.jsx(s.Box,{sx:{width:"100%",padding:1},children:t.jsx(De,{fullWidth:!0,label:"search",value:"left"===n?h:f,onChange:e=>{"left"===n?m(e.target.value):g(e.target.value)}})}),t.jsx(v,{}),t.jsx(C,{sx:{width:"100%",height:"80%",bgcolor:"secondary",overflow:"auto"},dense:!0,component:"div",role:"list",children:l.map(i=>(i[e],t.jsxs(s.ListItemButton,{role:"listitem",onClick:y(i),sx:{cursor:"pointer"},children:[t.jsx(w,{children:t.jsx(S,{checked:-1!==a.indexOf(i),tabIndex:-1,disableRipple:!0})}),t.jsx(b,{id:i[e],primary:i[o]})]},i[e])))})]})};return t.jsxs(s.Grid2,{container:!0,spacing:2,sx:{flexGrow:1,overflow:"auto",margin:1,display:"flex",width:"100%"},justifyContent:"center",alignItems:"center",children:[t.jsx(s.Grid2,{sx:{height:"100%",flex:1},children:E("Available Items",d,"left")}),t.jsx(s.Grid2,{children:t.jsxs(s.Grid2,{container:!0,direction:"column",alignItems:"center",children:[t.jsx(P,{sx:{my:.5},variant:"outlined",size:"small",onClick:()=>{p(e=>{let t=u.concat(T);return n(t),t}),c(ke(d,T)),l(ke(a,T))},disabled:0===T.length,"aria-label":"move selected right",children:">"}),t.jsx(P,{sx:{my:.5},variant:"outlined",size:"small",onClick:()=>{c(d.concat(A)),p(e=>{let t=ke(u,A);return n(t),t}),l(ke(a,A))},disabled:0===A.length,"aria-label":"move selected left",children:"<"})]})}),t.jsx(s.Grid2,{sx:{height:"100%",flex:1},children:E("Currently Selected",u,"right")})]})},Be=e=>{const{t:o}=y.useTranslation();return t.jsx(s.FormControlLabel,{sx:e.sx,hidden:e?.hidden||!1,disabled:e.disabled||!1,required:e.required||!1,control:t.jsx(s.Checkbox,{checked:e?.checkedValue==e.value||"true"===e.value||"1"==e.value,onChange:t=>{void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack&&(t.target.checked?void 0!==e.checkedValue&&null!=e.checkedValue?e.onChangeCallBack(e.checkedValue):e.onChangeCallBack(!0):void 0!==e.unCheckedValue&&null!=e.unCheckedValue?e.onChangeCallBack(e.unCheckedValue):e.onChangeCallBack(!1))}}),label:o(e.label)})},qe=e=>{const i=o.useSelector(e=>e.AppLayout),[r,n]=d.useState(e?.options||[]),a=o.useSelector(t=>t?.commonStores?.stores[e?.commonStoreKey]?.data),{handleGetRequest:l}=Re();d.useEffect(()=>{e?.commonStoreKey?n(a):(async()=>{e?.storeUrl?await l({endPointURI:e.storeUrl,showMask:!1,parameters:e?.storeLoadParam,successCallBkFn:e=>{n(e.data)},failureCallBkFn:()=>{n([])}}):e?.dataQueryId?await l({endPointURI:"api/v1/dev/query/result",showMask:!1,parameters:{queryId:e.dataQueryId,...e?.storeLoadParam},successCallBkFn:e=>{n(e.data)},failureCallBkFn:()=>{n([])}}):e?.options&&n(e.options)})()},[e?.storeUrl,e?.storeLoadParam,e?.dataQueryId,e?.commonStoreKey,e?.options,a]);const{t:c}=y.useTranslation();return t.jsx(s.Autocomplete,{sx:e.sx,value:(t=>{for(let o of r)if(o[e.valueField]==t)return o;return null})(e.value),options:r,disabled:e.disabled,hidden:e?.hidden||!1,onChange:(t,o)=>{if(void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack)if(null!=o){let t=o[e.valueField];e.onChangeCallBack(t,o)}else e.onChangeCallBack(null,null)},clearOnBlur:!0,handleHomeEndKeys:!0,getOptionLabel:t=>null!=t?c(t[e.displayField]):"",renderOption:(o,i)=>t.jsx("li",{...o,children:null!=i?c(i[e.displayField]):""}),slots:{popper:e=>t.jsx(s.Popper,{...e,style:{...e.style,direction:i.appDirection}})},groupBy:e?.groupField?t=>t[e.groupField]?t[e.groupField]:"":void 0,renderInput:o=>t.jsx(s.TextField,{...o,required:e.required||!1,variant:"outlined",slotProps:{inputLabel:{shrink:!0,sx:{fontWeight:"bold"}}},label:c(e.label),error:null!=e.errorMessage&&void 0!==e.errorMessage,helperText:null!=e.errorMessage&&void 0!==e.errorMessage?c(e.errorMessage):""})})},je="YYYY-MM-DD",Ge="YYYY-MM-DD HH:mm:ss",We="#37505C",He="#ff6d00",Ye="#ea690e",Ke="#74776B",Ve=e=>{const{t:o}=y.useTranslation();return e?.hidden?t.jsx(t.Fragment,{}):t.jsx(L.LocalizationProvider,{dateAdapter:M.AdapterMoment,children:t.jsx(L.DatePicker,{value:null!=e.value&&void 0!==e.value&&""!==e.value?x(e.value,e?.format||je):null,sx:{...e.sx,display:e?.hidden?"none":void 0},label:o(e.label),format:e?.format||je,disabled:e.disabled,onChange:t=>{let o=null;null!=t&&t.isValid()&&(o=t.format(e?.format||je)),void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack&&e.onChangeCallBack(o)},slotProps:{textField:{InputLabelProps:{shrink:!0,sx:{fontWeight:"bold"}},variant:"outlined",required:e.required,error:void 0!==e.errorMessage&&null!=e.errorMessage,helperText:void 0!==e.errorMessage&&null!=e.errorMessage?t.jsx(t.Fragment,{children:o(e.errorMessage)}):t.jsx(t.Fragment,{})}}})})},ze=e=>{const{t:o}=y.useTranslation();return e?.hidden?t.jsx(t.Fragment,{}):t.jsx(L.LocalizationProvider,{dateAdapter:M.AdapterMoment,children:t.jsx(L.DateTimePicker,{value:null!=e.value&&void 0!==e.value&&""!==e.value?x(e.value,e?.format||Ge):null,label:o(e.label),sx:{...e.sx,display:e?.hidden?"none":void 0},format:e?.format||Ge,disabled:e.disabled,onChange:t=>{let o=null;null!=t&&t.isValid()&&(o=t.format(e?.format||Ge)),void 0!==e.onChangeCallBack&&null!=e.onChangeCallBack&&e.onChangeCallBack(o)},slotProps:{textField:{InputLabelProps:{shrink:!0,sx:{fontWeight:"bold"}},variant:"outlined",required:e.required,error:void 0!==e.errorMessage&&null!=e.errorMessage,helperText:void 0!==e.errorMessage&&null!=e.errorMessage?t.jsx(t.Fragment,{children:o(e.errorMessage)}):t.jsx(t.Fragment,{})}}})})},Qe=e=>{const i=o.useSelector(e=>e.AppLayout),r=we(),[n,a]=d.useState([]),{handleGetRequest:s}=Re();return d.useEffect(()=>{e.lookupType&&(async()=>{await s({endPointURI:"api/v1/public/system/lookup",showMask:!0,parameters:{lookupType:e.lookupType},successCallBkFn:e=>{a(e.data)},failureCallBkFn:()=>{a([])}})})()},[e.lookupType,r.UserSession]),t.jsx(qe,{...e,options:n,displayField:"ltr"===i.appDirection?"lookupEnDisplay":"lookupArDisplay",valueField:"lookupValue"})},$e=e=>({...e,type:"string",renderEditCell:e=>t.jsx(Ve,{sx:{width:"100%"},label:"",value:e.value,onChangeCallBack:t=>{e.api.setEditCellValue({id:e.id,field:e.field,value:t})}}),valueParser:(e,t,o)=>{let i=null;return null!==e&&(i=x(e).format(je)),i},valueFormatter:(e,t,o)=>t[o.field]}),Ze=e=>({...e,type:"string",renderEditCell:e=>t.jsx(ze,{sx:{width:"100%"},label:"",value:e.value,onChangeCallBack:t=>{e.api.setEditCellValue({id:e.id,field:e.field,value:t})}}),valueParser:(e,t,o)=>{let i=null;return null!==e&&(i=x(e).format(Ge)),i},valueFormatter:(e,t,o)=>t[o.field]}),Je=e=>({...e,type:"custom",valueGetter:e=>e||e,renderCell:e=>{let o=null;try{o=e.colDef.options.find(t=>t[e.colDef.valueField]==e.value)}catch(e){}return t.jsx("div",{children:null!=o?o[e.colDef.displayField]:e.value})},commonStoreKey:e?.commonStoreKey,dataQueryId:e?.dataQueryId,storeUrl:e?.storeUrl,storeLoadParam:e?.storeLoadParam,renderEditCell:e=>t.jsx(qe,{...e,sx:{width:"100%"},options:e?.colDef?.options,valueField:e?.colDef?.valueField,displayField:e?.colDef?.displayField,groupField:e?.colDef?.comboboxGroupField,onChangeCallBack:(t,o)=>{null===t&&e.api.setEditCellValue({id:e.id,field:e.field,value:null}),e.api.setEditCellValue({id:e.id,field:e.field,value:t})}})}),Xe=e=>({...e,type:"custom",valueGetter:e=>null==e||null==e?null:e,renderCell:o=>{const i=o?.value;return i===e.checkedValue||"true"===i||1===i||!0===i?t.jsx(m.FontAwesomeIcon,{icon:"check",color:"green"}):t.jsx(m.FontAwesomeIcon,{icon:"xmark",color:"red"})},renderEditCell:o=>t.jsx(Be,{...o,checkedValue:e?.checkedValue||!0,unCheckedValue:e?.unCheckedValue||!1,onChangeCallBack:e=>{o.api.setEditCellValue({id:o.id,field:o.field,value:e})}})}),et=e=>{const t=[];if("field"===e.type&&"props"===e.mode&&e?.props)t.push(e.props);else if("group"===e.type&&e?.props&&e?.props?.elements)for(const o of e.props.elements)t.push(...et(o));return t},tt=e=>{const t=[];for(const o of e)t.push(...et(o));return t},ot=(e,t,o)=>{const i=[];for(const r of e)if("text"===r?.fieldType||"number"===r?.fieldType){const e={...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,type:"number"==r?.fieldType?"number":"string",field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200};i.push(e)}else if("date"===r?.fieldType){const e=$e({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else if("datetime"===r?.fieldType){const e=Ze({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else if("checkbox"===r?.fieldType){const e=Xe({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,checkedValue:r?.checkedValue,unCheckedValue:r?.unCheckedValue,width:150});i.push(e)}else if("combobox"===r?.fieldType){const e=Je({...r?.gridProps?.muiProps,comboboxGroupField:r?.comboboxGroupField,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",hidden:r?.hidden,searchable:r?.gridProps?.searchable,valueField:r?.optionValueField||"value",displayField:r?.optionDisplayField||"display",options:r?.options,commonStoreKey:r?.commonStoreKey,dataQueryId:r?.dataQueryId,storeUrl:r?.storeUrl,storeLoadParam:r?.storeLoadParam,flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else if("lookup"===r?.fieldType){const e=Je({...r?.gridProps?.muiProps,editable:null!=r?.gridProps?.muiProps?.editable?r?.gridProps?.muiProps?.editable:t,lookupType:r?.lookupType,field:r?.fieldName,headerName:o(r?.fieldLabel||r?.fieldName),headerAlign:"center",align:"center",commonStoreKey:r?.commonStoreKey,dataQueryId:r?.dataQueryId,storeUrl:r?.storeUrl,storeLoadParam:r?.storeLoadParam,hidden:r?.hidden,searchable:r?.gridProps?.searchable,valueField:r?.optionValueField||"value",displayField:r?.optionDisplayField||"display",options:r?.options||[],flex:r?.gridProps?.muiProps?.flex||1,minWidth:r?.gridProps?.muiProps?.width?r?.gridProps?.muiProps?.width:200});i.push(e)}else{const e={field:r.fieldName,...r?.gridProps?.muiProps};i.push(e)}return i},it=e=>{const t={};for(const o of e)if(o?.fieldName){const e=o.fieldName;"number"===o.fieldType?t[e]=!0===o?.required?ue.number({required_error:"This field is required",invalid_type_error:"This field must be a number"}):ue.number().optional().nullable():"checkbox"===o.fieldType?t[e]=!0===o?.required?ue.boolean({required_error:"This field is required"}):ue.boolean().optional().nullable():"combobox"===o.fieldType?o?.comboboxValueDataType?"number"===o?.comboboxValueDataType?t[e]=!0===o?.required?ue.number({required_error:"This field is required",invalid_type_error:"This field must be a number"}):ue.number().optional().nullable():"string"===o?.comboboxValueDataType&&(t[e]=!0===o?.required?ue.string({message:"This field is required"}).min(1,"This field is required"):ue.string().optional().nullable()):t[e]=!0===o?.required?ue.number({required_error:"This field is required",invalid_type_error:"This field must be a number"}):ue.number().optional().nullable():t[e]=!0===o?.required?ue.string({message:"This field is required"}).min(1,"This field is required"):ue.string().optional().nullable()}return t},rt=(e,t,o)=>{const i=[],r=[];if("exclude"===e.type&&0===e.ids.size)for(const e of t)i.push(e),r.push(e[o]);else if(e?.ids)for(const n of e.ids){const e=t.find(e=>e[o]===n);i.push(e),r.push(n)}return{selectedRecords:i,selectedRecordIds:r}};function nt(e,...t){const o=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(e=>o.searchParams.append("args[]",e)),`Minified MUI error #${e}; visit ${o} for the full message.`}function at(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var st,lt={exports:{}},dt={exports:{}},ct={};var ut,pt,ht,mt,ft,gt,Tt,At,yt,It,_t,Et,Ot,Ct,Nt,Rt={};
2
2
  /** @license React v16.13.1
3
3
  * react-is.development.js
4
4
  *
@@ -34,7 +34,7 @@ function(e,t){const o=ne(e,t);return"production"!==process.env.NODE_ENV?(...t)=>
34
34
  50% { transform: scale(1); opacity: 1; }
35
35
  75% { transform: scale(1); opacity: 0.6; }
36
36
  100% { transform: scale(1); opacity: 1; }
37
- `,or=e=>{const i=_.useNavigate(),r=o.useSelector(e=>e.AppLayout),{handlePostRequest:n}=Re();return t.jsxs(t.Fragment,{children:[t.jsxs(s.Button,{fullWidth:!0,onClick:()=>{var t;"NAVIGATION"===e?.notificationAction&&e?.notificationActionPayload&&i(e.notificationActionPayload),e?.isNotified||(t=e.id,n({endPointURI:"api/v1/public/notification/notified",showMask:!1,parameters:{notificationQueueId:t}})),e?.setOpen&&e.setOpen(!1)},sx:{marginBottom:1,justifyContent:"flex-start",alignItems:"flex-start",color:e?.notificationTextColor,display:"flex",flexDirection:"column",cursor:"pointer"},children:[t.jsxs(s.Box,{sx:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%"},children:[e?.notificationIcon?t.jsx(m.FontAwesomeIcon,{icon:e.notificationIcon,style:{marginRight:10,marginLeft:10,color:e?.notificationIconColor}}):t.jsx(t.Fragment,{}),"ltr"===r.appDirection?e.notificationEnText:e.notificationArText,t.jsx(s.Box,{sx:{flex:1}}),e?.isNotified?t.jsx(t.Fragment,{}):t.jsxs(s.Typography,{color:"warning",sx:{animation:`${tr} 2s infinite ease-in-out`,textTransform:"none",display:"inline-block"},children:[t.jsx(m.FontAwesomeIcon,{icon:"bell",style:{marginRight:5,marginLeft:5}}),"ltr"===r.appDirection?"New":"جديد"]})]}),t.jsxs(s.Box,{sx:{width:"100%",fontSize:12,display:"flex",justifyContent:"flex-end",alignItems:"center",cursor:"pointer"},children:[t.jsx(s.Box,{sx:{marginRight:1,marginLeft:1},children:hi(e.createTime,r.appDirection)}),t.jsx(s.Box,{sx:{flex:1}}),t.jsx(s.Box,{sx:{marginRight:1,marginLeft:1},children:e.createTime})]})]}),e?.showDivider?t.jsx(s.Divider,{flexItem:!0}):t.jsx(t.Fragment,{})]})},ir=()=>{const{UserInfo:e}=we(),[i,r]=d.useState(null),{handleGetRequest:n,handlePostRequest:a}=Re(),l=_.useNavigate(),c=o.useSelector(e=>e.AppLayout),[u,p]=d.useState(!1),[h,f]=d.useState([]);er(()=>{!0===e.isAuthenticated&&n({endPointURI:"api/v1/public/notifications/new",showMask:!1,successCallBkFn:e=>{e.data.length>h.length&&g.toast.info("ltr"===c.appDirection?"You have new notifications":"لديك اشعارات جديدة",{autoClose:3e3,position:"ltr"===c.appDirection?"bottom-right":"bottom-left",closeOnClick:!0}),f(e.data)}})},1e3);return t.jsx(s.ClickAwayListener,{onClickAway:()=>{p(!1)},children:t.jsxs("div",{style:{cursor:"pointer"},children:[t.jsx(s.IconButton,{color:"inherit",onClick:e=>{r(e.currentTarget),p(!u)},sx:{marginRight:1,marginLeft:1},children:t.jsx(s.Badge,{anchorOrigin:{vertical:"top",horizontal:"ltr"===c.appDirection?"right":"left"},badgeContent:h.filter(e=>void 0===e.isNotified||null===e.isNotified).length,color:"error",children:t.jsx(m.FontAwesomeIcon,{icon:"bell"})})}),t.jsx(s.Popper,{sx:{zIndex:1200,width:"fit-content",minWidth:350,display:"flex",flexDirection:"column"},open:u,anchorEl:i,dir:c.appDirection,placement:"bottom",transition:!0,children:({TransitionProps:e})=>t.jsx(s.Fade,{...e,timeout:350,children:t.jsxs(s.Paper,{sx:{padding:1,m:1,maxHeight:500,overflow:"hidden",display:"flex",flexDirection:"column"},children:[t.jsx(s.Divider,{variant:"fullWidth",flexItem:!0,children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2,marginBottom:1},children:[t.jsx(m.FontAwesomeIcon,{icon:"bell",style:{marginRight:10,marginLeft:10}}),"ltr"===c.appDirection?"Notifications":"الاشعارات"]})}),0==h.length?t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"center"},children:t.jsx(s.Box,{children:"ltr"===c.appDirection?"You don't have any notifications":"لا يوجد اشعارات"})}):t.jsx(t.Fragment,{}),t.jsx(s.Box,{sx:{flex:1,display:"flex",flexDirection:"column",overflowY:"auto"},children:h.map((e,o)=>t.jsx(or,{...e,setOpen:p,showDivider:o<h.length-1}))}),t.jsx(s.Divider,{variant:"fullWidth",flexItem:!0,children:t.jsx(s.Button,{sx:{textTransform:"none"},onClick:()=>{l("myNotifications")},children:"ltr"===c.appDirection?"Show Old Notifications":"عرض الاشعارات القديمة"})})]})})})]})})},rr=e=>{const[o,i]=d.useState(""),[r,n]=d.useState(""),[a,l]=d.useState(""),{handlePostRequest:c}=Re();return t.jsxs(s.Paper,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:400,padding:1},children:[t.jsxs(s.Box,{sx:{m:1,display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",fontWeight:"bold",fontSize:16},children:["Changing Password For : ",e?.selectedPerson?.employeeEnName]}),t.jsx(s.Divider,{variant:"fullWidth",sx:{width:"100%",marginBottom:2}}),e.isSelfService?t.jsx(De,{label:"Current Password",value:o,onChange:e=>{i(e.target.value)},sx:{m:1},fullWidth:!0,type:"password"}):t.jsx(t.Fragment,{}),t.jsx(De,{label:"New Password",value:r,onChange:e=>{n(e.target.value)},sx:{m:1},fullWidth:!0,type:"password"}),t.jsx(De,{label:"Confirm New Password",value:a,onChange:e=>{l(e.target.value)},sx:{m:1},fullWidth:!0,type:"password"}),t.jsx(s.Button,{sx:{m:1},variant:"contained",onClick:()=>{(async()=>{!e.isSelfService||null!==o&&""!==o.trim()?null!==r&&""!==r&&null!==a&&""!==a&&r==a?await c({endPointURI:e.isSelfService?"api/v1/ss/changeMyPassword":"api/v1/admin/changeUserPassword",data:{personId:e?.selectedPerson?.id,currentPassword:o,newPassword:r},successCallBkFn:()=>{e.onSuccessCallBk(),g.toast.success("Your request has been processed successfully")},showMask:!0}):g.toast.error("You must enter new password in required fields and must be identical"):g.toast.error("You must enter your current password to process your request")})()},children:"Change Password"})]})},nr=s.styled(p,{shouldForwardProp:e=>"open"!==e})(({theme:e})=>{const t=o.useSelector(e=>e.AppLayout),i=pe();return{transition:e.transitions.create(["margin","width"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{width:i?void 0:"calc(100% - 350px)",marginLeft:i||"ltr"!==t.appDirection?void 0:"350px",marginRight:i||"rtl"!==t.appDirection?void 0:"350px",transition:e.transitions.create(["margin","width"],{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen})}}]}}),ar=()=>{const{Window:e,setWindowState:i}=Se({windowTitle:"Change Current Organization",windowIcon:"globe",width:"fit-content",height:"fit-content"}),r=o.useSelector(e=>e.AppInfo.value),[n,a]=d.useState(null),l=()=>{a(null)},c=e=>{a(e.currentTarget)},u=o.useSelector(e=>e.AppLayout),p=o.useSelector(e=>e.SideBar),{UserSession:f}=we(),g=f.value.currentOrganization,{Window:T,setWindowState:y}=Se({windowIcon:"key",windowTitle:"Change Password",width:"fit-content",height:"fit-content"}),{handleGetRequest:I}=Re(),_=pe(),E=o.useDispatch();return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx(rr,{selectedPerson:f.value,isSelfService:!0,onSuccessCallBk:()=>{y(!1)}})}),t.jsx(s.Menu,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(n),onClose:l,children:t.jsx(s.MenuItem,{onClick:()=>{y(!0),l()},children:t.jsx(s.Typography,{sx:{textAlign:"center"},children:"Change Password"})})}),t.jsx(e,{children:t.jsx(Qi,{successChangeCallBackFn:()=>{i(!1)}})}),t.jsx(nr,{position:"fixed",open:p.isOpened,children:t.jsxs(h,{children:[t.jsx(s.IconButton,{color:"inherit","aria-label":"open drawer",onClick:()=>{E(Zi())},edge:"start",sx:[{mr:"ltr"===u.appDirection?2:void 0,ml:"rtl"===u.appDirection?2:void 0},p.isOpened&&{display:"none"}],children:t.jsx(m.FontAwesomeIcon,{icon:"bars"})}),_?t.jsx(t.Fragment,{}):t.jsx(Ti,{showAsAvatar:!0,attachmentCode:"ORGANIZATION_LOGOS",refKey:f?.value?.currentOrganization?.id+"",onErrorImage:"/logo.png",style:{marginRight:1,marginLeft:1}}),t.jsx(s.Typography,{variant:"h6",noWrap:!0,component:"div",sx:{flex:1},children:_?"":`${r.appName} - ${"ltr"===u.appDirection?g?.organizationEnName:g?.organizationArName}`}),t.jsx(s.Tooltip,{title:"light"===u.themeMode?"Switch Theme to Dark":"Switch Theme to Light",children:t.jsx(s.IconButton,{color:"inherit",onClick:()=>{E(ge.setThemeMode("light"===u.themeMode?"dark":"light")),localStorage.setItem("themeMode","light"===u.themeMode?"dark":"light")},children:"light"===u.themeMode?t.jsx(m.FontAwesomeIcon,{icon:"moon"}):t.jsx(m.FontAwesomeIcon,{icon:{prefix:"far",iconName:"sun"}})})}),t.jsx(s.Tooltip,{title:"ar"===A.language?"Change Language To English":"Change Language To Arabic",children:t.jsx(s.IconButton,{color:"inherit",onClick:()=>{let e="ar"===A.language?"en":"ar";var t;t=e,A.changeLanguage(t),localStorage.setItem("language",t),E(ge.setAppDirection("ar"===e?"rtl":"ltr"))},children:t.jsx(m.FontAwesomeIcon,{icon:"language"})})}),f.value?.userOrganizations&&f.value?.userOrganizations.length>1?t.jsx(s.Tooltip,{title:"Change Current Organization",children:t.jsx(s.IconButton,{color:"inherit",onClick:()=>{i(!0)},children:t.jsx(m.FontAwesomeIcon,{icon:"globe"})})}):t.jsx(t.Fragment,{}),!0===r?.enableUINotifications?t.jsx(ir,{}):t.jsx(t.Fragment,{}),_?t.jsx(t.Fragment,{}):t.jsx("div",{onClick:c,style:{cursor:"pointer"},children:t.jsx(Ti,{showAsAvatar:!0,onErrorImage:"/no_user.png",attachmentCode:"EMPLOYEE_PHOTOS",refKey:f.value?.id+""})}),t.jsx("div",{style:{marginLeft:5,marginRight:5,cursor:"pointer"},onClick:c,children:_?"":f.value?.username}),t.jsx(s.IconButton,{color:"inherit",onClick:async()=>{try{await I({endPointURI:"api/auth/logout"})}catch(e){}E(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")},children:t.jsx(m.FontAwesomeIcon,{rotation:"rtl"===u.appDirection?180:void 0,icon:"arrow-right-from-bracket"})})]})})]})},sr=s.styled("div")(({theme:e})=>({display:"flex",alignItems:"center",...e.mixins.toolbar,justifyContent:"flex-end"})),lr=(e,t)=>{for(const o of t){if(o.id===e)return o;if(o.children){const t=lr(e,o.children);if(t)return t}}},dr=[...[{id:"home",icon:"home",label:"Home",action:"NAVIGATION",actionPayload:{path:"/"}},{id:"system_admin",label:"System Administration",authority:"SYSTEM_ADMIN",icon:"cog",children:[{id:"system_admin.Person",label:"PERSON_PLURAL",authority:"SYSTEM_ADMIN",icon:"users",action:"NAVIGATION",actionPayload:{path:"admin/persons"}},{id:"system_admin.devtools.rolesx",label:"ROLES",icon:"tag",action:"NAVIGATION",actionPayload:{path:"dev/system/roles"}},{id:"development_admin.SystemApplication",label:"SYSTEM_APPLICATION_PLURAL",authority:"ORGANIZATION_ADMIN",icon:"window-restore",action:"NAVIGATION",actionPayload:{path:"admin/systemapplications"}},{id:"development_admin.organizations",label:"ORGANIZATION_PLURAL",authority:"ORGANIZATION_ADMIN",icon:"globe",action:"NAVIGATION",actionPayload:{path:"admin/organizations"}},{id:"development_admin.organization",label:"Organization Info",authority:"DEVELOPMENT_ADMIN",icon:"globe",children:[{id:"development_admin.organization.modules",label:"Subscriped Modules",icon:"layer-group",authority:"ORGANIZATION_ADMIN",action:"NAVIGATION",actionPayload:{path:"admin/org/apps"}},{id:"development_admin.organization.unitTypes",label:"Organization Unit Types",icon:"tags",action:"NAVIGATION",actionPayload:{path:"admin/org/unit/types"}},{id:"development_admin.organization.units",label:"Organization Units",icon:"folder-tree",action:"NAVIGATION",actionPayload:{path:"admin/org/units"}},{id:"development_admin.organization.ranks",label:"Organization Ranks",icon:"street-view",action:"NAVIGATION",actionPayload:{path:"admin/org/ranks"}}]},{id:"system_admin.devtools",label:"DEVELOPMENT_TOOLS",authority:"DEVELOPMENT_ADMIN",icon:"code",children:[{id:"system_admin.devtools.modules",label:"System Modules",icon:"layer-group",action:"NAVIGATION",actionPayload:{path:"dev/system/modules"}},{id:"system_admin.devtools.authorities",label:"System Authorities",icon:"key",action:"NAVIGATION",actionPayload:{path:"dev/system/authorities"}},{id:"system_admin.devtools.roles",label:"System Roles",icon:"tag",action:"NAVIGATION",actionPayload:{path:"dev/system/roles"}},{id:"system_admin.devtools.lookups",label:"System Lookups",icon:"list-check",action:"NAVIGATION",actionPayload:{path:"dev/system/lookups"}},{id:"system_admin.devtools.DatasourceConnection",label:"DATASOURCE_CONNECTION_PLURAL",icon:"plug",action:"NAVIGATION",actionPayload:{path:"dev/datasourceconnections"}},{id:"system_admin.devtools.EntityParameter",label:"ENTITY_PARAMETER_PLURAL",icon:"p",action:"NAVIGATION",actionPayload:{path:"dev/entityparameters"}},{id:"system_admin.devtools.DataQuery",label:"DATA_QUERY_PLURAL",icon:"file-code",action:"NAVIGATION",actionPayload:{path:"dev/dataqueries"}},{id:"system_admin.devtools.Report",label:"REPORT_PLURAL",icon:"file",action:"NAVIGATION",actionPayload:{path:"dev/reports"}},{id:"system_admin.devtools.MailConfig",label:"Mail Sender Config",icon:{iconName:"paper-plane",prefix:"fas"},action:"NAVIGATION",actionPayload:{path:"dev/mailsender/config"}},{id:"system_admin.devtools.MailTemplate",label:"MAIL_TEMPLATE_PLURAL",icon:"envelope",action:"NAVIGATION",actionPayload:{path:"dev/mailtemplates"}},{id:"system_admin.devtools.WorkflowDocument",label:"WORKFLOW_DOCUMENT_PLURAL",icon:"chart-diagram",action:"NAVIGATION",actionPayload:{path:"dev/workflowdocuments"}},{id:"system_admin.devtools.Widget",label:"WIDGET_PLURAL",icon:"chart-pie",action:"NAVIGATION",actionPayload:{path:"dev/widgets"}},{id:"system_admin.devtools.Dashboard",label:"DASHBOARD_PLURAL",icon:"square-poll-vertical",action:"NAVIGATION",actionPayload:{path:"dev/dashboards"}},{id:"system_admin.devtools.AttachmentConfig",label:"ATTACHMENT_CONFIG_PLURAL",icon:"paperclip",action:"NAVIGATION",actionPayload:{path:"dev/attachmentconfigs"}},{id:"system_admin.devtools.BluePrint",label:"BLUE_PRINT_PLURAL",icon:"fingerprint",action:"NAVIGATION",actionPayload:{path:"dev/blueprints"}},{id:"system_admin.devtools.Notification",label:"NOTIFICATION_PLURAL",icon:"bell",action:"NAVIGATION",actionPayload:{path:"dev/notifications"}}]},{id:"system_admin.followup",label:"SYSTEM_MONITORING",authority:"DEVELOPMENT_ADMIN",icon:"tv",children:[{id:"system_admin.WorkflowDocumentMailLog",label:"Action Mail Logs",icon:"envelopes-bulk",action:"NAVIGATION",actionPayload:{path:"dev/workflowdocumentmaillogs"}},{id:"system_admin.MailNotificationQueue",label:"Mail Notification Queue",icon:"envelope-open-text",action:"NAVIGATION",actionPayload:{path:"dev/mailnotificationqueues"}},{id:"system_admin.NotificationQueue",label:"NOTIFICATION_QUEUE_PLURAL",icon:"bell",action:"NAVIGATION",actionPayload:{path:"dev/notificationqueues"}}]}]}]];function cr(){return t.jsx(W,{sx:{width:6,height:6,borderRadius:"70%",bgcolor:"warning.main",display:"inline-block",verticalAlign:"middle",zIndex:1,mx:1}})}const ur=c.styled(J.TreeItem2Root)(({theme:e})=>({color:e.palette.grey[400],position:"relative",[`& .${$.treeItemClasses.groupTransition}`]:{marginLeft:e.spacing(2.5)},...e.applyStyles("light",{color:e.palette.grey[800]})})),pr=c.styled(J.TreeItem2Content)(({theme:e})=>({flexDirection:"row-reverse",borderRadius:e.spacing(.7),marginBottom:e.spacing(.5),marginTop:e.spacing(.5),padding:e.spacing(.5),paddingRight:e.spacing(1),"&.Mui-expanded ":{"&:not(.Mui-focused, .Mui-selected, .Mui-selected.Mui-focused) .labelIcon":{color:e.palette.primary.dark,...e.applyStyles("light",{color:e.palette.primary.main})},"&::before":{content:'""',display:"block",position:"absolute",left:"16px",top:"44px",height:"calc(100% - 48px)",width:"1.5px",backgroundColor:e.palette.grey[700],...e.applyStyles("light",{backgroundColor:e.palette.grey[300]})}},"&:hover":{backgroundColor:c.alpha(e.palette.primary.main,.1),color:"white",...e.applyStyles("light",{color:e.palette.primary.main})},"&.Mui-focused, &.Mui-selected, &.Mui-selected.Mui-focused":{backgroundColor:e.palette.primary.dark,color:e.palette.primary.contrastText,...e.applyStyles("light",{backgroundColor:e.palette.primary.main})}})),hr=V.animated(z);function mr(e){const o=V.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return t.jsx(hr,{style:o,...e})}const fr=c.styled(F)({color:"inherit",fontWeight:500});function gr({icon:e,expandable:i,children:r,...n}){const{t:a}=y.useTranslation(),s=o.useSelector(e=>e.AppLayout);return t.jsxs(J.TreeItem2Label,{...n,sx:{display:"flex",alignItems:"center",padding:1},children:[t.jsx(m.FontAwesomeIcon,{style:{marginRight:"ltr"===s.appDirection?7:void 0,marginLeft:"rtl"===s.appDirection?7:void 0,fontSize:"1.2rem"},icon:e}),t.jsx(fr,{variant:"body2",sx:{fontSize:16},children:a(r)}),i&&t.jsx(cr,{})]})}const Tr=e=>Array.isArray(e)?e.length>0&&e.some(Tr):Boolean(e),Ar=ce.forwardRef(function(e,o){const{id:i,itemId:r,label:n,disabled:a,children:s,...l}=e,{getRootProps:d,getContentProps:c,getIconContainerProps:u,getCheckboxProps:p,getLabelProps:h,getGroupTransitionProps:m,getDragAndDropOverlayProps:f,status:g,publicAPI:T}=Z.useTreeItem2({id:i,itemId:r,children:s,label:n,disabled:a,rootRef:o}),A=T.getItem(r),y=Tr(s);return t.jsx(ee.TreeItem2Provider,{itemId:r,children:t.jsxs(ur,{...d(l),children:[t.jsxs(pr,{...c({className:ai("content",{"Mui-expanded":g.expanded,"Mui-selected":g.selected,"Mui-focused":g.focused,"Mui-disabled":g.disabled})}),children:[t.jsx(J.TreeItem2IconContainer,{...u(),children:t.jsx(X.TreeItem2Icon,{status:g})}),t.jsx(J.TreeItem2Checkbox,{...p()}),t.jsx(gr,{...h({icon:A?.icon||"book",expandable:y&&g.expanded})}),t.jsx(te.TreeItem2DragAndDropOverlay,{...f()})]}),s&&t.jsx(mr,{...m()})]})})});function yr(){const e=_.useNavigate(),i=o.useSelector(e=>e.AppLayout),r=o.useSelector(e=>e.AppInfo.value),n=o.useDispatch(),a=pe(),{isUserAuthorized:s,isCurrentOrganizationAuthorizedToModule:l}=we(),d=e=>{const t=[];for(let o of e)if((void 0===o.authority||null==o.authority||s(o.authority))&&(void 0===o.applicationModule||null===o.applicationModule||l(o.applicationModule))){let e=structuredClone(o);o?.children&&(e.children=d(o.children)),t.push(e)}return t},c=[];r.enableAdministrationModule&&c.push(...structuredClone(dr)),c.push(...structuredClone(r.businessNavigationItems));const u=d(c);return t.jsx(Q.RichTreeView,{items:u,onItemClick:(t,o)=>{const i=lr(o,c);"NAVIGATION"!==i?.action||null==i?.actionPayload||void 0!==i.children&&null!==i.children&&0!=i.children.length||(e(i?.actionPayload?.path||""),a&&n(Zi()))},sx:{height:"fit-content",flexGrow:1,maxWidth:he,direction:i.appDirection,maxHeight:a?300:void 0,overflowY:"auto",overflowX:"auto"},slots:{item:Ar}})}const Ir=()=>{const e=o.useSelector(e=>e.AppInfo.value),{UserSession:i}=we(),r=i.value.currentOrganization,n=s.useTheme(),a=o.useSelector(e=>e.AppLayout),l=o.useSelector(e=>e.SideBar),d=o.useDispatch();return t.jsxs(K,{sx:{width:he,flexShrink:0,"& .MuiDrawer-paper":{width:he,boxSizing:"border-box"}},variant:"persistent",anchor:"ltr"===a.appDirection?"left":"right",open:l.isOpened,children:[t.jsxs(sr,{children:[t.jsxs(s.Box,{sx:{width:"100%"},children:[t.jsx(s.Typography,{color:"primary",sx:{width:"100%",textAlign:"center",fontSize:18,fontWeight:"bold"},children:"System Content"}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-around",marginTop:1},children:[t.jsx(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:`${e.appName} - ${"ltr"===a.appDirection?r?.organizationEnName:r?.organizationArName}`}),t.jsxs(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:["V.",e.appVersion]})]})]}),t.jsx(Y,{onClick:()=>{d(Zi())},children:"ltr"===n.direction?t.jsx(m.FontAwesomeIcon,{icon:"angle-left"}):t.jsx(m.FontAwesomeIcon,{icon:"angle-right"})})]}),t.jsx(v,{}),t.jsx(yr,{})]})},_r=re({key:"muirtl",stylisPlugins:[ie.prefixer,oe]}),Er=re({key:"mui"}),Or=e=>{const[o,i]=d.useState([]),[r,n]=d.useState([]),{handlePostRequest:a,handleGetRequest:l}=Re();d.useEffect(()=>{e.selectedRecord&&(async()=>{await l({endPointURI:"api/v1/admin/organization/member/roles",showMask:!0,parameters:{orgMemberId:e.selectedRecord.id,organizationId:e.selectedRecord.organizationId},successCallBkFn:e=>{i(e.data.currentRoles),n(e.data.availableRoles)}})})()},[e.selectedRecord]);return t.jsxs(t.Fragment,{children:[t.jsx(Fe,{displayField:"roleName",options:r,valueField:"id",selectedOptions:o,setSelection:i}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",width:"100%"},children:[t.jsx(s.Button,{variant:"contained",onClick:async()=>{await a({endPointURI:"api/v1/admin/organization/member/roles",showMask:!0,parameters:{orgMemberId:e.selectedRecord.id},data:o,successCallBkFn:()=>{g.toast.success("Your request has been proccesed successfully"),e.closeModalFn&&e.closeModalFn()}})},sx:{marginRight:1,marginLeft:1},children:"Save"}),t.jsx(s.Button,{variant:"contained",color:"error",onClick:e.closeModalFn,children:"Cancel"})]})]})},Cr=e=>{const[i,r]=d.useState(null),{Window:n,setWindowState:a}=Se({windowIcon:"tag",windowTitle:"Organization Member Roles",width:"50%"}),s=o.useSelector(e=>e.commonStores.stores.SystemOrganizations.data),l=o.useSelector(e=>e.commonStores.stores.SystemOrganizationRanks.data),c=o.useSelector(e=>e.commonStores.stores.SystemOrganizationUnits.data),{t:u}=y.useTranslation(),[p,h]=d.useState([]),m=xe({findAll:"api/v1/admin/organizationmember/all",deleteById:"api/v1/admin/organizationmember",save:"api/v1/admin/organizationmember",findById:"api/v1/admin/organizationmember",setData:h}),f=[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_IS_DEFAULT",fieldName:"isDefault",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_ID",fieldName:"organizationId",required:!0,fieldType:"combobox",options:s,optionValueField:"id",optionDisplayField:"organizationEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_RANK_ID",fieldName:"organizationRankId",required:!1,fieldType:"combobox",options:l,optionValueField:"id",optionDisplayField:"rankDisplay"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_UNIT_ID",fieldName:"organizationUnitId",required:!1,fieldType:"combobox",options:c,optionValueField:"id",optionDisplayField:"fullPath"}},{type:"field",mode:"props",props:{fieldLabel:"Membership number",fieldName:"organizationMembershipNumber",fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_MEMBER_PERSON_ID",fieldName:"personId",required:!1,fieldType:"number"}}];return t.jsxs(t.Fragment,{children:[t.jsx(n,{children:t.jsx(Or,{selectedRecord:i,closeModalFn:()=>{a(!1)}})}),t.jsx(vi,{apiActions:m,hideInfoBar:!0,data:p,setData:h,editMode:{editMode:"row"},formElements:f,rowActions:[{icon:"tag",label:"Roles",actionFn:async e=>{r(e),a(!0)}}],gridLoadParametersValues:{personId:e.selectedPerson.id},keyColumnName:"id",gridTitle:"ORGANIZATION_MEMBER_PLURAL",girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_EDIT",preActionValidation:async t=>(t.personId=e.selectedPerson.id,!0)},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_DELETE"}})]})},Nr=()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),n=xe({commonStoreKey:"CurrentOrganizationRanks",deleteById:"api/v1/admin/organizationrank",save:"api/v1/admin/organizationrank",findById:"api/v1/admin/organizationrank",setData:r}),{handleGetRequest:a}=Re(),s=o.useSelector(e=>e.commonStores.stores.SystemOrganizationRanks),l=o.useDispatch();return t.jsx(vi,{apiActions:n,data:i,hideInfoBar:!0,setData:r,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_RANK_ORGANIZATION_ID",fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_ORDER",fieldName:"rankOrder",required:!0,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_CODE",fieldName:"rankCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_AR_NAME",fieldName:"rankArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_EN_NAME",fieldName:"rankEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"ORGANIZATION_RANK_PLURAL",girdIcon:"street-view",editAction:{isEnabled:!0,authority:"ORGANIZATION_RANK_EDIT",postActionCallBack:()=>{(async()=>{await a({endPointURI:s.url,showMask:!1,successCallBkFn:e=>{l(ve({storeKey:"SystemOrganizationRanks",data:e.data}))},failureCallBkFn:()=>{l(ve({storeKey:"SystemOrganizationRanks",data:[]}))}})})()}},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_RANK_DELETE"}})},Rr=()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),{handleGetRequest:n}=Re(),a=o.useSelector(e=>e.commonStores.stores.SystemOrganizationUnits),s=o.useDispatch(),l=xe({findAll:"api/v1/public/organizationunit/all",deleteById:"api/v1/admin/organizationunit",save:"api/v1/admin/organizationunit",findById:"api/v1/admin/organizationunit",setData:r}),c=[{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_ID",fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_TYPE_ID",fieldName:"organizationUnitTypeId",required:!0,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemOrganizationUnitType.data),optionValueField:"id",optionDisplayField:"unitTypeEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_AR_NAME",fieldName:"organizationUnitArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_EN_NAME",fieldName:"organizationUnitEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_PARENT_ID",fieldName:"organizationUnitParentId",required:!1,fieldType:"combobox",options:i,optionValueField:"id",optionDisplayField:"organizationUnitEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:l,data:i,hideInfoBar:!0,setData:r,editMode:{editMode:"row"},formElements:c,keyColumnName:"id",gridTitle:"ORGANIZATION_UNIT_PLURAL",girdIcon:"folder-tree",editAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_EDIT",postActionCallBack:()=>{(async()=>{await n({endPointURI:a.url,showMask:!1,successCallBkFn:e=>{s(ve({storeKey:"SystemOrganizationUnits",data:e.data}))},failureCallBkFn:()=>{s(ve({storeKey:"SystemOrganizationUnits",data:[]}))}})})()}},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_DELETE"}})},br=()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({commonStoreKey:"SystemOrganizationUnitType",deleteById:"api/v1/admin/organizationunittype",save:"api/v1/admin/organizationunittype",findById:"api/v1/admin/organizationunittype",setData:i});return t.jsx(vi,{apiActions:r,data:o,hideInfoBar:!0,setData:i,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_ORGANIZATION_ID",hidden:!0,gridProps:{hidden:!0},fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_ORGANIZATION_UNIT_TYPE_ORDER",fieldName:"organizationUnitTypeOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_UNIT_TYPE_CODE",fieldName:"unitTypeCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_UNIT_TYPE_AR_NAME",fieldName:"unitTypeArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_UNIT_TYPE_EN_NAME",fieldName:"unitTypeEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"ORGANIZATION_UNIT_TYPE_PLURAL",girdIcon:"tags",editAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_TYPE_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_TYPE_DELETE"}})},wr=()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),n=xe({commonStoreKey:"SystemApplicationAuthorities",deleteById:"api/v1/admin/systemapplicationauthority",save:"api/v1/admin/systemapplicationauthority",findById:"api/v1/admin/systemapplicationauthority",setData:r}),a=o.useSelector(e=>e.commonStores.stores.SystemApplicationModules.data),{handleGetRequest:s}=Re(),l=[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_SYSTEM_MODULE_ID",fieldName:"systemModuleId",required:!1,fieldType:"combobox",options:a,optionValueField:"id",optionDisplayField:"moduleName"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_NAME",fieldName:"authorityName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_CODE",fieldName:"authorityCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_DESCRIPTION",fieldName:"authorityDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:n,data:i,hideInfoBar:!0,setData:r,editMode:{editMode:"row"},formElements:l,keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_AUTHORITY_PLURAL",girdIcon:"key",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_AUTHORITY_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_AUTHORITY_DELETE"}})},Sr=()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({commonStoreKey:"SystemApplicationModules",deleteById:"api/v1/admin/systemapplicationmodule",save:"api/v1/admin/systemapplicationmodule",findById:"api/v1/admin/systemapplicationmodule",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_MODULE_CODE",fieldName:"moduleCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_MODULE_NAME",fieldName:"moduleName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_MODULE_DESCRIPTION",fieldName:"moduleDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"text"}}],keyColumnName:"id",hideInfoBar:!0,gridTitle:"SYSTEM_APPLICATION_MODULE_PLURAL",girdIcon:"layer-group",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_MODULE_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_MODULE_DELETE"}})},Pr=e=>{const[o,i]=d.useState([]),[r,n]=d.useState([]),{handlePostRequest:a,handleGetRequest:l}=Re();d.useEffect(()=>{e.roleId&&(async()=>{await l({endPointURI:"api/v1/admin/systemApplicationRoleAuthorities",showMask:!0,parameters:{roleId:e.roleId},successCallBkFn:e=>{i(e.data.selectedAuthorities),n(e.data.availableAuthorities)}})})()},[e.roleId]);return t.jsxs(t.Fragment,{children:[t.jsx(Fe,{displayField:"authorityName",options:r,valueField:"id",selectedOptions:o,setSelection:i}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",width:"100%"},children:[t.jsx(s.Button,{variant:"contained",onClick:async()=>{await a({endPointURI:"api/v1/admin/systemApplicationRoleAuthorities",showMask:!0,parameters:{roleId:e.roleId},data:o,successCallBkFn:()=>{g.toast.success("Your request has been proccesed successfully"),e.closeModalFn&&e.closeModalFn()}})},sx:{marginRight:1,marginLeft:1},children:"Save"}),t.jsx(s.Button,{variant:"contained",color:"error",onClick:e.closeModalFn,children:"Cancel"})]})]})},vr=()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),[r,n]=d.useState(null),{Window:a,setWindowState:s}=Se({windowTitle:"System Application Role Authorities",windowIcon:"key",width:"50%"}),l=xe({commonStoreKey:"SystemApplicationRoles",deleteById:"api/v1/admin/systemapplicationrole",save:"api/v1/admin/systemapplicationrole",findById:"api/v1/admin/systemapplicationrole",setData:i});return t.jsxs(t.Fragment,{children:[t.jsx(a,{children:t.jsx(Pr,{roleId:r?.id,closeModalFn:()=>{s(!1)}})}),t.jsx(vi,{apiActions:l,data:o,hideInfoBar:!0,setData:i,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_ROLE_NAME",fieldName:"roleName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_ROLE_DESCRIPTION",fieldName:"roleDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_ROLE_PLURAL",girdIcon:"tag",rowActions:[{icon:"key",actionFn:async e=>{n(e),s(!0)},label:"Authorities"}],editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_DELETE"}})]})},Lr=e=>{const i=o.useSelector(e=>e.commonStores.stores.SystemEntityParameters.data),{t:r}=y.useTranslation(),[n,a]=d.useState([]),s=xe({findAll:"api/v1/dev/dataqueryparameter/all",deleteById:"api/v1/dev/dataqueryparameter",save:"api/v1/dev/dataqueryparameter",findById:"api/v1/dev/dataqueryparameter",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_DATA_QUERY_ID",fieldName:"dataQueryId",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_ENTITY_PARAMETER_ID",fieldName:"entityParameterId",required:!0,fieldType:"combobox",options:i,optionValueField:"id",optionDisplayField:"parameterCode"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_DEFAULT_VALUE",fieldName:"defaultValue",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_HIDDEN",fieldName:"hidden",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_MANDATORY",fieldName:"mandatory",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:s,data:n,setData:a,editMode:{editMode:"row"},hideInfoBar:!0,formElements:l,keyColumnName:"id",gridLoadParametersValues:{dataQueryId:e.selectedRecord.id},gridTitle:r("DATA_QUERY_PARAMETER_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"DATA_QUERY_PARAMETER_EDIT",preActionValidation:async t=>(t.dataQueryId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"DATA_QUERY_PARAMETER_DELETE"}})},Mr=()=>{const e=o.useSelector(e=>e.commonStores.stores.SystemOrganizations.data),{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/dev/lookup/all",deleteById:"api/v1/dev/lookup",save:"api/v1/dev/lookup",findById:"api/v1/dev/lookup",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"Organization",fieldName:"organizationId",options:e,optionDisplayField:"organizationEnName",optionValueField:"id",required:!1,fieldType:"combobox"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_TYPE",fieldName:"lookupType",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_AR_DISPLAY",fieldName:"lookupArDisplay",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_EN_DISPLAY",fieldName:"lookupEnDisplay",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_VALUE",fieldName:"lookupValue",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"System Application",fieldName:"systemApplicationId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,hideInfoBar:!0,editMode:{editMode:"row"},formElements:s,keyColumnName:"id",gridTitle:i("LOOKUP_PLURAL"),girdIcon:"list-check",editAction:{isEnabled:!0,authority:"LOOKUP_EDIT"},deleteAction:{isEnabled:!0,authority:"LOOKUP_DELETE"}})},xr=e=>{const{t:i}=y.useTranslation(),r=o.useSelector(e=>e.commonStores.stores.SystemEntityParameters.data),[n,a]=d.useState([]),s=xe({findAll:"api/v1/dev/reportparameter/all",deleteById:"api/v1/dev/reportparameter",save:"api/v1/dev/reportparameter",findById:"api/v1/dev/reportparameter",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_ENTITY_PARAMETER_ID",fieldName:"entityParameterId",required:!0,fieldType:"combobox",options:r,optionValueField:"id",optionDisplayField:"parameterCode"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_DEFAULT_VALUE",fieldName:"defaultValue",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_HIDDEN",fieldName:"hidden",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_MANDATORY",fieldName:"mandatory",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_REPORT_ID",fieldName:"reportId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}}];return t.jsx(vi,{apiActions:s,data:n,hideInfoBar:!0,setData:a,gridLoadParametersValues:{reportId:e.selectedRecord.id},editMode:{editMode:"row"},formElements:l,keyColumnName:"id",gridTitle:i("REPORT_PARAMETER_PLURAL"),girdIcon:"p",editAction:{isEnabled:!0,authority:"REPORT_PARAMETER_EDIT",preActionValidation:async t=>(t.reportId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"REPORT_PARAMETER_DELETE"}})},Dr=[{value:"FILE_SYSTEM"},{value:"SFTP"}],kr=(e,t,o,i,r)=>{i?("useSysDatasource"===i&&1==r?(t.hideField("datasourceConId"),o.setValue("datasourceConId",null)):t.showField("datasourceConId"),"reportType"===i&&("Blueprint"===r?(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.showField("reportBluePrintId")):"Jasper"===r?(t.showField("storageType"),t.showField("includeAppCodeInPath"),t.showField("useSysDatasource"),t.showField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.showField("reportJasperName"),t.hideField("reportBluePrintId")):"Excel"===r?(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.showField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")):(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")))):(e?.useSysCon&&t.hideField("datasourceConId"),e?.reportType?"Blueprint"===e?.reportType?(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.showField("reportBluePrintId")):"Jasper"===e?.reportType?(t.showField("storageType"),t.showField("includeAppCodeInPath"),t.showField("useSysDatasource"),t.showField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.showField("reportJasperName"),t.hideField("reportBluePrintId")):"Excel"===e?.reportType&&(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.showField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")):(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")))},Ur=e=>{const{t:o}=y.useTranslation(),[i,r]=d.useState([]),n=xe({findAll:"api/v1/dev/mailrecipient/all",deleteById:"api/v1/dev/mailrecipient",save:"api/v1/dev/mailrecipient",findById:"api/v1/dev/mailrecipient",setData:r});return t.jsx(vi,{apiActions:n,data:i,hideInfoBar:!0,gridLoadParametersValues:{mailTemplateId:e.selectedRecord.id},setData:r,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_RECIPIENT_TYPE",fieldName:"recipientType",required:!0,fieldType:"combobox",options:[{value:"To"},{value:"CC"}],optionDisplayField:"value",optionValueField:"value",comboboxValueDataType:"string"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_RECIPIENT_MAIL",fieldName:"recipientMail",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:o("MAIL_RECIPIENT_PLURAL"),girdIcon:"users",editAction:{isEnabled:!0,authority:"MAIL_RECIPIENT_EDIT",preActionValidation:t=>t?.recipientMail&&!pi(t.recipientMail)?(g.toast.error("You must enter a valid email address"),!1):(t.mailTemplateId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"MAIL_RECIPIENT_DELETE"}})},Fr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),s=xe({findAll:"api/v1/dev/mailbody/all",deleteById:"api/v1/dev/mailbody",save:"api/v1/dev/mailbody",findById:"api/v1/dev/mailbody",setData:n}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_NAME",fieldName:"bodyName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_ORDER",fieldName:"bodyOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_CONTENT",fieldName:"bodyContent",required:!0,fieldType:"text",muiTextFieldProps:{multiline:!0,rows:6}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_CONTENT_DATA_QUERY_ID",fieldName:"bodyContentDataQueryId",required:!1,fieldType:"combobox",options:a,optionDisplayField:"queryName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_PRINT_FOR_EACH_RECORD",fieldName:"printForEachRecord",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_IS_MAIN",fieldName:"isMain",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}}];return t.jsx(vi,{apiActions:s,data:r,hideInfoBar:!0,gridLoadParametersValues:{mailTemplateId:e.selectedRecord.id},setData:n,editMode:{editMode:"modal",specs:{modalIcon:{prefix:"fas",iconName:"envelope-open-text"},modalTitle:"Mail Body",modalWidth:"50%"}},formElements:l,keyColumnName:"id",gridTitle:i("MAIL_BODY_PLURAL"),girdIcon:{prefix:"fas",iconName:"envelope-open-text"},editAction:{isEnabled:!0,authority:"MAIL_BODY_EDIT",preActionValidation:async t=>(t.mailTemplateId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"MAIL_BODY_DELETE"}})},Br=e=>{const i=o.useSelector(e=>e.commonStores.stores.SystemReports.data),{t:r}=y.useTranslation(),[n,a]=d.useState([]),s=xe({findAll:"api/v1/dev/mailattachment/all",deleteById:"api/v1/dev/mailattachment",save:"api/v1/dev/mailattachment",findById:"api/v1/dev/mailattachment",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{options:i,optionValueField:"id",optionDisplayField:"reportName",fieldLabel:"REPORT_REPORT_NAME",fieldName:"reportId",required:!0,fieldType:"combobox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_ATTACHMENT_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_ATTACHMENT_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}}];return t.jsx(vi,{apiActions:s,data:n,hideInfoBar:!0,gridLoadParametersValues:{mailTemplateId:e.selectedRecord.id},setData:a,editMode:{editMode:"row"},formElements:l,keyColumnName:"id",gridTitle:r("MAIL_ATTACHMENT_PLURAL"),girdIcon:"paperclip",editAction:{isEnabled:!0,authority:"MAIL_ATTACHMENT_EDIT",preActionValidation:t=>(t.mailTemplateId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"MAIL_ATTACHMENT_DELETE"}})},qr={Gmail:{mailHost:{isMandatory:!0,isVisible:!0},mailPort:{isMandatory:!0,isVisible:!0},mailUsername:{isMandatory:!0,isVisible:!0},mailPassword:{isMandatory:!0,isVisible:!0},mailProtocol:{isMandatory:!0,isVisible:!0},isMailSmtpAuthEnabled:{isMandatory:!0,isVisible:!0},isMailStarttlsEnabled:{isMandatory:!0,isVisible:!0},isSmtpSSlEnabled:{isMandatory:!0,isVisible:!0},azureGraphApiClientId:{isMandatory:!1,isVisible:!1},azureGraphApiClientSecret:{isMandatory:!1,isVisible:!1},azureGraphApiTenantId:{isMandatory:!1,isVisible:!1},azureGraphApiScope:{isMandatory:!1,isVisible:!1},azureGraphApiEmailId:{isMandatory:!1,isVisible:!1}},Azure:{mailHost:{isMandatory:!1,isVisible:!1},mailPort:{isMandatory:!1,isVisible:!1},mailUsername:{isMandatory:!1,isVisible:!1},mailPassword:{isMandatory:!1,isVisible:!1},mailProtocol:{isMandatory:!1,isVisible:!1},isMailSmtpAuthEnabled:{isMandatory:!1,isVisible:!1},isMailStarttlsEnabled:{isMandatory:!1,isVisible:!1},isSmtpSSlEnabled:{isMandatory:!1,isVisible:!1},azureGraphApiClientId:{isMandatory:!0,isVisible:!0},azureGraphApiClientSecret:{isMandatory:!0,isVisible:!0},azureGraphApiTenantId:{isMandatory:!0,isVisible:!0},azureGraphApiScope:{isMandatory:!0,isVisible:!0},azureGraphApiEmailId:{isMandatory:!0,isVisible:!0}}},jr=(e,t,o)=>{if(e&&qr[e]){const i=qr[e],r=Object.keys(i);for(const e of r){i[e].isVisible?t.showField(e):(t.hideField(e),o.setValue(e,null))}}else t.hideField("mailHost"),o.setValue("mailHost",null),t.hideField("mailPort"),o.setValue("mailPort",null),t.hideField("mailUsername"),o.setValue("mailUsername",null),t.hideField("mailPassword"),o.setValue("mailPassword",null),t.hideField("mailProtocol"),o.setValue("mailProtocol",null),t.hideField("isMailSmtpAuthEnabled"),o.setValue("isMailSmtpAuthEnabled",null),t.hideField("isMailStarttlsEnabled"),o.setValue("isMailStarttlsEnabled",null),t.hideField("isSmtpSSlEnabled"),o.setValue("isSmtpSSlEnabled",null),t.hideField("azureGraphApiClientId"),o.setValue("azureGraphApiClientId",null),t.hideField("azureGraphApiClientSecret"),o.setValue("azureGraphApiClientSecret",null),t.hideField("azureGraphApiTenantId"),o.setValue("azureGraphApiTenantId",null),t.hideField("azureGraphApiScope"),o.setValue("azureGraphApiScope",null),t.hideField("azureGraphApiEmailId"),o.setValue("azureGraphApiEmailId",null)},Gr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/dev/workflowdocumentstatus/all",deleteById:"api/v1/dev/workflowdocumentstatus",save:"api/v1/dev/workflowdocumentstatus",findById:"api/v1/dev/workflowdocumentstatus",setData:n}),s=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_DOCUMENT_STATUS_CODE",fieldName:"documentStatusCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Status Arabic Name",fieldName:"documentStatusArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Status English Name",fieldName:"documentStatusEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_DOCUMENT_STATUS_ORDER",fieldName:"documentStatusOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_IS_ZERO_STATE",fieldName:"isZeroState",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"Next Actions Query (must return array of actions in table named workflow_document_action)",fieldName:"nextActionsQueryId",required:!1,fieldType:"combobox",options:s,optionValueField:"id",optionDisplayField:"queryName",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Next Action Takers Query (must return array of persons in table named person)",fieldName:"nextActionTakersQueryId",required:!1,fieldType:"combobox",options:s,optionValueField:"id",optionDisplayField:"queryName",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Next Action Takers Authority",fieldName:"nextActionTakersAuthority",fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_WORKFLOW_DOCUMENT_ID",fieldName:"workflowDocumentId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,hideInfoBar:!0,gridLoadParametersValues:{workflowDocumentId:e.selectedRecord.id},editMode:{editMode:"modal",specs:{modalIcon:"tag",modalTitle:"Workflow Document Status",modalWidth:600}},formElements:l,keyColumnName:"id",gridTitle:i("WORKFLOW_DOCUMENT_STATUS_PLURAL"),girdIcon:"tags",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_STATUS_EDIT",preActionValidation:t=>(t.workflowDocumentId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_STATUS_DELETE"}})},Wr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/dev/workflowdocumentactionmail/all",deleteById:"api/v1/dev/workflowdocumentactionmail",save:"api/v1/dev/workflowdocumentactionmail",findById:"api/v1/dev/workflowdocumentactionmail",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_MAIL_DOCUMENT_ACTION_ID",fieldName:"documentActionId",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_MAIL_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!0,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemMailTemplates.data),optionDisplayField:"mailTemplateName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_MAIL_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,hideInfoBar:!0,gridLoadParametersValues:{actionId:e.selectedRecord.id},setData:n,editMode:{editMode:"row"},formElements:s,keyColumnName:"id",gridTitle:i("WORKFLOW_DOCUMENT_ACTION_MAIL_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_MAIL_EDIT",preActionValidation:t=>(t.documentActionId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_MAIL_DELETE"}})},Hr=e=>{const[o,i]=d.useState(null),{Window:r,setWindowState:n}=Se({windowTitle:"Action Mail Notification",windowIcon:"envelope",width:"50%"}),{t:a}=y.useTranslation(),{handleGetRequest:s}=Re(),[l,c]=d.useState([]);d.useEffect(()=>{(async()=>{await s({endPointURI:"api/v1/dev/workflowdocumentstatus/all",showMask:!0,parameters:{workflowDocumentId:e.selectedRecord.id},successCallBkFn:e=>{c(e.data)}})})()},[e.selectedRecord]);const[u,p]=d.useState([]),h=xe({findAll:"api/v1/dev/workflowdocumentaction/all",deleteById:"api/v1/dev/workflowdocumentaction",save:"api/v1/dev/workflowdocumentaction",findById:"api/v1/dev/workflowdocumentaction",setData:p}),m=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_DOCUMENT_ACTION_CODE",fieldName:"documentActionCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Action Arabic Name",fieldName:"documentActionArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Action English Name",fieldName:"documentActionEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_NEXT_DOCUMENT_STATUS_ID",fieldName:"nextDocumentStatusId",required:!0,fieldType:"combobox",options:l,optionDisplayField:"documentStatusCode",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"Post Action Endpoint ( system will call it with post method and parameters refDocumentId , workflowActionId)",fieldName:"postActionEndpoint",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Pre Action Endpoint ( system will call it with post method and parameters refDocumentId , workflowActionId)",fieldName:"preActionEndpoint",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_REQUIRE_COMMENT",fieldName:"requireComment",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_WORKFLOW_DOCUMENT_ID",fieldName:"workflowDocumentId",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}}];return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Wr,{selectedRecord:o})}),t.jsx(vi,{apiActions:h,data:u,hideInfoBar:!0,gridLoadParametersValues:{workflowDocumentId:e.selectedRecord.id},setData:p,editMode:{editMode:"modal",specs:{modalIcon:"stamp",modalTitle:"Workflow Document Action",modalWidth:700}},rowActions:[{label:"Action Mail Notifications",icon:"envelope",actionFn:async e=>{i(e),n(!0)}}],formElements:m,keyColumnName:"id",gridTitle:a("WORKFLOW_DOCUMENT_ACTION_PLURAL"),girdIcon:"stamp",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_EDIT",preActionValidation:t=>(t.workflowDocumentId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_DELETE"}})]})},Yr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=o.useSelector(e=>e.commonStores.stores.SystemWidgets.data),s=xe({findAll:"api/v1/dev/dashboardwidget/all",deleteById:"api/v1/dev/dashboardwidget",save:"api/v1/dev/dashboardwidget",findById:"api/v1/dev/dashboardwidget",setData:n}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_DASHBOARD_ID",fieldName:"dashboardId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_WIDGET_ID",fieldName:"widgetId",required:!0,fieldType:"combobox",options:a,optionValueField:"id",optionDisplayField:"widgetName"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_WIDGET_ORDER",fieldName:"widgetOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:s,data:r,setData:n,editMode:{editMode:"row"},hideInfoBar:!0,formElements:l,gridLoadParametersValues:{dashboardId:e.selectedRecord.id},keyColumnName:"id",gridTitle:i("DASHBOARD_WIDGET_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"DASHBOARD_WIDGET_EDIT",preActionValidation:async t=>(t.dashboardId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"DASHBOARD_WIDGET_DELETE"}})},Kr=[...[...[{path:"admin/organizations",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({commonStoreKey:"SystemOrganizations",deleteById:"api/v1/org/admin/organization",save:"api/v1/org/admin/organization",findById:"api/v1/org/admin/organization",setData:i}),n=[{type:"field",mode:"props",props:{fieldLabel:"Logo",fieldName:"custom",fieldType:"custom",gridProps:{muiProps:{align:"center",headerAlign:"center",renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(Ti,{showAsAvatar:!0,attachmentCode:"ORGANIZATION_LOGOS",refKey:e.id+""})})}}}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_ORGANIZATION_CODE",fieldName:"organizationCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_ORGANIZATION_AR_NAME",fieldName:"organizationArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_ORGANIZATION_EN_NAME",fieldName:"organizationEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(t.Fragment,{children:t.jsx(vi,{attachment:{attachmentCode:"ORGANIZATION_LOGOS"},apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:n,keyColumnName:"id",gridTitle:"ORGANIZATION_PLURAL",girdIcon:"globe",editAction:{isEnabled:!0,authority:"ORGANIZATION_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_DELETE"}})})},authority:"ORGANIZATION_VIEW"},{path:"admin/organizationmembers",component:Cr,authority:"ORGANIZATION_MEMBER_VIEW"},{path:"admin/organizationmemberroles",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/admin/organizationmemberrole/all",deleteById:"api/v1/admin/organizationmemberrole",save:"api/v1/admin/organizationmemberrole",findById:"api/v1/admin/organizationmemberrole",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_END_DATE",fieldName:"endDate",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_ORGANIZATION_MEMBER_ID",fieldName:"organizationMemberId",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_START_DATE",fieldName:"startDate",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_SYSTEM_APPLICATION_ROLE_ID",fieldName:"systemApplicationRoleId",required:!0,fieldType:"text"}}],keyColumnName:"id",gridTitle:"ORGANIZATION_MEMBER_ROLE_PLURAL",girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_ROLE_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_ROLE_DELETE"}})},authority:"ORGANIZATION_MEMBER_ROLE_VIEW"},{path:"admin/organizationranks",component:Nr,authority:"ORGANIZATION_RANK_VIEW"},{path:"admin/organizationunits",component:Rr,authority:"ORGANIZATION_UNIT_VIEW"},{path:"admin/organizationunittypes",component:br,authority:"ORGANIZATION_UNIT_TYPE_VIEW"},{path:"admin/persons",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState(null),{UserInfo:n}=we(),a=o.useSelector(e=>e.commonStores.stores.CurrentOrganizationRanks.data),l=o.useSelector(e=>e.commonStores.stores.CurrentOrganizationUnits.data),[c,u]=d.useState([]),p=xe({commonStoreKey:"persons",deleteById:"api/v1/admin/person",save:"api/v1/admin/person",findById:"api/v1/admin/person",setData:u}),[h,m]=d.useState(null),{Window:f,setWindowState:T}=Se({windowTitle:"Organizations Membership",windowIcon:"globe"}),{Window:A,setWindowState:I}=Se({windowIcon:"tag",windowTitle:"Organization Member Roles",width:"50%"}),{Window:_,setWindowState:E}=Se({windowIcon:"key",windowTitle:"Change Password",width:"fit-content",height:"fit-content"}),O=[{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"id",fieldName:"id",gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"organizationMemberId",fieldName:"organizationMemberId",gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"Image",fieldName:"custom",fieldType:"custom",gridProps:{muiProps:{align:"center",headerAlign:"center",renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(Ti,{showAsAvatar:!0,attachmentCode:"EMPLOYEE_PHOTOS",refKey:e.id+""})})}}}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_EMPLOYEE_AR_NAME",fieldName:"employeeArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_EMPLOYEE_EN_NAME",fieldName:"employeeEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_EMAIL",fieldName:"email",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_MOBILE_NUMBER",fieldName:"mobileNumber",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_RANK_ID",fieldName:"organizationRankId",required:!1,fieldType:"combobox",options:a,optionValueField:"id",optionDisplayField:"rankEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_UNIT_ID",fieldName:"organizationUnitId",required:!1,fieldType:"combobox",options:l,optionValueField:"id",optionDisplayField:"organizationUnitEnName"}},{type:"field",mode:"props",props:{fieldLabel:"Membership number",fieldName:"organizationMembershipNumber",fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"PERSON_PASSWORD",fieldName:"password",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_USERNAME",fieldName:"username",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"Ref Source",fieldName:"refSource",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"PERSON_EMPLOYEE_NUMBER",fieldName:"refSyncNumber",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(Or,{selectedRecord:h,closeModalFn:()=>{I(!1)}})}),t.jsx(f,{children:t.jsx(Cr,{selectedPerson:i})}),t.jsx(_,{children:t.jsx(rr,{selectedPerson:i,isSelfService:!1,onSuccessCallBk:()=>{E(!1)}})}),t.jsx(vi,{attachment:{attachmentCode:"EMPLOYEE_PHOTOS"},apiActions:p,data:c,setData:u,editMode:{editMode:"modal",specs:{modalIcon:"user",modalTitle:"Person Profile",modalWidth:300}},formElements:O,keyColumnName:"id",gridTitle:"PERSON_PLURAL",rowActions:[{icon:"key",label:"Change User Password",actionFn:async e=>{r(e),E(!0)}},{icon:"tags",label:"Current Organization User Roles",isActionDisabledForRecord:e=>!e?.organizationMemberId,actionFn:async e=>{m({organizationId:n?.currentOrganization?.id,id:e?.organizationMemberId}),I(!0)}},{icon:"globe",label:"User Organizations",actionFn:async e=>{r(e),T(!0)}}],girdIcon:"users",editAction:{isEnabled:!0,authority:"PERSON_EDIT",preActionValidation:e=>null==e.refSource||null==e.refSource||""==e.refSource||(g.toast.error("This Person Was synced from other system therefore you can't modify this record"),!1)},deleteAction:{isEnabled:!0,authority:"PERSON_DELETE",preActionValidation:e=>null==e.refSource||null==e.refSource||""==e.refSource||(g.toast.error("This Person Was synced from other system therefore you can't modify this record"),!1)}})]})},authority:"PERSON_VIEW"},{path:"admin/systemapplications",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/org/admin/systemapplication/all",deleteById:"api/v1/org/admin/systemapplication",save:"api/v1/org/admin/systemapplication",findById:"api/v1/org/admin/systemapplication",setData:i});return t.jsx(t.Fragment,{children:t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_APPLICATION_CODE",fieldName:"applicationCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_APPLICATION_NAME",fieldName:"applicationName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_APPLICATION_DESCRIPTION",fieldName:"applicationDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_PLURAL",girdIcon:"window-restore",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_DELETE"}})})},authority:"SYSTEM_APPLICATION_VIEW"},{path:"admin/systemapplicationauthorities",component:wr,authority:"SYSTEM_APPLICATION_AUTHORITY_VIEW"},{path:"admin/systemapplicationmodules",component:Sr,authority:"SYSTEM_APPLICATION_MODULE_VIEW"},{path:"admin/systemapplicationroles",component:vr,authority:"SYSTEM_APPLICATION_ROLE_VIEW"},{path:"admin/systemapplicationroleauthorities",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/admin/systemapplicationroleauthority/all",deleteById:"api/v1/admin/systemapplicationroleauthority",save:"api/v1/admin/systemapplicationroleauthority",findById:"api/v1/admin/systemapplicationroleauthority",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_AUTHORITY_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_AUTHORITY_SYSTEM_APPLICATION_AUTHORITY_ID",fieldName:"systemApplicationAuthorityId",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_AUTHORITY_SYSTEM_APPLICATION_ROLE_ID",fieldName:"systemApplicationRoleId",required:!0,fieldType:"text"}}],keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_ROLE_AUTHORITY_PLURAL",girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_AUTHORITY_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_AUTHORITY_DELETE"}})},authority:"SYSTEM_APPLICATION_ROLE_AUTHORITY_VIEW"},{path:"admin/org/apps",component:()=>{const{t:e}=y.useTranslation(),{handleGetRequest:i}=Re(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/org/admin/organizationapplicationmodule/all",deleteById:"api/org/v1/admin/organizationapplicationmodule",save:"api/v1/org/admin/organizationapplicationmodule",findById:"api/org/v1/admin/organizationapplicationmodule",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_SYSTEM_APPLICATION_MODULE_ID",fieldName:"systemApplicationModuleId",required:!1,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemApplicationModules.data),optionDisplayField:"moduleName",optionValueField:"id"}},{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_APPLICATION_MODULE_ORGANIZATION_ID",fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_SUBSCRIPTION_DATE",fieldName:"subscriptionDate",required:!0,fieldType:"date"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_EXPIRATION_DATE",fieldName:"expirationDate",required:!1,fieldType:"date"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,hideInfoBar:!0,setData:n,editMode:{editMode:"row"},formElements:s,keyColumnName:"id",gridTitle:"ORGANIZATION_APPLICATION_MODULE_PLURAL",girdIcon:"layer-group",editAction:{isEnabled:!0,authority:"ORGANIZATION_APPLICATION_MODULE_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_APPLICATION_MODULE_DELETE"}})},authority:"ORGANIZATION_ADMIN"},{path:"admin/org/unit/types",component:br,authority:"DEVELOPMENT_ADMIN"},{path:"admin/org/units",component:Rr,authority:"DEVELOPMENT_ADMIN"},{path:"admin/org/ranks",component:Nr,authority:"DEVELOPMENT_ADMIN"}],...[{path:"dev/blueprints",component:()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),[r,n]=d.useState([]),a=xe({commonStoreKey:"SystemBluePrints",deleteById:"api/v1/dev/blueprint",save:"api/v1/dev/blueprint",findById:"api/v1/dev/blueprint",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"BLUE_PRINT_BLUE_PRINT_CODE",fieldName:"bluePrintCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"BLUE_PRINT_QUERY_ID",fieldName:"queryId",required:!0,fieldType:"combobox",options:i,optionDisplayField:"queryName",optionValueField:"id"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,editMode:{editMode:"row",reloadAfterSave:!0},formElements:s,keyColumnName:"id",gridTitle:e("BLUE_PRINT_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"BLUE_PRINT_EDIT"},deleteAction:{isEnabled:!0,authority:"BLUE_PRINT_DELETE"}})},authority:"BLUE_PRINT_VIEW"},{path:"dev/dataqueries",component:()=>{const[e,i]=d.useState(null),{Window:r,setWindowState:n}=Se({width:"50%",windowTitle:"Data query parameters",windowIcon:"p"}),a=o.useSelector(e=>e.commonStores.stores.SystemDataSources.data),{t:s}=y.useTranslation(),[l,c]=d.useState([]),u=xe({commonStoreKey:"SystemDataQueries",deleteById:"api/v1/dev/dataquery",save:"api/v1/dev/dataquery",findById:"api/v1/dev/dataquery",setData:c}),p=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_QUERY_NAME",fieldName:"queryName",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_USE_SYS_CON",fieldName:"useSysCon",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_DATASOURCE_CON_ID",fieldName:"datasourceConId",required:!1,options:a,optionDisplayField:"connectionName",optionValueField:"id",fieldType:"combobox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_QUERY_STR",fieldName:"queryStr",formProps:{fieldHeight:400},gridProps:{hidden:!0},muiTextFieldProps:{multiline:!0,rows:4},required:!1,fieldType:"text"}}];return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Lr,{selectedRecord:e})}),t.jsx(vi,{apiActions:u,rowActions:[{label:"Query Parameters",actionFn:async e=>{i(e),n(!0)},icon:"p"}],data:l,setData:c,editMode:{editMode:"modal",specs:{modalTitle:"System Query",modalWidth:600,modalIcon:"file-code"}},formElements:p,keyColumnName:"id",gridTitle:s("DATA_QUERY_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"DATA_QUERY_EDIT"},deleteAction:{isEnabled:!0,authority:"DATA_QUERY_DELETE"},formProps:{formValuesChangeCallBk:(e,t,o,i,r)=>{i?"useSysCon"===i&&1==r?(t.hideField("datasourceConId"),o.setValue("datasourceConId",null)):t.showField("datasourceConId"):e?.useSysCon&&t.hideField("datasourceConId")}}})]})},authority:"DATA_QUERY_VIEW"},{path:"dev/datasourceconnections",component:()=>{const{handleGetRequest:e}=Re(),i=o.useSelector(e=>e.commonStores.stores.SystemDataSourceType.data),{t:r}=y.useTranslation(),[n,a]=d.useState([]),s=xe({deleteById:"api/v1/dev/datasourceconnection",save:"api/v1/dev/datasourceconnection",findById:"api/v1/dev/datasourceconnection",setData:a,commonStoreKey:"SystemDataSources"}),l=[{type:"field",mode:"props",props:{fieldLabel:"ID",fieldName:"id",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_CONNECTION_NAME",fieldName:"connectionName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_TYPE",fieldName:"datasourceType",required:!0,fieldType:"combobox",options:i,comboboxValueDataType:"string",optionValueField:"value",optionDisplayField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_URL",fieldName:"datasourceUrl",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_USERNAME",fieldName:"datasourceUsername",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_PASSWORD",fieldName:"datasourcePassword",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:s,data:n,setData:a,editMode:{editMode:"modal",specs:{modalTitle:"Datasource Connection",modalIcon:"plug",modalWidth:300}},formElements:l,keyColumnName:"id",gridTitle:r("DATASOURCE_CONNECTION_PLURAL"),girdIcon:"plug",rowActions:[{icon:"plug",label:"test connection",actionFn:async t=>{await e({endPointURI:"api/v1/dev/datasourceConnection/test",showMask:!0,parameters:{id:t.id},successCallBkFn:e=>{g.toast.success(e.data)}})}}],editAction:{isEnabled:!0,authority:"DATASOURCE_CONNECTION_EDIT"},deleteAction:{isEnabled:!0,authority:"DATASOURCE_CONNECTION_DELETE"}})},authority:"DATASOURCE_CONNECTION_VIEW"},{path:"dev/entityparameters",component:()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.commonStores.stores.SystemParameterTypes.data),[r,n]=d.useState([]),a=xe({commonStoreKey:"SystemEntityParameters",deleteById:"api/v1/dev/entityparameter",save:"api/v1/dev/entityparameter",findById:"api/v1/dev/entityparameter",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_CODE",fieldName:"parameterCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_LABEL",fieldName:"parameterLabel",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_TYPE",fieldName:"parameterType",required:!0,fieldType:"combobox",options:i,comboboxValueDataType:"string",optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_DATA_QUERY_ID",fieldName:"parameterDataQueryId",hidden:!0,required:!1,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),optionDisplayField:"queryName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_DATASET",fieldName:"parameterDataset",hidden:!0,required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_DISPLAY_FIELD",fieldName:"parameterDisplayField",hidden:!0,required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_VALUE_FIELD",fieldName:"parameterValueField",hidden:!0,required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_VALUE_FORMAT",fieldName:"parameterValueFormat",required:!1,hidden:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,editMode:{editMode:"modal",specs:{modalTitle:"Entity Parameter",modalIcon:"p",modalWidth:300}},formElements:s,keyColumnName:"id",gridTitle:e("ENTITY_PARAMETER_PLURAL"),girdIcon:"p",formProps:{formValuesChangeCallBk:(e,t,o,i,r,n)=>{i?"parameterType"===i?("combobox"===r?(o.setValue("parameterValueFormat",null),t.showField("parameterDataQueryId"),t.showField("parameterDataset"),t.showField("parameterDisplayField"),t.showField("parameterValueField"),t.hideField("parameterValueFormat")):(t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField")),"date"===r||"datetime"===r?(t.showField("parameterValueFormat"),"date"===r?o.setValue("parameterValueFormat",je):o.setValue("parameterValueFormat",Ge)):(t.hideField("parameterValueFormat"),o.setValue("parameterValueFormat",null))):"parameterDataQueryId"==i?null!=r&&""!=r?(o.setValue("parameterDataset",null),t.hideField("parameterDataset")):t.showField("parameterDataset"):"parameterDataset"==i&&(null!=r&&""!=r?(o.setValue("parameterDataQueryId",null),t.hideField("parameterDataQueryId")):t.showField("parameterDataQueryId")):"combobox"===e?.parameterType?(o.setValue("parameterValueFormat",null),t.showField("parameterDataQueryId"),t.showField("parameterDataset"),t.showField("parameterDisplayField"),t.showField("parameterValueField"),t.hideField("parameterValueFormat")):"date"===e?.parameterType?(t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField"),t.showField("parameterValueFormat"),o.setValue("parameterValueFormat",je)):"datetime"===e?.parameterType?(t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField"),t.showField("parameterValueFormat"),o.setValue("parameterValueFormat",Ge)):(o.setValue("parameterValueFormat",null),t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField"),t.hideField("parameterValueFormat"))}},editAction:{isEnabled:!0,authority:"ENTITY_PARAMETER_EDIT"},deleteAction:{isEnabled:!0,authority:"ENTITY_PARAMETER_DELETE"}})},authority:"ENTITY_PARAMETER_VIEW"},{path:"dev/lookups",component:Mr,authority:"LOOKUP_VIEW"},{path:"dev/reports",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState(null),{Window:n,setWindowState:a}=Se({windowTitle:"Report View",windowIcon:"eye",width:"80%"}),{Window:s,setWindowState:l}=Se({windowTitle:"Report Parameters",windowIcon:"p",width:"80%"}),[c,u]=d.useState([]),p=o.useSelector(e=>e.commonStores.stores.SystemDataSources.data),h=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),m=o.useSelector(e=>e.commonStores.stores.SystemBluePrints.data),f=xe({findAll:"api/v1/dev/report/all",deleteById:"api/v1/dev/report",save:"api/v1/dev/report",findById:"api/v1/dev/report",setData:u}),T=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_TYPE",fieldName:"reportType",options:[{value:"Excel"},{value:"Jasper"},{value:"Blueprint"}],optionDisplayField:"value",optionValueField:"value",required:!0,fieldType:"combobox",comboboxValueDataType:"string"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_CODE",fieldName:"reportCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_NAME",fieldName:"reportName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_STORAGE_TYPE",fieldName:"storageType",required:!1,hidden:!0,gridProps:{hidden:!0},comboboxValueDataType:"string",fieldType:"combobox",options:Dr,optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_CATEGORY",fieldName:"reportCategory",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Authority Code",fieldName:"reportAuthorityCode",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_EXPORT_NAME",fieldName:"reportExportName",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_USE_SYS_DATASOURCE",fieldName:"useSysDatasource",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_DATASOURCE_CON_ID",fieldName:"datasourceConId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"combobox",options:p,optionValueField:"id",optionDisplayField:"connectionName"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_BLUE_PRINT_ID",fieldName:"reportBluePrintId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"combobox",options:m,optionDisplayField:"bluePrintCode",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_EXCEL_DATA_QUERY_ID",fieldName:"reportExcelDataQueryId",hidden:!0,required:!1,fieldType:"combobox",options:h,optionValueField:"id",optionDisplayField:"queryName"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_JASPER_NAME",fieldName:"reportJasperName",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Include App Code in attachment path",fieldName:"includeAppCodeInPath",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"Active",fieldName:"isActive",fieldType:"checkbox"}}];return t.jsxs(t.Fragment,{children:[t.jsx(n,{children:t.jsx(Di,{reportCode:i?.reportCode,resultMode:"App"})}),t.jsx(s,{children:t.jsx(xr,{selectedRecord:i})}),t.jsx(vi,{attachment:{attachmentCode:"JASPER_REPORTS",enableAttachFn:e=>"Jasper"===e?.reportType},apiActions:f,data:c,setData:u,editMode:{editMode:"modal",specs:{modalTitle:"Report",modalIcon:"file",modalWidth:300}},rowActions:[{icon:"p",label:"Report Parameters",isActionVisibleForRecord:e=>"Jasper"===e.reportType,actionFn:async(e,t)=>{r(e),l(!0)}},{icon:"eye",label:"View Report",actionFn:async(e,t)=>{r(e),a(!0)}}],formProps:{formValuesChangeCallBk:kr},formElements:T,keyColumnName:"id",gridTitle:e("REPORT_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"REPORT_EDIT",preActionValidation:e=>"Jasper"!==e?.reportType||!1!==e?.useSysDatasource||e?.datasourceConId?"Jasper"!==e?.reportType||e?.reportJasperName?"Blueprint"!==e?.reportType||e?.reportBluePrintId?!("Excel"===e?.reportType&&!e?.reportExcelDataQueryId)||(g.toast.error("You must choose the report query"),!1):(g.toast.error("You must choose the report blueprint"),!1):(g.toast.error("You must enter the jasper report name"),!1):(g.toast.error("You must choose the datasource"),!1)},deleteAction:{isEnabled:!0,authority:"REPORT_DELETE"}})]})},authority:"REPORT_VIEW"},{path:"dev/mailtemplates",component:()=>{const e=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),i=o.useSelector(e=>e.commonStores.stores.SystemTimeIntervals.data),[r,n]=d.useState(null),{Window:a,setWindowState:s}=Se({windowTitle:"Mail Receipents",windowIcon:"users"}),{Window:l,setWindowState:c}=Se({windowTitle:"Mail Bodies",windowIcon:{prefix:"fas",iconName:"envelope-open-text"}}),{Window:u,setWindowState:p}=Se({windowTitle:"Mail Attachment",windowIcon:"paperclip",width:500}),{t:h}=y.useTranslation(),[m,f]=d.useState([]),T=xe({commonStoreKey:"SystemMailTemplates",deleteById:"api/v1/dev/mailtemplate",save:"api/v1/dev/mailtemplate",findById:"api/v1/dev/mailtemplate",setData:f}),A=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_MAIL_TEMPLATE_CODE",fieldName:"mailTemplateCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_MAIL_TEMPLATE_NAME",fieldName:"mailTemplateName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"group",props:{label:"subject",icon:"users",style:{padding:1,border:"0.5px dashed black",margin:1},elements:[{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_MAIL_SUBJECT",fieldName:"mailSubject",required:!0,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_SUBJECT_DATA_QUERY_ID",fieldName:"subjectDataQueryId",required:!1,fieldType:"combobox",options:e,optionDisplayField:"queryName",optionValueField:"id",gridProps:{hidden:!0}}}]}},{type:"group",props:{label:"Recipients",icon:"users",style:{padding:1,border:"0.5px dashed black",margin:1},elements:[{type:"field",mode:"props",props:{fieldLabel:"To Recipient Query (must return list of objects with property email)",fieldName:"mailToDataQueryId",required:!1,fieldType:"combobox",options:e,optionDisplayField:"queryName",optionValueField:"id",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"CC Recipient Query (must return list of objects with property email)",fieldName:"mailCcDataQueryId",required:!1,fieldType:"combobox",options:e,optionDisplayField:"queryName",optionValueField:"id",gridProps:{hidden:!0}}}]}},{type:"group",props:{label:"Periodical Configuration",icon:"history",style:{padding:1,border:"0.5px dashed black",margin:1},elements:[{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_PERIODICAL",fieldName:"periodical",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_PERIOD_TYPE",fieldName:"periodType",options:i,optionDisplayField:"value",optionValueField:"value",required:!1,fieldType:"combobox",comboboxValueDataType:"string"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_PERIOD_VALUE",fieldName:"periodValue",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_START_SENDING_AT",fieldName:"startSendingAt",required:!1,fieldType:"datetime"}}]}}];return t.jsxs(t.Fragment,{children:[t.jsx(a,{children:t.jsx(Ur,{selectedRecord:r,callBkFn:()=>{s(!1)}})}),t.jsx(l,{children:t.jsx(Fr,{selectedRecord:r,callBkFn:()=>{s(!1)}})}),t.jsx(u,{children:t.jsx(Br,{selectedRecord:r,callBkFn:()=>{p(!1)}})}),t.jsx(vi,{apiActions:T,data:m,setData:f,editMode:{editMode:"modal",specs:{modalWidth:300,modalTitle:"Mail Template",modalIcon:"envelope"}},formElements:A,keyColumnName:"id",gridTitle:h("MAIL_TEMPLATE_PLURAL"),girdIcon:"envelope",rowActions:[{icon:"users",label:"Recipients",actionFn:async e=>{n(e),s(!0)}},{icon:{prefix:"fas",iconName:"envelope-open-text"},label:"Mail Body",actionFn:async e=>{n(e),c(!0)}},{icon:"paperclip",label:"Mail Attachments",actionFn:async e=>{n(e),p(!0)}}],editAction:{isEnabled:!0,authority:"MAIL_TEMPLATE_EDIT",preActionValidation:e=>!0!==e?.periodical||e?.periodType?!0!==e?.periodical||e?.periodValue?!(!0===e?.periodical&&!e?.startSendingAt)||(g.toast.error("You must specifiy the start sending time since this email is periodical"),!1):(g.toast.error("You must specifiy the period value since this email is periodical"),!1):(g.toast.error("You must specifiy the period type since this email is periodical"),!1)},deleteAction:{isEnabled:!0,authority:"MAIL_TEMPLATE_DELETE"}})]})},authority:"MAILTEMPLATE_VIEW"},{path:"dev/mailsender/config",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/dev/mailsenderconfig/all",deleteById:"api/v1/dev/mailsenderconfig",save:"api/v1/dev/mailsenderconfig",findById:"api/v1/dev/mailsenderconfig",setData:i}),n=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Name",fieldName:"configName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Engine",fieldName:"mailEngine",required:!0,fieldType:"combobox",comboboxValueDataType:"string",options:[{value:"Gmail"},{value:"Azure"}],optionDisplayField:"value",optionValueField:"value",formProps:{onValueChangeCallBack(e,t,o,i,r){jr(t,i,o)}}}},{type:"field",mode:"props",props:{fieldLabel:"Hostname",fieldName:"mailHost",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"port",fieldName:"mailPort",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"username",fieldName:"mailUsername",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"password",fieldName:"mailPassword",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Workflow Approval Receive Email",fieldName:"workFlowApprovalReceiveEmail",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Protocol",fieldName:"mailProtocol",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Enable Smtp Auth",fieldName:"isMailSmtpAuthEnabled",required:!1,fieldType:"checkbox",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Enable Start TLS",fieldName:"isMailStarttlsEnabled",required:!1,fieldType:"checkbox",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Enable SSL",fieldName:"isSmtpSSlEnabled",required:!1,fieldType:"checkbox",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Client Id",fieldName:"azureGraphApiClientId",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Secret",fieldName:"azureGraphApiClientSecret",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Tenant Id",fieldName:"azureGraphApiTenantId",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Scope",fieldName:"azureGraphApiScope",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Email Id",fieldName:"azureGraphApiEmailId",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Default",fieldName:"isDefault",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"Active",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"modal",specs:{modalIcon:{iconName:"paper-plane",prefix:"fas"},modalTitle:"Mail Sender Configuration",modalWidth:300}},formElements:n,keyColumnName:"id",gridTitle:e("Mail Sender Configuration"),girdIcon:{iconName:"paper-plane",prefix:"fas"},editAction:{isEnabled:!0,authority:"MAIL_SENDER_CONFIG_EDIT"},deleteAction:{isEnabled:!0,authority:"MAIL_SENDER_CONFIG_DELETE"},formLoadCallBk:(e,t,o)=>{jr(o.mailEngine,e,t)}})},authority:"MAILTEMPLATE_VIEW"},{path:"dev/workflowdocuments",component:()=>{const[e,i]=d.useState(null),{Window:r,setWindowState:n}=Se({windowTitle:"Document Status",windowIcon:"tag"}),{Window:a,setWindowState:s}=Se({windowTitle:"Document Action",windowIcon:"stamp"}),l=o.useSelector(e=>e.commonStores.stores.SystemOrganizations.data),c=o.useSelector(e=>e.commonStores.stores.SystemReports.data),u=o.useSelector(e=>e.commonStores.stores.SystemDataSources.data),{t:p}=y.useTranslation(),[h,m]=d.useState([]),f=xe({commonStoreKey:"SystemWorkflows",deleteById:"api/v1/dev/workflowdocument",save:"api/v1/dev/workflowdocument",findById:"api/v1/dev/workflowdocument",setData:m}),g=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ORG_CODE",fieldName:"orgCode",required:!1,fieldType:"combobox",options:l,optionDisplayField:"organizationCode",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_CODE",fieldName:"documentCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Workflow Document En Display Name",fieldName:"documentEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Workflow Document Ar Display Name",fieldName:"documentArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Report To be Attached For The Document ( will be passed a parameter called doc_id)",fieldName:"documentReportId",required:!1,fieldType:"combobox",options:c,optionDisplayField:"reportName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_APPROVAL_ALLOWED",fieldName:"mailApprovalAllowed",required:!1,fieldType:"checkbox"}},{type:"group",props:{icon:"bell",style:{border:"1px dashed black",padding:1,marginBottom:1},label:"App Visual Notifications",elements:[{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_APP_NOTIFICATION_ICON",fieldName:"appNotificationIcon",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_APP_NOTIFICATION_STYLE",fieldName:"appNotificationStyle",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_APP_VIEW_ROUTE",fieldName:"appViewRoute",required:!1,fieldType:"text"}}]}},{type:"group",props:{icon:"database",style:{border:"1px dashed black",padding:1,marginBottom:1},label:"Related Document Database",elements:[{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_USE_SYSTEM_CON",fieldName:"useSystemCon",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_CON_ID",fieldName:"documentConId",required:!1,fieldType:"combobox",options:u,optionDisplayField:"connectionName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_DATABASE_NAME",fieldName:"documentDatabaseName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_DATABASE_TABLE",fieldName:"documentDatabaseTable",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_ID_FIELD",fieldName:"documentIdField",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_STATUS_FIELD",fieldName:"documentStatusField",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_NUMBER_FIELD",fieldName:"documentNumberField",required:!0,fieldType:"text"}}]}}];return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Gr,{selectedRecord:e})}),t.jsx(a,{children:t.jsx(Hr,{selectedRecord:e})}),t.jsx(vi,{apiActions:f,data:h,setData:m,rowActions:[{icon:"tag",label:"Document States",actionFn:async e=>{i(e),n(!0)}},{icon:"stamp",label:"Document Actions",actionFn:async e=>{i(e),s(!0)}}],editMode:{editMode:"modal",specs:{modalIcon:"chart-diagram",modalTitle:p("WORKFLOW_DOCUMENT_SINGULAR")}},formElements:g,keyColumnName:"id",gridTitle:p("WORKFLOW_DOCUMENT_PLURAL"),girdIcon:"chart-diagram",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_EDIT"},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_DELETE"}})]})},authority:"WORKFLOW_DOCUMENT_VIEW"},{path:"dev/widgets",component:()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),r=o.useSelector(e=>e.commonStores.stores.SystemWidgetTypes.data),[n,a]=d.useState([]),s=xe({commonStoreKey:"SystemWidgets",deleteById:"api/v1/dev/widget",save:"api/v1/dev/widget",findById:"api/v1/dev/widget",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDGET_TYPE",fieldName:"widgetType",required:!0,fieldType:"combobox",comboboxValueDataType:"string",options:r,optionDisplayField:"name",optionValueField:"name"}},{type:"field",mode:"props",props:{fieldLabel:"Query",fieldName:"dataQueryId",required:!0,fieldType:"combobox",options:i,optionDisplayField:"queryName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDGET_NAME",fieldName:"widgetName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_ICON",fieldName:"icon",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_TITLE",fieldName:"title",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDGET_DESCRIPTION",fieldName:"widgetDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_HEIGHT",fieldName:"height",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDTH",fieldName:"width",required:!1,fieldType:"combobox",options:[{value:1},{value:2},{value:3},{value:4},{value:5},{value:6},{value:7},{value:8},{value:9},{value:10},{value:11},{value:12}],optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"group",props:{style:{padding:1,border:"1px solid black",width:"100%"},label:"Data Specs",elements:[{type:"field",mode:"props",props:{fieldLabel:"WIDGET_HORIZONTAL_AXIS_FIELD",fieldName:"horizontalAxisField",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_HORIZONTAL_AXIS_LABEL",fieldName:"horizontalAxisLabel",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_VERTICAL_AXIS_FIELD",fieldName:"verticalAxisField",required:!0,fieldType:"text"}}]}}];return t.jsx(vi,{apiActions:s,data:n,setData:a,editMode:{editMode:"modal",specs:{modalIcon:"chart-pie",modalTitle:"Widget"}},formElements:l,keyColumnName:"id",gridTitle:e("WIDGET_PLURAL"),girdIcon:"chart-pie",editAction:{isEnabled:!0,authority:"WIDGET_EDIT"},deleteAction:{isEnabled:!0,authority:"WIDGET_DELETE"}})},authority:"WIDGET_VIEW"},{path:"dev/dashboards",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState(null),{Window:r,setWindowState:n}=Se({windowTitle:"Dashboard Widgets",windowIcon:"chart-pie"}),[a,s]=d.useState([]),l=_.useNavigate(),c=xe({findAll:"api/v1/dev/dashboard/all",deleteById:"api/v1/dev/dashboard",save:"api/v1/dev/dashboard",findById:"api/v1/dev/dashboard",setData:s});return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Yr,{selectedRecord:o})}),t.jsx(vi,{apiActions:c,data:a,setData:s,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_DASHBOARD_CODE",fieldName:"dashboardCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_DASHBOARD_NAME",fieldName:"dashboardName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_DASHBOARD_TITLE",fieldName:"dashboardTitle",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",rowActions:[{label:"Widgets",icon:"chart-pie",actionFn:async e=>{i(e),n(!0)}},{label:"View",icon:"eye",actionFn:async e=>{l("/dashboard/"+e.dashboardCode)}}],gridTitle:e("DASHBOARD_PLURAL"),girdIcon:"square-poll-vertical",editAction:{isEnabled:!0,authority:"DASHBOARD_EDIT"},deleteAction:{isEnabled:!0,authority:"DASHBOARD_DELETE"}})]})},authority:"DASHBOARD_VIEW"},{path:"dashboard/:dashboardCode",component:zi},{path:"dev/workflowdocumentmaillogs",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/dev/workflowdocumentmaillog/all",deleteById:"api/v1/dev/workflowdocumentmaillog",save:"api/v1/dev/workflowdocumentmaillog",findById:"api/v1/dev/workflowdocumentmaillog",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_GRAPH_API_MSG_ID",fieldName:"graphApiMsgId",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_IS_PROCESSED",fieldName:"isProcessed",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_ACTION_CODE",fieldName:"mailActionCode",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_BODY_CONTENT",fieldName:"mailBodyContent",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_FROM",fieldName:"mailFrom",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_SUBJECT",fieldName:"mailSubject",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_PROCESS_MESSAGE",fieldName:"processMessage",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_PROCESS_TIME",fieldName:"processTime",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_REF_DOC_ID",fieldName:"refDocId",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_WORKFLOW_DOCUMENT_ID",fieldName:"workflowDocumentId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_RECEIVE_TIME",fieldName:"mailReceiveTime",required:!1,fieldType:"datetime"}}],keyColumnName:"id",gridTitle:e("WORKFLOW_DOCUMENT_MAIL_LOG_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_MAIL_LOG_EDIT"},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_MAIL_LOG_DELETE"}})}},{path:"dev/mailnotificationqueues",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),{handlePostRequest:n}=Re(),a=xe({findAll:"api/v1/dev/mailnotificationqueue/all",deleteById:"api/v1/dev/mailnotificationqueue",save:"api/v1/dev/mailnotificationqueue",findById:"api/v1/dev/mailnotificationqueue",setData:r}),s=o.useSelector(e=>e.commonStores.stores.SystemMailTemplates.data),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!1,fieldType:"combobox",options:s,optionDisplayField:"mailTemplateName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_ATTACHED_REPORT_ID",fieldName:"customMailAttachedReportId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_BODY",fieldName:"customMailBody",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_SUBJECT",fieldName:"customMailSubject",required:!1,hidden:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_RECIPIENTS",fieldName:"customRecipients",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_IS_NOTIFIED",fieldName:"isNotified",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_NOTIFICATION_TIME",fieldName:"notificationTime",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_NOTIFICATION_MESSAGE",fieldName:"notificationMessage",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_MAIL_PARAMETERS",fieldName:"mailParameters",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"text"}}];return t.jsx(vi,{apiActions:a,disableDefaultAction:!0,data:i,setData:r,editMode:{editMode:"none"},formElements:l,rowActions:[{actionFn:async e=>{(async e=>{await n({endPointURI:"api/v1/public/mailNotification/resend",showMask:!0,parameters:{mailNotificationQueueId:e},successCallBkFn:e=>{a.reloadData()}})})(e.id)},label:"Resend",icon:"repeat",confirmationMessage:"Are you sure you want to resend this email ?",isConfirmationRequired:!0}],keyColumnName:"id",gridTitle:e("MAIL_NOTIFICATION_QUEUE_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"MAIL_NOTIFICATION_QUEUE_EDIT"},deleteAction:{isEnabled:!0,authority:"MAIL_NOTIFICATION_QUEUE_DELETE"}})}},{path:"dev/system/authorities",component:wr},{path:"dev/system/roles",component:vr},{path:"dev/system/lookups",component:Mr},{path:"dev/system/modules",component:Sr},{path:"dev/attachmentconfigs",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/dev/attachmentconfig/all",deleteById:"api/v1/dev/attachmentconfig",save:"api/v1/dev/attachmentconfig",findById:"api/v1/dev/attachmentconfig",setData:i}),n=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_ATTACHMENT_CODE",fieldName:"attachmentCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_RELATED_DATABASE_TABLE",fieldName:"relatedDatabaseTable",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_STORAGE_TYPE",fieldName:"storageType",required:!0,fieldType:"combobox",comboboxValueDataType:"string",options:Dr,optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"Include App Code in attachment path",fieldName:"includeAppCodeInPath",required:!0,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_UPLOAD_DIRECTORY",fieldName:"uploadDirectory",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_ALLOWED_FILE_TYPES",fieldName:"allowedFileTypes",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_ATTACHMENT_CATEGORIES",fieldName:"attachmentCategories",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Is Category Mandatory",fieldName:"isCategoryRequired",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_MAX_ALLOWED_NUMBER_OF_FILES",fieldName:"maxAllowedNumberOfFiles",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_DOWNLOAD_AUTHORITY_KEY",fieldName:"downloadAuthorityKey",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_UPLOAD_AUTHORITY_KEY",fieldName:"uploadAuthorityKey",required:!1,fieldType:"text"}}];return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"modal",specs:{modalIcon:"paperclip",modalTitle:"Attachment Configuration"}},formElements:n,keyColumnName:"id",gridTitle:e("ATTACHMENT_CONFIG_PLURAL"),girdIcon:"paperclip",editAction:{isEnabled:!0,authority:"ATTACHMENT_CONFIG_EDIT"},deleteAction:{isEnabled:!0,authority:"ATTACHMENT_CONFIG_DELETE"}})}},{path:"dev/notifications",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),n=o.useSelector(e=>e.commonStores.stores.SystemTimeIntervals.data),a=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),l=xe({findAll:"api/v1/dev/notification/all",deleteById:"api/v1/dev/notification",save:"api/v1/dev/notification",findById:"api/v1/dev/notification",setData:r}),c=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_CODE",fieldName:"notificationCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Notification Data Query ( will be passed a parameter call last_run_time represents last check time)",fieldName:"notificationQueryId",required:!0,fieldType:"combobox",options:a,optionDisplayField:"queryName",gridProps:{hidden:!0},optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"Users to notify Query (must have username property in the result set)",fieldName:"usersToNotifyQueryId",required:!1,fieldType:"combobox",options:a,optionDisplayField:"queryName",gridProps:{hidden:!0},optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_AUTHORITY_TO_NOTIFY",fieldName:"authorityToNotify",required:!1,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Interval Type",fieldName:"intervalType",fieldType:"combobox",comboboxValueDataType:"string",options:n,gridProps:{hidden:!0},optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"Interval Value (minmum value 20 seconds)",fieldName:"intervalValue",gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"Start Notifing Date",fieldName:"startNotificationFrom",gridProps:{hidden:!0},fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_ICON",fieldName:"notificationIcon",required:!0,fieldType:"text",gridProps:{muiProps:{renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",color:e?.row?.notificationIconColor,justifyContent:"center",height:"100%"},children:e?.row?.notificationIcon?t.jsx(m.FontAwesomeIcon,{icon:e.row.notificationIcon}):t.jsx(t.Fragment,{})})}}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_AR_TEXT",fieldName:"notificationArText",required:!0,fieldType:"text",gridProps:{muiProps:{renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",color:e?.row?.notificationTextColor,justifyContent:"center",height:"100%"},children:e?.row?.notificationArText})}}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_EN_TEXT",fieldName:"notificationEnText",required:!0,fieldType:"text",gridProps:{muiProps:{renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",color:e?.row?.notificationTextColor,justifyContent:"center",height:"100%"},children:e?.row?.notificationEnText})}}}},{type:"field",mode:"props",props:{fieldLabel:"Last Runtime",disabled:!0,fieldName:"lastIntervalRun",fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"Last Successful Runtime",fieldName:"lastSuccessfulRun",disabled:!0,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"Last Run Message",fieldName:"lastRunMessage",disabled:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_TEXT_COLOR",fieldName:"notificationTextColor",required:!1,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_ICON_COLOR",fieldName:"notificationIconColor",required:!1,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_ACTION",fieldName:"notificationAction",required:!1,fieldType:"combobox",comboboxValueDataType:"string",options:[{value:"NAVIGATION"}],optionDisplayField:"value",optionValueField:"value",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Action Payload (must be a rout in case of NAVIGATION with parameter values betweem @@)",fieldName:"notificationActionPayload",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Organization Id Field on the Notification Query result set if it supports it",fieldName:"organizationIdField",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:l,data:i,setData:r,editMode:{editMode:"modal",specs:{modalIcon:"bell",modalTitle:"System Notification",modalWidth:"300"}},formElements:c,keyColumnName:"id",gridTitle:e("NOTIFICATION_PLURAL"),girdIcon:"bell",editAction:{isEnabled:!0,authority:"NOTIFICATION_EDIT"},deleteAction:{isEnabled:!0,authority:"NOTIFICATION_DELETE"}})}},{path:"myNotifications",component:()=>{const{UserInfo:e}=we(),i=o.useSelector(e=>e.AppLayout),{handleGetRequest:r,handlePostRequest:n}=Re(),[a,l]=d.useState([]),c=o.useSelector(e=>e.AppInfo.value),u=()=>{!0===e.isAuthenticated&&r({endPointURI:"api/v1/public/notifications",showMask:!1,successCallBkFn:e=>{l(e.data)}})};return!0===c?.enableUINotifications&&er(u,1e3),t.jsxs(t.Fragment,{children:[t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.Box,{sx:{flex:1}}),t.jsxs("h3",{children:[t.jsx(m.FontAwesomeIcon,{icon:"bell",style:{marginRight:10,marginLeft:10}}),"ltr"===i.appDirection?"Notifications":"الاشعارات"]}),t.jsx(s.Box,{sx:{flex:1}}),t.jsx(s.Button,{sx:{textTransform:"none"},onClick:async()=>{await n({endPointURI:"api/v1/public/notification/all/notified",showMask:!0})},children:"Mark All Read"}),t.jsx(s.Button,{color:"error",sx:{textTransform:"none"},onClick:async()=>{await n({endPointURI:"api/v1/public/notification/all/archive",showMask:!0})},children:"Delete All"})]}),t.jsx(s.Box,{sx:{flex:1,width:"100%",display:"flex",overflowY:"auto"},children:t.jsx(s.Box,{sx:{flexGrow:1,width:"fit-content",display:"flex",flexDirection:"column",overflowY:"auto",alignItems:"center",justifyContent:"flex-start"},children:a.map((e,o)=>t.jsx(or,{...e,showDivider:o<a.length-1}))})})]})}},{path:"workflow/:workflowDocumentCode/:refDocumentId",component:Fi}]]],Vr=e=>{const{isUserAuthorized:o,isCurrentOrganizationAuthorizedToModule:i}=we();return e?.applicationModule&&!i(e?.applicationModule)?t.jsx(s.Box,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"red"},children:t.jsxs("h2",{children:[t.jsx(m.FontAwesomeIcon,{style:{marginRight:10,marginLeft:10},icon:"cancel"}),"Your organization didn't subscribe for this system module"]})}):e?.authority&&!o(e.authority)?t.jsx(s.Box,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"red"},children:t.jsxs("h2",{children:[t.jsx(m.FontAwesomeIcon,{style:{marginRight:10,marginLeft:10},icon:"cancel"}),"You aren't authorized to access this page"]})}):t.jsx(t.Fragment,{children:e.children})},zr=()=>{const e=o.useSelector(e=>e.AppLayout),i=o.useSelector(e=>e.AppInfo.value),r=o.useSelector(e=>e.AppInfo.value.businessRoutes),{UserInfo:n}=we(),a=o.useDispatch(),{show:c,hide:u}=Ee(),p=o.useSelector(e=>e.commonStores),[h,m]=d.useState(!1),{isUserAuthorized:f}=we(),{handleGetRequest:g}=Re();d.useEffect(()=>{p?.storeKeys&&(async()=>{c("Loading ... please wait"),m(!1);const e=p.stores,t=p.storeKeys;for(let o of t)void 0!==e[o]?.authority&&null!==e[o]?.authority&&!f(e[o]?.authority)||""==e[o]?.url||!0!==e[o].autoLoad||g({endPointURI:e[o].url,showMask:!1,successCallBkFn:e=>{a(ve({storeKey:o,data:e.data}))},failureCallBkFn:()=>{a(ve({storeKey:o,data:[]}))}});m(!0),u()})()},[p.storeKeys,n?.currentOrganization]);const T=pe();return t.jsx(l.CacheProvider,{value:"ltr"===e.appDirection?Er:_r,children:t.jsx(s.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",flex:1,overflow:"hidden",padding:T?1:3},children:t.jsxs(_.Routes,{children:[i.enableAdministrationModule?Kr.map((e,o)=>t.jsx(_.Route,{path:e.path,element:t.jsx(Vr,{authority:e.authority,applicationModule:e.applicationModule,children:t.jsx(e.component,{})})},"adm"+o)):null,r.map((e,o)=>t.jsx(_.Route,{path:e.path,element:t.jsx(Vr,{authority:e.authority,children:t.jsx(e.component,{})})},"bs"+o))]})})})},Qr=c.styled("div")(({theme:e})=>({width:30,height:6,margin:10,backgroundColor:ae.grey[300],borderRadius:3,top:8,...e.applyStyles("dark",{backgroundColor:ae.grey[900]})}));function $r(e){const{window:i}=e,r=o.useSelector(e=>e.SideBar),n=o.useSelector(e=>e.AppInfo.value),a=o.useDispatch(),l=e=>{a(Ji(e))},d=void 0!==i?()=>i().document.body:void 0;return t.jsx(se,{container:d,anchor:"bottom",open:r.isOpened,onClose:()=>{l(!1)},onOpen:()=>{l(!0)},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",height:"100%",overflow:"hidden"},children:[t.jsx(Qr,{}),t.jsx(s.Box,{sx:{flexGrow:1,display:"flex",justifyContent:"center",width:"99%",overflowY:"auto"},children:t.jsx(yr,{})}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-around",marginTop:1,width:"100%"},children:[t.jsx(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:n.appName}),t.jsxs(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:["V.",n.appVersion]})]})]})})}const Zr=()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.loadingMask.value),r=o.useSelector(e=>e.AppLayout);return t.jsxs(s.Backdrop,{dir:r.appDirection,sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:i.isOpened,children:[t.jsx(s.CircularProgress,{color:"inherit"}),t.jsx("div",{style:{marginRight:10,marginLeft:10},children:i?.message||e("DEFAULT_LOADING_MESSAGE")})]})},Jr=()=>{const e=o.useSelector(e=>e.AppInfo.value),[i,r]=d.useState(""),[n,a]=d.useState(""),[c,u]=d.useState(!1),p=o.useSelector(e=>e.UserSession.value),h=o.useDispatch(),m=async()=>{if(null==i||""==i)return void g.toast.error("username is required to proceed");if(null==n||""==n)return void g.toast.error("password is required to proceed");u(!0);let t=null;try{if(t=await T.post(`${e.apiBaseUrl}/api/auth/login`,{username:i,password:n},{withCredentials:!0}),null!=t.data&&""!==t.data){u(!1);const e={...t.data,isAuthenticated:!0};t?.data?.token&&localStorage.setItem("TOKEN",t.data.token),h(Ce.setAuthenticated(e))}}catch(e){u(!1),g.toast.error(e?.response?.data||"failed to authenticate, contact your administrator")}},f=o.useSelector(e=>e.UserSession.value),A=s.createTheme({components:{MuiCssBaseline:{styleOverrides:`\n /* Custom Scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: ${e.appTheme?.dark?.primaryColor||Ye} #121212;\n }\n \n /* Webkit Browsers */\n *::-webkit-scrollbar {\n width: 12px;\n height: 10px;\n } \n `}},palette:{mode:e?.loginScreenStyle?.themeMode||"dark",primary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.primaryColor||We:e.appTheme?.dark?.primaryColor||Ye},secondary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.secondaryColor||He:e.appTheme?.dark?.secondaryColor||Ke}}});return d.useEffect(()=>{(async()=>{if(e?.apiBaseUrl&&null==f.isAuthenticated){const t=localStorage.getItem("TOKEN");try{let o=await T.get(`${e.apiBaseUrl}/api/auth/userInfo`,{withCredentials:!0,headers:{Authorization:`Bearer ${t}`}});if(null!=o&&null!=o.data){const e={...o.data,isAuthenticated:!0};h(Ce.setAuthenticated(e))}else h(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")}catch(e){h(Ce.setUnAuthenticated())}}})()},[e,f.isAuthenticated]),t.jsx(l.ThemeProvider,{theme:A,children:0==p.isAuthenticated?t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100%",backgroundImage:"url('/bg.jpg')",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:0}},children:t.jsx(s.Paper,{sx:{display:"flex",width:"fit-content",padding:2,height:"fit-content",borderRadius:5,alignItems:"center",justifyContent:"center",textAlign:"center",zIndex:1,p:4},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("img",{src:e?.appLogo,width:150,height:150}),t.jsx(s.Typography,{sx:{m:1},variant:"h4",color:"textSecondary",children:e?.appName}),t.jsxs(s.Typography,{sx:{paddingRight:1,width:"100%",textAlign:"right",fontSize:10},variant:"caption",color:"textSecondary",children:["V.",e.appVersion]}),t.jsx(s.TextField,{label:"username",sx:{width:300,m:1},value:i,onChange:e=>{r(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.TextField,{label:"password",sx:{width:300,m:1},value:n,type:"password",onChange:e=>{a(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.Button,{loading:c,onClick:m,variant:"contained",color:"primary",sx:{m:1},children:"login"})]})})}):t.jsxs(s.Paper,{sx:{width:"100%",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.CircularProgress,{sx:{marginRight:1}}),t.jsx("div",{children:"You will be redirected shortly ... please wait"})]})})},Xr=()=>{const[e,i]=d.useState({isLicensed:!0,lastLicenseCheckMessage:"",lastLicenseCheckTime:""}),{handleGetRequest:r}=Re(),n=o.useSelector(e=>e.AppInfo.value);return d.useEffect(()=>{if(n?.checkLicense?.endpoint){const e=setInterval(()=>{(async()=>{n?.checkLicense?.endpoint&&await r({endPointURI:n.checkLicense?.endpoint,successCallBkFn:e=>{i(e.data)}})})()},n?.checkLicense?.interval||6e4);return()=>{clearInterval(e),console.log("Interval cleared")}}},[n]),e.isLicensed?t.jsx(t.Fragment,{}):t.jsxs(s.Box,{sx:{flex:1,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"fixed",top:0,background:"rgba(235, 235, 235, 0.8)",left:0,zIndex:9999},children:[t.jsx("img",{src:n.appLogo,style:{height:200,width:200}}),t.jsxs(s.Typography,{variant:"h5",children:[n.appName," - ",n.appVersion]}),t.jsx(s.Typography,{variant:"h6",color:"error",children:"Your license is missing or has expired."}),t.jsx(s.Typography,{variant:"h6",color:"error",children:"Please reach out to your vendor for assistance."}),t.jsxs(s.Typography,{children:["License Check @",e?.lastLicenseCheckTime||"--------"]}),t.jsxs(s.Typography,{children:["License Check Result :"," ",e?.lastLicenseCheckMessage||"--------"]})]})},en=({msalInstance:e})=>{const i=o.useSelector(e=>e.AppInfo.value);o.useSelector(e=>e.UserSession.value);const[r,n]=d.useState(!1),{handleGetRequest:a}=Re(),c=o.useDispatch(),u=async()=>{localStorage.getItem("TOKEN")?i?.apiBaseUrl&&a({endPointURI:"api/auth/userInfo",showMask:!0,successCallBkFn:e=>{if(n(!1),null!=e&&null!=e.data){const t={...e.data,isAuthenticated:!0};c(Ce.setAuthenticated(t))}else c(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")},failureCallBkFn:()=>{n(!1)}}):(c(Ce.setUnAuthenticated()),n(!1))},p=o.useSelector(e=>e.UserSession.value);d.useEffect(()=>{u()},[i]);const h=s.createTheme({components:{MuiCssBaseline:{styleOverrides:`\n /* Custom Scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: ${i.appTheme?.dark?.primaryColor||Ye} #121212;\n }\n \n /* Webkit Browsers */\n *::-webkit-scrollbar {\n width: 12px;\n height: 10px;\n } \n `}},palette:{mode:i?.loginScreenStyle?.themeMode||"dark",primary:{main:"light"===i?.loginScreenStyle?.themeMode?i.appTheme?.light?.primaryColor||We:i.appTheme?.dark?.primaryColor||Ye},secondary:{main:"light"===i?.loginScreenStyle?.themeMode?i.appTheme?.light?.secondaryColor||He:i.appTheme?.dark?.secondaryColor||Ke}}});return t.jsx(l.ThemeProvider,{theme:h,children:0==p.isAuthenticated?t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100%",backgroundImage:"url('/bg.jpg')",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:0}},children:t.jsx(s.Paper,{sx:{display:"flex",width:"fit-content",padding:2,height:"fit-content",borderRadius:5,alignItems:"center",justifyContent:"center",textAlign:"center",zIndex:1,p:4},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("img",{src:i?.appLogo,width:150,height:150}),t.jsx(s.Typography,{sx:{m:1},variant:"h4",color:"textSecondary",children:i?.appName}),t.jsxs(s.Typography,{sx:{paddingRight:1,width:"100%",textAlign:"right",fontSize:10},variant:"caption",color:"textSecondary",children:["V.",i.appVersion]}),t.jsx(s.Button,{loading:r,onClick:async()=>{n(!0);const t=await e.acquireTokenPopup({scopes:i?.azureConfiguration?.scopes});t?.accessToken?(localStorage.setItem("TOKEN",t.accessToken),u()):n(!1)},variant:"contained",color:"primary",sx:{m:1},startIcon:t.jsx(m.FontAwesomeIcon,{icon:{iconName:"microsoft",prefix:"fab"}}),children:"login"})]})})}):t.jsxs(s.Paper,{sx:{width:"100%",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.CircularProgress,{sx:{marginRight:1}}),t.jsx("div",{children:"You will be redirected shortly ... please wait"})]})})},tn=()=>{const e=o.useSelector(e=>e.AppInfo.value),[i,r]=d.useState(""),[n,a]=d.useState(""),[c,u]=d.useState(!1),p=o.useSelector(e=>e.UserSession.value),h=o.useDispatch(),m=async()=>{if(null==i||""==i)return void g.toast.error("username is required to proceed");if(null==n||""==n)return void g.toast.error("password is required to proceed");u(!0);let t=null;try{if(t=await T.post(`${e.apiBaseUrl}/api/auth/login`,{username:i,password:n},{withCredentials:!0}),null!=t.data&&""!==t.data){u(!1);const e={...t.data,isAuthenticated:!0};t?.data?.token&&localStorage.setItem("TOKEN",t.data.token),h(Ce.setAuthenticated(e))}}catch(e){u(!1),g.toast.error(e?.response?.data||"failed to authenticate, contact your administrator")}},f=o.useSelector(e=>e.UserSession.value),A=s.createTheme({components:{MuiCssBaseline:{styleOverrides:`\n /* Custom Scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: ${e.appTheme?.dark?.primaryColor||Ye} #121212;\n }\n \n /* Webkit Browsers */\n *::-webkit-scrollbar {\n width: 12px;\n height: 10px;\n } \n `}},palette:{mode:e?.loginScreenStyle?.themeMode||"dark",primary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.primaryColor||We:e.appTheme?.dark?.primaryColor||Ye},secondary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.secondaryColor||He:e.appTheme?.dark?.secondaryColor||Ke}}});return d.useEffect(()=>{(async()=>{if(e?.apiBaseUrl&&null==f.isAuthenticated){const t=localStorage.getItem("TOKEN");try{let o=await T.get(`${e.apiBaseUrl}/api/auth/userInfo`,{withCredentials:!0,headers:{Authorization:`Bearer ${t}`}});if(null!=o&&null!=o.data){const e={...o.data,isAuthenticated:!0};h(Ce.setAuthenticated(e))}else h(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")}catch(e){h(Ce.setUnAuthenticated())}}})()},[e,f.isAuthenticated]),t.jsx(l.ThemeProvider,{theme:A,children:0==p.isAuthenticated?t.jsxs(s.Paper,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100%"},children:[t.jsx("img",{src:e?.appLogo,width:70,height:70}),t.jsx(s.Typography,{sx:{m:1},variant:"caption",color:"textSecondary",children:e?.appName}),t.jsxs(s.Typography,{sx:{paddingRight:1,width:200,textAlign:"right",fontSize:10},variant:"caption",color:"textSecondary",children:["V.",e.appVersion]}),t.jsx(s.TextField,{label:"username",sx:{width:200,m:1},value:i,onChange:e=>{r(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.TextField,{label:"password",sx:{width:200,m:1},value:n,type:"password",onChange:e=>{a(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.Button,{loading:c,onClick:m,variant:"contained",color:"primary",sx:{m:1},children:"login"})]}):t.jsxs(s.Paper,{sx:{width:"100%",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.CircularProgress,{sx:{marginRight:1}}),t.jsx("div",{children:"You will be redirected shortly ... please wait"})]})})},on=c.styled("main",{shouldForwardProp:e=>"open"!==e})(({theme:e,open:t})=>{const i=o.useSelector(e=>e.AppLayout),r=c.useTheme(),n=pe();return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,width:!n&&t?"calc(100% - 350px)":"100%",direction:i.appDirection,justifyContent:"flex-start",transition:!0===t?r.transitions.create(["margin","width"],{easing:r.transitions.easing.easeOut,duration:r.transitions.duration.enteringScreen}):r.transitions.create(["margin","width"],{easing:r.transitions.easing.sharp,duration:r.transitions.duration.leavingScreen}),marginLeft:n||"ltr"!==i.appDirection||!0!==t?0:he+"px",marginRight:n||"rtl"!==i.appDirection||!0!==t?0:he+"px"}}),rn=({msalInstance:e})=>{const i=o.useSelector(e=>e.SideBar),r=o.useSelector(e=>e.AppInfo.value),n=pe(),a=o.useSelector(e=>e.UserSession),s=o.useSelector(e=>e.AppLayout);return t.jsxs(_.BrowserRouter,{children:[t.jsx(g.ToastContainer,{rtl:"rtl"===s.appDirection,draggable:!0,position:"bottom-center"}),t.jsx(Zr,{}),!0===a.value.isAuthenticated?t.jsxs(on,{open:i.isOpened,children:[t.jsx(u,{}),t.jsx(ar,{}),n?null:t.jsx(Ir,{}),n?t.jsx($r,{}):null,t.jsx(sr,{}),t.jsx(zr,{}),t.jsx(Xr,{})]}):"AZURE"===r.authenticationMethod?t.jsx(en,{msalInstance:e}):n?t.jsx(tn,{}):t.jsx(Jr,{})]})},nn=f.createSlice({name:"AppInfo",initialState:{value:{documentTitle:null,apiBaseUrl:null,authenticationMethod:"APP",appName:null,appVersion:null,appLogo:null,muiPremiumKey:null,enableAdministrationModule:!1,enableUINotifications:!1,businessRoutes:[],businessNavigationItems:[],businessReduxReducers:{},businessCommonStoresMetaData:{},appTheme:{light:{primaryColor:"#37505C",secondaryColor:"#ff6d00"},dark:{primaryColor:"#ea690e",secondaryColor:"#74776B"}}}},reducers:{setAppInfo:(e,t)=>{e.value=t.payload}}}),an=nn.actions;var sn=nn.reducer;const ln={SystemDataSourceType:{autoLoad:!1,data:[{value:"Mysql"},{value:"Oracle"},{value:"DB2"}],url:""},SystemParameterTypes:{autoLoad:!1,url:"",data:[{value:"text"},{value:"number"},{value:"date"},{value:"datetime"},{value:"combobox"},{value:"checkbox"},{value:"html"},{value:"lookup"}]},SystemReportTypes:{autoLoad:!1,url:"",data:[{value:"Excel"},{value:"Jasper"},{value:"Blueprint"}]},SystemWorkflows:{autoLoad:!0,url:"api/v1/dev/workflowdocument/all",authority:"DEVELOPMENT_ADMIN",data:[]},SystemWidgetTypes:{autoLoad:!1,url:"",data:[{name:"LineChart"},{name:"ColumnChart"},{name:"PieChart"},{name:"Card"},{name:"CircularProgress"},{name:"LinearProgress"}]},SystemTimeIntervals:{autoLoad:!1,url:"",data:[{value:"second"},{value:"minute"},{value:"hour"},{value:"day"},{value:"week"},{value:"month"},{value:"year"}]},SystemMailRecipientTypes:{autoLoad:!1,url:"",data:[{name:"To"},{name:"CC"}]},SystemOrganizations:{autoLoad:!0,url:"api/v1/public/organization/all",data:[]},SystemOrganizationRanks:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organization/ranks/all",data:[]},CurrentOrganizationRanks:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organizationrank/all",data:[]},SystemOrganizationUnits:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organization/units/all",data:[]},CurrentOrganizationUnits:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organizationunit/all",data:[]},SystemOrganizationUnitType:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organizationunittype/all",data:[]},SystemDataSources:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/datasourceconnection/all"},SystemDataQueries:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/dataquery/all"},SystemBluePrints:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/blueprint/all"},SystemReports:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/report/all"},SystemEntityParameters:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/entityparameter/all"},SystemMailTemplates:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/mailtemplate/all"},SystemWidgets:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/widget/all"},SystemApplicationModules:{autoLoad:!0,data:[],authority:"SYSTEM_ADMIN",url:"api/v1/admin/systemapplicationmodule/application/all"},SystemApplicationAuthorities:{autoLoad:!0,data:[],authority:"SYSTEM_ADMIN",url:"api/v1/admin/systemapplicationauthority/all"},SystemApplicationRoles:{autoLoad:!0,data:[],authority:"SYSTEM_ADMIN",url:"api/v1/admin/systemapplicationrole/all"},persons:{autoLoad:!0,data:[],url:"api/v1/public/person/all"}},dn={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},cn=200,un=400,pn=400,hn=499,mn=500,fn=599,gn="GET",Tn="POST",An=[dn.OPENID_SCOPE,dn.PROFILE_SCOPE,dn.OFFLINE_ACCESS_SCOPE],yn=[...An,dn.EMAIL_SCOPE],In="Content-Type",_n="Content-Length",En="Retry-After",On="X-AnchorMailbox",Cn="x-ms-request-id",Nn="x-ms-httpver",Rn="active-account-filters",bn="common",wn="organizations",Sn="consumers",Pn="access_token",vn="xms_cc",Ln="login",Mn="select_account",xn="consent",Dn="none",kn="no_session",Un="code",Fn="id_token token refresh_token",Bn="query",qn="fragment",jn="query",Gn="authorization_code",Wn="refresh_token",Hn="MSSTS",Yn="ADFS",Kn="Generic",Vn="-",zn=".",Qn={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},$n="appmetadata",Zn="1",Jn="authority-metadata",Xn=86400,ea="config",ta="cache",oa="network",ia="hardcoded_values",ra={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},na={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},aa=60,sa=3600,la="throttling",da="retry-after, h429",ca="invalid_grant",ua="client_mismatch",pa="1",ha="3",ma="4",fa="2",ga="4",Ta="5",Aa="0",ya="1",Ia="2",_a="3",Ea="4",Oa="pop",Ca="unexpected_error",Na="post_request_failed",Ra={[Ca]:"Unexpected error in authentication.",[Na]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};
37
+ `,or=e=>{const i=_.useNavigate(),r=o.useSelector(e=>e.AppLayout),{handlePostRequest:n}=Re();return t.jsxs(t.Fragment,{children:[t.jsxs(s.Button,{fullWidth:!0,onClick:()=>{var t;"NAVIGATION"===e?.notificationAction&&e?.notificationActionPayload&&i(e.notificationActionPayload),e?.isNotified||(t=e.id,n({endPointURI:"api/v1/public/notification/notified",showMask:!1,parameters:{notificationQueueId:t}})),e?.setOpen&&e.setOpen(!1)},sx:{marginBottom:1,justifyContent:"flex-start",alignItems:"flex-start",color:e?.notificationTextColor,display:"flex",flexDirection:"column",cursor:"pointer"},children:[t.jsxs(s.Box,{sx:{cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%"},children:[e?.notificationIcon?t.jsx(m.FontAwesomeIcon,{icon:e.notificationIcon,style:{marginRight:10,marginLeft:10,color:e?.notificationIconColor}}):t.jsx(t.Fragment,{}),"ltr"===r.appDirection?e.notificationEnText:e.notificationArText,t.jsx(s.Box,{sx:{flex:1}}),e?.isNotified?t.jsx(t.Fragment,{}):t.jsxs(s.Typography,{color:"warning",sx:{animation:`${tr} 2s infinite ease-in-out`,textTransform:"none",display:"inline-block"},children:[t.jsx(m.FontAwesomeIcon,{icon:"bell",style:{marginRight:5,marginLeft:5}}),"ltr"===r.appDirection?"New":"جديد"]})]}),t.jsxs(s.Box,{sx:{width:"100%",fontSize:12,display:"flex",justifyContent:"flex-end",alignItems:"center",cursor:"pointer"},children:[t.jsx(s.Box,{sx:{marginRight:1,marginLeft:1},children:hi(e.createTime,r.appDirection)}),t.jsx(s.Box,{sx:{flex:1}}),t.jsx(s.Box,{sx:{marginRight:1,marginLeft:1},children:e.createTime})]})]}),e?.showDivider?t.jsx(s.Divider,{flexItem:!0}):t.jsx(t.Fragment,{})]})},ir=()=>{const{UserInfo:e}=we(),[i,r]=d.useState(null),{handleGetRequest:n,handlePostRequest:a}=Re(),l=_.useNavigate(),c=o.useSelector(e=>e.AppLayout),[u,p]=d.useState(!1),[h,f]=d.useState([]);er(()=>{!0===e.isAuthenticated&&n({endPointURI:"api/v1/public/notifications/new",showMask:!1,successCallBkFn:e=>{e.data.length>h.length&&g.toast.info("ltr"===c.appDirection?"You have new notifications":"لديك اشعارات جديدة",{autoClose:3e3,position:"ltr"===c.appDirection?"bottom-right":"bottom-left",closeOnClick:!0}),f(e.data)}})},1e3);return t.jsx(s.ClickAwayListener,{onClickAway:()=>{p(!1)},children:t.jsxs("div",{style:{cursor:"pointer"},children:[t.jsx(s.IconButton,{color:"inherit",onClick:e=>{r(e.currentTarget),p(!u)},sx:{marginRight:1,marginLeft:1},children:t.jsx(s.Badge,{anchorOrigin:{vertical:"top",horizontal:"ltr"===c.appDirection?"right":"left"},badgeContent:h.filter(e=>void 0===e.isNotified||null===e.isNotified).length,color:"error",children:t.jsx(m.FontAwesomeIcon,{icon:"bell"})})}),t.jsx(s.Popper,{sx:{zIndex:1200,width:"fit-content",minWidth:350,display:"flex",flexDirection:"column"},open:u,anchorEl:i,dir:c.appDirection,placement:"bottom",transition:!0,children:({TransitionProps:e})=>t.jsx(s.Fade,{...e,timeout:350,children:t.jsxs(s.Paper,{sx:{padding:1,m:1,maxHeight:500,overflow:"hidden",display:"flex",flexDirection:"column"},children:[t.jsx(s.Divider,{variant:"fullWidth",flexItem:!0,children:t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",marginTop:2,marginBottom:1},children:[t.jsx(m.FontAwesomeIcon,{icon:"bell",style:{marginRight:10,marginLeft:10}}),"ltr"===c.appDirection?"Notifications":"الاشعارات"]})}),0==h.length?t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",flex:1,justifyContent:"center"},children:t.jsx(s.Box,{children:"ltr"===c.appDirection?"You don't have any notifications":"لا يوجد اشعارات"})}):t.jsx(t.Fragment,{}),t.jsx(s.Box,{sx:{flex:1,display:"flex",flexDirection:"column",overflowY:"auto"},children:h.map((e,o)=>t.jsx(or,{...e,setOpen:p,showDivider:o<h.length-1}))}),t.jsx(s.Divider,{variant:"fullWidth",flexItem:!0,children:t.jsx(s.Button,{sx:{textTransform:"none"},onClick:()=>{l("myNotifications")},children:"ltr"===c.appDirection?"Show Old Notifications":"عرض الاشعارات القديمة"})})]})})})]})})},rr=e=>{const[o,i]=d.useState(""),[r,n]=d.useState(""),[a,l]=d.useState(""),{handlePostRequest:c}=Re();return t.jsxs(s.Paper,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",width:400,padding:1},children:[t.jsxs(s.Box,{sx:{m:1,display:"flex",alignItems:"center",justifyContent:"flex-start",width:"100%",fontWeight:"bold",fontSize:16},children:["Changing Password For : ",e?.selectedPerson?.employeeEnName]}),t.jsx(s.Divider,{variant:"fullWidth",sx:{width:"100%",marginBottom:2}}),e.isSelfService?t.jsx(De,{label:"Current Password",value:o,onChange:e=>{i(e.target.value)},sx:{m:1},fullWidth:!0,type:"password"}):t.jsx(t.Fragment,{}),t.jsx(De,{label:"New Password",value:r,onChange:e=>{n(e.target.value)},sx:{m:1},fullWidth:!0,type:"password"}),t.jsx(De,{label:"Confirm New Password",value:a,onChange:e=>{l(e.target.value)},sx:{m:1},fullWidth:!0,type:"password"}),t.jsx(s.Button,{sx:{m:1},variant:"contained",onClick:()=>{(async()=>{!e.isSelfService||null!==o&&""!==o.trim()?null!==r&&""!==r&&null!==a&&""!==a&&r==a?await c({endPointURI:e.isSelfService?"api/v1/ss/changeMyPassword":"api/v1/admin/changeUserPassword",data:{personId:e?.selectedPerson?.id,currentPassword:o,newPassword:r},successCallBkFn:()=>{e.onSuccessCallBk(),g.toast.success("Your request has been processed successfully")},showMask:!0}):g.toast.error("You must enter new password in required fields and must be identical"):g.toast.error("You must enter your current password to process your request")})()},children:"Change Password"})]})},nr=s.styled(p,{shouldForwardProp:e=>"open"!==e})(({theme:e})=>{const t=o.useSelector(e=>e.AppLayout),i=pe();return{transition:e.transitions.create(["margin","width"],{easing:e.transitions.easing.sharp,duration:e.transitions.duration.leavingScreen}),variants:[{props:({open:e})=>e,style:{width:i?void 0:"calc(100% - 350px)",marginLeft:i||"ltr"!==t.appDirection?void 0:"350px",marginRight:i||"rtl"!==t.appDirection?void 0:"350px",transition:e.transitions.create(["margin","width"],{easing:e.transitions.easing.easeOut,duration:e.transitions.duration.enteringScreen})}}]}}),ar=()=>{const{Window:e,setWindowState:i}=Se({windowTitle:"Change Current Organization",windowIcon:"globe",width:"fit-content",height:"fit-content"}),r=o.useSelector(e=>e.AppInfo.value),[n,a]=d.useState(null),l=()=>{a(null)},c=e=>{a(e.currentTarget)},u=o.useSelector(e=>e.AppLayout),p=o.useSelector(e=>e.SideBar),{UserSession:f}=we(),g=f.value.currentOrganization,{Window:T,setWindowState:y}=Se({windowIcon:"key",windowTitle:"Change Password",width:"fit-content",height:"fit-content"}),{handleGetRequest:I}=Re(),_=pe(),E=o.useDispatch();return t.jsxs(t.Fragment,{children:[t.jsx(T,{children:t.jsx(rr,{selectedPerson:f.value,isSelfService:!0,onSuccessCallBk:()=>{y(!1)}})}),t.jsx(s.Menu,{sx:{mt:"45px"},id:"menu-appbar",anchorEl:n,anchorOrigin:{vertical:"top",horizontal:"right"},keepMounted:!0,transformOrigin:{vertical:"top",horizontal:"right"},open:Boolean(n),onClose:l,children:t.jsx(s.MenuItem,{onClick:()=>{y(!0),l()},children:t.jsx(s.Typography,{sx:{textAlign:"center"},children:"Change Password"})})}),t.jsx(e,{children:t.jsx(Qi,{successChangeCallBackFn:()=>{i(!1)}})}),t.jsx(nr,{position:"fixed",open:p.isOpened,children:t.jsxs(h,{children:[t.jsx(s.IconButton,{color:"inherit","aria-label":"open drawer",onClick:()=>{E(Zi())},edge:"start",sx:[{mr:"ltr"===u.appDirection?2:void 0,ml:"rtl"===u.appDirection?2:void 0},p.isOpened&&{display:"none"}],children:t.jsx(m.FontAwesomeIcon,{icon:"bars"})}),_?t.jsx(t.Fragment,{}):t.jsx(Ti,{showAsAvatar:!0,attachmentCode:"ORGANIZATION_LOGOS",refKey:f?.value?.currentOrganization?.id+"",onErrorImage:"/logo.png",style:{marginRight:1,marginLeft:1}}),t.jsx(s.Typography,{variant:"h6",noWrap:!0,component:"div",sx:{flex:1},children:_?"":`${r.appName} - ${"ltr"===u.appDirection?g?.organizationEnName:g?.organizationArName}`}),t.jsx(s.Tooltip,{title:"light"===u.themeMode?"Switch Theme to Dark":"Switch Theme to Light",children:t.jsx(s.IconButton,{color:"inherit",onClick:()=>{E(ge.setThemeMode("light"===u.themeMode?"dark":"light")),localStorage.setItem("themeMode","light"===u.themeMode?"dark":"light")},children:"light"===u.themeMode?t.jsx(m.FontAwesomeIcon,{icon:"moon"}):t.jsx(m.FontAwesomeIcon,{icon:{prefix:"far",iconName:"sun"}})})}),t.jsx(s.Tooltip,{title:"ar"===A.language?"Change Language To English":"Change Language To Arabic",children:t.jsx(s.IconButton,{color:"inherit",onClick:()=>{let e="ar"===A.language?"en":"ar";var t;t=e,A.changeLanguage(t),localStorage.setItem("language",t),E(ge.setAppDirection("ar"===e?"rtl":"ltr"))},children:t.jsx(m.FontAwesomeIcon,{icon:"language"})})}),f.value?.userOrganizations&&f.value?.userOrganizations.length>1?t.jsx(s.Tooltip,{title:"Change Current Organization",children:t.jsx(s.IconButton,{color:"inherit",onClick:()=>{i(!0)},children:t.jsx(m.FontAwesomeIcon,{icon:"globe"})})}):t.jsx(t.Fragment,{}),!0===r?.enableUINotifications?t.jsx(ir,{}):t.jsx(t.Fragment,{}),_?t.jsx(t.Fragment,{}):t.jsx("div",{onClick:c,style:{cursor:"pointer"},children:t.jsx(Ti,{showAsAvatar:!0,onErrorImage:"/no_user.png",attachmentCode:"EMPLOYEE_PHOTOS",refKey:f.value?.id+""})}),t.jsx("div",{style:{marginLeft:5,marginRight:5,cursor:"pointer"},onClick:c,children:_?"":f.value?.username}),t.jsx(s.IconButton,{color:"inherit",onClick:async()=>{try{await I({endPointURI:"api/auth/logout"})}catch(e){}E(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")},children:t.jsx(m.FontAwesomeIcon,{rotation:"rtl"===u.appDirection?180:void 0,icon:"arrow-right-from-bracket"})})]})})]})},sr=s.styled("div")(({theme:e})=>({display:"flex",alignItems:"center",...e.mixins.toolbar,justifyContent:"flex-end"})),lr=(e,t)=>{for(const o of t){if(o.id===e)return o;if(o.children){const t=lr(e,o.children);if(t)return t}}},dr=[...[{id:"home",icon:"home",label:"Home",action:"NAVIGATION",actionPayload:{path:"/"}},{id:"system_admin",label:"System Administration",authority:"SYSTEM_ADMIN",icon:"cog",children:[{id:"system_admin.Person",label:"PERSON_PLURAL",authority:"SYSTEM_ADMIN",icon:"users",action:"NAVIGATION",actionPayload:{path:"admin/persons"}},{id:"system_admin.devtools.rolesx",label:"ROLES",icon:"tag",action:"NAVIGATION",actionPayload:{path:"dev/system/roles"}},{id:"development_admin.SystemApplication",label:"SYSTEM_APPLICATION_PLURAL",authority:"ORGANIZATION_ADMIN",icon:"window-restore",action:"NAVIGATION",actionPayload:{path:"admin/systemapplications"}},{id:"development_admin.organizations",label:"ORGANIZATION_PLURAL",authority:"ORGANIZATION_ADMIN",icon:"globe",action:"NAVIGATION",actionPayload:{path:"admin/organizations"}},{id:"development_admin.organization",label:"Organization Info",authority:"DEVELOPMENT_ADMIN",icon:"globe",children:[{id:"development_admin.organization.modules",label:"Subscriped Modules",icon:"layer-group",authority:"ORGANIZATION_ADMIN",action:"NAVIGATION",actionPayload:{path:"admin/org/apps"}},{id:"development_admin.organization.unitTypes",label:"Organization Unit Types",icon:"tags",action:"NAVIGATION",actionPayload:{path:"admin/org/unit/types"}},{id:"development_admin.organization.units",label:"Organization Units",icon:"folder-tree",action:"NAVIGATION",actionPayload:{path:"admin/org/units"}},{id:"development_admin.organization.ranks",label:"Organization Ranks",icon:"street-view",action:"NAVIGATION",actionPayload:{path:"admin/org/ranks"}}]},{id:"system_admin.devtools",label:"DEVELOPMENT_TOOLS",authority:"DEVELOPMENT_ADMIN",icon:"code",children:[{id:"system_admin.devtools.modules",label:"System Modules",icon:"layer-group",action:"NAVIGATION",actionPayload:{path:"dev/system/modules"}},{id:"system_admin.devtools.authorities",label:"System Authorities",icon:"key",action:"NAVIGATION",actionPayload:{path:"dev/system/authorities"}},{id:"system_admin.devtools.roles",label:"System Roles",icon:"tag",action:"NAVIGATION",actionPayload:{path:"dev/system/roles"}},{id:"system_admin.devtools.lookups",label:"System Lookups",icon:"list-check",action:"NAVIGATION",actionPayload:{path:"dev/system/lookups"}},{id:"system_admin.devtools.DatasourceConnection",label:"DATASOURCE_CONNECTION_PLURAL",icon:"plug",action:"NAVIGATION",actionPayload:{path:"dev/datasourceconnections"}},{id:"system_admin.devtools.EntityParameter",label:"ENTITY_PARAMETER_PLURAL",icon:"p",action:"NAVIGATION",actionPayload:{path:"dev/entityparameters"}},{id:"system_admin.devtools.DataQuery",label:"DATA_QUERY_PLURAL",icon:"file-code",action:"NAVIGATION",actionPayload:{path:"dev/dataqueries"}},{id:"system_admin.devtools.Report",label:"REPORT_PLURAL",icon:"file",action:"NAVIGATION",actionPayload:{path:"dev/reports"}},{id:"system_admin.devtools.MailConfig",label:"Mail Sender Config",icon:{iconName:"paper-plane",prefix:"fas"},action:"NAVIGATION",actionPayload:{path:"dev/mailsender/config"}},{id:"system_admin.devtools.MailTemplate",label:"MAIL_TEMPLATE_PLURAL",icon:"envelope",action:"NAVIGATION",actionPayload:{path:"dev/mailtemplates"}},{id:"system_admin.devtools.WorkflowDocument",label:"WORKFLOW_DOCUMENT_PLURAL",icon:"chart-diagram",action:"NAVIGATION",actionPayload:{path:"dev/workflowdocuments"}},{id:"system_admin.devtools.Widget",label:"WIDGET_PLURAL",icon:"chart-pie",action:"NAVIGATION",actionPayload:{path:"dev/widgets"}},{id:"system_admin.devtools.Dashboard",label:"DASHBOARD_PLURAL",icon:"square-poll-vertical",action:"NAVIGATION",actionPayload:{path:"dev/dashboards"}},{id:"system_admin.devtools.AttachmentConfig",label:"ATTACHMENT_CONFIG_PLURAL",icon:"paperclip",action:"NAVIGATION",actionPayload:{path:"dev/attachmentconfigs"}},{id:"system_admin.devtools.BluePrint",label:"BLUE_PRINT_PLURAL",icon:"fingerprint",action:"NAVIGATION",actionPayload:{path:"dev/blueprints"}},{id:"system_admin.devtools.Notification",label:"NOTIFICATION_PLURAL",icon:"bell",action:"NAVIGATION",actionPayload:{path:"dev/notifications"}}]},{id:"system_admin.followup",label:"SYSTEM_MONITORING",authority:"DEVELOPMENT_ADMIN",icon:"tv",children:[{id:"system_admin.WorkflowDocumentMailLog",label:"Action Mail Logs",icon:"envelopes-bulk",action:"NAVIGATION",actionPayload:{path:"dev/workflowdocumentmaillogs"}},{id:"system_admin.MailNotificationQueue",label:"Mail Notification Queue",icon:"envelope-open-text",action:"NAVIGATION",actionPayload:{path:"dev/mailnotificationqueues"}},{id:"system_admin.NotificationQueue",label:"NOTIFICATION_QUEUE_PLURAL",icon:"bell",action:"NAVIGATION",actionPayload:{path:"dev/notificationqueues"}}]}]}]];function cr(){return t.jsx(W,{sx:{width:6,height:6,borderRadius:"70%",bgcolor:"warning.main",display:"inline-block",verticalAlign:"middle",zIndex:1,mx:1}})}const ur=c.styled(J.TreeItem2Root)(({theme:e})=>({color:e.palette.grey[400],position:"relative",[`& .${$.treeItemClasses.groupTransition}`]:{marginLeft:e.spacing(2.5)},...e.applyStyles("light",{color:e.palette.grey[800]})})),pr=c.styled(J.TreeItem2Content)(({theme:e})=>({flexDirection:"row-reverse",borderRadius:e.spacing(.7),marginBottom:e.spacing(.5),marginTop:e.spacing(.5),padding:e.spacing(.5),paddingRight:e.spacing(1),"&.Mui-expanded ":{"&:not(.Mui-focused, .Mui-selected, .Mui-selected.Mui-focused) .labelIcon":{color:e.palette.primary.dark,...e.applyStyles("light",{color:e.palette.primary.main})},"&::before":{content:'""',display:"block",position:"absolute",left:"16px",top:"44px",height:"calc(100% - 48px)",width:"1.5px",backgroundColor:e.palette.grey[700],...e.applyStyles("light",{backgroundColor:e.palette.grey[300]})}},"&:hover":{backgroundColor:c.alpha(e.palette.primary.main,.1),color:"white",...e.applyStyles("light",{color:e.palette.primary.main})},"&.Mui-focused, &.Mui-selected, &.Mui-selected.Mui-focused":{backgroundColor:e.palette.primary.dark,color:e.palette.primary.contrastText,...e.applyStyles("light",{backgroundColor:e.palette.primary.main})}})),hr=V.animated(z);function mr(e){const o=V.useSpring({to:{opacity:e.in?1:0,transform:`translate3d(0,${e.in?0:20}px,0)`}});return t.jsx(hr,{style:o,...e})}const fr=c.styled(F)({color:"inherit",fontWeight:500});function gr({icon:e,expandable:i,children:r,...n}){const{t:a}=y.useTranslation(),s=o.useSelector(e=>e.AppLayout);return t.jsxs(J.TreeItem2Label,{...n,sx:{display:"flex",alignItems:"center",padding:1},children:[t.jsx(m.FontAwesomeIcon,{style:{marginRight:"ltr"===s.appDirection?7:void 0,marginLeft:"rtl"===s.appDirection?7:void 0,fontSize:"1.2rem"},icon:e}),t.jsx(fr,{variant:"body2",sx:{fontSize:16},children:a(r)}),i&&t.jsx(cr,{})]})}const Tr=e=>Array.isArray(e)?e.length>0&&e.some(Tr):Boolean(e),Ar=ce.forwardRef(function(e,o){const{id:i,itemId:r,label:n,disabled:a,children:s,...l}=e,{getRootProps:d,getContentProps:c,getIconContainerProps:u,getCheckboxProps:p,getLabelProps:h,getGroupTransitionProps:m,getDragAndDropOverlayProps:f,status:g,publicAPI:T}=Z.useTreeItem2({id:i,itemId:r,children:s,label:n,disabled:a,rootRef:o}),A=T.getItem(r),y=Tr(s);return t.jsx(ee.TreeItem2Provider,{itemId:r,children:t.jsxs(ur,{...d(l),children:[t.jsxs(pr,{...c({className:ai("content",{"Mui-expanded":g.expanded,"Mui-selected":g.selected,"Mui-focused":g.focused,"Mui-disabled":g.disabled})}),children:[t.jsx(J.TreeItem2IconContainer,{...u(),children:t.jsx(X.TreeItem2Icon,{status:g})}),t.jsx(J.TreeItem2Checkbox,{...p()}),t.jsx(gr,{...h({icon:A?.icon||"book",expandable:y&&g.expanded})}),t.jsx(te.TreeItem2DragAndDropOverlay,{...f()})]}),s&&t.jsx(mr,{...m()})]})})});function yr(){const e=_.useNavigate(),i=o.useSelector(e=>e.AppLayout),r=o.useSelector(e=>e.AppInfo.value),n=o.useDispatch(),a=pe(),{isUserAuthorized:s,isCurrentOrganizationAuthorizedToModule:l}=we(),d=e=>{const t=[];for(let o of e)if((void 0===o.authority||null==o.authority||s(o.authority))&&(void 0===o.applicationModule||null===o.applicationModule||l(o.applicationModule))){let e=structuredClone(o);o?.children&&(e.children=d(o.children)),t.push(e)}return t},c=[];r.enableAdministrationModule&&c.push(...structuredClone(dr)),c.push(...structuredClone(r.businessNavigationItems));const u=d(c);return t.jsx(Q.RichTreeView,{items:u,onItemClick:(t,o)=>{const i=lr(o,c);"NAVIGATION"===i?.action&&null!=i?.actionPayload&&(e(i?.actionPayload?.path||""),a&&n(Zi()))},sx:{height:"fit-content",flexGrow:1,maxWidth:he,direction:i.appDirection,maxHeight:a?300:void 0,overflowY:"auto",overflowX:"auto"},slots:{item:Ar}})}const Ir=()=>{const e=o.useSelector(e=>e.AppInfo.value),{UserSession:i}=we(),r=i.value.currentOrganization,n=s.useTheme(),a=o.useSelector(e=>e.AppLayout),l=o.useSelector(e=>e.SideBar),d=o.useDispatch();return t.jsxs(K,{sx:{width:he,flexShrink:0,"& .MuiDrawer-paper":{width:he,boxSizing:"border-box"}},variant:"persistent",anchor:"ltr"===a.appDirection?"left":"right",open:l.isOpened,children:[t.jsxs(sr,{children:[t.jsxs(s.Box,{sx:{width:"100%"},children:[t.jsx(s.Typography,{color:"primary",sx:{width:"100%",textAlign:"center",fontSize:18,fontWeight:"bold"},children:"System Content"}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-around",marginTop:1},children:[t.jsx(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:`${e.appName} - ${"ltr"===a.appDirection?r?.organizationEnName:r?.organizationArName}`}),t.jsxs(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:["V.",e.appVersion]})]})]}),t.jsx(Y,{onClick:()=>{d(Zi())},children:"ltr"===n.direction?t.jsx(m.FontAwesomeIcon,{icon:"angle-left"}):t.jsx(m.FontAwesomeIcon,{icon:"angle-right"})})]}),t.jsx(v,{}),t.jsx(yr,{})]})},_r=re({key:"muirtl",stylisPlugins:[ie.prefixer,oe]}),Er=re({key:"mui"}),Or=e=>{const[o,i]=d.useState([]),[r,n]=d.useState([]),{handlePostRequest:a,handleGetRequest:l}=Re();d.useEffect(()=>{e.selectedRecord&&(async()=>{await l({endPointURI:"api/v1/admin/organization/member/roles",showMask:!0,parameters:{orgMemberId:e.selectedRecord.id,organizationId:e.selectedRecord.organizationId},successCallBkFn:e=>{i(e.data.currentRoles),n(e.data.availableRoles)}})})()},[e.selectedRecord]);return t.jsxs(t.Fragment,{children:[t.jsx(Fe,{displayField:"roleName",options:r,valueField:"id",selectedOptions:o,setSelection:i}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",width:"100%"},children:[t.jsx(s.Button,{variant:"contained",onClick:async()=>{await a({endPointURI:"api/v1/admin/organization/member/roles",showMask:!0,parameters:{orgMemberId:e.selectedRecord.id},data:o,successCallBkFn:()=>{g.toast.success("Your request has been proccesed successfully"),e.closeModalFn&&e.closeModalFn()}})},sx:{marginRight:1,marginLeft:1},children:"Save"}),t.jsx(s.Button,{variant:"contained",color:"error",onClick:e.closeModalFn,children:"Cancel"})]})]})},Cr=e=>{const[i,r]=d.useState(null),{Window:n,setWindowState:a}=Se({windowIcon:"tag",windowTitle:"Organization Member Roles",width:"50%"}),s=o.useSelector(e=>e.commonStores.stores.SystemOrganizations.data),l=o.useSelector(e=>e.commonStores.stores.SystemOrganizationRanks.data),c=o.useSelector(e=>e.commonStores.stores.SystemOrganizationUnits.data),{t:u}=y.useTranslation(),[p,h]=d.useState([]),m=xe({findAll:"api/v1/admin/organizationmember/all",deleteById:"api/v1/admin/organizationmember",save:"api/v1/admin/organizationmember",findById:"api/v1/admin/organizationmember",setData:h}),f=[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_IS_DEFAULT",fieldName:"isDefault",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_ID",fieldName:"organizationId",required:!0,fieldType:"combobox",options:s,optionValueField:"id",optionDisplayField:"organizationEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_RANK_ID",fieldName:"organizationRankId",required:!1,fieldType:"combobox",options:l,optionValueField:"id",optionDisplayField:"rankDisplay"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_UNIT_ID",fieldName:"organizationUnitId",required:!1,fieldType:"combobox",options:c,optionValueField:"id",optionDisplayField:"fullPath"}},{type:"field",mode:"props",props:{fieldLabel:"Membership number",fieldName:"organizationMembershipNumber",fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_MEMBER_PERSON_ID",fieldName:"personId",required:!1,fieldType:"number"}}];return t.jsxs(t.Fragment,{children:[t.jsx(n,{children:t.jsx(Or,{selectedRecord:i,closeModalFn:()=>{a(!1)}})}),t.jsx(vi,{apiActions:m,hideInfoBar:!0,data:p,setData:h,editMode:{editMode:"row"},formElements:f,rowActions:[{icon:"tag",label:"Roles",actionFn:async e=>{r(e),a(!0)}}],gridLoadParametersValues:{personId:e.selectedPerson.id},keyColumnName:"id",gridTitle:"ORGANIZATION_MEMBER_PLURAL",girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_EDIT",preActionValidation:async t=>(t.personId=e.selectedPerson.id,!0)},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_DELETE"}})]})},Nr=()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),n=xe({commonStoreKey:"CurrentOrganizationRanks",deleteById:"api/v1/admin/organizationrank",save:"api/v1/admin/organizationrank",findById:"api/v1/admin/organizationrank",setData:r}),{handleGetRequest:a}=Re(),s=o.useSelector(e=>e.commonStores.stores.SystemOrganizationRanks),l=o.useDispatch();return t.jsx(vi,{apiActions:n,data:i,hideInfoBar:!0,setData:r,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_RANK_ORGANIZATION_ID",fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_ORDER",fieldName:"rankOrder",required:!0,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_CODE",fieldName:"rankCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_AR_NAME",fieldName:"rankArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_RANK_EN_NAME",fieldName:"rankEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_RANK_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"ORGANIZATION_RANK_PLURAL",girdIcon:"street-view",editAction:{isEnabled:!0,authority:"ORGANIZATION_RANK_EDIT",postActionCallBack:()=>{(async()=>{await a({endPointURI:s.url,showMask:!1,successCallBkFn:e=>{l(ve({storeKey:"SystemOrganizationRanks",data:e.data}))},failureCallBkFn:()=>{l(ve({storeKey:"SystemOrganizationRanks",data:[]}))}})})()}},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_RANK_DELETE"}})},Rr=()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),{handleGetRequest:n}=Re(),a=o.useSelector(e=>e.commonStores.stores.SystemOrganizationUnits),s=o.useDispatch(),l=xe({findAll:"api/v1/public/organizationunit/all",deleteById:"api/v1/admin/organizationunit",save:"api/v1/admin/organizationunit",findById:"api/v1/admin/organizationunit",setData:r}),c=[{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_ID",fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_TYPE_ID",fieldName:"organizationUnitTypeId",required:!0,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemOrganizationUnitType.data),optionValueField:"id",optionDisplayField:"unitTypeEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_AR_NAME",fieldName:"organizationUnitArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_EN_NAME",fieldName:"organizationUnitEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ORGANIZATION_UNIT_PARENT_ID",fieldName:"organizationUnitParentId",required:!1,fieldType:"combobox",options:i,optionValueField:"id",optionDisplayField:"organizationUnitEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:l,data:i,hideInfoBar:!0,setData:r,editMode:{editMode:"row"},formElements:c,keyColumnName:"id",gridTitle:"ORGANIZATION_UNIT_PLURAL",girdIcon:"folder-tree",editAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_EDIT",postActionCallBack:()=>{(async()=>{await n({endPointURI:a.url,showMask:!1,successCallBkFn:e=>{s(ve({storeKey:"SystemOrganizationUnits",data:e.data}))},failureCallBkFn:()=>{s(ve({storeKey:"SystemOrganizationUnits",data:[]}))}})})()}},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_DELETE"}})},br=()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({commonStoreKey:"SystemOrganizationUnitType",deleteById:"api/v1/admin/organizationunittype",save:"api/v1/admin/organizationunittype",findById:"api/v1/admin/organizationunittype",setData:i});return t.jsx(vi,{apiActions:r,data:o,hideInfoBar:!0,setData:i,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_ORGANIZATION_ID",hidden:!0,gridProps:{hidden:!0},fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_ORGANIZATION_UNIT_TYPE_ORDER",fieldName:"organizationUnitTypeOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_UNIT_TYPE_CODE",fieldName:"unitTypeCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_UNIT_TYPE_AR_NAME",fieldName:"unitTypeArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_UNIT_TYPE_EN_NAME",fieldName:"unitTypeEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_UNIT_TYPE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"ORGANIZATION_UNIT_TYPE_PLURAL",girdIcon:"tags",editAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_TYPE_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_UNIT_TYPE_DELETE"}})},wr=()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),n=xe({commonStoreKey:"SystemApplicationAuthorities",deleteById:"api/v1/admin/systemapplicationauthority",save:"api/v1/admin/systemapplicationauthority",findById:"api/v1/admin/systemapplicationauthority",setData:r}),a=o.useSelector(e=>e.commonStores.stores.SystemApplicationModules.data),{handleGetRequest:s}=Re(),l=[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_SYSTEM_MODULE_ID",fieldName:"systemModuleId",required:!1,fieldType:"combobox",options:a,optionValueField:"id",optionDisplayField:"moduleName"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_NAME",fieldName:"authorityName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_CODE",fieldName:"authorityCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_AUTHORITY_DESCRIPTION",fieldName:"authorityDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_AUTHORITY_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:n,data:i,hideInfoBar:!0,setData:r,editMode:{editMode:"row"},formElements:l,keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_AUTHORITY_PLURAL",girdIcon:"key",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_AUTHORITY_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_AUTHORITY_DELETE"}})},Sr=()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({commonStoreKey:"SystemApplicationModules",deleteById:"api/v1/admin/systemapplicationmodule",save:"api/v1/admin/systemapplicationmodule",findById:"api/v1/admin/systemapplicationmodule",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_MODULE_CODE",fieldName:"moduleCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_MODULE_NAME",fieldName:"moduleName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_MODULE_DESCRIPTION",fieldName:"moduleDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_MODULE_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"text"}}],keyColumnName:"id",hideInfoBar:!0,gridTitle:"SYSTEM_APPLICATION_MODULE_PLURAL",girdIcon:"layer-group",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_MODULE_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_MODULE_DELETE"}})},Pr=e=>{const[o,i]=d.useState([]),[r,n]=d.useState([]),{handlePostRequest:a,handleGetRequest:l}=Re();d.useEffect(()=>{e.roleId&&(async()=>{await l({endPointURI:"api/v1/admin/systemApplicationRoleAuthorities",showMask:!0,parameters:{roleId:e.roleId},successCallBkFn:e=>{i(e.data.selectedAuthorities),n(e.data.availableAuthorities)}})})()},[e.roleId]);return t.jsxs(t.Fragment,{children:[t.jsx(Fe,{displayField:"authorityName",options:r,valueField:"id",selectedOptions:o,setSelection:i}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"flex-end",width:"100%"},children:[t.jsx(s.Button,{variant:"contained",onClick:async()=>{await a({endPointURI:"api/v1/admin/systemApplicationRoleAuthorities",showMask:!0,parameters:{roleId:e.roleId},data:o,successCallBkFn:()=>{g.toast.success("Your request has been proccesed successfully"),e.closeModalFn&&e.closeModalFn()}})},sx:{marginRight:1,marginLeft:1},children:"Save"}),t.jsx(s.Button,{variant:"contained",color:"error",onClick:e.closeModalFn,children:"Cancel"})]})]})},vr=()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),[r,n]=d.useState(null),{Window:a,setWindowState:s}=Se({windowTitle:"System Application Role Authorities",windowIcon:"key",width:"50%"}),l=xe({commonStoreKey:"SystemApplicationRoles",deleteById:"api/v1/admin/systemapplicationrole",save:"api/v1/admin/systemapplicationrole",findById:"api/v1/admin/systemapplicationrole",setData:i});return t.jsxs(t.Fragment,{children:[t.jsx(a,{children:t.jsx(Pr,{roleId:r?.id,closeModalFn:()=>{s(!1)}})}),t.jsx(vi,{apiActions:l,data:o,hideInfoBar:!0,setData:i,editMode:{editMode:"row",reloadAfterSave:!0},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_ROLE_NAME",fieldName:"roleName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_ROLE_DESCRIPTION",fieldName:"roleDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_ROLE_PLURAL",girdIcon:"tag",rowActions:[{icon:"key",actionFn:async e=>{n(e),s(!0)},label:"Authorities"}],editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_DELETE"}})]})},Lr=e=>{const i=o.useSelector(e=>e.commonStores.stores.SystemEntityParameters.data),{t:r}=y.useTranslation(),[n,a]=d.useState([]),s=xe({findAll:"api/v1/dev/dataqueryparameter/all",deleteById:"api/v1/dev/dataqueryparameter",save:"api/v1/dev/dataqueryparameter",findById:"api/v1/dev/dataqueryparameter",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_DATA_QUERY_ID",fieldName:"dataQueryId",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_ENTITY_PARAMETER_ID",fieldName:"entityParameterId",required:!0,fieldType:"combobox",options:i,optionValueField:"id",optionDisplayField:"parameterCode"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_DEFAULT_VALUE",fieldName:"defaultValue",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_HIDDEN",fieldName:"hidden",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_PARAMETER_MANDATORY",fieldName:"mandatory",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:s,data:n,setData:a,editMode:{editMode:"row"},hideInfoBar:!0,formElements:l,keyColumnName:"id",gridLoadParametersValues:{dataQueryId:e.selectedRecord.id},gridTitle:r("DATA_QUERY_PARAMETER_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"DATA_QUERY_PARAMETER_EDIT",preActionValidation:async t=>(t.dataQueryId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"DATA_QUERY_PARAMETER_DELETE"}})},Mr=()=>{const e=o.useSelector(e=>e.commonStores.stores.SystemOrganizations.data),{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/dev/lookup/all",deleteById:"api/v1/dev/lookup",save:"api/v1/dev/lookup",findById:"api/v1/dev/lookup",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"Organization",fieldName:"organizationId",options:e,optionDisplayField:"organizationEnName",optionValueField:"id",required:!1,fieldType:"combobox"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_TYPE",fieldName:"lookupType",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_AR_DISPLAY",fieldName:"lookupArDisplay",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_EN_DISPLAY",fieldName:"lookupEnDisplay",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_LOOKUP_VALUE",fieldName:"lookupValue",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"LOOKUP_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"System Application",fieldName:"systemApplicationId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,hideInfoBar:!0,editMode:{editMode:"row"},formElements:s,keyColumnName:"id",gridTitle:i("LOOKUP_PLURAL"),girdIcon:"list-check",editAction:{isEnabled:!0,authority:"LOOKUP_EDIT"},deleteAction:{isEnabled:!0,authority:"LOOKUP_DELETE"}})},xr=e=>{const{t:i}=y.useTranslation(),r=o.useSelector(e=>e.commonStores.stores.SystemEntityParameters.data),[n,a]=d.useState([]),s=xe({findAll:"api/v1/dev/reportparameter/all",deleteById:"api/v1/dev/reportparameter",save:"api/v1/dev/reportparameter",findById:"api/v1/dev/reportparameter",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_ENTITY_PARAMETER_ID",fieldName:"entityParameterId",required:!0,fieldType:"combobox",options:r,optionValueField:"id",optionDisplayField:"parameterCode"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_DEFAULT_VALUE",fieldName:"defaultValue",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_HIDDEN",fieldName:"hidden",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_MANDATORY",fieldName:"mandatory",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_PARAMETER_REPORT_ID",fieldName:"reportId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}}];return t.jsx(vi,{apiActions:s,data:n,hideInfoBar:!0,setData:a,gridLoadParametersValues:{reportId:e.selectedRecord.id},editMode:{editMode:"row"},formElements:l,keyColumnName:"id",gridTitle:i("REPORT_PARAMETER_PLURAL"),girdIcon:"p",editAction:{isEnabled:!0,authority:"REPORT_PARAMETER_EDIT",preActionValidation:async t=>(t.reportId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"REPORT_PARAMETER_DELETE"}})},Dr=[{value:"FILE_SYSTEM"},{value:"SFTP"}],kr=(e,t,o,i,r)=>{i?("useSysDatasource"===i&&1==r?(t.hideField("datasourceConId"),o.setValue("datasourceConId",null)):t.showField("datasourceConId"),"reportType"===i&&("Blueprint"===r?(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.showField("reportBluePrintId")):"Jasper"===r?(t.showField("storageType"),t.showField("includeAppCodeInPath"),t.showField("useSysDatasource"),t.showField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.showField("reportJasperName"),t.hideField("reportBluePrintId")):"Excel"===r?(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.showField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")):(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")))):(e?.useSysCon&&t.hideField("datasourceConId"),e?.reportType?"Blueprint"===e?.reportType?(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.showField("reportBluePrintId")):"Jasper"===e?.reportType?(t.showField("storageType"),t.showField("includeAppCodeInPath"),t.showField("useSysDatasource"),t.showField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.showField("reportJasperName"),t.hideField("reportBluePrintId")):"Excel"===e?.reportType&&(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.showField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")):(t.hideField("storageType"),t.hideField("includeAppCodeInPath"),t.hideField("useSysDatasource"),t.hideField("datasourceConId"),t.hideField("reportExcelDataQueryId"),t.hideField("reportJasperName"),t.hideField("reportBluePrintId")))},Ur=e=>{const{t:o}=y.useTranslation(),[i,r]=d.useState([]),n=xe({findAll:"api/v1/dev/mailrecipient/all",deleteById:"api/v1/dev/mailrecipient",save:"api/v1/dev/mailrecipient",findById:"api/v1/dev/mailrecipient",setData:r});return t.jsx(vi,{apiActions:n,data:i,hideInfoBar:!0,gridLoadParametersValues:{mailTemplateId:e.selectedRecord.id},setData:r,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_RECIPIENT_TYPE",fieldName:"recipientType",required:!0,fieldType:"combobox",options:[{value:"To"},{value:"CC"}],optionDisplayField:"value",optionValueField:"value",comboboxValueDataType:"string"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_RECIPIENT_MAIL",fieldName:"recipientMail",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_RECIPIENT_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:o("MAIL_RECIPIENT_PLURAL"),girdIcon:"users",editAction:{isEnabled:!0,authority:"MAIL_RECIPIENT_EDIT",preActionValidation:t=>t?.recipientMail&&!pi(t.recipientMail)?(g.toast.error("You must enter a valid email address"),!1):(t.mailTemplateId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"MAIL_RECIPIENT_DELETE"}})},Fr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),s=xe({findAll:"api/v1/dev/mailbody/all",deleteById:"api/v1/dev/mailbody",save:"api/v1/dev/mailbody",findById:"api/v1/dev/mailbody",setData:n}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_NAME",fieldName:"bodyName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_ORDER",fieldName:"bodyOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_CONTENT",fieldName:"bodyContent",required:!0,fieldType:"text",muiTextFieldProps:{multiline:!0,rows:6}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_BODY_CONTENT_DATA_QUERY_ID",fieldName:"bodyContentDataQueryId",required:!1,fieldType:"combobox",options:a,optionDisplayField:"queryName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_PRINT_FOR_EACH_RECORD",fieldName:"printForEachRecord",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_IS_MAIN",fieldName:"isMain",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_BODY_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}}];return t.jsx(vi,{apiActions:s,data:r,hideInfoBar:!0,gridLoadParametersValues:{mailTemplateId:e.selectedRecord.id},setData:n,editMode:{editMode:"modal",specs:{modalIcon:{prefix:"fas",iconName:"envelope-open-text"},modalTitle:"Mail Body",modalWidth:"50%"}},formElements:l,keyColumnName:"id",gridTitle:i("MAIL_BODY_PLURAL"),girdIcon:{prefix:"fas",iconName:"envelope-open-text"},editAction:{isEnabled:!0,authority:"MAIL_BODY_EDIT",preActionValidation:async t=>(t.mailTemplateId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"MAIL_BODY_DELETE"}})},Br=e=>{const i=o.useSelector(e=>e.commonStores.stores.SystemReports.data),{t:r}=y.useTranslation(),[n,a]=d.useState([]),s=xe({findAll:"api/v1/dev/mailattachment/all",deleteById:"api/v1/dev/mailattachment",save:"api/v1/dev/mailattachment",findById:"api/v1/dev/mailattachment",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{options:i,optionValueField:"id",optionDisplayField:"reportName",fieldLabel:"REPORT_REPORT_NAME",fieldName:"reportId",required:!0,fieldType:"combobox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_ATTACHMENT_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_ATTACHMENT_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}}];return t.jsx(vi,{apiActions:s,data:n,hideInfoBar:!0,gridLoadParametersValues:{mailTemplateId:e.selectedRecord.id},setData:a,editMode:{editMode:"row"},formElements:l,keyColumnName:"id",gridTitle:r("MAIL_ATTACHMENT_PLURAL"),girdIcon:"paperclip",editAction:{isEnabled:!0,authority:"MAIL_ATTACHMENT_EDIT",preActionValidation:t=>(t.mailTemplateId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"MAIL_ATTACHMENT_DELETE"}})},qr={Gmail:{mailHost:{isMandatory:!0,isVisible:!0},mailPort:{isMandatory:!0,isVisible:!0},mailUsername:{isMandatory:!0,isVisible:!0},mailPassword:{isMandatory:!0,isVisible:!0},mailProtocol:{isMandatory:!0,isVisible:!0},isMailSmtpAuthEnabled:{isMandatory:!0,isVisible:!0},isMailStarttlsEnabled:{isMandatory:!0,isVisible:!0},isSmtpSSlEnabled:{isMandatory:!0,isVisible:!0},azureGraphApiClientId:{isMandatory:!1,isVisible:!1},azureGraphApiClientSecret:{isMandatory:!1,isVisible:!1},azureGraphApiTenantId:{isMandatory:!1,isVisible:!1},azureGraphApiScope:{isMandatory:!1,isVisible:!1},azureGraphApiEmailId:{isMandatory:!1,isVisible:!1}},Azure:{mailHost:{isMandatory:!1,isVisible:!1},mailPort:{isMandatory:!1,isVisible:!1},mailUsername:{isMandatory:!1,isVisible:!1},mailPassword:{isMandatory:!1,isVisible:!1},mailProtocol:{isMandatory:!1,isVisible:!1},isMailSmtpAuthEnabled:{isMandatory:!1,isVisible:!1},isMailStarttlsEnabled:{isMandatory:!1,isVisible:!1},isSmtpSSlEnabled:{isMandatory:!1,isVisible:!1},azureGraphApiClientId:{isMandatory:!0,isVisible:!0},azureGraphApiClientSecret:{isMandatory:!0,isVisible:!0},azureGraphApiTenantId:{isMandatory:!0,isVisible:!0},azureGraphApiScope:{isMandatory:!0,isVisible:!0},azureGraphApiEmailId:{isMandatory:!0,isVisible:!0}}},jr=(e,t,o)=>{if(e&&qr[e]){const i=qr[e],r=Object.keys(i);for(const e of r){i[e].isVisible?t.showField(e):(t.hideField(e),o.setValue(e,null))}}else t.hideField("mailHost"),o.setValue("mailHost",null),t.hideField("mailPort"),o.setValue("mailPort",null),t.hideField("mailUsername"),o.setValue("mailUsername",null),t.hideField("mailPassword"),o.setValue("mailPassword",null),t.hideField("mailProtocol"),o.setValue("mailProtocol",null),t.hideField("isMailSmtpAuthEnabled"),o.setValue("isMailSmtpAuthEnabled",null),t.hideField("isMailStarttlsEnabled"),o.setValue("isMailStarttlsEnabled",null),t.hideField("isSmtpSSlEnabled"),o.setValue("isSmtpSSlEnabled",null),t.hideField("azureGraphApiClientId"),o.setValue("azureGraphApiClientId",null),t.hideField("azureGraphApiClientSecret"),o.setValue("azureGraphApiClientSecret",null),t.hideField("azureGraphApiTenantId"),o.setValue("azureGraphApiTenantId",null),t.hideField("azureGraphApiScope"),o.setValue("azureGraphApiScope",null),t.hideField("azureGraphApiEmailId"),o.setValue("azureGraphApiEmailId",null)},Gr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/dev/workflowdocumentstatus/all",deleteById:"api/v1/dev/workflowdocumentstatus",save:"api/v1/dev/workflowdocumentstatus",findById:"api/v1/dev/workflowdocumentstatus",setData:n}),s=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_DOCUMENT_STATUS_CODE",fieldName:"documentStatusCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Status Arabic Name",fieldName:"documentStatusArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Status English Name",fieldName:"documentStatusEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_DOCUMENT_STATUS_ORDER",fieldName:"documentStatusOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_IS_ZERO_STATE",fieldName:"isZeroState",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"Next Actions Query (must return array of actions in table named workflow_document_action)",fieldName:"nextActionsQueryId",required:!1,fieldType:"combobox",options:s,optionValueField:"id",optionDisplayField:"queryName",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Next Action Takers Query (must return array of persons in table named person)",fieldName:"nextActionTakersQueryId",required:!1,fieldType:"combobox",options:s,optionValueField:"id",optionDisplayField:"queryName",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Next Action Takers Authority",fieldName:"nextActionTakersAuthority",fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_WORKFLOW_DOCUMENT_ID",fieldName:"workflowDocumentId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_STATUS_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,hideInfoBar:!0,gridLoadParametersValues:{workflowDocumentId:e.selectedRecord.id},editMode:{editMode:"modal",specs:{modalIcon:"tag",modalTitle:"Workflow Document Status",modalWidth:600}},formElements:l,keyColumnName:"id",gridTitle:i("WORKFLOW_DOCUMENT_STATUS_PLURAL"),girdIcon:"tags",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_STATUS_EDIT",preActionValidation:t=>(t.workflowDocumentId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_STATUS_DELETE"}})},Wr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/dev/workflowdocumentactionmail/all",deleteById:"api/v1/dev/workflowdocumentactionmail",save:"api/v1/dev/workflowdocumentactionmail",findById:"api/v1/dev/workflowdocumentactionmail",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_MAIL_DOCUMENT_ACTION_ID",fieldName:"documentActionId",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_MAIL_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!0,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemMailTemplates.data),optionDisplayField:"mailTemplateName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_MAIL_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,hideInfoBar:!0,gridLoadParametersValues:{actionId:e.selectedRecord.id},setData:n,editMode:{editMode:"row"},formElements:s,keyColumnName:"id",gridTitle:i("WORKFLOW_DOCUMENT_ACTION_MAIL_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_MAIL_EDIT",preActionValidation:t=>(t.documentActionId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_MAIL_DELETE"}})},Hr=e=>{const[o,i]=d.useState(null),{Window:r,setWindowState:n}=Se({windowTitle:"Action Mail Notification",windowIcon:"envelope",width:"50%"}),{t:a}=y.useTranslation(),{handleGetRequest:s}=Re(),[l,c]=d.useState([]);d.useEffect(()=>{(async()=>{await s({endPointURI:"api/v1/dev/workflowdocumentstatus/all",showMask:!0,parameters:{workflowDocumentId:e.selectedRecord.id},successCallBkFn:e=>{c(e.data)}})})()},[e.selectedRecord]);const[u,p]=d.useState([]),h=xe({findAll:"api/v1/dev/workflowdocumentaction/all",deleteById:"api/v1/dev/workflowdocumentaction",save:"api/v1/dev/workflowdocumentaction",findById:"api/v1/dev/workflowdocumentaction",setData:p}),m=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_DOCUMENT_ACTION_CODE",fieldName:"documentActionCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Action Arabic Name",fieldName:"documentActionArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Action English Name",fieldName:"documentActionEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_NEXT_DOCUMENT_STATUS_ID",fieldName:"nextDocumentStatusId",required:!0,fieldType:"combobox",options:l,optionDisplayField:"documentStatusCode",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"Post Action Endpoint ( system will call it with post method and parameters refDocumentId , workflowActionId)",fieldName:"postActionEndpoint",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Pre Action Endpoint ( system will call it with post method and parameters refDocumentId , workflowActionId)",fieldName:"preActionEndpoint",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_REQUIRE_COMMENT",fieldName:"requireComment",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ACTION_WORKFLOW_DOCUMENT_ID",fieldName:"workflowDocumentId",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}}];return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Wr,{selectedRecord:o})}),t.jsx(vi,{apiActions:h,data:u,hideInfoBar:!0,gridLoadParametersValues:{workflowDocumentId:e.selectedRecord.id},setData:p,editMode:{editMode:"modal",specs:{modalIcon:"stamp",modalTitle:"Workflow Document Action",modalWidth:700}},rowActions:[{label:"Action Mail Notifications",icon:"envelope",actionFn:async e=>{i(e),n(!0)}}],formElements:m,keyColumnName:"id",gridTitle:a("WORKFLOW_DOCUMENT_ACTION_PLURAL"),girdIcon:"stamp",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_EDIT",preActionValidation:t=>(t.workflowDocumentId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_ACTION_DELETE"}})]})},Yr=e=>{const{t:i}=y.useTranslation(),[r,n]=d.useState([]),a=o.useSelector(e=>e.commonStores.stores.SystemWidgets.data),s=xe({findAll:"api/v1/dev/dashboardwidget/all",deleteById:"api/v1/dev/dashboardwidget",save:"api/v1/dev/dashboardwidget",findById:"api/v1/dev/dashboardwidget",setData:n}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_DASHBOARD_ID",fieldName:"dashboardId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_WIDGET_ID",fieldName:"widgetId",required:!0,fieldType:"combobox",options:a,optionValueField:"id",optionDisplayField:"widgetName"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_WIDGET_ORDER",fieldName:"widgetOrder",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_WIDGET_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:s,data:r,setData:n,editMode:{editMode:"row"},hideInfoBar:!0,formElements:l,gridLoadParametersValues:{dashboardId:e.selectedRecord.id},keyColumnName:"id",gridTitle:i("DASHBOARD_WIDGET_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"DASHBOARD_WIDGET_EDIT",preActionValidation:async t=>(t.dashboardId=e.selectedRecord.id,!0)},deleteAction:{isEnabled:!0,authority:"DASHBOARD_WIDGET_DELETE"}})},Kr=[...[...[{path:"admin/organizations",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({commonStoreKey:"SystemOrganizations",deleteById:"api/v1/org/admin/organization",save:"api/v1/org/admin/organization",findById:"api/v1/org/admin/organization",setData:i}),n=[{type:"field",mode:"props",props:{fieldLabel:"Logo",fieldName:"custom",fieldType:"custom",gridProps:{muiProps:{align:"center",headerAlign:"center",renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(Ti,{showAsAvatar:!0,attachmentCode:"ORGANIZATION_LOGOS",refKey:e.id+""})})}}}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_ORGANIZATION_CODE",fieldName:"organizationCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_ORGANIZATION_AR_NAME",fieldName:"organizationArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_ORGANIZATION_EN_NAME",fieldName:"organizationEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(t.Fragment,{children:t.jsx(vi,{attachment:{attachmentCode:"ORGANIZATION_LOGOS"},apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:n,keyColumnName:"id",gridTitle:"ORGANIZATION_PLURAL",girdIcon:"globe",editAction:{isEnabled:!0,authority:"ORGANIZATION_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_DELETE"}})})},authority:"ORGANIZATION_VIEW"},{path:"admin/organizationmembers",component:Cr,authority:"ORGANIZATION_MEMBER_VIEW"},{path:"admin/organizationmemberroles",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/admin/organizationmemberrole/all",deleteById:"api/v1/admin/organizationmemberrole",save:"api/v1/admin/organizationmemberrole",findById:"api/v1/admin/organizationmemberrole",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_END_DATE",fieldName:"endDate",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_ORGANIZATION_MEMBER_ID",fieldName:"organizationMemberId",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_START_DATE",fieldName:"startDate",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ROLE_SYSTEM_APPLICATION_ROLE_ID",fieldName:"systemApplicationRoleId",required:!0,fieldType:"text"}}],keyColumnName:"id",gridTitle:"ORGANIZATION_MEMBER_ROLE_PLURAL",girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_ROLE_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_MEMBER_ROLE_DELETE"}})},authority:"ORGANIZATION_MEMBER_ROLE_VIEW"},{path:"admin/organizationranks",component:Nr,authority:"ORGANIZATION_RANK_VIEW"},{path:"admin/organizationunits",component:Rr,authority:"ORGANIZATION_UNIT_VIEW"},{path:"admin/organizationunittypes",component:br,authority:"ORGANIZATION_UNIT_TYPE_VIEW"},{path:"admin/persons",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState(null),{UserInfo:n}=we(),a=o.useSelector(e=>e.commonStores.stores.CurrentOrganizationRanks.data),l=o.useSelector(e=>e.commonStores.stores.CurrentOrganizationUnits.data),[c,u]=d.useState([]),p=xe({commonStoreKey:"persons",deleteById:"api/v1/admin/person",save:"api/v1/admin/person",findById:"api/v1/admin/person",setData:u}),[h,m]=d.useState(null),{Window:f,setWindowState:T}=Se({windowTitle:"Organizations Membership",windowIcon:"globe"}),{Window:A,setWindowState:I}=Se({windowIcon:"tag",windowTitle:"Organization Member Roles",width:"50%"}),{Window:_,setWindowState:E}=Se({windowIcon:"key",windowTitle:"Change Password",width:"fit-content",height:"fit-content"}),O=[{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"id",fieldName:"id",gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"organizationMemberId",fieldName:"organizationMemberId",gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"Image",fieldName:"custom",fieldType:"custom",gridProps:{muiProps:{align:"center",headerAlign:"center",renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:t.jsx(Ti,{showAsAvatar:!0,attachmentCode:"EMPLOYEE_PHOTOS",refKey:e.id+""})})}}}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_EMPLOYEE_AR_NAME",fieldName:"employeeArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_EMPLOYEE_EN_NAME",fieldName:"employeeEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_EMAIL",fieldName:"email",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_MOBILE_NUMBER",fieldName:"mobileNumber",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_RANK_ID",fieldName:"organizationRankId",required:!1,fieldType:"combobox",options:a,optionValueField:"id",optionDisplayField:"rankEnName"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_MEMBER_ORGANIZATION_UNIT_ID",fieldName:"organizationUnitId",required:!1,fieldType:"combobox",options:l,optionValueField:"id",optionDisplayField:"organizationUnitEnName"}},{type:"field",mode:"props",props:{fieldLabel:"Membership number",fieldName:"organizationMembershipNumber",fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"PERSON_PASSWORD",fieldName:"password",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_USERNAME",fieldName:"username",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"Ref Source",fieldName:"refSource",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{hidden:!0,fieldLabel:"PERSON_EMPLOYEE_NUMBER",fieldName:"refSyncNumber",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"PERSON_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsxs(t.Fragment,{children:[t.jsx(A,{children:t.jsx(Or,{selectedRecord:h,closeModalFn:()=>{I(!1)}})}),t.jsx(f,{children:t.jsx(Cr,{selectedPerson:i})}),t.jsx(_,{children:t.jsx(rr,{selectedPerson:i,isSelfService:!1,onSuccessCallBk:()=>{E(!1)}})}),t.jsx(vi,{attachment:{attachmentCode:"EMPLOYEE_PHOTOS"},apiActions:p,data:c,setData:u,editMode:{editMode:"modal",specs:{modalIcon:"user",modalTitle:"Person Profile",modalWidth:300}},formElements:O,keyColumnName:"id",gridTitle:"PERSON_PLURAL",rowActions:[{icon:"key",label:"Change User Password",actionFn:async e=>{r(e),E(!0)}},{icon:"tags",label:"Current Organization User Roles",isActionDisabledForRecord:e=>!e?.organizationMemberId,actionFn:async e=>{m({organizationId:n?.currentOrganization?.id,id:e?.organizationMemberId}),I(!0)}},{icon:"globe",label:"User Organizations",actionFn:async e=>{r(e),T(!0)}}],girdIcon:"users",editAction:{isEnabled:!0,authority:"PERSON_EDIT",preActionValidation:e=>null==e.refSource||null==e.refSource||""==e.refSource||(g.toast.error("This Person Was synced from other system therefore you can't modify this record"),!1)},deleteAction:{isEnabled:!0,authority:"PERSON_DELETE",preActionValidation:e=>null==e.refSource||null==e.refSource||""==e.refSource||(g.toast.error("This Person Was synced from other system therefore you can't modify this record"),!1)}})]})},authority:"PERSON_VIEW"},{path:"admin/systemapplications",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/org/admin/systemapplication/all",deleteById:"api/v1/org/admin/systemapplication",save:"api/v1/org/admin/systemapplication",findById:"api/v1/org/admin/systemapplication",setData:i});return t.jsx(t.Fragment,{children:t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_APPLICATION_CODE",fieldName:"applicationCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_APPLICATION_NAME",fieldName:"applicationName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_APPLICATION_DESCRIPTION",fieldName:"applicationDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_PLURAL",girdIcon:"window-restore",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_DELETE"}})})},authority:"SYSTEM_APPLICATION_VIEW"},{path:"admin/systemapplicationauthorities",component:wr,authority:"SYSTEM_APPLICATION_AUTHORITY_VIEW"},{path:"admin/systemapplicationmodules",component:Sr,authority:"SYSTEM_APPLICATION_MODULE_VIEW"},{path:"admin/systemapplicationroles",component:vr,authority:"SYSTEM_APPLICATION_ROLE_VIEW"},{path:"admin/systemapplicationroleauthorities",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/admin/systemapplicationroleauthority/all",deleteById:"api/v1/admin/systemapplicationroleauthority",save:"api/v1/admin/systemapplicationroleauthority",findById:"api/v1/admin/systemapplicationroleauthority",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_AUTHORITY_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_AUTHORITY_SYSTEM_APPLICATION_AUTHORITY_ID",fieldName:"systemApplicationAuthorityId",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"SYSTEM_APPLICATION_ROLE_AUTHORITY_SYSTEM_APPLICATION_ROLE_ID",fieldName:"systemApplicationRoleId",required:!0,fieldType:"text"}}],keyColumnName:"id",gridTitle:"SYSTEM_APPLICATION_ROLE_AUTHORITY_PLURAL",girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_AUTHORITY_EDIT"},deleteAction:{isEnabled:!0,authority:"SYSTEM_APPLICATION_ROLE_AUTHORITY_DELETE"}})},authority:"SYSTEM_APPLICATION_ROLE_AUTHORITY_VIEW"},{path:"admin/org/apps",component:()=>{const{t:e}=y.useTranslation(),{handleGetRequest:i}=Re(),[r,n]=d.useState([]),a=xe({findAll:"api/v1/org/admin/organizationapplicationmodule/all",deleteById:"api/org/v1/admin/organizationapplicationmodule",save:"api/v1/org/admin/organizationapplicationmodule",findById:"api/org/v1/admin/organizationapplicationmodule",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_SYSTEM_APPLICATION_MODULE_ID",fieldName:"systemApplicationModuleId",required:!1,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemApplicationModules.data),optionDisplayField:"moduleName",optionValueField:"id"}},{type:"field",mode:"props",props:{hidden:!0,gridProps:{hidden:!0},fieldLabel:"ORGANIZATION_APPLICATION_MODULE_ORGANIZATION_ID",fieldName:"organizationId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_SUBSCRIPTION_DATE",fieldName:"subscriptionDate",required:!0,fieldType:"date"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_EXPIRATION_DATE",fieldName:"expirationDate",required:!1,fieldType:"date"}},{type:"field",mode:"props",props:{fieldLabel:"ORGANIZATION_APPLICATION_MODULE_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,hideInfoBar:!0,setData:n,editMode:{editMode:"row"},formElements:s,keyColumnName:"id",gridTitle:"ORGANIZATION_APPLICATION_MODULE_PLURAL",girdIcon:"layer-group",editAction:{isEnabled:!0,authority:"ORGANIZATION_APPLICATION_MODULE_EDIT"},deleteAction:{isEnabled:!0,authority:"ORGANIZATION_APPLICATION_MODULE_DELETE"}})},authority:"ORGANIZATION_ADMIN"},{path:"admin/org/unit/types",component:br,authority:"DEVELOPMENT_ADMIN"},{path:"admin/org/units",component:Rr,authority:"DEVELOPMENT_ADMIN"},{path:"admin/org/ranks",component:Nr,authority:"DEVELOPMENT_ADMIN"}],...[{path:"dev/blueprints",component:()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),[r,n]=d.useState([]),a=xe({commonStoreKey:"SystemBluePrints",deleteById:"api/v1/dev/blueprint",save:"api/v1/dev/blueprint",findById:"api/v1/dev/blueprint",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"BLUE_PRINT_BLUE_PRINT_CODE",fieldName:"bluePrintCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"BLUE_PRINT_QUERY_ID",fieldName:"queryId",required:!0,fieldType:"combobox",options:i,optionDisplayField:"queryName",optionValueField:"id"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,editMode:{editMode:"row",reloadAfterSave:!0},formElements:s,keyColumnName:"id",gridTitle:e("BLUE_PRINT_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"BLUE_PRINT_EDIT"},deleteAction:{isEnabled:!0,authority:"BLUE_PRINT_DELETE"}})},authority:"BLUE_PRINT_VIEW"},{path:"dev/dataqueries",component:()=>{const[e,i]=d.useState(null),{Window:r,setWindowState:n}=Se({width:"50%",windowTitle:"Data query parameters",windowIcon:"p"}),a=o.useSelector(e=>e.commonStores.stores.SystemDataSources.data),{t:s}=y.useTranslation(),[l,c]=d.useState([]),u=xe({commonStoreKey:"SystemDataQueries",deleteById:"api/v1/dev/dataquery",save:"api/v1/dev/dataquery",findById:"api/v1/dev/dataquery",setData:c}),p=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_QUERY_NAME",fieldName:"queryName",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_USE_SYS_CON",fieldName:"useSysCon",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_DATASOURCE_CON_ID",fieldName:"datasourceConId",required:!1,options:a,optionDisplayField:"connectionName",optionValueField:"id",fieldType:"combobox"}},{type:"field",mode:"props",props:{fieldLabel:"DATA_QUERY_QUERY_STR",fieldName:"queryStr",formProps:{fieldHeight:400},gridProps:{hidden:!0},muiTextFieldProps:{multiline:!0,rows:4},required:!1,fieldType:"text"}}];return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Lr,{selectedRecord:e})}),t.jsx(vi,{apiActions:u,rowActions:[{label:"Query Parameters",actionFn:async e=>{i(e),n(!0)},icon:"p"}],data:l,setData:c,editMode:{editMode:"modal",specs:{modalTitle:"System Query",modalWidth:600,modalIcon:"file-code"}},formElements:p,keyColumnName:"id",gridTitle:s("DATA_QUERY_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"DATA_QUERY_EDIT"},deleteAction:{isEnabled:!0,authority:"DATA_QUERY_DELETE"},formProps:{formValuesChangeCallBk:(e,t,o,i,r)=>{i?"useSysCon"===i&&1==r?(t.hideField("datasourceConId"),o.setValue("datasourceConId",null)):t.showField("datasourceConId"):e?.useSysCon&&t.hideField("datasourceConId")}}})]})},authority:"DATA_QUERY_VIEW"},{path:"dev/datasourceconnections",component:()=>{const{handleGetRequest:e}=Re(),i=o.useSelector(e=>e.commonStores.stores.SystemDataSourceType.data),{t:r}=y.useTranslation(),[n,a]=d.useState([]),s=xe({deleteById:"api/v1/dev/datasourceconnection",save:"api/v1/dev/datasourceconnection",findById:"api/v1/dev/datasourceconnection",setData:a,commonStoreKey:"SystemDataSources"}),l=[{type:"field",mode:"props",props:{fieldLabel:"ID",fieldName:"id",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_CONNECTION_NAME",fieldName:"connectionName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_TYPE",fieldName:"datasourceType",required:!0,fieldType:"combobox",options:i,comboboxValueDataType:"string",optionValueField:"value",optionDisplayField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_URL",fieldName:"datasourceUrl",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_USERNAME",fieldName:"datasourceUsername",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_DATASOURCE_PASSWORD",fieldName:"datasourcePassword",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DATASOURCE_CONNECTION_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:s,data:n,setData:a,editMode:{editMode:"modal",specs:{modalTitle:"Datasource Connection",modalIcon:"plug",modalWidth:300}},formElements:l,keyColumnName:"id",gridTitle:r("DATASOURCE_CONNECTION_PLURAL"),girdIcon:"plug",rowActions:[{icon:"plug",label:"test connection",actionFn:async t=>{await e({endPointURI:"api/v1/dev/datasourceConnection/test",showMask:!0,parameters:{id:t.id},successCallBkFn:e=>{g.toast.success(e.data)}})}}],editAction:{isEnabled:!0,authority:"DATASOURCE_CONNECTION_EDIT"},deleteAction:{isEnabled:!0,authority:"DATASOURCE_CONNECTION_DELETE"}})},authority:"DATASOURCE_CONNECTION_VIEW"},{path:"dev/entityparameters",component:()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.commonStores.stores.SystemParameterTypes.data),[r,n]=d.useState([]),a=xe({commonStoreKey:"SystemEntityParameters",deleteById:"api/v1/dev/entityparameter",save:"api/v1/dev/entityparameter",findById:"api/v1/dev/entityparameter",setData:n}),s=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_CODE",fieldName:"parameterCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_LABEL",fieldName:"parameterLabel",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_TYPE",fieldName:"parameterType",required:!0,fieldType:"combobox",options:i,comboboxValueDataType:"string",optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_DATA_QUERY_ID",fieldName:"parameterDataQueryId",hidden:!0,required:!1,fieldType:"combobox",options:o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),optionDisplayField:"queryName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_DATASET",fieldName:"parameterDataset",hidden:!0,required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_DISPLAY_FIELD",fieldName:"parameterDisplayField",hidden:!0,required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_VALUE_FIELD",fieldName:"parameterValueField",hidden:!0,required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_PARAMETER_VALUE_FORMAT",fieldName:"parameterValueFormat",required:!1,hidden:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ENTITY_PARAMETER_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:a,data:r,setData:n,editMode:{editMode:"modal",specs:{modalTitle:"Entity Parameter",modalIcon:"p",modalWidth:300}},formElements:s,keyColumnName:"id",gridTitle:e("ENTITY_PARAMETER_PLURAL"),girdIcon:"p",formProps:{formValuesChangeCallBk:(e,t,o,i,r,n)=>{i?"parameterType"===i?("combobox"===r?(o.setValue("parameterValueFormat",null),t.showField("parameterDataQueryId"),t.showField("parameterDataset"),t.showField("parameterDisplayField"),t.showField("parameterValueField"),t.hideField("parameterValueFormat")):(t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField")),"date"===r||"datetime"===r?(t.showField("parameterValueFormat"),"date"===r?o.setValue("parameterValueFormat",je):o.setValue("parameterValueFormat",Ge)):(t.hideField("parameterValueFormat"),o.setValue("parameterValueFormat",null))):"parameterDataQueryId"==i?null!=r&&""!=r?(o.setValue("parameterDataset",null),t.hideField("parameterDataset")):t.showField("parameterDataset"):"parameterDataset"==i&&(null!=r&&""!=r?(o.setValue("parameterDataQueryId",null),t.hideField("parameterDataQueryId")):t.showField("parameterDataQueryId")):"combobox"===e?.parameterType?(o.setValue("parameterValueFormat",null),t.showField("parameterDataQueryId"),t.showField("parameterDataset"),t.showField("parameterDisplayField"),t.showField("parameterValueField"),t.hideField("parameterValueFormat")):"date"===e?.parameterType?(t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField"),t.showField("parameterValueFormat"),o.setValue("parameterValueFormat",je)):"datetime"===e?.parameterType?(t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField"),t.showField("parameterValueFormat"),o.setValue("parameterValueFormat",Ge)):(o.setValue("parameterValueFormat",null),t.hideField("parameterDataQueryId"),t.hideField("parameterDataset"),t.hideField("parameterDisplayField"),t.hideField("parameterValueField"),t.hideField("parameterValueFormat"))}},editAction:{isEnabled:!0,authority:"ENTITY_PARAMETER_EDIT"},deleteAction:{isEnabled:!0,authority:"ENTITY_PARAMETER_DELETE"}})},authority:"ENTITY_PARAMETER_VIEW"},{path:"dev/lookups",component:Mr,authority:"LOOKUP_VIEW"},{path:"dev/reports",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState(null),{Window:n,setWindowState:a}=Se({windowTitle:"Report View",windowIcon:"eye",width:"80%"}),{Window:s,setWindowState:l}=Se({windowTitle:"Report Parameters",windowIcon:"p",width:"80%"}),[c,u]=d.useState([]),p=o.useSelector(e=>e.commonStores.stores.SystemDataSources.data),h=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),m=o.useSelector(e=>e.commonStores.stores.SystemBluePrints.data),f=xe({findAll:"api/v1/dev/report/all",deleteById:"api/v1/dev/report",save:"api/v1/dev/report",findById:"api/v1/dev/report",setData:u}),T=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_TYPE",fieldName:"reportType",options:[{value:"Excel"},{value:"Jasper"},{value:"Blueprint"}],optionDisplayField:"value",optionValueField:"value",required:!0,fieldType:"combobox",comboboxValueDataType:"string"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_CODE",fieldName:"reportCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_NAME",fieldName:"reportName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_STORAGE_TYPE",fieldName:"storageType",required:!1,hidden:!0,gridProps:{hidden:!0},comboboxValueDataType:"string",fieldType:"combobox",options:Dr,optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_CATEGORY",fieldName:"reportCategory",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Authority Code",fieldName:"reportAuthorityCode",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_EXPORT_NAME",fieldName:"reportExportName",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_USE_SYS_DATASOURCE",fieldName:"useSysDatasource",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_DATASOURCE_CON_ID",fieldName:"datasourceConId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"combobox",options:p,optionValueField:"id",optionDisplayField:"connectionName"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_BLUE_PRINT_ID",fieldName:"reportBluePrintId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"combobox",options:m,optionDisplayField:"bluePrintCode",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_EXCEL_DATA_QUERY_ID",fieldName:"reportExcelDataQueryId",hidden:!0,required:!1,fieldType:"combobox",options:h,optionValueField:"id",optionDisplayField:"queryName"}},{type:"field",mode:"props",props:{fieldLabel:"REPORT_REPORT_JASPER_NAME",fieldName:"reportJasperName",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Include App Code in attachment path",fieldName:"includeAppCodeInPath",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"Active",fieldName:"isActive",fieldType:"checkbox"}}];return t.jsxs(t.Fragment,{children:[t.jsx(n,{children:t.jsx(Di,{reportCode:i?.reportCode,resultMode:"App"})}),t.jsx(s,{children:t.jsx(xr,{selectedRecord:i})}),t.jsx(vi,{attachment:{attachmentCode:"JASPER_REPORTS",enableAttachFn:e=>"Jasper"===e?.reportType},apiActions:f,data:c,setData:u,editMode:{editMode:"modal",specs:{modalTitle:"Report",modalIcon:"file",modalWidth:300}},rowActions:[{icon:"p",label:"Report Parameters",isActionVisibleForRecord:e=>"Jasper"===e.reportType,actionFn:async(e,t)=>{r(e),l(!0)}},{icon:"eye",label:"View Report",actionFn:async(e,t)=>{r(e),a(!0)}}],formProps:{formValuesChangeCallBk:kr},formElements:T,keyColumnName:"id",gridTitle:e("REPORT_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"REPORT_EDIT",preActionValidation:e=>"Jasper"!==e?.reportType||!1!==e?.useSysDatasource||e?.datasourceConId?"Jasper"!==e?.reportType||e?.reportJasperName?"Blueprint"!==e?.reportType||e?.reportBluePrintId?!("Excel"===e?.reportType&&!e?.reportExcelDataQueryId)||(g.toast.error("You must choose the report query"),!1):(g.toast.error("You must choose the report blueprint"),!1):(g.toast.error("You must enter the jasper report name"),!1):(g.toast.error("You must choose the datasource"),!1)},deleteAction:{isEnabled:!0,authority:"REPORT_DELETE"}})]})},authority:"REPORT_VIEW"},{path:"dev/mailtemplates",component:()=>{const e=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),i=o.useSelector(e=>e.commonStores.stores.SystemTimeIntervals.data),[r,n]=d.useState(null),{Window:a,setWindowState:s}=Se({windowTitle:"Mail Receipents",windowIcon:"users"}),{Window:l,setWindowState:c}=Se({windowTitle:"Mail Bodies",windowIcon:{prefix:"fas",iconName:"envelope-open-text"}}),{Window:u,setWindowState:p}=Se({windowTitle:"Mail Attachment",windowIcon:"paperclip",width:500}),{t:h}=y.useTranslation(),[m,f]=d.useState([]),T=xe({commonStoreKey:"SystemMailTemplates",deleteById:"api/v1/dev/mailtemplate",save:"api/v1/dev/mailtemplate",findById:"api/v1/dev/mailtemplate",setData:f}),A=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_MAIL_TEMPLATE_CODE",fieldName:"mailTemplateCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_MAIL_TEMPLATE_NAME",fieldName:"mailTemplateName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"group",props:{label:"subject",icon:"users",style:{padding:1,border:"0.5px dashed black",margin:1},elements:[{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_MAIL_SUBJECT",fieldName:"mailSubject",required:!0,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_SUBJECT_DATA_QUERY_ID",fieldName:"subjectDataQueryId",required:!1,fieldType:"combobox",options:e,optionDisplayField:"queryName",optionValueField:"id",gridProps:{hidden:!0}}}]}},{type:"group",props:{label:"Recipients",icon:"users",style:{padding:1,border:"0.5px dashed black",margin:1},elements:[{type:"field",mode:"props",props:{fieldLabel:"To Recipient Query (must return list of objects with property email)",fieldName:"mailToDataQueryId",required:!1,fieldType:"combobox",options:e,optionDisplayField:"queryName",optionValueField:"id",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"CC Recipient Query (must return list of objects with property email)",fieldName:"mailCcDataQueryId",required:!1,fieldType:"combobox",options:e,optionDisplayField:"queryName",optionValueField:"id",gridProps:{hidden:!0}}}]}},{type:"group",props:{label:"Periodical Configuration",icon:"history",style:{padding:1,border:"0.5px dashed black",margin:1},elements:[{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_PERIODICAL",fieldName:"periodical",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_PERIOD_TYPE",fieldName:"periodType",options:i,optionDisplayField:"value",optionValueField:"value",required:!1,fieldType:"combobox",comboboxValueDataType:"string"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_PERIOD_VALUE",fieldName:"periodValue",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_TEMPLATE_START_SENDING_AT",fieldName:"startSendingAt",required:!1,fieldType:"datetime"}}]}}];return t.jsxs(t.Fragment,{children:[t.jsx(a,{children:t.jsx(Ur,{selectedRecord:r,callBkFn:()=>{s(!1)}})}),t.jsx(l,{children:t.jsx(Fr,{selectedRecord:r,callBkFn:()=>{s(!1)}})}),t.jsx(u,{children:t.jsx(Br,{selectedRecord:r,callBkFn:()=>{p(!1)}})}),t.jsx(vi,{apiActions:T,data:m,setData:f,editMode:{editMode:"modal",specs:{modalWidth:300,modalTitle:"Mail Template",modalIcon:"envelope"}},formElements:A,keyColumnName:"id",gridTitle:h("MAIL_TEMPLATE_PLURAL"),girdIcon:"envelope",rowActions:[{icon:"users",label:"Recipients",actionFn:async e=>{n(e),s(!0)}},{icon:{prefix:"fas",iconName:"envelope-open-text"},label:"Mail Body",actionFn:async e=>{n(e),c(!0)}},{icon:"paperclip",label:"Mail Attachments",actionFn:async e=>{n(e),p(!0)}}],editAction:{isEnabled:!0,authority:"MAIL_TEMPLATE_EDIT",preActionValidation:e=>!0!==e?.periodical||e?.periodType?!0!==e?.periodical||e?.periodValue?!(!0===e?.periodical&&!e?.startSendingAt)||(g.toast.error("You must specifiy the start sending time since this email is periodical"),!1):(g.toast.error("You must specifiy the period value since this email is periodical"),!1):(g.toast.error("You must specifiy the period type since this email is periodical"),!1)},deleteAction:{isEnabled:!0,authority:"MAIL_TEMPLATE_DELETE"}})]})},authority:"MAILTEMPLATE_VIEW"},{path:"dev/mailsender/config",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/dev/mailsenderconfig/all",deleteById:"api/v1/dev/mailsenderconfig",save:"api/v1/dev/mailsenderconfig",findById:"api/v1/dev/mailsenderconfig",setData:i}),n=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Name",fieldName:"configName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Engine",fieldName:"mailEngine",required:!0,fieldType:"combobox",comboboxValueDataType:"string",options:[{value:"Gmail"},{value:"Azure"}],optionDisplayField:"value",optionValueField:"value",formProps:{onValueChangeCallBack(e,t,o,i,r){jr(t,i,o)}}}},{type:"field",mode:"props",props:{fieldLabel:"Hostname",fieldName:"mailHost",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"port",fieldName:"mailPort",required:!1,fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"username",fieldName:"mailUsername",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"password",fieldName:"mailPassword",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Workflow Approval Receive Email",fieldName:"workFlowApprovalReceiveEmail",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Protocol",fieldName:"mailProtocol",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Enable Smtp Auth",fieldName:"isMailSmtpAuthEnabled",required:!1,fieldType:"checkbox",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Enable Start TLS",fieldName:"isMailStarttlsEnabled",required:!1,fieldType:"checkbox",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Enable SSL",fieldName:"isSmtpSSlEnabled",required:!1,fieldType:"checkbox",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Client Id",fieldName:"azureGraphApiClientId",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Secret",fieldName:"azureGraphApiClientSecret",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Tenant Id",fieldName:"azureGraphApiTenantId",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Scope",fieldName:"azureGraphApiScope",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Azure Graph API Email Id",fieldName:"azureGraphApiEmailId",required:!1,fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Default",fieldName:"isDefault",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"Active",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"modal",specs:{modalIcon:{iconName:"paper-plane",prefix:"fas"},modalTitle:"Mail Sender Configuration",modalWidth:300}},formElements:n,keyColumnName:"id",gridTitle:e("Mail Sender Configuration"),girdIcon:{iconName:"paper-plane",prefix:"fas"},editAction:{isEnabled:!0,authority:"MAIL_SENDER_CONFIG_EDIT"},deleteAction:{isEnabled:!0,authority:"MAIL_SENDER_CONFIG_DELETE"},formLoadCallBk:(e,t,o)=>{jr(o.mailEngine,e,t)}})},authority:"MAILTEMPLATE_VIEW"},{path:"dev/workflowdocuments",component:()=>{const[e,i]=d.useState(null),{Window:r,setWindowState:n}=Se({windowTitle:"Document Status",windowIcon:"tag"}),{Window:a,setWindowState:s}=Se({windowTitle:"Document Action",windowIcon:"stamp"}),l=o.useSelector(e=>e.commonStores.stores.SystemOrganizations.data),c=o.useSelector(e=>e.commonStores.stores.SystemReports.data),u=o.useSelector(e=>e.commonStores.stores.SystemDataSources.data),{t:p}=y.useTranslation(),[h,m]=d.useState([]),f=xe({commonStoreKey:"SystemWorkflows",deleteById:"api/v1/dev/workflowdocument",save:"api/v1/dev/workflowdocument",findById:"api/v1/dev/workflowdocument",setData:m}),g=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_ORG_CODE",fieldName:"orgCode",required:!1,fieldType:"combobox",options:l,optionDisplayField:"organizationCode",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_CODE",fieldName:"documentCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Workflow Document En Display Name",fieldName:"documentEnName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Workflow Document Ar Display Name",fieldName:"documentArName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Report To be Attached For The Document ( will be passed a parameter called doc_id)",fieldName:"documentReportId",required:!1,fieldType:"combobox",options:c,optionDisplayField:"reportName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_APPROVAL_ALLOWED",fieldName:"mailApprovalAllowed",required:!1,fieldType:"checkbox"}},{type:"group",props:{icon:"bell",style:{border:"1px dashed black",padding:1,marginBottom:1},label:"App Visual Notifications",elements:[{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_APP_NOTIFICATION_ICON",fieldName:"appNotificationIcon",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_APP_NOTIFICATION_STYLE",fieldName:"appNotificationStyle",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_APP_VIEW_ROUTE",fieldName:"appViewRoute",required:!1,fieldType:"text"}}]}},{type:"group",props:{icon:"database",style:{border:"1px dashed black",padding:1,marginBottom:1},label:"Related Document Database",elements:[{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_USE_SYSTEM_CON",fieldName:"useSystemCon",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_CON_ID",fieldName:"documentConId",required:!1,fieldType:"combobox",options:u,optionDisplayField:"connectionName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_DATABASE_NAME",fieldName:"documentDatabaseName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_DATABASE_TABLE",fieldName:"documentDatabaseTable",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_ID_FIELD",fieldName:"documentIdField",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_STATUS_FIELD",fieldName:"documentStatusField",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_DOCUMENT_NUMBER_FIELD",fieldName:"documentNumberField",required:!0,fieldType:"text"}}]}}];return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Gr,{selectedRecord:e})}),t.jsx(a,{children:t.jsx(Hr,{selectedRecord:e})}),t.jsx(vi,{apiActions:f,data:h,setData:m,rowActions:[{icon:"tag",label:"Document States",actionFn:async e=>{i(e),n(!0)}},{icon:"stamp",label:"Document Actions",actionFn:async e=>{i(e),s(!0)}}],editMode:{editMode:"modal",specs:{modalIcon:"chart-diagram",modalTitle:p("WORKFLOW_DOCUMENT_SINGULAR")}},formElements:g,keyColumnName:"id",gridTitle:p("WORKFLOW_DOCUMENT_PLURAL"),girdIcon:"chart-diagram",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_EDIT"},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_DELETE"}})]})},authority:"WORKFLOW_DOCUMENT_VIEW"},{path:"dev/widgets",component:()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),r=o.useSelector(e=>e.commonStores.stores.SystemWidgetTypes.data),[n,a]=d.useState([]),s=xe({commonStoreKey:"SystemWidgets",deleteById:"api/v1/dev/widget",save:"api/v1/dev/widget",findById:"api/v1/dev/widget",setData:a}),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDGET_TYPE",fieldName:"widgetType",required:!0,fieldType:"combobox",comboboxValueDataType:"string",options:r,optionDisplayField:"name",optionValueField:"name"}},{type:"field",mode:"props",props:{fieldLabel:"Query",fieldName:"dataQueryId",required:!0,fieldType:"combobox",options:i,optionDisplayField:"queryName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDGET_NAME",fieldName:"widgetName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_ICON",fieldName:"icon",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_TITLE",fieldName:"title",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDGET_DESCRIPTION",fieldName:"widgetDescription",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_HEIGHT",fieldName:"height",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_WIDTH",fieldName:"width",required:!1,fieldType:"combobox",options:[{value:1},{value:2},{value:3},{value:4},{value:5},{value:6},{value:7},{value:8},{value:9},{value:10},{value:11},{value:12}],optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}},{type:"group",props:{style:{padding:1,border:"1px solid black",width:"100%"},label:"Data Specs",elements:[{type:"field",mode:"props",props:{fieldLabel:"WIDGET_HORIZONTAL_AXIS_FIELD",fieldName:"horizontalAxisField",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_HORIZONTAL_AXIS_LABEL",fieldName:"horizontalAxisLabel",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WIDGET_VERTICAL_AXIS_FIELD",fieldName:"verticalAxisField",required:!0,fieldType:"text"}}]}}];return t.jsx(vi,{apiActions:s,data:n,setData:a,editMode:{editMode:"modal",specs:{modalIcon:"chart-pie",modalTitle:"Widget"}},formElements:l,keyColumnName:"id",gridTitle:e("WIDGET_PLURAL"),girdIcon:"chart-pie",editAction:{isEnabled:!0,authority:"WIDGET_EDIT"},deleteAction:{isEnabled:!0,authority:"WIDGET_DELETE"}})},authority:"WIDGET_VIEW"},{path:"dev/dashboards",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState(null),{Window:r,setWindowState:n}=Se({windowTitle:"Dashboard Widgets",windowIcon:"chart-pie"}),[a,s]=d.useState([]),l=_.useNavigate(),c=xe({findAll:"api/v1/dev/dashboard/all",deleteById:"api/v1/dev/dashboard",save:"api/v1/dev/dashboard",findById:"api/v1/dev/dashboard",setData:s});return t.jsxs(t.Fragment,{children:[t.jsx(r,{children:t.jsx(Yr,{selectedRecord:o})}),t.jsx(vi,{apiActions:c,data:a,setData:s,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_DASHBOARD_CODE",fieldName:"dashboardCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_DASHBOARD_NAME",fieldName:"dashboardName",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_DASHBOARD_TITLE",fieldName:"dashboardTitle",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"DASHBOARD_ENABLED",fieldName:"enabled",required:!1,fieldType:"checkbox"}}],keyColumnName:"id",rowActions:[{label:"Widgets",icon:"chart-pie",actionFn:async e=>{i(e),n(!0)}},{label:"View",icon:"eye",actionFn:async e=>{l("/dashboard/"+e.dashboardCode)}}],gridTitle:e("DASHBOARD_PLURAL"),girdIcon:"square-poll-vertical",editAction:{isEnabled:!0,authority:"DASHBOARD_EDIT"},deleteAction:{isEnabled:!0,authority:"DASHBOARD_DELETE"}})]})},authority:"DASHBOARD_VIEW"},{path:"dashboard/:dashboardCode",component:zi},{path:"dev/workflowdocumentmaillogs",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/dev/workflowdocumentmaillog/all",deleteById:"api/v1/dev/workflowdocumentmaillog",save:"api/v1/dev/workflowdocumentmaillog",findById:"api/v1/dev/workflowdocumentmaillog",setData:i});return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"row"},formElements:[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_GRAPH_API_MSG_ID",fieldName:"graphApiMsgId",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_IS_PROCESSED",fieldName:"isProcessed",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_ACTION_CODE",fieldName:"mailActionCode",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_BODY_CONTENT",fieldName:"mailBodyContent",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_FROM",fieldName:"mailFrom",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_SUBJECT",fieldName:"mailSubject",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_PROCESS_MESSAGE",fieldName:"processMessage",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_PROCESS_TIME",fieldName:"processTime",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_REF_DOC_ID",fieldName:"refDocId",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_WORKFLOW_DOCUMENT_ID",fieldName:"workflowDocumentId",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"WORKFLOW_DOCUMENT_MAIL_LOG_MAIL_RECEIVE_TIME",fieldName:"mailReceiveTime",required:!1,fieldType:"datetime"}}],keyColumnName:"id",gridTitle:e("WORKFLOW_DOCUMENT_MAIL_LOG_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_MAIL_LOG_EDIT"},deleteAction:{isEnabled:!0,authority:"WORKFLOW_DOCUMENT_MAIL_LOG_DELETE"}})}},{path:"dev/mailnotificationqueues",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),{handlePostRequest:n}=Re(),a=xe({findAll:"api/v1/dev/mailnotificationqueue/all",deleteById:"api/v1/dev/mailnotificationqueue",save:"api/v1/dev/mailnotificationqueue",findById:"api/v1/dev/mailnotificationqueue",setData:r}),s=o.useSelector(e=>e.commonStores.stores.SystemMailTemplates.data),l=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_MAIL_TEMPLATE_ID",fieldName:"mailTemplateId",required:!1,fieldType:"combobox",options:s,optionDisplayField:"mailTemplateName",optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_ATTACHED_REPORT_ID",fieldName:"customMailAttachedReportId",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_BODY",fieldName:"customMailBody",required:!1,hidden:!0,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_MAIL_SUBJECT",fieldName:"customMailSubject",required:!1,hidden:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_CUSTOM_RECIPIENTS",fieldName:"customRecipients",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_IS_NOTIFIED",fieldName:"isNotified",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_NOTIFICATION_TIME",fieldName:"notificationTime",required:!1,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_NOTIFICATION_MESSAGE",fieldName:"notificationMessage",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"MAIL_NOTIFICATION_QUEUE_MAIL_PARAMETERS",fieldName:"mailParameters",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"text"}}];return t.jsx(vi,{apiActions:a,disableDefaultAction:!0,data:i,setData:r,editMode:{editMode:"none"},formElements:l,rowActions:[{actionFn:async e=>{(async e=>{await n({endPointURI:"api/v1/public/mailNotification/resend",showMask:!0,parameters:{mailNotificationQueueId:e},successCallBkFn:e=>{a.reloadData()}})})(e.id)},label:"Resend",icon:"repeat",confirmationMessage:"Are you sure you want to resend this email ?",isConfirmationRequired:!0}],keyColumnName:"id",gridTitle:e("MAIL_NOTIFICATION_QUEUE_PLURAL"),girdIcon:"table-cells",editAction:{isEnabled:!0,authority:"MAIL_NOTIFICATION_QUEUE_EDIT"},deleteAction:{isEnabled:!0,authority:"MAIL_NOTIFICATION_QUEUE_DELETE"}})}},{path:"dev/system/authorities",component:wr},{path:"dev/system/roles",component:vr},{path:"dev/system/lookups",component:Mr},{path:"dev/system/modules",component:Sr},{path:"dev/attachmentconfigs",component:()=>{const{t:e}=y.useTranslation(),[o,i]=d.useState([]),r=xe({findAll:"api/v1/dev/attachmentconfig/all",deleteById:"api/v1/dev/attachmentconfig",save:"api/v1/dev/attachmentconfig",findById:"api/v1/dev/attachmentconfig",setData:i}),n=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_ATTACHMENT_CODE",fieldName:"attachmentCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_RELATED_DATABASE_TABLE",fieldName:"relatedDatabaseTable",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_STORAGE_TYPE",fieldName:"storageType",required:!0,fieldType:"combobox",comboboxValueDataType:"string",options:Dr,optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"Include App Code in attachment path",fieldName:"includeAppCodeInPath",required:!0,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_UPLOAD_DIRECTORY",fieldName:"uploadDirectory",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_ALLOWED_FILE_TYPES",fieldName:"allowedFileTypes",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_ATTACHMENT_CATEGORIES",fieldName:"attachmentCategories",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Is Category Mandatory",fieldName:"isCategoryRequired",required:!1,fieldType:"checkbox"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_MAX_ALLOWED_NUMBER_OF_FILES",fieldName:"maxAllowedNumberOfFiles",required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_DOWNLOAD_AUTHORITY_KEY",fieldName:"downloadAuthorityKey",required:!1,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"ATTACHMENT_CONFIG_UPLOAD_AUTHORITY_KEY",fieldName:"uploadAuthorityKey",required:!1,fieldType:"text"}}];return t.jsx(vi,{apiActions:r,data:o,setData:i,editMode:{editMode:"modal",specs:{modalIcon:"paperclip",modalTitle:"Attachment Configuration"}},formElements:n,keyColumnName:"id",gridTitle:e("ATTACHMENT_CONFIG_PLURAL"),girdIcon:"paperclip",editAction:{isEnabled:!0,authority:"ATTACHMENT_CONFIG_EDIT"},deleteAction:{isEnabled:!0,authority:"ATTACHMENT_CONFIG_DELETE"}})}},{path:"dev/notifications",component:()=>{const{t:e}=y.useTranslation(),[i,r]=d.useState([]),n=o.useSelector(e=>e.commonStores.stores.SystemTimeIntervals.data),a=o.useSelector(e=>e.commonStores.stores.SystemDataQueries.data),l=xe({findAll:"api/v1/dev/notification/all",deleteById:"api/v1/dev/notification",save:"api/v1/dev/notification",findById:"api/v1/dev/notification",setData:r}),c=[{type:"field",mode:"props",props:{fieldLabel:"id",fieldName:"id",fieldType:"number",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createTime",fieldName:"createTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"createdBy",fieldName:"createdBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateBy",fieldName:"lastUpdateBy",fieldType:"text",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"lastUpdateTime",fieldName:"lastUpdateTime",fieldType:"datetime",hidden:!0,gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_CODE",fieldName:"notificationCode",required:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Notification Data Query ( will be passed a parameter call last_run_time represents last check time)",fieldName:"notificationQueryId",required:!0,fieldType:"combobox",options:a,optionDisplayField:"queryName",gridProps:{hidden:!0},optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"Users to notify Query (must have username property in the result set)",fieldName:"usersToNotifyQueryId",required:!1,fieldType:"combobox",options:a,optionDisplayField:"queryName",gridProps:{hidden:!0},optionValueField:"id"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_AUTHORITY_TO_NOTIFY",fieldName:"authorityToNotify",required:!1,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"Interval Type",fieldName:"intervalType",fieldType:"combobox",comboboxValueDataType:"string",options:n,gridProps:{hidden:!0},optionDisplayField:"value",optionValueField:"value"}},{type:"field",mode:"props",props:{fieldLabel:"Interval Value (minmum value 20 seconds)",fieldName:"intervalValue",gridProps:{hidden:!0},fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"Start Notifing Date",fieldName:"startNotificationFrom",gridProps:{hidden:!0},fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_SYSTEM_APPLICATION_ID",fieldName:"systemApplicationId",hidden:!0,gridProps:{hidden:!0},required:!1,fieldType:"number"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_ICON",fieldName:"notificationIcon",required:!0,fieldType:"text",gridProps:{muiProps:{renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",color:e?.row?.notificationIconColor,justifyContent:"center",height:"100%"},children:e?.row?.notificationIcon?t.jsx(m.FontAwesomeIcon,{icon:e.row.notificationIcon}):t.jsx(t.Fragment,{})})}}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_AR_TEXT",fieldName:"notificationArText",required:!0,fieldType:"text",gridProps:{muiProps:{renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",color:e?.row?.notificationTextColor,justifyContent:"center",height:"100%"},children:e?.row?.notificationArText})}}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_EN_TEXT",fieldName:"notificationEnText",required:!0,fieldType:"text",gridProps:{muiProps:{renderCell:e=>t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",color:e?.row?.notificationTextColor,justifyContent:"center",height:"100%"},children:e?.row?.notificationEnText})}}}},{type:"field",mode:"props",props:{fieldLabel:"Last Runtime",disabled:!0,fieldName:"lastIntervalRun",fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"Last Successful Runtime",fieldName:"lastSuccessfulRun",disabled:!0,fieldType:"datetime"}},{type:"field",mode:"props",props:{fieldLabel:"Last Run Message",fieldName:"lastRunMessage",disabled:!0,fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_TEXT_COLOR",fieldName:"notificationTextColor",required:!1,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_ICON_COLOR",fieldName:"notificationIconColor",required:!1,gridProps:{hidden:!0},fieldType:"text"}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_NOTIFICATION_ACTION",fieldName:"notificationAction",required:!1,fieldType:"combobox",comboboxValueDataType:"string",options:[{value:"NAVIGATION"}],optionDisplayField:"value",optionValueField:"value",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Action Payload (must be a rout in case of NAVIGATION with parameter values betweem @@)",fieldName:"notificationActionPayload",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"Organization Id Field on the Notification Query result set if it supports it",fieldName:"organizationIdField",required:!1,fieldType:"text",gridProps:{hidden:!0}}},{type:"field",mode:"props",props:{fieldLabel:"NOTIFICATION_IS_ACTIVE",fieldName:"isActive",required:!1,fieldType:"checkbox"}}];return t.jsx(vi,{apiActions:l,data:i,setData:r,editMode:{editMode:"modal",specs:{modalIcon:"bell",modalTitle:"System Notification",modalWidth:"300"}},formElements:c,keyColumnName:"id",gridTitle:e("NOTIFICATION_PLURAL"),girdIcon:"bell",editAction:{isEnabled:!0,authority:"NOTIFICATION_EDIT"},deleteAction:{isEnabled:!0,authority:"NOTIFICATION_DELETE"}})}},{path:"myNotifications",component:()=>{const{UserInfo:e}=we(),i=o.useSelector(e=>e.AppLayout),{handleGetRequest:r,handlePostRequest:n}=Re(),[a,l]=d.useState([]),c=o.useSelector(e=>e.AppInfo.value),u=()=>{!0===e.isAuthenticated&&r({endPointURI:"api/v1/public/notifications",showMask:!1,successCallBkFn:e=>{l(e.data)}})};return!0===c?.enableUINotifications&&er(u,1e3),t.jsxs(t.Fragment,{children:[t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.Box,{sx:{flex:1}}),t.jsxs("h3",{children:[t.jsx(m.FontAwesomeIcon,{icon:"bell",style:{marginRight:10,marginLeft:10}}),"ltr"===i.appDirection?"Notifications":"الاشعارات"]}),t.jsx(s.Box,{sx:{flex:1}}),t.jsx(s.Button,{sx:{textTransform:"none"},onClick:async()=>{await n({endPointURI:"api/v1/public/notification/all/notified",showMask:!0})},children:"Mark All Read"}),t.jsx(s.Button,{color:"error",sx:{textTransform:"none"},onClick:async()=>{await n({endPointURI:"api/v1/public/notification/all/archive",showMask:!0})},children:"Delete All"})]}),t.jsx(s.Box,{sx:{flex:1,width:"100%",display:"flex",overflowY:"auto"},children:t.jsx(s.Box,{sx:{flexGrow:1,width:"fit-content",display:"flex",flexDirection:"column",overflowY:"auto",alignItems:"center",justifyContent:"flex-start"},children:a.map((e,o)=>t.jsx(or,{...e,showDivider:o<a.length-1}))})})]})}},{path:"workflow/:workflowDocumentCode/:refDocumentId",component:Fi}]]],Vr=e=>{const{isUserAuthorized:o,isCurrentOrganizationAuthorizedToModule:i}=we();return e?.applicationModule&&!i(e?.applicationModule)?t.jsx(s.Box,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"red"},children:t.jsxs("h2",{children:[t.jsx(m.FontAwesomeIcon,{style:{marginRight:10,marginLeft:10},icon:"cancel"}),"Your organization didn't subscribe for this system module"]})}):e?.authority&&!o(e.authority)?t.jsx(s.Box,{sx:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",color:"red"},children:t.jsxs("h2",{children:[t.jsx(m.FontAwesomeIcon,{style:{marginRight:10,marginLeft:10},icon:"cancel"}),"You aren't authorized to access this page"]})}):t.jsx(t.Fragment,{children:e.children})},zr=()=>{const e=o.useSelector(e=>e.AppLayout),i=o.useSelector(e=>e.AppInfo.value),r=o.useSelector(e=>e.AppInfo.value.businessRoutes),{UserInfo:n}=we(),a=o.useDispatch(),{show:c,hide:u}=Ee(),p=o.useSelector(e=>e.commonStores),[h,m]=d.useState(!1),{isUserAuthorized:f}=we(),{handleGetRequest:g}=Re();d.useEffect(()=>{p?.storeKeys&&(async()=>{c("Loading ... please wait"),m(!1);const e=p.stores,t=p.storeKeys;for(let o of t)void 0!==e[o]?.authority&&null!==e[o]?.authority&&!f(e[o]?.authority)||""==e[o]?.url||!0!==e[o].autoLoad||g({endPointURI:e[o].url,showMask:!1,successCallBkFn:e=>{a(ve({storeKey:o,data:e.data}))},failureCallBkFn:()=>{a(ve({storeKey:o,data:[]}))}});m(!0),u()})()},[p.storeKeys,n?.currentOrganization]);const T=pe();return t.jsx(l.CacheProvider,{value:"ltr"===e.appDirection?Er:_r,children:t.jsx(s.Box,{sx:{display:"flex",flexDirection:"column",justifyContent:"flex-start",flex:1,overflow:"hidden",padding:T?1:3},children:t.jsxs(_.Routes,{children:[i.enableAdministrationModule?Kr.map((e,o)=>t.jsx(_.Route,{path:e.path,element:t.jsx(Vr,{authority:e.authority,applicationModule:e.applicationModule,children:t.jsx(e.component,{})})},"adm"+o)):null,r.map((e,o)=>t.jsx(_.Route,{path:e.path,element:t.jsx(Vr,{authority:e.authority,children:t.jsx(e.component,{})})},"bs"+o))]})})})},Qr=c.styled("div")(({theme:e})=>({width:30,height:6,margin:10,backgroundColor:ae.grey[300],borderRadius:3,top:8,...e.applyStyles("dark",{backgroundColor:ae.grey[900]})}));function $r(e){const{window:i}=e,r=o.useSelector(e=>e.SideBar),n=o.useSelector(e=>e.AppInfo.value),a=o.useDispatch(),l=e=>{a(Ji(e))},d=void 0!==i?()=>i().document.body:void 0;return t.jsx(se,{container:d,anchor:"bottom",open:r.isOpened,onClose:()=>{l(!1)},onOpen:()=>{l(!0)},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",height:"100%",overflow:"hidden"},children:[t.jsx(Qr,{}),t.jsx(s.Box,{sx:{flexGrow:1,display:"flex",justifyContent:"center",width:"99%",overflowY:"auto"},children:t.jsx(yr,{})}),t.jsxs(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-around",marginTop:1,width:"100%"},children:[t.jsx(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:n.appName}),t.jsxs(s.Typography,{sx:{fontSize:12},color:"textDisabled",children:["V.",n.appVersion]})]})]})})}const Zr=()=>{const{t:e}=y.useTranslation(),i=o.useSelector(e=>e.loadingMask.value),r=o.useSelector(e=>e.AppLayout);return t.jsxs(s.Backdrop,{dir:r.appDirection,sx:{color:"#fff",zIndex:e=>e.zIndex.drawer+1},open:i.isOpened,children:[t.jsx(s.CircularProgress,{color:"inherit"}),t.jsx("div",{style:{marginRight:10,marginLeft:10},children:i?.message||e("DEFAULT_LOADING_MESSAGE")})]})},Jr=()=>{const e=o.useSelector(e=>e.AppInfo.value),[i,r]=d.useState(""),[n,a]=d.useState(""),[c,u]=d.useState(!1),p=o.useSelector(e=>e.UserSession.value),h=o.useDispatch(),m=async()=>{if(null==i||""==i)return void g.toast.error("username is required to proceed");if(null==n||""==n)return void g.toast.error("password is required to proceed");u(!0);let t=null;try{if(t=await T.post(`${e.apiBaseUrl}/api/auth/login`,{username:i,password:n},{withCredentials:!0}),null!=t.data&&""!==t.data){u(!1);const e={...t.data,isAuthenticated:!0};t?.data?.token&&localStorage.setItem("TOKEN",t.data.token),h(Ce.setAuthenticated(e))}}catch(e){u(!1),g.toast.error(e?.response?.data||"failed to authenticate, contact your administrator")}},f=o.useSelector(e=>e.UserSession.value),A=s.createTheme({components:{MuiCssBaseline:{styleOverrides:`\n /* Custom Scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: ${e.appTheme?.dark?.primaryColor||Ye} #121212;\n }\n \n /* Webkit Browsers */\n *::-webkit-scrollbar {\n width: 12px;\n height: 10px;\n } \n `}},palette:{mode:e?.loginScreenStyle?.themeMode||"dark",primary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.primaryColor||We:e.appTheme?.dark?.primaryColor||Ye},secondary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.secondaryColor||He:e.appTheme?.dark?.secondaryColor||Ke}}});return d.useEffect(()=>{(async()=>{if(e?.apiBaseUrl&&null==f.isAuthenticated){const t=localStorage.getItem("TOKEN");try{let o=await T.get(`${e.apiBaseUrl}/api/auth/userInfo`,{withCredentials:!0,headers:{Authorization:`Bearer ${t}`}});if(null!=o&&null!=o.data){const e={...o.data,isAuthenticated:!0};h(Ce.setAuthenticated(e))}else h(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")}catch(e){h(Ce.setUnAuthenticated())}}})()},[e,f.isAuthenticated]),t.jsx(l.ThemeProvider,{theme:A,children:0==p.isAuthenticated?t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100%",backgroundImage:"url('/bg.jpg')",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:0}},children:t.jsx(s.Paper,{sx:{display:"flex",width:"fit-content",padding:2,height:"fit-content",borderRadius:5,alignItems:"center",justifyContent:"center",textAlign:"center",zIndex:1,p:4},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("img",{src:e?.appLogo,width:150,height:150}),t.jsx(s.Typography,{sx:{m:1},variant:"h4",color:"textSecondary",children:e?.appName}),t.jsxs(s.Typography,{sx:{paddingRight:1,width:"100%",textAlign:"right",fontSize:10},variant:"caption",color:"textSecondary",children:["V.",e.appVersion]}),t.jsx(s.TextField,{label:"username",sx:{width:300,m:1},value:i,onChange:e=>{r(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.TextField,{label:"password",sx:{width:300,m:1},value:n,type:"password",onChange:e=>{a(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.Button,{loading:c,onClick:m,variant:"contained",color:"primary",sx:{m:1},children:"login"})]})})}):t.jsxs(s.Paper,{sx:{width:"100%",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.CircularProgress,{sx:{marginRight:1}}),t.jsx("div",{children:"You will be redirected shortly ... please wait"})]})})},Xr=()=>{const[e,i]=d.useState({isLicensed:!0,lastLicenseCheckMessage:"",lastLicenseCheckTime:""}),{handleGetRequest:r}=Re(),n=o.useSelector(e=>e.AppInfo.value);return d.useEffect(()=>{if(n?.checkLicense?.endpoint){const e=setInterval(()=>{(async()=>{n?.checkLicense?.endpoint&&await r({endPointURI:n.checkLicense?.endpoint,successCallBkFn:e=>{i(e.data)}})})()},n?.checkLicense?.interval||6e4);return()=>{clearInterval(e),console.log("Interval cleared")}}},[n]),e.isLicensed?t.jsx(t.Fragment,{}):t.jsxs(s.Box,{sx:{flex:1,width:"100%",height:"100%",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",position:"fixed",top:0,background:"rgba(235, 235, 235, 0.8)",left:0,zIndex:9999},children:[t.jsx("img",{src:n.appLogo,style:{height:200,width:200}}),t.jsxs(s.Typography,{variant:"h5",children:[n.appName," - ",n.appVersion]}),t.jsx(s.Typography,{variant:"h6",color:"error",children:"Your license is missing or has expired."}),t.jsx(s.Typography,{variant:"h6",color:"error",children:"Please reach out to your vendor for assistance."}),t.jsxs(s.Typography,{children:["License Check @",e?.lastLicenseCheckTime||"--------"]}),t.jsxs(s.Typography,{children:["License Check Result :"," ",e?.lastLicenseCheckMessage||"--------"]})]})},en=({msalInstance:e})=>{const i=o.useSelector(e=>e.AppInfo.value);o.useSelector(e=>e.UserSession.value);const[r,n]=d.useState(!1),{handleGetRequest:a}=Re(),c=o.useDispatch(),u=async()=>{localStorage.getItem("TOKEN")?i?.apiBaseUrl&&a({endPointURI:"api/auth/userInfo",showMask:!0,successCallBkFn:e=>{if(n(!1),null!=e&&null!=e.data){const t={...e.data,isAuthenticated:!0};c(Ce.setAuthenticated(t))}else c(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")},failureCallBkFn:()=>{n(!1)}}):(c(Ce.setUnAuthenticated()),n(!1))},p=o.useSelector(e=>e.UserSession.value);d.useEffect(()=>{u()},[i]);const h=s.createTheme({components:{MuiCssBaseline:{styleOverrides:`\n /* Custom Scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: ${i.appTheme?.dark?.primaryColor||Ye} #121212;\n }\n \n /* Webkit Browsers */\n *::-webkit-scrollbar {\n width: 12px;\n height: 10px;\n } \n `}},palette:{mode:i?.loginScreenStyle?.themeMode||"dark",primary:{main:"light"===i?.loginScreenStyle?.themeMode?i.appTheme?.light?.primaryColor||We:i.appTheme?.dark?.primaryColor||Ye},secondary:{main:"light"===i?.loginScreenStyle?.themeMode?i.appTheme?.light?.secondaryColor||He:i.appTheme?.dark?.secondaryColor||Ke}}});return t.jsx(l.ThemeProvider,{theme:h,children:0==p.isAuthenticated?t.jsx(s.Box,{sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",width:"100%",backgroundImage:"url('/bg.jpg')",backgroundRepeat:"no-repeat",backgroundSize:"cover",backgroundPosition:"center","&::before":{content:'""',position:"absolute",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.4)",zIndex:0}},children:t.jsx(s.Paper,{sx:{display:"flex",width:"fit-content",padding:2,height:"fit-content",borderRadius:5,alignItems:"center",justifyContent:"center",textAlign:"center",zIndex:1,p:4},children:t.jsxs(s.Box,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},children:[t.jsx("img",{src:i?.appLogo,width:150,height:150}),t.jsx(s.Typography,{sx:{m:1},variant:"h4",color:"textSecondary",children:i?.appName}),t.jsxs(s.Typography,{sx:{paddingRight:1,width:"100%",textAlign:"right",fontSize:10},variant:"caption",color:"textSecondary",children:["V.",i.appVersion]}),t.jsx(s.Button,{loading:r,onClick:async()=>{n(!0);const t=await e.acquireTokenPopup({scopes:i?.azureConfiguration?.scopes});t?.accessToken?(localStorage.setItem("TOKEN",t.accessToken),u()):n(!1)},variant:"contained",color:"primary",sx:{m:1},startIcon:t.jsx(m.FontAwesomeIcon,{icon:{iconName:"microsoft",prefix:"fab"}}),children:"login"})]})})}):t.jsxs(s.Paper,{sx:{width:"100%",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.CircularProgress,{sx:{marginRight:1}}),t.jsx("div",{children:"You will be redirected shortly ... please wait"})]})})},tn=()=>{const e=o.useSelector(e=>e.AppInfo.value),[i,r]=d.useState(""),[n,a]=d.useState(""),[c,u]=d.useState(!1),p=o.useSelector(e=>e.UserSession.value),h=o.useDispatch(),m=async()=>{if(null==i||""==i)return void g.toast.error("username is required to proceed");if(null==n||""==n)return void g.toast.error("password is required to proceed");u(!0);let t=null;try{if(t=await T.post(`${e.apiBaseUrl}/api/auth/login`,{username:i,password:n},{withCredentials:!0}),null!=t.data&&""!==t.data){u(!1);const e={...t.data,isAuthenticated:!0};t?.data?.token&&localStorage.setItem("TOKEN",t.data.token),h(Ce.setAuthenticated(e))}}catch(e){u(!1),g.toast.error(e?.response?.data||"failed to authenticate, contact your administrator")}},f=o.useSelector(e=>e.UserSession.value),A=s.createTheme({components:{MuiCssBaseline:{styleOverrides:`\n /* Custom Scrollbar */\n * {\n scrollbar-width: thin;\n scrollbar-color: ${e.appTheme?.dark?.primaryColor||Ye} #121212;\n }\n \n /* Webkit Browsers */\n *::-webkit-scrollbar {\n width: 12px;\n height: 10px;\n } \n `}},palette:{mode:e?.loginScreenStyle?.themeMode||"dark",primary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.primaryColor||We:e.appTheme?.dark?.primaryColor||Ye},secondary:{main:"light"===e?.loginScreenStyle?.themeMode?e.appTheme?.light?.secondaryColor||He:e.appTheme?.dark?.secondaryColor||Ke}}});return d.useEffect(()=>{(async()=>{if(e?.apiBaseUrl&&null==f.isAuthenticated){const t=localStorage.getItem("TOKEN");try{let o=await T.get(`${e.apiBaseUrl}/api/auth/userInfo`,{withCredentials:!0,headers:{Authorization:`Bearer ${t}`}});if(null!=o&&null!=o.data){const e={...o.data,isAuthenticated:!0};h(Ce.setAuthenticated(e))}else h(Ce.setUnAuthenticated()),localStorage.removeItem("TOKEN")}catch(e){h(Ce.setUnAuthenticated())}}})()},[e,f.isAuthenticated]),t.jsx(l.ThemeProvider,{theme:A,children:0==p.isAuthenticated?t.jsxs(s.Paper,{sx:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100vh",width:"100%"},children:[t.jsx("img",{src:e?.appLogo,width:70,height:70}),t.jsx(s.Typography,{sx:{m:1},variant:"caption",color:"textSecondary",children:e?.appName}),t.jsxs(s.Typography,{sx:{paddingRight:1,width:200,textAlign:"right",fontSize:10},variant:"caption",color:"textSecondary",children:["V.",e.appVersion]}),t.jsx(s.TextField,{label:"username",sx:{width:200,m:1},value:i,onChange:e=>{r(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.TextField,{label:"password",sx:{width:200,m:1},value:n,type:"password",onChange:e=>{a(e.target.value)},onKeyDown:e=>{"Enter"===e.key&&m()}}),t.jsx(s.Button,{loading:c,onClick:m,variant:"contained",color:"primary",sx:{m:1},children:"login"})]}):t.jsxs(s.Paper,{sx:{width:"100%",height:"100vh",display:"flex",alignItems:"center",justifyContent:"center"},children:[t.jsx(s.CircularProgress,{sx:{marginRight:1}}),t.jsx("div",{children:"You will be redirected shortly ... please wait"})]})})},on=c.styled("main",{shouldForwardProp:e=>"open"!==e})(({theme:e,open:t})=>{const i=o.useSelector(e=>e.AppLayout),r=c.useTheme(),n=pe();return{display:"flex",flexDirection:"column",overflow:"hidden",flexGrow:1,width:!n&&t?"calc(100% - 350px)":"100%",direction:i.appDirection,justifyContent:"flex-start",transition:!0===t?r.transitions.create(["margin","width"],{easing:r.transitions.easing.easeOut,duration:r.transitions.duration.enteringScreen}):r.transitions.create(["margin","width"],{easing:r.transitions.easing.sharp,duration:r.transitions.duration.leavingScreen}),marginLeft:n||"ltr"!==i.appDirection||!0!==t?0:he+"px",marginRight:n||"rtl"!==i.appDirection||!0!==t?0:he+"px"}}),rn=({msalInstance:e})=>{const i=o.useSelector(e=>e.SideBar),r=o.useSelector(e=>e.AppInfo.value),n=pe(),a=o.useSelector(e=>e.UserSession),s=o.useSelector(e=>e.AppLayout);return t.jsxs(_.BrowserRouter,{children:[t.jsx(g.ToastContainer,{rtl:"rtl"===s.appDirection,draggable:!0,position:"bottom-center"}),t.jsx(Zr,{}),!0===a.value.isAuthenticated?t.jsxs(on,{open:i.isOpened,children:[t.jsx(u,{}),t.jsx(ar,{}),n?null:t.jsx(Ir,{}),n?t.jsx($r,{}):null,t.jsx(sr,{}),t.jsx(zr,{}),t.jsx(Xr,{})]}):"AZURE"===r.authenticationMethod?t.jsx(en,{msalInstance:e}):n?t.jsx(tn,{}):t.jsx(Jr,{})]})},nn=f.createSlice({name:"AppInfo",initialState:{value:{documentTitle:null,apiBaseUrl:null,authenticationMethod:"APP",appName:null,appVersion:null,appLogo:null,muiPremiumKey:null,enableAdministrationModule:!1,enableUINotifications:!1,businessRoutes:[],businessNavigationItems:[],businessReduxReducers:{},businessCommonStoresMetaData:{},appTheme:{light:{primaryColor:"#37505C",secondaryColor:"#ff6d00"},dark:{primaryColor:"#ea690e",secondaryColor:"#74776B"}}}},reducers:{setAppInfo:(e,t)=>{e.value=t.payload}}}),an=nn.actions;var sn=nn.reducer;const ln={SystemDataSourceType:{autoLoad:!1,data:[{value:"Mysql"},{value:"Oracle"},{value:"DB2"}],url:""},SystemParameterTypes:{autoLoad:!1,url:"",data:[{value:"text"},{value:"number"},{value:"date"},{value:"datetime"},{value:"combobox"},{value:"checkbox"},{value:"html"},{value:"lookup"}]},SystemReportTypes:{autoLoad:!1,url:"",data:[{value:"Excel"},{value:"Jasper"},{value:"Blueprint"}]},SystemWorkflows:{autoLoad:!0,url:"api/v1/dev/workflowdocument/all",authority:"DEVELOPMENT_ADMIN",data:[]},SystemWidgetTypes:{autoLoad:!1,url:"",data:[{name:"LineChart"},{name:"ColumnChart"},{name:"PieChart"},{name:"Card"},{name:"CircularProgress"},{name:"LinearProgress"}]},SystemTimeIntervals:{autoLoad:!1,url:"",data:[{value:"second"},{value:"minute"},{value:"hour"},{value:"day"},{value:"week"},{value:"month"},{value:"year"}]},SystemMailRecipientTypes:{autoLoad:!1,url:"",data:[{name:"To"},{name:"CC"}]},SystemOrganizations:{autoLoad:!0,url:"api/v1/public/organization/all",data:[]},SystemOrganizationRanks:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organization/ranks/all",data:[]},CurrentOrganizationRanks:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organizationrank/all",data:[]},SystemOrganizationUnits:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organization/units/all",data:[]},CurrentOrganizationUnits:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organizationunit/all",data:[]},SystemOrganizationUnitType:{autoLoad:!0,authority:"SYSTEM_ADMIN",url:"api/v1/public/organizationunittype/all",data:[]},SystemDataSources:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/datasourceconnection/all"},SystemDataQueries:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/dataquery/all"},SystemBluePrints:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/blueprint/all"},SystemReports:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/report/all"},SystemEntityParameters:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/entityparameter/all"},SystemMailTemplates:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/mailtemplate/all"},SystemWidgets:{autoLoad:!0,data:[],authority:"DEVELOPMENT_ADMIN",url:"api/v1/dev/widget/all"},SystemApplicationModules:{autoLoad:!0,data:[],authority:"SYSTEM_ADMIN",url:"api/v1/admin/systemapplicationmodule/application/all"},SystemApplicationAuthorities:{autoLoad:!0,data:[],authority:"SYSTEM_ADMIN",url:"api/v1/admin/systemapplicationauthority/all"},SystemApplicationRoles:{autoLoad:!0,data:[],authority:"SYSTEM_ADMIN",url:"api/v1/admin/systemapplicationrole/all"},persons:{autoLoad:!0,data:[],url:"api/v1/public/person/all"}},dn={LIBRARY_NAME:"MSAL.JS",SKU:"msal.js.common",DEFAULT_AUTHORITY:"https://login.microsoftonline.com/common/",DEFAULT_AUTHORITY_HOST:"login.microsoftonline.com",DEFAULT_COMMON_TENANT:"common",ADFS:"adfs",DSTS:"dstsv2",AAD_INSTANCE_DISCOVERY_ENDPT:"https://login.microsoftonline.com/common/discovery/instance?api-version=1.1&authorization_endpoint=",CIAM_AUTH_URL:".ciamlogin.com",AAD_TENANT_DOMAIN_SUFFIX:".onmicrosoft.com",RESOURCE_DELIM:"|",NO_ACCOUNT:"NO_ACCOUNT",CLAIMS:"claims",CONSUMER_UTID:"9188040d-6c67-4c5b-b112-36a304b66dad",OPENID_SCOPE:"openid",PROFILE_SCOPE:"profile",OFFLINE_ACCESS_SCOPE:"offline_access",EMAIL_SCOPE:"email",CODE_GRANT_TYPE:"authorization_code",RT_GRANT_TYPE:"refresh_token",S256_CODE_CHALLENGE_METHOD:"S256",URL_FORM_CONTENT_TYPE:"application/x-www-form-urlencoded;charset=utf-8",AUTHORIZATION_PENDING:"authorization_pending",NOT_DEFINED:"not_defined",EMPTY_STRING:"",NOT_APPLICABLE:"N/A",NOT_AVAILABLE:"Not Available",FORWARD_SLASH:"/",IMDS_ENDPOINT:"http://169.254.169.254/metadata/instance/compute/location",IMDS_VERSION:"2020-06-01",IMDS_TIMEOUT:2e3,AZURE_REGION_AUTO_DISCOVER_FLAG:"TryAutoDetect",REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX:"login.microsoft.com",KNOWN_PUBLIC_CLOUDS:["login.microsoftonline.com","login.windows.net","login.microsoft.com","sts.windows.net"],SHR_NONCE_VALIDITY:240,INVALID_INSTANCE:"invalid_instance"},cn=200,un=400,pn=400,hn=499,mn=500,fn=599,gn="GET",Tn="POST",An=[dn.OPENID_SCOPE,dn.PROFILE_SCOPE,dn.OFFLINE_ACCESS_SCOPE],yn=[...An,dn.EMAIL_SCOPE],In="Content-Type",_n="Content-Length",En="Retry-After",On="X-AnchorMailbox",Cn="x-ms-request-id",Nn="x-ms-httpver",Rn="active-account-filters",bn="common",wn="organizations",Sn="consumers",Pn="access_token",vn="xms_cc",Ln="login",Mn="select_account",xn="consent",Dn="none",kn="no_session",Un="code",Fn="id_token token refresh_token",Bn="query",qn="fragment",jn="query",Gn="authorization_code",Wn="refresh_token",Hn="MSSTS",Yn="ADFS",Kn="Generic",Vn="-",zn=".",Qn={ID_TOKEN:"IdToken",ACCESS_TOKEN:"AccessToken",ACCESS_TOKEN_WITH_AUTH_SCHEME:"AccessToken_With_AuthScheme",REFRESH_TOKEN:"RefreshToken"},$n="appmetadata",Zn="1",Jn="authority-metadata",Xn=86400,ea="config",ta="cache",oa="network",ia="hardcoded_values",ra={SCHEMA_VERSION:5,MAX_LAST_HEADER_BYTES:330,MAX_CACHED_ERRORS:50,CACHE_KEY:"server-telemetry",CATEGORY_SEPARATOR:"|",VALUE_SEPARATOR:",",OVERFLOW_TRUE:"1",OVERFLOW_FALSE:"0",UNKNOWN_ERROR:"unknown_error"},na={BEARER:"Bearer",POP:"pop",SSH:"ssh-cert"},aa=60,sa=3600,la="throttling",da="retry-after, h429",ca="invalid_grant",ua="client_mismatch",pa="1",ha="3",ma="4",fa="2",ga="4",Ta="5",Aa="0",ya="1",Ia="2",_a="3",Ea="4",Oa="pop",Ca="unexpected_error",Na="post_request_failed",Ra={[Ca]:"Unexpected error in authentication.",[Na]:"Post request failed from the network, could be a 4xx/5xx or a network unavailability. Please check the exact error code for details."};
38
38
  /*! @azure/msal-common v15.12.0 2025-08-19 */class ba extends Error{constructor(e,t,o){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,ba.prototype),this.errorCode=e||dn.EMPTY_STRING,this.errorMessage=t||dn.EMPTY_STRING,this.subError=o||dn.EMPTY_STRING,this.name="AuthError"}setCorrelationId(e){this.correlationId=e}}function wa(e,t){return new ba(e,t?`${Ra[e]} ${t}`:Ra[e])}
39
39
  /*! @azure/msal-common v15.12.0 2025-08-19 */const Sa="client_info_decoding_error",Pa="client_info_empty_error",va="token_parsing_error",La="null_or_empty_token",Ma="endpoints_resolution_error",xa="network_error",Da="openid_config_error",ka="hash_not_deserialized",Ua="invalid_state",Fa="state_mismatch",Ba="state_not_found",qa="nonce_mismatch",ja="auth_time_not_found",Ga="max_age_transpired",Wa="multiple_matching_tokens",Ha="multiple_matching_accounts",Ya="multiple_matching_appMetadata",Ka="request_cannot_be_made",Va="cannot_remove_empty_scope",za="cannot_append_scopeset",Qa="empty_input_scopeset",$a="device_code_polling_cancelled",Za="device_code_expired",Ja="device_code_unknown_error",Xa="no_account_in_silent_request",es="invalid_cache_record",ts="invalid_cache_environment",os="no_account_found",is="no_crypto_object",rs="unexpected_credential_type",ns="invalid_assertion",as="invalid_client_credential",ss="token_refresh_required",ls="user_timeout_reached",ds="token_claims_cnf_required_for_signedjwt",cs="authorization_code_missing_from_server_response",us="binding_key_not_removed",ps="end_session_endpoint_not_supported",hs="key_id_missing",ms="no_network_connectivity",fs="user_canceled",gs="missing_tenant_id_error",Ts="method_not_implemented",As="nested_app_auth_bridge_disabled",ys={[Sa]:"The client info could not be parsed/decoded correctly",[Pa]:"The client info was empty",[va]:"Token cannot be parsed",[La]:"The token is null or empty",[Ma]:"Endpoints cannot be resolved",[xa]:"Network request failed",[Da]:"Could not retrieve endpoints. Check your authority and verify the .well-known/openid-configuration endpoint returns the required endpoints.",[ka]:"The hash parameters could not be deserialized",[Ua]:"State was not the expected format",[Fa]:"State mismatch error",[Ba]:"State not found",[qa]:"Nonce mismatch error",[ja]:"Max Age was requested and the ID token is missing the auth_time variable. auth_time is an optional claim and is not enabled by default - it must be enabled. See https://aka.ms/msaljs/optional-claims for more information.",[Ga]:"Max Age is set to 0, or too much time has elapsed since the last end-user authentication.",[Wa]:"The cache contains multiple tokens satisfying the requirements. Call AcquireToken again providing more requirements such as authority or account.",[Ha]:"The cache contains multiple accounts satisfying the given parameters. Please pass more info to obtain the correct account",[Ya]:"The cache contains multiple appMetadata satisfying the given parameters. Please pass more info to obtain the correct appMetadata",[Ka]:"Token request cannot be made without authorization code or refresh token.",[Va]:"Cannot remove null or empty scope from ScopeSet",[za]:"Cannot append ScopeSet",[Qa]:"Empty input ScopeSet cannot be processed",[$a]:"Caller has cancelled token endpoint polling during device code flow by setting DeviceCodeRequest.cancel = true.",[Za]:"Device code is expired.",[Ja]:"Device code stopped polling for unknown reasons.",[Xa]:"Please pass an account object, silent flow is not supported without account information",[es]:"Cache record object was null or undefined.",[ts]:"Invalid environment when attempting to create cache entry",[os]:"No account found in cache for given key.",[is]:"No crypto object detected.",[rs]:"Unexpected credential type.",[ns]:"Client assertion must meet requirements described in https://tools.ietf.org/html/rfc7515",[as]:"Client credential (secret, certificate, or assertion) must not be empty when creating a confidential client. An application should at most have one credential",[ss]:"Cannot return token from cache because it must be refreshed. This may be due to one of the following reasons: forceRefresh parameter is set to true, claims have been requested, there is no cached access token or it is expired.",[ls]:"User defined timeout for device code polling reached",[ds]:"Cannot generate a POP jwt if the token_claims are not populated",[cs]:"Server response does not contain an authorization code to proceed",[us]:"Could not remove the credential's binding key from storage.",[ps]:"The provided authority does not support logout",[hs]:"A keyId value is missing from the requested bound token's cache record and is required to match the token to it's stored binding key.",[ms]:"No network connectivity. Check your internet connection.",[fs]:"User cancelled the flow.",[gs]:"A tenant id - not common, organizations, or consumers - must be specified when using the client_credentials flow.",[Ts]:"This method has not been implemented",[As]:"The nested app auth bridge is disabled"};class Is extends ba{constructor(e,t){super(e,t?`${ys[e]}: ${t}`:ys[e]),this.name="ClientAuthError",Object.setPrototypeOf(this,Is.prototype)}}function _s(e,t){return new Is(e,t)}
40
40
  /*! @azure/msal-common v15.12.0 2025-08-19 */const Es={createNewGuid:()=>{throw _s(Ts)},base64Decode:()=>{throw _s(Ts)},base64Encode:()=>{throw _s(Ts)},base64UrlEncode:()=>{throw _s(Ts)},encodeKid:()=>{throw _s(Ts)},async getPublicKeyThumbprint(){throw _s(Ts)},async removeTokenBindingKey(){throw _s(Ts)},async clearKeystore(){throw _s(Ts)},async signJwt(){throw _s(Ts)},async hashString(){throw _s(Ts)}};