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.
package/dist/pkg-index.js CHANGED
@@ -55,14 +55,13 @@ __export(pkg_index_exports, {
55
55
  module.exports = __toCommonJS(pkg_index_exports);
56
56
 
57
57
  // src/components/Sidebar.jsx
58
- var import_react86 = require("react");
59
- var import_react87 = require("@remixicon/react");
58
+ var import_react85 = require("react");
59
+ var import_react86 = require("@remixicon/react");
60
60
  var import_router = require("next/router");
61
61
 
62
62
  // src/components/workflow/WorkflowMain.jsx
63
63
  var import_react9 = __toESM(require("react"));
64
- var import_react10 = require("react");
65
- var import_sweetalert2 = __toESM(require("sweetalert2"));
64
+ var import_sweetalert23 = __toESM(require("sweetalert2"));
66
65
 
67
66
  // src/components/Service/ApiEndpointsProvider.js
68
67
  var STORAGE_KEY = "FLOWCORE_API_ENDPOINTS";
@@ -149,155 +148,11 @@ function SearchBar({ searchQuery, setSearchQuery }) {
149
148
  }
150
149
 
151
150
  // src/components/workflow/WorkflowTable.jsx
152
- var import_react4 = __toESM(require("react"));
151
+ var import_react3 = __toESM(require("react"));
153
152
 
154
- // src/components/workflow/AddEditModal.jsx
153
+ // src/components/workflow/DeleteModal.jsx
155
154
  var import_react2 = __toESM(require("react"));
156
155
  var import_jsx_runtime2 = require("react/jsx-runtime");
157
- function AddEditModal({
158
- isOpen,
159
- onClose,
160
- onSave,
161
- editData
162
- }) {
163
- const [formData, setFormData] = (0, import_react2.useState)({
164
- name: "",
165
- code: "",
166
- type: "",
167
- version: "",
168
- published: true,
169
- status: true
170
- });
171
- (0, import_react2.useEffect)(() => {
172
- if (editData) {
173
- setFormData(editData);
174
- }
175
- }, [editData]);
176
- if (!isOpen) return null;
177
- const handleChange = (e) => {
178
- const { name, value, type, checked } = e.target;
179
- setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
180
- [name]: type === "checkbox" ? checked : value
181
- }));
182
- };
183
- const handleSave = () => {
184
- onSave(formData);
185
- onClose();
186
- };
187
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fc:fixed fc:inset-0 fc:bg-black/40 fc:flex fc:items-center fc:justify-center fc:z-50", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:bg-white fc:w-[550px] fc:rounded-xl fc:shadow-xl fc:p-6", children: [
188
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center fc:mb-6", children: [
189
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "fc:text-xl fc:font-bold fc:text-slate-800", children: "Edit Workflow" }),
190
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
191
- "button",
192
- {
193
- onClick: onClose,
194
- className: "fc:text-slate-500 hover:fc:text-red-500 fc:text-xl",
195
- children: "\u2715"
196
- }
197
- )
198
- ] }),
199
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:mb-4", children: [
200
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Workflow Name" }),
201
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
202
- "input",
203
- {
204
- type: "text",
205
- name: "name",
206
- value: formData.name,
207
- onChange: handleChange,
208
- 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"
209
- }
210
- )
211
- ] }),
212
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:mb-4", children: [
213
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Workflow Code" }),
214
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
215
- "input",
216
- {
217
- type: "text",
218
- name: "code",
219
- value: formData.code,
220
- onChange: handleChange,
221
- 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"
222
- }
223
- )
224
- ] }),
225
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:mb-4", children: [
226
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Workflow Type" }),
227
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
228
- "input",
229
- {
230
- type: "text",
231
- name: "type",
232
- value: formData.type,
233
- onChange: handleChange,
234
- 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"
235
- }
236
- )
237
- ] }),
238
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:mb-4", children: [
239
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "fc:block fc:text-sm fc:font-medium fc:mb-2", children: "Version" }),
240
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
241
- "input",
242
- {
243
- type: "number",
244
- name: "version",
245
- value: formData.version,
246
- onChange: handleChange,
247
- 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"
248
- }
249
- )
250
- ] }),
251
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-3 fc:mb-4", children: [
252
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "fc:text-sm fc:font-medium", children: "Published" }),
253
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
254
- "input",
255
- {
256
- type: "checkbox",
257
- name: "published",
258
- checked: formData.published,
259
- onChange: handleChange
260
- }
261
- ),
262
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: formData.published ? "Yes" : "No" })
263
- ] }),
264
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-3 fc:mb-8", children: [
265
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("label", { className: "fc:text-sm fc:font-medium", children: "Status" }),
266
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
267
- "input",
268
- {
269
- type: "checkbox",
270
- name: "status",
271
- checked: formData.status,
272
- onChange: handleChange
273
- }
274
- ),
275
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { children: formData.status ? "Active" : "Inactive" })
276
- ] }),
277
- /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:flex fc:justify-end fc:gap-3", children: [
278
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
279
- "button",
280
- {
281
- onClick: onClose,
282
- className: "fc:px-5 fc:py-2 fc:rounded-lg fc:border fc:border-slate-300 hover:fc:bg-slate-100",
283
- children: "Cancel"
284
- }
285
- ),
286
- /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
287
- "button",
288
- {
289
- onClick: handleSave,
290
- className: "fc:px-5 fc:py-2 fc:rounded-lg fc:bg-blue-600 hover:fc:bg-blue-700 fc:text-white",
291
- children: "Save"
292
- }
293
- )
294
- ] })
295
- ] }) });
296
- }
297
-
298
- // src/components/workflow/DeleteModal.jsx
299
- var import_react3 = __toESM(require("react"));
300
- var import_jsx_runtime3 = require("react/jsx-runtime");
301
156
  function DeleteModal({
302
157
  isOpen,
303
158
  onClose,
@@ -305,10 +160,10 @@ function DeleteModal({
305
160
  workflowName = "Citizen Petition"
306
161
  }) {
307
162
  if (!isOpen) return null;
308
- return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center", children: [
309
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "fc:absolute fc:inset-0 fc:bg-black/25 fc:backdrop-blur-sm" }),
310
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("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: [
311
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
163
+ return /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center", children: [
164
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fc:absolute fc:inset-0 fc:bg-black/25 fc:backdrop-blur-sm" }),
165
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("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: [
166
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
312
167
  "button",
313
168
  {
314
169
  onClick: onClose,
@@ -316,21 +171,21 @@ function DeleteModal({
316
171
  children: "\xD7"
317
172
  }
318
173
  ),
319
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "fc:flex fc:justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("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__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fc:text-2xl", children: "\u26A0\uFE0F" }) }) }),
320
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h2", { className: "fc:text-[31px] fc:font-semibold fc:text-center fc:mt-5 fc:text-gray-900", children: "Delete Workflow" }),
321
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("p", { className: "fc:text-center fc:text-gray-500 fc:text-sm fc:mt-3", children: [
174
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("div", { className: "fc:flex fc:justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("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__ */ (0, import_jsx_runtime2.jsx)("span", { className: "fc:text-2xl", children: "\u26A0\uFE0F" }) }) }),
175
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("h2", { className: "fc:text-[31px] fc:font-semibold fc:text-center fc:mt-5 fc:text-gray-900", children: "Delete Workflow" }),
176
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("p", { className: "fc:text-center fc:text-gray-500 fc:text-sm fc:mt-3", children: [
322
177
  "Are you sure you want to delete",
323
178
  " ",
324
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "fc:font-semibold fc:text-gray-700", children: [
179
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("span", { className: "fc:font-semibold fc:text-gray-700", children: [
325
180
  '"',
326
181
  workflowName,
327
182
  '"'
328
183
  ] }),
329
184
  "?"
330
185
  ] }),
331
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "fc:text-center fc:text-gray-400 fc:text-sm fc:mt-1", children: "This action cannot be undone." }),
332
- /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:flex fc:gap-3 fc:mt-8", children: [
333
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
186
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("p", { className: "fc:text-center fc:text-gray-400 fc:text-sm fc:mt-1", children: "This action cannot be undone." }),
187
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)("div", { className: "fc:flex fc:gap-3 fc:mt-8", children: [
188
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
334
189
  "button",
335
190
  {
336
191
  onClick: onClose,
@@ -338,7 +193,7 @@ function DeleteModal({
338
193
  children: "Cancel"
339
194
  }
340
195
  ),
341
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
196
+ /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
342
197
  "button",
343
198
  {
344
199
  onClick: () => {
@@ -355,8 +210,8 @@ function DeleteModal({
355
210
  }
356
211
 
357
212
  // src/components/workflow/WorkflowTable.jsx
358
- var import_jsx_runtime4 = require("react/jsx-runtime");
359
- function WorkflowTable({ pageSize, searchQuery, apiData }) {
213
+ var import_jsx_runtime3 = require("react/jsx-runtime");
214
+ function WorkflowTable({ pageSize, searchQuery, apiData, onEdit, onDeleteApi }) {
360
215
  const initialData = [
361
216
  {
362
217
  id: "1",
@@ -467,19 +322,18 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
467
322
  status: true
468
323
  }
469
324
  ];
470
- const [data, setData] = (0, import_react4.useState)(apiData || initialData);
471
- import_react4.default.useEffect(() => {
325
+ const [data, setData] = (0, import_react3.useState)(apiData || initialData);
326
+ import_react3.default.useEffect(() => {
472
327
  if (apiData) setData(apiData);
473
328
  }, [apiData]);
474
329
  const filteredData = data.filter(
475
330
  (item) => item.name.toLowerCase().includes((searchQuery || "").toLowerCase()) || item.code.toLowerCase().includes((searchQuery || "").toLowerCase())
476
331
  );
477
- const [sortColumn, setSortColumn] = (0, import_react4.useState)("");
478
- const [sortDirection, setSortDirection] = (0, import_react4.useState)("asc");
479
- const [currentPage, setCurrentPage] = (0, import_react4.useState)(1);
480
- const [editOpen, setEditOpen] = (0, import_react4.useState)(false);
481
- const [deleteOpen, setDeleteOpen] = (0, import_react4.useState)(false);
482
- const [selectedWorkflow, setSelectedWorkflow] = (0, import_react4.useState)(null);
332
+ const [sortColumn, setSortColumn] = (0, import_react3.useState)("");
333
+ const [sortDirection, setSortDirection] = (0, import_react3.useState)("asc");
334
+ const [currentPage, setCurrentPage] = (0, import_react3.useState)(1);
335
+ const [deleteOpen, setDeleteOpen] = (0, import_react3.useState)(false);
336
+ const [selectedWorkflow, setSelectedWorkflow] = (0, import_react3.useState)(null);
483
337
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
484
338
  const startIndex = (currentPage - 1) * pageSize;
485
339
  const visibleData = filteredData.slice(
@@ -505,8 +359,8 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
505
359
  };
506
360
  const getSortIcon = (column) => {
507
361
  if (sortColumn !== column)
508
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-slate-500 fc:ml-1", children: "\u25B2" });
509
- return sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25B2" }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25BC" });
362
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fc:text-slate-500 fc:ml-1", children: "\u25B2" });
363
+ return sortDirection === "asc" ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25B2" }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "fc:text-blue-600 fc:ml-1", children: "\u25BC" });
510
364
  };
511
365
  const toggleSwitch = (id) => {
512
366
  setData(
@@ -518,22 +372,21 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
518
372
  );
519
373
  };
520
374
  const handleEdit = (workflow) => {
521
- setSelectedWorkflow(workflow);
522
- setEditOpen(true);
375
+ if (onEdit) {
376
+ onEdit(workflow);
377
+ return;
378
+ }
523
379
  };
524
380
  const handleDelete = (workflow) => {
525
381
  setSelectedWorkflow(workflow);
526
382
  setDeleteOpen(true);
527
383
  };
528
- const handleUpdate = (updatedWorkflow) => {
529
- setData(
530
- (prev) => prev.map(
531
- (item) => item.id === updatedWorkflow.id ? updatedWorkflow : item
532
- )
533
- );
534
- setEditOpen(false);
535
- };
536
- const confirmDelete = () => {
384
+ const confirmDelete = async () => {
385
+ if (onDeleteApi) {
386
+ await onDeleteApi(selectedWorkflow);
387
+ setDeleteOpen(false);
388
+ return;
389
+ }
537
390
  setData(
538
391
  (prev) => prev.filter(
539
392
  (item) => item.id !== selectedWorkflow.id
@@ -541,82 +394,82 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
541
394
  );
542
395
  setDeleteOpen(false);
543
396
  };
544
- return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_jsx_runtime4.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:space-y-5", children: [
545
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:w-full fc:border fc:border-slate-200 fc:rounded-2xl fc:overflow-hidden", children: [
546
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "fc:max-h-[420px] fc:overflow-y-auto fc:overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("table", { className: "fc:w-full fc:border-collapse fc:bg-white", children: [
547
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("thead", { className: "fc:sticky fc:top-0 fc:z-10 fc:bg-slate-50", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("tr", { className: "fc:border-b fc:border-slate-200 fc:text-xs fc:uppercase fc:text-slate-500", children: [
548
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "S.No" }),
549
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
397
+ return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:space-y-5", children: [
398
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:w-full fc:border fc:border-slate-200 fc:rounded-2xl fc:overflow-hidden", children: [
399
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "fc:max-h-[420px] fc:overflow-y-auto fc:overflow-x-auto", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("table", { className: "fc:w-full fc:border-collapse fc:bg-white", children: [
400
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("thead", { className: "fc:sticky fc:top-0 fc:z-10 fc:bg-slate-50", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("tr", { className: "fc:border-b fc:border-slate-200 fc:text-xs fc:uppercase fc:text-slate-500", children: [
401
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "S.No" }),
402
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
550
403
  "th",
551
404
  {
552
405
  onClick: () => handleSort("name"),
553
406
  className: "fc:px-5 fc:py-4 fc:cursor-pointer",
554
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:items-center", children: [
407
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:flex fc:items-center", children: [
555
408
  "Workflow Name",
556
409
  getSortIcon("name")
557
410
  ] })
558
411
  }
559
412
  ),
560
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
413
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
561
414
  "th",
562
415
  {
563
416
  onClick: () => handleSort("code"),
564
417
  className: "fc:px-5 fc:py-4 fc:cursor-pointer",
565
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:items-center", children: [
418
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:flex fc:items-center", children: [
566
419
  "Workflow Code",
567
420
  getSortIcon("code")
568
421
  ] })
569
422
  }
570
423
  ),
571
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
424
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
572
425
  "th",
573
426
  {
574
427
  onClick: () => handleSort("type"),
575
428
  className: "fc:px-5 fc:py-4 fc:cursor-pointer",
576
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:items-center", children: [
429
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:flex fc:items-center", children: [
577
430
  "Workflow Type",
578
431
  getSortIcon("type")
579
432
  ] })
580
433
  }
581
434
  ),
582
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
435
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
583
436
  "th",
584
437
  {
585
438
  onClick: () => handleSort("version"),
586
439
  className: "fc:px-5 fc:py-4 fc:text-center fc:cursor-pointer",
587
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:justify-center fc:items-center", children: [
440
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:flex fc:justify-center fc:items-center", children: [
588
441
  "Version",
589
442
  getSortIcon("version")
590
443
  ] })
591
444
  }
592
445
  ),
593
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Published" }),
594
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Status" }),
595
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Action" })
446
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Published" }),
447
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Status" }),
448
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("th", { className: "fc:px-5 fc:py-4 fc:text-center", children: "Action" })
596
449
  ] }) }),
597
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("tbody", { className: "fc:divide-y fc:divide-slate-100", children: visibleData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
450
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("tbody", { className: "fc:divide-y fc:divide-slate-100", children: visibleData.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
598
451
  "tr",
599
452
  {
600
453
  className: "hover:fc:bg-slate-50",
601
454
  children: [
602
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: startIndex + index + 1 }),
603
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4 fc:font-semibold", children: item.name }),
604
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4", children: item.code }),
605
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4", children: item.type }),
606
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: item.version }),
607
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
455
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: startIndex + index + 1 }),
456
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4 fc:font-semibold", children: item.name }),
457
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4", children: item.code }),
458
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4", children: item.type }),
459
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: item.version }),
460
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
608
461
  "span",
609
462
  {
610
463
  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"}`,
611
464
  children: item.published ? "Yes" : "No"
612
465
  }
613
466
  ) }),
614
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
467
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4 fc:text-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
615
468
  "button",
616
469
  {
617
470
  onClick: () => toggleSwitch(item.id),
618
471
  className: `fc:w-11 fc:h-6 fc:rounded-full fc:relative ${item.status ? "fc:bg-blue-600" : "fc:bg-gray-300"}`,
619
- children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
472
+ children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
620
473
  "span",
621
474
  {
622
475
  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"}`
@@ -624,8 +477,8 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
624
477
  )
625
478
  }
626
479
  ) }),
627
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("td", { className: "fc:px-5 fc:py-4", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:justify-center fc:gap-2", children: [
628
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
480
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("td", { className: "fc:px-5 fc:py-4", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "fc:flex fc:justify-center fc:gap-2", children: [
481
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
629
482
  "button",
630
483
  {
631
484
  onClick: () => handleEdit(item),
@@ -633,7 +486,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
633
486
  children: "Edit"
634
487
  }
635
488
  ),
636
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
489
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
637
490
  "button",
638
491
  {
639
492
  onClick: () => handleDelete(item),
@@ -647,8 +500,8 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
647
500
  item.id
648
501
  )) })
649
502
  ] }) }),
650
- /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
651
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
503
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("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: [
504
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
652
505
  "button",
653
506
  {
654
507
  onClick: () => setCurrentPage((prev) => Math.max(prev - 1, 1)),
@@ -656,7 +509,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
656
509
  children: "\u2039 Prev"
657
510
  }
658
511
  ),
659
- Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
512
+ Array.from({ length: totalPages }, (_, i) => i + 1).map((page) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
660
513
  "button",
661
514
  {
662
515
  onClick: () => setCurrentPage(page),
@@ -665,7 +518,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
665
518
  },
666
519
  page
667
520
  )),
668
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
521
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
669
522
  "button",
670
523
  {
671
524
  onClick: () => setCurrentPage((prev) => Math.min(prev + 1, totalPages)),
@@ -673,7 +526,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
673
526
  children: "Next \u203A"
674
527
  }
675
528
  ),
676
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
529
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
677
530
  "button",
678
531
  {
679
532
  onClick: () => setCurrentPage(totalPages),
@@ -683,16 +536,7 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
683
536
  )
684
537
  ] })
685
538
  ] }),
686
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
687
- AddEditModal,
688
- {
689
- isOpen: editOpen,
690
- editData: selectedWorkflow,
691
- onClose: () => setEditOpen(false),
692
- onSave: handleUpdate
693
- }
694
- ),
695
- /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
539
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
696
540
  DeleteModal,
697
541
  {
698
542
  isOpen: deleteOpen,
@@ -705,26 +549,330 @@ function WorkflowTable({ pageSize, searchQuery, apiData }) {
705
549
  }
706
550
 
707
551
  // src/components/workflow/AddWorkflowModal.jsx
552
+ var import_react4 = __toESM(require("react"));
553
+ var import_sweetalert2 = __toESM(require("sweetalert2"));
554
+ var import_jsx_runtime4 = require("react/jsx-runtime");
555
+ var INITIAL_FORM = {
556
+ workflowTypeId: "",
557
+ workflowCode: "",
558
+ workflowName: "",
559
+ version: "1",
560
+ published: "false",
561
+ status: "active",
562
+ defaultPriority: "medium",
563
+ description: ""
564
+ };
565
+ function AddWorkflowModal({
566
+ isOpen,
567
+ onClose,
568
+ workflowTypes = [],
569
+ onSave
570
+ }) {
571
+ const [formData, setFormData] = (0, import_react4.useState)(INITIAL_FORM);
572
+ const [errors, setErrors] = (0, import_react4.useState)({});
573
+ const [isSubmitting, setIsSubmitting] = (0, import_react4.useState)(false);
574
+ const [submitError, setSubmitError] = (0, import_react4.useState)("");
575
+ (0, import_react4.useEffect)(() => {
576
+ if (!isOpen) {
577
+ setFormData(INITIAL_FORM);
578
+ setErrors({});
579
+ setSubmitError("");
580
+ setIsSubmitting(false);
581
+ }
582
+ }, [isOpen]);
583
+ if (!isOpen) return null;
584
+ const handleChange = (event) => {
585
+ const { name, value } = event.target;
586
+ if (name === "description" && value.length > 500) return;
587
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [name]: value }));
588
+ setErrors((prev) => __spreadProps(__spreadValues({}, prev), { [name]: "" }));
589
+ setSubmitError("");
590
+ };
591
+ const validate = () => {
592
+ const nextErrors = {};
593
+ if (!formData.workflowTypeId) nextErrors.workflowTypeId = "Workflow type is required";
594
+ if (!formData.workflowCode.trim()) nextErrors.workflowCode = "Workflow code is required";
595
+ if (!formData.workflowName.trim()) nextErrors.workflowName = "Workflow name is required";
596
+ if (!formData.version.trim()) nextErrors.version = "Version is required";
597
+ setErrors(nextErrors);
598
+ return Object.keys(nextErrors).length === 0;
599
+ };
600
+ const handleSubmit = async (event) => {
601
+ var _a, _b;
602
+ event.preventDefault();
603
+ if (!validate()) return;
604
+ if (!onSave) {
605
+ setSubmitError("Save handler not configured.");
606
+ return;
607
+ }
608
+ const payload = {
609
+ workflowTypeId: formData.workflowTypeId,
610
+ workflowCode: formData.workflowCode.trim(),
611
+ workflowName: formData.workflowName.trim(),
612
+ version: formData.version.trim(),
613
+ published: formData.published === "true",
614
+ status: formData.status === "active",
615
+ defaultPriority: formData.defaultPriority,
616
+ description: formData.description.trim(),
617
+ createdBy: "System"
618
+ };
619
+ try {
620
+ setIsSubmitting(true);
621
+ const result = await onSave(payload);
622
+ if (result) {
623
+ onClose();
624
+ }
625
+ } catch (error) {
626
+ 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.";
627
+ setSubmitError(message);
628
+ await import_sweetalert2.default.fire("Error", message, "error");
629
+ } finally {
630
+ setIsSubmitting(false);
631
+ }
632
+ };
633
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
634
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
635
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
636
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100", children: [
637
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
638
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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__ */ (0, import_jsx_runtime4.jsx)("svg", { className: "fc:w-6 fc:h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }) }) }),
639
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
640
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800", children: "Add Workflow" }),
641
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5", children: "Create a new workflow and configure its details" })
642
+ ] })
643
+ ] }),
644
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" })
645
+ ] }),
646
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
647
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
648
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
649
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u{1F4CB}" }),
650
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "Workflow Information" })
651
+ ] }),
652
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
653
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
654
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
655
+ "Workflow Type ",
656
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-red-500", children: "*" })
657
+ ] }),
658
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { name: "workflowTypeId", value: formData.workflowTypeId, onChange: handleChange, className: inputClass(errors.workflowTypeId), children: [
659
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "", children: "Select workflow type" }),
660
+ workflowTypes.length > 0 ? workflowTypes.map((type) => {
661
+ var _a, _b;
662
+ const id = (_a = type.workflowTypeId) != null ? _a : type.WorkflowTypeId;
663
+ const label = (_b = type.workflowTypeName) != null ? _b : type.WorkflowTypeName;
664
+ return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: id, children: label }, id);
665
+ }) : /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_jsx_runtime4.Fragment, { children: [
666
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "petition", children: "Petition" }),
667
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "building", children: "Building Permission" }),
668
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "leave", children: "Leave" })
669
+ ] })
670
+ ] }),
671
+ errors.workflowTypeId && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowTypeId })
672
+ ] }),
673
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
674
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
675
+ "Workflow Code ",
676
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-red-500", children: "*" })
677
+ ] }),
678
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { name: "workflowCode", value: formData.workflowCode, onChange: handleChange, type: "text", placeholder: "Enter workflow code", className: inputClass(errors.workflowCode) }),
679
+ errors.workflowCode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowCode })
680
+ ] })
681
+ ] }),
682
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
683
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
684
+ "Workflow Name ",
685
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-red-500", children: "*" })
686
+ ] }),
687
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { name: "workflowName", value: formData.workflowName, onChange: handleChange, type: "text", placeholder: "Enter workflow name", className: inputClass(errors.workflowName) }),
688
+ errors.workflowName && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowName })
689
+ ] }),
690
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
691
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
692
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
693
+ "Version ",
694
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-red-500", children: "*" })
695
+ ] }),
696
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("input", { name: "version", type: "text", value: formData.version, onChange: handleChange, className: inputClass(errors.version) }),
697
+ errors.version && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.version })
698
+ ] }),
699
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
700
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
701
+ "Published ",
702
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-red-500", children: "*" })
703
+ ] }),
704
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { name: "published", value: formData.published, onChange: handleChange, className: inputClass(), children: [
705
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "false", children: "No" }),
706
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "true", children: "Yes" })
707
+ ] }),
708
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Make workflow active for use" })
709
+ ] })
710
+ ] })
711
+ ] }),
712
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
713
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center", children: [
714
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700", children: "Description" }),
715
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("span", { className: "fc:text-[10px] fc:text-slate-400", children: [
716
+ formData.description.length,
717
+ " / 500"
718
+ ] })
719
+ ] }),
720
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("textarea", { name: "description", rows: 3, value: formData.description, onChange: handleChange, placeholder: "Enter workflow description (optional)", className: inputClass() }),
721
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-400", children: "Provide additional information about this workflow" })
722
+ ] }),
723
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
724
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
725
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "\u2699\uFE0F" }),
726
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { children: "Status & Settings" })
727
+ ] }),
728
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
729
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
730
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
731
+ "Status ",
732
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "fc:text-red-500", children: "*" })
733
+ ] }),
734
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { name: "status", value: formData.status, onChange: handleChange, className: inputClass(), children: [
735
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "active", children: "Active" }),
736
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "inactive", children: "Inactive" })
737
+ ] }),
738
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Set the initial status of this workflow" })
739
+ ] }),
740
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
741
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: "Default Priority" }),
742
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("select", { name: "defaultPriority", value: formData.defaultPriority, onChange: handleChange, className: inputClass(), children: [
743
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "medium", children: "Medium" }),
744
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "high", children: "High" }),
745
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("option", { value: "low", children: "Low" })
746
+ ] }),
747
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Default priority for tasks in this workflow" })
748
+ ] })
749
+ ] })
750
+ ] })
751
+ ] }),
752
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("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: [
753
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" }),
754
+ /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("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" })
755
+ ] }),
756
+ submitError && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "fc:px-8 fc:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("p", { className: "fc:text-sm fc:text-red-600", children: submitError }) })
757
+ ] })
758
+ ] });
759
+ }
760
+ 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" : ""}`;
761
+
762
+ // src/components/workflow/EditWorkflowModal.jsx
708
763
  var import_react5 = __toESM(require("react"));
764
+ var import_sweetalert22 = __toESM(require("sweetalert2"));
709
765
  var import_jsx_runtime5 = require("react/jsx-runtime");
710
- function AddWorkflowModal({
766
+ var INITIAL_FORM2 = {
767
+ workflowTypeId: "",
768
+ workflowCode: "",
769
+ workflowName: "",
770
+ version: "",
771
+ published: "false",
772
+ status: "active",
773
+ defaultPriority: "medium",
774
+ description: ""
775
+ };
776
+ function EditWorkflowModal({
711
777
  isOpen,
712
778
  onClose,
713
- workflowTypes = []
779
+ onSave,
780
+ workflowTypes = [],
781
+ editData = null
714
782
  }) {
783
+ const [formData, setFormData] = (0, import_react5.useState)(INITIAL_FORM2);
784
+ const [errors, setErrors] = (0, import_react5.useState)({});
785
+ const [isSubmitting, setIsSubmitting] = (0, import_react5.useState)(false);
786
+ const [submitError, setSubmitError] = (0, import_react5.useState)("");
787
+ (0, import_react5.useEffect)(() => {
788
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
789
+ if (editData) {
790
+ setFormData({
791
+ workflowTypeId: (_d = (_c = (_a = editData.workflowTypeId) != null ? _a : editData.WorkflowTypeId) != null ? _c : (_b = editData.workflowType) == null ? void 0 : _b.workflowTypeId) != null ? _d : editData.workflowTypeId,
792
+ workflowCode: (_g = (_f = (_e = editData.workflowCode) != null ? _e : editData.WorkflowCode) != null ? _f : editData.code) != null ? _g : "",
793
+ workflowName: (_j = (_i = (_h = editData.workflowName) != null ? _h : editData.WorkflowName) != null ? _i : editData.name) != null ? _j : "",
794
+ version: (_m = (_l = (_k = editData.version) != null ? _k : editData.WorkflowVersion) != null ? _l : editData.workflowVersion) != null ? _m : "1",
795
+ published: ((_o = (_n = editData.published) != null ? _n : editData.isPublished) != null ? _o : editData.IsPublished) ? "true" : "false",
796
+ status: ((_q = (_p = editData.status) != null ? _p : editData.isActive) != null ? _q : editData.IsActive) ? "active" : "inactive",
797
+ defaultPriority: (_s = (_r = editData.defaultPriority) != null ? _r : editData.defaultPriority) != null ? _s : "medium",
798
+ description: (_u = (_t = editData.description) != null ? _t : editData.Description) != null ? _u : ""
799
+ });
800
+ setErrors({});
801
+ setSubmitError("");
802
+ }
803
+ }, [editData]);
804
+ (0, import_react5.useEffect)(() => {
805
+ if (!isOpen) {
806
+ setFormData(INITIAL_FORM2);
807
+ setErrors({});
808
+ setSubmitError("");
809
+ setIsSubmitting(false);
810
+ }
811
+ }, [isOpen]);
715
812
  if (!isOpen) return null;
813
+ const handleChange = (event) => {
814
+ const { name, value } = event.target;
815
+ if (name === "description" && value.length > 500) return;
816
+ setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [name]: value }));
817
+ setErrors((prev) => __spreadProps(__spreadValues({}, prev), { [name]: "" }));
818
+ setSubmitError("");
819
+ };
820
+ const validate = () => {
821
+ const nextErrors = {};
822
+ if (!formData.workflowTypeId) nextErrors.workflowTypeId = "Workflow type is required";
823
+ if (!formData.workflowCode.trim()) nextErrors.workflowCode = "Workflow code is required";
824
+ if (!formData.workflowName.trim()) nextErrors.workflowName = "Workflow name is required";
825
+ if (!formData.version.trim()) nextErrors.version = "Version is required";
826
+ setErrors(nextErrors);
827
+ return Object.keys(nextErrors).length === 0;
828
+ };
829
+ const handleSubmit = async (event) => {
830
+ var _a, _b, _c, _d, _e, _f;
831
+ event.preventDefault();
832
+ if (!validate()) return;
833
+ if (!onSave) {
834
+ setSubmitError("Save handler not configured.");
835
+ return;
836
+ }
837
+ 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;
838
+ const payload = {
839
+ workflowId,
840
+ workflowTypeId: formData.workflowTypeId,
841
+ workflowCode: formData.workflowCode.trim(),
842
+ workflowName: formData.workflowName.trim(),
843
+ version: formData.version.trim(),
844
+ published: formData.published === "true",
845
+ status: formData.status === "active",
846
+ defaultPriority: formData.defaultPriority,
847
+ description: formData.description.trim(),
848
+ updatedBy: (_d = (_c = editData == null ? void 0 : editData.updatedBy) != null ? _c : editData == null ? void 0 : editData.createdBy) != null ? _d : "System"
849
+ };
850
+ try {
851
+ setIsSubmitting(true);
852
+ const result = await onSave(payload);
853
+ if (result) {
854
+ onClose();
855
+ }
856
+ } catch (error) {
857
+ 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.";
858
+ setSubmitError(message);
859
+ await import_sweetalert22.default.fire("Error", message, "error");
860
+ } finally {
861
+ setIsSubmitting(false);
862
+ }
863
+ };
716
864
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
717
865
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
718
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
866
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
719
867
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-8 fc:py-6 fc:border-b fc:border-slate-100", children: [
720
868
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:flex fc:items-center fc:gap-4", children: [
721
869
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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__ */ (0, import_jsx_runtime5.jsx)("svg", { className: "fc:w-6 fc:h-6", fill: "none", stroke: "currentColor", strokeWidth: "2", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }) }) }),
722
870
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
723
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800", children: "Add Workflow" }),
724
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5", children: "Create a new workflow and configure its details" })
871
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("h2", { className: "fc:text-xl fc:font-extrabold fc:text-slate-800", children: "Edit Workflow" }),
872
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-xs fc:text-slate-400 fc:mt-0.5", children: "Update the workflow details" })
725
873
  ] })
726
874
  ] }),
727
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" })
875
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" })
728
876
  ] }),
729
877
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
730
878
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
@@ -732,29 +880,34 @@ function AddWorkflowModal({
732
880
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u{1F4CB}" }),
733
881
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Workflow Information" })
734
882
  ] }),
735
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:fc:grid-cols-2 fc:gap-5", children: [
883
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
736
884
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
737
885
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
738
886
  "Workflow Type ",
739
887
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-red-500", children: "*" })
740
888
  ] }),
741
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
889
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { name: "workflowTypeId", value: formData.workflowTypeId, onChange: handleChange, className: inputClass2(errors.workflowTypeId), children: [
742
890
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "", children: "Select workflow type" }),
743
- workflowTypes.length > 0 ? workflowTypes.map((type) => /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: type.workflowTypeId || type.WorkflowTypeId, children: type.workflowTypeName || type.WorkflowTypeName }, type.workflowTypeId || type.WorkflowTypeId)) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
891
+ workflowTypes.length > 0 ? workflowTypes.map((type) => {
892
+ var _a, _b;
893
+ const id = (_a = type.workflowTypeId) != null ? _a : type.WorkflowTypeId;
894
+ const label = (_b = type.workflowTypeName) != null ? _b : type.WorkflowTypeName;
895
+ return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: id, children: label }, id);
896
+ }) : /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(import_jsx_runtime5.Fragment, { children: [
744
897
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "petition", children: "Petition" }),
745
898
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "building", children: "Building Permission" }),
746
899
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "leave", children: "Leave" })
747
900
  ] })
748
901
  ] }),
749
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Choose the category this workflow belongs to" })
902
+ errors.workflowTypeId && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowTypeId })
750
903
  ] }),
751
904
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
752
905
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
753
906
  "Workflow Code ",
754
907
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-red-500", children: "*" })
755
908
  ] }),
756
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }),
757
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Unique code for this workflow (e.g., PET-001)" })
909
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "workflowCode", value: formData.workflowCode, onChange: handleChange, type: "text", placeholder: "Enter workflow code", className: inputClass2(errors.workflowCode) }),
910
+ errors.workflowCode && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowCode })
758
911
  ] })
759
912
  ] }),
760
913
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
@@ -762,24 +915,24 @@ function AddWorkflowModal({
762
915
  "Workflow Name ",
763
916
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-red-500", children: "*" })
764
917
  ] }),
765
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }),
766
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Enter a descriptive name for this workflow" })
918
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "workflowName", value: formData.workflowName, onChange: handleChange, type: "text", placeholder: "Enter workflow name", className: inputClass2(errors.workflowName) }),
919
+ errors.workflowName && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.workflowName })
767
920
  ] }),
768
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:fc:grid-cols-2 fc:gap-5", children: [
921
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
769
922
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
770
923
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
771
924
  "Version ",
772
925
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-red-500", children: "*" })
773
926
  ] }),
774
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }),
775
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-400 fc:mt-1", children: "Workflow version number" })
927
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("input", { name: "version", type: "text", value: formData.version, onChange: handleChange, className: inputClass2(errors.version) }),
928
+ errors.version && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-500 fc:mt-1", children: errors.version })
776
929
  ] }),
777
930
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
778
931
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
779
932
  "Published ",
780
933
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-red-500", children: "*" })
781
934
  ] }),
782
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
935
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { name: "published", value: formData.published, onChange: handleChange, className: inputClass2(), children: [
783
936
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "false", children: "No" }),
784
937
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "true", children: "Yes" })
785
938
  ] }),
@@ -790,9 +943,12 @@ function AddWorkflowModal({
790
943
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
791
944
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center", children: [
792
945
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700", children: "Description" }),
793
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-[10px] fc:text-slate-400", children: "0 / 500" })
946
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("span", { className: "fc:text-[10px] fc:text-slate-400", children: [
947
+ formData.description.length,
948
+ " / 500"
949
+ ] })
794
950
  ] }),
795
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }),
951
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("textarea", { name: "description", rows: 3, value: formData.description, onChange: handleChange, placeholder: "Enter workflow description (optional)", className: inputClass2() }),
796
952
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-[10px] fc:text-red-400", children: "Provide additional information about this workflow" })
797
953
  ] }),
798
954
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
@@ -800,13 +956,13 @@ function AddWorkflowModal({
800
956
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "\u2699\uFE0F" }),
801
957
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { children: "Status & Settings" })
802
958
  ] }),
803
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:fc:grid-cols-2 fc:gap-5", children: [
959
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { className: "fc:grid fc:grid-cols-1 md:fc:grid-cols-2 fc:gap-5", children: [
804
960
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
805
961
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: [
806
962
  "Status ",
807
963
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("span", { className: "fc:text-red-500", children: "*" })
808
964
  ] }),
809
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
965
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { name: "status", value: formData.status, onChange: handleChange, className: inputClass2(), children: [
810
966
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "active", children: "Active" }),
811
967
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "inactive", children: "Inactive" })
812
968
  ] }),
@@ -814,7 +970,7 @@ function AddWorkflowModal({
814
970
  ] }),
815
971
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("div", { children: [
816
972
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("label", { className: "fc:block fc:text-xs fc:font-bold fc:text-slate-700 fc:mb-1.5", children: "Default Priority" }),
817
- /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
973
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("select", { name: "defaultPriority", value: formData.defaultPriority, onChange: handleChange, className: inputClass2(), children: [
818
974
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "medium", children: "Medium" }),
819
975
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "high", children: "High" }),
820
976
  /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("option", { value: "low", children: "Low" })
@@ -825,12 +981,14 @@ function AddWorkflowModal({
825
981
  ] })
826
982
  ] }),
827
983
  /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)("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: [
828
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }),
829
- /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" })
830
- ] })
984
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" }),
985
+ /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("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" })
986
+ ] }),
987
+ submitError && /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { className: "fc:px-8 fc:pb-6", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("p", { className: "fc:text-sm fc:text-red-600", children: submitError }) })
831
988
  ] })
832
989
  ] });
833
990
  }
991
+ 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" : ""}`;
834
992
 
835
993
  // src/components/Common/commonheader.js
836
994
  var import_react8 = __toESM(require("react"));
@@ -1040,7 +1198,9 @@ function Workflow() {
1040
1198
  const [searchQuery, setSearchQuery] = (0, import_react9.useState)("");
1041
1199
  const [apiData, setApiData] = (0, import_react9.useState)([]);
1042
1200
  const [workflowTypes, setWorkflowTypes] = (0, import_react9.useState)([]);
1043
- (0, import_react10.useEffect)(() => {
1201
+ const [editModalOpen, setEditModalOpen] = (0, import_react9.useState)(false);
1202
+ const [selectedWorkflow, setSelectedWorkflow] = (0, import_react9.useState)(null);
1203
+ (0, import_react9.useEffect)(() => {
1044
1204
  (async () => {
1045
1205
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
1046
1206
  try {
@@ -1054,11 +1214,11 @@ function Workflow() {
1054
1214
  const typeRows = Array.isArray(typeValue) ? typeValue : (typeValue == null ? void 0 : typeValue.items) || (typeValue == null ? void 0 : typeValue.records) || [];
1055
1215
  setWorkflowTypes(typeRows);
1056
1216
  setApiData(rows.map((item) => {
1057
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2;
1058
- 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 });
1217
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p, _q, _r, _s, _t, _u;
1218
+ 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 });
1059
1219
  }));
1060
1220
  } catch (error) {
1061
- await import_sweetalert2.default.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");
1221
+ await import_sweetalert23.default.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");
1062
1222
  }
1063
1223
  })();
1064
1224
  }, [refreshKey]);
@@ -1067,6 +1227,71 @@ function Workflow() {
1067
1227
  console.log("Table data refreshed!");
1068
1228
  setRefreshKey((prev) => prev + 1);
1069
1229
  };
1230
+ const handleCreateApi = async (workflowPayload) => {
1231
+ var _a, _b, _c, _d, _e;
1232
+ try {
1233
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflow) == null ? void 0 : _c.create;
1234
+ if (!endpoint) throw new Error("Workflow create endpoint is not configured.");
1235
+ await getApiService().post(endpoint, workflowPayload);
1236
+ await import_sweetalert23.default.fire("Success", "Workflow created successfully.", "success");
1237
+ handleRefresh();
1238
+ return true;
1239
+ } catch (error) {
1240
+ await import_sweetalert23.default.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");
1241
+ return false;
1242
+ }
1243
+ };
1244
+ const handleUpdateApi = async (workflowPayload) => {
1245
+ var _a, _b, _c, _d, _e;
1246
+ try {
1247
+ const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflow) == null ? void 0 : _c.update;
1248
+ if (!endpoint) throw new Error("Workflow update endpoint is not configured.");
1249
+ await getApiService().put(endpoint, workflowPayload);
1250
+ await import_sweetalert23.default.fire("Success", "Workflow updated successfully.", "success");
1251
+ handleRefresh();
1252
+ return true;
1253
+ } catch (error) {
1254
+ await import_sweetalert23.default.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");
1255
+ return false;
1256
+ }
1257
+ };
1258
+ const handleDeleteApi = async (workflow) => {
1259
+ var _a, _b, _c, _d, _e, _f, _g, _h;
1260
+ try {
1261
+ const endpoints = getApiEndpoints();
1262
+ const deleteEndpoint = (_b = (_a = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _a.workflow) == null ? void 0 : _b.delete;
1263
+ const updateEndpoint = (_d = (_c = endpoints == null ? void 0 : endpoints.flowCore) == null ? void 0 : _c.workflow) == null ? void 0 : _d.update;
1264
+ const workflowId = (_f = (_e = workflow.workflowId) != null ? _e : workflow.WorkflowId) != null ? _f : workflow.id;
1265
+ if (deleteEndpoint) {
1266
+ try {
1267
+ await getApiService().delete(`${deleteEndpoint}/${workflowId}`);
1268
+ } catch (e) {
1269
+ await getApiService().delete(deleteEndpoint, { data: { workflowId } });
1270
+ }
1271
+ } else if (updateEndpoint) {
1272
+ await getApiService().put(updateEndpoint, __spreadProps(__spreadValues({}, workflow), { workflowId, isActive: false, updatedBy: workflow.updatedBy || workflow.createdBy || "System" }));
1273
+ } else {
1274
+ throw new Error("Workflow delete endpoint is not configured.");
1275
+ }
1276
+ await import_sweetalert23.default.fire("Success", "Workflow deleted successfully.", "success");
1277
+ handleRefresh();
1278
+ return true;
1279
+ } catch (error) {
1280
+ await import_sweetalert23.default.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");
1281
+ return false;
1282
+ }
1283
+ };
1284
+ const handleEdit = (workflow) => {
1285
+ setSelectedWorkflow(workflow);
1286
+ setEditModalOpen(true);
1287
+ };
1288
+ const handleCloseEdit = () => {
1289
+ setEditModalOpen(false);
1290
+ setSelectedWorkflow(null);
1291
+ };
1292
+ const handleCloseAdd = () => {
1293
+ setModalOpen(false);
1294
+ };
1070
1295
  return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fc:h-screen fc:bg-slate-50 fc:p-6 fc:flex fc:flex-col", children: [
1071
1296
  /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)("div", { className: "fc:flex fc:flex-col fc:flex-1 fc:gap-5 fc:overflow-hidden", children: [
1072
1297
  /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
@@ -1129,7 +1354,9 @@ function Workflow() {
1129
1354
  {
1130
1355
  apiData,
1131
1356
  pageSize,
1132
- searchQuery
1357
+ searchQuery,
1358
+ onEdit: handleEdit,
1359
+ onDeleteApi: handleDeleteApi
1133
1360
  },
1134
1361
  refreshKey
1135
1362
  ) }) })
@@ -1139,19 +1366,30 @@ function Workflow() {
1139
1366
  AddWorkflowModal,
1140
1367
  {
1141
1368
  isOpen: modalOpen,
1142
- onClose: () => setModalOpen(false),
1143
- workflowTypes
1369
+ onClose: handleCloseAdd,
1370
+ workflowTypes,
1371
+ onSave: handleCreateApi
1372
+ }
1373
+ ),
1374
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
1375
+ EditWorkflowModal,
1376
+ {
1377
+ isOpen: editModalOpen,
1378
+ onClose: handleCloseEdit,
1379
+ workflowTypes,
1380
+ editData: selectedWorkflow,
1381
+ onSave: handleUpdateApi
1144
1382
  }
1145
1383
  )
1146
1384
  ] });
1147
1385
  }
1148
1386
 
1149
1387
  // src/components/workflow-type/WorkflowTypeMains.js
1150
- var import_react16 = __toESM(require("react"));
1151
- var import_sweetalert23 = __toESM(require("sweetalert2"));
1388
+ var import_react15 = __toESM(require("react"));
1389
+ var import_sweetalert25 = __toESM(require("sweetalert2"));
1152
1390
 
1153
1391
  // src/components/workflow-type/SearchBar.jsx
1154
- var import_react11 = __toESM(require("react"));
1392
+ var import_react10 = __toESM(require("react"));
1155
1393
  var import_jsx_runtime10 = require("react/jsx-runtime");
1156
1394
  function SearchBar2({
1157
1395
  searchQuery,
@@ -1175,10 +1413,10 @@ function SearchBar2({
1175
1413
  }
1176
1414
 
1177
1415
  // src/components/workflow-type/WorkflowTypeTable.jsx
1178
- var import_react14 = __toESM(require("react"));
1416
+ var import_react13 = __toESM(require("react"));
1179
1417
 
1180
1418
  // src/components/workflow-type/DeleteWorkflowType.jsx
1181
- var import_react12 = __toESM(require("react"));
1419
+ var import_react11 = __toESM(require("react"));
1182
1420
  var import_jsx_runtime11 = require("react/jsx-runtime");
1183
1421
  var DeleteWorkflowType = ({
1184
1422
  isOpen,
@@ -1215,7 +1453,7 @@ var DeleteWorkflowType = ({
1215
1453
  var DeleteWorkflowType_default = DeleteWorkflowType;
1216
1454
 
1217
1455
  // src/components/workflow-type/EditWorkflowType.jsx
1218
- var import_react13 = __toESM(require("react"));
1456
+ var import_react12 = __toESM(require("react"));
1219
1457
  var import_jsx_runtime12 = require("react/jsx-runtime");
1220
1458
  var EditWorkflowType = ({
1221
1459
  isOpen,
@@ -1223,13 +1461,13 @@ var EditWorkflowType = ({
1223
1461
  onSave,
1224
1462
  selectedData
1225
1463
  }) => {
1226
- const [formData, setFormData] = (0, import_react13.useState)({
1464
+ const [formData, setFormData] = (0, import_react12.useState)({
1227
1465
  workflowTypeCode: "",
1228
1466
  workflowTypeName: "",
1229
1467
  description: "",
1230
1468
  isActive: true
1231
1469
  });
1232
- (0, import_react13.useEffect)(() => {
1470
+ (0, import_react12.useEffect)(() => {
1233
1471
  var _a, _b;
1234
1472
  if (selectedData) {
1235
1473
  setFormData({
@@ -1552,15 +1790,15 @@ function WorkflowTypeTable({
1552
1790
  updatedOn: "2026-01-29",
1553
1791
  updatedBy: "Officer"
1554
1792
  }];
1555
- const [data, setData] = (0, import_react14.useState)(apiData || initialData);
1556
- (0, import_react14.useEffect)(() => {
1793
+ const [data, setData] = (0, import_react13.useState)(apiData || initialData);
1794
+ (0, import_react13.useEffect)(() => {
1557
1795
  if (apiData) setData(apiData);
1558
1796
  }, [apiData]);
1559
- const [sortOrder, setSortOrder] = (0, import_react14.useState)("asc");
1560
- const [sortKey, setSortKey] = (0, import_react14.useState)("workflowTypeId");
1561
- const [selectedItem, setSelectedItem] = (0, import_react14.useState)(null);
1562
- const [isEditOpen, setIsEditOpen] = (0, import_react14.useState)(false);
1563
- const [isDeleteOpen, setIsDeleteOpen] = (0, import_react14.useState)(false);
1797
+ const [sortOrder, setSortOrder] = (0, import_react13.useState)("asc");
1798
+ const [sortKey, setSortKey] = (0, import_react13.useState)("workflowTypeId");
1799
+ const [selectedItem, setSelectedItem] = (0, import_react13.useState)(null);
1800
+ const [isEditOpen, setIsEditOpen] = (0, import_react13.useState)(false);
1801
+ const [isDeleteOpen, setIsDeleteOpen] = (0, import_react13.useState)(false);
1564
1802
  const handleSort = (columnKey) => {
1565
1803
  const isAsc = sortKey === columnKey && sortOrder === "asc";
1566
1804
  setSortOrder(isAsc ? "desc" : "asc");
@@ -1576,7 +1814,7 @@ function WorkflowTypeTable({
1576
1814
  const query = (searchQuery || "").toLowerCase();
1577
1815
  return item.workflowTypeName.toLowerCase().includes(query) || item.workflowTypeCode.toLowerCase().includes(query) || item.description.toLowerCase().includes(query);
1578
1816
  });
1579
- (0, import_react14.useEffect)(() => {
1817
+ (0, import_react13.useEffect)(() => {
1580
1818
  if (setTotalEntries) setTotalEntries(filteredData.length);
1581
1819
  }, [filteredData.length, setTotalEntries]);
1582
1820
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -1662,8 +1900,8 @@ function WorkflowTypeTable({
1662
1900
  }
1663
1901
 
1664
1902
  // src/components/workflow-type/AddWorkflowTypeModal.jsx
1665
- var import_react15 = __toESM(require("react"));
1666
- var import_sweetalert22 = __toESM(require("sweetalert2"));
1903
+ var import_react14 = __toESM(require("react"));
1904
+ var import_sweetalert24 = __toESM(require("sweetalert2"));
1667
1905
  var import_jsx_runtime14 = require("react/jsx-runtime");
1668
1906
  var initialFormData = {
1669
1907
  workflowTypeCode: "",
@@ -1672,12 +1910,12 @@ var initialFormData = {
1672
1910
  createdBy: ""
1673
1911
  };
1674
1912
  var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1675
- const [formData, setFormData] = (0, import_react15.useState)(__spreadProps(__spreadValues({}, initialFormData), {
1913
+ const [formData, setFormData] = (0, import_react14.useState)(__spreadProps(__spreadValues({}, initialFormData), {
1676
1914
  createdBy
1677
1915
  }));
1678
- const [errors, setErrors] = (0, import_react15.useState)({});
1679
- const [isSubmitting, setIsSubmitting] = (0, import_react15.useState)(false);
1680
- const [submitError, setSubmitError] = (0, import_react15.useState)("");
1916
+ const [errors, setErrors] = (0, import_react14.useState)({});
1917
+ const [isSubmitting, setIsSubmitting] = (0, import_react14.useState)(false);
1918
+ const [submitError, setSubmitError] = (0, import_react14.useState)("");
1681
1919
  const handleChange = ({ target: { name, value } }) => {
1682
1920
  if (name === "description" && value.length > 500) return;
1683
1921
  setFormData((previous) => __spreadProps(__spreadValues({}, previous), { [name]: value }));
@@ -1719,7 +1957,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1719
1957
  } catch (error) {
1720
1958
  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.";
1721
1959
  setSubmitError(message);
1722
- await import_sweetalert22.default.fire("Error", message, "error");
1960
+ await import_sweetalert24.default.fire("Error", message, "error");
1723
1961
  } finally {
1724
1962
  setIsSubmitting(false);
1725
1963
  }
@@ -1735,10 +1973,10 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1735
1973
  ] }),
1736
1974
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("form", { onSubmit: handleSubmit, className: "fc:space-y-4 fc:p-6", children: [
1737
1975
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "fc:grid fc:grid-cols-2 fc:gap-4", children: [
1738
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Workflow Type Code", required: true, error: errors.workflowTypeCode, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, placeholder: "e.g. PETITION", className: inputClass(errors.workflowTypeCode) }) }),
1739
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Workflow Type Name", required: true, error: errors.workflowTypeName, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, placeholder: "Enter workflow type name", className: inputClass(errors.workflowTypeName) }) })
1976
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Workflow Type Code", required: true, error: errors.workflowTypeCode, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "workflowTypeCode", value: formData.workflowTypeCode, onChange: handleChange, placeholder: "e.g. PETITION", className: inputClass3(errors.workflowTypeCode) }) }),
1977
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Workflow Type Name", required: true, error: errors.workflowTypeName, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "workflowTypeName", value: formData.workflowTypeName, onChange: handleChange, placeholder: "Enter workflow type name", className: inputClass3(errors.workflowTypeName) }) })
1740
1978
  ] }),
1741
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Created By", required: true, error: errors.createdBy, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "createdBy", value: formData.createdBy, onChange: handleChange, placeholder: "Enter user name or ID", className: inputClass(errors.createdBy) }) }),
1979
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Created By", required: true, error: errors.createdBy, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("input", { name: "createdBy", value: formData.createdBy, onChange: handleChange, placeholder: "Enter user name or ID", className: inputClass3(errors.createdBy) }) }),
1742
1980
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(FormField, { label: "Description", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("div", { className: "fc:relative", children: [
1743
1981
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)("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" }),
1744
1982
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("span", { className: "fc:absolute fc:bottom-2 fc:right-3 fc:text-xs fc:text-gray-400", children: [
@@ -1754,7 +1992,7 @@ var AddWorkflowTypeModal = ({ isOpen, onClose, onSave, createdBy = "" }) => {
1754
1992
  ] })
1755
1993
  ] }) });
1756
1994
  };
1757
- 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"}`;
1995
+ 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"}`;
1758
1996
  var FormField = ({ label, required, error, children }) => /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)("label", { className: "fc:block fc:text-xs fc:font-semibold fc:text-gray-700", children: [
1759
1997
  label,
1760
1998
  " ",
@@ -1767,7 +2005,7 @@ var AddWorkflowTypeModal_default = AddWorkflowTypeModal;
1767
2005
  // src/components/workflow-type/WorkflowTypeMains.js
1768
2006
  var import_jsx_runtime15 = require("react/jsx-runtime");
1769
2007
  function WorkflowTypeMains() {
1770
- const [refreshkey, setRefreshKey] = (0, import_react16.useState)(0);
2008
+ const [refreshkey, setRefreshKey] = (0, import_react15.useState)(0);
1771
2009
  const handleRefresh = () => {
1772
2010
  console.log("Table data refreshed!");
1773
2011
  setRefreshKey((prev) => prev + 1);
@@ -1778,28 +2016,28 @@ function WorkflowTypeMains() {
1778
2016
  const endpoint = (_c = (_b = (_a = getApiEndpoints()) == null ? void 0 : _a.flowCore) == null ? void 0 : _b.workflowType) == null ? void 0 : _c.update;
1779
2017
  if (!endpoint) throw new Error("Workflow type update endpoint is not configured.");
1780
2018
  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" });
1781
- await import_sweetalert23.default.fire("Success", "Workflow type updated successfully.", "success");
2019
+ await import_sweetalert25.default.fire("Success", "Workflow type updated successfully.", "success");
1782
2020
  handleRefresh();
1783
2021
  return true;
1784
2022
  } catch (error) {
1785
- await import_sweetalert23.default.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");
2023
+ await import_sweetalert25.default.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");
1786
2024
  return false;
1787
2025
  }
1788
2026
  };
1789
2027
  const handleDeleteApi = async (item) => {
1790
2028
  return handleUpdateApi(__spreadProps(__spreadValues({}, item), { isActive: false }));
1791
2029
  };
1792
- const tableRef = (0, import_react16.useRef)(null);
1793
- const [modalOpen, setModalOpen] = (0, import_react16.useState)(false);
1794
- const [pageSize, setPageSize] = (0, import_react16.useState)(10);
1795
- const [searchQuery, setSearchQuery] = (0, import_react16.useState)("");
1796
- const [currentPage, setCurrentPage] = (0, import_react16.useState)(1);
1797
- const [totalEntries, setTotalEntries] = (0, import_react16.useState)(0);
1798
- const [isEditOpen, setIsEditOpen] = (0, import_react16.useState)(false);
1799
- const [isDeleteOpen, setIsDeleteOpen] = (0, import_react16.useState)(false);
1800
- const [selectedItem, setSelectedItem] = (0, import_react16.useState)(null);
1801
- const [apiData, setApiData] = (0, import_react16.useState)([]);
1802
- (0, import_react16.useEffect)(() => {
2030
+ const tableRef = (0, import_react15.useRef)(null);
2031
+ const [modalOpen, setModalOpen] = (0, import_react15.useState)(false);
2032
+ const [pageSize, setPageSize] = (0, import_react15.useState)(10);
2033
+ const [searchQuery, setSearchQuery] = (0, import_react15.useState)("");
2034
+ const [currentPage, setCurrentPage] = (0, import_react15.useState)(1);
2035
+ const [totalEntries, setTotalEntries] = (0, import_react15.useState)(0);
2036
+ const [isEditOpen, setIsEditOpen] = (0, import_react15.useState)(false);
2037
+ const [isDeleteOpen, setIsDeleteOpen] = (0, import_react15.useState)(false);
2038
+ const [selectedItem, setSelectedItem] = (0, import_react15.useState)(null);
2039
+ const [apiData, setApiData] = (0, import_react15.useState)([]);
2040
+ (0, import_react15.useEffect)(() => {
1803
2041
  (async () => {
1804
2042
  var _a, _b, _c, _d, _e, _f, _g;
1805
2043
  try {
@@ -1809,7 +2047,7 @@ function WorkflowTypeMains() {
1809
2047
  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;
1810
2048
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
1811
2049
  } catch (error) {
1812
- await import_sweetalert23.default.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");
2050
+ await import_sweetalert25.default.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");
1813
2051
  }
1814
2052
  })();
1815
2053
  }, [refreshkey]);
@@ -1862,7 +2100,7 @@ function WorkflowTypeMains() {
1862
2100
  ] })
1863
2101
  ] }) }),
1864
2102
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(AddWorkflowTypeModal_default, { isOpen: modalOpen, onClose: () => setModalOpen(false), onSave: async () => {
1865
- await import_sweetalert23.default.fire("Success", "Workflow type created successfully.", "success");
2103
+ await import_sweetalert25.default.fire("Success", "Workflow type created successfully.", "success");
1866
2104
  handleRefresh();
1867
2105
  } }),
1868
2106
  /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(EditWorkflowType_default, { isOpen: isEditOpen, onClose: () => setIsEditOpen(false), onSave: handleUpdateApi, selectedData: selectedItem }),
@@ -1871,10 +2109,10 @@ function WorkflowTypeMains() {
1871
2109
  }
1872
2110
 
1873
2111
  // src/components/WorkflowStep/main.js
1874
- var import_react19 = __toESM(require("react"));
2112
+ var import_react18 = __toESM(require("react"));
1875
2113
 
1876
2114
  // src/components/Common/footer.js
1877
- var import_react17 = __toESM(require("react"));
2115
+ var import_react16 = __toESM(require("react"));
1878
2116
  var import_jsx_runtime16 = require("react/jsx-runtime");
1879
2117
  function Footer() {
1880
2118
  return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)("div", { className: "fc:flex fc:justify-between fc:items-center fc:px-6 fc:py-4 fc:sticky fc:bottom-0 fc:z-10 fc:border-t fc:border-gray-200 fc:rounded-xl fc:bg-slate-50/50 fc:shadow-md", children: [
@@ -1894,10 +2132,10 @@ function Footer() {
1894
2132
  var import_link2 = __toESM(require("next/link"));
1895
2133
 
1896
2134
  // src/components/WorkflowStep/AddWorkflowStepModal.js
1897
- var import_react18 = __toESM(require("react"));
2135
+ var import_react17 = __toESM(require("react"));
1898
2136
  var import_jsx_runtime17 = require("react/jsx-runtime");
1899
2137
  function AddWorkflowStepModal({ onClose }) {
1900
- const [formData, setFormData] = (0, import_react18.useState)({
2138
+ const [formData, setFormData] = (0, import_react17.useState)({
1901
2139
  workflow: "",
1902
2140
  stepCode: "",
1903
2141
  stepName: "",
@@ -1910,7 +2148,7 @@ function AddWorkflowStepModal({ onClose }) {
1910
2148
  excludeHolidays: true,
1911
2149
  status: "active"
1912
2150
  });
1913
- const [errors, setErrors] = (0, import_react18.useState)({});
2151
+ const [errors, setErrors] = (0, import_react17.useState)({});
1914
2152
  const handleChange = (field, value) => {
1915
2153
  setFormData((prev) => __spreadProps(__spreadValues({}, prev), { [field]: value }));
1916
2154
  if (errors[field]) {
@@ -2386,10 +2624,10 @@ function WorkflowStep() {
2386
2624
  const handleDownload = () => {
2387
2625
  console.log("Download clicked");
2388
2626
  };
2389
- const tableRef = (0, import_react19.useRef)(null);
2390
- const [showModal, setShowModal] = (0, import_react19.useState)(false);
2391
- const [pageSize, setPageSize] = (0, import_react19.useState)(5);
2392
- const [sortConfig, setSortConfig] = (0, import_react19.useState)({
2627
+ const tableRef = (0, import_react18.useRef)(null);
2628
+ const [showModal, setShowModal] = (0, import_react18.useState)(false);
2629
+ const [pageSize, setPageSize] = (0, import_react18.useState)(5);
2630
+ const [sortConfig, setSortConfig] = (0, import_react18.useState)({
2393
2631
  key: "",
2394
2632
  direction: "asc"
2395
2633
  });
@@ -2491,14 +2729,14 @@ function WorkflowStep() {
2491
2729
  }
2492
2730
 
2493
2731
  // src/components/WorkFlowTransition/Transitiontable.js
2494
- var import_react21 = __toESM(require("react"));
2732
+ var import_react20 = __toESM(require("react"));
2495
2733
  var import_link3 = __toESM(require("next/link"));
2496
2734
 
2497
2735
  // src/components/WorkFlowTransition/AddWorkFlowTransitionModal.js
2498
- var import_react20 = __toESM(require("react"));
2736
+ var import_react19 = __toESM(require("react"));
2499
2737
  var import_jsx_runtime19 = require("react/jsx-runtime");
2500
2738
  function AddWorkTransitionStepModal({ onClose, onSubmit }) {
2501
- const [formData, setFormData] = (0, import_react20.useState)({
2739
+ const [formData, setFormData] = (0, import_react19.useState)({
2502
2740
  workflow: "",
2503
2741
  fromStep: "",
2504
2742
  toStep: "",
@@ -2509,7 +2747,7 @@ function AddWorkTransitionStepModal({ onClose, onSubmit }) {
2509
2747
  requireComment: false,
2510
2748
  status: "active"
2511
2749
  });
2512
- const [errors, setErrors] = (0, import_react20.useState)({});
2750
+ const [errors, setErrors] = (0, import_react19.useState)({});
2513
2751
  const validateForm = () => {
2514
2752
  const newErrors = {};
2515
2753
  if (!formData.workflow) newErrors.workflow = "Workflow is required.";
@@ -2940,10 +3178,10 @@ function WorkFlowTransition() {
2940
3178
  const handleDownload = () => {
2941
3179
  console.log("Download clicked");
2942
3180
  };
2943
- const tableRef = (0, import_react21.useRef)(null);
2944
- const [showModal, setShowModal] = (0, import_react21.useState)(false);
2945
- const [pageSize, setPageSize] = (0, import_react21.useState)(5);
2946
- const [sortConfig, setSortConfig] = (0, import_react21.useState)({
3181
+ const tableRef = (0, import_react20.useRef)(null);
3182
+ const [showModal, setShowModal] = (0, import_react20.useState)(false);
3183
+ const [pageSize, setPageSize] = (0, import_react20.useState)(5);
3184
+ const [sortConfig, setSortConfig] = (0, import_react20.useState)({
2947
3185
  key: "",
2948
3186
  direction: "asc"
2949
3187
  });
@@ -3032,10 +3270,10 @@ function WorkFlowTransition() {
3032
3270
  }
3033
3271
 
3034
3272
  // src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
3035
- var import_react27 = __toESM(require("react"));
3273
+ var import_react26 = __toESM(require("react"));
3036
3274
 
3037
3275
  // src/components/user-hierarchy-node-mapping/adduserhierarchynode.jsx
3038
- var import_react22 = __toESM(require("react"));
3276
+ var import_react21 = __toESM(require("react"));
3039
3277
  var import_jsx_runtime21 = require("react/jsx-runtime");
3040
3278
  function AddUserHierarchyNodeMappingModal({
3041
3279
  isOpen,
@@ -3141,7 +3379,7 @@ function AddUserHierarchyNodeMappingModal({
3141
3379
  }
3142
3380
 
3143
3381
  // src/components/user-hierarchy-node-mapping/searchbar.jsx
3144
- var import_react23 = __toESM(require("react"));
3382
+ var import_react22 = __toESM(require("react"));
3145
3383
  var import_jsx_runtime22 = require("react/jsx-runtime");
3146
3384
  function MappingSearchBar({
3147
3385
  searchQuery,
@@ -3165,10 +3403,10 @@ function MappingSearchBar({
3165
3403
  }
3166
3404
 
3167
3405
  // src/components/user-hierarchy-node-mapping/userhierarchynodetable.jsx
3168
- var import_react26 = __toESM(require("react"));
3406
+ var import_react25 = __toESM(require("react"));
3169
3407
 
3170
3408
  // src/components/user-hierarchy-node-mapping/edit-mapping.jsx
3171
- var import_react24 = __toESM(require("react"));
3409
+ var import_react23 = __toESM(require("react"));
3172
3410
  var import_jsx_runtime23 = require("react/jsx-runtime");
3173
3411
  function EditUserHierarchyNodeMappingModal({
3174
3412
  isOpen,
@@ -3176,14 +3414,14 @@ function EditUserHierarchyNodeMappingModal({
3176
3414
  selectedMapping,
3177
3415
  onSave
3178
3416
  }) {
3179
- const [formData, setFormData] = (0, import_react24.useState)({
3417
+ const [formData, setFormData] = (0, import_react23.useState)({
3180
3418
  hierarchyNodeId: "",
3181
3419
  roleCode: "",
3182
3420
  isPrimary: "",
3183
3421
  effectiveFrom: "",
3184
3422
  effectiveTo: ""
3185
3423
  });
3186
- (0, import_react24.useEffect)(() => {
3424
+ (0, import_react23.useEffect)(() => {
3187
3425
  if (selectedMapping) {
3188
3426
  setFormData({
3189
3427
  hierarchyNodeId: selectedMapping.hierarchyNodeId || "",
@@ -3364,7 +3602,7 @@ function EditUserHierarchyNodeMappingModal({
3364
3602
  }
3365
3603
 
3366
3604
  // src/components/user-hierarchy-node-mapping/delete-mapping.jsx
3367
- var import_react25 = __toESM(require("react"));
3605
+ var import_react24 = __toESM(require("react"));
3368
3606
  var import_jsx_runtime24 = require("react/jsx-runtime");
3369
3607
  function DeleteUserHierarchyNodeMappingModal({
3370
3608
  isOpen,
@@ -3669,9 +3907,9 @@ function UserHierarchyNodeMappingTable({
3669
3907
  effectiveTo: "",
3670
3908
  status: true
3671
3909
  }];
3672
- const [data, setData] = (0, import_react26.useState)(initialData);
3673
- const [sortOrder, setSortOrder] = (0, import_react26.useState)("asc");
3674
- const [sortKey, setSortKey] = (0, import_react26.useState)("mappingId");
3910
+ const [data, setData] = (0, import_react25.useState)(initialData);
3911
+ const [sortOrder, setSortOrder] = (0, import_react25.useState)("asc");
3912
+ const [sortKey, setSortKey] = (0, import_react25.useState)("mappingId");
3675
3913
  const handleSort = (columnKey) => {
3676
3914
  const isAsc = sortKey === columnKey && sortOrder === "asc";
3677
3915
  setSortOrder(isAsc ? "desc" : "asc");
@@ -3687,7 +3925,7 @@ function UserHierarchyNodeMappingTable({
3687
3925
  const query = (searchQuery || "").toLowerCase();
3688
3926
  return String(item.mappingId).toLowerCase().includes(query) || String(item.externalUserId).toLowerCase().includes(query) || String(item.hierarchyNodeId).toLowerCase().includes(query) || item.roleCode.toLowerCase().includes(query);
3689
3927
  });
3690
- (0, import_react26.useEffect)(() => {
3928
+ (0, import_react25.useEffect)(() => {
3691
3929
  if (setTotalEntries) setTotalEntries(filteredData.length);
3692
3930
  }, [filteredData.length, setTotalEntries]);
3693
3931
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -3696,9 +3934,9 @@ function UserHierarchyNodeMappingTable({
3696
3934
  const pageNumbers = Array.from({
3697
3935
  length: totalPages
3698
3936
  }, (_, i) => i + 1);
3699
- const [showEditPopup, setShowEditPopup] = (0, import_react26.useState)(false);
3700
- const [showDeletePopup, setShowDeletePopup] = (0, import_react26.useState)(false);
3701
- const [selectedItem, setSelectedItem] = (0, import_react26.useState)(null);
3937
+ const [showEditPopup, setShowEditPopup] = (0, import_react25.useState)(false);
3938
+ const [showDeletePopup, setShowDeletePopup] = (0, import_react25.useState)(false);
3939
+ const [selectedItem, setSelectedItem] = (0, import_react25.useState)(null);
3702
3940
  const openEditPopup = (item) => {
3703
3941
  setSelectedItem(item);
3704
3942
  setShowEditPopup(true);
@@ -3808,17 +4046,17 @@ function UserHierarchyNodeMappingTable({
3808
4046
  // src/components/user-hierarchy-node-mapping/user_hierarachy_node_main.jsx
3809
4047
  var import_jsx_runtime26 = require("react/jsx-runtime");
3810
4048
  function User_hierarchy_mapping_main() {
3811
- const [refreshkey, setRefreshKey] = (0, import_react27.useState)(0);
4049
+ const [refreshkey, setRefreshKey] = (0, import_react26.useState)(0);
3812
4050
  const handleRefresh = () => {
3813
4051
  console.log("Table data refreshed!");
3814
4052
  setRefreshKey((prev) => prev + 1);
3815
4053
  };
3816
- const tableRef = (0, import_react27.useRef)(null);
3817
- const [modalOpen, setModalOpen] = (0, import_react27.useState)(false);
3818
- const [pageSize, setPageSize] = (0, import_react27.useState)(10);
3819
- const [searchQuery, setSearchQuery] = (0, import_react27.useState)("");
3820
- const [currentPage, setCurrentPage] = (0, import_react27.useState)(1);
3821
- const [totalEntries, setTotalEntries] = (0, import_react27.useState)(0);
4054
+ const tableRef = (0, import_react26.useRef)(null);
4055
+ const [modalOpen, setModalOpen] = (0, import_react26.useState)(false);
4056
+ const [pageSize, setPageSize] = (0, import_react26.useState)(10);
4057
+ const [searchQuery, setSearchQuery] = (0, import_react26.useState)("");
4058
+ const [currentPage, setCurrentPage] = (0, import_react26.useState)(1);
4059
+ const [totalEntries, setTotalEntries] = (0, import_react26.useState)(0);
3822
4060
  const handlePageSizeChange = (e) => {
3823
4061
  setPageSize(Number(e.target.value));
3824
4062
  setCurrentPage(1);
@@ -3860,10 +4098,10 @@ function User_hierarchy_mapping_main() {
3860
4098
  }
3861
4099
 
3862
4100
  // src/components/document-configuration/DocumentConfigurationmain.jsx
3863
- var import_react33 = __toESM(require("react"));
4101
+ var import_react32 = __toESM(require("react"));
3864
4102
 
3865
4103
  // src/components/document-configuration/SearchBar.jsx
3866
- var import_react28 = __toESM(require("react"));
4104
+ var import_react27 = __toESM(require("react"));
3867
4105
  var import_jsx_runtime27 = require("react/jsx-runtime");
3868
4106
  function SearchBar3({
3869
4107
  searchQuery,
@@ -3880,10 +4118,10 @@ function SearchBar3({
3880
4118
  }
3881
4119
 
3882
4120
  // src/components/document-configuration/DocumentConfigurationTable.jsx
3883
- var import_react31 = __toESM(require("react"));
4121
+ var import_react30 = __toESM(require("react"));
3884
4122
 
3885
4123
  // src/components/document-configuration/Edit.jsx
3886
- var import_react29 = __toESM(require("react"));
4124
+ var import_react28 = __toESM(require("react"));
3887
4125
  var import_jsx_runtime28 = require("react/jsx-runtime");
3888
4126
  function EditDocumentConfiguration({
3889
4127
  isOpen,
@@ -3891,7 +4129,7 @@ function EditDocumentConfiguration({
3891
4129
  initialData,
3892
4130
  onSave
3893
4131
  }) {
3894
- const [formData, setFormData] = (0, import_react29.useState)({
4132
+ const [formData, setFormData] = (0, import_react28.useState)({
3895
4133
  docName: "",
3896
4134
  stepId: "",
3897
4135
  extensions: "",
@@ -3900,8 +4138,8 @@ function EditDocumentConfiguration({
3900
4138
  isMandatory: false,
3901
4139
  status: "Active"
3902
4140
  });
3903
- const [errors, setErrors] = (0, import_react29.useState)({});
3904
- (0, import_react29.useEffect)(() => {
4141
+ const [errors, setErrors] = (0, import_react28.useState)({});
4142
+ (0, import_react28.useEffect)(() => {
3905
4143
  if (initialData) {
3906
4144
  const sizeParts = (initialData.maxSize || "10 MB").split(" ");
3907
4145
  setFormData({
@@ -4033,7 +4271,7 @@ function EditDocumentConfiguration({
4033
4271
  }
4034
4272
 
4035
4273
  // src/components/document-configuration/Delete.jsx
4036
- var import_react30 = __toESM(require("react"));
4274
+ var import_react29 = __toESM(require("react"));
4037
4275
  var import_jsx_runtime29 = require("react/jsx-runtime");
4038
4276
  function DeleteDocumentConfiguration({
4039
4277
  isOpen,
@@ -4310,12 +4548,12 @@ function DocumentConfigTable({
4310
4548
  status: "Active"
4311
4549
  }
4312
4550
  ];
4313
- const [data, setData] = (0, import_react31.useState)(initialData);
4314
- const [sortOrder, setSortOrder] = (0, import_react31.useState)("asc");
4315
- const [sortKey, setSortKey] = (0, import_react31.useState)("docName");
4316
- const [isEditOpen, setIsEditOpen] = (0, import_react31.useState)(false);
4317
- const [isDeleteOpen, setIsDeleteOpen] = (0, import_react31.useState)(false);
4318
- const [selectedItem, setSelectedItem] = (0, import_react31.useState)(null);
4551
+ const [data, setData] = (0, import_react30.useState)(initialData);
4552
+ const [sortOrder, setSortOrder] = (0, import_react30.useState)("asc");
4553
+ const [sortKey, setSortKey] = (0, import_react30.useState)("docName");
4554
+ const [isEditOpen, setIsEditOpen] = (0, import_react30.useState)(false);
4555
+ const [isDeleteOpen, setIsDeleteOpen] = (0, import_react30.useState)(false);
4556
+ const [selectedItem, setSelectedItem] = (0, import_react30.useState)(null);
4319
4557
  const handleSort = (columnKey) => {
4320
4558
  const isAsc = sortKey === columnKey && sortOrder === "asc";
4321
4559
  setSortOrder(isAsc ? "desc" : "asc");
@@ -4331,7 +4569,7 @@ function DocumentConfigTable({
4331
4569
  const query = (searchQuery || "").toLowerCase();
4332
4570
  return item.docName.toLowerCase().includes(query) || item.extensions.toLowerCase().includes(query) || item.stepId.toLowerCase().includes(query);
4333
4571
  });
4334
- (0, import_react31.useEffect)(() => {
4572
+ (0, import_react30.useEffect)(() => {
4335
4573
  if (setTotalEntries) setTotalEntries(filteredData.length);
4336
4574
  }, [filteredData.length, setTotalEntries]);
4337
4575
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -4537,19 +4775,19 @@ function DocumentConfigTable({
4537
4775
  }
4538
4776
 
4539
4777
  // src/components/document-configuration/AddDocumentConfigurationModal.jsx
4540
- var import_react32 = __toESM(require("react"));
4778
+ var import_react31 = __toESM(require("react"));
4541
4779
  var import_jsx_runtime31 = require("react/jsx-runtime");
4542
4780
  function AddDocumentConfigModal({
4543
4781
  isOpen,
4544
4782
  onClose
4545
4783
  }) {
4546
- const [isMandatory, setIsMandatory] = (0, import_react32.useState)(false);
4547
- const [status, setStatus] = (0, import_react32.useState)("Active");
4548
- const [documentName, setDocumentName] = (0, import_react32.useState)("");
4549
- const [stepId, setStepId] = (0, import_react32.useState)("");
4550
- const [maxSize, setMaxSize] = (0, import_react32.useState)("");
4551
- const [allowedExtensions, setAllowedExtensions] = (0, import_react32.useState)("");
4552
- const [errors, setErrors] = (0, import_react32.useState)({});
4784
+ const [isMandatory, setIsMandatory] = (0, import_react31.useState)(false);
4785
+ const [status, setStatus] = (0, import_react31.useState)("Active");
4786
+ const [documentName, setDocumentName] = (0, import_react31.useState)("");
4787
+ const [stepId, setStepId] = (0, import_react31.useState)("");
4788
+ const [maxSize, setMaxSize] = (0, import_react31.useState)("");
4789
+ const [allowedExtensions, setAllowedExtensions] = (0, import_react31.useState)("");
4790
+ const [errors, setErrors] = (0, import_react31.useState)({});
4553
4791
  const handleSave = () => {
4554
4792
  let newErrors = {};
4555
4793
  if (!documentName.trim()) {
@@ -4682,17 +4920,17 @@ function AddDocumentConfigModal({
4682
4920
  // src/components/document-configuration/DocumentConfigurationmain.jsx
4683
4921
  var import_jsx_runtime32 = require("react/jsx-runtime");
4684
4922
  function DocumentConfigurationmain() {
4685
- const [refreshkey, setRefreshKey] = (0, import_react33.useState)(0);
4923
+ const [refreshkey, setRefreshKey] = (0, import_react32.useState)(0);
4686
4924
  const handleRefresh = () => {
4687
4925
  console.log("Table data refreshed!");
4688
4926
  setRefreshKey((prev) => prev + 1);
4689
4927
  };
4690
- const tableRef = (0, import_react33.useRef)(null);
4691
- const [modalOpen, setModalOpen] = (0, import_react33.useState)(false);
4692
- const [pageSize, setPageSize] = (0, import_react33.useState)(10);
4693
- const [searchQuery, setSearchQuery] = (0, import_react33.useState)("");
4694
- const [currentPage, setCurrentPage] = (0, import_react33.useState)(1);
4695
- const [totalEntries, setTotalEntries] = (0, import_react33.useState)(0);
4928
+ const tableRef = (0, import_react32.useRef)(null);
4929
+ const [modalOpen, setModalOpen] = (0, import_react32.useState)(false);
4930
+ const [pageSize, setPageSize] = (0, import_react32.useState)(10);
4931
+ const [searchQuery, setSearchQuery] = (0, import_react32.useState)("");
4932
+ const [currentPage, setCurrentPage] = (0, import_react32.useState)(1);
4933
+ const [totalEntries, setTotalEntries] = (0, import_react32.useState)(0);
4696
4934
  const handlePageSizeChange = (e) => {
4697
4935
  setPageSize(Number(e.target.value));
4698
4936
  setCurrentPage(1);
@@ -4732,10 +4970,10 @@ function DocumentConfigurationmain() {
4732
4970
  }
4733
4971
 
4734
4972
  // src/components/audit-log/AuditLogmain.jsx
4735
- var import_react37 = __toESM(require("react"));
4973
+ var import_react36 = __toESM(require("react"));
4736
4974
 
4737
4975
  // src/components/audit-log/SearchBar.jsx
4738
- var import_react34 = __toESM(require("react"));
4976
+ var import_react33 = __toESM(require("react"));
4739
4977
  var import_jsx_runtime33 = require("react/jsx-runtime");
4740
4978
  function SearchBar4({
4741
4979
  searchQuery,
@@ -4752,7 +4990,7 @@ function SearchBar4({
4752
4990
  }
4753
4991
 
4754
4992
  // src/components/audit-log/AuditLogTable.jsx
4755
- var import_react35 = __toESM(require("react"));
4993
+ var import_react34 = __toESM(require("react"));
4756
4994
  var import_jsx_runtime34 = require("react/jsx-runtime");
4757
4995
  function AuditLogTable({
4758
4996
  pageSize,
@@ -4962,9 +5200,9 @@ function AuditLogTable({
4962
5200
  ip: "192.168.1.45",
4963
5201
  time: "2026-07-17 15:55"
4964
5202
  }];
4965
- const [data, setData] = (0, import_react35.useState)(initialData);
4966
- const [sortOrder, setSortOrder] = (0, import_react35.useState)("asc");
4967
- const [sortKey, setSortKey] = (0, import_react35.useState)("logId");
5203
+ const [data, setData] = (0, import_react34.useState)(initialData);
5204
+ const [sortOrder, setSortOrder] = (0, import_react34.useState)("asc");
5205
+ const [sortKey, setSortKey] = (0, import_react34.useState)("logId");
4968
5206
  const handleSort = (columnKey) => {
4969
5207
  const isAsc = sortKey === columnKey && sortOrder === "asc";
4970
5208
  setSortOrder(isAsc ? "desc" : "asc");
@@ -4980,7 +5218,7 @@ function AuditLogTable({
4980
5218
  const query = (searchQuery || "").toLowerCase();
4981
5219
  return item.logId.toLowerCase().includes(query) || item.user.toLowerCase().includes(query) || item.section.toLowerCase().includes(query) || item.action.toLowerCase().includes(query);
4982
5220
  });
4983
- (0, import_react35.useEffect)(() => {
5221
+ (0, import_react34.useEffect)(() => {
4984
5222
  if (setTotalEntries) setTotalEntries(filteredData.length);
4985
5223
  }, [filteredData.length, setTotalEntries]);
4986
5224
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5048,19 +5286,19 @@ function AuditLogTable({
5048
5286
  }
5049
5287
 
5050
5288
  // src/components/audit-log/AddAuditLogModal.jsx
5051
- var import_react36 = __toESM(require("react"));
5289
+ var import_react35 = __toESM(require("react"));
5052
5290
  var import_jsx_runtime35 = require("react/jsx-runtime");
5053
5291
  function AddAuditLogModal({
5054
5292
  isOpen,
5055
5293
  onClose
5056
5294
  }) {
5057
- const [logId, setLogId] = (0, import_react36.useState)("");
5058
- const [userName, setUserName] = (0, import_react36.useState)("");
5059
- const [actionType, setActionType] = (0, import_react36.useState)("");
5060
- const [ipAddress, setIpAddress] = (0, import_react36.useState)("");
5061
- const [sectionModule, setSectionModule] = (0, import_react36.useState)("");
5062
- const [timestamp, setTimestamp] = (0, import_react36.useState)("");
5063
- const [errors, setErrors] = (0, import_react36.useState)({});
5295
+ const [logId, setLogId] = (0, import_react35.useState)("");
5296
+ const [userName, setUserName] = (0, import_react35.useState)("");
5297
+ const [actionType, setActionType] = (0, import_react35.useState)("");
5298
+ const [ipAddress, setIpAddress] = (0, import_react35.useState)("");
5299
+ const [sectionModule, setSectionModule] = (0, import_react35.useState)("");
5300
+ const [timestamp, setTimestamp] = (0, import_react35.useState)("");
5301
+ const [errors, setErrors] = (0, import_react35.useState)({});
5064
5302
  const handleCommit = () => {
5065
5303
  let newErrors = {};
5066
5304
  if (!logId.trim()) newErrors.logId = "Log ID is required";
@@ -5179,17 +5417,17 @@ function AddAuditLogModal({
5179
5417
  // src/components/audit-log/AuditLogmain.jsx
5180
5418
  var import_jsx_runtime36 = require("react/jsx-runtime");
5181
5419
  function AuditLogmain() {
5182
- const [refreshkey, setRefreshKey] = (0, import_react37.useState)(0);
5420
+ const [refreshkey, setRefreshKey] = (0, import_react36.useState)(0);
5183
5421
  const handleRefresh = () => {
5184
5422
  console.log("Table data refreshed!");
5185
5423
  setRefreshKey((prev) => prev + 1);
5186
5424
  };
5187
- const tableRef = (0, import_react37.useRef)(null);
5188
- const [modalOpen, setModalOpen] = (0, import_react37.useState)(false);
5189
- const [pageSize, setPageSize] = (0, import_react37.useState)(10);
5190
- const [searchQuery, setSearchQuery] = (0, import_react37.useState)("");
5191
- const [currentPage, setCurrentPage] = (0, import_react37.useState)(1);
5192
- const [totalEntries, setTotalEntries] = (0, import_react37.useState)(0);
5425
+ const tableRef = (0, import_react36.useRef)(null);
5426
+ const [modalOpen, setModalOpen] = (0, import_react36.useState)(false);
5427
+ const [pageSize, setPageSize] = (0, import_react36.useState)(10);
5428
+ const [searchQuery, setSearchQuery] = (0, import_react36.useState)("");
5429
+ const [currentPage, setCurrentPage] = (0, import_react36.useState)(1);
5430
+ const [totalEntries, setTotalEntries] = (0, import_react36.useState)(0);
5193
5431
  const handlePageSizeChange = (e) => {
5194
5432
  setPageSize(Number(e.target.value));
5195
5433
  setCurrentPage(1);
@@ -5248,10 +5486,10 @@ function AuditLogmain() {
5248
5486
  }
5249
5487
 
5250
5488
  // src/components/movement-history/MovementHistorymain.jsx
5251
- var import_react41 = __toESM(require("react"));
5489
+ var import_react40 = __toESM(require("react"));
5252
5490
 
5253
5491
  // src/components/movement-history/SearchBar.jsx
5254
- var import_react38 = __toESM(require("react"));
5492
+ var import_react37 = __toESM(require("react"));
5255
5493
  var import_jsx_runtime37 = require("react/jsx-runtime");
5256
5494
  function SearchBar5({
5257
5495
  searchQuery,
@@ -5268,7 +5506,7 @@ function SearchBar5({
5268
5506
  }
5269
5507
 
5270
5508
  // src/components/movement-history/MovementHistoryTable.jsx
5271
- var import_react39 = __toESM(require("react"));
5509
+ var import_react38 = __toESM(require("react"));
5272
5510
  var import_jsx_runtime38 = require("react/jsx-runtime");
5273
5511
  function MovementHistoryTable({
5274
5512
  pageSize,
@@ -5478,9 +5716,9 @@ function MovementHistoryTable({
5478
5716
  toStepId: "APPROVE",
5479
5717
  movedOn: "2026-02-12"
5480
5718
  }];
5481
- const [data, setData] = (0, import_react39.useState)(initialData);
5482
- const [sortOrder, setSortOrder] = (0, import_react39.useState)("asc");
5483
- const [sortKey, setSortKey] = (0, import_react39.useState)("movementHistoryId");
5719
+ const [data, setData] = (0, import_react38.useState)(initialData);
5720
+ const [sortOrder, setSortOrder] = (0, import_react38.useState)("asc");
5721
+ const [sortKey, setSortKey] = (0, import_react38.useState)("movementHistoryId");
5484
5722
  const handleSort = (columnKey) => {
5485
5723
  const isAsc = sortKey === columnKey && sortOrder === "asc";
5486
5724
  setSortOrder(isAsc ? "desc" : "asc");
@@ -5496,7 +5734,7 @@ function MovementHistoryTable({
5496
5734
  const query = (searchQuery || "").toLowerCase();
5497
5735
  return item.movementHistoryId.toLowerCase().includes(query) || item.name.toLowerCase().includes(query) || item.toStepId.toLowerCase().includes(query);
5498
5736
  });
5499
- (0, import_react39.useEffect)(() => {
5737
+ (0, import_react38.useEffect)(() => {
5500
5738
  if (setTotalEntries) setTotalEntries(filteredData.length);
5501
5739
  }, [filteredData.length, setTotalEntries]);
5502
5740
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -5567,19 +5805,19 @@ function MovementHistoryTable({
5567
5805
  }
5568
5806
 
5569
5807
  // src/components/movement-history/AddMovementHistoryModal.jsx
5570
- var import_react40 = __toESM(require("react"));
5808
+ var import_react39 = __toESM(require("react"));
5571
5809
  var import_jsx_runtime39 = require("react/jsx-runtime");
5572
5810
  function AddMovementHistoryModal({
5573
5811
  isOpen,
5574
5812
  onClose
5575
5813
  }) {
5576
- const [movementHistoryId, setMovementHistoryId] = (0, import_react40.useState)("");
5577
- const [fileInstanceId, setFileInstanceId] = (0, import_react40.useState)("");
5578
- const [fromStepId, setFromStepId] = (0, import_react40.useState)("");
5579
- const [toStepId, setToStepId] = (0, import_react40.useState)("");
5580
- const [actionCode, setActionCode] = (0, import_react40.useState)("");
5581
- const [movedOn, setMovedOn] = (0, import_react40.useState)("");
5582
- const [errors, setErrors] = (0, import_react40.useState)({});
5814
+ const [movementHistoryId, setMovementHistoryId] = (0, import_react39.useState)("");
5815
+ const [fileInstanceId, setFileInstanceId] = (0, import_react39.useState)("");
5816
+ const [fromStepId, setFromStepId] = (0, import_react39.useState)("");
5817
+ const [toStepId, setToStepId] = (0, import_react39.useState)("");
5818
+ const [actionCode, setActionCode] = (0, import_react39.useState)("");
5819
+ const [movedOn, setMovedOn] = (0, import_react39.useState)("");
5820
+ const [errors, setErrors] = (0, import_react39.useState)({});
5583
5821
  const handleSaveRecord = () => {
5584
5822
  let newErrors = {};
5585
5823
  if (!movementHistoryId.toString().trim()) newErrors.movementHistoryId = "Movement History ID is required";
@@ -5694,17 +5932,17 @@ function AddMovementHistoryModal({
5694
5932
  // src/components/movement-history/MovementHistorymain.jsx
5695
5933
  var import_jsx_runtime40 = require("react/jsx-runtime");
5696
5934
  function MovementHistorymain() {
5697
- const [refreshkey, setRefreshKey] = (0, import_react41.useState)(0);
5935
+ const [refreshkey, setRefreshKey] = (0, import_react40.useState)(0);
5698
5936
  const handleRefresh = () => {
5699
5937
  console.log("Table data refreshed!");
5700
5938
  setRefreshKey((prev) => prev + 1);
5701
5939
  };
5702
- const tableRef = (0, import_react41.useRef)(null);
5703
- const [modalOpen, setModalOpen] = (0, import_react41.useState)(false);
5704
- const [pageSize, setPageSize] = (0, import_react41.useState)(10);
5705
- const [searchQuery, setSearchQuery] = (0, import_react41.useState)("");
5706
- const [currentPage, setCurrentPage] = (0, import_react41.useState)(1);
5707
- const [totalEntries, setTotalEntries] = (0, import_react41.useState)(0);
5940
+ const tableRef = (0, import_react40.useRef)(null);
5941
+ const [modalOpen, setModalOpen] = (0, import_react40.useState)(false);
5942
+ const [pageSize, setPageSize] = (0, import_react40.useState)(10);
5943
+ const [searchQuery, setSearchQuery] = (0, import_react40.useState)("");
5944
+ const [currentPage, setCurrentPage] = (0, import_react40.useState)(1);
5945
+ const [totalEntries, setTotalEntries] = (0, import_react40.useState)(0);
5708
5946
  const handlePageSizeChange = (e) => {
5709
5947
  setPageSize(Number(e.target.value));
5710
5948
  setCurrentPage(1);
@@ -5747,10 +5985,10 @@ function MovementHistorymain() {
5747
5985
  }
5748
5986
 
5749
5987
  // src/components/task-permission/TaskPermissionMain.jsx
5750
- var import_react45 = __toESM(require("react"));
5988
+ var import_react44 = __toESM(require("react"));
5751
5989
 
5752
5990
  // src/components/task-permission/SearchBar.js
5753
- var import_react42 = __toESM(require("react"));
5991
+ var import_react41 = __toESM(require("react"));
5754
5992
  var import_jsx_runtime41 = require("react/jsx-runtime");
5755
5993
  function SearchBar6({
5756
5994
  searchTerm,
@@ -5778,7 +6016,7 @@ function SearchBar6({
5778
6016
  }
5779
6017
 
5780
6018
  // src/components/task-permission/Table.js
5781
- var import_react43 = __toESM(require("react"));
6019
+ var import_react42 = __toESM(require("react"));
5782
6020
  var import_jsx_runtime42 = require("react/jsx-runtime");
5783
6021
  function Table({
5784
6022
  pageSize,
@@ -5963,12 +6201,12 @@ function Table({
5963
6201
  permissionType: "Write",
5964
6202
  isStatusEnabled: true
5965
6203
  }];
5966
- const [data, setData] = (0, import_react43.useState)(initialData);
5967
- const [sortOrder, setSortOrder] = (0, import_react43.useState)("asc");
5968
- const [sortKey, setSortKey] = (0, import_react43.useState)("taskId");
5969
- const [selectedItem, setSelectedItem] = (0, import_react43.useState)(null);
5970
- const [isEditModalOpen, setIsEditModalOpen] = (0, import_react43.useState)(false);
5971
- const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react43.useState)(false);
6204
+ const [data, setData] = (0, import_react42.useState)(initialData);
6205
+ const [sortOrder, setSortOrder] = (0, import_react42.useState)("asc");
6206
+ const [sortKey, setSortKey] = (0, import_react42.useState)("taskId");
6207
+ const [selectedItem, setSelectedItem] = (0, import_react42.useState)(null);
6208
+ const [isEditModalOpen, setIsEditModalOpen] = (0, import_react42.useState)(false);
6209
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react42.useState)(false);
5972
6210
  const handleEdit = (item) => {
5973
6211
  setSelectedItem(item);
5974
6212
  setIsEditModalOpen(true);
@@ -6025,7 +6263,7 @@ function Table({
6025
6263
  }
6026
6264
  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);
6027
6265
  });
6028
- (0, import_react43.useEffect)(() => {
6266
+ (0, import_react42.useEffect)(() => {
6029
6267
  if (setTotalEntries) setTotalEntries(filteredData.length);
6030
6268
  }, [filteredData.length, setTotalEntries]);
6031
6269
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6148,7 +6386,7 @@ function Table({
6148
6386
  }
6149
6387
 
6150
6388
  // src/components/task-permission/Popup.js
6151
- var import_react44 = __toESM(require("react"));
6389
+ var import_react43 = __toESM(require("react"));
6152
6390
  var import_jsx_runtime43 = require("react/jsx-runtime");
6153
6391
  function Popup({
6154
6392
  isOpen,
@@ -6156,13 +6394,13 @@ function Popup({
6156
6394
  onSave
6157
6395
  }) {
6158
6396
  if (!isOpen) return null;
6159
- const [stepName, setStepName] = (0, import_react44.useState)("");
6160
- const [stepCode, setStepCode] = (0, import_react44.useState)("");
6161
- const [workflow, setWorkflow] = (0, import_react44.useState)("");
6162
- const [canView, setCanView] = (0, import_react44.useState)(false);
6163
- const [canEdit, setCanEdit] = (0, import_react44.useState)(false);
6164
- const [canApprove, setCanApprove] = (0, import_react44.useState)(false);
6165
- const [canReject, setCanReject] = (0, import_react44.useState)(false);
6397
+ const [stepName, setStepName] = (0, import_react43.useState)("");
6398
+ const [stepCode, setStepCode] = (0, import_react43.useState)("");
6399
+ const [workflow, setWorkflow] = (0, import_react43.useState)("");
6400
+ const [canView, setCanView] = (0, import_react43.useState)(false);
6401
+ const [canEdit, setCanEdit] = (0, import_react43.useState)(false);
6402
+ const [canApprove, setCanApprove] = (0, import_react43.useState)(false);
6403
+ const [canReject, setCanReject] = (0, import_react43.useState)(false);
6166
6404
  const handleSubmit = (e) => {
6167
6405
  e.preventDefault();
6168
6406
  if (!stepName || !stepCode || !workflow) {
@@ -6279,17 +6517,17 @@ function Popup({
6279
6517
  // src/components/task-permission/TaskPermissionMain.jsx
6280
6518
  var import_jsx_runtime44 = require("react/jsx-runtime");
6281
6519
  function TaskPermissionMain() {
6282
- const [refreshkey, setRefreshKey] = (0, import_react45.useState)(0);
6520
+ const [refreshkey, setRefreshKey] = (0, import_react44.useState)(0);
6283
6521
  const handleRefresh = () => {
6284
6522
  console.log("Table data refreshed!");
6285
6523
  setRefreshKey((prev) => prev + 1);
6286
6524
  };
6287
- const tableRef = (0, import_react45.useRef)(null);
6288
- const [showModal, setShowModal] = (0, import_react45.useState)(false);
6289
- const [pageSize, setPageSize] = (0, import_react45.useState)(10);
6290
- const [searchQuery, setSearchQuery] = (0, import_react45.useState)("");
6291
- const [currentPage, setCurrentPage] = (0, import_react45.useState)(1);
6292
- const [totalEntries, setTotalEntries] = (0, import_react45.useState)(0);
6525
+ const tableRef = (0, import_react44.useRef)(null);
6526
+ const [showModal, setShowModal] = (0, import_react44.useState)(false);
6527
+ const [pageSize, setPageSize] = (0, import_react44.useState)(10);
6528
+ const [searchQuery, setSearchQuery] = (0, import_react44.useState)("");
6529
+ const [currentPage, setCurrentPage] = (0, import_react44.useState)(1);
6530
+ const [totalEntries, setTotalEntries] = (0, import_react44.useState)(0);
6293
6531
  const handlePageSizeChange = (e) => {
6294
6532
  setPageSize(Number(e.target.value));
6295
6533
  setCurrentPage(1);
@@ -6331,10 +6569,10 @@ function TaskPermissionMain() {
6331
6569
  }
6332
6570
 
6333
6571
  // src/components/Workflow-Setting/WorkflowSettingMain.jsx
6334
- var import_react49 = __toESM(require("react"));
6572
+ var import_react48 = __toESM(require("react"));
6335
6573
 
6336
6574
  // src/components/Workflow-Setting/SearchBar.js
6337
- var import_react46 = __toESM(require("react"));
6575
+ var import_react45 = __toESM(require("react"));
6338
6576
  var import_jsx_runtime45 = require("react/jsx-runtime");
6339
6577
  function SearchBar7({
6340
6578
  searchTerm,
@@ -6362,7 +6600,7 @@ function SearchBar7({
6362
6600
  }
6363
6601
 
6364
6602
  // src/components/Workflow-Setting/Table.js
6365
- var import_react47 = __toESM(require("react"));
6603
+ var import_react46 = __toESM(require("react"));
6366
6604
  var import_jsx_runtime46 = require("react/jsx-runtime");
6367
6605
  function Table2({
6368
6606
  pageSize,
@@ -6547,12 +6785,12 @@ function Table2({
6547
6785
  SLA: "2 Hours",
6548
6786
  isActive: true
6549
6787
  }];
6550
- const [data, setData] = (0, import_react47.useState)(initialData);
6551
- const [sortOrder, setSortOrder] = (0, import_react47.useState)("asc");
6552
- const [sortKey, setSortKey] = (0, import_react47.useState)("settingId");
6553
- const [selectedItem, setSelectedItem] = (0, import_react47.useState)(null);
6554
- const [isEditModalOpen, setIsEditModalOpen] = (0, import_react47.useState)(false);
6555
- const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react47.useState)(false);
6788
+ const [data, setData] = (0, import_react46.useState)(initialData);
6789
+ const [sortOrder, setSortOrder] = (0, import_react46.useState)("asc");
6790
+ const [sortKey, setSortKey] = (0, import_react46.useState)("settingId");
6791
+ const [selectedItem, setSelectedItem] = (0, import_react46.useState)(null);
6792
+ const [isEditModalOpen, setIsEditModalOpen] = (0, import_react46.useState)(false);
6793
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react46.useState)(false);
6556
6794
  const handleEdit = (item) => {
6557
6795
  setSelectedItem(item);
6558
6796
  setIsEditModalOpen(true);
@@ -6609,7 +6847,7 @@ function Table2({
6609
6847
  }
6610
6848
  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);
6611
6849
  });
6612
- (0, import_react47.useEffect)(() => {
6850
+ (0, import_react46.useEffect)(() => {
6613
6851
  if (setTotalEntries) setTotalEntries(filteredData.length);
6614
6852
  }, [filteredData.length, setTotalEntries]);
6615
6853
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -6742,7 +6980,7 @@ function Table2({
6742
6980
  }
6743
6981
 
6744
6982
  // src/components/Workflow-Setting/Popup.js
6745
- var import_react48 = __toESM(require("react"));
6983
+ var import_react47 = __toESM(require("react"));
6746
6984
  var import_jsx_runtime47 = require("react/jsx-runtime");
6747
6985
  function Popup2({
6748
6986
  isOpen,
@@ -6750,8 +6988,8 @@ function Popup2({
6750
6988
  onSave
6751
6989
  }) {
6752
6990
  if (!isOpen) return null;
6753
- const [settingKey, setSettingKey] = (0, import_react48.useState)("");
6754
- const [settingValue, setSettingValue] = (0, import_react48.useState)("");
6991
+ const [settingKey, setSettingKey] = (0, import_react47.useState)("");
6992
+ const [settingValue, setSettingValue] = (0, import_react47.useState)("");
6755
6993
  const handleSubmit = (e) => {
6756
6994
  e.preventDefault();
6757
6995
  if (!settingKey || !settingValue) {
@@ -6802,17 +7040,17 @@ function Popup2({
6802
7040
  // src/components/Workflow-Setting/WorkflowSettingMain.jsx
6803
7041
  var import_jsx_runtime48 = require("react/jsx-runtime");
6804
7042
  function WorkflowSettingMain() {
6805
- const [refreshkey, setRefreshKey] = (0, import_react49.useState)(0);
7043
+ const [refreshkey, setRefreshKey] = (0, import_react48.useState)(0);
6806
7044
  const handleRefresh = () => {
6807
7045
  console.log("Table data refreshed!");
6808
7046
  setRefreshKey((prev) => prev + 1);
6809
7047
  };
6810
- const tableRef = (0, import_react49.useRef)(null);
6811
- const [showModal, setShowModal] = (0, import_react49.useState)(false);
6812
- const [pageSize, setPageSize] = (0, import_react49.useState)(10);
6813
- const [searchQuery, setSearchQuery] = (0, import_react49.useState)("");
6814
- const [currentPage, setCurrentPage] = (0, import_react49.useState)(1);
6815
- const [totalEntries, setTotalEntries] = (0, import_react49.useState)(0);
7048
+ const tableRef = (0, import_react48.useRef)(null);
7049
+ const [showModal, setShowModal] = (0, import_react48.useState)(false);
7050
+ const [pageSize, setPageSize] = (0, import_react48.useState)(10);
7051
+ const [searchQuery, setSearchQuery] = (0, import_react48.useState)("");
7052
+ const [currentPage, setCurrentPage] = (0, import_react48.useState)(1);
7053
+ const [totalEntries, setTotalEntries] = (0, import_react48.useState)(0);
6816
7054
  const handlePageSizeChange = (e) => {
6817
7055
  setPageSize(Number(e.target.value));
6818
7056
  setCurrentPage(1);
@@ -6854,10 +7092,10 @@ function WorkflowSettingMain() {
6854
7092
  }
6855
7093
 
6856
7094
  // src/components/notification/NotificationMain.jsx
6857
- var import_react53 = __toESM(require("react"));
7095
+ var import_react52 = __toESM(require("react"));
6858
7096
 
6859
7097
  // src/components/notification/SearchBar.js
6860
- var import_react50 = __toESM(require("react"));
7098
+ var import_react49 = __toESM(require("react"));
6861
7099
  var import_jsx_runtime49 = require("react/jsx-runtime");
6862
7100
  function SearchBar8({
6863
7101
  searchTerm,
@@ -6885,7 +7123,7 @@ function SearchBar8({
6885
7123
  }
6886
7124
 
6887
7125
  // src/components/notification/Table.js
6888
- var import_react51 = __toESM(require("react"));
7126
+ var import_react50 = __toESM(require("react"));
6889
7127
  var import_jsx_runtime50 = require("react/jsx-runtime");
6890
7128
  function Table3({
6891
7129
  pageSize,
@@ -7070,12 +7308,12 @@ function Table3({
7070
7308
  recipientGroup: "Risk Assessment",
7071
7309
  isMuted: false
7072
7310
  }];
7073
- const [data, setData] = (0, import_react51.useState)(initialData);
7074
- const [sortOrder, setSortOrder] = (0, import_react51.useState)("asc");
7075
- const [sortKey, setSortKey] = (0, import_react51.useState)("notificationId");
7076
- const [selectedItem, setSelectedItem] = (0, import_react51.useState)(null);
7077
- const [isEditModalOpen, setIsEditModalOpen] = (0, import_react51.useState)(false);
7078
- const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react51.useState)(false);
7311
+ const [data, setData] = (0, import_react50.useState)(initialData);
7312
+ const [sortOrder, setSortOrder] = (0, import_react50.useState)("asc");
7313
+ const [sortKey, setSortKey] = (0, import_react50.useState)("notificationId");
7314
+ const [selectedItem, setSelectedItem] = (0, import_react50.useState)(null);
7315
+ const [isEditModalOpen, setIsEditModalOpen] = (0, import_react50.useState)(false);
7316
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react50.useState)(false);
7079
7317
  const handleEdit = (item) => {
7080
7318
  setSelectedItem(item);
7081
7319
  setIsEditModalOpen(true);
@@ -7132,7 +7370,7 @@ function Table3({
7132
7370
  }
7133
7371
  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);
7134
7372
  });
7135
- (0, import_react51.useEffect)(() => {
7373
+ (0, import_react50.useEffect)(() => {
7136
7374
  if (setTotalEntries) setTotalEntries(filteredData.length);
7137
7375
  }, [filteredData.length, setTotalEntries]);
7138
7376
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7260,7 +7498,7 @@ function Table3({
7260
7498
  }
7261
7499
 
7262
7500
  // src/components/notification/Popup.js
7263
- var import_react52 = __toESM(require("react"));
7501
+ var import_react51 = __toESM(require("react"));
7264
7502
  var import_jsx_runtime51 = require("react/jsx-runtime");
7265
7503
  function Popup3({
7266
7504
  isOpen,
@@ -7268,10 +7506,10 @@ function Popup3({
7268
7506
  onSave
7269
7507
  }) {
7270
7508
  if (!isOpen) return null;
7271
- const [fileInstanceId, setFileInstanceId] = (0, import_react52.useState)("");
7272
- const [userId, setUserId] = (0, import_react52.useState)("");
7273
- const [type, setType] = (0, import_react52.useState)("");
7274
- const [message, setMessage] = (0, import_react52.useState)("");
7509
+ const [fileInstanceId, setFileInstanceId] = (0, import_react51.useState)("");
7510
+ const [userId, setUserId] = (0, import_react51.useState)("");
7511
+ const [type, setType] = (0, import_react51.useState)("");
7512
+ const [message, setMessage] = (0, import_react51.useState)("");
7275
7513
  const handleSubmit = (e) => {
7276
7514
  e.preventDefault();
7277
7515
  if (!fileInstanceId || !userId || !type || !message) {
@@ -7342,17 +7580,17 @@ function Popup3({
7342
7580
  // src/components/notification/NotificationMain.jsx
7343
7581
  var import_jsx_runtime52 = require("react/jsx-runtime");
7344
7582
  function NotificationMain() {
7345
- const [refreshkey, setRefreshKey] = (0, import_react53.useState)(0);
7583
+ const [refreshkey, setRefreshKey] = (0, import_react52.useState)(0);
7346
7584
  const handleRefresh = () => {
7347
7585
  console.log("Table data refreshed!");
7348
7586
  setRefreshKey((prev) => prev + 1);
7349
7587
  };
7350
- const tableRef = (0, import_react53.useRef)(null);
7351
- const [showModal, setShowModal] = (0, import_react53.useState)(false);
7352
- const [pageSize, setPageSize] = (0, import_react53.useState)(10);
7353
- const [searchQuery, setSearchQuery] = (0, import_react53.useState)("");
7354
- const [currentPage, setCurrentPage] = (0, import_react53.useState)(1);
7355
- const [totalEntries, setTotalEntries] = (0, import_react53.useState)(0);
7588
+ const tableRef = (0, import_react52.useRef)(null);
7589
+ const [showModal, setShowModal] = (0, import_react52.useState)(false);
7590
+ const [pageSize, setPageSize] = (0, import_react52.useState)(10);
7591
+ const [searchQuery, setSearchQuery] = (0, import_react52.useState)("");
7592
+ const [currentPage, setCurrentPage] = (0, import_react52.useState)(1);
7593
+ const [totalEntries, setTotalEntries] = (0, import_react52.useState)(0);
7356
7594
  const handlePageSizeChange = (e) => {
7357
7595
  setPageSize(Number(e.target.value));
7358
7596
  setCurrentPage(1);
@@ -7391,10 +7629,10 @@ function NotificationMain() {
7391
7629
  }
7392
7630
 
7393
7631
  // src/components/task-instance/task_instance_main.jsx
7394
- var import_react59 = __toESM(require("react"));
7632
+ var import_react58 = __toESM(require("react"));
7395
7633
 
7396
7634
  // src/components/task-instance/searchbartaskinstance.jsx
7397
- var import_react54 = __toESM(require("react"));
7635
+ var import_react53 = __toESM(require("react"));
7398
7636
  var import_jsx_runtime53 = require("react/jsx-runtime");
7399
7637
  function TaskInstanceSearchBar({
7400
7638
  searchQuery,
@@ -7418,10 +7656,10 @@ function TaskInstanceSearchBar({
7418
7656
  }
7419
7657
 
7420
7658
  // src/components/task-instance/taskinstancetable.jsx
7421
- var import_react57 = __toESM(require("react"));
7659
+ var import_react56 = __toESM(require("react"));
7422
7660
 
7423
7661
  // src/components/task-instance/edit-instance.jsx
7424
- var import_react55 = __toESM(require("react"));
7662
+ var import_react54 = __toESM(require("react"));
7425
7663
  var import_jsx_runtime54 = require("react/jsx-runtime");
7426
7664
  function EditTaskInstanceModal({
7427
7665
  isOpen,
@@ -7429,7 +7667,7 @@ function EditTaskInstanceModal({
7429
7667
  selectedTask,
7430
7668
  onSave
7431
7669
  }) {
7432
- const [formData, setFormData] = (0, import_react55.useState)({
7670
+ const [formData, setFormData] = (0, import_react54.useState)({
7433
7671
  assignedUserId: "",
7434
7672
  status: "",
7435
7673
  dueDate: "",
@@ -7437,7 +7675,7 @@ function EditTaskInstanceModal({
7437
7675
  escalatedOn: "",
7438
7676
  slaStatus: ""
7439
7677
  });
7440
- (0, import_react55.useEffect)(() => {
7678
+ (0, import_react54.useEffect)(() => {
7441
7679
  if (selectedTask) {
7442
7680
  setFormData({
7443
7681
  assignedUserId: selectedTask.assignedUserId || selectedTask.assigned_user_id || "",
@@ -7635,7 +7873,7 @@ function EditTaskInstanceModal({
7635
7873
  }
7636
7874
 
7637
7875
  // src/components/task-instance/delete-instance.jsx
7638
- var import_react56 = __toESM(require("react"));
7876
+ var import_react55 = __toESM(require("react"));
7639
7877
  var import_jsx_runtime55 = require("react/jsx-runtime");
7640
7878
  function DeleteInstanceModal({
7641
7879
  isOpen,
@@ -7940,9 +8178,9 @@ function TaskInstanceTable({
7940
8178
  reminderSentOn: "2026-08-06",
7941
8179
  escalatedOn: ""
7942
8180
  }];
7943
- const [data, setData] = (0, import_react57.useState)(initialData);
7944
- const [sortOrder, setSortOrder] = (0, import_react57.useState)("asc");
7945
- const [sortKey, setSortKey] = (0, import_react57.useState)("taskInstanceId");
8181
+ const [data, setData] = (0, import_react56.useState)(initialData);
8182
+ const [sortOrder, setSortOrder] = (0, import_react56.useState)("asc");
8183
+ const [sortKey, setSortKey] = (0, import_react56.useState)("taskInstanceId");
7946
8184
  const handleSort = (columnKey) => {
7947
8185
  const isAsc = sortKey === columnKey && sortOrder === "asc";
7948
8186
  setSortOrder(isAsc ? "desc" : "asc");
@@ -7958,7 +8196,7 @@ function TaskInstanceTable({
7958
8196
  const query = (searchQuery || "").toLowerCase();
7959
8197
  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);
7960
8198
  });
7961
- (0, import_react57.useEffect)(() => {
8199
+ (0, import_react56.useEffect)(() => {
7962
8200
  if (setTotalEntries) setTotalEntries(filteredData.length);
7963
8201
  }, [filteredData.length, setTotalEntries]);
7964
8202
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -7967,9 +8205,9 @@ function TaskInstanceTable({
7967
8205
  const pageNumbers = Array.from({
7968
8206
  length: totalPages
7969
8207
  }, (_, i) => i + 1);
7970
- const [showEditPopup, setShowEditPopup] = (0, import_react57.useState)(false);
7971
- const [showDeletePopup, setShowDeletePopup] = (0, import_react57.useState)(false);
7972
- const [selectedItem, setSelectedItem] = (0, import_react57.useState)(null);
8208
+ const [showEditPopup, setShowEditPopup] = (0, import_react56.useState)(false);
8209
+ const [showDeletePopup, setShowDeletePopup] = (0, import_react56.useState)(false);
8210
+ const [selectedItem, setSelectedItem] = (0, import_react56.useState)(null);
7973
8211
  const openEditPopup = (item) => {
7974
8212
  setSelectedItem(item);
7975
8213
  setShowEditPopup(true);
@@ -8090,7 +8328,7 @@ function TaskInstanceTable({
8090
8328
  }
8091
8329
 
8092
8330
  // src/components/task-instance/addtaskinstance.jsx
8093
- var import_react58 = __toESM(require("react"));
8331
+ var import_react57 = __toESM(require("react"));
8094
8332
  var import_jsx_runtime57 = require("react/jsx-runtime");
8095
8333
  function AddTaskInstanceModal({
8096
8334
  isOpen,
@@ -8223,17 +8461,17 @@ function AddTaskInstanceModal({
8223
8461
  // src/components/task-instance/task_instance_main.jsx
8224
8462
  var import_jsx_runtime58 = require("react/jsx-runtime");
8225
8463
  function Task_instance_main() {
8226
- const [refreshkey, setRefreshKey] = (0, import_react59.useState)(0);
8464
+ const [refreshkey, setRefreshKey] = (0, import_react58.useState)(0);
8227
8465
  const handleRefresh = () => {
8228
8466
  console.log("Table data refreshed!");
8229
8467
  setRefreshKey((prev) => prev + 1);
8230
8468
  };
8231
- const [modalOpen, setModalOpen] = (0, import_react59.useState)(false);
8232
- const [pageSize, setPageSize] = (0, import_react59.useState)(10);
8233
- const [searchQuery, setSearchQuery] = (0, import_react59.useState)("");
8234
- const tableRef = (0, import_react59.useRef)(null);
8235
- const [currentPage, setCurrentPage] = (0, import_react59.useState)(1);
8236
- const [totalEntries, setTotalEntries] = (0, import_react59.useState)(0);
8469
+ const [modalOpen, setModalOpen] = (0, import_react58.useState)(false);
8470
+ const [pageSize, setPageSize] = (0, import_react58.useState)(10);
8471
+ const [searchQuery, setSearchQuery] = (0, import_react58.useState)("");
8472
+ const tableRef = (0, import_react58.useRef)(null);
8473
+ const [currentPage, setCurrentPage] = (0, import_react58.useState)(1);
8474
+ const [totalEntries, setTotalEntries] = (0, import_react58.useState)(0);
8237
8475
  const handlePageSizeChange = (e) => {
8238
8476
  setPageSize(Number(e.target.value));
8239
8477
  setCurrentPage(1);
@@ -8300,10 +8538,10 @@ function Task_instance_main() {
8300
8538
  }
8301
8539
 
8302
8540
  // src/components/comment/comment_main.jsx
8303
- var import_react63 = __toESM(require("react"));
8541
+ var import_react62 = __toESM(require("react"));
8304
8542
 
8305
8543
  // src/components/comment/searchbarcomment.jsx
8306
- var import_react60 = __toESM(require("react"));
8544
+ var import_react59 = __toESM(require("react"));
8307
8545
  var import_jsx_runtime59 = require("react/jsx-runtime");
8308
8546
  function CommentSearchBar({
8309
8547
  searchQuery,
@@ -8327,7 +8565,7 @@ function CommentSearchBar({
8327
8565
  }
8328
8566
 
8329
8567
  // src/components/comment/commenttable.jsx
8330
- var import_react61 = __toESM(require("react"));
8568
+ var import_react60 = __toESM(require("react"));
8331
8569
  var import_jsx_runtime60 = require("react/jsx-runtime");
8332
8570
  function CommentTable({
8333
8571
  pageSize,
@@ -8537,9 +8775,9 @@ function CommentTable({
8537
8775
  createdOn: "08 Aug 2026",
8538
8776
  status: true
8539
8777
  }];
8540
- const [data, setData] = (0, import_react61.useState)(initialData);
8541
- const [sortOrder, setSortOrder] = (0, import_react61.useState)("asc");
8542
- const [sortKey, setSortKey] = (0, import_react61.useState)("commentId");
8778
+ const [data, setData] = (0, import_react60.useState)(initialData);
8779
+ const [sortOrder, setSortOrder] = (0, import_react60.useState)("asc");
8780
+ const [sortKey, setSortKey] = (0, import_react60.useState)("commentId");
8543
8781
  const handleSort = (columnKey) => {
8544
8782
  const isAsc = sortKey === columnKey && sortOrder === "asc";
8545
8783
  setSortOrder(isAsc ? "desc" : "asc");
@@ -8555,7 +8793,7 @@ function CommentTable({
8555
8793
  const query = (searchQuery || "").toLowerCase();
8556
8794
  return String(item.commentId).toLowerCase().includes(query) || String(item.taskInstanceId).toLowerCase().includes(query) || item.comment.toLowerCase().includes(query) || String(item.commentedBy).toLowerCase().includes(query);
8557
8795
  });
8558
- (0, import_react61.useEffect)(() => {
8796
+ (0, import_react60.useEffect)(() => {
8559
8797
  if (setTotalEntries) setTotalEntries(filteredData.length);
8560
8798
  }, [filteredData.length, setTotalEntries]);
8561
8799
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -8611,15 +8849,15 @@ function CommentTable({
8611
8849
  }
8612
8850
 
8613
8851
  // src/components/comment/addcomment.jsx
8614
- var import_react62 = __toESM(require("react"));
8852
+ var import_react61 = __toESM(require("react"));
8615
8853
  var import_jsx_runtime61 = require("react/jsx-runtime");
8616
8854
  function AddCommentModal({
8617
8855
  isOpen,
8618
8856
  onClose
8619
8857
  }) {
8620
- const [allowEdit, setAllowEdit] = (0, import_react62.useState)(true);
8621
- const [pinComment, setPinComment] = (0, import_react62.useState)(true);
8622
- const [sendNotification, setSendNotification] = (0, import_react62.useState)(false);
8858
+ const [allowEdit, setAllowEdit] = (0, import_react61.useState)(true);
8859
+ const [pinComment, setPinComment] = (0, import_react61.useState)(true);
8860
+ const [sendNotification, setSendNotification] = (0, import_react61.useState)(false);
8623
8861
  if (!isOpen) return null;
8624
8862
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)("div", { className: "fc:fixed fc:inset-0 fc:z-50 fc:flex fc:items-center fc:justify-center fc:p-4", children: [
8625
8863
  /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("div", { className: "fc:fixed fc:inset-0 fc:bg-slate-900/50 fc:backdrop-blur-sm fc:transition-opacity fc:duration-200", onClick: onClose }),
@@ -8816,12 +9054,12 @@ function AddCommentModal({
8816
9054
  // src/components/comment/comment_main.jsx
8817
9055
  var import_jsx_runtime62 = require("react/jsx-runtime");
8818
9056
  function Comment_main() {
8819
- const [modalOpen, setModalOpen] = (0, import_react63.useState)(false);
8820
- const [pageSize, setPageSize] = (0, import_react63.useState)(10);
8821
- const [searchQuery, setSearchQuery] = (0, import_react63.useState)("");
8822
- const [currentPage, setCurrentPage] = (0, import_react63.useState)(1);
8823
- const [totalEntries, setTotalEntries] = (0, import_react63.useState)(0);
8824
- const tableRef = (0, import_react63.useRef)(null);
9057
+ const [modalOpen, setModalOpen] = (0, import_react62.useState)(false);
9058
+ const [pageSize, setPageSize] = (0, import_react62.useState)(10);
9059
+ const [searchQuery, setSearchQuery] = (0, import_react62.useState)("");
9060
+ const [currentPage, setCurrentPage] = (0, import_react62.useState)(1);
9061
+ const [totalEntries, setTotalEntries] = (0, import_react62.useState)(0);
9062
+ const tableRef = (0, import_react62.useRef)(null);
8825
9063
  const handlePageSizeChange = (e) => {
8826
9064
  setPageSize(Number(e.target.value));
8827
9065
  setCurrentPage(1);
@@ -8890,11 +9128,11 @@ function Comment_main() {
8890
9128
  }
8891
9129
 
8892
9130
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
8893
- var import_react69 = __toESM(require("react"));
8894
- var import_sweetalert24 = __toESM(require("sweetalert2"));
9131
+ var import_react68 = __toESM(require("react"));
9132
+ var import_sweetalert26 = __toESM(require("sweetalert2"));
8895
9133
 
8896
9134
  // src/components/hierarchy-node/SearchBar.jsx
8897
- var import_react64 = __toESM(require("react"));
9135
+ var import_react63 = __toESM(require("react"));
8898
9136
  var import_jsx_runtime63 = require("react/jsx-runtime");
8899
9137
  function SearchBar9({ searchQuery, setSearchQuery }) {
8900
9138
  return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "fc:relative fc:max-w-sm fc:w-full", children: [
@@ -8930,18 +9168,18 @@ function SearchBar9({ searchQuery, setSearchQuery }) {
8930
9168
  }
8931
9169
 
8932
9170
  // src/components/hierarchy-node/HierarchyTable.jsx
8933
- var import_react67 = __toESM(require("react"));
9171
+ var import_react66 = __toESM(require("react"));
8934
9172
 
8935
9173
  // src/components/hierarchy-node/AddEditModal.jsx
8936
- var import_react65 = __toESM(require("react"));
9174
+ var import_react64 = __toESM(require("react"));
8937
9175
  var import_jsx_runtime64 = require("react/jsx-runtime");
8938
- function AddEditModal2({
9176
+ function AddEditModal({
8939
9177
  isOpen,
8940
9178
  onClose,
8941
9179
  onSave,
8942
9180
  editData
8943
9181
  }) {
8944
- const [formData, setFormData] = (0, import_react65.useState)({
9182
+ const [formData, setFormData] = (0, import_react64.useState)({
8945
9183
  hierarchyNodeId: "",
8946
9184
  parentHierarchyNodeId: "",
8947
9185
  hierarchyLevel: "",
@@ -8951,7 +9189,7 @@ function AddEditModal2({
8951
9189
  externalEntityId: "",
8952
9190
  isActive: true
8953
9191
  });
8954
- (0, import_react65.useEffect)(() => {
9192
+ (0, import_react64.useEffect)(() => {
8955
9193
  if (editData) {
8956
9194
  setFormData(editData);
8957
9195
  }
@@ -9094,7 +9332,7 @@ function AddEditModal2({
9094
9332
  }
9095
9333
 
9096
9334
  // src/components/hierarchy-node/DeleteModal.jsx
9097
- var import_react66 = __toESM(require("react"));
9335
+ var import_react65 = __toESM(require("react"));
9098
9336
  var import_jsx_runtime65 = require("react/jsx-runtime");
9099
9337
  function DeleteModal2({
9100
9338
  isOpen,
@@ -9250,27 +9488,27 @@ function HierarchyTable({
9250
9488
  externalEntityId: 1010,
9251
9489
  isActive: true
9252
9490
  }];
9253
- const [currentPage, setCurrentPage] = (0, import_react67.useState)(1);
9491
+ const [currentPage, setCurrentPage] = (0, import_react66.useState)(1);
9254
9492
  ;
9255
- const [data, setData] = (0, import_react67.useState)(apiData || hierarchyData);
9256
- (0, import_react67.useEffect)(() => {
9493
+ const [data, setData] = (0, import_react66.useState)(apiData || hierarchyData);
9494
+ (0, import_react66.useEffect)(() => {
9257
9495
  if (apiData) setData(apiData);
9258
9496
  }, [apiData]);
9259
9497
  const filteredData = data.filter(
9260
9498
  (item) => (item.nodeName || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || (item.nodeType || "").toLowerCase().includes((searchQuery || "").toLowerCase()) || String(item.hierarchyNodeId).includes(searchQuery || "")
9261
9499
  );
9262
- const [sortColumn, setSortColumn] = (0, import_react67.useState)("");
9263
- const [sortDirection, setSortDirection] = (0, import_react67.useState)("asc");
9500
+ const [sortColumn, setSortColumn] = (0, import_react66.useState)("");
9501
+ const [sortDirection, setSortDirection] = (0, import_react66.useState)("asc");
9264
9502
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
9265
9503
  const startIndex = (currentPage - 1) * pageSize;
9266
9504
  const visibleData = filteredData.slice(
9267
9505
  startIndex,
9268
9506
  startIndex + pageSize
9269
9507
  );
9270
- const [editOpen, setEditOpen] = (0, import_react67.useState)(false);
9271
- const [deleteOpen, setDeleteOpen] = (0, import_react67.useState)(false);
9272
- const [selectedNode, setSelectedNode] = (0, import_react67.useState)(null);
9273
- (0, import_react67.useEffect)(() => {
9508
+ const [editOpen, setEditOpen] = (0, import_react66.useState)(false);
9509
+ const [deleteOpen, setDeleteOpen] = (0, import_react66.useState)(false);
9510
+ const [selectedNode, setSelectedNode] = (0, import_react66.useState)(null);
9511
+ (0, import_react66.useEffect)(() => {
9274
9512
  setCurrentPage(1);
9275
9513
  }, [searchQuery, pageSize]);
9276
9514
  const handleSort = (column) => {
@@ -9421,7 +9659,7 @@ function HierarchyTable({
9421
9659
  )
9422
9660
  ] }),
9423
9661
  /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
9424
- AddEditModal2,
9662
+ AddEditModal,
9425
9663
  {
9426
9664
  isOpen: editOpen,
9427
9665
  editData: selectedNode,
@@ -9443,7 +9681,7 @@ function HierarchyTable({
9443
9681
  }
9444
9682
 
9445
9683
  // src/components/hierarchy-node/AddHierarchyNodeModal.jsx
9446
- var import_react68 = __toESM(require("react"));
9684
+ var import_react67 = __toESM(require("react"));
9447
9685
  var import_jsx_runtime67 = require("react/jsx-runtime");
9448
9686
  function AddHierarchyNodeModal({
9449
9687
  isOpen,
@@ -9549,12 +9787,12 @@ function AddHierarchyNodeModal({
9549
9787
  // src/components/hierarchy-node/HierarchyNodeMain.jsx
9550
9788
  var import_jsx_runtime68 = require("react/jsx-runtime");
9551
9789
  function HierarchyNodeMain() {
9552
- const [modalOpen, setModalOpen] = (0, import_react69.useState)(false);
9553
- const [pageSize, setPageSize] = (0, import_react69.useState)(5);
9554
- const tableRef = (0, import_react69.useRef)(null);
9555
- const [searchQuery, setSearchQuery] = (0, import_react69.useState)("");
9556
- const [apiData, setApiData] = (0, import_react69.useState)([]);
9557
- (0, import_react69.useEffect)(() => {
9790
+ const [modalOpen, setModalOpen] = (0, import_react68.useState)(false);
9791
+ const [pageSize, setPageSize] = (0, import_react68.useState)(5);
9792
+ const tableRef = (0, import_react68.useRef)(null);
9793
+ const [searchQuery, setSearchQuery] = (0, import_react68.useState)("");
9794
+ const [apiData, setApiData] = (0, import_react68.useState)([]);
9795
+ (0, import_react68.useEffect)(() => {
9558
9796
  (async () => {
9559
9797
  var _a, _b, _c, _d, _e, _f, _g;
9560
9798
  try {
@@ -9564,7 +9802,7 @@ function HierarchyNodeMain() {
9564
9802
  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;
9565
9803
  setApiData(Array.isArray(value) ? value : (value == null ? void 0 : value.items) || (value == null ? void 0 : value.records) || []);
9566
9804
  } catch (error) {
9567
- await import_sweetalert24.default.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");
9805
+ await import_sweetalert26.default.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");
9568
9806
  }
9569
9807
  })();
9570
9808
  }, [modalOpen]);
@@ -9630,10 +9868,10 @@ function HierarchyNodeMain() {
9630
9868
  }
9631
9869
 
9632
9870
  // src/components/file-pool/FilePoolMain.jsx
9633
- var import_react73 = __toESM(require("react"));
9871
+ var import_react72 = __toESM(require("react"));
9634
9872
 
9635
9873
  // src/components/file-pool/SearchBar.jsx
9636
- var import_react70 = __toESM(require("react"));
9874
+ var import_react69 = __toESM(require("react"));
9637
9875
  var import_jsx_runtime69 = require("react/jsx-runtime");
9638
9876
  function SearchBar10() {
9639
9877
  return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "fc:relative fc:w-full fc:max-w-sm", children: [
@@ -9643,7 +9881,7 @@ function SearchBar10() {
9643
9881
  }
9644
9882
 
9645
9883
  // src/components/file-pool/FilePoolTable.jsx
9646
- var import_react71 = __toESM(require("react"));
9884
+ var import_react70 = __toESM(require("react"));
9647
9885
  var import_jsx_runtime70 = require("react/jsx-runtime");
9648
9886
  function FilePoolTable({
9649
9887
  pageSize
@@ -9719,10 +9957,10 @@ function FilePoolTable({
9719
9957
  addedOn: "10-07-2026",
9720
9958
  pulledOn: "-"
9721
9959
  }];
9722
- const [currentPage, setCurrentPage] = (0, import_react71.useState)(1);
9723
- const [data, setData] = (0, import_react71.useState)(filePoolData);
9724
- const [sortColumn, setSortColumn] = (0, import_react71.useState)("");
9725
- const [sortDirection, setSortDirection] = (0, import_react71.useState)("asc");
9960
+ const [currentPage, setCurrentPage] = (0, import_react70.useState)(1);
9961
+ const [data, setData] = (0, import_react70.useState)(filePoolData);
9962
+ const [sortColumn, setSortColumn] = (0, import_react70.useState)("");
9963
+ const [sortDirection, setSortDirection] = (0, import_react70.useState)("asc");
9726
9964
  const totalPages = Math.ceil(data.length / pageSize) || 1;
9727
9965
  const startIndex = (currentPage - 1) * pageSize;
9728
9966
  const currentData = data.slice(startIndex, startIndex + pageSize);
@@ -9805,7 +10043,7 @@ function FilePoolTable({
9805
10043
  }
9806
10044
 
9807
10045
  // src/components/file-pool/AddFilePoolModal.jsx
9808
- var import_react72 = __toESM(require("react"));
10046
+ var import_react71 = __toESM(require("react"));
9809
10047
  var import_jsx_runtime71 = require("react/jsx-runtime");
9810
10048
  function AddFilePoolModal({
9811
10049
  isOpen,
@@ -9878,9 +10116,9 @@ function AddFilePoolModal({
9878
10116
  // src/components/file-pool/FilePoolMain.jsx
9879
10117
  var import_jsx_runtime72 = require("react/jsx-runtime");
9880
10118
  function FilePoolMain() {
9881
- const [modalOpen, setModalOpen] = (0, import_react73.useState)(false);
9882
- const [pageSize, setPageSize] = (0, import_react73.useState)(5);
9883
- const tableRef = (0, import_react73.useRef)(null);
10119
+ const [modalOpen, setModalOpen] = (0, import_react72.useState)(false);
10120
+ const [pageSize, setPageSize] = (0, import_react72.useState)(5);
10121
+ const tableRef = (0, import_react72.useRef)(null);
9884
10122
  const handleRefresh = () => {
9885
10123
  console.log("Refresh clicked");
9886
10124
  };
@@ -9930,10 +10168,10 @@ function FilePoolMain() {
9930
10168
  }
9931
10169
 
9932
10170
  // src/components/uploaded-document/UploadedDocumentMain.jsx
9933
- var import_react77 = __toESM(require("react"));
10171
+ var import_react76 = __toESM(require("react"));
9934
10172
 
9935
10173
  // src/components/uploaded-document/SearchBar.jsx
9936
- var import_react74 = __toESM(require("react"));
10174
+ var import_react73 = __toESM(require("react"));
9937
10175
  var import_jsx_runtime73 = require("react/jsx-runtime");
9938
10176
  function SearchBar11() {
9939
10177
  return /* @__PURE__ */ (0, import_jsx_runtime73.jsxs)("div", { className: "fc:relative fc:w-full fc:max-w-sm", children: [
@@ -9943,7 +10181,7 @@ function SearchBar11() {
9943
10181
  }
9944
10182
 
9945
10183
  // src/components/uploaded-document/UploadedDocumentTable.jsx
9946
- var import_react75 = __toESM(require("react"));
10184
+ var import_react74 = __toESM(require("react"));
9947
10185
  var import_jsx_runtime74 = require("react/jsx-runtime");
9948
10186
  function UploadedDocumentTable({
9949
10187
  pageSize
@@ -10019,10 +10257,10 @@ function UploadedDocumentTable({
10019
10257
  storagePath: "/uploads/certificate.pdf",
10020
10258
  uploadedBy: "Admin"
10021
10259
  }];
10022
- const [data, setData] = (0, import_react75.useState)(uploadedDocuments);
10023
- const [currentPage, setCurrentPage] = (0, import_react75.useState)(1);
10024
- const [sortColumn, setSortColumn] = (0, import_react75.useState)("");
10025
- const [sortDirection, setSortDirection] = (0, import_react75.useState)("asc");
10260
+ const [data, setData] = (0, import_react74.useState)(uploadedDocuments);
10261
+ const [currentPage, setCurrentPage] = (0, import_react74.useState)(1);
10262
+ const [sortColumn, setSortColumn] = (0, import_react74.useState)("");
10263
+ const [sortDirection, setSortDirection] = (0, import_react74.useState)("asc");
10026
10264
  const totalPages = Math.ceil(data.length / pageSize) || 1;
10027
10265
  const startIndex = (currentPage - 1) * pageSize;
10028
10266
  const currentData = data.slice(startIndex, startIndex + pageSize);
@@ -10106,7 +10344,7 @@ function UploadedDocumentTable({
10106
10344
  }
10107
10345
 
10108
10346
  // src/components/uploaded-document/AddUploadedDocumentModal.jsx
10109
- var import_react76 = __toESM(require("react"));
10347
+ var import_react75 = __toESM(require("react"));
10110
10348
  var import_jsx_runtime75 = require("react/jsx-runtime");
10111
10349
  function AddUploadedDocumentModal({
10112
10350
  isOpen,
@@ -10222,9 +10460,9 @@ function AddUploadedDocumentModal({
10222
10460
  // src/components/uploaded-document/UploadedDocumentMain.jsx
10223
10461
  var import_jsx_runtime76 = require("react/jsx-runtime");
10224
10462
  function UploadedDocumentMain() {
10225
- const [modalOpen, setModalOpen] = (0, import_react77.useState)(false);
10226
- const [pageSize, setPageSize] = (0, import_react77.useState)(5);
10227
- const tableRef = (0, import_react77.useRef)(null);
10463
+ const [modalOpen, setModalOpen] = (0, import_react76.useState)(false);
10464
+ const [pageSize, setPageSize] = (0, import_react76.useState)(5);
10465
+ const tableRef = (0, import_react76.useRef)(null);
10228
10466
  const handleRefresh = () => {
10229
10467
  console.log("Refresh clicked");
10230
10468
  };
@@ -10274,14 +10512,14 @@ function UploadedDocumentMain() {
10274
10512
  }
10275
10513
 
10276
10514
  // src/components/BuisnessEntity/BusinessEntitymain.js
10277
- var import_react79 = __toESM(require("react"));
10515
+ var import_react78 = __toESM(require("react"));
10278
10516
  var import_link4 = __toESM(require("next/link"));
10279
10517
 
10280
10518
  // src/components/BuisnessEntity/AddBusinessEntityModal.js
10281
- var import_react78 = __toESM(require("react"));
10519
+ var import_react77 = __toESM(require("react"));
10282
10520
  var import_jsx_runtime77 = require("react/jsx-runtime");
10283
10521
  function AddBusinessEntityModal({ onClose }) {
10284
- const [formData, setFormData] = (0, import_react78.useState)({
10522
+ const [formData, setFormData] = (0, import_react77.useState)({
10285
10523
  entityType: "",
10286
10524
  entityKey: "",
10287
10525
  displayNumber: "",
@@ -10290,7 +10528,7 @@ function AddBusinessEntityModal({ onClose }) {
10290
10528
  isVisible: true,
10291
10529
  status: "Active"
10292
10530
  });
10293
- const [errors, setErrors] = (0, import_react78.useState)({});
10531
+ const [errors, setErrors] = (0, import_react77.useState)({});
10294
10532
  const handleChange = (field, value) => {
10295
10533
  setFormData((prev) => __spreadProps(__spreadValues({}, prev), {
10296
10534
  [field]: value
@@ -10665,10 +10903,10 @@ function BusinessEntity() {
10665
10903
  const handleDownload = () => {
10666
10904
  console.log("Download clicked");
10667
10905
  };
10668
- const tableRef = (0, import_react79.useRef)(null);
10669
- const [showModal, setShowModal] = (0, import_react79.useState)(false);
10670
- const [pageSize, setPageSize] = (0, import_react79.useState)(5);
10671
- const [sortConfig, setSortConfig] = (0, import_react79.useState)({
10906
+ const tableRef = (0, import_react78.useRef)(null);
10907
+ const [showModal, setShowModal] = (0, import_react78.useState)(false);
10908
+ const [pageSize, setPageSize] = (0, import_react78.useState)(5);
10909
+ const [sortConfig, setSortConfig] = (0, import_react78.useState)({
10672
10910
  key: "",
10673
10911
  direction: "asc"
10674
10912
  });
@@ -10746,14 +10984,14 @@ function BusinessEntity() {
10746
10984
  }
10747
10985
 
10748
10986
  // src/components/FileInstance/FileInstancemain.js
10749
- var import_react81 = __toESM(require("react"));
10987
+ var import_react80 = __toESM(require("react"));
10750
10988
  var import_link5 = __toESM(require("next/link"));
10751
10989
 
10752
10990
  // src/components/FileInstance/AddWorkFlowFileInstanceModal.js
10753
- var import_react80 = __toESM(require("react"));
10991
+ var import_react79 = __toESM(require("react"));
10754
10992
  var import_jsx_runtime79 = require("react/jsx-runtime");
10755
10993
  function AddFileInstanceModal({ onClose }) {
10756
- const [formData, setFormData] = (0, import_react80.useState)({
10994
+ const [formData, setFormData] = (0, import_react79.useState)({
10757
10995
  workflow: "",
10758
10996
  businessEntityType: "",
10759
10997
  businessEntity: "",
@@ -10763,7 +11001,7 @@ function AddFileInstanceModal({ onClose }) {
10763
11001
  status: "Pending",
10764
11002
  priority: "High"
10765
11003
  });
10766
- const [errors, setErrors] = (0, import_react80.useState)({});
11004
+ const [errors, setErrors] = (0, import_react79.useState)({});
10767
11005
  const validateForm = () => {
10768
11006
  const newErrors = {};
10769
11007
  if (!formData.workflow) newErrors.workflow = "Workflow is required.";
@@ -11174,10 +11412,10 @@ function FileInstance() {
11174
11412
  const handleDownload = () => {
11175
11413
  console.log("Download clicked");
11176
11414
  };
11177
- const tableRef = (0, import_react81.useRef)(null);
11178
- const [showModal, setShowModal] = (0, import_react81.useState)(false);
11179
- const [pageSize, setPageSize] = (0, import_react81.useState)(5);
11180
- const [sortConfig, setSortConfig] = (0, import_react81.useState)({
11415
+ const tableRef = (0, import_react80.useRef)(null);
11416
+ const [showModal, setShowModal] = (0, import_react80.useState)(false);
11417
+ const [pageSize, setPageSize] = (0, import_react80.useState)(5);
11418
+ const [sortConfig, setSortConfig] = (0, import_react80.useState)({
11181
11419
  key: "",
11182
11420
  direction: "asc"
11183
11421
  });
@@ -11285,10 +11523,10 @@ function FileInstance() {
11285
11523
  }
11286
11524
 
11287
11525
  // src/components/assignment-rule/AssignmentRuleMain.jsx
11288
- var import_react85 = __toESM(require("react"));
11526
+ var import_react84 = __toESM(require("react"));
11289
11527
 
11290
11528
  // src/components/assignment-rule/SearchBar.js
11291
- var import_react82 = __toESM(require("react"));
11529
+ var import_react81 = __toESM(require("react"));
11292
11530
  var import_jsx_runtime81 = require("react/jsx-runtime");
11293
11531
  function SearchBar12({
11294
11532
  searchQuery,
@@ -11308,7 +11546,7 @@ function SearchBar12({
11308
11546
  }
11309
11547
 
11310
11548
  // src/components/assignment-rule/Table.js
11311
- var import_react83 = __toESM(require("react"));
11549
+ var import_react82 = __toESM(require("react"));
11312
11550
  var import_jsx_runtime82 = require("react/jsx-runtime");
11313
11551
  function Table4({
11314
11552
  pageSize,
@@ -11416,12 +11654,12 @@ function Table4({
11416
11654
  dynamicFunctionId: "4",
11417
11655
  isPoolEnabled: true
11418
11656
  }];
11419
- const [data, setData] = (0, import_react83.useState)(initialData);
11420
- const [sortOrder, setSortOrder] = (0, import_react83.useState)("asc");
11421
- const [sortKey, setSortKey] = (0, import_react83.useState)("workflowStepId");
11422
- const [selectedItem, setSelectedItem] = (0, import_react83.useState)(null);
11423
- const [isEditModalOpen, setIsEditModalOpen] = (0, import_react83.useState)(false);
11424
- const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react83.useState)(false);
11657
+ const [data, setData] = (0, import_react82.useState)(initialData);
11658
+ const [sortOrder, setSortOrder] = (0, import_react82.useState)("asc");
11659
+ const [sortKey, setSortKey] = (0, import_react82.useState)("workflowStepId");
11660
+ const [selectedItem, setSelectedItem] = (0, import_react82.useState)(null);
11661
+ const [isEditModalOpen, setIsEditModalOpen] = (0, import_react82.useState)(false);
11662
+ const [isDeleteModalOpen, setIsDeleteModalOpen] = (0, import_react82.useState)(false);
11425
11663
  const handleEdit = (item) => {
11426
11664
  setSelectedItem(item);
11427
11665
  setIsEditModalOpen(true);
@@ -11474,7 +11712,7 @@ function Table4({
11474
11712
  const query = searchQuery.toLowerCase().trim();
11475
11713
  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);
11476
11714
  });
11477
- (0, import_react83.useEffect)(() => {
11715
+ (0, import_react82.useEffect)(() => {
11478
11716
  if (setTotalEntries) setTotalEntries(filteredData.length);
11479
11717
  }, [filteredData.length, setTotalEntries]);
11480
11718
  const totalPages = Math.ceil(filteredData.length / pageSize) || 1;
@@ -11600,7 +11838,7 @@ function Table4({
11600
11838
  }
11601
11839
 
11602
11840
  // src/components/assignment-rule/Popup.js
11603
- var import_react84 = __toESM(require("react"));
11841
+ var import_react83 = __toESM(require("react"));
11604
11842
  var import_jsx_runtime83 = require("react/jsx-runtime");
11605
11843
  function Popup4({
11606
11844
  isOpen,
@@ -11608,11 +11846,11 @@ function Popup4({
11608
11846
  onSave
11609
11847
  }) {
11610
11848
  if (!isOpen) return null;
11611
- const [workflowStepId, setWorkflowStepId] = (0, import_react84.useState)("");
11612
- const [assignmentType, setAssignmentType] = (0, import_react84.useState)("");
11613
- const [hierarchyNodeType, setHierarchyNodeType] = (0, import_react84.useState)("");
11614
- const [dynamicFunctionId, setDynamicFunctionId] = (0, import_react84.useState)("");
11615
- const [isPoolEnabled, setIsPoolEnabled] = (0, import_react84.useState)(false);
11849
+ const [workflowStepId, setWorkflowStepId] = (0, import_react83.useState)("");
11850
+ const [assignmentType, setAssignmentType] = (0, import_react83.useState)("");
11851
+ const [hierarchyNodeType, setHierarchyNodeType] = (0, import_react83.useState)("");
11852
+ const [dynamicFunctionId, setDynamicFunctionId] = (0, import_react83.useState)("");
11853
+ const [isPoolEnabled, setIsPoolEnabled] = (0, import_react83.useState)(false);
11616
11854
  const handleSubmit = (e) => {
11617
11855
  e.preventDefault();
11618
11856
  if (!workflowStepId || !assignmentType || !hierarchyNodeType) {
@@ -11689,17 +11927,17 @@ function Popup4({
11689
11927
  // src/components/assignment-rule/AssignmentRuleMain.jsx
11690
11928
  var import_jsx_runtime84 = require("react/jsx-runtime");
11691
11929
  function AssignmentRuleMain() {
11692
- const [refreshkey, setRefreshKey] = (0, import_react85.useState)(0);
11930
+ const [refreshkey, setRefreshKey] = (0, import_react84.useState)(0);
11693
11931
  const handleRefresh = () => {
11694
11932
  console.log("Table data refreshed!");
11695
11933
  setRefreshKey((prev) => prev + 1);
11696
11934
  };
11697
- const tableRef = (0, import_react85.useRef)(null);
11698
- const [showModal, setShowModal] = (0, import_react85.useState)(false);
11699
- const [pageSize, setPageSize] = (0, import_react85.useState)(10);
11700
- const [searchQuery, setSearchQuery] = (0, import_react85.useState)("");
11701
- const [currentPage, setCurrentPage] = (0, import_react85.useState)(1);
11702
- const [totalEntries, setTotalEntries] = (0, import_react85.useState)(0);
11935
+ const tableRef = (0, import_react84.useRef)(null);
11936
+ const [showModal, setShowModal] = (0, import_react84.useState)(false);
11937
+ const [pageSize, setPageSize] = (0, import_react84.useState)(10);
11938
+ const [searchQuery, setSearchQuery] = (0, import_react84.useState)("");
11939
+ const [currentPage, setCurrentPage] = (0, import_react84.useState)(1);
11940
+ const [totalEntries, setTotalEntries] = (0, import_react84.useState)(0);
11703
11941
  const handlePageSizeChange = (e) => {
11704
11942
  setPageSize(Number(e.target.value));
11705
11943
  setCurrentPage(1);
@@ -11750,90 +11988,90 @@ var workflowItems = [
11750
11988
  {
11751
11989
  name: "Workflow Type",
11752
11990
  component: "workflowType",
11753
- icon: import_react87.RiGitMergeLine
11991
+ icon: import_react86.RiGitMergeLine
11754
11992
  },
11755
11993
  {
11756
11994
  name: "Workflow",
11757
11995
  component: "workflow",
11758
- icon: import_react87.RiNodeTree
11996
+ icon: import_react86.RiNodeTree
11759
11997
  },
11760
11998
  {
11761
11999
  name: "Workflow Step",
11762
12000
  component: "workflowStep",
11763
- icon: import_react87.RiGitBranchLine
12001
+ icon: import_react86.RiGitBranchLine
11764
12002
  },
11765
12003
  {
11766
12004
  name: "Workflow Transition",
11767
12005
  component: "workflowTransition",
11768
- icon: import_react87.RiCornerDownRightLine
12006
+ icon: import_react86.RiCornerDownRightLine
11769
12007
  }
11770
12008
  ];
11771
12009
  var permissionItems = [{
11772
12010
  name: "Task Permission",
11773
12011
  component: "Task_permission_main",
11774
- icon: import_react87.RiUserSettingsLine
12012
+ icon: import_react86.RiUserSettingsLine
11775
12013
  }, {
11776
12014
  name: "Assignment Rule",
11777
12015
  component: "AssignmentRuleMain",
11778
- icon: import_react87.RiFileShieldLine
12016
+ icon: import_react86.RiFileShieldLine
11779
12017
  }];
11780
12018
  var hierarchyItems = [{
11781
12019
  name: "Hierarchy Node",
11782
12020
  component: "HierarchyNodeMain",
11783
- icon: import_react87.RiNodeTree
12021
+ icon: import_react86.RiNodeTree
11784
12022
  }, {
11785
12023
  name: "User Hierarchy Mapping",
11786
12024
  component: "User_hierarchy_mapping_main",
11787
- icon: import_react87.RiUserSharedLine
12025
+ icon: import_react86.RiUserSharedLine
11788
12026
  }, {
11789
12027
  name: "Workflow Settings",
11790
12028
  component: "WorkflowSettingMain",
11791
- icon: import_react87.RiSettings4Line
12029
+ icon: import_react86.RiSettings4Line
11792
12030
  }];
11793
12031
  var documentItems = [{
11794
12032
  name: "Document Configuration",
11795
12033
  component: "DocumentConfigurationmain",
11796
- icon: import_react87.RiFileSettingsLine
12034
+ icon: import_react86.RiFileSettingsLine
11797
12035
  }];
11798
12036
  var fileItems = [{
11799
12037
  name: "File Instance",
11800
12038
  component: "FileInstanceMain",
11801
- icon: import_react87.RiFileList3Line
12039
+ icon: import_react86.RiFileList3Line
11802
12040
  }, {
11803
12041
  name: "Business Entity",
11804
12042
  component: "BusinessEntitymain",
11805
- icon: import_react87.RiFileList3Line
12043
+ icon: import_react86.RiFileList3Line
11806
12044
  }, {
11807
12045
  name: "File Pool",
11808
12046
  component: "FilePoolMain",
11809
- icon: import_react87.RiDatabase2Line
12047
+ icon: import_react86.RiDatabase2Line
11810
12048
  }, {
11811
12049
  name: "Uploaded Document",
11812
12050
  component: "UploadedDocumentMain",
11813
- icon: import_react87.RiFileUploadLine
12051
+ icon: import_react86.RiFileUploadLine
11814
12052
  }];
11815
12053
  var communicationItems = [{
11816
12054
  name: "Notification",
11817
12055
  component: "Notification_main",
11818
- icon: import_react87.RiNotification4Line
12056
+ icon: import_react86.RiNotification4Line
11819
12057
  }, {
11820
12058
  name: "Comment",
11821
12059
  component: "Comment_main",
11822
- icon: import_react87.RiChat3Line
12060
+ icon: import_react86.RiChat3Line
11823
12061
  }];
11824
12062
  var taskItems = [{
11825
12063
  name: "Task Instance",
11826
12064
  component: "TaskInstanceMain",
11827
- icon: import_react87.RiCheckboxMultipleLine
12065
+ icon: import_react86.RiCheckboxMultipleLine
11828
12066
  }];
11829
12067
  var trackingItems = [{
11830
12068
  name: "Audit Log",
11831
12069
  component: "AuditLogmain",
11832
- icon: import_react87.RiShieldCheckLine
12070
+ icon: import_react86.RiShieldCheckLine
11833
12071
  }, {
11834
12072
  name: "Movement History",
11835
12073
  component: "MovementHistorymain",
11836
- icon: import_react87.RiHistoryLine
12074
+ icon: import_react86.RiHistoryLine
11837
12075
  }];
11838
12076
  function Sidebar({
11839
12077
  isOpen,
@@ -11841,15 +12079,15 @@ function Sidebar({
11841
12079
  childrens
11842
12080
  }) {
11843
12081
  const router = (0, import_router.useRouter)();
11844
- const [workflowOpen, setWorkflowOpen] = (0, import_react86.useState)(false);
11845
- const [permissionOpen, setPermissionOpen] = (0, import_react86.useState)(false);
11846
- const [hierarchyOpen, setHierarchyOpen] = (0, import_react86.useState)(false);
11847
- const [documentOpen, setDocumentOpen] = (0, import_react86.useState)(false);
11848
- const [filesOpen, setFilesOpen] = (0, import_react86.useState)(false);
11849
- const [tasksOpen, setTasksOpen] = (0, import_react86.useState)(false);
11850
- const [trackingOpen, setTrackingOpen] = (0, import_react86.useState)(false);
11851
- const [communicationOpen, setCommunicationOpen] = (0, import_react86.useState)(false);
11852
- const [activeComponent, setActiveComponent] = (0, import_react86.useState)("workflowType");
12082
+ const [workflowOpen, setWorkflowOpen] = (0, import_react85.useState)(false);
12083
+ const [permissionOpen, setPermissionOpen] = (0, import_react85.useState)(false);
12084
+ const [hierarchyOpen, setHierarchyOpen] = (0, import_react85.useState)(false);
12085
+ const [documentOpen, setDocumentOpen] = (0, import_react85.useState)(false);
12086
+ const [filesOpen, setFilesOpen] = (0, import_react85.useState)(false);
12087
+ const [tasksOpen, setTasksOpen] = (0, import_react85.useState)(false);
12088
+ const [trackingOpen, setTrackingOpen] = (0, import_react85.useState)(false);
12089
+ const [communicationOpen, setCommunicationOpen] = (0, import_react85.useState)(false);
12090
+ const [activeComponent, setActiveComponent] = (0, import_react85.useState)("workflowType");
11853
12091
  const renderMenuItemold = (item) => {
11854
12092
  const Icon = item.icon;
11855
12093
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("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: [
@@ -11926,7 +12164,7 @@ function Sidebar({
11926
12164
  HeadingIcon && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(HeadingIcon, { size: 18, className: "fc:text-[#405170] fc:shrink-0" }),
11927
12165
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { className: "fc:text-[16px] fc:font-semibold", children: title })
11928
12166
  ] }),
11929
- open ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react87.RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react87.RiArrowRightSLine, { size: 18 })
12167
+ open ? /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react86.RiArrowDownSLine, { size: 18 }) : /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react86.RiArrowRightSLine, { size: 18 })
11930
12168
  ] }),
11931
12169
  open && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "fc:ml-[2px] fc:border-l fc:border-[#E5E9F1] fc:pl-[2px]", children: items.map(renderMenuItem) })
11932
12170
  ] });
@@ -11946,39 +12184,39 @@ function Sidebar({
11946
12184
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "fc:text-[12px] fc:text-[#344261]", children: "Workflow Engine" })
11947
12185
  ] })
11948
12186
  ] }),
11949
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", onClick: onToggle, className: "fc:flex fc:h-8 fc:w-8 fc:items-center fc:justify-center fc:rounded-lg hover:fc:fc:bg-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react87.RiMenuLine, { size: 18 }) })
12187
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", onClick: onToggle, className: "fc:flex fc:h-8 fc:w-8 fc:items-center fc:justify-center fc:rounded-lg hover:fc:fc:bg-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react86.RiMenuLine, { size: 18 }) })
11950
12188
  ] }),
11951
12189
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "fc:min-h-0 fc:flex-1 fc:overflow-y-auto fc:overflow-x-hidden fc:px-[27px] fc:pb-[30px] fc:pt-[31px]", children: [
11952
12190
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "fc:mb-[19px] fc:ml-[15px] fc:text-[14px] fc:font-bold fc:uppercase fc:leading-[20px] fc:tracking-[0.2px] fc:text-[#3C4D74]", children: "Configuration Masters" }),
11953
12191
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "fc:flex fc:flex-col fc:gap-[3px]", children: [
11954
- renderDropdown("Workflow", workflowOpen, setWorkflowOpen, workflowItems, import_react87.RiNodeTree),
11955
- renderDropdown("Permissions", permissionOpen, setPermissionOpen, permissionItems, import_react87.RiShieldUserLine),
11956
- renderDropdown("Documents", documentOpen, setDocumentOpen, documentItems, import_react87.RiFileSettingsLine),
11957
- renderDropdown("Hierarchy", hierarchyOpen, setHierarchyOpen, hierarchyItems, import_react87.RiNodeTree)
12192
+ renderDropdown("Workflow", workflowOpen, setWorkflowOpen, workflowItems, import_react86.RiNodeTree),
12193
+ renderDropdown("Permissions", permissionOpen, setPermissionOpen, permissionItems, import_react86.RiShieldUserLine),
12194
+ renderDropdown("Documents", documentOpen, setDocumentOpen, documentItems, import_react86.RiFileSettingsLine),
12195
+ renderDropdown("Hierarchy", hierarchyOpen, setHierarchyOpen, hierarchyItems, import_react86.RiNodeTree)
11958
12196
  ] }),
11959
12197
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("p", { className: "fc:mb-[19px] fc:ml-[15px] fc:mt-[39px] fc:text-[14px] fc:font-bold fc:uppercase fc:leading-[20px] fc:tracking-[0.2px] fc:text-[#3C4D74]", children: "Runtime" }),
11960
12198
  /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "fc:flex fc:flex-col fc:gap-[3px]", children: [
11961
- renderDropdown("Files", filesOpen, setFilesOpen, fileItems, import_react87.RiFolder3Line),
11962
- renderDropdown("Tasks", tasksOpen, setTasksOpen, taskItems, import_react87.RiCheckboxCircleLine),
11963
- renderDropdown("Tracking", trackingOpen, setTrackingOpen, trackingItems, import_react87.RiRouteLine),
11964
- renderDropdown("Communication", communicationOpen, setCommunicationOpen, communicationItems, import_react87.RiMessage2Line)
12199
+ renderDropdown("Files", filesOpen, setFilesOpen, fileItems, import_react86.RiFolder3Line),
12200
+ renderDropdown("Tasks", tasksOpen, setTasksOpen, taskItems, import_react86.RiCheckboxCircleLine),
12201
+ renderDropdown("Tracking", trackingOpen, setTrackingOpen, trackingItems, import_react86.RiRouteLine),
12202
+ renderDropdown("Communication", communicationOpen, setCommunicationOpen, communicationItems, import_react86.RiMessage2Line)
11965
12203
  ] })
11966
12204
  ] }),
11967
12205
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "fc:shrink-0 fc:bg-white fc:px-[27px] fc:pb-[34px] fc:pt-[18px]", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("button", { type: "button", className: "fc:flex fc:h-[66px] fc:w-full fc:items-center fc:gap-[18px] fc:rounded-[10px] fc:border fc:border-[#E1E5ED] fc:bg-white fc:px-[23px] fc:text-left fc:text-[16px] fc:font-semibold fc:text-[#2D3A58] fc:shadow-sm hover:fc:fc:bg-[#F7F8FC] fc:transition", children: [
11968
- /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react87.RiSettings4Line, { size: 20 }),
12206
+ /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react86.RiSettings4Line, { size: 20 }),
11969
12207
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("span", { children: "Settings" })
11970
12208
  ] }) })
11971
12209
  ] }),
11972
12210
  /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("div", { className: "fc:flex-1 fc:overflow-auto fc:bg-[#F5F7FB]", children: renderContent() }),
11973
- !isOpen && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", onClick: onToggle, "aria-label": "Open sidebar", className: "fc:fixed fc:left-[px] fc:top-[30px] fc:z-[100] fc:flex fc:h-[46px] fc:w-[46px] fc:items-center fc:justify-center fc:rounded-[9px] fc:border fc:border-[#E1E5ED] fc:bg-white fc:text-[#344261] fc:shadow-[0_2px_8px_rgba(0,0,0,0.08)] fc:transition-colors hover:fc:bg-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react87.RiMenuLine, { size: 18 }) })
12211
+ !isOpen && /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("button", { type: "button", onClick: onToggle, "aria-label": "Open sidebar", className: "fc:fixed fc:left-[px] fc:top-[30px] fc:z-[100] fc:flex fc:h-[46px] fc:w-[46px] fc:items-center fc:justify-center fc:rounded-[9px] fc:border fc:border-[#E1E5ED] fc:bg-white fc:text-[#344261] fc:shadow-[0_2px_8px_rgba(0,0,0,0.08)] fc:transition-colors hover:fc:bg-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_react86.RiMenuLine, { size: 18 }) })
11974
12212
  ] });
11975
12213
  }
11976
12214
 
11977
12215
  // src/components/Layout.jsx
11978
- var import_react88 = require("react");
12216
+ var import_react87 = require("react");
11979
12217
  var import_jsx_runtime86 = require("react/jsx-runtime");
11980
12218
  var Layout = ({ children }) => {
11981
- const [isOpen, setIsOpen] = (0, import_react88.useState)(true);
12219
+ const [isOpen, setIsOpen] = (0, import_react87.useState)(true);
11982
12220
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "flowcore fc:flex fc:min-h-screen", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
11983
12221
  Sidebar,
11984
12222
  {