jett.admin.npmpackage 1.0.99 → 1.0.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.css CHANGED
@@ -53,6 +53,7 @@
53
53
  --text-base--line-height: calc(1.5 / 1);
54
54
  --text-lg: 1.125rem;
55
55
  --text-lg--line-height: calc(1.75 / 1.125);
56
+ --font-weight-normal: 400;
56
57
  --font-weight-medium: 500;
57
58
  --font-weight-semibold: 600;
58
59
  --radius-sm: 0.25rem;
@@ -777,6 +778,15 @@
777
778
  font-size: var(--text-xs);
778
779
  line-height: var(--tw-leading, var(--text-xs--line-height));
779
780
  }
781
+ .\!text-\[14px\] {
782
+ font-size: 14px !important;
783
+ }
784
+ .\!text-\[15px\] {
785
+ font-size: 15px !important;
786
+ }
787
+ .\!text-\[16px\] {
788
+ font-size: 16px !important;
789
+ }
780
790
  .text-\[12px\] {
781
791
  font-size: 12px;
782
792
  }
@@ -794,6 +804,18 @@
794
804
  --tw-leading: calc(var(--spacing) * 6);
795
805
  line-height: calc(var(--spacing) * 6);
796
806
  }
807
+ .\!font-medium {
808
+ --tw-font-weight: var(--font-weight-medium) !important;
809
+ font-weight: var(--font-weight-medium) !important;
810
+ }
811
+ .\!font-normal {
812
+ --tw-font-weight: var(--font-weight-normal) !important;
813
+ font-weight: var(--font-weight-normal) !important;
814
+ }
815
+ .\!font-semibold {
816
+ --tw-font-weight: var(--font-weight-semibold) !important;
817
+ font-weight: var(--font-weight-semibold) !important;
818
+ }
797
819
  .font-\[500\] {
798
820
  --tw-font-weight: 500;
799
821
  font-weight: 500;
@@ -810,8 +832,11 @@
810
832
  --tw-font-weight: var(--font-weight-semibold);
811
833
  font-weight: var(--font-weight-semibold);
812
834
  }
813
- .text-\[\#000\] {
814
- color: #000;
835
+ .\!text-\[\#000\] {
836
+ color: #000 !important;
837
+ }
838
+ .\!text-\[\#3f3f46cc\] {
839
+ color: #3f3f46cc !important;
815
840
  }
816
841
  .text-\[\#3f3f46cc\] {
817
842
  color: #3f3f46cc;
@@ -1288,6 +1313,9 @@
1288
1313
  }
1289
1314
  }
1290
1315
  }
1316
+ body {
1317
+ font-family: "Inter", sans-serif;
1318
+ }
1291
1319
  @layer utilities {
1292
1320
  .scrollbar-hide {
1293
1321
  scrollbar-width: none;
package/dist/index.js CHANGED
@@ -455,33 +455,6 @@ var navItemsConstant = [
455
455
  },
456
456
  isDropDown: false
457
457
  },
458
- {
459
- Icon: import_lucide_react4.Globe,
460
- label: "TMC Ecosystem",
461
- onClick: () => {
462
- },
463
- isDropDown: true,
464
- options: [
465
- {
466
- label: "Markets",
467
- onClick: () => {
468
- window.location.href = "/market/";
469
- }
470
- },
471
- {
472
- label: "Users",
473
- onClick: () => {
474
- window.location.href = `/users/users?role=admin&auth=${encodedAuthData}`;
475
- }
476
- },
477
- {
478
- label: "Supplier Ecosystem",
479
- onClick: () => {
480
- window.location.href = "/supplier/";
481
- }
482
- }
483
- ]
484
- },
485
458
  {
486
459
  Icon: import_lucide_react4.Building,
487
460
  label: "Consumer Ecosystem",
@@ -501,43 +474,51 @@ var navItemsConstant = [
501
474
  }
502
475
  },
503
476
  {
504
- label: "Booking History",
477
+ label: "Users",
505
478
  onClick: () => {
506
- window.location.href = "/finance/bookingHistory/";
479
+ window.location.href = "/users/users";
507
480
  }
508
481
  },
509
482
  {
510
- label: "Reports",
483
+ label: "Tags (Consumer Variables)",
511
484
  onClick: () => {
512
- window.open("https://viz.jett.travel", "_blank");
485
+ window.location.href = "/orgselector/?path=tag";
513
486
  }
514
487
  },
515
488
  {
516
- label: "Users",
489
+ label: "Special Request",
517
490
  onClick: () => {
518
- window.location.href = "/users/users";
491
+ window.location.href = "/orgselector/?path=special-requests";
519
492
  }
520
493
  },
521
494
  {
522
- label: "Tags",
523
- onClick: () => {
524
- window.location.href = "/orgselector/?path=tag";
525
- }
526
- },
495
+ label: "Support Tickets (Coming Soon)",
496
+ isDisabled: true
497
+ // onClick: () => {},
498
+ }
499
+ ],
500
+ isDropDown: true
501
+ },
502
+ {
503
+ Icon: import_lucide_react4.Banknote,
504
+ label: "Finance",
505
+ onClick: () => {
506
+ },
507
+ isDropDown: true,
508
+ options: [
527
509
  {
528
- label: "Payment Ledger",
510
+ label: "Credit Management",
529
511
  onClick: () => {
530
512
  window.location.href = "/finance/paymentsLedger/";
531
513
  }
532
514
  },
533
515
  {
534
- label: "Special Request",
516
+ label: "Booking & Invoices",
535
517
  onClick: () => {
536
- window.location.href = "/orgselector/?path=special-requests";
518
+ window.location.href = "/finance/bookingHistory/";
537
519
  }
538
520
  }
539
- ],
540
- isDropDown: true
521
+ ]
541
522
  },
542
523
  {
543
524
  Icon: import_lucide_react4.DollarSign,
@@ -547,7 +528,7 @@ var navItemsConstant = [
547
528
  isDropDown: true,
548
529
  options: [
549
530
  {
550
- label: "Pricing Policy",
531
+ label: "Pricing Engine",
551
532
  onClick: () => {
552
533
  window.location.href = "/orgselector/?path=pricing-policy";
553
534
  }
@@ -563,21 +544,46 @@ var navItemsConstant = [
563
544
  onClick: () => {
564
545
  window.location.href = "/orgselector/?path=voucher";
565
546
  }
566
- },
547
+ }
548
+ ]
549
+ },
550
+ {
551
+ Icon: import_lucide_react4.Handshake,
552
+ label: "Supplier Ecosystem",
553
+ onClick: () => {
554
+ },
555
+ isDropDown: true,
556
+ options: [
567
557
  {
568
- label: "Supplier Deals",
558
+ label: "Suppliers List",
569
559
  onClick: () => {
570
- window.location.href = "/supplierdeals/";
560
+ window.location.href = "/supplier/";
571
561
  }
572
562
  },
573
563
  {
574
- label: "Invoices",
564
+ label: "Supplier Deals",
575
565
  onClick: () => {
576
- window.location.href = "/finance/invoices/";
566
+ window.location.href = "/supplierdeals/";
577
567
  }
578
568
  }
579
569
  ]
580
570
  },
571
+ {
572
+ Icon: import_lucide_react4.BarChart3,
573
+ label: "Reports",
574
+ onClick: () => {
575
+ },
576
+ isDropDown: true,
577
+ options: [
578
+ {
579
+ label: "Reports (Coming Soon)",
580
+ isDisabled: true
581
+ // onClick: () => {
582
+ // window.open("https://viz.jett.travel", "_blank");
583
+ // },
584
+ }
585
+ ]
586
+ },
581
587
  {
582
588
  Icon: import_lucide_react4.Cog,
583
589
  label: "Settings",
@@ -590,6 +596,23 @@ var navItemsConstant = [
590
596
  onClick: () => {
591
597
  window.location.href = "/whitelabel/";
592
598
  }
599
+ },
600
+ {
601
+ label: "Markets",
602
+ onClick: () => {
603
+ window.location.href = "/market/";
604
+ }
605
+ },
606
+ {
607
+ label: "Users",
608
+ onClick: () => {
609
+ window.location.href = `/users/users?role=admin&auth=${encodedAuthData}`;
610
+ }
611
+ },
612
+ {
613
+ label: "Reports Configurations (Coming Soon)",
614
+ isDisabled: true
615
+ // onClick: () => {},
593
616
  }
594
617
  ]
595
618
  }
@@ -795,31 +818,119 @@ var AppSideBar = ({
795
818
  const extractUrlFromOnClick = (onClick) => {
796
819
  if (!onClick || typeof onClick !== "function") return null;
797
820
  const funcString = onClick.toString();
798
- const match = funcString.match(/window\.location\.href\s*=\s*["']([^"']+)["']/);
821
+ let match = funcString.match(/window\.location\.href\s*=\s*`([^`]+)`/);
822
+ if (!match) {
823
+ match = funcString.match(/window\.location\.href\s*=\s*["']([^"']+)["']/);
824
+ }
799
825
  if (match && match[1]) {
800
826
  try {
801
827
  if (match[1].startsWith("http://") || match[1].startsWith("https://")) {
802
828
  const url = new URL(match[1]);
803
- return url.pathname;
829
+ return {
830
+ pathname: url.pathname,
831
+ search: url.search,
832
+ fullPath: url.pathname + url.search
833
+ };
804
834
  }
805
835
  if (match[1].startsWith("/")) {
806
836
  const url = new URL(match[1], window.location.origin);
807
- return url.pathname;
837
+ return {
838
+ pathname: url.pathname,
839
+ search: url.search,
840
+ fullPath: url.pathname + url.search
841
+ };
808
842
  }
809
843
  return null;
810
844
  } catch {
811
- const pathMatch = match[1].match(/^([^?]+)/);
812
- return pathMatch ? pathMatch[1] : null;
845
+ const pathMatch = match[1].match(/^([^?]+)(\?.*)?$/);
846
+ if (pathMatch) {
847
+ return {
848
+ pathname: pathMatch[1],
849
+ search: pathMatch[2] || "",
850
+ fullPath: match[1]
851
+ };
852
+ }
853
+ return null;
813
854
  }
814
855
  }
815
856
  return null;
816
857
  };
817
- const currentPathMatches = (menuUrl, currentPath) => {
818
- if (!menuUrl || !currentPath) return false;
819
- const normalizedMenuUrl = menuUrl.replace(/\/$/, "") || "/";
858
+ const currentUrlMatches = (menuUrlData, currentPath, currentSearch) => {
859
+ if (!menuUrlData || !currentPath) return false;
860
+ const normalizedMenuPath = menuUrlData.pathname.replace(/\/$/, "") || "/";
820
861
  const normalizedCurrentPath = currentPath.replace(/\/$/, "") || "/";
821
- if (normalizedMenuUrl === normalizedCurrentPath) return true;
822
- if (normalizedCurrentPath.startsWith(normalizedMenuUrl + "/")) return true;
862
+ if (normalizedMenuPath === "/users/users" && normalizedCurrentPath === "/users/users") {
863
+ const menuParams = new URLSearchParams(menuUrlData.search);
864
+ const currentParams = new URLSearchParams(currentSearch);
865
+ const menuRole = menuParams.get("role");
866
+ const currentRole = currentParams.get("role");
867
+ if (menuRole && currentRole) {
868
+ return menuRole === currentRole;
869
+ }
870
+ if (menuRole && !currentRole || !menuRole && currentRole) {
871
+ return false;
872
+ }
873
+ return true;
874
+ }
875
+ if (normalizedMenuPath === "/corporate" && normalizedCurrentPath.startsWith("/org/organizations")) {
876
+ return true;
877
+ }
878
+ if (normalizedMenuPath === "/trips") {
879
+ if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
880
+ return true;
881
+ }
882
+ }
883
+ if (normalizedMenuPath === "/orgselector" && menuUrlData.search) {
884
+ const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
885
+ if (menuPathParam) {
886
+ const pathRouteMap = {
887
+ "offer": "/offer/offer",
888
+ "voucher": "/voucher/voucher",
889
+ "tag": "/tags/tags",
890
+ "special-requests": "/corporate/special-requests",
891
+ "pricing-policy": "/policies/pricing-policy",
892
+ "users": "/users/users"
893
+ // Consumer Ecosystem Users (no role param)
894
+ };
895
+ const expectedRoute = pathRouteMap[menuPathParam];
896
+ if (expectedRoute) {
897
+ if (normalizedCurrentPath === expectedRoute || normalizedCurrentPath.startsWith(expectedRoute + "/")) {
898
+ if (menuPathParam === "users") {
899
+ const currentParams = new URLSearchParams(currentSearch);
900
+ const currentRole = currentParams.get("role");
901
+ return currentRole !== "admin";
902
+ }
903
+ return true;
904
+ }
905
+ }
906
+ }
907
+ if (normalizedCurrentPath === "/orgselector") {
908
+ const menuPathParam2 = new URLSearchParams(menuUrlData.search).get("path");
909
+ const currentPathParam = new URLSearchParams(currentSearch).get("path");
910
+ if (menuPathParam2 && currentPathParam) {
911
+ return menuPathParam2 === currentPathParam;
912
+ }
913
+ }
914
+ }
915
+ if (normalizedMenuPath === normalizedCurrentPath) {
916
+ if (menuUrlData.search) {
917
+ const menuParams = new URLSearchParams(menuUrlData.search);
918
+ const currentParams = new URLSearchParams(currentSearch);
919
+ for (const [key, value] of menuParams.entries()) {
920
+ if (key === "auth") {
921
+ continue;
922
+ }
923
+ if (currentParams.get(key) !== value) {
924
+ return false;
925
+ }
926
+ }
927
+ return true;
928
+ }
929
+ return true;
930
+ }
931
+ if (normalizedCurrentPath.startsWith(normalizedMenuPath + "/")) {
932
+ return true;
933
+ }
823
934
  return false;
824
935
  };
825
936
  const navItemsLocal = navItems ?? navItemsConstant;
@@ -827,27 +938,28 @@ var AppSideBar = ({
827
938
  const sideBarLogoLocal = sideBarLogo ?? logo_white_default;
828
939
  const detectAndSetActiveMenu = (0, import_react12.useCallback)(() => {
829
940
  const currentPath = window.location.pathname;
941
+ const currentSearch = window.location.search;
830
942
  const newOpenMenus = /* @__PURE__ */ new Set();
831
943
  let foundActivePath = null;
832
944
  navItemsLocal.forEach((item, index) => {
833
945
  if (!item.isDropDown && item.onClick && typeof item.onClick === "function") {
834
- const itemUrl = extractUrlFromOnClick(item.onClick);
835
- if (itemUrl && currentPathMatches(itemUrl, currentPath)) {
946
+ const itemUrlData = extractUrlFromOnClick(item.onClick);
947
+ if (itemUrlData && currentUrlMatches(itemUrlData, currentPath, currentSearch)) {
836
948
  foundActivePath = `menu-${index}`;
837
949
  }
838
950
  }
839
951
  if (item.options && item.options.length > 0) {
840
952
  item.options.forEach((option, optionsIndex) => {
841
953
  if (option.onClick && typeof option.onClick === "function") {
842
- const optionUrl = extractUrlFromOnClick(option.onClick);
843
- if (optionUrl && currentPathMatches(optionUrl, currentPath)) {
954
+ const optionUrlData = extractUrlFromOnClick(option.onClick);
955
+ if (optionUrlData && currentUrlMatches(optionUrlData, currentPath, currentSearch)) {
844
956
  const menuKey = `menu-${index}`;
845
957
  newOpenMenus.add(menuKey);
846
958
  foundActivePath = `menu-${index}-option-${optionsIndex}`;
847
959
  if (option.options && option.options.length > 0) {
848
960
  option.options.forEach((subOption, subIndex) => {
849
- const subOptionUrl = extractUrlFromOnClick(subOption.onClick);
850
- if (subOptionUrl && currentPathMatches(subOptionUrl, currentPath)) {
961
+ const subOptionUrlData = extractUrlFromOnClick(subOption.onClick);
962
+ if (subOptionUrlData && currentUrlMatches(subOptionUrlData, currentPath, currentSearch)) {
851
963
  const subMenuKey = `menu-${index}-option-${optionsIndex}`;
852
964
  newOpenMenus.add(subMenuKey);
853
965
  foundActivePath = `menu-${index}-option-${optionsIndex}-sub-${subOption.label}`;
@@ -864,18 +976,38 @@ var AppSideBar = ({
864
976
  setActiveMenuPath(foundActivePath);
865
977
  }
866
978
  }, [navItemsLocal]);
979
+ const [currentUrl, setCurrentUrl] = (0, import_react12.useState)(
980
+ () => window.location.pathname + window.location.search
981
+ );
867
982
  (0, import_react12.useEffect)(() => {
868
983
  detectAndSetActiveMenu();
984
+ setCurrentUrl(window.location.pathname + window.location.search);
869
985
  }, [detectAndSetActiveMenu]);
870
986
  (0, import_react12.useEffect)(() => {
987
+ let lastUrl = window.location.pathname + window.location.search;
871
988
  const handleLocationChange = () => {
872
- detectAndSetActiveMenu();
989
+ const newUrl = window.location.pathname + window.location.search;
990
+ if (newUrl !== lastUrl) {
991
+ lastUrl = newUrl;
992
+ setCurrentUrl(newUrl);
993
+ detectAndSetActiveMenu();
994
+ }
873
995
  };
874
996
  window.addEventListener("popstate", handleLocationChange);
997
+ const checkInterval = setInterval(() => {
998
+ const newUrl = window.location.pathname + window.location.search;
999
+ if (newUrl !== lastUrl) {
1000
+ handleLocationChange();
1001
+ }
1002
+ }, 250);
875
1003
  return () => {
876
1004
  window.removeEventListener("popstate", handleLocationChange);
1005
+ clearInterval(checkInterval);
877
1006
  };
878
1007
  }, [detectAndSetActiveMenu]);
1008
+ (0, import_react12.useEffect)(() => {
1009
+ detectAndSetActiveMenu();
1010
+ }, [currentUrl, detectAndSetActiveMenu]);
879
1011
  const toggleMobileMenu = () => {
880
1012
  setIsMobileMenuOpen(!isMobileMenuOpen);
881
1013
  };
@@ -932,7 +1064,7 @@ var AppSideBar = ({
932
1064
  onClick: (e) => handleMenuClick(item, index, e)
933
1065
  },
934
1066
  /* @__PURE__ */ import_react12.default.createElement("div", { className: "text-primary" }, /* @__PURE__ */ import_react12.default.createElement(item.Icon, { width: 20, height: 20 })),
935
- /* @__PURE__ */ import_react12.default.createElement("span", { className: "font-medium text-base text-[#000] dark:text-[#f4f4f5cc]" }, item.label),
1067
+ /* @__PURE__ */ import_react12.default.createElement("span", { className: "!font-medium !text-[16px] !text-[#000] dark:text-[#f4f4f5cc]" }, item.label),
936
1068
  item.isDropDown && /* @__PURE__ */ import_react12.default.createElement("div", { className: `ml-auto transition-all delay-75 ${isOpen ? "rotate-180" : ""}` }, /* @__PURE__ */ import_react12.default.createElement(import_lucide_react6.ChevronDown, { width: 20, height: 20, className: "text-gray-500 dark:text-gray-400" }))
937
1069
  ), item.options && item.options.length > 0 && /* @__PURE__ */ import_react12.default.createElement(
938
1070
  "div",
@@ -950,7 +1082,7 @@ var AppSideBar = ({
950
1082
  onClick: (e) => handleSubMenuClick(options, optionsIndex, index, e)
951
1083
  },
952
1084
  /* @__PURE__ */ import_react12.default.createElement("div", null),
953
- /* @__PURE__ */ import_react12.default.createElement("span", { className: "font-medium text-base text-[#3f3f46cc] dark:text-[#a1a1aa]" }, options.label),
1085
+ /* @__PURE__ */ import_react12.default.createElement("span", { className: "!font-medium !text-[15px] !text-[#3f3f46cc] dark:text-[#a1a1aa]" }, options.label),
954
1086
  options.isDropDown && /* @__PURE__ */ import_react12.default.createElement(
955
1087
  "div",
956
1088
  {
@@ -987,7 +1119,7 @@ var AppSideBar = ({
987
1119
  window.location.href = "/profile";
988
1120
  }
989
1121
  },
990
- /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "flex h-full w-full items-center justify-center rounded-full bg-muted dark:text-white" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "font-semibold dark:text-white" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin User"), /* @__PURE__ */ import_react12.default.createElement("p", { className: "text-sm dark:text-[#f4f4f5cc]" }, role)))
1122
+ /* @__PURE__ */ import_react12.default.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ import_react12.default.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ import_react12.default.createElement("div", null, /* @__PURE__ */ import_react12.default.createElement("p", { className: "!font-semibold dark:text-white !text-[16px]" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin"), /* @__PURE__ */ import_react12.default.createElement("p", { className: "!text-[14px] !font-normal dark:text-[#f4f4f5cc]" }, role)))
991
1123
  ))
992
1124
  ));
993
1125
  };
@@ -1167,7 +1299,7 @@ var Pagination = ({
1167
1299
  tableHeader,
1168
1300
  isHideCheckbox
1169
1301
  },
1170
- paginatedData.map((item, index) => {
1302
+ data.map((item, index) => {
1171
1303
  return /* @__PURE__ */ import_react15.default.createElement(
1172
1304
  ComponentType,
1173
1305
  {
@@ -1249,7 +1381,7 @@ var Pagination = ({
1249
1381
  {
1250
1382
  key: pageNum,
1251
1383
  onClick: () => handlePageChange(pageNum),
1252
- className: `flex items-center justify-center min-w-9 h-9 px-3 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`
1384
+ className: `flex items-center justify-center min-w-9 h-9 px-3 cursor-pointer rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`
1253
1385
  },
1254
1386
  pageNum
1255
1387
  )), /* @__PURE__ */ import_react15.default.createElement(
package/dist/index.mjs CHANGED
@@ -393,7 +393,7 @@ var CustomUpload = ({
393
393
  // src/sideBar/SideBar.jsx
394
394
  import {
395
395
  ChevronDown as ChevronDown3,
396
- Globe as Globe2,
396
+ Globe,
397
397
  LogOut,
398
398
  Menu,
399
399
  X
@@ -403,18 +403,13 @@ import React12, { useEffect, useState as useState3, useCallback } from "react";
403
403
  // ConstantUI.js
404
404
  import {
405
405
  Home,
406
- BaggageClaim,
407
- Users,
408
406
  Banknote,
409
- Globe,
410
- TrendingUp,
411
- FileText,
412
- FileKey2,
413
407
  LifeBuoy,
414
408
  Cog,
415
409
  Building,
416
410
  Handshake,
417
- DollarSign
411
+ DollarSign,
412
+ BarChart3
418
413
  } from "lucide-react";
419
414
  var encodedAuthData = localStorage.getItem("encodedAuthData");
420
415
  var navItemsConstant = [
@@ -426,33 +421,6 @@ var navItemsConstant = [
426
421
  },
427
422
  isDropDown: false
428
423
  },
429
- {
430
- Icon: Globe,
431
- label: "TMC Ecosystem",
432
- onClick: () => {
433
- },
434
- isDropDown: true,
435
- options: [
436
- {
437
- label: "Markets",
438
- onClick: () => {
439
- window.location.href = "/market/";
440
- }
441
- },
442
- {
443
- label: "Users",
444
- onClick: () => {
445
- window.location.href = `/users/users?role=admin&auth=${encodedAuthData}`;
446
- }
447
- },
448
- {
449
- label: "Supplier Ecosystem",
450
- onClick: () => {
451
- window.location.href = "/supplier/";
452
- }
453
- }
454
- ]
455
- },
456
424
  {
457
425
  Icon: Building,
458
426
  label: "Consumer Ecosystem",
@@ -472,43 +440,51 @@ var navItemsConstant = [
472
440
  }
473
441
  },
474
442
  {
475
- label: "Booking History",
443
+ label: "Users",
476
444
  onClick: () => {
477
- window.location.href = "/finance/bookingHistory/";
445
+ window.location.href = "/users/users";
478
446
  }
479
447
  },
480
448
  {
481
- label: "Reports",
449
+ label: "Tags (Consumer Variables)",
482
450
  onClick: () => {
483
- window.open("https://viz.jett.travel", "_blank");
451
+ window.location.href = "/orgselector/?path=tag";
484
452
  }
485
453
  },
486
454
  {
487
- label: "Users",
455
+ label: "Special Request",
488
456
  onClick: () => {
489
- window.location.href = "/users/users";
457
+ window.location.href = "/orgselector/?path=special-requests";
490
458
  }
491
459
  },
492
460
  {
493
- label: "Tags",
494
- onClick: () => {
495
- window.location.href = "/orgselector/?path=tag";
496
- }
497
- },
461
+ label: "Support Tickets (Coming Soon)",
462
+ isDisabled: true
463
+ // onClick: () => {},
464
+ }
465
+ ],
466
+ isDropDown: true
467
+ },
468
+ {
469
+ Icon: Banknote,
470
+ label: "Finance",
471
+ onClick: () => {
472
+ },
473
+ isDropDown: true,
474
+ options: [
498
475
  {
499
- label: "Payment Ledger",
476
+ label: "Credit Management",
500
477
  onClick: () => {
501
478
  window.location.href = "/finance/paymentsLedger/";
502
479
  }
503
480
  },
504
481
  {
505
- label: "Special Request",
482
+ label: "Booking & Invoices",
506
483
  onClick: () => {
507
- window.location.href = "/orgselector/?path=special-requests";
484
+ window.location.href = "/finance/bookingHistory/";
508
485
  }
509
486
  }
510
- ],
511
- isDropDown: true
487
+ ]
512
488
  },
513
489
  {
514
490
  Icon: DollarSign,
@@ -518,7 +494,7 @@ var navItemsConstant = [
518
494
  isDropDown: true,
519
495
  options: [
520
496
  {
521
- label: "Pricing Policy",
497
+ label: "Pricing Engine",
522
498
  onClick: () => {
523
499
  window.location.href = "/orgselector/?path=pricing-policy";
524
500
  }
@@ -534,21 +510,46 @@ var navItemsConstant = [
534
510
  onClick: () => {
535
511
  window.location.href = "/orgselector/?path=voucher";
536
512
  }
537
- },
513
+ }
514
+ ]
515
+ },
516
+ {
517
+ Icon: Handshake,
518
+ label: "Supplier Ecosystem",
519
+ onClick: () => {
520
+ },
521
+ isDropDown: true,
522
+ options: [
538
523
  {
539
- label: "Supplier Deals",
524
+ label: "Suppliers List",
540
525
  onClick: () => {
541
- window.location.href = "/supplierdeals/";
526
+ window.location.href = "/supplier/";
542
527
  }
543
528
  },
544
529
  {
545
- label: "Invoices",
530
+ label: "Supplier Deals",
546
531
  onClick: () => {
547
- window.location.href = "/finance/invoices/";
532
+ window.location.href = "/supplierdeals/";
548
533
  }
549
534
  }
550
535
  ]
551
536
  },
537
+ {
538
+ Icon: BarChart3,
539
+ label: "Reports",
540
+ onClick: () => {
541
+ },
542
+ isDropDown: true,
543
+ options: [
544
+ {
545
+ label: "Reports (Coming Soon)",
546
+ isDisabled: true
547
+ // onClick: () => {
548
+ // window.open("https://viz.jett.travel", "_blank");
549
+ // },
550
+ }
551
+ ]
552
+ },
552
553
  {
553
554
  Icon: Cog,
554
555
  label: "Settings",
@@ -561,6 +562,23 @@ var navItemsConstant = [
561
562
  onClick: () => {
562
563
  window.location.href = "/whitelabel/";
563
564
  }
565
+ },
566
+ {
567
+ label: "Markets",
568
+ onClick: () => {
569
+ window.location.href = "/market/";
570
+ }
571
+ },
572
+ {
573
+ label: "Users",
574
+ onClick: () => {
575
+ window.location.href = `/users/users?role=admin&auth=${encodedAuthData}`;
576
+ }
577
+ },
578
+ {
579
+ label: "Reports Configurations (Coming Soon)",
580
+ isDisabled: true
581
+ // onClick: () => {},
564
582
  }
565
583
  ]
566
584
  }
@@ -766,31 +784,119 @@ var AppSideBar = ({
766
784
  const extractUrlFromOnClick = (onClick) => {
767
785
  if (!onClick || typeof onClick !== "function") return null;
768
786
  const funcString = onClick.toString();
769
- const match = funcString.match(/window\.location\.href\s*=\s*["']([^"']+)["']/);
787
+ let match = funcString.match(/window\.location\.href\s*=\s*`([^`]+)`/);
788
+ if (!match) {
789
+ match = funcString.match(/window\.location\.href\s*=\s*["']([^"']+)["']/);
790
+ }
770
791
  if (match && match[1]) {
771
792
  try {
772
793
  if (match[1].startsWith("http://") || match[1].startsWith("https://")) {
773
794
  const url = new URL(match[1]);
774
- return url.pathname;
795
+ return {
796
+ pathname: url.pathname,
797
+ search: url.search,
798
+ fullPath: url.pathname + url.search
799
+ };
775
800
  }
776
801
  if (match[1].startsWith("/")) {
777
802
  const url = new URL(match[1], window.location.origin);
778
- return url.pathname;
803
+ return {
804
+ pathname: url.pathname,
805
+ search: url.search,
806
+ fullPath: url.pathname + url.search
807
+ };
779
808
  }
780
809
  return null;
781
810
  } catch {
782
- const pathMatch = match[1].match(/^([^?]+)/);
783
- return pathMatch ? pathMatch[1] : null;
811
+ const pathMatch = match[1].match(/^([^?]+)(\?.*)?$/);
812
+ if (pathMatch) {
813
+ return {
814
+ pathname: pathMatch[1],
815
+ search: pathMatch[2] || "",
816
+ fullPath: match[1]
817
+ };
818
+ }
819
+ return null;
784
820
  }
785
821
  }
786
822
  return null;
787
823
  };
788
- const currentPathMatches = (menuUrl, currentPath) => {
789
- if (!menuUrl || !currentPath) return false;
790
- const normalizedMenuUrl = menuUrl.replace(/\/$/, "") || "/";
824
+ const currentUrlMatches = (menuUrlData, currentPath, currentSearch) => {
825
+ if (!menuUrlData || !currentPath) return false;
826
+ const normalizedMenuPath = menuUrlData.pathname.replace(/\/$/, "") || "/";
791
827
  const normalizedCurrentPath = currentPath.replace(/\/$/, "") || "/";
792
- if (normalizedMenuUrl === normalizedCurrentPath) return true;
793
- if (normalizedCurrentPath.startsWith(normalizedMenuUrl + "/")) return true;
828
+ if (normalizedMenuPath === "/users/users" && normalizedCurrentPath === "/users/users") {
829
+ const menuParams = new URLSearchParams(menuUrlData.search);
830
+ const currentParams = new URLSearchParams(currentSearch);
831
+ const menuRole = menuParams.get("role");
832
+ const currentRole = currentParams.get("role");
833
+ if (menuRole && currentRole) {
834
+ return menuRole === currentRole;
835
+ }
836
+ if (menuRole && !currentRole || !menuRole && currentRole) {
837
+ return false;
838
+ }
839
+ return true;
840
+ }
841
+ if (normalizedMenuPath === "/corporate" && normalizedCurrentPath.startsWith("/org/organizations")) {
842
+ return true;
843
+ }
844
+ if (normalizedMenuPath === "/trips") {
845
+ if (normalizedCurrentPath.startsWith("/tripdetails") || normalizedCurrentPath.startsWith("/offline")) {
846
+ return true;
847
+ }
848
+ }
849
+ if (normalizedMenuPath === "/orgselector" && menuUrlData.search) {
850
+ const menuPathParam = new URLSearchParams(menuUrlData.search).get("path");
851
+ if (menuPathParam) {
852
+ const pathRouteMap = {
853
+ "offer": "/offer/offer",
854
+ "voucher": "/voucher/voucher",
855
+ "tag": "/tags/tags",
856
+ "special-requests": "/corporate/special-requests",
857
+ "pricing-policy": "/policies/pricing-policy",
858
+ "users": "/users/users"
859
+ // Consumer Ecosystem Users (no role param)
860
+ };
861
+ const expectedRoute = pathRouteMap[menuPathParam];
862
+ if (expectedRoute) {
863
+ if (normalizedCurrentPath === expectedRoute || normalizedCurrentPath.startsWith(expectedRoute + "/")) {
864
+ if (menuPathParam === "users") {
865
+ const currentParams = new URLSearchParams(currentSearch);
866
+ const currentRole = currentParams.get("role");
867
+ return currentRole !== "admin";
868
+ }
869
+ return true;
870
+ }
871
+ }
872
+ }
873
+ if (normalizedCurrentPath === "/orgselector") {
874
+ const menuPathParam2 = new URLSearchParams(menuUrlData.search).get("path");
875
+ const currentPathParam = new URLSearchParams(currentSearch).get("path");
876
+ if (menuPathParam2 && currentPathParam) {
877
+ return menuPathParam2 === currentPathParam;
878
+ }
879
+ }
880
+ }
881
+ if (normalizedMenuPath === normalizedCurrentPath) {
882
+ if (menuUrlData.search) {
883
+ const menuParams = new URLSearchParams(menuUrlData.search);
884
+ const currentParams = new URLSearchParams(currentSearch);
885
+ for (const [key, value] of menuParams.entries()) {
886
+ if (key === "auth") {
887
+ continue;
888
+ }
889
+ if (currentParams.get(key) !== value) {
890
+ return false;
891
+ }
892
+ }
893
+ return true;
894
+ }
895
+ return true;
896
+ }
897
+ if (normalizedCurrentPath.startsWith(normalizedMenuPath + "/")) {
898
+ return true;
899
+ }
794
900
  return false;
795
901
  };
796
902
  const navItemsLocal = navItems ?? navItemsConstant;
@@ -798,27 +904,28 @@ var AppSideBar = ({
798
904
  const sideBarLogoLocal = sideBarLogo ?? logo_white_default;
799
905
  const detectAndSetActiveMenu = useCallback(() => {
800
906
  const currentPath = window.location.pathname;
907
+ const currentSearch = window.location.search;
801
908
  const newOpenMenus = /* @__PURE__ */ new Set();
802
909
  let foundActivePath = null;
803
910
  navItemsLocal.forEach((item, index) => {
804
911
  if (!item.isDropDown && item.onClick && typeof item.onClick === "function") {
805
- const itemUrl = extractUrlFromOnClick(item.onClick);
806
- if (itemUrl && currentPathMatches(itemUrl, currentPath)) {
912
+ const itemUrlData = extractUrlFromOnClick(item.onClick);
913
+ if (itemUrlData && currentUrlMatches(itemUrlData, currentPath, currentSearch)) {
807
914
  foundActivePath = `menu-${index}`;
808
915
  }
809
916
  }
810
917
  if (item.options && item.options.length > 0) {
811
918
  item.options.forEach((option, optionsIndex) => {
812
919
  if (option.onClick && typeof option.onClick === "function") {
813
- const optionUrl = extractUrlFromOnClick(option.onClick);
814
- if (optionUrl && currentPathMatches(optionUrl, currentPath)) {
920
+ const optionUrlData = extractUrlFromOnClick(option.onClick);
921
+ if (optionUrlData && currentUrlMatches(optionUrlData, currentPath, currentSearch)) {
815
922
  const menuKey = `menu-${index}`;
816
923
  newOpenMenus.add(menuKey);
817
924
  foundActivePath = `menu-${index}-option-${optionsIndex}`;
818
925
  if (option.options && option.options.length > 0) {
819
926
  option.options.forEach((subOption, subIndex) => {
820
- const subOptionUrl = extractUrlFromOnClick(subOption.onClick);
821
- if (subOptionUrl && currentPathMatches(subOptionUrl, currentPath)) {
927
+ const subOptionUrlData = extractUrlFromOnClick(subOption.onClick);
928
+ if (subOptionUrlData && currentUrlMatches(subOptionUrlData, currentPath, currentSearch)) {
822
929
  const subMenuKey = `menu-${index}-option-${optionsIndex}`;
823
930
  newOpenMenus.add(subMenuKey);
824
931
  foundActivePath = `menu-${index}-option-${optionsIndex}-sub-${subOption.label}`;
@@ -835,18 +942,38 @@ var AppSideBar = ({
835
942
  setActiveMenuPath(foundActivePath);
836
943
  }
837
944
  }, [navItemsLocal]);
945
+ const [currentUrl, setCurrentUrl] = useState3(
946
+ () => window.location.pathname + window.location.search
947
+ );
838
948
  useEffect(() => {
839
949
  detectAndSetActiveMenu();
950
+ setCurrentUrl(window.location.pathname + window.location.search);
840
951
  }, [detectAndSetActiveMenu]);
841
952
  useEffect(() => {
953
+ let lastUrl = window.location.pathname + window.location.search;
842
954
  const handleLocationChange = () => {
843
- detectAndSetActiveMenu();
955
+ const newUrl = window.location.pathname + window.location.search;
956
+ if (newUrl !== lastUrl) {
957
+ lastUrl = newUrl;
958
+ setCurrentUrl(newUrl);
959
+ detectAndSetActiveMenu();
960
+ }
844
961
  };
845
962
  window.addEventListener("popstate", handleLocationChange);
963
+ const checkInterval = setInterval(() => {
964
+ const newUrl = window.location.pathname + window.location.search;
965
+ if (newUrl !== lastUrl) {
966
+ handleLocationChange();
967
+ }
968
+ }, 250);
846
969
  return () => {
847
970
  window.removeEventListener("popstate", handleLocationChange);
971
+ clearInterval(checkInterval);
848
972
  };
849
973
  }, [detectAndSetActiveMenu]);
974
+ useEffect(() => {
975
+ detectAndSetActiveMenu();
976
+ }, [currentUrl, detectAndSetActiveMenu]);
850
977
  const toggleMobileMenu = () => {
851
978
  setIsMobileMenuOpen(!isMobileMenuOpen);
852
979
  };
@@ -903,7 +1030,7 @@ var AppSideBar = ({
903
1030
  onClick: (e) => handleMenuClick(item, index, e)
904
1031
  },
905
1032
  /* @__PURE__ */ React12.createElement("div", { className: "text-primary" }, /* @__PURE__ */ React12.createElement(item.Icon, { width: 20, height: 20 })),
906
- /* @__PURE__ */ React12.createElement("span", { className: "font-medium text-base text-[#000] dark:text-[#f4f4f5cc]" }, item.label),
1033
+ /* @__PURE__ */ React12.createElement("span", { className: "!font-medium !text-[16px] !text-[#000] dark:text-[#f4f4f5cc]" }, item.label),
907
1034
  item.isDropDown && /* @__PURE__ */ React12.createElement("div", { className: `ml-auto transition-all delay-75 ${isOpen ? "rotate-180" : ""}` }, /* @__PURE__ */ React12.createElement(ChevronDown3, { width: 20, height: 20, className: "text-gray-500 dark:text-gray-400" }))
908
1035
  ), item.options && item.options.length > 0 && /* @__PURE__ */ React12.createElement(
909
1036
  "div",
@@ -921,7 +1048,7 @@ var AppSideBar = ({
921
1048
  onClick: (e) => handleSubMenuClick(options, optionsIndex, index, e)
922
1049
  },
923
1050
  /* @__PURE__ */ React12.createElement("div", null),
924
- /* @__PURE__ */ React12.createElement("span", { className: "font-medium text-base text-[#3f3f46cc] dark:text-[#a1a1aa]" }, options.label),
1051
+ /* @__PURE__ */ React12.createElement("span", { className: "!font-medium !text-[15px] !text-[#3f3f46cc] dark:text-[#a1a1aa]" }, options.label),
925
1052
  options.isDropDown && /* @__PURE__ */ React12.createElement(
926
1053
  "div",
927
1054
  {
@@ -958,7 +1085,7 @@ var AppSideBar = ({
958
1085
  window.location.href = "/profile";
959
1086
  }
960
1087
  },
961
- /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React12.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ React12.createElement("span", { className: "flex h-full w-full items-center justify-center rounded-full bg-muted dark:text-white" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "font-semibold dark:text-white" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin User"), /* @__PURE__ */ React12.createElement("p", { className: "text-sm dark:text-[#f4f4f5cc]" }, role)))
1088
+ /* @__PURE__ */ React12.createElement("div", { className: "flex items-center gap-3" }, /* @__PURE__ */ React12.createElement("span", { className: "relative flex shrink-0 overflow-hidden dark:bg-[#27272a] rounded-full h-10 w-10" }, /* @__PURE__ */ React12.createElement("span", { className: "flex h-full w-full items-center justify-center !text-[16px] !font-normal border border-gray-200 dark:border-[#303036] rounded-full bg-muted dark:text-white" }, ((_a = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _a.UserName) ? authData.userInfo.UserName.split("")[0] : "A")), /* @__PURE__ */ React12.createElement("div", null, /* @__PURE__ */ React12.createElement("p", { className: "!font-semibold dark:text-white !text-[16px]" }, ((_b = authData == null ? void 0 : authData.userInfo) == null ? void 0 : _b.UserName) ? authData.userInfo.UserName : "Admin"), /* @__PURE__ */ React12.createElement("p", { className: "!text-[14px] !font-normal dark:text-[#f4f4f5cc]" }, role)))
962
1089
  ))
963
1090
  ));
964
1091
  };
@@ -1138,7 +1265,7 @@ var Pagination = ({
1138
1265
  tableHeader,
1139
1266
  isHideCheckbox
1140
1267
  },
1141
- paginatedData.map((item, index) => {
1268
+ data.map((item, index) => {
1142
1269
  return /* @__PURE__ */ React15.createElement(
1143
1270
  ComponentType,
1144
1271
  {
@@ -1220,7 +1347,7 @@ var Pagination = ({
1220
1347
  {
1221
1348
  key: pageNum,
1222
1349
  onClick: () => handlePageChange(pageNum),
1223
- className: `flex items-center justify-center min-w-9 h-9 px-3 rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`
1350
+ className: `flex items-center justify-center min-w-9 h-9 px-3 cursor-pointer rounded-md border border-[#e5e5e5] dark:border-[#303036] text-sm transition-colors ${currentPage === pageNum ? "bg-primary text-white border-primary dark:bg-primary" : "bg-white text-black hover:bg-gray-50 dark:bg-[#18181b] dark:text-white dark:hover:bg-[#27272a]"}`
1224
1351
  },
1225
1352
  pageNum
1226
1353
  )), /* @__PURE__ */ React15.createElement(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "jett.admin.npmpackage",
3
- "version": "1.0.99",
3
+ "version": "1.0.100",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "exports": {