flowcore-fn 9.3.2 → 9.3.4

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.
@@ -19,14 +19,13 @@ var __spreadValues = (a, b) => {
19
19
  var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
20
 
21
21
  // src/components/Sidebar.jsx
22
- import { useState as useState56 } from "react";
22
+ import { useState as useState57 } from "react";
23
23
  import { RiFlowChart, RiShieldUserLine, RiFolder3Line, RiCheckboxCircleLine, RiRouteLine, RiMessage2Line, RiMenuLine, RiGitMergeLine, RiNodeTree, RiGitBranchLine, RiCornerDownRightLine, RiUserSettingsLine, RiFileShieldLine, RiUserSharedLine, RiSettings4Line, RiFileSettingsLine, RiFileList3Line, RiFileUploadLine, RiNotification4Line, RiDatabase2Line, RiChat3Line, RiCheckboxMultipleLine, RiShieldCheckLine, RiHistoryLine, RiArrowDownSLine, RiArrowRightSLine } from "@remixicon/react";
24
24
  import { useRouter } from "next/router";
25
25
 
26
26
  // src/components/workflow/WorkflowMain.jsx
27
- import React9, { useState as useState5, useRef as useRef2 } from "react";
28
- import { useEffect as useEffect3 } from "react";
29
- import Swal from "sweetalert2";
27
+ import React9, { useState as useState6, useRef as useRef2, useEffect as useEffect5 } from "react";
28
+ import Swal3 from "sweetalert2";
30
29
 
31
30
  // src/components/Service/ApiEndpointsProvider.js
32
31
  var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
@@ -113,155 +112,11 @@ function SearchBar({ searchQuery, setSearchQuery }) {
113
112
  }
114
113
 
115
114
  // src/components/workflow/WorkflowTable.jsx
116
- import React4, { useState as useState2 } from "react";
117
-
118
- // src/components/workflow/AddEditModal.jsx
119
- import React2, { useEffect, useState } from "react";
120
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
121
- function AddEditModal({
122
- isOpen,
123
- onClose,
124
- onSave,
125
- editData
126
- }) {
127
- const [formData, setFormData] = useState({
128
- name: "",
129
- code: "",
130
- type: "",
131
- version: "",
132
- published: true,
133
- status: true
134
- });
135
- useEffect(() => {
136
- if (editData) {
137
- setFormData(editData);
138
- }
139
- }, [editData]);
140
- if (!isOpen) return null;
141
- const handleChange = (e) => {
142
- const { name, value, type, checked } = e.target;
143
- setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
144
- [name]: type === "checkbox" ? checked : value
145
- }));
146
- };
147
- const handleSave = () => {
148
- onSave(formData);
149
- onClose();
150
- };
151
- return /* @__PURE__ */ jsx2("div", { className: "fc:fixed fc:inset-0 fc:bg-black/40 fc:flex fc:items-center fc:justify-center fc:z-50", children: /* @__PURE__ */ jsxs2("div", { className: "fc:bg-white fc:w-[550px] fc:rounded-xl fc:shadow-xl fc:p-6", children: [
152
- /* @__PURE__ */ jsxs2("div", { className: "fc:flex fc:justify-between fc:items-center fc:mb-6", children: [
153
- /* @__PURE__ */ jsx2("h2", { className: "fc:text-xl fc:font-bold fc:text-slate-800", children: "Edit Workflow" }),
154
- /* @__PURE__ */ jsx2(
155
- "button",
156
- {
157
- onClick: onClose,
158
- className: "fc:text-slate-500 hover:fc:text-red-500 fc:text-xl",
159
- children: "\u2715"
160
- }
161
- )
162
- ] }),
163
- /* @__PURE__ */ jsxs2("div", { className: "fc:mb-4", children: [
164
- /* @__PURE__ */ jsx2("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Workflow Name" }),
165
- /* @__PURE__ */ jsx2(
166
- "input",
167
- {
168
- type: "text",
169
- name: "name",
170
- value: formData.name,
171
- onChange: handleChange,
172
- className: "fc:w-full fc:border fc:border-slate-300 fc:rounded-lg fc:px-3 fc:py-2 fc:outline-none focus:fc:border-blue-500"
173
- }
174
- )
175
- ] }),
176
- /* @__PURE__ */ jsxs2("div", { className: "fc:mb-4", children: [
177
- /* @__PURE__ */ jsx2("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Workflow Code" }),
178
- /* @__PURE__ */ jsx2(
179
- "input",
180
- {
181
- type: "text",
182
- name: "code",
183
- value: formData.code,
184
- onChange: handleChange,
185
- className: "fc:w-full fc:border fc:border-slate-300 fc:rounded-lg fc:px-3 fc:py-2 fc:outline-none focus:fc:border-blue-500"
186
- }
187
- )
188
- ] }),
189
- /* @__PURE__ */ jsxs2("div", { className: "fc:mb-4", children: [
190
- /* @__PURE__ */ jsx2("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Workflow Type" }),
191
- /* @__PURE__ */ jsx2(
192
- "input",
193
- {
194
- type: "text",
195
- name: "type",
196
- value: formData.type,
197
- onChange: handleChange,
198
- className: "fc:w-full fc:border fc:border-slate-300 fc:rounded-lg fc:px-3 fc:py-2 fc:outline-none focus:fc:border-blue-500"
199
- }
200
- )
201
- ] }),
202
- /* @__PURE__ */ jsxs2("div", { className: "fc:mb-4", children: [
203
- /* @__PURE__ */ jsx2("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Version" }),
204
- /* @__PURE__ */ jsx2(
205
- "input",
206
- {
207
- type: "number",
208
- name: "version",
209
- value: formData.version,
210
- onChange: handleChange,
211
- className: "fc:w-full fc:border fc:border-slate-300 fc:rounded-lg fc:px-3 fc:py-2 fc:outline-none focus:fc:border-blue-500"
212
- }
213
- )
214
- ] }),
215
- /* @__PURE__ */ jsxs2("div", { className: "fc:flex fc:items-center fc:gap-3 fc:mb-4", children: [
216
- /* @__PURE__ */ jsx2("label", { className: "fc:text-sm fc:font-medium", children: "Published" }),
217
- /* @__PURE__ */ jsx2(
218
- "input",
219
- {
220
- type: "checkbox",
221
- name: "published",
222
- checked: formData.published,
223
- onChange: handleChange
224
- }
225
- ),
226
- /* @__PURE__ */ jsx2("span", { children: formData.published ? "Yes" : "No" })
227
- ] }),
228
- /* @__PURE__ */ jsxs2("div", { className: "fc:flex fc:items-center fc:gap-3 fc:mb-8", children: [
229
- /* @__PURE__ */ jsx2("label", { className: "fc:text-sm fc:font-medium", children: "Status" }),
230
- /* @__PURE__ */ jsx2(
231
- "input",
232
- {
233
- type: "checkbox",
234
- name: "status",
235
- checked: formData.status,
236
- onChange: handleChange
237
- }
238
- ),
239
- /* @__PURE__ */ jsx2("span", { children: formData.status ? "Active" : "Inactive" })
240
- ] }),
241
- /* @__PURE__ */ jsxs2("div", { className: "fc:flex fc:justify-end fc:gap-3", children: [
242
- /* @__PURE__ */ jsx2(
243
- "button",
244
- {
245
- onClick: onClose,
246
- className: "fc:px-5 fc:py-2 fc:rounded-lg fc:border fc:border-slate-300 hover:fc:bg-slate-100",
247
- children: "Cancel"
248
- }
249
- ),
250
- /* @__PURE__ */ jsx2(
251
- "button",
252
- {
253
- onClick: handleSave,
254
- className: "fc:px-5 fc:py-2 fc:rounded-lg fc:bg-blue-600 hover:fc:bg-blue-700 fc:text-white",
255
- children: "Save"
256
- }
257
- )
258
- ] })
259
- ] }) });
260
- }
115
+ import React3, { useState, useEffect } from "react";
261
116
 
262
117
  // src/components/workflow/DeleteModal.jsx
263
- import React3 from "react";
264
- import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
118
+ import React2 from "react";
119
+ import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
265
120
  function DeleteModal({
266
121
  isOpen,
267
122
  onClose,
@@ -269,10 +124,10 @@ function DeleteModal({
269
124
  workflowName = "Citizen Petition"
270
125
  }) {
271
126
  if (!isOpen) return null;
272
- return /* @__PURE__ */ jsxs3("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center", children: [
273
- /* @__PURE__ */ jsx3("div", { className: "fc:absolute fc:inset-0 fc:bg-black/25 fc:backdrop-blur-sm" }),
274
- /* @__PURE__ */ jsxs3("div", { className: "fc:relative fc:bg-white fc:w-[390px] fc:rounded-[22px] fc:shadow-2xl fc:px-8 fc:pt-7 fc:pb-6", children: [
275
- /* @__PURE__ */ jsx3(
127
+ return /* @__PURE__ */ jsxs2("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center", children: [
128
+ /* @__PURE__ */ jsx2("div", { className: "fc:absolute fc:inset-0 fc:bg-black/25 fc:backdrop-blur-sm" }),
129
+ /* @__PURE__ */ jsxs2("div", { className: "fc:relative fc:bg-white fc:w-[390px] fc:rounded-[22px] fc:shadow-2xl fc:px-8 fc:pt-7 fc:pb-6", children: [
130
+ /* @__PURE__ */ jsx2(
276
131
  "button",
277
132
  {
278
133
  onClick: onClose,
@@ -280,21 +135,21 @@ function DeleteModal({
280
135
  children: "\xD7"
281
136
  }
282
137
  ),
283
- /* @__PURE__ */ jsx3("div", { className: "fc:flex fc:justify-center", children: /* @__PURE__ */ jsx3("div", { className: "fc:w-12 fc:h-12 fc:bg-orange-50 fc:rounded-2xl fc:flex fc:items-center fc:justify-center", children: /* @__PURE__ */ jsx3("span", { className: "fc:text-2xl", children: "\u26A0\uFE0F" }) }) }),
284
- /* @__PURE__ */ jsx3("h2", { className: "fc:text-[31px] fc:font-semibold fc:text-center fc:mt-5 fc:text-gray-900", children: "Delete Workflow" }),
285
- /* @__PURE__ */ jsxs3("p", { className: "fc:text-center fc:text-gray-500 fc:text-sm fc:mt-3", children: [
138
+ /* @__PURE__ */ jsx2("div", { className: "fc:flex fc:justify-center", children: /* @__PURE__ */ jsx2("div", { className: "fc:w-12 fc:h-12 fc:bg-orange-50 fc:rounded-2xl fc:flex fc:items-center fc:justify-center", children: /* @__PURE__ */ jsx2("span", { className: "fc:text-2xl", children: "\u26A0\uFE0F" }) }) }),
139
+ /* @__PURE__ */ jsx2("h2", { className: "fc:text-[31px] fc:font-semibold fc:text-center fc:mt-5 fc:text-gray-900", children: "Delete Workflow" }),
140
+ /* @__PURE__ */ jsxs2("p", { className: "fc:text-center fc:text-gray-500 fc:text-sm fc:mt-3", children: [
286
141
  "Are you sure you want to delete",
287
142
  " ",
288
- /* @__PURE__ */ jsxs3("span", { className: "fc:font-semibold fc:text-gray-700", children: [
143
+ /* @__PURE__ */ jsxs2("span", { className: "fc:font-semibold fc:text-gray-700", children: [
289
144
  '"',
290
145
  workflowName,
291
146
  '"'
292
147
  ] }),
293
148
  "?"
294
149
  ] }),
295
- /* @__PURE__ */ jsx3("p", { className: "fc:text-center fc:text-gray-400 fc:text-sm fc:mt-1", children: "This action cannot be undone." }),
296
- /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:gap-3 fc:mt-8", children: [
297
- /* @__PURE__ */ jsx3(
150
+ /* @__PURE__ */ jsx2("p", { className: "fc:text-center fc:text-gray-400 fc:text-sm fc:mt-1", children: "This action cannot be undone." }),
151
+ /* @__PURE__ */ jsxs2("div", { className: "fc:flex fc:gap-3 fc:mt-8", children: [
152
+ /* @__PURE__ */ jsx2(
298
153
  "button",
299
154
  {
300
155
  onClick: onClose,
@@ -302,7 +157,7 @@ function DeleteModal({
302
157
  children: "Cancel"
303
158
  }
304
159
  ),
305
- /* @__PURE__ */ jsx3(
160
+ /* @__PURE__ */ jsx2(
306
161
  "button",
307
162
  {
308
163
  onClick: () => {
@@ -319,8 +174,8 @@ function DeleteModal({
319
174
  }
320
175
 
321
176
  // src/components/workflow/WorkflowTable.jsx
322
- import { Fragment, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
323
- function WorkflowTable({ pageSize, searchQuery, apiData }) {
177
+ import { Fragment, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
178
+ function WorkflowTable({ pageSize, searchQuery, apiData, onEdit, onDeleteApi }) {
324
179
  const initialData = [
325
180
  {
326
181
  id: "1",
@@ -431,19 +286,18 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
431
286
  status: true
432
287
  }
433
288
  ];
434
- const [data, setData] = useState2(apiData || initialData);
435
- React4.useEffect(() => {
289
+ const [data, setData] = useState(apiData || initialData);
290
+ React3.useEffect(() => {
436
291
  if (apiData) setData(apiData);
437
292
  }, [apiData]);
438
293
  const filteredData = data.filter(
439
294
  (item) => item.name.toLowerCase().includes((searchQuery || "").toLowerCase()) || item.code.toLowerCase().includes((searchQuery || "").toLowerCase())
440
295
  );
441
- const [sortColumn, setSortColumn] = useState2("");
442
- const [sortDirection, setSortDirection] = useState2("asc");
443
- const [currentPage, setCurrentPage] = useState2(1);
444
- const [editOpen, setEditOpen] = useState2(false);
445
- const [deleteOpen, setDeleteOpen] = useState2(false);
446
- const [selectedWorkflow, setSelectedWorkflow] = useState2(null);
296
+ const [sortColumn, setSortColumn] = useState("");
297
+ const [sortDirection, setSortDirection] = useState("asc");
298
+ const [currentPage, setCurrentPage] = useState(1);
299
+ const [deleteOpen, setDeleteOpen] = useState(false);
300
+ const [selectedWorkflow, setSelectedWorkflow] = useState(null);
447
301
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
448
302
  const startIndex = (currentPage - 1) * pageSize;
449
303
  const visibleData = filteredData.slice(
@@ -469,8 +323,8 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
469
323
  };
470
324
  const getSortIcon = (column) => {
471
325
  if (sortColumn !== column)
472
- return /* @__PURE__ */ jsx4("span", { className: "fc:text-slate-500 fc:ml-1", children: "\u25B2" });
473
- return sortDirection === "asc" ? /* @__PURE__ */ jsx4("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25B2" }) : /* @__PURE__ */ jsx4("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25BC" });
326
+ return /* @__PURE__ */ jsx3("span", { className: "fc:text-slate-500 fc:ml-1", children: "\u25B2" });
327
+ return sortDirection === "asc" ? /* @__PURE__ */ jsx3("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25B2" }) : /* @__PURE__ */ jsx3("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25BC" });
474
328
  };
475
329
  const toggleSwitch = (id) => {
476
330
  setData(
@@ -482,22 +336,21 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
482
336
  );
483
337
  };
484
338
  const handleEdit = (workflow) => {
485
- setSelectedWorkflow(workflow);
486
- setEditOpen(true);
339
+ if (onEdit) {
340
+ onEdit(workflow);
341
+ return;
342
+ }
487
343
  };
488
344
  const handleDelete = (workflow) => {
489
345
  setSelectedWorkflow(workflow);
490
346
  setDeleteOpen(true);
491
347
  };
492
- const handleUpdate = (updatedWorkflow) => {
493
- setData(
494
- (prev) => prev.map(
495
- (item) => item.id === updatedWorkflow.id ? updatedWorkflow : item
496
- )
497
- );
498
- setEditOpen(false);
499
- };
500
- const confirmDelete = () => {
348
+ const confirmDelete = async () => {
349
+ if (onDeleteApi) {
350
+ await onDeleteApi(selectedWorkflow);
351
+ setDeleteOpen(false);
352
+ return;
353
+ }
501
354
  setData(
502
355
  (prev) => prev.filter(
503
356
  (item) => item.id !== selectedWorkflow.id
@@ -505,82 +358,82 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
505
358
  );
506
359
  setDeleteOpen(false);
507
360
  };
508
- return /* @__PURE__ */ jsx4(Fragment, { children: /* @__PURE__ */ jsxs4("div", { className: "fc:space-y-5", children: [
509
- /* @__PURE__ */ jsxs4("div", { className: "fc:w-full fc:border fc:border-slate-200 fc:rounded-2xl fc:overflow-hidden", children: [
510
- /* @__PURE__ */ jsx4("div", { className: "fc:max-h-[420px] fc:overflow-y-auto fc:overflow-x-auto", children: /* @__PURE__ */ jsxs4("table", { className: "fc:w-full fc:border-collapse fc:bg-white", children: [
511
- /* @__PURE__ */ jsx4("thead", { className: "fc:sticky fc:top-0 fc:z-10 fc:bg-slate-50", children: /* @__PURE__ */ jsxs4("tr", { className: "fc:border-b fc:border-slate-200 fc:text-xs fc:uppercase fc:text-slate-500", children: [
512
- /* @__PURE__ */ jsx4("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "S.No" }),
513
- /* @__PURE__ */ jsx4(
361
+ return /* @__PURE__ */ jsx3(Fragment, { children: /* @__PURE__ */ jsxs3("div", { className: "fc:space-y-5", children: [
362
+ /* @__PURE__ */ jsxs3("div", { className: "fc:w-full fc:border fc:border-slate-200 fc:rounded-2xl fc:overflow-hidden", children: [
363
+ /* @__PURE__ */ jsx3("div", { className: "fc:max-h-[420px] fc:overflow-y-auto fc:overflow-x-auto", children: /* @__PURE__ */ jsxs3("table", { className: "fc:w-full fc:border-collapse fc:bg-white", children: [
364
+ /* @__PURE__ */ jsx3("thead", { className: "fc:sticky fc:top-0 fc:z-10 fc:bg-slate-50", children: /* @__PURE__ */ jsxs3("tr", { className: "fc:border-b fc:border-slate-200 fc:text-xs fc:uppercase fc:text-slate-500", children: [
365
+ /* @__PURE__ */ jsx3("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "S.No" }),
366
+ /* @__PURE__ */ jsx3(
514
367
  "th",
515
368
  {
516
369
  onClick: () => handleSort("name"),
517
370
  className: "fc:px-5 fc:py-4 fc:cursor-pointer",
518
- children: /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center", children: [
371
+ children: /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:items-center", children: [
519
372
  "Workflow Name",
520
373
  getSortIcon("name")
521
374
  ] })
522
375
  }
523
376
  ),
524
- /* @__PURE__ */ jsx4(
377
+ /* @__PURE__ */ jsx3(
525
378
  "th",
526
379
  {
527
380
  onClick: () => handleSort("code"),
528
381
  className: "fc:px-5 fc:py-4 fc:cursor-pointer",
529
- children: /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center", children: [
382
+ children: /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:items-center", children: [
530
383
  "Workflow Code",
531
384
  getSortIcon("code")
532
385
  ] })
533
386
  }
534
387
  ),
535
- /* @__PURE__ */ jsx4(
388
+ /* @__PURE__ */ jsx3(
536
389
  "th",
537
390
  {
538
391
  onClick: () => handleSort("type"),
539
392
  className: "fc:px-5 fc:py-4 fc:cursor-pointer",
540
- children: /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center", children: [
393
+ children: /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:items-center", children: [
541
394
  "Workflow Type",
542
395
  getSortIcon("type")
543
396
  ] })
544
397
  }
545
398
  ),
546
- /* @__PURE__ */ jsx4(
399
+ /* @__PURE__ */ jsx3(
547
400
  "th",
548
401
  {
549
402
  onClick: () => handleSort("version"),
550
403
  className: "fc:px-5 fc:py-4 fc:text-center fc:cursor-pointer",
551
- children: /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:justify-center fc:items-center", children: [
404
+ children: /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:justify-center fc:items-center", children: [
552
405
  "Version",
553
406
  getSortIcon("version")
554
407
  ] })
555
408
  }
556
409
  ),
557
- /* @__PURE__ */ jsx4("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Published" }),
558
- /* @__PURE__ */ jsx4("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Status" }),
559
- /* @__PURE__ */ jsx4("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Action" })
410
+ /* @__PURE__ */ jsx3("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Published" }),
411
+ /* @__PURE__ */ jsx3("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Status" }),
412
+ /* @__PURE__ */ jsx3("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Action" })
560
413
  ] }) }),
561
- /* @__PURE__ */ jsx4("tbody", { className: "fc:divide-y fc:divide-slate-100", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs4(
414
+ /* @__PURE__ */ jsx3("tbody", { className: "fc:divide-y fc:divide-slate-100", children: visibleData.map((item, index) => /* @__PURE__ */ jsxs3(
562
415
  "tr",
563
416
  {
564
417
  className: "hover:fc:bg-slate-50",
565
418
  children: [
566
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: startIndex + index + 1 }),
567
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4 fc:font-semibold", children: item.name }),
568
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4", children: item.code }),
569
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4", children: item.type }),
570
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: item.version }),
571
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ jsx4(
419
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: startIndex + index + 1 }),
420
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4 fc:font-semibold", children: item.name }),
421
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4", children: item.code }),
422
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4", children: item.type }),
423
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: item.version }),
424
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ jsx3(
572
425
  "span",
573
426
  {
574
427
  className: `fc:px-3 fc:py-1 fc:rounded-md fc:text-xs ${item.published ? "fc:bg-green-100 fc:text-green-700" : "fc:bg-red-100 fc:text-red-700"}`,
575
428
  children: item.published ? "Yes" : "No"
576
429
  }
577
430
  ) }),
578
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ jsx4(
431
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ jsx3(
579
432
  "button",
580
433
  {
581
434
  onClick: () => toggleSwitch(item.id),
582
435
  className: `fc:w-11 fc:h-6 fc:rounded-full fc:relative ${item.status ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
583
- children: /* @__PURE__ */ jsx4(
436
+ children: /* @__PURE__ */ jsx3(
584
437
  "span",
585
438
  {
586
439
  className: `fc:absolute fc:top-0.5 fc:h-5 fc:w-5 fc:bg-white fc:rounded-full fc:transition-all ${item.status ? "fc:left-5" : "fc:left-0.5"}`
@@ -588,8 +441,8 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
588
441
  )
589
442
  }
590
443
  ) }),
591
- /* @__PURE__ */ jsx4("td", { className: "fc:px-5 fc:py-4", children: /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:justify-center fc:gap-2", children: [
592
- /* @__PURE__ */ jsx4(
444
+ /* @__PURE__ */ jsx3("td", { className: "fc:px-5 fc:py-4", children: /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:justify-center fc:gap-2", children: [
445
+ /* @__PURE__ */ jsx3(
593
446
  "button",
594
447
  {
595
448
  onClick: () => handleEdit(item),
@@ -597,7 +450,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
597
450
  children: "Edit"
598
451
  }
599
452
  ),
600
- /* @__PURE__ */ jsx4(
453
+ /* @__PURE__ */ jsx3(
601
454
  "button",
602
455
  {
603
456
  onClick: () => handleDelete(item),
@@ -611,8 +464,8 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
611
464
  item.id
612
465
  )) })
613
466
  ] }) }),
614
- /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-1 fc:text-[13px] fc:text-slate-700 fc:font-normal fc:mt-4 fc:bg-slate-50/50 fc:p-3 fc:rounded-xl fc:border fc:border-slate-100", children: [
615
- /* @__PURE__ */ jsx4(
467
+ /* @__PURE__ */ jsxs3("div", { className: "fc:flex fc:items-center fc:justify-end fc:gap-1 fc:text-[13px] fc:text-slate-700 fc:font-normal fc:mt-4 fc:bg-slate-50/50 fc:p-3 fc:rounded-xl fc:border fc:border-slate-100", children: [
468
+ /* @__PURE__ */ jsx3(
616
469
  "button",
617
470
  {
618
471
  onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
@@ -620,7 +473,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
620
473
  children: "\u2039 Prev"
621
474
  }
622
475
  ),
623
- Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => /* @__PURE__ */ jsx4(
476
+ Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => /* @__PURE__ */ jsx3(
624
477
  "button",
625
478
  {
626
479
  onClick: () => setCurrentPage(page),
@@ -629,7 +482,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
629
482
  },
630
483
  page
631
484
  )),
632
- /* @__PURE__ */ jsx4(
485
+ /* @__PURE__ */ jsx3(
633
486
  "button",
634
487
  {
635
488
  onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
@@ -637,7 +490,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
637
490
  children: "Next \u203A"
638
491
  }
639
492
  ),
640
- /* @__PURE__ */ jsx4(
493
+ /* @__PURE__ */ jsx3(
641
494
  "button",
642
495
  {
643
496
  onClick: () => setCurrentPage(totalPages),
@@ -647,16 +500,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
647
500
  )
648
501
  ] })
649
502
  ] }),
650
- /* @__PURE__ */ jsx4(
651
- AddEditModal,
652
- {
653
- isOpen: editOpen,
654
- editData: selectedWorkflow,
655
- onClose: () => setEditOpen(false),
656
- onSave: handleUpdate
657
- }
658
- ),
659
- /* @__PURE__ */ jsx4(
503
+ /* @__PURE__ */ jsx3(
660
504
  DeleteModal,
661
505
  {
662
506
  isOpen: deleteOpen,
@@ -669,26 +513,330 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
669
513
  }
670
514
 
671
515
  // src/components/workflow/AddWorkflowModal.jsx
672
- import React5 from "react";
673
- import { Fragment as Fragment2, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
516
+ import React4, { useEffect as useEffect2, useState as useState2 } from "react";
517
+ import Swal from "sweetalert2";
518
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
519
+ var INITIAL_FORM = {
520
+ workflowTypeId: "",
521
+ workflowCode: "",
522
+ workflowName: "",
523
+ version: "1",
524
+ published: "false",
525
+ status: "active",
526
+ defaultPriority: "medium",
527
+ description: ""
528
+ };
674
529
  function AddWorkflowModal({
675
530
  isOpen,
676
531
  onClose,
677
- workflowTypes = []
532
+ workflowTypes = [],
533
+ onSave
678
534
  }) {
535
+ const [formData, setFormData] = useState2(INITIAL_FORM);
536
+ const [errors, setErrors] = useState2({});
537
+ const [isSubmitting, setIsSubmitting] = useState2(false);
538
+ const [submitError, setSubmitError] = useState2("");
539
+ useEffect2(() => {
540
+ if (!isOpen) {
541
+ setFormData(INITIAL_FORM);
542
+ setErrors({});
543
+ setSubmitError("");
544
+ setIsSubmitting(false);
545
+ }
546
+ }, [isOpen]);
679
547
  if (!isOpen) return null;
548
+ const handleChange = (event) => {
549
+ const { name, value } = event.target;
550
+ if (name === "description" && value.length > 500) return;
551
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [name]: value }));
552
+ setErrors((prev) => __spreadProps(__spreadValues({}, prev), { [name]: "" }));
553
+ setSubmitError("");
554
+ };
555
+ const validate = () => {
556
+ const nextErrors = {};
557
+ if (!formData.workflowTypeId) nextErrors.workflowTypeId = "Workflow type is required";
558
+ if (!formData.workflowCode.trim()) nextErrors.workflowCode = "Workflow code is required";
559
+ if (!formData.workflowName.trim()) nextErrors.workflowName = "Workflow name is required";
560
+ if (!formData.version.trim()) nextErrors.version = "Version is required";
561
+ setErrors(nextErrors);
562
+ return Object.keys(nextErrors).length === 0;
563
+ };
564
+ const handleSubmit = async (event) => {
565
+ var _a, _b;
566
+ event.preventDefault();
567
+ if (!validate()) return;
568
+ if (!onSave) {
569
+ setSubmitError("Save handler not configured.");
570
+ return;
571
+ }
572
+ const payload = {
573
+ workflowTypeId: formData.workflowTypeId,
574
+ workflowCode: formData.workflowCode.trim(),
575
+ workflowName: formData.workflowName.trim(),
576
+ version: formData.version.trim(),
577
+ published: formData.published === "true",
578
+ status: formData.status === "active",
579
+ defaultPriority: formData.defaultPriority,
580
+ description: formData.description.trim(),
581
+ createdBy: "System"
582
+ };
583
+ try {
584
+ setIsSubmitting(true);
585
+ const result = await onSave(payload);
586
+ if (result) {
587
+ onClose();
588
+ }
589
+ } catch (error) {
590
+ const message = ((_b = (_a = error == null ? void 0 : error.response) == null ? void 0 : _a.data) == null ? void 0 : _b.message) || (error == null ? void 0 : error.message) || "Unable to save workflow.";
591
+ setSubmitError(message);
592
+ await Swal.fire("Error", message, "error");
593
+ } finally {
594
+ setIsSubmitting(false);
595
+ }
596
+ };
597
+ return /* @__PURE__ */ jsxs4("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
598
+ /* @__PURE__ */ jsx4("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
599
+ /* @__PURE__ */ jsxs4("form", { onSubmit: handleSubmit, 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: [
600
+ /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100", children: [
601
+ /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
602
+ /* @__PURE__ */ jsx4("div", { className: "fc:w-12 fc:h-12 fc:bg-indigo-50 fc:text-indigo-600 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:shadow-sm", children: /* @__PURE__ */ jsx4("svg", { className: "fc:w-6 fc:h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx4("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
603
+ /* @__PURE__ */ jsxs4("div", { children: [
604
+ /* @__PURE__ */ jsx4("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800", children: "Add Workflow" }),
605
+ /* @__PURE__ */ jsx4("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5", children: "Create a new workflow and configure its details" })
606
+ ] })
607
+ ] }),
608
+ /* @__PURE__ */ jsx4("button", { type: "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" })
609
+ ] }),
610
+ /* @__PURE__ */ jsxs4("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: [
611
+ /* @__PURE__ */ jsxs4("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: [
612
+ /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
613
+ /* @__PURE__ */ jsx4("span", { children: "\u{1F4CB}" }),
614
+ /* @__PURE__ */ jsx4("span", { children: "Workflow Information" })
615
+ ] }),
616
+ /* @__PURE__ */ jsxs4("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
617
+ /* @__PURE__ */ jsxs4("div", { children: [
618
+ /* @__PURE__ */ jsxs4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
619
+ "Workflow Type ",
620
+ /* @__PURE__ */ jsx4("span", { className: "fc:text-red-500", children: "*" })
621
+ ] }),
622
+ /* @__PURE__ */ jsxs4("select", { name: "workflowTypeId", value: formData.workflowTypeId, onChange: handleChange, className: inputClass(errors.workflowTypeId), children: [
623
+ /* @__PURE__ */ jsx4("option", { value: "", children: "Select workflow type" }),
624
+ workflowTypes.length > 0 ? workflowTypes.map((type) => {
625
+ var _a, _b;
626
+ const id = (_a = type.workflowTypeId) != null ? _a : type.WorkflowTypeId;
627
+ const label = (_b = type.workflowTypeName) != null ? _b : type.WorkflowTypeName;
628
+ return /* @__PURE__ */ jsx4("option", { value: id, children: label }, id);
629
+ }) : /* @__PURE__ */ jsxs4(Fragment2, { children: [
630
+ /* @__PURE__ */ jsx4("option", { value: "petition", children: "Petition" }),
631
+ /* @__PURE__ */ jsx4("option", { value: "building", children: "Building Permission" }),
632
+ /* @__PURE__ */ jsx4("option", { value: "leave", children: "Leave" })
633
+ ] })
634
+ ] }),
635
+ errors.workflowTypeId && /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowTypeId })
636
+ ] }),
637
+ /* @__PURE__ */ jsxs4("div", { children: [
638
+ /* @__PURE__ */ jsxs4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
639
+ "Workflow Code ",
640
+ /* @__PURE__ */ jsx4("span", { className: "fc:text-red-500", children: "*" })
641
+ ] }),
642
+ /* @__PURE__ */ jsx4("input", { name: "workflowCode", value: formData.workflowCode, onChange: handleChange, type: "text", placeholder: "Enter workflow code", className: inputClass(errors.workflowCode) }),
643
+ errors.workflowCode && /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowCode })
644
+ ] })
645
+ ] }),
646
+ /* @__PURE__ */ jsxs4("div", { children: [
647
+ /* @__PURE__ */ jsxs4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
648
+ "Workflow Name ",
649
+ /* @__PURE__ */ jsx4("span", { className: "fc:text-red-500", children: "*" })
650
+ ] }),
651
+ /* @__PURE__ */ jsx4("input", { name: "workflowName", value: formData.workflowName, onChange: handleChange, type: "text", placeholder: "Enter workflow name", className: inputClass(errors.workflowName) }),
652
+ errors.workflowName && /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowName })
653
+ ] }),
654
+ /* @__PURE__ */ jsxs4("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
655
+ /* @__PURE__ */ jsxs4("div", { children: [
656
+ /* @__PURE__ */ jsxs4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
657
+ "Version ",
658
+ /* @__PURE__ */ jsx4("span", { className: "fc:text-red-500", children: "*" })
659
+ ] }),
660
+ /* @__PURE__ */ jsx4("input", { name: "version", type: "text", value: formData.version, onChange: handleChange, className: inputClass(errors.version) }),
661
+ errors.version && /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.version })
662
+ ] }),
663
+ /* @__PURE__ */ jsxs4("div", { children: [
664
+ /* @__PURE__ */ jsxs4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
665
+ "Published ",
666
+ /* @__PURE__ */ jsx4("span", { className: "fc:text-red-500", children: "*" })
667
+ ] }),
668
+ /* @__PURE__ */ jsxs4("select", { name: "published", value: formData.published, onChange: handleChange, className: inputClass(), children: [
669
+ /* @__PURE__ */ jsx4("option", { value: "false", children: "No" }),
670
+ /* @__PURE__ */ jsx4("option", { value: "true", children: "Yes" })
671
+ ] }),
672
+ /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Make workflow active for use" })
673
+ ] })
674
+ ] })
675
+ ] }),
676
+ /* @__PURE__ */ jsxs4("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-3", children: [
677
+ /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:justify-between fc:items-center", children: [
678
+ /* @__PURE__ */ jsx4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700", children: "Description" }),
679
+ /* @__PURE__ */ jsxs4("span", { className: "fc:text-[10px] fc:text-slate-400", children: [
680
+ formData.description.length,
681
+ " / 500"
682
+ ] })
683
+ ] }),
684
+ /* @__PURE__ */ jsx4("textarea", { name: "description", rows: 3, value: formData.description, onChange: handleChange, placeholder: "Enter workflow description (optional)", className: inputClass() }),
685
+ /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-400", children: "Provide additional information about this workflow" })
686
+ ] }),
687
+ /* @__PURE__ */ jsxs4("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: [
688
+ /* @__PURE__ */ jsxs4("div", { className: "fc:flex fc:items-center fc:gap-2 fc:text-indigo-600 fc:text-sm fc:font-bold fc:border-b fc:border-slate-50 fc:pb-3", children: [
689
+ /* @__PURE__ */ jsx4("span", { children: "\u2699\uFE0F" }),
690
+ /* @__PURE__ */ jsx4("span", { children: "Status & Settings" })
691
+ ] }),
692
+ /* @__PURE__ */ jsxs4("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
693
+ /* @__PURE__ */ jsxs4("div", { children: [
694
+ /* @__PURE__ */ jsxs4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
695
+ "Status ",
696
+ /* @__PURE__ */ jsx4("span", { className: "fc:text-red-500", children: "*" })
697
+ ] }),
698
+ /* @__PURE__ */ jsxs4("select", { name: "status", value: formData.status, onChange: handleChange, className: inputClass(), children: [
699
+ /* @__PURE__ */ jsx4("option", { value: "active", children: "Active" }),
700
+ /* @__PURE__ */ jsx4("option", { value: "inactive", children: "Inactive" })
701
+ ] }),
702
+ /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Set the initial status of this workflow" })
703
+ ] }),
704
+ /* @__PURE__ */ jsxs4("div", { children: [
705
+ /* @__PURE__ */ jsx4("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: "Default Priority" }),
706
+ /* @__PURE__ */ jsxs4("select", { name: "defaultPriority", value: formData.defaultPriority, onChange: handleChange, className: inputClass(), children: [
707
+ /* @__PURE__ */ jsx4("option", { value: "medium", children: "Medium" }),
708
+ /* @__PURE__ */ jsx4("option", { value: "high", children: "High" }),
709
+ /* @__PURE__ */ jsx4("option", { value: "low", children: "Low" })
710
+ ] }),
711
+ /* @__PURE__ */ jsx4("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Default priority for tasks in this workflow" })
712
+ ] })
713
+ ] })
714
+ ] })
715
+ ] }),
716
+ /* @__PURE__ */ jsxs4("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: [
717
+ /* @__PURE__ */ jsx4("button", { type: "button", onClick: onClose, disabled: isSubmitting, className: "fc:px-6 fc:py-2.5 fc:border fc:border-slate-200 fc:text-red-500 fc:text-xs fc:font-bold fc:rounded-xl hover:fc:fc:bg-slate-50 fc:transition-all fc:flex fc:items-center fc:gap-1.5", children: "\u2715 Cancel" }),
718
+ /* @__PURE__ */ jsx4("button", { type: "submit", disabled: isSubmitting, className: "fc:px-6 fc:py-2.5 fc:bg-indigo-600 hover:fc:fc:bg-indigo-700 fc:text-white fc:text-xs fc:font-bold fc:rounded-xl fc:shadow-md fc:shadow-indigo-500/10 fc:transition-all fc:flex fc:items-center fc:gap-1.5", children: isSubmitting ? "Saving..." : "\u{1F4BE} Save Workflow" })
719
+ ] }),
720
+ submitError && /* @__PURE__ */ jsx4("div", { className: "fc:px-8 fc:pb-6", children: /* @__PURE__ */ jsx4("p", { className: "fc:text-sm fc:text-red-600", children: submitError }) })
721
+ ] })
722
+ ] });
723
+ }
724
+ var inputClass = (error) => `fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/10 focus:fc:border-indigo-500 ${error ? "fc:border-red-500" : ""}`;
725
+
726
+ // src/components/workflow/EditWorkflowModal.jsx
727
+ import React5, { useEffect as useEffect3, useState as useState3 } from "react";
728
+ import Swal2 from "sweetalert2";
729
+ import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
730
+ var INITIAL_FORM2 = {
731
+ workflowTypeId: "",
732
+ workflowCode: "",
733
+ workflowName: "",
734
+ version: "",
735
+ published: "false",
736
+ status: "active",
737
+ defaultPriority: "medium",
738
+ description: ""
739
+ };
740
+ function EditWorkflowModal({
741
+ isOpen,
742
+ onClose,
743
+ onSave,
744
+ workflowTypes = [],
745
+ editData = null
746
+ }) {
747
+ const [formData, setFormData] = useState3(INITIAL_FORM2);
748
+ const [errors, setErrors] = useState3({});
749
+ const [isSubmitting, setIsSubmitting] = useState3(false);
750
+ const [submitError, setSubmitError] = useState3("");
751
+ useEffect3(() => {
752
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
753
+ if (editData) {
754
+ setFormData({
755
+ workflowTypeId: (_d = (_c = (_a = editData.workflowTypeId) != null ? _a : editData.WorkflowTypeId) != null ? _c : (_b = editData.workflowType) == null ? void 0 : _b.workflowTypeId) != null ? _d : editData.workflowTypeId,
756
+ workflowCode: (_g = (_f = (_e = editData.workflowCode) != null ? _e : editData.WorkflowCode) != null ? _f : editData.code) != null ? _g : "",
757
+ workflowName: (_j = (_i = (_h = editData.workflowName) != null ? _h : editData.WorkflowName) != null ? _i : editData.name) != null ? _j : "",
758
+ version: (_m = (_l = (_k = editData.version) != null ? _k : editData.WorkflowVersion) != null ? _l : editData.workflowVersion) != null ? _m : "1",
759
+ published: ((_o = (_n = editData.published) != null ? _n : editData.isPublished) != null ? _o : editData.IsPublished) ? "true" : "false",
760
+ status: ((_q = (_p = editData.status) != null ? _p : editData.isActive) != null ? _q : editData.IsActive) ? "active" : "inactive",
761
+ defaultPriority: (_s = (_r = editData.defaultPriority) != null ? _r : editData.defaultPriority) != null ? _s : "medium",
762
+ description: (_u = (_t = editData.description) != null ? _t : editData.Description) != null ? _u : ""
763
+ });
764
+ setErrors({});
765
+ setSubmitError("");
766
+ }
767
+ }, [editData]);
768
+ useEffect3(() => {
769
+ if (!isOpen) {
770
+ setFormData(INITIAL_FORM2);
771
+ setErrors({});
772
+ setSubmitError("");
773
+ setIsSubmitting(false);
774
+ }
775
+ }, [isOpen]);
776
+ if (!isOpen) return null;
777
+ const handleChange = (event) => {
778
+ const { name, value } = event.target;
779
+ if (name === "description" && value.length > 500) return;
780
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [name]: value }));
781
+ setErrors((prev) => __spreadProps(__spreadValues({}, prev), { [name]: "" }));
782
+ setSubmitError("");
783
+ };
784
+ const validate = () => {
785
+ const nextErrors = {};
786
+ if (!formData.workflowTypeId) nextErrors.workflowTypeId = "Workflow type is required";
787
+ if (!formData.workflowCode.trim()) nextErrors.workflowCode = "Workflow code is required";
788
+ if (!formData.workflowName.trim()) nextErrors.workflowName = "Workflow name is required";
789
+ if (!formData.version.trim()) nextErrors.version = "Version is required";
790
+ setErrors(nextErrors);
791
+ return Object.keys(nextErrors).length === 0;
792
+ };
793
+ const handleSubmit = async (event) => {
794
+ var _a, _b, _c, _d, _e, _f;
795
+ event.preventDefault();
796
+ if (!validate()) return;
797
+ if (!onSave) {
798
+ setSubmitError("Save handler not configured.");
799
+ return;
800
+ }
801
+ const workflowId = (_b = (_a = editData == null ? void 0 : editData.workflowId) != null ? _a : editData == null ? void 0 : editData.WorkflowId) != null ? _b : editData == null ? void 0 : editData.id;
802
+ const payload = {
803
+ workflowId,
804
+ workflowTypeId: formData.workflowTypeId,
805
+ workflowCode: formData.workflowCode.trim(),
806
+ workflowName: formData.workflowName.trim(),
807
+ version: formData.version.trim(),
808
+ published: formData.published === "true",
809
+ status: formData.status === "active",
810
+ defaultPriority: formData.defaultPriority,
811
+ description: formData.description.trim(),
812
+ updatedBy: (_d = (_c = editData == null ? void 0 : editData.updatedBy) != null ? _c : editData == null ? void 0 : editData.createdBy) != null ? _d : "System"
813
+ };
814
+ try {
815
+ setIsSubmitting(true);
816
+ const result = await onSave(payload);
817
+ if (result) {
818
+ onClose();
819
+ }
820
+ } catch (error) {
821
+ const message = ((_f = (_e = error == null ? void 0 : error.response) == null ? void 0 : _e.data) == null ? void 0 : _f.message) || (error == null ? void 0 : error.message) || "Unable to save workflow.";
822
+ setSubmitError(message);
823
+ await Swal2.fire("Error", message, "error");
824
+ } finally {
825
+ setIsSubmitting(false);
826
+ }
827
+ };
680
828
  return /* @__PURE__ */ jsxs5("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
681
829
  /* @__PURE__ */ jsx5("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
682
- /* @__PURE__ */ jsxs5("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: [
830
+ /* @__PURE__ */ jsxs5("form", { onSubmit: handleSubmit, 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: [
683
831
  /* @__PURE__ */ jsxs5("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100", children: [
684
832
  /* @__PURE__ */ jsxs5("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
685
833
  /* @__PURE__ */ jsx5("div", { className: "fc:w-12 fc:h-12 fc:bg-indigo-50 fc:text-indigo-600 fc:rounded-xl fc:flex fc:items-center fc:justify-center fc:shadow-sm", children: /* @__PURE__ */ jsx5("svg", { className: "fc:w-6 fc:h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx5("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10" }) }) }),
686
834
  /* @__PURE__ */ jsxs5("div", { children: [
687
- /* @__PURE__ */ jsx5("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800", children: "Add Workflow" }),
688
- /* @__PURE__ */ jsx5("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5", children: "Create a new workflow and configure its details" })
835
+ /* @__PURE__ */ jsx5("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800", children: "Edit Workflow" }),
836
+ /* @__PURE__ */ jsx5("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5", children: "Update the workflow details" })
689
837
  ] })
690
838
  ] }),
691
- /* @__PURE__ */ jsx5("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" })
839
+ /* @__PURE__ */ jsx5("button", { type: "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" })
692
840
  ] }),
693
841
  /* @__PURE__ */ jsxs5("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: [
694
842
  /* @__PURE__ */ jsxs5("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: [
@@ -696,29 +844,34 @@ function AddWorkflowModal({
696
844
  /* @__PURE__ */ jsx5("span", { children: "\u{1F4CB}" }),
697
845
  /* @__PURE__ */ jsx5("span", { children: "Workflow Information" })
698
846
  ] }),
699
- /* @__PURE__ */ jsxs5("div", { className: "fc:grid fc:grid-cols-1 md:fc:fc:grid-cols-2 fc:gap-5", children: [
847
+ /* @__PURE__ */ jsxs5("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
700
848
  /* @__PURE__ */ jsxs5("div", { children: [
701
849
  /* @__PURE__ */ jsxs5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
702
850
  "Workflow Type ",
703
851
  /* @__PURE__ */ jsx5("span", { className: "fc:text-red-500", children: "*" })
704
852
  ] }),
705
- /* @__PURE__ */ jsxs5("select", { className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
853
+ /* @__PURE__ */ jsxs5("select", { name: "workflowTypeId", value: formData.workflowTypeId, onChange: handleChange, className: inputClass2(errors.workflowTypeId), children: [
706
854
  /* @__PURE__ */ jsx5("option", { value: "", children: "Select workflow type" }),
707
- workflowTypes.length > 0 ? workflowTypes.map((type) => /* @__PURE__ */ jsx5("option", { value: type.workflowTypeId || type.WorkflowTypeId, children: type.workflowTypeName || type.WorkflowTypeName }, type.workflowTypeId || type.WorkflowTypeId)) : /* @__PURE__ */ jsxs5(Fragment2, { children: [
855
+ workflowTypes.length > 0 ? workflowTypes.map((type) => {
856
+ var _a, _b;
857
+ const id = (_a = type.workflowTypeId) != null ? _a : type.WorkflowTypeId;
858
+ const label = (_b = type.workflowTypeName) != null ? _b : type.WorkflowTypeName;
859
+ return /* @__PURE__ */ jsx5("option", { value: id, children: label }, id);
860
+ }) : /* @__PURE__ */ jsxs5(Fragment3, { children: [
708
861
  /* @__PURE__ */ jsx5("option", { value: "petition", children: "Petition" }),
709
862
  /* @__PURE__ */ jsx5("option", { value: "building", children: "Building Permission" }),
710
863
  /* @__PURE__ */ jsx5("option", { value: "leave", children: "Leave" })
711
864
  ] })
712
865
  ] }),
713
- /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Choose the category this workflow belongs to" })
866
+ errors.workflowTypeId && /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowTypeId })
714
867
  ] }),
715
868
  /* @__PURE__ */ jsxs5("div", { children: [
716
869
  /* @__PURE__ */ jsxs5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
717
870
  "Workflow Code ",
718
871
  /* @__PURE__ */ jsx5("span", { className: "fc:text-red-500", children: "*" })
719
872
  ] }),
720
- /* @__PURE__ */ jsx5("input", { type: "text", placeholder: "Enter workflow code", className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500" }),
721
- /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
873
+ /* @__PURE__ */ jsx5("input", { name: "workflowCode", value: formData.workflowCode, onChange: handleChange, type: "text", placeholder: "Enter workflow code", className: inputClass2(errors.workflowCode) }),
874
+ errors.workflowCode && /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowCode })
722
875
  ] })
723
876
  ] }),
724
877
  /* @__PURE__ */ jsxs5("div", { children: [
@@ -726,24 +879,24 @@ function AddWorkflowModal({
726
879
  "Workflow Name ",
727
880
  /* @__PURE__ */ jsx5("span", { className: "fc:text-red-500", children: "*" })
728
881
  ] }),
729
- /* @__PURE__ */ jsx5("input", { type: "text", placeholder: "Enter workflow name", className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500" }),
730
- /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Enter a descriptive name for this workflow" })
882
+ /* @__PURE__ */ jsx5("input", { name: "workflowName", value: formData.workflowName, onChange: handleChange, type: "text", placeholder: "Enter workflow name", className: inputClass2(errors.workflowName) }),
883
+ errors.workflowName && /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowName })
731
884
  ] }),
732
- /* @__PURE__ */ jsxs5("div", { className: "fc:grid fc:grid-cols-1 md:fc:fc:grid-cols-2 fc:gap-5", children: [
885
+ /* @__PURE__ */ jsxs5("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
733
886
  /* @__PURE__ */ jsxs5("div", { children: [
734
887
  /* @__PURE__ */ jsxs5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
735
888
  "Version ",
736
889
  /* @__PURE__ */ jsx5("span", { className: "fc:text-red-500", children: "*" })
737
890
  ] }),
738
- /* @__PURE__ */ jsx5("input", { type: "text", defaultValue: "1", className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500" }),
739
- /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Workflow version number" })
891
+ /* @__PURE__ */ jsx5("input", { name: "version", type: "text", value: formData.version, onChange: handleChange, className: inputClass2(errors.version) }),
892
+ errors.version && /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.version })
740
893
  ] }),
741
894
  /* @__PURE__ */ jsxs5("div", { children: [
742
895
  /* @__PURE__ */ jsxs5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
743
896
  "Published ",
744
897
  /* @__PURE__ */ jsx5("span", { className: "fc:text-red-500", children: "*" })
745
898
  ] }),
746
- /* @__PURE__ */ jsxs5("select", { className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
899
+ /* @__PURE__ */ jsxs5("select", { name: "published", value: formData.published, onChange: handleChange, className: inputClass2(), children: [
747
900
  /* @__PURE__ */ jsx5("option", { value: "false", children: "No" }),
748
901
  /* @__PURE__ */ jsx5("option", { value: "true", children: "Yes" })
749
902
  ] }),
@@ -754,9 +907,12 @@ function AddWorkflowModal({
754
907
  /* @__PURE__ */ jsxs5("div", { className: "fc:bg-white fc:p-6 fc:rounded-2xl fc:border fc:border-slate-100/80 fc:shadow-sm fc:space-y-3", children: [
755
908
  /* @__PURE__ */ jsxs5("div", { className: "fc:flex fc:justify-between fc:items-center", children: [
756
909
  /* @__PURE__ */ jsx5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700", children: "Description" }),
757
- /* @__PURE__ */ jsx5("span", { className: "fc:text-[10px] fc:text-slate-400", children: "0 / 500" })
910
+ /* @__PURE__ */ jsxs5("span", { className: "fc:text-[10px] fc:text-slate-400", children: [
911
+ formData.description.length,
912
+ " / 500"
913
+ ] })
758
914
  ] }),
759
- /* @__PURE__ */ jsx5("textarea", { rows: 3, placeholder: "Enter workflow description (optional)", className: "fc:w-full fc:p-3 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:resize-none focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500" }),
915
+ /* @__PURE__ */ jsx5("textarea", { name: "description", rows: 3, value: formData.description, onChange: handleChange, placeholder: "Enter workflow description (optional)", className: inputClass2() }),
760
916
  /* @__PURE__ */ jsx5("p", { className: "fc:text-[10px] fc:text-red-400", children: "Provide additional information about this workflow" })
761
917
  ] }),
762
918
  /* @__PURE__ */ jsxs5("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: [
@@ -764,13 +920,13 @@ function AddWorkflowModal({
764
920
  /* @__PURE__ */ jsx5("span", { children: "\u2699\uFE0F" }),
765
921
  /* @__PURE__ */ jsx5("span", { children: "Status & Settings" })
766
922
  ] }),
767
- /* @__PURE__ */ jsxs5("div", { className: "fc:grid fc:grid-cols-1 md:fc:fc:grid-cols-2 fc:gap-5", children: [
923
+ /* @__PURE__ */ jsxs5("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
768
924
  /* @__PURE__ */ jsxs5("div", { children: [
769
925
  /* @__PURE__ */ jsxs5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
770
926
  "Status ",
771
927
  /* @__PURE__ */ jsx5("span", { className: "fc:text-red-500", children: "*" })
772
928
  ] }),
773
- /* @__PURE__ */ jsxs5("select", { className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
929
+ /* @__PURE__ */ jsxs5("select", { name: "status", value: formData.status, onChange: handleChange, className: inputClass2(), children: [
774
930
  /* @__PURE__ */ jsx5("option", { value: "active", children: "Active" }),
775
931
  /* @__PURE__ */ jsx5("option", { value: "inactive", children: "Inactive" })
776
932
  ] }),
@@ -778,7 +934,7 @@ function AddWorkflowModal({
778
934
  ] }),
779
935
  /* @__PURE__ */ jsxs5("div", { children: [
780
936
  /* @__PURE__ */ jsx5("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: "Default Priority" }),
781
- /* @__PURE__ */ jsxs5("select", { className: "fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:fc:outline-none focus:fc:fc:ring-2 focus:fc:fc:ring-indigo-500/10 focus:fc:fc:border-indigo-500", children: [
937
+ /* @__PURE__ */ jsxs5("select", { name: "defaultPriority", value: formData.defaultPriority, onChange: handleChange, className: inputClass2(), children: [
782
938
  /* @__PURE__ */ jsx5("option", { value: "medium", children: "Medium" }),
783
939
  /* @__PURE__ */ jsx5("option", { value: "high", children: "High" }),
784
940
  /* @__PURE__ */ jsx5("option", { value: "low", children: "Low" })
@@ -789,12 +945,14 @@ function AddWorkflowModal({
789
945
  ] })
790
946
  ] }),
791
947
  /* @__PURE__ */ jsxs5("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: [
792
- /* @__PURE__ */ jsx5("button", { onClick: onClose, className: "fc:px-6 fc:py-2.5 fc:border fc:border-slate-200 fc:text-red-500 fc:text-xs fc:font-bold fc:rounded-xl hover:fc:fc:bg-slate-50 fc:transition-all fc:flex fc:items-center fc:gap-1.5", children: "\u2715 Cancel" }),
793
- /* @__PURE__ */ jsx5("button", { type: "button", className: "fc:px-6 fc:py-2.5 fc:bg-indigo-600 hover:fc:fc:bg-indigo-700 fc:text-white fc:text-xs fc:font-bold fc:rounded-xl fc:shadow-md fc:shadow-indigo-500/10 fc:transition-all fc:flex fc:items-center fc:gap-1.5", children: "\u{1F4BE} Save Workflow" })
794
- ] })
948
+ /* @__PURE__ */ jsx5("button", { type: "button", onClick: onClose, disabled: isSubmitting, className: "fc:px-6 fc:py-2.5 fc:border fc:border-slate-200 fc:text-red-500 fc:text-xs fc:font-bold fc:rounded-xl hover:fc:fc:bg-slate-50 fc:transition-all fc:flex fc:items-center fc:gap-1.5", children: "\u2715 Cancel" }),
949
+ /* @__PURE__ */ jsx5("button", { type: "submit", disabled: isSubmitting, className: "fc:px-6 fc:py-2.5 fc:bg-indigo-600 hover:fc:fc:bg-indigo-700 fc:text-white fc:text-xs fc:font-bold fc:rounded-xl fc:shadow-md fc:shadow-indigo-500/10 fc:transition-all fc:flex fc:items-center fc:gap-1.5", children: isSubmitting ? "Saving..." : "\u{1F4BE} Save Workflow" })
950
+ ] }),
951
+ submitError && /* @__PURE__ */ jsx5("div", { className: "fc:px-8 fc:pb-6", children: /* @__PURE__ */ jsx5("p", { className: "fc:text-sm fc:text-red-600", children: submitError }) })
795
952
  ] })
796
953
  ] });
797
954
  }
955
+ var inputClass2 = (error) => `fc:w-full fc:p-2.5 fc:border fc:border-slate-200 fc:rounded-xl fc:text-xs fc:bg-white fc:text-slate-700 focus:fc:outline-none focus:fc:ring-2 focus:fc:ring-indigo-500/10 focus:fc:border-indigo-500 ${error ? "fc:border-red-500" : ""}`;
798
956
 
799
957
  // src/components/Common/commonheader.js
800
958
  import React8 from "react";
@@ -802,10 +960,10 @@ import Link from "next/link";
802
960
  import { FolderKanban, Home, ChevronRight, Plus } from "lucide-react";
803
961
 
804
962
  // src/components/Common/Refresh.js
805
- import React6, { useState as useState3 } from "react";
963
+ import React6, { useState as useState4 } from "react";
806
964
  import { jsx as jsx6 } from "react/jsx-runtime";
807
965
  var Refresh = ({ onRefresh }) => {
808
- const [isSpinning, setIsSpinning] = useState3(false);
966
+ const [isSpinning, setIsSpinning] = useState4(false);
809
967
  const handleClick = () => {
810
968
  setIsSpinning(true);
811
969
  if (onRefresh) {
@@ -846,14 +1004,14 @@ var Refresh = ({ onRefresh }) => {
846
1004
  var Refresh_default = Refresh;
847
1005
 
848
1006
  // src/components/Common/Download.js
849
- import React7, { useState as useState4, useRef, useEffect as useEffect2 } from "react";
1007
+ import React7, { useState as useState5, useRef, useEffect as useEffect4 } from "react";
850
1008
  import html2canvas from "html2canvas";
851
1009
  import { jsPDF } from "jspdf";
852
1010
  import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
853
1011
  var Download = ({ targetRef, fileName = "download" }) => {
854
- const [isOpen, setIsOpen] = useState4(false);
1012
+ const [isOpen, setIsOpen] = useState5(false);
855
1013
  const dropdownRef = useRef(null);
856
- useEffect2(() => {
1014
+ useEffect4(() => {
857
1015
  const handleClickOutside = (event) => {
858
1016
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
859
1017
  setIsOpen(false);
@@ -998,13 +1156,15 @@ function CommonHeader({
998
1156
  // src/components/workflow/WorkflowMain.jsx
999
1157
  import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
1000
1158
  function Workflow() {
1001
- const [refreshKey, setRefreshKey] = useState5(0);
1002
- const [modalOpen, setModalOpen] = useState5(false);
1003
- const [pageSize, setPageSize] = useState5(10);
1004
- const [searchQuery, setSearchQuery] = useState5("");
1005
- const [apiData, setApiData] = useState5([]);
1006
- const [workflowTypes, setWorkflowTypes] = useState5([]);
1007
- useEffect3(() => {
1159
+ const [refreshKey, setRefreshKey] = useState6(0);
1160
+ const [modalOpen, setModalOpen] = useState6(false);
1161
+ const [pageSize, setPageSize] = useState6(10);
1162
+ const [searchQuery, setSearchQuery] = useState6("");
1163
+ const [apiData, setApiData] = useState6([]);
1164
+ const [workflowTypes, setWorkflowTypes] = useState6([]);
1165
+ const [editModalOpen, setEditModalOpen] = useState6(false);
1166
+ const [selectedWorkflow, setSelectedWorkflow] = useState6(null);
1167
+ useEffect5(() => {
1008
1168
  (async () => {
1009
1169
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1010
1170
  try {
@@ -1018,11 +1178,11 @@ function Workflow() {
1018
1178
  const typeRows = Array.isArray(typeValue) ? typeValue : (typeValue == null ? void 0 : typeValue.items) || (typeValue == null ? void 0 : typeValue.records) || [];
1019
1179
  setWorkflowTypes(typeRows);
1020
1180
  setApiData(rows.map((item) => {
1021
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
1022
- return __spreadProps(__spreadValues({}, item), { id: (_b2 = (_a2 = item.id) != null ? _a2 : item.workflowId) != null ? _b2 : item.WorkflowId, name: (_d2 = (_c2 = item.name) != null ? _c2 : item.workflowName) != null ? _d2 : item.WorkflowName, code: (_f2 = (_e2 = item.code) != null ? _e2 : item.workflowCode) != null ? _f2 : item.WorkflowCode, type: (_h2 = (_g2 = item.type) != null ? _g2 : item.workflowTypeName) != null ? _h2 : item.WorkflowTypeName, status: (_j2 = (_i2 = item.status) != null ? _i2 : item.isActive) != null ? _j2 : item.IsActive });
1181
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q, _r, _s, _t, _u;
1182
+ return __spreadProps(__spreadValues({}, item), { id: (_b2 = (_a2 = item.id) != null ? _a2 : item.workflowId) != null ? _b2 : item.WorkflowId, workflowId: (_d2 = (_c2 = item.workflowId) != null ? _c2 : item.WorkflowId) != null ? _d2 : item.id, name: (_f2 = (_e2 = item.name) != null ? _e2 : item.workflowName) != null ? _f2 : item.WorkflowName, code: (_h2 = (_g2 = item.code) != null ? _g2 : item.workflowCode) != null ? _h2 : item.WorkflowCode, type: (_j2 = (_i2 = item.type) != null ? _i2 : item.workflowTypeName) != null ? _j2 : item.WorkflowTypeName, workflowTypeId: (_l2 = (_k2 = item.workflowTypeId) != null ? _k2 : item.WorkflowTypeId) != null ? _l2 : item.workflowTypeId, version: (_o = (_n = (_m = item.version) != null ? _m : item.workflowVersion) != null ? _n : item.WorkflowVersion) != null ? _o : item.version, published: (_r = (_q = (_p = item.published) != null ? _p : item.isPublished) != null ? _q : item.IsPublished) != null ? _r : false, status: (_u = (_t = (_s = item.status) != null ? _s : item.isActive) != null ? _t : item.IsActive) != null ? _u : false });
1023
1183
  }));
1024
1184
  } catch (error) {
1025
- await Swal.fire("Error", ((_l = (_k = error == null ? void 0 : error.response) == null ? void 0 : _k.data) == null ? void 0 : _l.message) || (error == null ? void 0 : error.message) || "Unable to load workflows.", "error");
1185
+ await Swal3.fire("Error", ((_l = (_k = error == null ? void 0 : error.response) == null ? void 0 : _k.data) == null ? void 0 : _l.message) || (error == null ? void 0 : error.message) || "Unable to load workflows.", "error");
1026
1186
  }
1027
1187
  })();
1028
1188
  }, [refreshKey]);
@@ -1031,6 +1191,71 @@ function Workflow() {
1031
1191
  console.log("Table data refreshed!");
1032
1192
  setRefreshKey((prev) => prev + 1);
1033
1193
  };
1194
+ const handleCreateApi = async (workflowPayload) => {
1195
+ var _a, _b, _c, _d, _e;
1196
+ try {
1197
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflow) == null ? void 0 : _c.create;
1198
+ if (!endpoint) throw new Error("Workflow create endpoint is not configured.");
1199
+ await getApiService().post(endpoint, workflowPayload);
1200
+ await Swal3.fire("Success", "Workflow created successfully.", "success");
1201
+ handleRefresh();
1202
+ return true;
1203
+ } catch (error) {
1204
+ await Swal3.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create workflow.", "error");
1205
+ return false;
1206
+ }
1207
+ };
1208
+ const handleUpdateApi = async (workflowPayload) => {
1209
+ var _a, _b, _c, _d, _e;
1210
+ try {
1211
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflow) == null ? void 0 : _c.update;
1212
+ if (!endpoint) throw new Error("Workflow update endpoint is not configured.");
1213
+ await getApiService().put(endpoint, workflowPayload);
1214
+ await Swal3.fire("Success", "Workflow updated successfully.", "success");
1215
+ handleRefresh();
1216
+ return true;
1217
+ } catch (error) {
1218
+ await Swal3.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update workflow.", "error");
1219
+ return false;
1220
+ }
1221
+ };
1222
+ const handleDeleteApi = async (workflow) => {
1223
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1224
+ try {
1225
+ const endpoints = getApiEndpoints();
1226
+ const deleteEndpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflow) == null ? void 0 : _b.delete;
1227
+ const updateEndpoint = (_d = (_c = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _c.workflow) == null ? void 0 : _d.update;
1228
+ const workflowId = (_f = (_e = workflow.workflowId) != null ? _e : workflow.WorkflowId) != null ? _f : workflow.id;
1229
+ if (deleteEndpoint) {
1230
+ try {
1231
+ await getApiService().delete(`${deleteEndpoint}/${workflowId}`);
1232
+ } catch (e) {
1233
+ await getApiService().delete(deleteEndpoint, { data: { workflowId } });
1234
+ }
1235
+ } else if (updateEndpoint) {
1236
+ await getApiService().put(updateEndpoint, __spreadProps(__spreadValues({}, workflow), { workflowId, isActive: false, updatedBy: workflow.updatedBy || workflow.createdBy || "System" }));
1237
+ } else {
1238
+ throw new Error("Workflow delete endpoint is not configured.");
1239
+ }
1240
+ await Swal3.fire("Success", "Workflow deleted successfully.", "success");
1241
+ handleRefresh();
1242
+ return true;
1243
+ } catch (error) {
1244
+ await Swal3.fire("Error", ((_h = (_g = error == null ? void 0 : error.response) == null ? void 0 : _g.data) == null ? void 0 : _h.message) || (error == null ? void 0 : error.message) || "Unable to delete workflow.", "error");
1245
+ return false;
1246
+ }
1247
+ };
1248
+ const handleEdit = (workflow) => {
1249
+ setSelectedWorkflow(workflow);
1250
+ setEditModalOpen(true);
1251
+ };
1252
+ const handleCloseEdit = () => {
1253
+ setEditModalOpen(false);
1254
+ setSelectedWorkflow(null);
1255
+ };
1256
+ const handleCloseAdd = () => {
1257
+ setModalOpen(false);
1258
+ };
1034
1259
  return /* @__PURE__ */ jsxs8("div", { className: "fc:h-screen fc:bg-slate-50 fc:p-6 fc:flex fc:flex-col", children: [
1035
1260
  /* @__PURE__ */ jsxs8("div", { className: "fc:flex fc:flex-col fc:flex-1 fc:gap-5 fc:overflow-hidden", children: [
1036
1261
  /* @__PURE__ */ jsx9(
@@ -1093,7 +1318,9 @@ function Workflow() {
1093
1318
  {
1094
1319
  apiData,
1095
1320
  pageSize,
1096
- searchQuery
1321
+ searchQuery,
1322
+ onEdit: handleEdit,
1323
+ onDeleteApi: handleDeleteApi
1097
1324
  },
1098
1325
  refreshKey
1099
1326
  ) }) })
@@ -1103,16 +1330,27 @@ function Workflow() {
1103
1330
  AddWorkflowModal,
1104
1331
  {
1105
1332
  isOpen: modalOpen,
1106
- onClose: () => setModalOpen(false),
1107
- workflowTypes
1333
+ onClose: handleCloseAdd,
1334
+ workflowTypes,
1335
+ onSave: handleCreateApi
1336
+ }
1337
+ ),
1338
+ /* @__PURE__ */ jsx9(
1339
+ EditWorkflowModal,
1340
+ {
1341
+ isOpen: editModalOpen,
1342
+ onClose: handleCloseEdit,
1343
+ workflowTypes,
1344
+ editData: selectedWorkflow,
1345
+ onSave: handleUpdateApi
1108
1346
  }
1109
1347
  )
1110
1348
  ] });
1111
1349
  }
1112
1350
 
1113
1351
  // src/components/workflow-type/WorkflowTypeMains.js
1114
- import React15, { useState as useState9, useRef as useRef3, useEffect as useEffect6 } from "react";
1115
- import Swal3 from "sweetalert2";
1352
+ import React15, { useState as useState10, useRef as useRef3, useEffect as useEffect8 } from "react";
1353
+ import Swal5 from "sweetalert2";
1116
1354
 
1117
1355
  // src/components/workflow-type/SearchBar.jsx
1118
1356
  import React10 from "react";
@@ -1139,7 +1377,7 @@ function SearchBar2({
1139
1377
  }
1140
1378
 
1141
1379
  // src/components/workflow-type/WorkflowTypeTable.jsx
1142
- import React13, { useState as useState7, useEffect as useEffect5 } from "react";
1380
+ import React13, { useState as useState8, useEffect as useEffect7 } from "react";
1143
1381
 
1144
1382
  // src/components/workflow-type/DeleteWorkflowType.jsx
1145
1383
  import React11 from "react";
@@ -1179,7 +1417,7 @@ var DeleteWorkflowType = ({
1179
1417
  var DeleteWorkflowType_default = DeleteWorkflowType;
1180
1418
 
1181
1419
  // src/components/workflow-type/EditWorkflowType.jsx
1182
- import React12, { useState as useState6, useEffect as useEffect4 } from "react";
1420
+ import React12, { useState as useState7, useEffect as useEffect6 } from "react";
1183
1421
  import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
1184
1422
  var EditWorkflowType = ({
1185
1423
  isOpen,
@@ -1187,13 +1425,13 @@ var EditWorkflowType = ({
1187
1425
  onSave,
1188
1426
  selectedData
1189
1427
  }) => {
1190
- const [formData, setFormData] = useState6({
1428
+ const [formData, setFormData] = useState7({
1191
1429
  workflowTypeCode: "",
1192
1430
  workflowTypeName: "",
1193
1431
  description: "",
1194
1432
  isActive: true
1195
1433
  });
1196
- useEffect4(() => {
1434
+ useEffect6(() => {
1197
1435
  var _a, _b;
1198
1436
  if (selectedData) {
1199
1437
  setFormData({
@@ -1516,15 +1754,15 @@ function WorkflowTypeTable({
1516
1754
  updatedOn: "2026-01-29",
1517
1755
  updatedBy: "Officer"
1518
1756
  }];
1519
- const [data, setData] = useState7(apiData || initialData);
1520
- useEffect5(() => {
1757
+ const [data, setData] = useState8(apiData || initialData);
1758
+ useEffect7(() => {
1521
1759
  if (apiData) setData(apiData);
1522
1760
  }, [apiData]);
1523
- const [sortOrder, setSortOrder] = useState7("asc");
1524
- const [sortKey, setSortKey] = useState7("workflowTypeId");
1525
- const [selectedItem, setSelectedItem] = useState7(null);
1526
- const [isEditOpen, setIsEditOpen] = useState7(false);
1527
- const [isDeleteOpen, setIsDeleteOpen] = useState7(false);
1761
+ const [sortOrder, setSortOrder] = useState8("asc");
1762
+ const [sortKey, setSortKey] = useState8("workflowTypeId");
1763
+ const [selectedItem, setSelectedItem] = useState8(null);
1764
+ const [isEditOpen, setIsEditOpen] = useState8(false);
1765
+ const [isDeleteOpen, setIsDeleteOpen] = useState8(false);
1528
1766
  const handleSort = (columnKey) => {
1529
1767
  const isAsc = sortKey === columnKey && sortOrder === "asc";
1530
1768
  setSortOrder(isAsc ? "desc" : "asc");
@@ -1540,7 +1778,7 @@ function WorkflowTypeTable({
1540
1778
  const query = (searchQuery || "").toLowerCase();
1541
1779
  return item.workflowTypeName.toLowerCase().includes(query) || item.workflowTypeCode.toLowerCase().includes(query) || item.description.toLowerCase().includes(query);
1542
1780
  });
1543
- useEffect5(() => {
1781
+ useEffect7(() => {
1544
1782
  if (setTotalEntries) setTotalEntries(filteredData.length);
1545
1783
  }, [filteredData.length, setTotalEntries]);
1546
1784
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -1626,8 +1864,8 @@ function WorkflowTypeTable({
1626
1864
  }
1627
1865
 
1628
1866
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1629
- import React14, { useState as useState8 } from "react";
1630
- import Swal2 from "sweetalert2";
1867
+ import React14, { useState as useState9 } from "react";
1868
+ import Swal4 from "sweetalert2";
1631
1869
  import { jsx as jsx14, jsxs as jsxs13 } from "react/jsx-runtime";
1632
1870
  var initialFormData = {
1633
1871
  workflowTypeCode: "",
@@ -1636,12 +1874,12 @@ var initialFormData = {
1636
1874
  createdBy: ""
1637
1875
  };
1638
1876
  var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1639
- const [formData, setFormData] = useState8(__spreadProps(__spreadValues({}, initialFormData), {
1877
+ const [formData, setFormData] = useState9(__spreadProps(__spreadValues({}, initialFormData), {
1640
1878
  createdBy
1641
1879
  }));
1642
- const [errors, setErrors] = useState8({});
1643
- const [isSubmitting, setIsSubmitting] = useState8(false);
1644
- const [submitError, setSubmitError] = useState8("");
1880
+ const [errors, setErrors] = useState9({});
1881
+ const [isSubmitting, setIsSubmitting] = useState9(false);
1882
+ const [submitError, setSubmitError] = useState9("");
1645
1883
  const handleChange = ({ target: { name, value } }) => {
1646
1884
  if (name === "description" && value.length > 500) return;
1647
1885
  setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [name]: value }));
@@ -1683,7 +1921,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1683
1921
  } catch (error) {
1684
1922
  const message = ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to create workflow type. Please try again.";
1685
1923
  setSubmitError(message);
1686
- await Swal2.fire("Error", message, "error");
1924
+ await Swal4.fire("Error", message, "error");
1687
1925
  } finally {
1688
1926
  setIsSubmitting(false);
1689
1927
  }
@@ -1699,10 +1937,10 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1699
1937
  ] }),
1700
1938
  /* @__PURE__ */ jsxs13("form", { onSubmit: handleSubmit, className: "fc:space-y-4 fc:p-6", children: [
1701
1939
  /* @__PURE__ */ jsxs13("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: [
1702
- /* @__PURE__ */ jsx14(FormField, { label: "Workflow Type Code", required: true, error: errors.workflowTypeCode, children: /* @__PURE__ */ jsx14("input", { name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, placeholder: "e.g. PETITION", className: inputClass(errors.workflowTypeCode) }) }),
1703
- /* @__PURE__ */ jsx14(FormField, { label: "Workflow Type Name", required: true, error: errors.workflowTypeName, children: /* @__PURE__ */ jsx14("input", { name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, placeholder: "Enter workflow type name", className: inputClass(errors.workflowTypeName) }) })
1940
+ /* @__PURE__ */ jsx14(FormField, { label: "Workflow Type Code", required: true, error: errors.workflowTypeCode, children: /* @__PURE__ */ jsx14("input", { name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, placeholder: "e.g. PETITION", className: inputClass3(errors.workflowTypeCode) }) }),
1941
+ /* @__PURE__ */ jsx14(FormField, { label: "Workflow Type Name", required: true, error: errors.workflowTypeName, children: /* @__PURE__ */ jsx14("input", { name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, placeholder: "Enter workflow type name", className: inputClass3(errors.workflowTypeName) }) })
1704
1942
  ] }),
1705
- /* @__PURE__ */ jsx14(FormField, { label: "Created By", required: true, error: errors.createdBy, children: /* @__PURE__ */ jsx14("input", { name: "createdBy", value: formData.createdBy, onChange: handleChange, placeholder: "Enter user name or ID", className: inputClass(errors.createdBy) }) }),
1943
+ /* @__PURE__ */ jsx14(FormField, { label: "Created By", required: true, error: errors.createdBy, children: /* @__PURE__ */ jsx14("input", { name: "createdBy", value: formData.createdBy, onChange: handleChange, placeholder: "Enter user name or ID", className: inputClass3(errors.createdBy) }) }),
1706
1944
  /* @__PURE__ */ jsx14(FormField, { label: "Description", children: /* @__PURE__ */ jsxs13("div", { className: "fc:relative", children: [
1707
1945
  /* @__PURE__ */ jsx14("textarea", { name: "description", rows: "3", value: formData.description, onChange: handleChange, placeholder: "Enter description", className: "fc:w-full fc:resize-none fc:rounded-xl fc:border fc:border-slate-200 fc:p-3 fc:text-sm fc:text-slate-700 fc:outline-none focus:fc:border-indigo-500" }),
1708
1946
  /* @__PURE__ */ jsxs13("span", { className: "fc:absolute fc:bottom-2 fc:right-3 fc:text-xs fc:text-gray-400", children: [
@@ -1718,7 +1956,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1718
1956
  ] })
1719
1957
  ] }) });
1720
1958
  };
1721
- var inputClass = (hasError) => `fc:w-full fc:rounded-xl fc:border fc:bg-white fc:p-3 fc:text-sm fc:text-slate-700 fc:outline-none focus:fc:border-indigo-500 ${hasError ? "fc:border-red-500" : "fc:border-slate-200"}`;
1959
+ var inputClass3 = (hasError) => `fc:w-full fc:rounded-xl fc:border fc:bg-white fc:p-3 fc:text-sm fc:text-slate-700 fc:outline-none focus:fc:border-indigo-500 ${hasError ? "fc:border-red-500" : "fc:border-slate-200"}`;
1722
1960
  var FormField = ({ label, required, error, children }) => /* @__PURE__ */ jsxs13("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700", children: [
1723
1961
  label,
1724
1962
  " ",
@@ -1731,7 +1969,7 @@ var AddWorkflowTypeModal_default = AddWorkflowTypeModal;
1731
1969
  // src/components/workflow-type/WorkflowTypeMains.js
1732
1970
  import { jsx as jsx15, jsxs as jsxs14 } from "react/jsx-runtime";
1733
1971
  function WorkflowTypeMains() {
1734
- const [refreshkey, setRefreshKey] = useState9(0);
1972
+ const [refreshkey, setRefreshKey] = useState10(0);
1735
1973
  const handleRefresh = () => {
1736
1974
  console.log("Table data refreshed!");
1737
1975
  setRefreshKey((prev) => prev + 1);
@@ -1742,11 +1980,11 @@ function WorkflowTypeMains() {
1742
1980
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowType) == null ? void 0 : _c.update;
1743
1981
  if (!endpoint) throw new Error("Workflow type update endpoint is not configured.");
1744
1982
  await getApiService().put(endpoint, { workflowTypeId: item.workflowTypeId, workflowTypeCode: item.workflowTypeCode.trim().toUpperCase(), workflowTypeName: item.workflowTypeName.trim(), description: (item.description || "").trim(), isActive: Boolean(item.isActive), updatedBy: item.updatedBy || item.createdBy || "System" });
1745
- await Swal3.fire("Success", "Workflow type updated successfully.", "success");
1983
+ await Swal5.fire("Success", "Workflow type updated successfully.", "success");
1746
1984
  handleRefresh();
1747
1985
  return true;
1748
1986
  } catch (error) {
1749
- await Swal3.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update workflow type.", "error");
1987
+ await Swal5.fire("Error", ((_e = (_d = error == null ? void 0 : error.response) == null ? void 0 : _d.data) == null ? void 0 : _e.message) || (error == null ? void 0 : error.message) || "Unable to update workflow type.", "error");
1750
1988
  return false;
1751
1989
  }
1752
1990
  };
@@ -1754,16 +1992,16 @@ function WorkflowTypeMains() {
1754
1992
  return handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
1755
1993
  };
1756
1994
  const tableRef = useRef3(null);
1757
- const [modalOpen, setModalOpen] = useState9(false);
1758
- const [pageSize, setPageSize] = useState9(10);
1759
- const [searchQuery, setSearchQuery] = useState9("");
1760
- const [currentPage, setCurrentPage] = useState9(1);
1761
- const [totalEntries, setTotalEntries] = useState9(0);
1762
- const [isEditOpen, setIsEditOpen] = useState9(false);
1763
- const [isDeleteOpen, setIsDeleteOpen] = useState9(false);
1764
- const [selectedItem, setSelectedItem] = useState9(null);
1765
- const [apiData, setApiData] = useState9([]);
1766
- useEffect6(() => {
1995
+ const [modalOpen, setModalOpen] = useState10(false);
1996
+ const [pageSize, setPageSize] = useState10(10);
1997
+ const [searchQuery, setSearchQuery] = useState10("");
1998
+ const [currentPage, setCurrentPage] = useState10(1);
1999
+ const [totalEntries, setTotalEntries] = useState10(0);
2000
+ const [isEditOpen, setIsEditOpen] = useState10(false);
2001
+ const [isDeleteOpen, setIsDeleteOpen] = useState10(false);
2002
+ const [selectedItem, setSelectedItem] = useState10(null);
2003
+ const [apiData, setApiData] = useState10([]);
2004
+ useEffect8(() => {
1767
2005
  (async () => {
1768
2006
  var _a, _b, _c, _d, _e, _f, _g;
1769
2007
  try {
@@ -1773,7 +2011,7 @@ function WorkflowTypeMains() {
1773
2011
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
1774
2012
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
1775
2013
  } catch (error) {
1776
- await Swal3.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load workflow types.", "error");
2014
+ await Swal5.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load workflow types.", "error");
1777
2015
  }
1778
2016
  })();
1779
2017
  }, [refreshkey]);
@@ -1826,7 +2064,7 @@ function WorkflowTypeMains() {
1826
2064
  ] })
1827
2065
  ] }) }),
1828
2066
  /* @__PURE__ */ jsx15(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false), onSave: async () => {
1829
- await Swal3.fire("Success", "Workflow type created successfully.", "success");
2067
+ await Swal5.fire("Success", "Workflow type created successfully.", "success");
1830
2068
  handleRefresh();
1831
2069
  } }),
1832
2070
  /* @__PURE__ */ jsx15(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), onSave: handleUpdateApi, selectedData: selectedItem }),
@@ -1835,7 +2073,7 @@ function WorkflowTypeMains() {
1835
2073
  }
1836
2074
 
1837
2075
  // src/components/WorkflowStep/main.js
1838
- import React18, { useState as useState11, useRef as useRef4 } from "react";
2076
+ import React18, { useState as useState12, useRef as useRef4 } from "react";
1839
2077
 
1840
2078
  // src/components/Common/footer.js
1841
2079
  import React16 from "react";
@@ -1858,10 +2096,10 @@ function Footer() {
1858
2096
  import Link2 from "next/link";
1859
2097
 
1860
2098
  // src/components/WorkflowStep/AddWorkflowStepModal.js
1861
- import React17, { useState as useState10 } from "react";
2099
+ import React17, { useState as useState11 } from "react";
1862
2100
  import { jsx as jsx17, jsxs as jsxs16 } from "react/jsx-runtime";
1863
2101
  function AddWorkflowStepModal({ onClose }) {
1864
- const [formData, setFormData] = useState10({
2102
+ const [formData, setFormData] = useState11({
1865
2103
  workflow: "",
1866
2104
  stepCode: "",
1867
2105
  stepName: "",
@@ -1874,7 +2112,7 @@ function AddWorkflowStepModal({ onClose }) {
1874
2112
  excludeHolidays: true,
1875
2113
  status: "active"
1876
2114
  });
1877
- const [errors, setErrors] = useState10({});
2115
+ const [errors, setErrors] = useState11({});
1878
2116
  const handleChange = (field, value) => {
1879
2117
  setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [field]: value }));
1880
2118
  if (errors[field]) {
@@ -2221,7 +2459,7 @@ function AddWorkflowStepModal({ onClose }) {
2221
2459
  }
2222
2460
 
2223
2461
  // src/components/WorkflowStep/main.js
2224
- import { Fragment as Fragment3, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2462
+ import { Fragment as Fragment4, jsx as jsx18, jsxs as jsxs17 } from "react/jsx-runtime";
2225
2463
  var workflowSteps = [{
2226
2464
  workflowStepId: 1,
2227
2465
  workflowId: 1,
@@ -2351,9 +2589,9 @@ function WorkflowStep() {
2351
2589
  console.log("Download clicked");
2352
2590
  };
2353
2591
  const tableRef = useRef4(null);
2354
- const [showModal, setShowModal] = useState11(false);
2355
- const [pageSize, setPageSize] = useState11(5);
2356
- const [sortConfig, setSortConfig] = useState11({
2592
+ const [showModal, setShowModal] = useState12(false);
2593
+ const [pageSize, setPageSize] = useState12(5);
2594
+ const [sortConfig, setSortConfig] = useState12({
2357
2595
  key: "",
2358
2596
  direction: "asc"
2359
2597
  });
@@ -2367,7 +2605,7 @@ function WorkflowStep() {
2367
2605
  direction
2368
2606
  });
2369
2607
  };
2370
- return /* @__PURE__ */ jsxs17(Fragment3, { children: [
2608
+ return /* @__PURE__ */ jsxs17(Fragment4, { children: [
2371
2609
  /* @__PURE__ */ jsxs17("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
2372
2610
  /* @__PURE__ */ jsx18(CommonHeader, { title: "Workflow Step", breadcrumbs: [{
2373
2611
  label: "Dashboard",
@@ -2455,14 +2693,14 @@ function WorkflowStep() {
2455
2693
  }
2456
2694
 
2457
2695
  // src/components/WorkFlowTransition/Transitiontable.js
2458
- import React20, { useState as useState13, useRef as useRef5 } from "react";
2696
+ import React20, { useState as useState14, useRef as useRef5 } from "react";
2459
2697
  import Link3 from "next/link";
2460
2698
 
2461
2699
  // src/components/WorkFlowTransition/AddWorkFlowTransitionModal.js
2462
- import React19, { useState as useState12 } from "react";
2700
+ import React19, { useState as useState13 } from "react";
2463
2701
  import { jsx as jsx19, jsxs as jsxs18 } from "react/jsx-runtime";
2464
2702
  function AddWorkTransitionStepModal({ onClose, onSubmit }) {
2465
- const [formData, setFormData] = useState12({
2703
+ const [formData, setFormData] = useState13({
2466
2704
  workflow: "",
2467
2705
  fromStep: "",
2468
2706
  toStep: "",
@@ -2473,7 +2711,7 @@ function AddWorkTransitionStepModal({ onClose, onSubmit }) {
2473
2711
  requireComment: false,
2474
2712
  status: "active"
2475
2713
  });
2476
- const [errors, setErrors] = useState12({});
2714
+ const [errors, setErrors] = useState13({});
2477
2715
  const validateForm = () => {
2478
2716
  const newErrors = {};
2479
2717
  if (!formData.workflow) newErrors.workflow = "Workflow is required.";
@@ -2825,7 +3063,7 @@ function AddWorkTransitionStepModal({ onClose, onSubmit }) {
2825
3063
  }
2826
3064
 
2827
3065
  // src/components/WorkFlowTransition/Transitiontable.js
2828
- import { Fragment as Fragment4, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
3066
+ import { Fragment as Fragment5, jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
2829
3067
  var WorkflowTransition = [{
2830
3068
  TransitionId: 1,
2831
3069
  workflowId: 1,
@@ -2905,9 +3143,9 @@ function WorkFlowTransition() {
2905
3143
  console.log("Download clicked");
2906
3144
  };
2907
3145
  const tableRef = useRef5(null);
2908
- const [showModal, setShowModal] = useState13(false);
2909
- const [pageSize, setPageSize] = useState13(5);
2910
- const [sortConfig, setSortConfig] = useState13({
3146
+ const [showModal, setShowModal] = useState14(false);
3147
+ const [pageSize, setPageSize] = useState14(5);
3148
+ const [sortConfig, setSortConfig] = useState14({
2911
3149
  key: "",
2912
3150
  direction: "asc"
2913
3151
  });
@@ -2921,7 +3159,7 @@ function WorkFlowTransition() {
2921
3159
  direction
2922
3160
  });
2923
3161
  };
2924
- return /* @__PURE__ */ jsxs19(Fragment4, { children: [
3162
+ return /* @__PURE__ */ jsxs19(Fragment5, { children: [
2925
3163
  /* @__PURE__ */ jsxs19("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
2926
3164
  /* @__PURE__ */ jsx20(CommonHeader, { title: "WorkFlow Transition", breadcrumbs: [{
2927
3165
  label: "Dashboard",
@@ -2996,7 +3234,7 @@ function WorkFlowTransition() {
2996
3234
  }
2997
3235
 
2998
3236
  // src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
2999
- import React26, { useState as useState16, useRef as useRef6 } from "react";
3237
+ import React26, { useState as useState17, useRef as useRef6 } from "react";
3000
3238
 
3001
3239
  // src/components/user-hierarchy-node-mapping/adduserhierarchynode.jsx
3002
3240
  import React21 from "react";
@@ -3129,10 +3367,10 @@ function MappingSearchBar({
3129
3367
  }
3130
3368
 
3131
3369
  // src/components/user-hierarchy-node-mapping/userhierarchynodetable.jsx
3132
- import React25, { useState as useState15, useEffect as useEffect8 } from "react";
3370
+ import React25, { useState as useState16, useEffect as useEffect10 } from "react";
3133
3371
 
3134
3372
  // src/components/user-hierarchy-node-mapping/edit-mapping.jsx
3135
- import React23, { useEffect as useEffect7, useState as useState14 } from "react";
3373
+ import React23, { useEffect as useEffect9, useState as useState15 } from "react";
3136
3374
  import { jsx as jsx23, jsxs as jsxs22 } from "react/jsx-runtime";
3137
3375
  function EditUserHierarchyNodeMappingModal({
3138
3376
  isOpen,
@@ -3140,14 +3378,14 @@ function EditUserHierarchyNodeMappingModal({
3140
3378
  selectedMapping,
3141
3379
  onSave
3142
3380
  }) {
3143
- const [formData, setFormData] = useState14({
3381
+ const [formData, setFormData] = useState15({
3144
3382
  hierarchyNodeId: "",
3145
3383
  roleCode: "",
3146
3384
  isPrimary: "",
3147
3385
  effectiveFrom: "",
3148
3386
  effectiveTo: ""
3149
3387
  });
3150
- useEffect7(() => {
3388
+ useEffect9(() => {
3151
3389
  if (selectedMapping) {
3152
3390
  setFormData({
3153
3391
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
@@ -3633,9 +3871,9 @@ function UserHierarchyNodeMappingTable({
3633
3871
  effectiveTo: "",
3634
3872
  status: true
3635
3873
  }];
3636
- const [data, setData] = useState15(initialData);
3637
- const [sortOrder, setSortOrder] = useState15("asc");
3638
- const [sortKey, setSortKey] = useState15("mappingId");
3874
+ const [data, setData] = useState16(initialData);
3875
+ const [sortOrder, setSortOrder] = useState16("asc");
3876
+ const [sortKey, setSortKey] = useState16("mappingId");
3639
3877
  const handleSort = (columnKey) => {
3640
3878
  const isAsc = sortKey === columnKey && sortOrder === "asc";
3641
3879
  setSortOrder(isAsc ? "desc" : "asc");
@@ -3651,7 +3889,7 @@ function UserHierarchyNodeMappingTable({
3651
3889
  const query = (searchQuery || "").toLowerCase();
3652
3890
  return String(item.mappingId).toLowerCase().includes(query) || String(item.externalUserId).toLowerCase().includes(query) || String(item.hierarchyNodeId).toLowerCase().includes(query) || item.roleCode.toLowerCase().includes(query);
3653
3891
  });
3654
- useEffect8(() => {
3892
+ useEffect10(() => {
3655
3893
  if (setTotalEntries) setTotalEntries(filteredData.length);
3656
3894
  }, [filteredData.length, setTotalEntries]);
3657
3895
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -3660,9 +3898,9 @@ function UserHierarchyNodeMappingTable({
3660
3898
  const pageNumbers = Array.from({
3661
3899
  length: totalPages
3662
3900
  }, (_, i) => i + 1);
3663
- const [showEditPopup, setShowEditPopup] = useState15(false);
3664
- const [showDeletePopup, setShowDeletePopup] = useState15(false);
3665
- const [selectedItem, setSelectedItem] = useState15(null);
3901
+ const [showEditPopup, setShowEditPopup] = useState16(false);
3902
+ const [showDeletePopup, setShowDeletePopup] = useState16(false);
3903
+ const [selectedItem, setSelectedItem] = useState16(null);
3666
3904
  const openEditPopup = (item) => {
3667
3905
  setSelectedItem(item);
3668
3906
  setShowEditPopup(true);
@@ -3772,17 +4010,17 @@ function UserHierarchyNodeMappingTable({
3772
4010
  // src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
3773
4011
  import { jsx as jsx26, jsxs as jsxs25 } from "react/jsx-runtime";
3774
4012
  function User_hierarchy_mapping_main() {
3775
- const [refreshkey, setRefreshKey] = useState16(0);
4013
+ const [refreshkey, setRefreshKey] = useState17(0);
3776
4014
  const handleRefresh = () => {
3777
4015
  console.log("Table data refreshed!");
3778
4016
  setRefreshKey((prev) => prev + 1);
3779
4017
  };
3780
4018
  const tableRef = useRef6(null);
3781
- const [modalOpen, setModalOpen] = useState16(false);
3782
- const [pageSize, setPageSize] = useState16(10);
3783
- const [searchQuery, setSearchQuery] = useState16("");
3784
- const [currentPage, setCurrentPage] = useState16(1);
3785
- const [totalEntries, setTotalEntries] = useState16(0);
4019
+ const [modalOpen, setModalOpen] = useState17(false);
4020
+ const [pageSize, setPageSize] = useState17(10);
4021
+ const [searchQuery, setSearchQuery] = useState17("");
4022
+ const [currentPage, setCurrentPage] = useState17(1);
4023
+ const [totalEntries, setTotalEntries] = useState17(0);
3786
4024
  const handlePageSizeChange = (e) => {
3787
4025
  setPageSize(Number(e.target.value));
3788
4026
  setCurrentPage(1);
@@ -3824,7 +4062,7 @@ function User_hierarchy_mapping_main() {
3824
4062
  }
3825
4063
 
3826
4064
  // src/components/document-configuration/DocumentConfigurationmain.jsx
3827
- import React32, { useState as useState20, useRef as useRef7 } from "react";
4065
+ import React32, { useState as useState21, useRef as useRef7 } from "react";
3828
4066
 
3829
4067
  // src/components/document-configuration/SearchBar.jsx
3830
4068
  import React27 from "react";
@@ -3844,10 +4082,10 @@ function SearchBar3({
3844
4082
  }
3845
4083
 
3846
4084
  // src/components/document-configuration/DocumentConfigurationTable.jsx
3847
- import React30, { useState as useState18, useEffect as useEffect10 } from "react";
4085
+ import React30, { useState as useState19, useEffect as useEffect12 } from "react";
3848
4086
 
3849
4087
  // src/components/document-configuration/Edit.jsx
3850
- import React28, { useState as useState17, useEffect as useEffect9 } from "react";
4088
+ import React28, { useState as useState18, useEffect as useEffect11 } from "react";
3851
4089
  import { jsx as jsx28, jsxs as jsxs27 } from "react/jsx-runtime";
3852
4090
  function EditDocumentConfiguration({
3853
4091
  isOpen,
@@ -3855,7 +4093,7 @@ function EditDocumentConfiguration({
3855
4093
  initialData,
3856
4094
  onSave
3857
4095
  }) {
3858
- const [formData, setFormData] = useState17({
4096
+ const [formData, setFormData] = useState18({
3859
4097
  docName: "",
3860
4098
  stepId: "",
3861
4099
  extensions: "",
@@ -3864,8 +4102,8 @@ function EditDocumentConfiguration({
3864
4102
  isMandatory: false,
3865
4103
  status: "Active"
3866
4104
  });
3867
- const [errors, setErrors] = useState17({});
3868
- useEffect9(() => {
4105
+ const [errors, setErrors] = useState18({});
4106
+ useEffect11(() => {
3869
4107
  if (initialData) {
3870
4108
  const sizeParts = (initialData.maxSize || "10 MB").split(" ");
3871
4109
  setFormData({
@@ -4274,12 +4512,12 @@ function DocumentConfigTable({
4274
4512
  status: "Active"
4275
4513
  }
4276
4514
  ];
4277
- const [data, setData] = useState18(initialData);
4278
- const [sortOrder, setSortOrder] = useState18("asc");
4279
- const [sortKey, setSortKey] = useState18("docName");
4280
- const [isEditOpen, setIsEditOpen] = useState18(false);
4281
- const [isDeleteOpen, setIsDeleteOpen] = useState18(false);
4282
- const [selectedItem, setSelectedItem] = useState18(null);
4515
+ const [data, setData] = useState19(initialData);
4516
+ const [sortOrder, setSortOrder] = useState19("asc");
4517
+ const [sortKey, setSortKey] = useState19("docName");
4518
+ const [isEditOpen, setIsEditOpen] = useState19(false);
4519
+ const [isDeleteOpen, setIsDeleteOpen] = useState19(false);
4520
+ const [selectedItem, setSelectedItem] = useState19(null);
4283
4521
  const handleSort = (columnKey) => {
4284
4522
  const isAsc = sortKey === columnKey && sortOrder === "asc";
4285
4523
  setSortOrder(isAsc ? "desc" : "asc");
@@ -4295,7 +4533,7 @@ function DocumentConfigTable({
4295
4533
  const query = (searchQuery || "").toLowerCase();
4296
4534
  return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
4297
4535
  });
4298
- useEffect10(() => {
4536
+ useEffect12(() => {
4299
4537
  if (setTotalEntries) setTotalEntries(filteredData.length);
4300
4538
  }, [filteredData.length, setTotalEntries]);
4301
4539
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -4501,19 +4739,19 @@ function DocumentConfigTable({
4501
4739
  }
4502
4740
 
4503
4741
  // src/components/document-configuration/AddDocumentConfigurationModal.jsx
4504
- import React31, { useState as useState19 } from "react";
4742
+ import React31, { useState as useState20 } from "react";
4505
4743
  import { jsx as jsx31, jsxs as jsxs30 } from "react/jsx-runtime";
4506
4744
  function AddDocumentConfigModal({
4507
4745
  isOpen,
4508
4746
  onClose
4509
4747
  }) {
4510
- const [isMandatory, setIsMandatory] = useState19(false);
4511
- const [status, setStatus] = useState19("Active");
4512
- const [documentName, setDocumentName] = useState19("");
4513
- const [stepId, setStepId] = useState19("");
4514
- const [maxSize, setMaxSize] = useState19("");
4515
- const [allowedExtensions, setAllowedExtensions] = useState19("");
4516
- const [errors, setErrors] = useState19({});
4748
+ const [isMandatory, setIsMandatory] = useState20(false);
4749
+ const [status, setStatus] = useState20("Active");
4750
+ const [documentName, setDocumentName] = useState20("");
4751
+ const [stepId, setStepId] = useState20("");
4752
+ const [maxSize, setMaxSize] = useState20("");
4753
+ const [allowedExtensions, setAllowedExtensions] = useState20("");
4754
+ const [errors, setErrors] = useState20({});
4517
4755
  const handleSave = () => {
4518
4756
  let newErrors = {};
4519
4757
  if (!documentName.trim()) {
@@ -4646,17 +4884,17 @@ function AddDocumentConfigModal({
4646
4884
  // src/components/document-configuration/DocumentConfigurationmain.jsx
4647
4885
  import { jsx as jsx32, jsxs as jsxs31 } from "react/jsx-runtime";
4648
4886
  function DocumentConfigurationmain() {
4649
- const [refreshkey, setRefreshKey] = useState20(0);
4887
+ const [refreshkey, setRefreshKey] = useState21(0);
4650
4888
  const handleRefresh = () => {
4651
4889
  console.log("Table data refreshed!");
4652
4890
  setRefreshKey((prev) => prev + 1);
4653
4891
  };
4654
4892
  const tableRef = useRef7(null);
4655
- const [modalOpen, setModalOpen] = useState20(false);
4656
- const [pageSize, setPageSize] = useState20(10);
4657
- const [searchQuery, setSearchQuery] = useState20("");
4658
- const [currentPage, setCurrentPage] = useState20(1);
4659
- const [totalEntries, setTotalEntries] = useState20(0);
4893
+ const [modalOpen, setModalOpen] = useState21(false);
4894
+ const [pageSize, setPageSize] = useState21(10);
4895
+ const [searchQuery, setSearchQuery] = useState21("");
4896
+ const [currentPage, setCurrentPage] = useState21(1);
4897
+ const [totalEntries, setTotalEntries] = useState21(0);
4660
4898
  const handlePageSizeChange = (e) => {
4661
4899
  setPageSize(Number(e.target.value));
4662
4900
  setCurrentPage(1);
@@ -4696,7 +4934,7 @@ function DocumentConfigurationmain() {
4696
4934
  }
4697
4935
 
4698
4936
  // src/components/audit-log/AuditLogmain.jsx
4699
- import React36, { useState as useState23, useRef as useRef8 } from "react";
4937
+ import React36, { useState as useState24, useRef as useRef8 } from "react";
4700
4938
 
4701
4939
  // src/components/audit-log/SearchBar.jsx
4702
4940
  import React33 from "react";
@@ -4716,7 +4954,7 @@ function SearchBar4({
4716
4954
  }
4717
4955
 
4718
4956
  // src/components/audit-log/AuditLogTable.jsx
4719
- import React34, { useState as useState21, useEffect as useEffect11 } from "react";
4957
+ import React34, { useState as useState22, useEffect as useEffect13 } from "react";
4720
4958
  import { jsx as jsx34, jsxs as jsxs33 } from "react/jsx-runtime";
4721
4959
  function AuditLogTable({
4722
4960
  pageSize,
@@ -4926,9 +5164,9 @@ function AuditLogTable({
4926
5164
  ip: "192.168.1.45",
4927
5165
  time: "2026-07-17 15:55"
4928
5166
  }];
4929
- const [data, setData] = useState21(initialData);
4930
- const [sortOrder, setSortOrder] = useState21("asc");
4931
- const [sortKey, setSortKey] = useState21("logId");
5167
+ const [data, setData] = useState22(initialData);
5168
+ const [sortOrder, setSortOrder] = useState22("asc");
5169
+ const [sortKey, setSortKey] = useState22("logId");
4932
5170
  const handleSort = (columnKey) => {
4933
5171
  const isAsc = sortKey === columnKey && sortOrder === "asc";
4934
5172
  setSortOrder(isAsc ? "desc" : "asc");
@@ -4944,7 +5182,7 @@ function AuditLogTable({
4944
5182
  const query = (searchQuery || "").toLowerCase();
4945
5183
  return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
4946
5184
  });
4947
- useEffect11(() => {
5185
+ useEffect13(() => {
4948
5186
  if (setTotalEntries) setTotalEntries(filteredData.length);
4949
5187
  }, [filteredData.length, setTotalEntries]);
4950
5188
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5012,19 +5250,19 @@ function AuditLogTable({
5012
5250
  }
5013
5251
 
5014
5252
  // src/components/audit-log/AddAuditLogModal.jsx
5015
- import React35, { useState as useState22 } from "react";
5253
+ import React35, { useState as useState23 } from "react";
5016
5254
  import { jsx as jsx35, jsxs as jsxs34 } from "react/jsx-runtime";
5017
5255
  function AddAuditLogModal({
5018
5256
  isOpen,
5019
5257
  onClose
5020
5258
  }) {
5021
- const [logId, setLogId] = useState22("");
5022
- const [userName, setUserName] = useState22("");
5023
- const [actionType, setActionType] = useState22("");
5024
- const [ipAddress, setIpAddress] = useState22("");
5025
- const [sectionModule, setSectionModule] = useState22("");
5026
- const [timestamp, setTimestamp] = useState22("");
5027
- const [errors, setErrors] = useState22({});
5259
+ const [logId, setLogId] = useState23("");
5260
+ const [userName, setUserName] = useState23("");
5261
+ const [actionType, setActionType] = useState23("");
5262
+ const [ipAddress, setIpAddress] = useState23("");
5263
+ const [sectionModule, setSectionModule] = useState23("");
5264
+ const [timestamp, setTimestamp] = useState23("");
5265
+ const [errors, setErrors] = useState23({});
5028
5266
  const handleCommit = () => {
5029
5267
  let newErrors = {};
5030
5268
  if (!logId.trim()) newErrors.logId = "Log ID is required";
@@ -5143,17 +5381,17 @@ function AddAuditLogModal({
5143
5381
  // src/components/audit-log/AuditLogmain.jsx
5144
5382
  import { jsx as jsx36, jsxs as jsxs35 } from "react/jsx-runtime";
5145
5383
  function AuditLogmain() {
5146
- const [refreshkey, setRefreshKey] = useState23(0);
5384
+ const [refreshkey, setRefreshKey] = useState24(0);
5147
5385
  const handleRefresh = () => {
5148
5386
  console.log("Table data refreshed!");
5149
5387
  setRefreshKey((prev) => prev + 1);
5150
5388
  };
5151
5389
  const tableRef = useRef8(null);
5152
- const [modalOpen, setModalOpen] = useState23(false);
5153
- const [pageSize, setPageSize] = useState23(10);
5154
- const [searchQuery, setSearchQuery] = useState23("");
5155
- const [currentPage, setCurrentPage] = useState23(1);
5156
- const [totalEntries, setTotalEntries] = useState23(0);
5390
+ const [modalOpen, setModalOpen] = useState24(false);
5391
+ const [pageSize, setPageSize] = useState24(10);
5392
+ const [searchQuery, setSearchQuery] = useState24("");
5393
+ const [currentPage, setCurrentPage] = useState24(1);
5394
+ const [totalEntries, setTotalEntries] = useState24(0);
5157
5395
  const handlePageSizeChange = (e) => {
5158
5396
  setPageSize(Number(e.target.value));
5159
5397
  setCurrentPage(1);
@@ -5212,7 +5450,7 @@ function AuditLogmain() {
5212
5450
  }
5213
5451
 
5214
5452
  // src/components/movement-history/MovementHistorymain.jsx
5215
- import React40, { useState as useState26, useRef as useRef9 } from "react";
5453
+ import React40, { useState as useState27, useRef as useRef9 } from "react";
5216
5454
 
5217
5455
  // src/components/movement-history/SearchBar.jsx
5218
5456
  import React37 from "react";
@@ -5232,7 +5470,7 @@ function SearchBar5({
5232
5470
  }
5233
5471
 
5234
5472
  // src/components/movement-history/MovementHistoryTable.jsx
5235
- import React38, { useState as useState24, useEffect as useEffect12 } from "react";
5473
+ import React38, { useState as useState25, useEffect as useEffect14 } from "react";
5236
5474
  import { jsx as jsx38, jsxs as jsxs37 } from "react/jsx-runtime";
5237
5475
  function MovementHistoryTable({
5238
5476
  pageSize,
@@ -5442,9 +5680,9 @@ function MovementHistoryTable({
5442
5680
  toStepId: "APPROVE",
5443
5681
  movedOn: "2026-02-12"
5444
5682
  }];
5445
- const [data, setData] = useState24(initialData);
5446
- const [sortOrder, setSortOrder] = useState24("asc");
5447
- const [sortKey, setSortKey] = useState24("movementHistoryId");
5683
+ const [data, setData] = useState25(initialData);
5684
+ const [sortOrder, setSortOrder] = useState25("asc");
5685
+ const [sortKey, setSortKey] = useState25("movementHistoryId");
5448
5686
  const handleSort = (columnKey) => {
5449
5687
  const isAsc = sortKey === columnKey && sortOrder === "asc";
5450
5688
  setSortOrder(isAsc ? "desc" : "asc");
@@ -5460,7 +5698,7 @@ function MovementHistoryTable({
5460
5698
  const query = (searchQuery || "").toLowerCase();
5461
5699
  return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
5462
5700
  });
5463
- useEffect12(() => {
5701
+ useEffect14(() => {
5464
5702
  if (setTotalEntries) setTotalEntries(filteredData.length);
5465
5703
  }, [filteredData.length, setTotalEntries]);
5466
5704
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5531,19 +5769,19 @@ function MovementHistoryTable({
5531
5769
  }
5532
5770
 
5533
5771
  // src/components/movement-history/AddMovementHistoryModal.jsx
5534
- import React39, { useState as useState25 } from "react";
5772
+ import React39, { useState as useState26 } from "react";
5535
5773
  import { jsx as jsx39, jsxs as jsxs38 } from "react/jsx-runtime";
5536
5774
  function AddMovementHistoryModal({
5537
5775
  isOpen,
5538
5776
  onClose
5539
5777
  }) {
5540
- const [movementHistoryId, setMovementHistoryId] = useState25("");
5541
- const [fileInstanceId, setFileInstanceId] = useState25("");
5542
- const [fromStepId, setFromStepId] = useState25("");
5543
- const [toStepId, setToStepId] = useState25("");
5544
- const [actionCode, setActionCode] = useState25("");
5545
- const [movedOn, setMovedOn] = useState25("");
5546
- const [errors, setErrors] = useState25({});
5778
+ const [movementHistoryId, setMovementHistoryId] = useState26("");
5779
+ const [fileInstanceId, setFileInstanceId] = useState26("");
5780
+ const [fromStepId, setFromStepId] = useState26("");
5781
+ const [toStepId, setToStepId] = useState26("");
5782
+ const [actionCode, setActionCode] = useState26("");
5783
+ const [movedOn, setMovedOn] = useState26("");
5784
+ const [errors, setErrors] = useState26({});
5547
5785
  const handleSaveRecord = () => {
5548
5786
  let newErrors = {};
5549
5787
  if (!movementHistoryId.toString().trim()) newErrors.movementHistoryId = "Movement History ID is required";
@@ -5658,17 +5896,17 @@ function AddMovementHistoryModal({
5658
5896
  // src/components/movement-history/MovementHistorymain.jsx
5659
5897
  import { jsx as jsx40, jsxs as jsxs39 } from "react/jsx-runtime";
5660
5898
  function MovementHistorymain() {
5661
- const [refreshkey, setRefreshKey] = useState26(0);
5899
+ const [refreshkey, setRefreshKey] = useState27(0);
5662
5900
  const handleRefresh = () => {
5663
5901
  console.log("Table data refreshed!");
5664
5902
  setRefreshKey((prev) => prev + 1);
5665
5903
  };
5666
5904
  const tableRef = useRef9(null);
5667
- const [modalOpen, setModalOpen] = useState26(false);
5668
- const [pageSize, setPageSize] = useState26(10);
5669
- const [searchQuery, setSearchQuery] = useState26("");
5670
- const [currentPage, setCurrentPage] = useState26(1);
5671
- const [totalEntries, setTotalEntries] = useState26(0);
5905
+ const [modalOpen, setModalOpen] = useState27(false);
5906
+ const [pageSize, setPageSize] = useState27(10);
5907
+ const [searchQuery, setSearchQuery] = useState27("");
5908
+ const [currentPage, setCurrentPage] = useState27(1);
5909
+ const [totalEntries, setTotalEntries] = useState27(0);
5672
5910
  const handlePageSizeChange = (e) => {
5673
5911
  setPageSize(Number(e.target.value));
5674
5912
  setCurrentPage(1);
@@ -5711,7 +5949,7 @@ function MovementHistorymain() {
5711
5949
  }
5712
5950
 
5713
5951
  // src/components/task-permission/TaskPermissionMain.jsx
5714
- import React44, { useState as useState29, useRef as useRef10 } from "react";
5952
+ import React44, { useState as useState30, useRef as useRef10 } from "react";
5715
5953
 
5716
5954
  // src/components/task-permission/SearchBar.js
5717
5955
  import React41 from "react";
@@ -5742,7 +5980,7 @@ function SearchBar6({
5742
5980
  }
5743
5981
 
5744
5982
  // src/components/task-permission/Table.js
5745
- import React42, { useState as useState27, useEffect as useEffect13 } from "react";
5983
+ import React42, { useState as useState28, useEffect as useEffect15 } from "react";
5746
5984
  import { jsx as jsx42, jsxs as jsxs41 } from "react/jsx-runtime";
5747
5985
  function Table({
5748
5986
  pageSize,
@@ -5927,12 +6165,12 @@ function Table({
5927
6165
  permissionType: "Write",
5928
6166
  isStatusEnabled: true
5929
6167
  }];
5930
- const [data, setData] = useState27(initialData);
5931
- const [sortOrder, setSortOrder] = useState27("asc");
5932
- const [sortKey, setSortKey] = useState27("taskId");
5933
- const [selectedItem, setSelectedItem] = useState27(null);
5934
- const [isEditModalOpen, setIsEditModalOpen] = useState27(false);
5935
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState27(false);
6168
+ const [data, setData] = useState28(initialData);
6169
+ const [sortOrder, setSortOrder] = useState28("asc");
6170
+ const [sortKey, setSortKey] = useState28("taskId");
6171
+ const [selectedItem, setSelectedItem] = useState28(null);
6172
+ const [isEditModalOpen, setIsEditModalOpen] = useState28(false);
6173
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState28(false);
5936
6174
  const handleEdit = (item) => {
5937
6175
  setSelectedItem(item);
5938
6176
  setIsEditModalOpen(true);
@@ -5989,7 +6227,7 @@ function Table({
5989
6227
  }
5990
6228
  return item.taskId && item.taskId.toString().toLowerCase().includes(query) || item.role && item.role.toLowerCase().includes(query) || item.taskName && item.taskName.toLowerCase().includes(query) || item.permissionType && item.permissionType.toLowerCase().includes(query);
5991
6229
  });
5992
- useEffect13(() => {
6230
+ useEffect15(() => {
5993
6231
  if (setTotalEntries) setTotalEntries(filteredData.length);
5994
6232
  }, [filteredData.length, setTotalEntries]);
5995
6233
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6112,7 +6350,7 @@ function Table({
6112
6350
  }
6113
6351
 
6114
6352
  // src/components/task-permission/Popup.js
6115
- import React43, { useState as useState28 } from "react";
6353
+ import React43, { useState as useState29 } from "react";
6116
6354
  import { jsx as jsx43, jsxs as jsxs42 } from "react/jsx-runtime";
6117
6355
  function Popup({
6118
6356
  isOpen,
@@ -6120,13 +6358,13 @@ function Popup({
6120
6358
  onSave
6121
6359
  }) {
6122
6360
  if (!isOpen) return null;
6123
- const [stepName, setStepName] = useState28("");
6124
- const [stepCode, setStepCode] = useState28("");
6125
- const [workflow, setWorkflow] = useState28("");
6126
- const [canView, setCanView] = useState28(false);
6127
- const [canEdit, setCanEdit] = useState28(false);
6128
- const [canApprove, setCanApprove] = useState28(false);
6129
- const [canReject, setCanReject] = useState28(false);
6361
+ const [stepName, setStepName] = useState29("");
6362
+ const [stepCode, setStepCode] = useState29("");
6363
+ const [workflow, setWorkflow] = useState29("");
6364
+ const [canView, setCanView] = useState29(false);
6365
+ const [canEdit, setCanEdit] = useState29(false);
6366
+ const [canApprove, setCanApprove] = useState29(false);
6367
+ const [canReject, setCanReject] = useState29(false);
6130
6368
  const handleSubmit = (e) => {
6131
6369
  e.preventDefault();
6132
6370
  if (!stepName || !stepCode || !workflow) {
@@ -6243,17 +6481,17 @@ function Popup({
6243
6481
  // src/components/task-permission/TaskPermissionMain.jsx
6244
6482
  import { jsx as jsx44, jsxs as jsxs43 } from "react/jsx-runtime";
6245
6483
  function TaskPermissionMain() {
6246
- const [refreshkey, setRefreshKey] = useState29(0);
6484
+ const [refreshkey, setRefreshKey] = useState30(0);
6247
6485
  const handleRefresh = () => {
6248
6486
  console.log("Table data refreshed!");
6249
6487
  setRefreshKey((prev) => prev + 1);
6250
6488
  };
6251
6489
  const tableRef = useRef10(null);
6252
- const [showModal, setShowModal] = useState29(false);
6253
- const [pageSize, setPageSize] = useState29(10);
6254
- const [searchQuery, setSearchQuery] = useState29("");
6255
- const [currentPage, setCurrentPage] = useState29(1);
6256
- const [totalEntries, setTotalEntries] = useState29(0);
6490
+ const [showModal, setShowModal] = useState30(false);
6491
+ const [pageSize, setPageSize] = useState30(10);
6492
+ const [searchQuery, setSearchQuery] = useState30("");
6493
+ const [currentPage, setCurrentPage] = useState30(1);
6494
+ const [totalEntries, setTotalEntries] = useState30(0);
6257
6495
  const handlePageSizeChange = (e) => {
6258
6496
  setPageSize(Number(e.target.value));
6259
6497
  setCurrentPage(1);
@@ -6295,7 +6533,7 @@ function TaskPermissionMain() {
6295
6533
  }
6296
6534
 
6297
6535
  // src/components/Workflow-Setting/WorkflowSettingMain.jsx
6298
- import React48, { useState as useState32, useRef as useRef11 } from "react";
6536
+ import React48, { useState as useState33, useRef as useRef11 } from "react";
6299
6537
 
6300
6538
  // src/components/Workflow-Setting/SearchBar.js
6301
6539
  import React45 from "react";
@@ -6326,7 +6564,7 @@ function SearchBar7({
6326
6564
  }
6327
6565
 
6328
6566
  // src/components/Workflow-Setting/Table.js
6329
- import React46, { useState as useState30, useEffect as useEffect14 } from "react";
6567
+ import React46, { useState as useState31, useEffect as useEffect16 } from "react";
6330
6568
  import { jsx as jsx46, jsxs as jsxs45 } from "react/jsx-runtime";
6331
6569
  function Table2({
6332
6570
  pageSize,
@@ -6511,12 +6749,12 @@ function Table2({
6511
6749
  SLA: "2 Hours",
6512
6750
  isActive: true
6513
6751
  }];
6514
- const [data, setData] = useState30(initialData);
6515
- const [sortOrder, setSortOrder] = useState30("asc");
6516
- const [sortKey, setSortKey] = useState30("settingId");
6517
- const [selectedItem, setSelectedItem] = useState30(null);
6518
- const [isEditModalOpen, setIsEditModalOpen] = useState30(false);
6519
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState30(false);
6752
+ const [data, setData] = useState31(initialData);
6753
+ const [sortOrder, setSortOrder] = useState31("asc");
6754
+ const [sortKey, setSortKey] = useState31("settingId");
6755
+ const [selectedItem, setSelectedItem] = useState31(null);
6756
+ const [isEditModalOpen, setIsEditModalOpen] = useState31(false);
6757
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState31(false);
6520
6758
  const handleEdit = (item) => {
6521
6759
  setSelectedItem(item);
6522
6760
  setIsEditModalOpen(true);
@@ -6573,7 +6811,7 @@ function Table2({
6573
6811
  }
6574
6812
  return item.settingId && item.settingId.toString().toLowerCase().includes(query) || item.moduleName && item.moduleName.toLowerCase().includes(query) || item.executionOrder && item.executionOrder.toString().toLowerCase().includes(query) || item.SLA && item.SLA.toLowerCase().includes(query);
6575
6813
  });
6576
- useEffect14(() => {
6814
+ useEffect16(() => {
6577
6815
  if (setTotalEntries) setTotalEntries(filteredData.length);
6578
6816
  }, [filteredData.length, setTotalEntries]);
6579
6817
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6706,7 +6944,7 @@ function Table2({
6706
6944
  }
6707
6945
 
6708
6946
  // src/components/Workflow-Setting/Popup.js
6709
- import React47, { useState as useState31 } from "react";
6947
+ import React47, { useState as useState32 } from "react";
6710
6948
  import { jsx as jsx47, jsxs as jsxs46 } from "react/jsx-runtime";
6711
6949
  function Popup2({
6712
6950
  isOpen,
@@ -6714,8 +6952,8 @@ function Popup2({
6714
6952
  onSave
6715
6953
  }) {
6716
6954
  if (!isOpen) return null;
6717
- const [settingKey, setSettingKey] = useState31("");
6718
- const [settingValue, setSettingValue] = useState31("");
6955
+ const [settingKey, setSettingKey] = useState32("");
6956
+ const [settingValue, setSettingValue] = useState32("");
6719
6957
  const handleSubmit = (e) => {
6720
6958
  e.preventDefault();
6721
6959
  if (!settingKey || !settingValue) {
@@ -6766,17 +7004,17 @@ function Popup2({
6766
7004
  // src/components/Workflow-Setting/WorkflowSettingMain.jsx
6767
7005
  import { jsx as jsx48, jsxs as jsxs47 } from "react/jsx-runtime";
6768
7006
  function WorkflowSettingMain() {
6769
- const [refreshkey, setRefreshKey] = useState32(0);
7007
+ const [refreshkey, setRefreshKey] = useState33(0);
6770
7008
  const handleRefresh = () => {
6771
7009
  console.log("Table data refreshed!");
6772
7010
  setRefreshKey((prev) => prev + 1);
6773
7011
  };
6774
7012
  const tableRef = useRef11(null);
6775
- const [showModal, setShowModal] = useState32(false);
6776
- const [pageSize, setPageSize] = useState32(10);
6777
- const [searchQuery, setSearchQuery] = useState32("");
6778
- const [currentPage, setCurrentPage] = useState32(1);
6779
- const [totalEntries, setTotalEntries] = useState32(0);
7013
+ const [showModal, setShowModal] = useState33(false);
7014
+ const [pageSize, setPageSize] = useState33(10);
7015
+ const [searchQuery, setSearchQuery] = useState33("");
7016
+ const [currentPage, setCurrentPage] = useState33(1);
7017
+ const [totalEntries, setTotalEntries] = useState33(0);
6780
7018
  const handlePageSizeChange = (e) => {
6781
7019
  setPageSize(Number(e.target.value));
6782
7020
  setCurrentPage(1);
@@ -6818,7 +7056,7 @@ function WorkflowSettingMain() {
6818
7056
  }
6819
7057
 
6820
7058
  // src/components/notification/NotificationMain.jsx
6821
- import React52, { useState as useState35, useRef as useRef12 } from "react";
7059
+ import React52, { useState as useState36, useRef as useRef12 } from "react";
6822
7060
 
6823
7061
  // src/components/notification/SearchBar.js
6824
7062
  import React49 from "react";
@@ -6849,7 +7087,7 @@ function SearchBar8({
6849
7087
  }
6850
7088
 
6851
7089
  // src/components/notification/Table.js
6852
- import React50, { useState as useState33, useEffect as useEffect15 } from "react";
7090
+ import React50, { useState as useState34, useEffect as useEffect17 } from "react";
6853
7091
  import { jsx as jsx50, jsxs as jsxs49 } from "react/jsx-runtime";
6854
7092
  function Table3({
6855
7093
  pageSize,
@@ -7034,12 +7272,12 @@ function Table3({
7034
7272
  recipientGroup: "Risk Assessment",
7035
7273
  isMuted: false
7036
7274
  }];
7037
- const [data, setData] = useState33(initialData);
7038
- const [sortOrder, setSortOrder] = useState33("asc");
7039
- const [sortKey, setSortKey] = useState33("notificationId");
7040
- const [selectedItem, setSelectedItem] = useState33(null);
7041
- const [isEditModalOpen, setIsEditModalOpen] = useState33(false);
7042
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState33(false);
7275
+ const [data, setData] = useState34(initialData);
7276
+ const [sortOrder, setSortOrder] = useState34("asc");
7277
+ const [sortKey, setSortKey] = useState34("notificationId");
7278
+ const [selectedItem, setSelectedItem] = useState34(null);
7279
+ const [isEditModalOpen, setIsEditModalOpen] = useState34(false);
7280
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState34(false);
7043
7281
  const handleEdit = (item) => {
7044
7282
  setSelectedItem(item);
7045
7283
  setIsEditModalOpen(true);
@@ -7096,7 +7334,7 @@ function Table3({
7096
7334
  }
7097
7335
  return item.notificationId && item.notificationId.toString().toLowerCase().includes(query) || item.eventTrigger && item.eventTrigger.toLowerCase().includes(query) || item.channelType && item.channelType.toLowerCase().includes(query) || item.recipientGroup && item.recipientGroup.toLowerCase().includes(query);
7098
7336
  });
7099
- useEffect15(() => {
7337
+ useEffect17(() => {
7100
7338
  if (setTotalEntries) setTotalEntries(filteredData.length);
7101
7339
  }, [filteredData.length, setTotalEntries]);
7102
7340
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7224,7 +7462,7 @@ function Table3({
7224
7462
  }
7225
7463
 
7226
7464
  // src/components/notification/Popup.js
7227
- import React51, { useState as useState34 } from "react";
7465
+ import React51, { useState as useState35 } from "react";
7228
7466
  import { jsx as jsx51, jsxs as jsxs50 } from "react/jsx-runtime";
7229
7467
  function Popup3({
7230
7468
  isOpen,
@@ -7232,10 +7470,10 @@ function Popup3({
7232
7470
  onSave
7233
7471
  }) {
7234
7472
  if (!isOpen) return null;
7235
- const [fileInstanceId, setFileInstanceId] = useState34("");
7236
- const [userId, setUserId] = useState34("");
7237
- const [type, setType] = useState34("");
7238
- const [message, setMessage] = useState34("");
7473
+ const [fileInstanceId, setFileInstanceId] = useState35("");
7474
+ const [userId, setUserId] = useState35("");
7475
+ const [type, setType] = useState35("");
7476
+ const [message, setMessage] = useState35("");
7239
7477
  const handleSubmit = (e) => {
7240
7478
  e.preventDefault();
7241
7479
  if (!fileInstanceId || !userId || !type || !message) {
@@ -7306,17 +7544,17 @@ function Popup3({
7306
7544
  // src/components/notification/NotificationMain.jsx
7307
7545
  import { jsx as jsx52, jsxs as jsxs51 } from "react/jsx-runtime";
7308
7546
  function NotificationMain() {
7309
- const [refreshkey, setRefreshKey] = useState35(0);
7547
+ const [refreshkey, setRefreshKey] = useState36(0);
7310
7548
  const handleRefresh = () => {
7311
7549
  console.log("Table data refreshed!");
7312
7550
  setRefreshKey((prev) => prev + 1);
7313
7551
  };
7314
7552
  const tableRef = useRef12(null);
7315
- const [showModal, setShowModal] = useState35(false);
7316
- const [pageSize, setPageSize] = useState35(10);
7317
- const [searchQuery, setSearchQuery] = useState35("");
7318
- const [currentPage, setCurrentPage] = useState35(1);
7319
- const [totalEntries, setTotalEntries] = useState35(0);
7553
+ const [showModal, setShowModal] = useState36(false);
7554
+ const [pageSize, setPageSize] = useState36(10);
7555
+ const [searchQuery, setSearchQuery] = useState36("");
7556
+ const [currentPage, setCurrentPage] = useState36(1);
7557
+ const [totalEntries, setTotalEntries] = useState36(0);
7320
7558
  const handlePageSizeChange = (e) => {
7321
7559
  setPageSize(Number(e.target.value));
7322
7560
  setCurrentPage(1);
@@ -7355,7 +7593,7 @@ function NotificationMain() {
7355
7593
  }
7356
7594
 
7357
7595
  // src/components/task-instance/task_instance_main.jsx
7358
- import React58, { useState as useState38, useRef as useRef13 } from "react";
7596
+ import React58, { useState as useState39, useRef as useRef13 } from "react";
7359
7597
 
7360
7598
  // src/components/task-instance/searchbartaskinstance.jsx
7361
7599
  import React53 from "react";
@@ -7382,10 +7620,10 @@ function TaskInstanceSearchBar({
7382
7620
  }
7383
7621
 
7384
7622
  // src/components/task-instance/taskinstancetable.jsx
7385
- import React56, { useState as useState37, useEffect as useEffect17 } from "react";
7623
+ import React56, { useState as useState38, useEffect as useEffect19 } from "react";
7386
7624
 
7387
7625
  // src/components/task-instance/edit-instance.jsx
7388
- import React54, { useEffect as useEffect16, useState as useState36 } from "react";
7626
+ import React54, { useEffect as useEffect18, useState as useState37 } from "react";
7389
7627
  import { jsx as jsx54, jsxs as jsxs53 } from "react/jsx-runtime";
7390
7628
  function EditTaskInstanceModal({
7391
7629
  isOpen,
@@ -7393,7 +7631,7 @@ function EditTaskInstanceModal({
7393
7631
  selectedTask,
7394
7632
  onSave
7395
7633
  }) {
7396
- const [formData, setFormData] = useState36({
7634
+ const [formData, setFormData] = useState37({
7397
7635
  assignedUserId: "",
7398
7636
  status: "",
7399
7637
  dueDate: "",
@@ -7401,7 +7639,7 @@ function EditTaskInstanceModal({
7401
7639
  escalatedOn: "",
7402
7640
  slaStatus: ""
7403
7641
  });
7404
- useEffect16(() => {
7642
+ useEffect18(() => {
7405
7643
  if (selectedTask) {
7406
7644
  setFormData({
7407
7645
  assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
@@ -7904,9 +8142,9 @@ function TaskInstanceTable({
7904
8142
  reminderSentOn: "2026-08-06",
7905
8143
  escalatedOn: ""
7906
8144
  }];
7907
- const [data, setData] = useState37(initialData);
7908
- const [sortOrder, setSortOrder] = useState37("asc");
7909
- const [sortKey, setSortKey] = useState37("taskInstanceId");
8145
+ const [data, setData] = useState38(initialData);
8146
+ const [sortOrder, setSortOrder] = useState38("asc");
8147
+ const [sortKey, setSortKey] = useState38("taskInstanceId");
7910
8148
  const handleSort = (columnKey) => {
7911
8149
  const isAsc = sortKey === columnKey && sortOrder === "asc";
7912
8150
  setSortOrder(isAsc ? "desc" : "asc");
@@ -7922,7 +8160,7 @@ function TaskInstanceTable({
7922
8160
  const query = (searchQuery || "").toLowerCase();
7923
8161
  return String(item.taskInstanceId).includes(query) || String(item.fileInstanceId).includes(query) || String(item.workflowStepId).includes(query) || String(item.assignedUserId).includes(query) || item.status.toLowerCase().includes(query);
7924
8162
  });
7925
- useEffect17(() => {
8163
+ useEffect19(() => {
7926
8164
  if (setTotalEntries) setTotalEntries(filteredData.length);
7927
8165
  }, [filteredData.length, setTotalEntries]);
7928
8166
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7931,9 +8169,9 @@ function TaskInstanceTable({
7931
8169
  const pageNumbers = Array.from({
7932
8170
  length: totalPages
7933
8171
  }, (_, i) => i + 1);
7934
- const [showEditPopup, setShowEditPopup] = useState37(false);
7935
- const [showDeletePopup, setShowDeletePopup] = useState37(false);
7936
- const [selectedItem, setSelectedItem] = useState37(null);
8172
+ const [showEditPopup, setShowEditPopup] = useState38(false);
8173
+ const [showDeletePopup, setShowDeletePopup] = useState38(false);
8174
+ const [selectedItem, setSelectedItem] = useState38(null);
7937
8175
  const openEditPopup = (item) => {
7938
8176
  setSelectedItem(item);
7939
8177
  setShowEditPopup(true);
@@ -8187,17 +8425,17 @@ function AddTaskInstanceModal({
8187
8425
  // src/components/task-instance/task_instance_main.jsx
8188
8426
  import { jsx as jsx58, jsxs as jsxs57 } from "react/jsx-runtime";
8189
8427
  function Task_instance_main() {
8190
- const [refreshkey, setRefreshKey] = useState38(0);
8428
+ const [refreshkey, setRefreshKey] = useState39(0);
8191
8429
  const handleRefresh = () => {
8192
8430
  console.log("Table data refreshed!");
8193
8431
  setRefreshKey((prev) => prev + 1);
8194
8432
  };
8195
- const [modalOpen, setModalOpen] = useState38(false);
8196
- const [pageSize, setPageSize] = useState38(10);
8197
- const [searchQuery, setSearchQuery] = useState38("");
8433
+ const [modalOpen, setModalOpen] = useState39(false);
8434
+ const [pageSize, setPageSize] = useState39(10);
8435
+ const [searchQuery, setSearchQuery] = useState39("");
8198
8436
  const tableRef = useRef13(null);
8199
- const [currentPage, setCurrentPage] = useState38(1);
8200
- const [totalEntries, setTotalEntries] = useState38(0);
8437
+ const [currentPage, setCurrentPage] = useState39(1);
8438
+ const [totalEntries, setTotalEntries] = useState39(0);
8201
8439
  const handlePageSizeChange = (e) => {
8202
8440
  setPageSize(Number(e.target.value));
8203
8441
  setCurrentPage(1);
@@ -8264,7 +8502,7 @@ function Task_instance_main() {
8264
8502
  }
8265
8503
 
8266
8504
  // src/components/comment/comment_main.jsx
8267
- import React62, { useState as useState41, useRef as useRef14 } from "react";
8505
+ import React62, { useState as useState42, useRef as useRef14 } from "react";
8268
8506
 
8269
8507
  // src/components/comment/searchbarcomment.jsx
8270
8508
  import React59 from "react";
@@ -8291,7 +8529,7 @@ function CommentSearchBar({
8291
8529
  }
8292
8530
 
8293
8531
  // src/components/comment/commenttable.jsx
8294
- import React60, { useState as useState39, useEffect as useEffect18 } from "react";
8532
+ import React60, { useState as useState40, useEffect as useEffect20 } from "react";
8295
8533
  import { jsx as jsx60, jsxs as jsxs59 } from "react/jsx-runtime";
8296
8534
  function CommentTable({
8297
8535
  pageSize,
@@ -8501,9 +8739,9 @@ function CommentTable({
8501
8739
  createdOn: "08 Aug 2026",
8502
8740
  status: true
8503
8741
  }];
8504
- const [data, setData] = useState39(initialData);
8505
- const [sortOrder, setSortOrder] = useState39("asc");
8506
- const [sortKey, setSortKey] = useState39("commentId");
8742
+ const [data, setData] = useState40(initialData);
8743
+ const [sortOrder, setSortOrder] = useState40("asc");
8744
+ const [sortKey, setSortKey] = useState40("commentId");
8507
8745
  const handleSort = (columnKey) => {
8508
8746
  const isAsc = sortKey === columnKey && sortOrder === "asc";
8509
8747
  setSortOrder(isAsc ? "desc" : "asc");
@@ -8519,7 +8757,7 @@ function CommentTable({
8519
8757
  const query = (searchQuery || "").toLowerCase();
8520
8758
  return String(item.commentId).toLowerCase().includes(query) || String(item.taskInstanceId).toLowerCase().includes(query) || item.comment.toLowerCase().includes(query) || String(item.commentedBy).toLowerCase().includes(query);
8521
8759
  });
8522
- useEffect18(() => {
8760
+ useEffect20(() => {
8523
8761
  if (setTotalEntries) setTotalEntries(filteredData.length);
8524
8762
  }, [filteredData.length, setTotalEntries]);
8525
8763
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8575,15 +8813,15 @@ function CommentTable({
8575
8813
  }
8576
8814
 
8577
8815
  // src/components/comment/addcomment.jsx
8578
- import React61, { useState as useState40 } from "react";
8816
+ import React61, { useState as useState41 } from "react";
8579
8817
  import { jsx as jsx61, jsxs as jsxs60 } from "react/jsx-runtime";
8580
8818
  function AddCommentModal({
8581
8819
  isOpen,
8582
8820
  onClose
8583
8821
  }) {
8584
- const [allowEdit, setAllowEdit] = useState40(true);
8585
- const [pinComment, setPinComment] = useState40(true);
8586
- const [sendNotification, setSendNotification] = useState40(false);
8822
+ const [allowEdit, setAllowEdit] = useState41(true);
8823
+ const [pinComment, setPinComment] = useState41(true);
8824
+ const [sendNotification, setSendNotification] = useState41(false);
8587
8825
  if (!isOpen) return null;
8588
8826
  return /* @__PURE__ */ jsxs60("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
8589
8827
  /* @__PURE__ */ jsx61("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
@@ -8780,11 +9018,11 @@ function AddCommentModal({
8780
9018
  // src/components/comment/comment_main.jsx
8781
9019
  import { jsx as jsx62, jsxs as jsxs61 } from "react/jsx-runtime";
8782
9020
  function Comment_main() {
8783
- const [modalOpen, setModalOpen] = useState41(false);
8784
- const [pageSize, setPageSize] = useState41(10);
8785
- const [searchQuery, setSearchQuery] = useState41("");
8786
- const [currentPage, setCurrentPage] = useState41(1);
8787
- const [totalEntries, setTotalEntries] = useState41(0);
9021
+ const [modalOpen, setModalOpen] = useState42(false);
9022
+ const [pageSize, setPageSize] = useState42(10);
9023
+ const [searchQuery, setSearchQuery] = useState42("");
9024
+ const [currentPage, setCurrentPage] = useState42(1);
9025
+ const [totalEntries, setTotalEntries] = useState42(0);
8788
9026
  const tableRef = useRef14(null);
8789
9027
  const handlePageSizeChange = (e) => {
8790
9028
  setPageSize(Number(e.target.value));
@@ -8854,8 +9092,8 @@ function Comment_main() {
8854
9092
  }
8855
9093
 
8856
9094
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
8857
- import React68, { useState as useState44, useRef as useRef15, useEffect as useEffect21 } from "react";
8858
- import Swal4 from "sweetalert2";
9095
+ import React68, { useState as useState45, useRef as useRef15, useEffect as useEffect23 } from "react";
9096
+ import Swal6 from "sweetalert2";
8859
9097
 
8860
9098
  // src/components/hierarchy-node/SearchBar.jsx
8861
9099
  import React63 from "react";
@@ -8894,18 +9132,18 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
8894
9132
  }
8895
9133
 
8896
9134
  // src/components/hierarchy-node/HierarchyTable.jsx
8897
- import React66, { useState as useState43, useEffect as useEffect20 } from "react";
9135
+ import React66, { useState as useState44, useEffect as useEffect22 } from "react";
8898
9136
 
8899
9137
  // src/components/hierarchy-node/AddEditModal.jsx
8900
- import React64, { useEffect as useEffect19, useState as useState42 } from "react";
9138
+ import React64, { useEffect as useEffect21, useState as useState43 } from "react";
8901
9139
  import { jsx as jsx64, jsxs as jsxs63 } from "react/jsx-runtime";
8902
- function AddEditModal2({
9140
+ function AddEditModal({
8903
9141
  isOpen,
8904
9142
  onClose,
8905
9143
  onSave,
8906
9144
  editData
8907
9145
  }) {
8908
- const [formData, setFormData] = useState42({
9146
+ const [formData, setFormData] = useState43({
8909
9147
  hierarchyNodeId: "",
8910
9148
  parentHierarchyNodeId: "",
8911
9149
  hierarchyLevel: "",
@@ -8915,7 +9153,7 @@ function AddEditModal2({
8915
9153
  externalEntityId: "",
8916
9154
  isActive: true
8917
9155
  });
8918
- useEffect19(() => {
9156
+ useEffect21(() => {
8919
9157
  if (editData) {
8920
9158
  setFormData(editData);
8921
9159
  }
@@ -9214,27 +9452,27 @@ function HierarchyTable({
9214
9452
  externalEntityId: 1010,
9215
9453
  isActive: true
9216
9454
  }];
9217
- const [currentPage, setCurrentPage] = useState43(1);
9455
+ const [currentPage, setCurrentPage] = useState44(1);
9218
9456
  ;
9219
- const [data, setData] = useState43(apiData || hierarchyData);
9220
- useEffect20(() => {
9457
+ const [data, setData] = useState44(apiData || hierarchyData);
9458
+ useEffect22(() => {
9221
9459
  if (apiData) setData(apiData);
9222
9460
  }, [apiData]);
9223
9461
  const filteredData = data.filter(
9224
9462
  (item) => (item.nodeName || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || (item.nodeType || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || String(item.hierarchyNodeId).includes(searchQuery || "")
9225
9463
  );
9226
- const [sortColumn, setSortColumn] = useState43("");
9227
- const [sortDirection, setSortDirection] = useState43("asc");
9464
+ const [sortColumn, setSortColumn] = useState44("");
9465
+ const [sortDirection, setSortDirection] = useState44("asc");
9228
9466
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
9229
9467
  const startIndex = (currentPage - 1) * pageSize;
9230
9468
  const visibleData = filteredData.slice(
9231
9469
  startIndex,
9232
9470
  startIndex + pageSize
9233
9471
  );
9234
- const [editOpen, setEditOpen] = useState43(false);
9235
- const [deleteOpen, setDeleteOpen] = useState43(false);
9236
- const [selectedNode, setSelectedNode] = useState43(null);
9237
- useEffect20(() => {
9472
+ const [editOpen, setEditOpen] = useState44(false);
9473
+ const [deleteOpen, setDeleteOpen] = useState44(false);
9474
+ const [selectedNode, setSelectedNode] = useState44(null);
9475
+ useEffect22(() => {
9238
9476
  setCurrentPage(1);
9239
9477
  }, [searchQuery, pageSize]);
9240
9478
  const handleSort = (column) => {
@@ -9385,7 +9623,7 @@ function HierarchyTable({
9385
9623
  )
9386
9624
  ] }),
9387
9625
  /* @__PURE__ */ jsx66(
9388
- AddEditModal2,
9626
+ AddEditModal,
9389
9627
  {
9390
9628
  isOpen: editOpen,
9391
9629
  editData: selectedNode,
@@ -9513,12 +9751,12 @@ function AddHierarchyNodeModal({
9513
9751
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
9514
9752
  import { jsx as jsx68, jsxs as jsxs67 } from "react/jsx-runtime";
9515
9753
  function HierarchyNodeMain() {
9516
- const [modalOpen, setModalOpen] = useState44(false);
9517
- const [pageSize, setPageSize] = useState44(5);
9754
+ const [modalOpen, setModalOpen] = useState45(false);
9755
+ const [pageSize, setPageSize] = useState45(5);
9518
9756
  const tableRef = useRef15(null);
9519
- const [searchQuery, setSearchQuery] = useState44("");
9520
- const [apiData, setApiData] = useState44([]);
9521
- useEffect21(() => {
9757
+ const [searchQuery, setSearchQuery] = useState45("");
9758
+ const [apiData, setApiData] = useState45([]);
9759
+ useEffect23(() => {
9522
9760
  (async () => {
9523
9761
  var _a, _b, _c, _d, _e, _f, _g;
9524
9762
  try {
@@ -9528,7 +9766,7 @@ function HierarchyNodeMain() {
9528
9766
  const value = ((_d = result == null ? void 0 : result.data) == null ? void 0 : _d.data) || ((_e = result == null ? void 0 : result.data) == null ? void 0 : _e.result) || (result == null ? void 0 : result.data) || result;
9529
9767
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
9530
9768
  } catch (error) {
9531
- await Swal4.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
9769
+ await Swal6.fire("Error", ((_g = (_f = error == null ? void 0 : error.response) == null ? void 0 : _f.data) == null ? void 0 : _g.message) || (error == null ? void 0 : error.message) || "Unable to load hierarchy nodes.", "error");
9532
9770
  }
9533
9771
  })();
9534
9772
  }, [modalOpen]);
@@ -9594,7 +9832,7 @@ function HierarchyNodeMain() {
9594
9832
  }
9595
9833
 
9596
9834
  // src/components/file-pool/FilePoolMain.jsx
9597
- import React72, { useState as useState46, useRef as useRef16 } from "react";
9835
+ import React72, { useState as useState47, useRef as useRef16 } from "react";
9598
9836
 
9599
9837
  // src/components/file-pool/SearchBar.jsx
9600
9838
  import React69 from "react";
@@ -9607,7 +9845,7 @@ function SearchBar10() {
9607
9845
  }
9608
9846
 
9609
9847
  // src/components/file-pool/FilePoolTable.jsx
9610
- import React70, { useState as useState45 } from "react";
9848
+ import React70, { useState as useState46 } from "react";
9611
9849
  import { jsx as jsx70, jsxs as jsxs69 } from "react/jsx-runtime";
9612
9850
  function FilePoolTable({
9613
9851
  pageSize
@@ -9683,10 +9921,10 @@ function FilePoolTable({
9683
9921
  addedOn: "10-07-2026",
9684
9922
  pulledOn: "-"
9685
9923
  }];
9686
- const [currentPage, setCurrentPage] = useState45(1);
9687
- const [data, setData] = useState45(filePoolData);
9688
- const [sortColumn, setSortColumn] = useState45("");
9689
- const [sortDirection, setSortDirection] = useState45("asc");
9924
+ const [currentPage, setCurrentPage] = useState46(1);
9925
+ const [data, setData] = useState46(filePoolData);
9926
+ const [sortColumn, setSortColumn] = useState46("");
9927
+ const [sortDirection, setSortDirection] = useState46("asc");
9690
9928
  const totalPages = Math.ceil(data.length / pageSize) || 1;
9691
9929
  const startIndex = (currentPage - 1) * pageSize;
9692
9930
  const currentData = data.slice(startIndex, startIndex + pageSize);
@@ -9842,8 +10080,8 @@ function AddFilePoolModal({
9842
10080
  // src/components/file-pool/FilePoolMain.jsx
9843
10081
  import { jsx as jsx72, jsxs as jsxs71 } from "react/jsx-runtime";
9844
10082
  function FilePoolMain() {
9845
- const [modalOpen, setModalOpen] = useState46(false);
9846
- const [pageSize, setPageSize] = useState46(5);
10083
+ const [modalOpen, setModalOpen] = useState47(false);
10084
+ const [pageSize, setPageSize] = useState47(5);
9847
10085
  const tableRef = useRef16(null);
9848
10086
  const handleRefresh = () => {
9849
10087
  console.log("Refresh clicked");
@@ -9894,7 +10132,7 @@ function FilePoolMain() {
9894
10132
  }
9895
10133
 
9896
10134
  // src/components/uploaded-document/UploadedDocumentMain.jsx
9897
- import React76, { useState as useState48, useRef as useRef17 } from "react";
10135
+ import React76, { useState as useState49, useRef as useRef17 } from "react";
9898
10136
 
9899
10137
  // src/components/uploaded-document/SearchBar.jsx
9900
10138
  import React73 from "react";
@@ -9907,7 +10145,7 @@ function SearchBar11() {
9907
10145
  }
9908
10146
 
9909
10147
  // src/components/uploaded-document/UploadedDocumentTable.jsx
9910
- import React74, { useState as useState47 } from "react";
10148
+ import React74, { useState as useState48 } from "react";
9911
10149
  import { jsx as jsx74, jsxs as jsxs73 } from "react/jsx-runtime";
9912
10150
  function UploadedDocumentTable({
9913
10151
  pageSize
@@ -9983,10 +10221,10 @@ function UploadedDocumentTable({
9983
10221
  storagePath: "/uploads/certificate.pdf",
9984
10222
  uploadedBy: "Admin"
9985
10223
  }];
9986
- const [data, setData] = useState47(uploadedDocuments);
9987
- const [currentPage, setCurrentPage] = useState47(1);
9988
- const [sortColumn, setSortColumn] = useState47("");
9989
- const [sortDirection, setSortDirection] = useState47("asc");
10224
+ const [data, setData] = useState48(uploadedDocuments);
10225
+ const [currentPage, setCurrentPage] = useState48(1);
10226
+ const [sortColumn, setSortColumn] = useState48("");
10227
+ const [sortDirection, setSortDirection] = useState48("asc");
9990
10228
  const totalPages = Math.ceil(data.length / pageSize) || 1;
9991
10229
  const startIndex = (currentPage - 1) * pageSize;
9992
10230
  const currentData = data.slice(startIndex, startIndex + pageSize);
@@ -10186,8 +10424,8 @@ function AddUploadedDocumentModal({
10186
10424
  // src/components/uploaded-document/UploadedDocumentMain.jsx
10187
10425
  import { jsx as jsx76, jsxs as jsxs75 } from "react/jsx-runtime";
10188
10426
  function UploadedDocumentMain() {
10189
- const [modalOpen, setModalOpen] = useState48(false);
10190
- const [pageSize, setPageSize] = useState48(5);
10427
+ const [modalOpen, setModalOpen] = useState49(false);
10428
+ const [pageSize, setPageSize] = useState49(5);
10191
10429
  const tableRef = useRef17(null);
10192
10430
  const handleRefresh = () => {
10193
10431
  console.log("Refresh clicked");
@@ -10238,14 +10476,14 @@ function UploadedDocumentMain() {
10238
10476
  }
10239
10477
 
10240
10478
  // src/components/BuisnessEntity/BusinessEntitymain.js
10241
- import React78, { useState as useState50, useRef as useRef18 } from "react";
10479
+ import React78, { useState as useState51, useRef as useRef18 } from "react";
10242
10480
  import Link4 from "next/link";
10243
10481
 
10244
10482
  // src/components/BuisnessEntity/AddBusinessEntityModal.js
10245
- import React77, { useState as useState49 } from "react";
10483
+ import React77, { useState as useState50 } from "react";
10246
10484
  import { jsx as jsx77, jsxs as jsxs76 } from "react/jsx-runtime";
10247
10485
  function AddBusinessEntityModal({ onClose }) {
10248
- const [formData, setFormData] = useState49({
10486
+ const [formData, setFormData] = useState50({
10249
10487
  entityType: "",
10250
10488
  entityKey: "",
10251
10489
  displayNumber: "",
@@ -10254,7 +10492,7 @@ function AddBusinessEntityModal({ onClose }) {
10254
10492
  isVisible: true,
10255
10493
  status: "Active"
10256
10494
  });
10257
- const [errors, setErrors] = useState49({});
10495
+ const [errors, setErrors] = useState50({});
10258
10496
  const handleChange = (field, value) => {
10259
10497
  setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
10260
10498
  [field]: value
@@ -10542,7 +10780,7 @@ function AddBusinessEntityModal({ onClose }) {
10542
10780
  }
10543
10781
 
10544
10782
  // src/components/BuisnessEntity/BusinessEntitymain.js
10545
- import { Fragment as Fragment5, jsx as jsx78, jsxs as jsxs77 } from "react/jsx-runtime";
10783
+ import { Fragment as Fragment6, jsx as jsx78, jsxs as jsxs77 } from "react/jsx-runtime";
10546
10784
  var BusinessEntitys = [{
10547
10785
  BusinessEntityId: 1,
10548
10786
  EntityType: "Application",
@@ -10630,9 +10868,9 @@ function BusinessEntity() {
10630
10868
  console.log("Download clicked");
10631
10869
  };
10632
10870
  const tableRef = useRef18(null);
10633
- const [showModal, setShowModal] = useState50(false);
10634
- const [pageSize, setPageSize] = useState50(5);
10635
- const [sortConfig, setSortConfig] = useState50({
10871
+ const [showModal, setShowModal] = useState51(false);
10872
+ const [pageSize, setPageSize] = useState51(5);
10873
+ const [sortConfig, setSortConfig] = useState51({
10636
10874
  key: "",
10637
10875
  direction: "asc"
10638
10876
  });
@@ -10646,7 +10884,7 @@ function BusinessEntity() {
10646
10884
  direction
10647
10885
  });
10648
10886
  };
10649
- return /* @__PURE__ */ jsx78(Fragment5, { children: /* @__PURE__ */ jsxs77("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
10887
+ return /* @__PURE__ */ jsx78(Fragment6, { children: /* @__PURE__ */ jsxs77("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:min-h-screen fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
10650
10888
  /* @__PURE__ */ jsx78(CommonHeader, { title: "Business Entity", breadcrumbs: [{
10651
10889
  label: "Dashboard",
10652
10890
  href: "/dashboard"
@@ -10710,14 +10948,14 @@ function BusinessEntity() {
10710
10948
  }
10711
10949
 
10712
10950
  // src/components/FileInstance/FileInstancemain.js
10713
- import React80, { useState as useState52, useRef as useRef19 } from "react";
10951
+ import React80, { useState as useState53, useRef as useRef19 } from "react";
10714
10952
  import Link5 from "next/link";
10715
10953
 
10716
10954
  // src/components/FileInstance/AddWorkFlowFileInstanceModal.js
10717
- import React79, { useState as useState51 } from "react";
10955
+ import React79, { useState as useState52 } from "react";
10718
10956
  import { jsx as jsx79, jsxs as jsxs78 } from "react/jsx-runtime";
10719
10957
  function AddFileInstanceModal({ onClose }) {
10720
- const [formData, setFormData] = useState51({
10958
+ const [formData, setFormData] = useState52({
10721
10959
  workflow: "",
10722
10960
  businessEntityType: "",
10723
10961
  businessEntity: "",
@@ -10727,7 +10965,7 @@ function AddFileInstanceModal({ onClose }) {
10727
10965
  status: "Pending",
10728
10966
  priority: "High"
10729
10967
  });
10730
- const [errors, setErrors] = useState51({});
10968
+ const [errors, setErrors] = useState52({});
10731
10969
  const validateForm = () => {
10732
10970
  const newErrors = {};
10733
10971
  if (!formData.workflow) newErrors.workflow = "Workflow is required.";
@@ -10999,7 +11237,7 @@ function AddFileInstanceModal({ onClose }) {
10999
11237
  }
11000
11238
 
11001
11239
  // src/components/FileInstance/FileInstancemain.js
11002
- import { Fragment as Fragment6, jsx as jsx80, jsxs as jsxs79 } from "react/jsx-runtime";
11240
+ import { Fragment as Fragment7, jsx as jsx80, jsxs as jsxs79 } from "react/jsx-runtime";
11003
11241
  var FileInstances = [{
11004
11242
  FileInstanceId: 1,
11005
11243
  workflowId: 1,
@@ -11139,9 +11377,9 @@ function FileInstance() {
11139
11377
  console.log("Download clicked");
11140
11378
  };
11141
11379
  const tableRef = useRef19(null);
11142
- const [showModal, setShowModal] = useState52(false);
11143
- const [pageSize, setPageSize] = useState52(5);
11144
- const [sortConfig, setSortConfig] = useState52({
11380
+ const [showModal, setShowModal] = useState53(false);
11381
+ const [pageSize, setPageSize] = useState53(5);
11382
+ const [sortConfig, setSortConfig] = useState53({
11145
11383
  key: "",
11146
11384
  direction: "asc"
11147
11385
  });
@@ -11155,7 +11393,7 @@ function FileInstance() {
11155
11393
  direction
11156
11394
  });
11157
11395
  };
11158
- return /* @__PURE__ */ jsxs79(Fragment6, { children: [
11396
+ return /* @__PURE__ */ jsxs79(Fragment7, { children: [
11159
11397
  /* @__PURE__ */ jsxs79("div", { className: "fc:p-5 fc:bg-[#f5f7fb] fc:font-sans fc:text-slate-700 fc:flex fc:flex-col", children: [
11160
11398
  /* @__PURE__ */ jsx80(CommonHeader, { title: "File Instance ", breadcrumbs: [{
11161
11399
  label: "Dashboard",
@@ -11249,7 +11487,7 @@ function FileInstance() {
11249
11487
  }
11250
11488
 
11251
11489
  // src/components/assignment-rule/AssignmentRuleMain.jsx
11252
- import React84, { useState as useState55, useRef as useRef20 } from "react";
11490
+ import React84, { useState as useState56, useRef as useRef20 } from "react";
11253
11491
 
11254
11492
  // src/components/assignment-rule/SearchBar.js
11255
11493
  import React81 from "react";
@@ -11272,7 +11510,7 @@ function SearchBar12({
11272
11510
  }
11273
11511
 
11274
11512
  // src/components/assignment-rule/Table.js
11275
- import React82, { useState as useState53, useEffect as useEffect22 } from "react";
11513
+ import React82, { useState as useState54, useEffect as useEffect24 } from "react";
11276
11514
  import { jsx as jsx82, jsxs as jsxs81 } from "react/jsx-runtime";
11277
11515
  function Table4({
11278
11516
  pageSize,
@@ -11380,12 +11618,12 @@ function Table4({
11380
11618
  dynamicFunctionId: "4",
11381
11619
  isPoolEnabled: true
11382
11620
  }];
11383
- const [data, setData] = useState53(initialData);
11384
- const [sortOrder, setSortOrder] = useState53("asc");
11385
- const [sortKey, setSortKey] = useState53("workflowStepId");
11386
- const [selectedItem, setSelectedItem] = useState53(null);
11387
- const [isEditModalOpen, setIsEditModalOpen] = useState53(false);
11388
- const [isDeleteModalOpen, setIsDeleteModalOpen] = useState53(false);
11621
+ const [data, setData] = useState54(initialData);
11622
+ const [sortOrder, setSortOrder] = useState54("asc");
11623
+ const [sortKey, setSortKey] = useState54("workflowStepId");
11624
+ const [selectedItem, setSelectedItem] = useState54(null);
11625
+ const [isEditModalOpen, setIsEditModalOpen] = useState54(false);
11626
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = useState54(false);
11389
11627
  const handleEdit = (item) => {
11390
11628
  setSelectedItem(item);
11391
11629
  setIsEditModalOpen(true);
@@ -11438,7 +11676,7 @@ function Table4({
11438
11676
  const query = searchQuery.toLowerCase().trim();
11439
11677
  return item.workflowStepId && item.workflowStepId.toString().toLowerCase().includes(query) || item.assignmentType && item.assignmentType.toLowerCase().includes(query) || item.hierarchyNodeType && item.hierarchyNodeType.toLowerCase().includes(query) || item.dynamicFunctionId && item.dynamicFunctionId.toString().toLowerCase().includes(query);
11440
11678
  });
11441
- useEffect22(() => {
11679
+ useEffect24(() => {
11442
11680
  if (setTotalEntries) setTotalEntries(filteredData.length);
11443
11681
  }, [filteredData.length, setTotalEntries]);
11444
11682
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -11564,7 +11802,7 @@ function Table4({
11564
11802
  }
11565
11803
 
11566
11804
  // src/components/assignment-rule/Popup.js
11567
- import React83, { useState as useState54 } from "react";
11805
+ import React83, { useState as useState55 } from "react";
11568
11806
  import { jsx as jsx83, jsxs as jsxs82 } from "react/jsx-runtime";
11569
11807
  function Popup4({
11570
11808
  isOpen,
@@ -11572,11 +11810,11 @@ function Popup4({
11572
11810
  onSave
11573
11811
  }) {
11574
11812
  if (!isOpen) return null;
11575
- const [workflowStepId, setWorkflowStepId] = useState54("");
11576
- const [assignmentType, setAssignmentType] = useState54("");
11577
- const [hierarchyNodeType, setHierarchyNodeType] = useState54("");
11578
- const [dynamicFunctionId, setDynamicFunctionId] = useState54("");
11579
- const [isPoolEnabled, setIsPoolEnabled] = useState54(false);
11813
+ const [workflowStepId, setWorkflowStepId] = useState55("");
11814
+ const [assignmentType, setAssignmentType] = useState55("");
11815
+ const [hierarchyNodeType, setHierarchyNodeType] = useState55("");
11816
+ const [dynamicFunctionId, setDynamicFunctionId] = useState55("");
11817
+ const [isPoolEnabled, setIsPoolEnabled] = useState55(false);
11580
11818
  const handleSubmit = (e) => {
11581
11819
  e.preventDefault();
11582
11820
  if (!workflowStepId || !assignmentType || !hierarchyNodeType) {
@@ -11653,17 +11891,17 @@ function Popup4({
11653
11891
  // src/components/assignment-rule/AssignmentRuleMain.jsx
11654
11892
  import { jsx as jsx84, jsxs as jsxs83 } from "react/jsx-runtime";
11655
11893
  function AssignmentRuleMain() {
11656
- const [refreshkey, setRefreshKey] = useState55(0);
11894
+ const [refreshkey, setRefreshKey] = useState56(0);
11657
11895
  const handleRefresh = () => {
11658
11896
  console.log("Table data refreshed!");
11659
11897
  setRefreshKey((prev) => prev + 1);
11660
11898
  };
11661
11899
  const tableRef = useRef20(null);
11662
- const [showModal, setShowModal] = useState55(false);
11663
- const [pageSize, setPageSize] = useState55(10);
11664
- const [searchQuery, setSearchQuery] = useState55("");
11665
- const [currentPage, setCurrentPage] = useState55(1);
11666
- const [totalEntries, setTotalEntries] = useState55(0);
11900
+ const [showModal, setShowModal] = useState56(false);
11901
+ const [pageSize, setPageSize] = useState56(10);
11902
+ const [searchQuery, setSearchQuery] = useState56("");
11903
+ const [currentPage, setCurrentPage] = useState56(1);
11904
+ const [totalEntries, setTotalEntries] = useState56(0);
11667
11905
  const handlePageSizeChange = (e) => {
11668
11906
  setPageSize(Number(e.target.value));
11669
11907
  setCurrentPage(1);
@@ -11708,7 +11946,7 @@ function AssignmentRuleMain() {
11708
11946
  }
11709
11947
 
11710
11948
  // src/components/Sidebar.jsx
11711
- import { Fragment as Fragment7, jsx as jsx85, jsxs as jsxs84 } from "react/jsx-runtime";
11949
+ import { Fragment as Fragment8, jsx as jsx85, jsxs as jsxs84 } from "react/jsx-runtime";
11712
11950
  var workflowItems = [
11713
11951
  // Menu Name testing // component or page-Use function name
11714
11952
  {
@@ -11805,15 +12043,15 @@ function Sidebar({
11805
12043
  childrens
11806
12044
  }) {
11807
12045
  const router = useRouter();
11808
- const [workflowOpen, setWorkflowOpen] = useState56(false);
11809
- const [permissionOpen, setPermissionOpen] = useState56(false);
11810
- const [hierarchyOpen, setHierarchyOpen] = useState56(false);
11811
- const [documentOpen, setDocumentOpen] = useState56(false);
11812
- const [filesOpen, setFilesOpen] = useState56(false);
11813
- const [tasksOpen, setTasksOpen] = useState56(false);
11814
- const [trackingOpen, setTrackingOpen] = useState56(false);
11815
- const [communicationOpen, setCommunicationOpen] = useState56(false);
11816
- const [activeComponent, setActiveComponent] = useState56("workflowType");
12046
+ const [workflowOpen, setWorkflowOpen] = useState57(false);
12047
+ const [permissionOpen, setPermissionOpen] = useState57(false);
12048
+ const [hierarchyOpen, setHierarchyOpen] = useState57(false);
12049
+ const [documentOpen, setDocumentOpen] = useState57(false);
12050
+ const [filesOpen, setFilesOpen] = useState57(false);
12051
+ const [tasksOpen, setTasksOpen] = useState57(false);
12052
+ const [trackingOpen, setTrackingOpen] = useState57(false);
12053
+ const [communicationOpen, setCommunicationOpen] = useState57(false);
12054
+ const [activeComponent, setActiveComponent] = useState57("workflowType");
11817
12055
  const renderMenuItemold = (item) => {
11818
12056
  const Icon = item.icon;
11819
12057
  return /* @__PURE__ */ jsxs84("button", { type: "button", className: `fc:flex fc:h-[48px] fc:w-full fc:items-center fc:gap-[8px] fc:rounded-[9px] fc:px-[8px] fc:text-left fc:transition-colors fc:duration-150${router.pathname === item.path ? "bg-blue-50 text-blue-600" : "text-[#344261] hover:bg-[#F6F8FC]"}`, onClick: () => router.push(item.path), children: [
@@ -11895,7 +12133,7 @@ function Sidebar({
11895
12133
  open && /* @__PURE__ */ jsx85("div", { className: "fc:ml-[2px] fc:border-l fc:border-[#E5E9F1] fc:pl-[2px]", children: items.map(renderMenuItem) })
11896
12134
  ] });
11897
12135
  };
11898
- return /* @__PURE__ */ jsxs84(Fragment7, { children: [
12136
+ return /* @__PURE__ */ jsxs84(Fragment8, { children: [
11899
12137
  /* @__PURE__ */ jsxs84("aside", { className: `fc:flex fc:h-screen fc:flex-col fc:overflow-hidden fc:border-r fc:border-[#E5E9F1] fc:bg-white fc:font-sans fc:text-[#273657] fc:transition-all fc:duration-300 fc:ease-in-out ${isOpen ? "fc:w-[285px] fc:min-w-[285px] fc:translate-x-0 fc:opacity-100" : "fc:w-0 fc:min-w-0 fc:-translate-x-full fc:opacity-0"}`, children: [
11900
12138
  /* @__PURE__ */ jsxs84("header", { className: "fc:flex fc:h-[84px] fc:items-center fc:justify-between fc:border-b fc:border-[#EDF0F5] fc:px-[14px]", children: [
11901
12139
  /* @__PURE__ */ jsxs84("div", { className: "fc:flex fc:items-center fc:gap-2", children: [
@@ -11939,10 +12177,10 @@ function Sidebar({
11939
12177
  }
11940
12178
 
11941
12179
  // src/components/Layout.jsx
11942
- import { useState as useState57 } from "react";
12180
+ import { useState as useState58 } from "react";
11943
12181
  import { jsx as jsx86 } from "react/jsx-runtime";
11944
12182
  var Layout = ({ children }) => {
11945
- const [isOpen, setIsOpen] = useState57(true);
12183
+ const [isOpen, setIsOpen] = useState58(true);
11946
12184
  return /* @__PURE__ */ jsx86("div", { className: "flowcore fc:flex fc:min-h-screen", children: /* @__PURE__ */ jsx86(
11947
12185
  Sidebar,
11948
12186
  {