{"version":3,"file":"WorkflowContent.mjs","names":["React","useMemo","useAxiosGet","makeStyles","PageContainer","useUser","APP_RIBBON_SPACE","useBuildEnvironment","UnitTypeEnums","WorkflowUiInterruptContent","SmsDisplay","EmailDisplay","ConfigService","useStyles","theme","root","height","WorkflowContent","props","selectedNode","workflow","reloadWorkflow","users","groups","handleClose","inquiryPageParams","buildEnv","classes","appRibbonSpace","user","data","pageData","loading","pageLoading","error","pageError","tenantV1ApiUrl","properties","page","id","content","res","type","Scene","Sms","sms","body","to","from","nodeLabel","Mail","email","html","text","pageId","entityName","entity","pbiReportCode","pbiReportForUnity","requiredFieldsMap","requiredFieldMapping","udpTagId","queryId","inquiryTreeId"],"sources":["../../src/workflow/WorkflowContent.jsx"],"sourcesContent":["import React, { useMemo } from 'react';\nimport { useAxiosGet } from '../utilities/useAxiosGet';\nimport { makeStyles } from '@material-ui/core';\nimport { PageContainer } from '../page/PageContainer';\nimport { useUser } from '../utilities/auth/useUser';\nimport {\n  APP_RIBBON_SPACE,\n  useBuildEnvironment\n} from '../shell/ui/useBuildEnvironment';\nimport { UnitTypeEnums } from '../enums/workflowEnums';\nimport { WorkflowUiInterruptContent } from './WorkflowUiInterruptContent';\nimport { SmsDisplay } from '../UI/components/dataDisplay/SmsDisplay';\nimport { EmailDisplay } from '../UI/components/dataDisplay/EmailDisplay';\nimport { ConfigService } from '../configService';\n\nconst useStyles = makeStyles((theme) => ({\n  root: {\n    height: '100%'\n  }\n}));\n\nexport const WorkflowContent = (props) => {\n  const {\n    selectedNode,\n    workflow,\n    reloadWorkflow,\n    users,\n    groups,\n    handleClose,\n    inquiryPageParams = {}\n  } = props;\n  const buildEnv = useBuildEnvironment();\n  const classes = useStyles({\n    ...props,\n    appRibbonSpace: buildEnv ? APP_RIBBON_SPACE : 0\n  });\n  const user = useUser();\n\n  const [{ data: pageData, loading: pageLoading, error: pageError }] =\n    useAxiosGet(\n      ConfigService.tenantV1ApiUrl,\n      `page/${selectedNode?.properties?.page?.id}`,\n      {},\n      !!!selectedNode?.properties?.page?.id,\n      false\n    );\n\n  const content = useMemo(() => {\n    let res = null;\n    if (selectedNode?.properties?.type === UnitTypeEnums.Scene) {\n      res = (\n        <WorkflowUiInterruptContent\n          key={selectedNode.id}\n          selectedNode={selectedNode}\n          workflow={workflow}\n          reloadWorkflow={reloadWorkflow}\n          users={users}\n          groups={groups}\n          handleClose={handleClose}\n          inquiryPageParams={inquiryPageParams}\n        />\n      );\n    } else if (selectedNode?.properties?.type === UnitTypeEnums.Sms) {\n      res = (\n        <SmsDisplay\n          messages={[selectedNode?.properties?.sms?.body || '']}\n          to={selectedNode?.properties?.sms?.to || ''}\n          from={selectedNode?.properties?.sms?.from || ''}\n          title={selectedNode?.properties?.nodeLabel || ''}\n          handleClose={handleClose}\n        />\n      );\n    } else if (selectedNode?.properties?.type === UnitTypeEnums.Mail) {\n      res = (\n        <EmailDisplay\n          html={\n            selectedNode?.properties?.email?.html ||\n            selectedNode?.properties?.email?.text ||\n            ''\n          }\n          to={selectedNode?.properties?.email?.to || ''}\n          from={selectedNode?.properties?.email?.from || ''}\n          title={selectedNode?.properties?.nodeLabel || ''}\n          handleClose={handleClose}\n        />\n      );\n    } else if (selectedNode?.properties?.page?.id) {\n      res = (\n        <PageContainer\n          user={user}\n          key={selectedNode?.id}\n          pageData={pageData}\n          pageLoading={pageLoading}\n          widgetParams={{\n            pageId: pageData?.pageId,\n            entityName: selectedNode?.properties?.page?.entity?.entityName,\n            pbiReportCode: selectedNode?.properties?.page?.pbiReportCode,\n            pbiReportForUnity:\n              selectedNode?.properties?.page?.pbiReportForUnity,\n            requiredFieldsMap:\n              selectedNode?.properties?.page?.requiredFieldMapping,\n            udpTagId: selectedNode?.properties?.page?.udpTagId,\n            queryId: selectedNode?.properties?.page?.queryId,\n            inquiryTreeId: selectedNode?.properties?.page?.inquiryTreeId\n          }}\n          disableMargins={true}\n          fromMenu={true}\n        />\n      );\n    }\n    return res;\n  }, [\n    groups,\n    pageData,\n    pageLoading,\n    reloadWorkflow,\n    selectedNode,\n    user,\n    users,\n    workflow,\n    handleClose\n  ]);\n\n  return <div className={classes.root}>{content}</div>;\n};\n"],"mappings":";;;;;;;;;;;;AAeA,MAAMa,YAAYV,YAAYW,WAAW,EACvCC,MAAM,EACJC,QAAQ,QACV,EACD,EAAE;AAEH,MAAaC,mBAAmBC,UAAU;CACxC,MAAM,EACJC,cACAC,UACAC,gBACAC,OACAC,QACAC,aACAC,oBAAoB,EAAC,KACnBP;CACJ,MAAMQ,WAAWnB,qBAAqB;CACtC,MAAMoB,UAAUd,UAAU;EACxB,GAAGK;EACHU,gBAAgBF,WAAAA,KAA8B;EAC/C,CAAC;CACF,MAAMG,OAAOxB,SAAS;CAEtB,MAAM,CAAC,EAAEyB,MAAMC,UAAUC,SAASC,aAAaC,OAAOC,eACpDjC,YACEU,cAAcwB,gBACd,QAAQjB,cAAckB,YAAYC,MAAMC,MACxC,EAAE,EACF,CAAC,CAAC,CAACpB,cAAckB,YAAYC,MAAMC,IACnC,MACD;CAEH,MAAMC,UAAUvC,cAAc;EAC5B,IAAIwC,MAAM;AACV,MAAItB,cAAckB,YAAYK,SAASlC,cAAcmC,MACnDF,OACE,sBAAA,cAAC,4BAAD;GACE,KAAKtB,aAAaoB;GACJpB;GACJC;GACMC;GACTC;GACCC;GACKC;GACMC;GAEtB,CAAA;WACQN,cAAckB,YAAYK,SAASlC,cAAcoC,IAC1DH,OACE,sBAAA,cAAC,YAAD;GACE,UAAU,CAACtB,cAAckB,YAAYQ,KAAKC,QAAQ,GAAG;GACrD,IAAI3B,cAAckB,YAAYQ,KAAKE,MAAM;GACzC,MAAM5B,cAAckB,YAAYQ,KAAKG,QAAQ;GAC7C,OAAO7B,cAAckB,YAAYY,aAAa;GACjCzB;GAEhB,CAAA;WACQL,cAAckB,YAAYK,SAASlC,cAAc0C,KAC1DT,OACE,sBAAA,cAAC,cAAD;GACE,MACEtB,cAAckB,YAAYc,OAAOC,QACjCjC,cAAckB,YAAYc,OAAOE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