flowcore-fn 10.3.9 → 10.4.1

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.
@@ -12,7 +12,7 @@ import {
12
12
  } from "./chunk-I4E63NIC.mjs";
13
13
 
14
14
  // src/components/Sidebar.jsx
15
- import { useState as useState81, useEffect as useEffect60 } from "react";
15
+ import { useState as useState81, useEffect as useEffect61 } from "react";
16
16
  import {
17
17
  RiShieldUserLine,
18
18
  RiFolder3Line,
@@ -9375,21 +9375,21 @@ function Popup({ isOpen, onClose, onSave }) {
9375
9375
  }
9376
9376
  };
9377
9377
  const permissionCards = [
9378
- { icon: "\u{1F441}\uFE0F", title: "Can View", desc: "Read logs & details", field: "canView" },
9379
- { icon: "\u2713", title: "Can Approve", desc: "Pass states & approve", field: "canApprove" },
9380
- { icon: "\u{1F4DD}", title: "Can Edit", desc: "Modify properties", field: "canEdit" },
9381
- { icon: "\u2715", title: "Can Reject", desc: "Cancel / reject tasks", field: "canReject" },
9382
- { icon: "\u27A1\uFE0F", title: "Can Forward", desc: "Forward to next step", field: "canForward" },
9383
- { icon: "\u23E9", title: "Can Free Forward", desc: "Forward freely to any step", field: "canFreeForward" },
9384
- { icon: "\u21A9\uFE0F", title: "Can Return", desc: "Return to previous step", field: "canReturn" },
9385
- { icon: "\u{1F464}", title: "Can Return To Applicant", desc: "Send back to applicant", field: "canReturnToApplicant" },
9386
- { icon: "\u{1F465}", title: "Can Delegate", desc: "Reassign or delegate task", field: "canDelegate" },
9387
- { icon: "\u23F8\uFE0F", title: "Can Hold", desc: "Put execution on hold", field: "canHold" }
9378
+ { title: "Can View", field: "canView", labelField: "viewLabel" },
9379
+ { title: "Can Approve", field: "canApprove", labelField: "approveLabel" },
9380
+ { title: "Can Edit", field: "canEdit", labelField: "editLabel" },
9381
+ { title: "Can Reject", field: "canReject", labelField: "rejectLabel" },
9382
+ { title: "Can Forward", field: "canForward", labelField: "forwardLabel" },
9383
+ { title: "Can Free Forward", field: "canFreeForward", labelField: "freeForwardLabel" },
9384
+ { title: "Can Return", field: "canReturn", labelField: "returnLabel" },
9385
+ { title: "Can Return To Applicant", field: "canReturnToApplicant", labelField: "returnToApplicantLabel" },
9386
+ { title: "Can Delegate", field: "canDelegate", labelField: "delegateLabel" },
9387
+ { title: "Can Hold", field: "canHold", labelField: "holdLabel" }
9388
9388
  ];
9389
9389
  return /* @__PURE__ */ jsxs40("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
9390
9390
  /* @__PURE__ */ jsx41("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
9391
- /* @__PURE__ */ jsxs40("div", { className: "fc:relative fc:w-full fc:max-w-4xl fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:flex fc:flex-col fc:z-10 fc:max-h-[92vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:duration-200", children: [
9392
- /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100", children: [
9391
+ /* @__PURE__ */ jsxs40("div", { className: "fc:relative fc:w-full fc:max-w-6xl fc:bg-white fc:rounded-3xl fc:shadow-2xl fc:flex fc:flex-col fc:z-10 fc:max-h-[96vh] fc:overflow-hidden fc:animate-in fc:fade-in fc:zoom-in-95 fc:duration-200", children: [
9392
+ /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-6 fc:py-4 fc:border-b fc:border-slate-100", children: [
9393
9393
  /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
9394
9394
  /* @__PURE__ */ jsx41("div", { className: "fc:w-12 fc:h-12 fc:bg-blue-50 fc:text-blue-600 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:shadow-sm fc:text-xl", children: "\u{1F511}" }),
9395
9395
  /* @__PURE__ */ jsxs40("div", { children: [
@@ -9399,10 +9399,10 @@ function Popup({ isOpen, onClose, onSave }) {
9399
9399
  ] }),
9400
9400
  /* @__PURE__ */ jsx41("button", { onClick: onClose, className: "fc:text-slate-400 hover:fc:fc:text-slate-600 hover:fc:fc:bg-slate-100 fc:p-2 fc:rounded-full fc:transition-all fc:text-sm fc:font-semibold", children: "\u2715" })
9401
9401
  ] }),
9402
- /* @__PURE__ */ jsxs40("form", { onSubmit: handleSubmit, className: "fc:flex fc:flex-col fc:flex-1 fc:overflow-hidden", children: [
9403
- /* @__PURE__ */ jsxs40("div", { className: "fc:p-8 fc:space-y-8 fc:overflow-y-auto fc:max-h-[calc(92vh-170px)] fc:bg-slate-50/30", children: [
9404
- /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9405
- /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9402
+ /* @__PURE__ */ jsxs40("form", { onSubmit: handleSubmit, className: "fc:flex fc:min-h-0 fc:flex-1 fc:flex-col fc:overflow-hidden", children: [
9403
+ /* @__PURE__ */ jsxs40("div", { className: "fc:min-h-0 fc:flex-1 fc:space-y-4 fc:overflow-y-auto fc:bg-slate-50/30 fc:p-4 md:fc:p-5", children: [
9404
+ /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9405
+ /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-2", children: [
9406
9406
  /* @__PURE__ */ jsx41("span", { children: "\u{1F4CB}" }),
9407
9407
  /* @__PURE__ */ jsx41("span", { children: "Step Information" })
9408
9408
  ] }),
@@ -9435,56 +9435,57 @@ function Popup({ isOpen, onClose, onSave }) {
9435
9435
  errors.workflowStepId && /* @__PURE__ */ jsx41("p", { className: "fc:text-red-500 fc:text-[11px] fc:mt-1", children: errors.workflowStepId })
9436
9436
  ] })
9437
9437
  ] }),
9438
- /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9438
+ /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9439
9439
  /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9440
9440
  /* @__PURE__ */ jsx41("span", { children: "\u2699\uFE0F" }),
9441
9441
  /* @__PURE__ */ jsx41("span", { children: "Set Initial Matrix Access Rules" })
9442
9442
  ] }),
9443
- /* @__PURE__ */ jsx41("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: permissionCards.map(({ icon, title, desc, field }) => /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:justify-between fc:p-4 fc:bg-slate-50/50 fc:border fc:border-slate-100 fc:rounded-2xl", children: [
9444
- /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2.5", children: [
9445
- /* @__PURE__ */ jsx41("div", { className: "fc:w-8 fc:h-8 fc:rounded-lg fc:bg-blue-50 fc:text-blue-600 fc:flex fc:items-center fc:justify-center fc:text-xs", children: icon }),
9446
- /* @__PURE__ */ jsxs40("div", { children: [
9447
- /* @__PURE__ */ jsx41("p", { className: "fc:text-xs fc:font-bold fc:text-slate-700", children: title }),
9448
- /* @__PURE__ */ jsx41("p", { className: "fc:text-[9px] fc:text-slate-400", children: desc })
9449
- ] })
9450
- ] }),
9451
- /* @__PURE__ */ jsx41(
9452
- "button",
9453
- {
9454
- type: "button",
9455
- onClick: () => handleChange(field, !formData[field]),
9456
- className: `fc:relative fc:inline-flex fc:h-5.5 fc:w-10 fc:shrink-0 fc:cursor-pointer fc:rounded-full fc:border-2 fc:border-transparent fc:transition-colors fc:duration-200 fc:ease-in-out fc:outline-none ${formData[field] ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
9457
- children: /* @__PURE__ */ jsx41(
9458
- "span",
9459
- {
9460
- className: `fc:pointer-events-none fc:inline-block fc:h-4.5 fc:w-4.5 fc:transform fc:rounded-full fc:bg-white fc:shadow fc:ring-0 fc:transition fc:duration-200 fc:ease-in-out ${formData[field] ? "fc:translate-x-4.5" : "fc:translate-x-0"}`
9461
- }
9462
- )
9463
- }
9464
- )
9465
- ] }, field)) })
9466
- ] }),
9467
- /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-5", children: [
9468
- /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9469
- /* @__PURE__ */ jsx41("span", { children: "\u{1F3F7}\uFE0F" }),
9470
- /* @__PURE__ */ jsx41("span", { children: "Action Labels" })
9471
- ] }),
9472
- /* @__PURE__ */ jsx41("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: permissionLabelFields.map(({ field, label, fallback }) => /* @__PURE__ */ jsxs40("div", { children: [
9473
- /* @__PURE__ */ jsx41("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: label }),
9474
- /* @__PURE__ */ jsx41(
9475
- "input",
9476
- {
9477
- type: "text",
9478
- value: formData[field],
9479
- onChange: (event) => handleChange(field, event.target.value),
9480
- placeholder: fallback,
9481
- className: "fc:w-full fc:px-3 fc:py-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:text-slate-700 fc:bg-white focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/10 focus:fc:border-indigo-500"
9482
- }
9483
- )
9484
- ] }, field)) })
9443
+ /* @__PURE__ */ jsx41(
9444
+ "div",
9445
+ {
9446
+ className: "fc:grid fc:gap-3",
9447
+ style: { gridTemplateColumns: "repeat(auto-fit, minmax(max(200px, calc((100% - 36px) / 4)), 1fr))" },
9448
+ children: permissionCards.map(({ title, field, labelField }) => {
9449
+ var _a, _b;
9450
+ const actionLabel = permissionLabelFields.find((item) => item.field === labelField);
9451
+ return /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:min-w-0 fc:flex-col fc:gap-2 fc:rounded-xl fc:border fc:border-slate-100 fc:bg-slate-50/50 fc:p-3", children: [
9452
+ /* @__PURE__ */ jsx41("p", { className: "fc:text-[11px] fc:font-extrabold fc:text-slate-700", children: title }),
9453
+ /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2", children: [
9454
+ /* @__PURE__ */ jsx41(
9455
+ "input",
9456
+ {
9457
+ type: "text",
9458
+ "aria-label": (_a = actionLabel == null ? void 0 : actionLabel.label) != null ? _a : `${title} label`,
9459
+ value: (_b = formData[labelField]) != null ? _b : "",
9460
+ placeholder: actionLabel == null ? void 0 : actionLabel.fallback,
9461
+ onChange: (event) => handleChange(labelField, event.target.value),
9462
+ className: "fc:min-w-0 fc:flex-1 fc:rounded-lg fc:border fc:border-slate-200 fc:bg-white fc:px-2 fc:py-1.5 fc:text-[11px] fc:text-slate-700 focus:fc:border-indigo-500 focus:fc:outline-none"
9463
+ }
9464
+ ),
9465
+ /* @__PURE__ */ jsx41(
9466
+ "button",
9467
+ {
9468
+ type: "button",
9469
+ "aria-label": `${title}: ${formData[field] ? "enabled" : "disabled"}`,
9470
+ "aria-pressed": Boolean(formData[field]),
9471
+ onClick: () => handleChange(field, !formData[field]),
9472
+ className: `fc:relative fc:inline-flex fc:h-5.5 fc:w-10 fc:shrink-0 fc:cursor-pointer fc:rounded-full fc:border-2 fc:border-transparent fc:transition-colors fc:duration-200 fc:ease-in-out fc:outline-none ${formData[field] ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
9473
+ children: /* @__PURE__ */ jsx41(
9474
+ "span",
9475
+ {
9476
+ className: `fc:pointer-events-none fc:inline-block fc:h-4.5 fc:w-4.5 fc:transform fc:rounded-full fc:bg-white fc:shadow fc:ring-0 fc:transition fc:duration-200 fc:ease-in-out ${formData[field] ? "fc:translate-x-4.5" : "fc:translate-x-0"}`
9477
+ }
9478
+ )
9479
+ }
9480
+ )
9481
+ ] })
9482
+ ] }, field);
9483
+ })
9484
+ }
9485
+ )
9485
9486
  ] }),
9486
- /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-4", children: [
9487
- /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
9487
+ /* @__PURE__ */ jsxs40("div", { className: "fc:bg-white fc:p-4 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-3", children: [
9488
+ /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-blue-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-2", children: [
9488
9489
  /* @__PURE__ */ jsx41("span", { children: "\u{1F518}" }),
9489
9490
  /* @__PURE__ */ jsx41("span", { children: "Status" })
9490
9491
  ] }),
@@ -9508,7 +9509,7 @@ function Popup({ isOpen, onClose, onSave }) {
9508
9509
  )) })
9509
9510
  ] })
9510
9511
  ] }),
9511
- /* @__PURE__ */ jsxs40("div", { className: "fc:p-5 fc:bg-white fc:border-t fc:border-slate-100 fc:flex fc:items-center fc:justify-end fc:gap-3 fc:px-8", children: [
9512
+ /* @__PURE__ */ jsxs40("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-3 fc:border-t fc:border-slate-100 fc:bg-white fc:px-6 fc:py-3", children: [
9512
9513
  /* @__PURE__ */ jsxs40(
9513
9514
  "button",
9514
9515
  {
@@ -10285,12 +10286,12 @@ function FormFieldMain() {
10285
10286
  /* @__PURE__ */ jsx46(
10286
10287
  CommonHeader,
10287
10288
  {
10288
- title: "Update Permission",
10289
+ title: "Applicant Form Fields",
10289
10290
  breadcrumbs: [
10290
10291
  { label: "Dashboard", href: "/dashboard" },
10291
10292
  { label: "Masters", href: "/masters" },
10292
10293
  { label: "Permissions", href: "/permissions" },
10293
- { label: "Update Permission", href: "/form-field" }
10294
+ { label: "Applicant Form Fields", href: "/form-field" }
10294
10295
  ],
10295
10296
  buttonText: "Add Form Field",
10296
10297
  onButtonClick: openCreate
@@ -18630,7 +18631,9 @@ function AddStatusModal({
18630
18631
  isOpen,
18631
18632
  onClose,
18632
18633
  onSave,
18633
- modules = []
18634
+ modules = [],
18635
+ actionCodes = [],
18636
+ isLoadingActionCodes = false
18634
18637
  }) {
18635
18638
  const [formData, setFormData] = useState70(INITIAL_FORM4);
18636
18639
  const [errors, setErrors] = useState70({});
@@ -18678,9 +18681,6 @@ function AddStatusModal({
18678
18681
  if (!formData.moduleId) {
18679
18682
  errs.moduleId = "Module is required.";
18680
18683
  }
18681
- if (!formData.statusName.trim()) {
18682
- errs.statusName = "Status Name is required.";
18683
- }
18684
18684
  if (!formData.statusCode.trim()) {
18685
18685
  errs.statusCode = "Status Code is required.";
18686
18686
  }
@@ -18693,7 +18693,7 @@ function AddStatusModal({
18693
18693
  if (!validate()) return;
18694
18694
  const payload = {
18695
18695
  moduleId: Number(formData.moduleId),
18696
- statusName: formData.statusName.trim(),
18696
+ statusName: formData.statusCode.trim().toUpperCase(),
18697
18697
  statusCode: formData.statusCode.trim().toUpperCase(),
18698
18698
  description: formData.description.trim(),
18699
18699
  createdBy: "System"
@@ -18793,15 +18793,21 @@ function AddStatusModal({
18793
18793
  /* @__PURE__ */ jsx94("span", { className: "fc:text-red-500", children: "*" })
18794
18794
  ] }),
18795
18795
  /* @__PURE__ */ jsxs93("div", { className: "fc:relative", children: [
18796
- /* @__PURE__ */ jsx94(
18797
- "input",
18796
+ /* @__PURE__ */ jsxs93(
18797
+ "select",
18798
18798
  {
18799
- type: "text",
18800
18799
  name: "statusCode",
18801
18800
  value: formData.statusCode,
18802
18801
  onChange: handleChange,
18803
- placeholder: "e.g. ST_01, COMPLETED",
18804
- className: `${inputCls(errors.statusCode)} uppercase`
18802
+ disabled: isLoadingActionCodes,
18803
+ className: `${inputCls(errors.statusCode)} fc:bg-white disabled:fc:opacity-60`,
18804
+ children: [
18805
+ /* @__PURE__ */ jsx94("option", { value: "", children: isLoadingActionCodes ? "Loading action codes..." : "Select an action code" }),
18806
+ actionCodes.map((action) => {
18807
+ var _a;
18808
+ return /* @__PURE__ */ jsx94("option", { value: action.name, children: action.name }, (_a = action.value) != null ? _a : action.name);
18809
+ })
18810
+ ]
18805
18811
  }
18806
18812
  ),
18807
18813
  /* @__PURE__ */ jsx94("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx94("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
@@ -18809,27 +18815,6 @@ function AddStatusModal({
18809
18815
  errors.statusCode && /* @__PURE__ */ jsx94("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusCode })
18810
18816
  ] })
18811
18817
  ] }),
18812
- /* @__PURE__ */ jsxs93("div", { children: [
18813
- /* @__PURE__ */ jsxs93("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: [
18814
- "Status Name ",
18815
- /* @__PURE__ */ jsx94("span", { className: "fc:text-red-500", children: "*" })
18816
- ] }),
18817
- /* @__PURE__ */ jsxs93("div", { className: "fc:relative", children: [
18818
- /* @__PURE__ */ jsx94(
18819
- "input",
18820
- {
18821
- type: "text",
18822
- name: "statusName",
18823
- value: formData.statusName,
18824
- onChange: handleChange,
18825
- placeholder: "Enter status name (e.g. In Progress, Completed)",
18826
- className: inputCls(errors.statusName)
18827
- }
18828
- ),
18829
- /* @__PURE__ */ jsx94("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx94("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
18830
- ] }),
18831
- errors.statusName && /* @__PURE__ */ jsx94("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusName })
18832
- ] }),
18833
18818
  /* @__PURE__ */ jsxs93("div", { children: [
18834
18819
  /* @__PURE__ */ jsx94("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Description" }),
18835
18820
  /* @__PURE__ */ jsxs93("div", { className: "fc:relative", children: [
@@ -18905,6 +18890,8 @@ function EditStatusModal({
18905
18890
  onSave,
18906
18891
  selectedData,
18907
18892
  modules = [],
18893
+ actionCodes = [],
18894
+ isLoadingActionCodes = false,
18908
18895
  isFetchingById = false
18909
18896
  }) {
18910
18897
  const [formData, setFormData] = useState71(() => getInitialFormData3(selectedData));
@@ -18961,9 +18948,6 @@ function EditStatusModal({
18961
18948
  if (!formData.moduleId) {
18962
18949
  errs.moduleId = "Module is required.";
18963
18950
  }
18964
- if (!String(formData.statusName).trim()) {
18965
- errs.statusName = "Status Name is required.";
18966
- }
18967
18951
  if (!String(formData.statusCode).trim()) {
18968
18952
  errs.statusCode = "Status Code is required.";
18969
18953
  }
@@ -18977,7 +18961,7 @@ function EditStatusModal({
18977
18961
  const payload = {
18978
18962
  statusId: Number(formData.statusId) || 0,
18979
18963
  moduleId: Number(formData.moduleId) || 0,
18980
- statusName: String(formData.statusName).trim(),
18964
+ statusName: String(formData.statusCode).trim().toUpperCase(),
18981
18965
  statusCode: String(formData.statusCode).trim().toUpperCase(),
18982
18966
  description: String(formData.description).trim(),
18983
18967
  isActive: Boolean(formData.isActive),
@@ -19083,15 +19067,22 @@ function EditStatusModal({
19083
19067
  /* @__PURE__ */ jsx95("span", { className: "fc:text-red-500", children: "*" })
19084
19068
  ] }),
19085
19069
  /* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
19086
- /* @__PURE__ */ jsx95(
19087
- "input",
19070
+ /* @__PURE__ */ jsxs94(
19071
+ "select",
19088
19072
  {
19089
- type: "text",
19090
19073
  name: "statusCode",
19091
19074
  value: formData.statusCode,
19092
19075
  onChange: handleChange,
19093
- placeholder: "e.g. ST_01, COMPLETED",
19094
- className: `${inputCls(errors.statusCode)} uppercase`
19076
+ disabled: true,
19077
+ className: `${inputCls(errors.statusCode)} fc:bg-white disabled:fc:opacity-60`,
19078
+ children: [
19079
+ /* @__PURE__ */ jsx95("option", { value: "", children: isLoadingActionCodes ? "Loading action codes..." : "Select an action code" }),
19080
+ formData.statusCode && !actionCodes.some((action) => action.name.toUpperCase() === String(formData.statusCode).toUpperCase()) && /* @__PURE__ */ jsx95("option", { value: formData.statusCode, children: formData.statusCode }),
19081
+ actionCodes.map((action) => {
19082
+ var _a;
19083
+ return /* @__PURE__ */ jsx95("option", { value: action.name, children: action.name }, (_a = action.value) != null ? _a : action.name);
19084
+ })
19085
+ ]
19095
19086
  }
19096
19087
  ),
19097
19088
  /* @__PURE__ */ jsx95("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx95("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M10 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4" }) })
@@ -19099,45 +19090,7 @@ function EditStatusModal({
19099
19090
  errors.statusCode && /* @__PURE__ */ jsx95("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusCode })
19100
19091
  ] })
19101
19092
  ] }),
19102
- /* @__PURE__ */ jsxs94("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-3.5", children: [
19103
- /* @__PURE__ */ jsxs94("div", { children: [
19104
- /* @__PURE__ */ jsxs94("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: [
19105
- "Status Name ",
19106
- /* @__PURE__ */ jsx95("span", { className: "fc:text-red-500", children: "*" })
19107
- ] }),
19108
- /* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
19109
- /* @__PURE__ */ jsx95(
19110
- "input",
19111
- {
19112
- type: "text",
19113
- name: "statusName",
19114
- value: formData.statusName,
19115
- onChange: handleChange,
19116
- placeholder: "Enter status name",
19117
- className: inputCls(errors.statusName)
19118
- }
19119
- ),
19120
- /* @__PURE__ */ jsx95("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx95("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z" }) })
19121
- ] }),
19122
- errors.statusName && /* @__PURE__ */ jsx95("p", { className: "fc:text-[11px] fc:text-red-500 fc:mt-1", children: errors.statusName })
19123
- ] }),
19124
- /* @__PURE__ */ jsxs94("div", { children: [
19125
- /* @__PURE__ */ jsx95("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Status ID" }),
19126
- /* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
19127
- /* @__PURE__ */ jsx95(
19128
- "input",
19129
- {
19130
- type: "text",
19131
- name: "statusId",
19132
- value: formData.statusId,
19133
- disabled: true,
19134
- className: "fc:w-full fc:py-2.5 fc:px-3 fc:pl-9 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-slate-100 fc:text-slate-500 fc:cursor-not-allowed"
19135
- }
19136
- ),
19137
- /* @__PURE__ */ jsx95("svg", { className: "fc:w-4 fc:h-4 fc:absolute fc:left-3 fc:top-3 fc:text-slate-400 fc:pointer-events-none", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx95("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M7 20l4-16m2 16l4-16M6 9h14M4 15h14" }) })
19138
- ] })
19139
- ] })
19140
- ] }),
19093
+ /* @__PURE__ */ jsx95("div", { className: "fc:grid fc:grid-cols-2 md:fc:grid-cols-2 fc:gap-3.5" }),
19141
19094
  /* @__PURE__ */ jsxs94("div", { children: [
19142
19095
  /* @__PURE__ */ jsx95("label", { className: "fc:block fc:text-[11px] fc:font-bold fc:text-slate-700 fc:mb-1", children: "Description" }),
19143
19096
  /* @__PURE__ */ jsxs94("div", { className: "fc:relative", children: [
@@ -19249,7 +19202,8 @@ var DEFAULT_ENDPOINTS2 = {
19249
19202
  update: "/api/flowcore/Status/Update",
19250
19203
  getList: "/api/flowcore/Status/GetList",
19251
19204
  getById: "/api/flowcore/Status/GetById",
19252
- moduleList: "/api/flowcore/Module/GetList"
19205
+ moduleList: "/api/flowcore/Module/GetList",
19206
+ actionCodeList: "/api/flowcore/WorkflowExecution/GetActionCodeList"
19253
19207
  };
19254
19208
  function StatusMain() {
19255
19209
  const tableRef = useRef24(null);
@@ -19257,6 +19211,9 @@ function StatusMain() {
19257
19211
  const [isLoading, setIsLoading] = useState72(false);
19258
19212
  const [apiData, setApiData] = useState72([]);
19259
19213
  const [modules, setModules] = useState72([]);
19214
+ const [actionCodes, setActionCodes] = useState72([]);
19215
+ const [isLoadingActionCodes, setIsLoadingActionCodes] = useState72(false);
19216
+ const [hasLoadedActionCodes, setHasLoadedActionCodes] = useState72(false);
19260
19217
  const [selectedModuleId, setSelectedModuleId] = useState72("");
19261
19218
  const [pageSize, setPageSize] = useState72(5);
19262
19219
  const [searchQuery, setSearchQuery] = useState72("");
@@ -19294,9 +19251,50 @@ function StatusMain() {
19294
19251
  return DEFAULT_ENDPOINTS2.moduleList;
19295
19252
  }
19296
19253
  };
19254
+ const getActionCodeListEndpoint = () => {
19255
+ var _a, _b;
19256
+ try {
19257
+ const flowCore = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore;
19258
+ return ((_b = flowCore == null ? void 0 : flowCore.inbox) == null ? void 0 : _b.GetPermisiionLabelWithCodeAll) || DEFAULT_ENDPOINTS2.actionCodeList;
19259
+ } catch (e) {
19260
+ return DEFAULT_ENDPOINTS2.actionCodeList;
19261
+ }
19262
+ };
19297
19263
  const handleRefresh = () => {
19298
19264
  setRefreshKey((prev) => prev + 1);
19299
19265
  };
19266
+ const handleOpenAdd = async () => {
19267
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
19268
+ setIsAddOpen(true);
19269
+ if (hasLoadedActionCodes || isLoadingActionCodes) return;
19270
+ try {
19271
+ setIsLoadingActionCodes(true);
19272
+ let endpoint3 = getActionCodeListEndpoint();
19273
+ if (typeof endpoint3 === "function") endpoint3 = endpoint3();
19274
+ const response = await getApiService().get(endpoint3);
19275
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
19276
+ const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
19277
+ setActionCodes(rows.filter((item) => {
19278
+ var _a2;
19279
+ return (_a2 = item == null ? void 0 : item.name) != null ? _a2 : item == null ? void 0 : item.Name;
19280
+ }).map((item) => {
19281
+ var _a2, _b2;
19282
+ return {
19283
+ value: (_a2 = item.value) != null ? _a2 : item.Value,
19284
+ name: String((_b2 = item.name) != null ? _b2 : item.Name)
19285
+ };
19286
+ }));
19287
+ setHasLoadedActionCodes(true);
19288
+ } catch (error) {
19289
+ await Swal29.fire(
19290
+ "Error",
19291
+ ((_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) || (error == null ? void 0 : error.message) || "Unable to load action codes.",
19292
+ "error"
19293
+ );
19294
+ } finally {
19295
+ setIsLoadingActionCodes(false);
19296
+ }
19297
+ };
19300
19298
  useEffect50(() => {
19301
19299
  let isMounted = true;
19302
19300
  (async () => {
@@ -19511,7 +19509,7 @@ function StatusMain() {
19511
19509
  { label: "Status", href: "/status" }
19512
19510
  ],
19513
19511
  buttonText: "Add Status",
19514
- onButtonClick: () => setIsAddOpen(true)
19512
+ onButtonClick: handleOpenAdd
19515
19513
  }
19516
19514
  ),
19517
19515
  /* @__PURE__ */ jsxs95("div", { className: "fc:bg-white fc:rounded-3xl fc:shadow-sm fc:border fc:border-slate-100 fc:p-6 fc:flex fc:flex-col fc:gap-6", children: [
@@ -19644,7 +19642,9 @@ function StatusMain() {
19644
19642
  isOpen: isAddOpen,
19645
19643
  onClose: () => setIsAddOpen(false),
19646
19644
  onSave: handleCreate,
19647
- modules
19645
+ modules,
19646
+ actionCodes,
19647
+ isLoadingActionCodes
19648
19648
  }
19649
19649
  ),
19650
19650
  /* @__PURE__ */ jsx96(
@@ -19657,6 +19657,8 @@ function StatusMain() {
19657
19657
  },
19658
19658
  selectedData: selectedItem,
19659
19659
  modules,
19660
+ actionCodes,
19661
+ isLoadingActionCodes,
19660
19662
  onSave: handleUpdate
19661
19663
  }
19662
19664
  )
@@ -19664,7 +19666,7 @@ function StatusMain() {
19664
19666
  }
19665
19667
 
19666
19668
  // src/components/inbox/InboxMain.jsx
19667
- import React111, { useState as useState79, useMemo as useMemo8, useRef as useRef29, useEffect as useEffect58 } from "react";
19669
+ import React111, { useState as useState79, useMemo as useMemo8, useRef as useRef28, useEffect as useEffect59 } from "react";
19668
19670
  import Swal31 from "sweetalert2";
19669
19671
  import {
19670
19672
  RiInboxArchiveLine as RiInboxArchiveLine2,
@@ -20783,7 +20785,7 @@ function NotificationPopover({
20783
20785
  }
20784
20786
 
20785
20787
  // src/components/inbox/ReviewApplication.jsx
20786
- import React110, { useState as useState78, useEffect as useEffect57 } from "react";
20788
+ import React110, { useState as useState78, useEffect as useEffect58 } from "react";
20787
20789
  import { RiFileTextLine as RiFileTextLine7, RiCheckboxLine as RiCheckboxLine2, RiArrowGoBackLine as RiArrowGoBackLine4 } from "@remixicon/react";
20788
20790
 
20789
20791
  // src/components/inbox/ReviewHeaderBar.jsx
@@ -21195,143 +21197,305 @@ import React107 from "react";
21195
21197
  import { RiEyeLine as RiEyeLine4, RiArrowGoBackLine as RiArrowGoBackLine3, RiCheckLine as RiCheckLine4, RiArrowRightLine as RiArrowRightLine2, RiArrowDownSLine as RiArrowDownSLine3 } from "@remixicon/react";
21196
21198
 
21197
21199
  // src/components/inbox/DynamicFormDisplay.jsx
21198
- import React106, { useState as useState76, useRef as useRef27 } from "react";
21200
+ import React106, { useEffect as useEffect56, useState as useState76 } from "react";
21199
21201
  import { RiFullscreenLine, RiFullscreenExitLine, RiDownload2Line, RiFileTextLine as RiFileTextLine4 } from "@remixicon/react";
21200
- import { jsx as jsx106, jsxs as jsxs105 } from "react/jsx-runtime";
21201
- var STATIC_FORM_JSON = {
21202
- formId: "election-petition",
21203
- formName: "Election Petition Application",
21204
- schemaVersion: "1.0",
21205
- layout: { columns: 2, collapsibleSections: true, defaultExpanded: true },
21206
- sections: [
21207
- {
21208
- id: "basic-information",
21209
- title: "Basic Information",
21210
- type: "section",
21211
- fields: [
21212
- { id: "applicant-name", label: "Applicant Name", type: "text", value: "Mohit Sharma", colSpan: 1 },
21213
- { id: "mobile-number", label: "Mobile Number", type: "tel", value: "9876543210", colSpan: 1 },
21214
- { id: "email-address", label: "Email Address", type: "email", value: "mohit.sharma@example.com", colSpan: 1 },
21215
- { id: "address", label: "Address", type: "text", value: "Sector 22, Chandigarh, 160022", colSpan: 1 }
21216
- ]
21217
- },
21218
- {
21219
- id: "petition-details",
21220
- title: "Petition Details",
21221
- type: "section",
21222
- fields: [
21223
- { id: "category", label: "Category", type: "text", value: "General", colSpan: 1 },
21224
- { id: "payment-challan-number", label: "Payment Challan Number", type: "text", value: "CHN2026001234", colSpan: 1 },
21225
- { id: "deposit-date", label: "Deposit Date", type: "date", value: "2026-09-28", displayValue: "28 Sep 2026", colSpan: 1 },
21226
- { id: "election-type", label: "Election Type", type: "text", value: "Municipal Election", colSpan: 1 },
21227
- { id: "ward-number", label: "Ward Number", type: "number", value: 22, colSpan: 1 },
21228
- { id: "description", label: "Description", type: "textarea", value: "Election petition for ward no. 22", colSpan: 2 },
21229
- { id: "declaration-accepted", label: "Applicant Declaration Accepted", type: "boolean", value: true, displayValue: "Yes", colSpan: 2 }
21230
- ]
21231
- },
21232
- {
21233
- id: "beneficiaries",
21234
- title: "Beneficiaries",
21235
- type: "table",
21236
- columns: [
21237
- { id: "col-1", key: "name", label: "Name", type: "text" },
21238
- { id: "col-2", key: "gender", label: "Gender", type: "text" },
21239
- { id: "col-3", key: "date-of-birth", label: "Date of Birth", type: "date" },
21240
- { id: "col-4", key: "is-active", label: "Is Active", type: "boolean" }
21241
- ],
21242
- rows: [
21243
- { id: "row-1", values: ["Ramesh Kumar", "Male", "1985-01-12", true] },
21244
- { id: "row-2", values: ["Priya Devi", "Female", "1990-03-04", true] },
21245
- { id: "row-3", values: ["Amit Singh", "Male", "1988-08-21", false] }
21246
- ]
21247
- },
21248
- {
21249
- id: "attachments",
21250
- title: "Applicant Attachments",
21251
- type: "attachments",
21252
- files: [
21253
- { id: "file-1", label: "Fee Challan File", fileName: "fee_challan_1234.pdf", contentType: "application/pdf", sizeBytes: 250880, downloadUrl: "/api/applications/TASK-31/files/file-1" },
21254
- { id: "file-2", label: "Supporting Document", fileName: "petition_document.pdf", contentType: "application/pdf", sizeBytes: 1258291, downloadUrl: "/api/applications/TASK-31/files/file-2" }
21255
- ]
21256
- },
21257
- {
21258
- id: "additional-information",
21259
- title: "Additional Information",
21260
- type: "section",
21261
- fields: [
21262
- { id: "additional-comments", label: "Additional Comments", type: "textarea", value: "Please find the attached documents for election petition.", colSpan: 2 }
21263
- ]
21264
- }
21265
- ]
21202
+
21203
+ // src/components/inbox/reviewHelpers.js
21204
+ var getAvailableActions2 = (response) => {
21205
+ var _a, _b, _c, _d, _e, _f, _g;
21206
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21207
+ const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21208
+ return rows.map((action) => {
21209
+ var _a2, _b2, _c2, _d2, _e2, _f2;
21210
+ return {
21211
+ label: (_d2 = (_c2 = (_b2 = (_a2 = action.label) != null ? _a2 : action.Label) != null ? _b2 : action.actionName) != null ? _c2 : action.ActionName) != null ? _d2 : "",
21212
+ actionCode: (_f2 = (_e2 = action.actionCode) != null ? _e2 : action.ActionCode) != null ? _f2 : ""
21213
+ };
21214
+ }).filter((action) => action.label && action.actionCode);
21266
21215
  };
21267
- var formatSize = (bytes) => {
21268
- if (bytes >= 1048576) return `${(bytes / 1048576).toFixed(1)} MB`;
21269
- if (bytes >= 1024) return `${Math.round(bytes / 1024)} KB`;
21270
- return `${bytes} B`;
21216
+ var getWorkflowStepsStatusEndpoint = () => {
21217
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
21218
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21219
+ const endpoint3 = (_k = (_j = (_i = (_g = (_e = (_c = flowCore.getWorkflowStepsBarStatus) == null ? void 0 : _c.getStatus) != null ? _e : (_d = flowCore.workflowStepsBarStatus) == null ? void 0 : _d.getStatus) != null ? _g : (_f = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _f.GetStatus) != null ? _i : (_h = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _h.getStatus) != null ? _j : flowCore.GetWorkflowStepsBarStatus) != null ? _k : flowCore.getWorkflowStepsBarStatus;
21220
+ if (!endpoint3) throw new Error("Workflow steps bar status endpoint is not configured.");
21221
+ return endpoint3;
21271
21222
  };
21272
- var FieldCard = ({ field }) => {
21273
- var _a;
21274
- const label = /* @__PURE__ */ jsx106("span", { className: "fc:text-[11px] fc:font-bold fc:text-slate-500 fc:block", children: field.label });
21275
- const span = field.colSpan === 2 ? "fc:col-span-2" : "";
21276
- if (field.type === "boolean") {
21277
- return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21278
- label,
21279
- /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-1.5 fc:mt-1", children: [
21280
- /* @__PURE__ */ jsx106("input", { type: "checkbox", checked: field.value === true, readOnly: true, className: "fc:h-4 fc:w-4 fc:accent-emerald-600" }),
21281
- /* @__PURE__ */ jsx106("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900", children: field.displayValue || (field.value ? "Yes" : "No") })
21282
- ] })
21283
- ] });
21223
+ var getWorkflowSteps = (response) => {
21224
+ var _a, _b, _c, _d, _e, _f, _g;
21225
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21226
+ const steps = (_g = (_f = value == null ? void 0 : value.steps) != null ? _f : value == null ? void 0 : value.Steps) != null ? _g : [];
21227
+ return Array.isArray(steps) ? [...steps].sort((first, second) => {
21228
+ var _a2, _b2, _c2, _d2;
21229
+ return Number((_b2 = (_a2 = first.sequenceNo) != null ? _a2 : first.SequenceNo) != null ? _b2 : 0) - Number((_d2 = (_c2 = second.sequenceNo) != null ? _c2 : second.SequenceNo) != null ? _d2 : 0);
21230
+ }) : [];
21231
+ };
21232
+ var getFileHistoryEndpoint = () => {
21233
+ var _a, _b, _c, _d, _e;
21234
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21235
+ const configured = (_c = flowCore.getFileHistory) != null ? _c : flowCore.GetFileHistory;
21236
+ const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getFileHistory) != null ? _d : configured == null ? void 0 : configured.GetFileHistory) != null ? _e : configured;
21237
+ if (!endpoint3) throw new Error("Get File History endpoint is not configured.");
21238
+ return endpoint3;
21239
+ };
21240
+ var getDocumentHistoryEndpoint = () => {
21241
+ var _a, _b, _c, _d, _e;
21242
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21243
+ const configured = (_c = flowCore.getDocumentAndWorkFlow) != null ? _c : flowCore.GetDocumentAndWorkFlow;
21244
+ const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getDocumentHistoryByHistoryId) != null ? _d : configured == null ? void 0 : configured.GetDocumentHistoryByHistoryId) != null ? _e : configured;
21245
+ if (!endpoint3) throw new Error("Document history details endpoint is not configured.");
21246
+ return endpoint3;
21247
+ };
21248
+ var getApplicantFormPreviewEndpoint = () => {
21249
+ var _a, _b;
21250
+ const endpoint3 = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.applicantFormPreview;
21251
+ if (!endpoint3) throw new Error("Applicant form preview endpoint is not configured.");
21252
+ return endpoint3;
21253
+ };
21254
+ var getConfigValue = (source, key) => {
21255
+ if (!source || typeof source !== "object") return void 0;
21256
+ const matchingKey = Object.keys(source).find((candidate) => candidate.toLowerCase() === key.toLowerCase());
21257
+ return matchingKey ? source[matchingKey] : void 0;
21258
+ };
21259
+ var findConfigEntry = (source, key, path = [], visited = /* @__PURE__ */ new WeakSet()) => {
21260
+ if (!source || typeof source !== "object" || visited.has(source)) return null;
21261
+ visited.add(source);
21262
+ const entries = Object.entries(source);
21263
+ const matchingEntry = entries.find(([candidate]) => candidate.toLowerCase() === key.toLowerCase());
21264
+ if (matchingEntry) return { value: matchingEntry[1], path: [...path, matchingEntry[0]] };
21265
+ for (const [candidate, value] of entries) {
21266
+ const result = findConfigEntry(value, key, [...path, candidate], visited);
21267
+ if (result) return result;
21284
21268
  }
21285
- if (field.type === "textarea") {
21286
- return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21287
- label,
21288
- /* @__PURE__ */ jsx106("span", { className: "fc:text-[13px] fc:font-semibold fc:text-slate-900 fc:mt-1 fc:block fc:whitespace-pre-wrap", children: field.value || "-" })
21289
- ] });
21269
+ return null;
21270
+ };
21271
+ var getStepDocumentsEndpoint = () => {
21272
+ var _a, _b, _c;
21273
+ const suppliedEndpoints = getApiEndpoints();
21274
+ const root = (_a = getConfigValue(suppliedEndpoints, "apiEndpoints")) != null ? _a : suppliedEndpoints;
21275
+ const flowCore = (_b = getConfigValue(root, "flowCore")) != null ? _b : root;
21276
+ const inbox = getConfigValue(flowCore, "inbox");
21277
+ const documentConfiguration = getConfigValue(flowCore, "documentConfiguration");
21278
+ const configuredEndpoint = (_c = getConfigValue(inbox, "getDocumentsByWorkFlowStepId")) != null ? _c : getConfigValue(documentConfiguration, "getDocumentsByWorkFlowStepId");
21279
+ const endpoint3 = configuredEndpoint ? { value: configuredEndpoint, path: ["flowCore", "inbox", "getDocumentsByWorkFlowStepId"] } : findConfigEntry(suppliedEndpoints, "getDocumentsByWorkFlowStepId");
21280
+ if (!(endpoint3 == null ? void 0 : endpoint3.value)) {
21281
+ const configKeys = Object.keys(flowCore != null ? flowCore : {}).join(", ") || "none";
21282
+ const inboxKeys = Object.keys(inbox != null ? inbox : {}).join(", ") || "none";
21283
+ throw new Error(`Documents endpoint missing at runtime. flowCore keys: ${configKeys}. inbox keys: ${inboxKeys}.`);
21290
21284
  }
21291
- return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21292
- label,
21293
- /* @__PURE__ */ jsx106("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900 fc:mt-1 fc:block", children: field.type === "date" ? field.displayValue || field.value : (_a = field.value) != null ? _a : "-" })
21294
- ] });
21285
+ if (typeof endpoint3.value !== "string" && typeof endpoint3.value !== "function") {
21286
+ throw new Error(`Configured document endpoint at ${endpoint3.path.join(".")} must be a URL string or function.`);
21287
+ }
21288
+ return endpoint3.value;
21295
21289
  };
21296
- var TableSection = ({ section }) => {
21297
- return /* @__PURE__ */ jsx106("div", { className: "fc:overflow-x-auto fc:rounded-xl fc:border fc:border-slate-200/80 fc-custom-scrollbar", children: /* @__PURE__ */ jsxs105("table", { className: "fc:min-w-full", children: [
21298
- /* @__PURE__ */ jsx106("thead", { className: "fc:bg-slate-50", children: /* @__PURE__ */ jsx106("tr", { children: section.columns.map((col) => /* @__PURE__ */ jsx106("th", { className: "fc:px-3 fc:py-2.5 fc:text-[11px] fc:font-bold fc:text-slate-600 fc:text-left fc:whitespace-nowrap fc:border-b fc:border-slate-200", children: col.label }, col.id)) }) }),
21299
- /* @__PURE__ */ jsx106("tbody", { className: "fc:divide-y fc:divide-slate-100", children: section.rows.map((row) => /* @__PURE__ */ jsx106("tr", { className: "hover:fc:bg-slate-50/50", children: section.columns.map((col, index) => {
21300
- const val = row.values[index];
21301
- return /* @__PURE__ */ jsx106("td", { className: "fc:px-3 fc:py-2 fc:text-xs fc:text-slate-700 fc:whitespace-nowrap", children: col.type === "boolean" ? /* @__PURE__ */ jsx106("span", { className: `fc:inline-flex fc:items-center fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[10px] fc:font-bold ${val ? "fc:bg-emerald-50 fc:text-emerald-600 fc:border fc:border-emerald-200" : "fc:bg-red-50 fc:text-red-500 fc:border fc:border-red-200"}`, children: val ? "Active" : "Inactive" }) : val !== null && val !== void 0 ? String(val) : "-" }, col.id);
21302
- }) }, row.id)) })
21303
- ] }) });
21290
+ var getUploadDocumentEndpoint = () => {
21291
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
21292
+ const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21293
+ const execution = (_c = flowCore.workflowExecution) != null ? _c : flowCore.WorkflowExecution;
21294
+ const endpoint3 = (_l = (_j = (_h = (_f = (_d = execution == null ? void 0 : execution.uploadDocument) != null ? _d : execution == null ? void 0 : execution.UploadDocument) != null ? _f : (_e = flowCore.inbox) == null ? void 0 : _e.uploadDocument) != null ? _h : (_g = flowCore.inbox) == null ? void 0 : _g.UploadDocument) != null ? _j : (_i = flowCore.Inbox) == null ? void 0 : _i.uploadDocument) != null ? _l : (_k = flowCore.Inbox) == null ? void 0 : _k.UploadDocument;
21295
+ if (!endpoint3) throw new Error("Workflow document upload endpoint is not configured.");
21296
+ return endpoint3;
21304
21297
  };
21305
- var AttachmentsSection = ({ section }) => /* @__PURE__ */ jsx106("div", { className: "fc:space-y-3", children: section.files.map((file) => /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:justify-between fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80", children: [
21306
- /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
21307
- /* @__PURE__ */ jsx106("div", { className: "fc:w-9 fc:h-9 fc:rounded-lg fc:bg-red-100 fc:flex fc:items-center fc:justify-center fc:shrink-0", children: /* @__PURE__ */ jsx106(RiFileTextLine4, { size: 18, className: "fc:text-red-500" }) }),
21308
- /* @__PURE__ */ jsxs105("div", { children: [
21309
- /* @__PURE__ */ jsx106("span", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-800", children: file.label }),
21310
- /* @__PURE__ */ jsxs105("span", { className: "fc:block fc:text-[11px] fc:text-slate-500", children: [
21311
- file.fileName,
21312
- " (",
21313
- formatSize(file.sizeBytes),
21314
- ")"
21315
- ] })
21316
- ] })
21317
- ] }),
21318
- /* @__PURE__ */ jsxs105("a", { href: file.downloadUrl, download: true, className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:text-xs fc:font-semibold fc:text-blue-600 hover:fc:text-blue-700 fc:shrink-0", children: [
21319
- /* @__PURE__ */ jsx106(RiDownload2Line, { size: 15 }),
21320
- /* @__PURE__ */ jsx106("span", { children: "Download" })
21321
- ] })
21322
- ] }, file.id)) });
21323
- function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21324
- const [activeTab, setActiveTab] = useState76(STATIC_FORM_JSON.sections[0].id);
21325
- const [expandedSections, setExpandedSections] = useState76(() => {
21326
- const map = {};
21327
- STATIC_FORM_JSON.sections.forEach((s) => {
21328
- map[s.id] = true;
21298
+ var getConfiguredDocuments = (response) => {
21299
+ var _a, _b, _c, _d, _e, _f, _g;
21300
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21301
+ const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21302
+ return rows.map((document2) => {
21303
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
21304
+ return __spreadProps(__spreadValues({}, document2), {
21305
+ documentConfigurationId: Number((_b2 = (_a2 = document2.documentConfigurationId) != null ? _a2 : document2.DocumentConfigurationId) != null ? _b2 : document2.id),
21306
+ documentName: (_d2 = (_c2 = document2.documentName) != null ? _c2 : document2.DocumentName) != null ? _d2 : "Document",
21307
+ allowedExtensions: (_f2 = (_e2 = document2.allowedExtensions) != null ? _e2 : document2.AllowedExtensions) != null ? _f2 : "",
21308
+ maxSizeMB: Number((_h = (_g2 = document2.maxSizeMB) != null ? _g2 : document2.MaxSizeMB) != null ? _h : 0),
21309
+ isMandatory: Boolean((_j = (_i = document2.isMandatory) != null ? _i : document2.IsMandatory) != null ? _j : false),
21310
+ isActive: Boolean((_l = (_k = document2.isActive) != null ? _k : document2.IsActive) != null ? _l : true)
21329
21311
  });
21330
- return map;
21312
+ }).filter((document2) => Number.isInteger(document2.documentConfigurationId) && document2.isActive);
21313
+ };
21314
+ var getDocumentAcceptValue = (extensions) => String(extensions != null ? extensions : "").split(/[,;\s]+/).map((extension) => extension.trim().toLowerCase()).filter(Boolean).map((extension) => extension.startsWith(".") ? extension : `.${extension}`).join(",");
21315
+ var getFileHistoryMovements = (response) => {
21316
+ var _a, _b, _c, _d, _e, _f, _g;
21317
+ const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21318
+ const movements = (_g = (_f = value == null ? void 0 : value.movements) != null ? _f : value == null ? void 0 : value.Movements) != null ? _g : [];
21319
+ return Array.isArray(movements) ? movements : [];
21320
+ };
21321
+ var formatMovementDate = (value) => {
21322
+ if (!value) return "-";
21323
+ const date = new Date(value);
21324
+ return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString("en-GB", {
21325
+ day: "2-digit",
21326
+ month: "short",
21327
+ year: "numeric",
21328
+ hour: "2-digit",
21329
+ minute: "2-digit"
21331
21330
  });
21331
+ };
21332
+ var mapFileHistoryMovement = (movement, index) => {
21333
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
21334
+ const actionCode = String((_d = (_c = (_b = (_a = movement.actionCode) != null ? _a : movement.ActionCode) != null ? _b : movement.actionName) != null ? _c : movement.ActionName) != null ? _d : "Action");
21335
+ const normalizedAction = actionCode.toUpperCase().replace(/[\s-]/g, "_");
21336
+ const isReturn = normalizedAction.includes("RETURN") || normalizedAction === "PULL";
21337
+ const isResubmit = normalizedAction.includes("RESUBMIT");
21338
+ const isSubmit = !isResubmit && normalizedAction.includes("SUBMIT");
21339
+ const status = isReturn ? "Returned to Applicant" : isResubmit ? "Resubmitted" : isSubmit ? "Submitted" : normalizedAction.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase());
21340
+ const applicantActor = isResubmit || movement.applicantName && !movement.officialName;
21341
+ const userName = (_l = (_k = (_j = (_i = (_h = (_g = (_f = (_e = movement.userregistrationName) != null ? _e : movement.UserRegistrationName) != null ? _f : movement.UserName) != null ? _g : movement.userName) != null ? _h : applicantActor ? movement.applicantName : movement.officialName) != null ? _i : movement.officialName) != null ? _j : movement.applicantName) != null ? _k : movement.performedBy) != null ? _l : "Unknown user";
21342
+ const comments = (_p = (_o = (_n = (_m = movement.officialComment) != null ? _m : movement.applicantComment) != null ? _n : movement.comments) != null ? _o : movement.Comments) != null ? _p : "-";
21343
+ const stepId = (_q = movement.fromWorkflowStepId) != null ? _q : movement.FromWorkflowStepId;
21344
+ const stepName = (_s = (_r = movement.workflowStepName) != null ? _r : movement.WorkflowStepName) != null ? _s : "";
21345
+ return {
21346
+ id: (_u = (_t = movement.movementHistoryId) != null ? _t : movement.MovementHistoryId) != null ? _u : index + 1,
21347
+ type: isReturn ? "return" : isSubmit ? "submit" : isResubmit ? "resubmit" : "forward",
21348
+ date: formatMovementDate((_v = movement.movedOn) != null ? _v : movement.MovedOn),
21349
+ userName,
21350
+ userRole: applicantActor ? "Applicant" : "Official",
21351
+ status,
21352
+ stepNum: stepId != null && Number(stepId) > 0 ? `Step ${stepId}` : null,
21353
+ stepName: stepName || null,
21354
+ remarks: comments,
21355
+ isAlert: isReturn,
21356
+ isCurrent: false,
21357
+ title: status,
21358
+ by: `By ${userName}${applicantActor ? " (Applicant)" : ""}`
21359
+ };
21360
+ };
21361
+ var DEFAULT_ACTIONS = [
21362
+ { label: "Approve kro", actionCode: "APPROVE" },
21363
+ { label: "Reject", actionCode: "REJECT" },
21364
+ { label: "Forward", actionCode: "FORWARD" },
21365
+ { label: "Free Forward", actionCode: "FREE_FORWARD" },
21366
+ { label: "Return To Applicant", actionCode: "RETURN_TO_APPLICANT" }
21367
+ ];
21368
+
21369
+ // src/components/inbox/DynamicFormDisplay.jsx
21370
+ import { jsx as jsx106, jsxs as jsxs105 } from "react/jsx-runtime";
21371
+ var formatSize = (bytes) => {
21372
+ const size = Number(bytes);
21373
+ if (!Number.isFinite(size)) return "";
21374
+ if (size >= 1048576) return `${(size / 1048576).toFixed(1)} MB`;
21375
+ if (size >= 1024) return `${Math.round(size / 1024)} KB`;
21376
+ return `${size} B`;
21377
+ };
21378
+ var FieldCard = ({ field }) => {
21379
+ var _a;
21380
+ const label = /* @__PURE__ */ jsx106("span", { className: "fc:text-[11px] fc:font-bold fc:text-slate-500 fc:block", children: field.label });
21381
+ const span = field.colSpan === 2 ? "fc:col-span-2" : "";
21382
+ if (field.type === "boolean") {
21383
+ return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21384
+ label,
21385
+ /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-1.5 fc:mt-1", children: [
21386
+ /* @__PURE__ */ jsx106("input", { type: "checkbox", checked: field.value === true, readOnly: true, className: "fc:h-4 fc:w-4 fc:accent-emerald-600" }),
21387
+ /* @__PURE__ */ jsx106("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900", children: field.displayValue || (field.value ? "Yes" : "No") })
21388
+ ] })
21389
+ ] });
21390
+ }
21391
+ if (field.type === "textarea") {
21392
+ return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21393
+ label,
21394
+ /* @__PURE__ */ jsx106("span", { className: "fc:text-[13px] fc:font-semibold fc:text-slate-900 fc:mt-1 fc:block fc:whitespace-pre-wrap", children: field.value || "-" })
21395
+ ] });
21396
+ }
21397
+ return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80 ${span}`, children: [
21398
+ label,
21399
+ /* @__PURE__ */ jsx106("span", { className: "fc:text-[13px] fc:font-bold fc:text-slate-900 fc:mt-1 fc:block", children: field.type === "date" ? field.displayValue || field.value : (_a = field.value) != null ? _a : "-" })
21400
+ ] });
21401
+ };
21402
+ var TableSection = ({ section }) => {
21403
+ var _a, _b;
21404
+ return /* @__PURE__ */ jsx106("div", { className: "fc:overflow-x-auto fc:rounded-xl fc:border fc:border-slate-200/80 fc-custom-scrollbar", children: /* @__PURE__ */ jsxs105("table", { className: "fc:min-w-full", children: [
21405
+ /* @__PURE__ */ jsx106("thead", { className: "fc:bg-slate-50", children: /* @__PURE__ */ jsx106("tr", { children: ((_a = section.columns) != null ? _a : []).map((col) => /* @__PURE__ */ jsx106("th", { className: "fc:px-3 fc:py-2.5 fc:text-[11px] fc:font-bold fc:text-slate-600 fc:text-left fc:whitespace-nowrap fc:border-b fc:border-slate-200", children: col.label }, col.id)) }) }),
21406
+ /* @__PURE__ */ jsx106("tbody", { className: "fc:divide-y fc:divide-slate-100", children: ((_b = section.rows) != null ? _b : []).map((row) => {
21407
+ var _a2;
21408
+ return /* @__PURE__ */ jsx106("tr", { className: "hover:fc:bg-slate-50/50", children: ((_a2 = section.columns) != null ? _a2 : []).map((col, index) => {
21409
+ var _a3;
21410
+ const val = (_a3 = row.values) == null ? void 0 : _a3[index];
21411
+ return /* @__PURE__ */ jsx106("td", { className: "fc:px-3 fc:py-2 fc:text-xs fc:text-slate-700 fc:whitespace-nowrap", children: col.type === "boolean" ? /* @__PURE__ */ jsx106("span", { className: `fc:inline-flex fc:items-center fc:px-2 fc:py-0.5 fc:rounded-full fc:text-[10px] fc:font-bold ${val ? "fc:bg-emerald-50 fc:text-emerald-600 fc:border fc:border-emerald-200" : "fc:bg-red-50 fc:text-red-500 fc:border fc:border-red-200"}`, children: val ? "Active" : "Inactive" }) : col.key === "profilePath" && val ? /* @__PURE__ */ jsx106("a", { href: String(val), target: "_blank", rel: "noreferrer", className: "fc:text-blue-600 hover:fc:underline", children: "View profile" }) : val !== null && val !== void 0 ? String(val) : "-" }, col.id);
21412
+ }) }, row.id);
21413
+ }) })
21414
+ ] }) });
21415
+ };
21416
+ var AttachmentsSection = ({ section }) => {
21417
+ var _a;
21418
+ return /* @__PURE__ */ jsx106("div", { className: "fc:space-y-3", children: ((_a = section.files) != null ? _a : []).map((file) => {
21419
+ const size = formatSize(file.sizeBytes);
21420
+ return /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:justify-between fc:bg-[#F8FAFC] fc:rounded-xl fc:p-3 fc:border fc:border-slate-200/80", children: [
21421
+ /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-3 fc:min-w-0", children: [
21422
+ /* @__PURE__ */ jsx106("div", { className: "fc:w-9 fc:h-9 fc:rounded-lg fc:bg-red-100 fc:flex fc:items-center fc:justify-center fc:shrink-0", children: /* @__PURE__ */ jsx106(RiFileTextLine4, { size: 18, className: "fc:text-red-500" }) }),
21423
+ /* @__PURE__ */ jsxs105("div", { className: "fc:min-w-0", children: [
21424
+ /* @__PURE__ */ jsx106("span", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-800", children: file.label }),
21425
+ /* @__PURE__ */ jsxs105("span", { className: "fc:block fc:text-[11px] fc:text-slate-500 fc:break-all", children: [
21426
+ file.fileName,
21427
+ size ? ` (${size})` : ""
21428
+ ] })
21429
+ ] })
21430
+ ] }),
21431
+ /* @__PURE__ */ jsxs105("a", { href: file.downloadUrl, download: true, className: "fc:inline-flex fc:items-center fc:gap-1.5 fc:text-xs fc:font-semibold fc:text-blue-600 hover:fc:text-blue-700 fc:shrink-0 fc:ml-3", children: [
21432
+ /* @__PURE__ */ jsx106(RiDownload2Line, { size: 15 }),
21433
+ /* @__PURE__ */ jsx106("span", { children: "Download" })
21434
+ ] })
21435
+ ] }, file.id);
21436
+ }) });
21437
+ };
21438
+ function DynamicFormDisplay({ fileNo, maximized = false, onToggleMaximize }) {
21439
+ const [displayData, setDisplayData] = useState76(null);
21440
+ const [activeTab, setActiveTab] = useState76("");
21441
+ const [expandedSections, setExpandedSections] = useState76({});
21442
+ const [isLoading, setIsLoading] = useState76(false);
21443
+ const [loadError, setLoadError] = useState76("");
21444
+ useEffect56(() => {
21445
+ if (!fileNo) {
21446
+ setDisplayData(null);
21447
+ setActiveTab("");
21448
+ setIsLoading(false);
21449
+ setLoadError("File number is unavailable.");
21450
+ return void 0;
21451
+ }
21452
+ let isCurrent = true;
21453
+ const loadPreview = async () => {
21454
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
21455
+ setIsLoading(true);
21456
+ setLoadError("");
21457
+ setDisplayData(null);
21458
+ setActiveTab("");
21459
+ try {
21460
+ const endpoint3 = getApplicantFormPreviewEndpoint();
21461
+ const url = typeof endpoint3 === "function" ? endpoint3() : String(endpoint3);
21462
+ const response = await getApiService().post(url, { fileNo });
21463
+ const preview = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21464
+ if (!Array.isArray(preview == null ? void 0 : preview.sections)) {
21465
+ throw new Error("The applicant form preview response is invalid.");
21466
+ }
21467
+ if (isCurrent) {
21468
+ setDisplayData(preview);
21469
+ setActiveTab((_g = (_f = preview.sections[0]) == null ? void 0 : _f.id) != null ? _g : "");
21470
+ setExpandedSections(Object.fromEntries(
21471
+ preview.sections.map((section) => {
21472
+ var _a2;
21473
+ return [section.id, ((_a2 = preview.layout) == null ? void 0 : _a2.defaultExpanded) !== false];
21474
+ })
21475
+ ));
21476
+ }
21477
+ } catch (error) {
21478
+ if (isCurrent) {
21479
+ setLoadError(((_i = (_h = error == null ? void 0 : error.response) == null ? void 0 : _h.data) == null ? void 0 : _i.message) || (error == null ? void 0 : error.message) || "Unable to load applicant form preview.");
21480
+ }
21481
+ } finally {
21482
+ if (isCurrent) setIsLoading(false);
21483
+ }
21484
+ };
21485
+ loadPreview();
21486
+ return () => {
21487
+ isCurrent = false;
21488
+ };
21489
+ }, [fileNo]);
21332
21490
  const toggleSection = (id) => setExpandedSections((prev) => __spreadProps(__spreadValues({}, prev), { [id]: !prev[id] }));
21333
- const displayData = STATIC_FORM_JSON;
21334
21491
  const isMax = !!maximized;
21492
+ if (isLoading) {
21493
+ return /* @__PURE__ */ jsx106("div", { role: "status", className: "fc:rounded-2xl fc:border fc:border-slate-200 fc:bg-white fc:p-6 fc:text-center fc:text-sm fc:text-slate-500", children: "Loading applicant form preview..." });
21494
+ }
21495
+ if (loadError) {
21496
+ return /* @__PURE__ */ jsx106("div", { role: "alert", className: "fc:rounded-2xl fc:border fc:border-rose-200 fc:bg-white fc:p-6 fc:text-center fc:text-sm fc:text-rose-600", children: loadError });
21497
+ }
21498
+ if (!displayData) return null;
21335
21499
  return /* @__PURE__ */ jsxs105("div", { className: `fc:bg-white fc:border fc:border-slate-200 fc:rounded-2xl fc:shadow-sm fc:overflow-hidden ${isMax ? "fc:w-full" : ""}`, children: [
21336
21500
  /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:justify-between fc:px-5 fc:py-4 fc:border-b fc:border-slate-100", children: [
21337
21501
  /* @__PURE__ */ jsxs105("div", { className: "fc:flex fc:items-center fc:gap-3", children: [
@@ -21360,7 +21524,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21360
21524
  )
21361
21525
  ] }),
21362
21526
  /* @__PURE__ */ jsx106("div", { className: "fc:flex fc:items-center fc:gap-1 fc:px-5 fc:border-b fc:border-slate-200 fc:overflow-x-auto fc:pb-1 fc-custom-scrollbar", children: displayData.sections.map((section) => {
21363
- var _a;
21527
+ var _a, _b, _c, _d, _e;
21364
21528
  return /* @__PURE__ */ jsxs105(
21365
21529
  "button",
21366
21530
  {
@@ -21369,24 +21533,25 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21369
21533
  className: `fc:inline-flex fc:items-center fc:gap-1.5 fc:px-3 fc:py-2.5 fc:text-xs fc:font-semibold fc:whitespace-nowrap fc:border-b-2 fc:transition-colors ${activeTab === section.id ? "fc:border-blue-600 fc:text-blue-600" : "fc:border-transparent fc:text-slate-500 hover:fc:text-slate-800"}`,
21370
21534
  children: [
21371
21535
  section.title,
21372
- /* @__PURE__ */ jsx106("span", { className: `fc:rounded-full fc:px-1.5 fc:py-0.5 fc:text-[9px] fc:font-bold ${activeTab === section.id ? "fc:bg-blue-50 fc:text-blue-600" : "fc:bg-slate-100 fc:text-slate-400"}`, children: section.type === "table" ? section.rows.length : section.type === "attachments" ? section.files.length : ((_a = section.fields) == null ? void 0 : _a.length) || 0 })
21536
+ /* @__PURE__ */ jsx106("span", { className: `fc:rounded-full fc:px-1.5 fc:py-0.5 fc:text-[9px] fc:font-bold ${activeTab === section.id ? "fc:bg-blue-50 fc:text-blue-600" : "fc:bg-slate-100 fc:text-slate-400"}`, children: section.type === "table" ? (_b = (_a = section.rows) == null ? void 0 : _a.length) != null ? _b : 0 : section.type === "attachments" ? (_d = (_c = section.files) == null ? void 0 : _c.length) != null ? _d : 0 : ((_e = section.fields) == null ? void 0 : _e.length) || 0 })
21373
21537
  ]
21374
21538
  },
21375
21539
  section.id
21376
21540
  );
21377
21541
  }) }),
21378
21542
  /* @__PURE__ */ jsx106("div", { className: "fc:p-5", children: displayData.sections.map((section) => {
21379
- var _a, _b;
21543
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
21380
21544
  if (section.id !== activeTab) return null;
21381
21545
  if (section.type === "table") {
21382
21546
  return /* @__PURE__ */ jsxs105("div", { className: "fc:space-y-3", children: [
21383
- /* @__PURE__ */ jsx106("div", { className: "fc:flex fc:items-center fc:justify-between", children: /* @__PURE__ */ jsxs105("div", { children: [
21547
+ /* @__PURE__ */ jsxs105("div", { children: [
21384
21548
  /* @__PURE__ */ jsx106("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
21385
21549
  /* @__PURE__ */ jsxs105("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
21386
- section.rows.length,
21550
+ (_b = (_a = section.rows) == null ? void 0 : _a.length) != null ? _b : 0,
21387
21551
  " records"
21388
21552
  ] })
21389
- ] }) }),
21553
+ ] }),
21554
+ ((_c = section.fields) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx106("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: section.fields.map((field) => /* @__PURE__ */ jsx106(FieldCard, { field }, field.id)) }),
21390
21555
  /* @__PURE__ */ jsx106(TableSection, { section })
21391
21556
  ] }, section.id);
21392
21557
  }
@@ -21395,7 +21560,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21395
21560
  /* @__PURE__ */ jsxs105("div", { children: [
21396
21561
  /* @__PURE__ */ jsx106("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
21397
21562
  /* @__PURE__ */ jsxs105("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
21398
- section.files.length,
21563
+ (_e = (_d = section.files) == null ? void 0 : _d.length) != null ? _e : 0,
21399
21564
  " files"
21400
21565
  ] })
21401
21566
  ] }),
@@ -21407,11 +21572,11 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21407
21572
  /* @__PURE__ */ jsxs105("div", { children: [
21408
21573
  /* @__PURE__ */ jsx106("h3", { className: "fc:text-sm fc:font-extrabold fc:text-slate-900", children: section.title }),
21409
21574
  /* @__PURE__ */ jsxs105("p", { className: "fc:text-[11px] fc:text-slate-400 fc:mt-0.5", children: [
21410
- ((_a = section.fields) == null ? void 0 : _a.length) || 0,
21575
+ ((_f = section.fields) == null ? void 0 : _f.length) || 0,
21411
21576
  " fields"
21412
21577
  ] })
21413
21578
  ] }),
21414
- displayData.layout.collapsibleSections && /* @__PURE__ */ jsx106(
21579
+ ((_g = displayData.layout) == null ? void 0 : _g.collapsibleSections) && /* @__PURE__ */ jsx106(
21415
21580
  "button",
21416
21581
  {
21417
21582
  type: "button",
@@ -21421,7 +21586,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21421
21586
  }
21422
21587
  )
21423
21588
  ] }),
21424
- (!displayData.layout.collapsibleSections || expandedSections[section.id]) && /* @__PURE__ */ jsx106("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: (_b = section.fields) == null ? void 0 : _b.map((field) => /* @__PURE__ */ jsx106(FieldCard, { field }, field.id)) })
21589
+ (!((_h = displayData.layout) == null ? void 0 : _h.collapsibleSections) || expandedSections[section.id]) && /* @__PURE__ */ jsx106("div", { className: `fc:grid fc:gap-3 ${isMax ? "fc:grid-cols-3" : "fc:grid-cols-2"}`, children: (_i = section.fields) == null ? void 0 : _i.map((field) => /* @__PURE__ */ jsx106(FieldCard, { field }, field.id)) })
21425
21590
  ] }, section.id);
21426
21591
  }) })
21427
21592
  ] });
@@ -21430,6 +21595,7 @@ function DynamicFormDisplay({ maximized = false, onToggleMaximize }) {
21430
21595
  // src/components/inbox/FileDetailsTab.jsx
21431
21596
  import { jsx as jsx107, jsxs as jsxs106 } from "react/jsx-runtime";
21432
21597
  function FileDetailsTab({
21598
+ fileNo,
21433
21599
  fileHistory,
21434
21600
  isLoadingFileHistory,
21435
21601
  fileHistoryError,
@@ -21456,6 +21622,7 @@ function FileDetailsTab({
21456
21622
  /* @__PURE__ */ jsx107("div", { style: { minWidth: 0 }, children: /* @__PURE__ */ jsx107(
21457
21623
  DynamicFormDisplay,
21458
21624
  {
21625
+ fileNo,
21459
21626
  maximized: isMaximized,
21460
21627
  onToggleMaximize: () => setIsMaximized(!isMaximized)
21461
21628
  }
@@ -21572,168 +21739,6 @@ function FileDetailsTab({
21572
21739
  // src/components/inbox/MovementDetailModal.jsx
21573
21740
  import React108 from "react";
21574
21741
  import { RiHistoryLine as RiHistoryLine2, RiCloseLine as RiCloseLine5, RiFileTextLine as RiFileTextLine5 } from "@remixicon/react";
21575
-
21576
- // src/components/inbox/reviewHelpers.js
21577
- var getAvailableActions2 = (response) => {
21578
- var _a, _b, _c, _d, _e, _f, _g;
21579
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21580
- const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21581
- return rows.map((action) => {
21582
- var _a2, _b2, _c2, _d2, _e2, _f2;
21583
- return {
21584
- label: (_d2 = (_c2 = (_b2 = (_a2 = action.label) != null ? _a2 : action.Label) != null ? _b2 : action.actionName) != null ? _c2 : action.ActionName) != null ? _d2 : "",
21585
- actionCode: (_f2 = (_e2 = action.actionCode) != null ? _e2 : action.ActionCode) != null ? _f2 : ""
21586
- };
21587
- }).filter((action) => action.label && action.actionCode);
21588
- };
21589
- var getWorkflowStepsStatusEndpoint = () => {
21590
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
21591
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21592
- const endpoint3 = (_k = (_j = (_i = (_g = (_e = (_c = flowCore.getWorkflowStepsBarStatus) == null ? void 0 : _c.getStatus) != null ? _e : (_d = flowCore.workflowStepsBarStatus) == null ? void 0 : _d.getStatus) != null ? _g : (_f = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _f.GetStatus) != null ? _i : (_h = flowCore.GetWorkflowStepsBarStatus) == null ? void 0 : _h.getStatus) != null ? _j : flowCore.GetWorkflowStepsBarStatus) != null ? _k : flowCore.getWorkflowStepsBarStatus;
21593
- if (!endpoint3) throw new Error("Workflow steps bar status endpoint is not configured.");
21594
- return endpoint3;
21595
- };
21596
- var getWorkflowSteps = (response) => {
21597
- var _a, _b, _c, _d, _e, _f, _g;
21598
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21599
- const steps = (_g = (_f = value == null ? void 0 : value.steps) != null ? _f : value == null ? void 0 : value.Steps) != null ? _g : [];
21600
- return Array.isArray(steps) ? [...steps].sort((first, second) => {
21601
- var _a2, _b2, _c2, _d2;
21602
- return Number((_b2 = (_a2 = first.sequenceNo) != null ? _a2 : first.SequenceNo) != null ? _b2 : 0) - Number((_d2 = (_c2 = second.sequenceNo) != null ? _c2 : second.SequenceNo) != null ? _d2 : 0);
21603
- }) : [];
21604
- };
21605
- var getFileHistoryEndpoint = () => {
21606
- var _a, _b, _c, _d, _e;
21607
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21608
- const configured = (_c = flowCore.getFileHistory) != null ? _c : flowCore.GetFileHistory;
21609
- const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getFileHistory) != null ? _d : configured == null ? void 0 : configured.GetFileHistory) != null ? _e : configured;
21610
- if (!endpoint3) throw new Error("Get File History endpoint is not configured.");
21611
- return endpoint3;
21612
- };
21613
- var getDocumentHistoryEndpoint = () => {
21614
- var _a, _b, _c, _d, _e;
21615
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21616
- const configured = (_c = flowCore.getDocumentAndWorkFlow) != null ? _c : flowCore.GetDocumentAndWorkFlow;
21617
- const endpoint3 = (_e = (_d = configured == null ? void 0 : configured.getDocumentHistoryByHistoryId) != null ? _d : configured == null ? void 0 : configured.GetDocumentHistoryByHistoryId) != null ? _e : configured;
21618
- if (!endpoint3) throw new Error("Document history details endpoint is not configured.");
21619
- return endpoint3;
21620
- };
21621
- var getConfigValue = (source, key) => {
21622
- if (!source || typeof source !== "object") return void 0;
21623
- const matchingKey = Object.keys(source).find((candidate) => candidate.toLowerCase() === key.toLowerCase());
21624
- return matchingKey ? source[matchingKey] : void 0;
21625
- };
21626
- var findConfigEntry = (source, key, path = [], visited = /* @__PURE__ */ new WeakSet()) => {
21627
- if (!source || typeof source !== "object" || visited.has(source)) return null;
21628
- visited.add(source);
21629
- const entries = Object.entries(source);
21630
- const matchingEntry = entries.find(([candidate]) => candidate.toLowerCase() === key.toLowerCase());
21631
- if (matchingEntry) return { value: matchingEntry[1], path: [...path, matchingEntry[0]] };
21632
- for (const [candidate, value] of entries) {
21633
- const result = findConfigEntry(value, key, [...path, candidate], visited);
21634
- if (result) return result;
21635
- }
21636
- return null;
21637
- };
21638
- var getStepDocumentsEndpoint = () => {
21639
- var _a, _b, _c;
21640
- const suppliedEndpoints = getApiEndpoints();
21641
- const root = (_a = getConfigValue(suppliedEndpoints, "apiEndpoints")) != null ? _a : suppliedEndpoints;
21642
- const flowCore = (_b = getConfigValue(root, "flowCore")) != null ? _b : root;
21643
- const inbox = getConfigValue(flowCore, "inbox");
21644
- const documentConfiguration = getConfigValue(flowCore, "documentConfiguration");
21645
- const configuredEndpoint = (_c = getConfigValue(inbox, "getDocumentsByWorkFlowStepId")) != null ? _c : getConfigValue(documentConfiguration, "getDocumentsByWorkFlowStepId");
21646
- const endpoint3 = configuredEndpoint ? { value: configuredEndpoint, path: ["flowCore", "inbox", "getDocumentsByWorkFlowStepId"] } : findConfigEntry(suppliedEndpoints, "getDocumentsByWorkFlowStepId");
21647
- if (!(endpoint3 == null ? void 0 : endpoint3.value)) {
21648
- const configKeys = Object.keys(flowCore != null ? flowCore : {}).join(", ") || "none";
21649
- const inboxKeys = Object.keys(inbox != null ? inbox : {}).join(", ") || "none";
21650
- throw new Error(`Documents endpoint missing at runtime. flowCore keys: ${configKeys}. inbox keys: ${inboxKeys}.`);
21651
- }
21652
- if (typeof endpoint3.value !== "string" && typeof endpoint3.value !== "function") {
21653
- throw new Error(`Configured document endpoint at ${endpoint3.path.join(".")} must be a URL string or function.`);
21654
- }
21655
- return endpoint3.value;
21656
- };
21657
- var getUploadDocumentEndpoint = () => {
21658
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
21659
- const flowCore = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) != null ? _b : {};
21660
- const execution = (_c = flowCore.workflowExecution) != null ? _c : flowCore.WorkflowExecution;
21661
- const endpoint3 = (_l = (_j = (_h = (_f = (_d = execution == null ? void 0 : execution.uploadDocument) != null ? _d : execution == null ? void 0 : execution.UploadDocument) != null ? _f : (_e = flowCore.inbox) == null ? void 0 : _e.uploadDocument) != null ? _h : (_g = flowCore.inbox) == null ? void 0 : _g.UploadDocument) != null ? _j : (_i = flowCore.Inbox) == null ? void 0 : _i.uploadDocument) != null ? _l : (_k = flowCore.Inbox) == null ? void 0 : _k.UploadDocument;
21662
- if (!endpoint3) throw new Error("Workflow document upload endpoint is not configured.");
21663
- return endpoint3;
21664
- };
21665
- var getConfiguredDocuments = (response) => {
21666
- var _a, _b, _c, _d, _e, _f, _g;
21667
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21668
- const rows = Array.isArray(value) ? value : (_g = (_f = value == null ? void 0 : value.items) != null ? _f : value == null ? void 0 : value.records) != null ? _g : [];
21669
- return rows.map((document2) => {
21670
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h, _i, _j, _k, _l;
21671
- return __spreadProps(__spreadValues({}, document2), {
21672
- documentConfigurationId: Number((_b2 = (_a2 = document2.documentConfigurationId) != null ? _a2 : document2.DocumentConfigurationId) != null ? _b2 : document2.id),
21673
- documentName: (_d2 = (_c2 = document2.documentName) != null ? _c2 : document2.DocumentName) != null ? _d2 : "Document",
21674
- allowedExtensions: (_f2 = (_e2 = document2.allowedExtensions) != null ? _e2 : document2.AllowedExtensions) != null ? _f2 : "",
21675
- maxSizeMB: Number((_h = (_g2 = document2.maxSizeMB) != null ? _g2 : document2.MaxSizeMB) != null ? _h : 0),
21676
- isMandatory: Boolean((_j = (_i = document2.isMandatory) != null ? _i : document2.IsMandatory) != null ? _j : false),
21677
- isActive: Boolean((_l = (_k = document2.isActive) != null ? _k : document2.IsActive) != null ? _l : true)
21678
- });
21679
- }).filter((document2) => Number.isInteger(document2.documentConfigurationId) && document2.isActive);
21680
- };
21681
- var getDocumentAcceptValue = (extensions) => String(extensions != null ? extensions : "").split(/[,;\s]+/).map((extension) => extension.trim().toLowerCase()).filter(Boolean).map((extension) => extension.startsWith(".") ? extension : `.${extension}`).join(",");
21682
- var getFileHistoryMovements = (response) => {
21683
- var _a, _b, _c, _d, _e, _f, _g;
21684
- const value = (_e = (_d = (_c = (_a = response == null ? void 0 : response.data) == null ? void 0 : _a.data) != null ? _c : (_b = response == null ? void 0 : response.data) == null ? void 0 : _b.result) != null ? _d : response == null ? void 0 : response.data) != null ? _e : response;
21685
- const movements = (_g = (_f = value == null ? void 0 : value.movements) != null ? _f : value == null ? void 0 : value.Movements) != null ? _g : [];
21686
- return Array.isArray(movements) ? movements : [];
21687
- };
21688
- var formatMovementDate = (value) => {
21689
- if (!value) return "-";
21690
- const date = new Date(value);
21691
- return Number.isNaN(date.getTime()) ? String(value) : date.toLocaleString("en-GB", {
21692
- day: "2-digit",
21693
- month: "short",
21694
- year: "numeric",
21695
- hour: "2-digit",
21696
- minute: "2-digit"
21697
- });
21698
- };
21699
- var mapFileHistoryMovement = (movement, index) => {
21700
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v;
21701
- const actionCode = String((_d = (_c = (_b = (_a = movement.actionCode) != null ? _a : movement.ActionCode) != null ? _b : movement.actionName) != null ? _c : movement.ActionName) != null ? _d : "Action");
21702
- const normalizedAction = actionCode.toUpperCase().replace(/[\s-]/g, "_");
21703
- const isReturn = normalizedAction.includes("RETURN") || normalizedAction === "PULL";
21704
- const isResubmit = normalizedAction.includes("RESUBMIT");
21705
- const isSubmit = !isResubmit && normalizedAction.includes("SUBMIT");
21706
- const status = isReturn ? "Returned to Applicant" : isResubmit ? "Resubmitted" : isSubmit ? "Submitted" : normalizedAction.replace(/_/g, " ").toLowerCase().replace(/\b\w/g, (letter) => letter.toUpperCase());
21707
- const applicantActor = isResubmit || movement.applicantName && !movement.officialName;
21708
- const userName = (_l = (_k = (_j = (_i = (_h = (_g = (_f = (_e = movement.userregistrationName) != null ? _e : movement.UserRegistrationName) != null ? _f : movement.UserName) != null ? _g : movement.userName) != null ? _h : applicantActor ? movement.applicantName : movement.officialName) != null ? _i : movement.officialName) != null ? _j : movement.applicantName) != null ? _k : movement.performedBy) != null ? _l : "Unknown user";
21709
- const comments = (_p = (_o = (_n = (_m = movement.officialComment) != null ? _m : movement.applicantComment) != null ? _n : movement.comments) != null ? _o : movement.Comments) != null ? _p : "-";
21710
- const stepId = (_q = movement.fromWorkflowStepId) != null ? _q : movement.FromWorkflowStepId;
21711
- const stepName = (_s = (_r = movement.workflowStepName) != null ? _r : movement.WorkflowStepName) != null ? _s : "";
21712
- return {
21713
- id: (_u = (_t = movement.movementHistoryId) != null ? _t : movement.MovementHistoryId) != null ? _u : index + 1,
21714
- type: isReturn ? "return" : isSubmit ? "submit" : isResubmit ? "resubmit" : "forward",
21715
- date: formatMovementDate((_v = movement.movedOn) != null ? _v : movement.MovedOn),
21716
- userName,
21717
- userRole: applicantActor ? "Applicant" : "Official",
21718
- status,
21719
- stepNum: stepId != null && Number(stepId) > 0 ? `Step ${stepId}` : null,
21720
- stepName: stepName || null,
21721
- remarks: comments,
21722
- isAlert: isReturn,
21723
- isCurrent: false,
21724
- title: status,
21725
- by: `By ${userName}${applicantActor ? " (Applicant)" : ""}`
21726
- };
21727
- };
21728
- var DEFAULT_ACTIONS = [
21729
- { label: "Approve kro", actionCode: "APPROVE" },
21730
- { label: "Reject", actionCode: "REJECT" },
21731
- { label: "Forward", actionCode: "FORWARD" },
21732
- { label: "Free Forward", actionCode: "FREE_FORWARD" },
21733
- { label: "Return To Applicant", actionCode: "RETURN_TO_APPLICANT" }
21734
- ];
21735
-
21736
- // src/components/inbox/MovementDetailModal.jsx
21737
21742
  import { Fragment as Fragment8, jsx as jsx108, jsxs as jsxs107 } from "react/jsx-runtime";
21738
21743
  function MovementDetailModal({
21739
21744
  selectedHistoryItem,
@@ -21880,7 +21885,7 @@ function MovementDetailModal({
21880
21885
  }
21881
21886
 
21882
21887
  // src/components/inbox/TakeActionPanel.jsx
21883
- import React109, { useState as useState77, useEffect as useEffect56, useRef as useRef28 } from "react";
21888
+ import React109, { useState as useState77, useEffect as useEffect57, useRef as useRef27 } from "react";
21884
21889
  import Swal30 from "sweetalert2";
21885
21890
  import {
21886
21891
  RiCloseLine as RiCloseLine6,
@@ -21916,10 +21921,10 @@ function TakeActionPanel({
21916
21921
  const [uploadedDocuments, setUploadedDocuments] = useState77([]);
21917
21922
  const [uploadingDocumentId, setUploadingDocumentId] = useState77(null);
21918
21923
  const [documentUploadErrors, setDocumentUploadErrors] = useState77({});
21919
- const documentInputRefs = useRef28({});
21924
+ const documentInputRefs = useRef27({});
21920
21925
  const selectedAction = actions.find((a) => a.actionCode === actionCode);
21921
21926
  const isReturnToApplicant = ((_a = selectedAction == null ? void 0 : selectedAction.label) == null ? void 0 : _a.toLowerCase().includes("return")) || ["PULL", "RETURN_TO_APPLICANT"].includes(actionCode == null ? void 0 : actionCode.toUpperCase());
21922
- useEffect56(() => {
21927
+ useEffect57(() => {
21923
21928
  let isCurrent = true;
21924
21929
  (async () => {
21925
21930
  var _a2, _b, _c, _d, _e, _f, _g;
@@ -21944,7 +21949,7 @@ function TakeActionPanel({
21944
21949
  isCurrent = false;
21945
21950
  };
21946
21951
  }, [workflowStepId, activeWorkflowStepId]);
21947
- useEffect56(() => {
21952
+ useEffect57(() => {
21948
21953
  if (!isReturnToApplicant) {
21949
21954
  setEditableFields([]);
21950
21955
  setSelectedEditableFields([]);
@@ -21973,7 +21978,7 @@ function TakeActionPanel({
21973
21978
  isCurrent = false;
21974
21979
  };
21975
21980
  }, [isReturnToApplicant]);
21976
- useEffect56(() => {
21981
+ useEffect57(() => {
21977
21982
  const normalizedStepId = Number(workflowStepId);
21978
21983
  setOfficialDocuments([]);
21979
21984
  setUploadedDocuments([]);
@@ -22508,7 +22513,7 @@ function ReviewApplication({
22508
22513
  const createdOn = (file == null ? void 0 : file.receivedDate) && file.receivedDate !== "-" ? file.receivedDate : "01 Oct 2026, 10:24 AM";
22509
22514
  const workflowStepId = (_b = (_a = file == null ? void 0 : file.workflowStepId) != null ? _a : file == null ? void 0 : file.WorkflowStepId) != null ? _b : activeWorkflowStepId;
22510
22515
  const fileInstanceId = (_g = (_e = (_c = file == null ? void 0 : file.fileInstanceId) != null ? _c : file == null ? void 0 : file.FileInstanceId) != null ? _e : (_d = file == null ? void 0 : file.fileInstance) == null ? void 0 : _d.fileInstanceId) != null ? _g : (_f = file == null ? void 0 : file.FileInstance) == null ? void 0 : _f.FileInstanceId;
22511
- useEffect57(() => {
22516
+ useEffect58(() => {
22512
22517
  if (!workflowStepId) {
22513
22518
  setWorkflowSteps([]);
22514
22519
  setWorkflowStepsError("Workflow step ID is unavailable.");
@@ -22539,7 +22544,7 @@ function ReviewApplication({
22539
22544
  };
22540
22545
  }, [workflowStepId]);
22541
22546
  const historyNeeded = activeTab === "workflowHistory" || activeTab === "fileDetails";
22542
- useEffect57(() => {
22547
+ useEffect58(() => {
22543
22548
  if (!historyNeeded) return void 0;
22544
22549
  const normalizedFileInstanceId = Number(fileInstanceId);
22545
22550
  if (!Number.isInteger(normalizedFileInstanceId) || normalizedFileInstanceId <= 0) {
@@ -22681,6 +22686,7 @@ function ReviewApplication({
22681
22686
  activeTab === "fileDetails" && /* @__PURE__ */ jsx110(
22682
22687
  FileDetailsTab,
22683
22688
  {
22689
+ fileNo,
22684
22690
  fileHistory,
22685
22691
  isLoadingFileHistory,
22686
22692
  fileHistoryError,
@@ -22840,16 +22846,16 @@ function InboxMain({
22840
22846
  const [activeTab, setActiveTab] = useState79(initialTab);
22841
22847
  const [viewMode, setViewMode] = useState79(initialView);
22842
22848
  const [reviewingFile, setReviewingFile] = useState79(null);
22843
- useEffect58(() => {
22849
+ useEffect59(() => {
22844
22850
  if (initialTab) setActiveTab(initialTab);
22845
22851
  }, [initialTab]);
22846
- useEffect58(() => {
22852
+ useEffect59(() => {
22847
22853
  if (initialView) setViewMode(initialView);
22848
22854
  }, [initialView]);
22849
22855
  const [assignedSteps, setAssignedSteps] = useState79([]);
22850
22856
  const [activeWorkflowStepId, setActiveWorkflowStepId] = useState79(null);
22851
22857
  const [roleDropdownOpen, setRoleDropdownOpen] = useState79(false);
22852
- const roleDropdownRef = useRef29(null);
22858
+ const roleDropdownRef = useRef28(null);
22853
22859
  const activeRoleDetails = assignedSteps.find(
22854
22860
  (step) => Number(step.workflowStepId) === Number(activeWorkflowStepId)
22855
22861
  );
@@ -22859,7 +22865,7 @@ function InboxMain({
22859
22865
  const [totalFiles, setTotalFiles] = useState79([]);
22860
22866
  const [refreshKey, setRefreshKey] = useState79(0);
22861
22867
  const [isUnclaiming, setIsUnclaiming] = useState79(false);
22862
- useEffect58(() => {
22868
+ useEffect59(() => {
22863
22869
  let isCurrent = true;
22864
22870
  const loadAssignedSteps = async () => {
22865
22871
  var _a, _b;
@@ -22918,7 +22924,7 @@ function InboxMain({
22918
22924
  isCurrent = false;
22919
22925
  };
22920
22926
  }, []);
22921
- useEffect58(() => {
22927
+ useEffect59(() => {
22922
22928
  let isCurrent = true;
22923
22929
  const loadStepFiles = async () => {
22924
22930
  var _a, _b;
@@ -22984,7 +22990,7 @@ function InboxMain({
22984
22990
  { key: "financialYear", label: "Financial Year", width: "120px", visible: true }
22985
22991
  ]);
22986
22992
  const [columnDropdownOpen, setColumnDropdownOpen] = useState79(false);
22987
- const columnDropdownRef = useRef29(null);
22993
+ const columnDropdownRef = useRef28(null);
22988
22994
  const [searchQuery, setSearchQuery] = useState79("");
22989
22995
  const [priorityFilter, setPriorityFilter] = useState79("all");
22990
22996
  const [pageSize, setPageSize] = useState79(10);
@@ -22998,7 +23004,7 @@ function InboxMain({
22998
23004
  const [selectedActionFile, setSelectedActionFile] = useState79(null);
22999
23005
  const [viewModalOpen, setViewModalOpen] = useState79(false);
23000
23006
  const [selectedViewFile, setSelectedViewFile] = useState79(null);
23001
- const tableRef = useRef29(null);
23007
+ const tableRef = useRef28(null);
23002
23008
  const [hoveredFileCard, setHoveredFileCard] = useState79(null);
23003
23009
  const [hoverTimeoutId, setHoverTimeoutId] = useState79(null);
23004
23010
  const hiddenDynamicColumns = useMemo8(
@@ -23059,12 +23065,12 @@ function InboxMain({
23059
23065
  }, 120);
23060
23066
  setHoverTimeoutId(timer);
23061
23067
  };
23062
- useEffect58(() => {
23068
+ useEffect59(() => {
23063
23069
  return () => {
23064
23070
  if (hoverTimeoutId) clearTimeout(hoverTimeoutId);
23065
23071
  };
23066
23072
  }, [hoverTimeoutId]);
23067
- useEffect58(() => {
23073
+ useEffect59(() => {
23068
23074
  const handleScroll = () => {
23069
23075
  if (hoveredFileCard) {
23070
23076
  setHoveredFileCard(null);
@@ -23073,7 +23079,7 @@ function InboxMain({
23073
23079
  window.addEventListener("scroll", handleScroll, true);
23074
23080
  return () => window.removeEventListener("scroll", handleScroll, true);
23075
23081
  }, [hoveredFileCard]);
23076
- useEffect58(() => {
23082
+ useEffect59(() => {
23077
23083
  const handleOutsideClick = (e) => {
23078
23084
  if (columnDropdownRef.current && !columnDropdownRef.current.contains(e.target)) {
23079
23085
  setColumnDropdownOpen(false);
@@ -23084,7 +23090,7 @@ function InboxMain({
23084
23090
  }
23085
23091
  return () => document.removeEventListener("mousedown", handleOutsideClick);
23086
23092
  }, [columnDropdownOpen]);
23087
- useEffect58(() => {
23093
+ useEffect59(() => {
23088
23094
  const handleOutsideClick = (e) => {
23089
23095
  if (roleDropdownRef.current && !roleDropdownRef.current.contains(e.target)) {
23090
23096
  setRoleDropdownOpen(false);
@@ -24350,7 +24356,7 @@ import {
24350
24356
  } from "@remixicon/react";
24351
24357
 
24352
24358
  // src/components/track-application/TrackingSlipModal.jsx
24353
- import React115, { useEffect as useEffect59 } from "react";
24359
+ import React115, { useEffect as useEffect60 } from "react";
24354
24360
  import {
24355
24361
  RiCloseLine as RiCloseLine7,
24356
24362
  RiPrinterLine,
@@ -24364,7 +24370,7 @@ import {
24364
24370
  } from "@remixicon/react";
24365
24371
  import { jsx as jsx115, jsxs as jsxs111 } from "react/jsx-runtime";
24366
24372
  function TrackingSlipModal({ isOpen, onClose, application }) {
24367
- useEffect59(() => {
24373
+ useEffect60(() => {
24368
24374
  if (!isOpen) return;
24369
24375
  const handleKeyDown = (e) => {
24370
24376
  if (e.key === "Escape") onClose();
@@ -25353,7 +25359,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
25353
25359
  ];
25354
25360
  const masterPermissionItems = [
25355
25361
  { name: "Step Permission", component: "step_permission_main", icon: RiUserSettingsLine, configKey: "isStepPermission" },
25356
- { name: "Update Permission", component: "FormFieldMain", icon: RiFileList3Line, configKey: "isFormField" },
25362
+ { name: "Applicant Editable Fields", component: "FormFieldMain", icon: RiFileList3Line, configKey: "isFormField" },
25357
25363
  { name: "Assignment Rule", component: "AssignmentRuleMain", icon: RiFileShieldLine, configKey: "isAssignmentRule" }
25358
25364
  ];
25359
25365
  const masterHierarchyItems = [
@@ -25437,7 +25443,7 @@ function Sidebar({ isOpen, onToggle, childrens, sidebar, sidebarConfig }) {
25437
25443
  const [tasksOpen, setTasksOpen] = useState81(false);
25438
25444
  const [trackingOpen, setTrackingOpen] = useState81(false);
25439
25445
  const [communicationOpen, setCommunicationOpen] = useState81(false);
25440
- useEffect60(() => {
25446
+ useEffect61(() => {
25441
25447
  if (workflowItems.some((item) => item.component === activeComponent)) {
25442
25448
  setWorkflowOpen(true);
25443
25449
  } else if (permissionItems.some((item) => item.component === activeComponent)) {