ptechcore_ui 1.0.20 → 1.0.22

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.
Files changed (36) hide show
  1. package/dist/imgs/login_illustration.png +0 -0
  2. package/dist/index.cjs +691 -583
  3. package/dist/index.d.cts +21 -0
  4. package/dist/index.d.ts +21 -0
  5. package/dist/index.js +715 -693
  6. package/dist/modules-icons/accountingblanc.svg +1 -0
  7. package/dist/modules-icons/accountingblue.svg +1 -0
  8. package/dist/modules-icons/assetblanc.svg +1 -0
  9. package/dist/modules-icons/assetblue.svg +1 -0
  10. package/dist/modules-icons/biblanc.svg +1 -0
  11. package/dist/modules-icons/biblue.svg +1 -0
  12. package/dist/modules-icons/collection_litigationblanc.svg +1 -0
  13. package/dist/modules-icons/collection_litigationblue.svg +1 -0
  14. package/dist/modules-icons/crm-blue.svg +1 -0
  15. package/dist/modules-icons/crmwhite.svg +1 -0
  16. package/dist/modules-icons/facilityblanc.svg +1 -0
  17. package/dist/modules-icons/facilityblue.svg +1 -0
  18. package/dist/modules-icons/financeblanc.svg +1 -0
  19. package/dist/modules-icons/financeblue.svg +1 -0
  20. package/dist/modules-icons/human_capitalblanc.svg +1 -0
  21. package/dist/modules-icons/human_capitalblue.svg +1 -0
  22. package/dist/modules-icons/invoicingblanc.svg +1 -0
  23. package/dist/modules-icons/invoicingblue.svg +1 -0
  24. package/dist/modules-icons/marketingblanc.svg +1 -0
  25. package/dist/modules-icons/marketingblue.svg +1 -0
  26. package/dist/modules-icons/procurementblanc.svg +1 -0
  27. package/dist/modules-icons/procurementblue.svg +1 -0
  28. package/dist/modules-icons/security_managementblanc.svg +1 -0
  29. package/dist/modules-icons/security_managementblue.svg +1 -0
  30. package/dist/modules-icons/sopblancs.svg +1 -0
  31. package/dist/modules-icons/sopblues.svg +1 -0
  32. package/dist/modules-icons/thriveblanc.svg +1 -0
  33. package/dist/modules-icons/thriveblue.svg +1 -0
  34. package/dist/modules-icons/wiseblancs.svg +1 -0
  35. package/dist/modules-icons/wiseblues.svg +1 -0
  36. package/package.json +3 -2
package/dist/index.js CHANGED
@@ -230,7 +230,20 @@ import {
230
230
  DollarSign,
231
231
  HelpCircle as HelpCircle2,
232
232
  Building2,
233
- LayoutGrid
233
+ LayoutGrid,
234
+ Mail,
235
+ Phone,
236
+ Shield,
237
+ Briefcase,
238
+ Edit3,
239
+ Camera,
240
+ Eye as Eye2,
241
+ EyeOff,
242
+ Lock,
243
+ Save,
244
+ Loader2,
245
+ Check as Check2,
246
+ Trash2
234
247
  } from "lucide-react";
235
248
 
236
249
  // src/assets/modules-icons/crm-blue.svg
@@ -759,6 +772,36 @@ var FetchApi = class {
759
772
  if (!res.ok) throw new Error(await res.text());
760
773
  return res.json();
761
774
  }
775
+ static async uploadFile(url, formData, token) {
776
+ const headers = {};
777
+ const local_token = localStorage.getItem("token");
778
+ if (local_token) {
779
+ headers["Authorization"] = `Token ${local_token}`;
780
+ }
781
+ const res = await fetch(url, {
782
+ method: "POST",
783
+ headers,
784
+ body: formData
785
+ });
786
+ if (!res.ok) throw new Error(await res.text());
787
+ return res.json();
788
+ }
789
+ static async patch(url, payload, token) {
790
+ const headers = {
791
+ "Content-Type": "application/json"
792
+ };
793
+ const local_token = localStorage.getItem("token");
794
+ if (local_token) {
795
+ headers["Authorization"] = `Token ${local_token}`;
796
+ }
797
+ const res = await fetch(url, {
798
+ method: "PATCH",
799
+ headers,
800
+ body: payload ? JSON.stringify(payload) : void 0
801
+ });
802
+ if (!res.ok) throw new Error(await res.text());
803
+ return res.json();
804
+ }
762
805
  };
763
806
 
764
807
  // src/services/AuthServices.ts
@@ -933,7 +976,22 @@ var UserServices = {
933
976
  getuserEntitiesAccess: (id, token) => FetchApi.get(`${API_URL}/core/entities/`, token),
934
977
  // !!! ce n'est pas la bonne url
935
978
  // Ajouter un utilisateur à une entité
936
- addUserToEntity: (entityId, userId, token) => FetchApi.post(`${API_URL}/core/entities/${entityId}/users/`, { user_id: userId }, token)
979
+ addUserToEntity: (entityId, userId, token) => FetchApi.post(`${API_URL}/core/entities/${entityId}/users/`, { user_id: userId }, token),
980
+ // === Nouvelles méthodes pour le profil utilisateur ===
981
+ // Mettre à jour le profil de l'utilisateur connecté
982
+ updateMyProfile: (data) => FetchApi.put(`${USERS_API_URL}me/`, data),
983
+ // Changer la photo de profil
984
+ updateProfilePicture: (file) => {
985
+ const formData = new FormData();
986
+ formData.append("profile_picture", file);
987
+ return FetchApi.uploadFile(`${USERS_API_URL}me/upload-picture/`, formData);
988
+ },
989
+ // Supprimer la photo de profil
990
+ deleteProfilePicture: () => FetchApi.delete(`${USERS_API_URL}me/delete-picture/`),
991
+ // Changer le mot de passe (utilisateur authentifié)
992
+ changePassword: (data) => FetchApi.post(`${API_BASE_URL2}change-my-password/`, data),
993
+ // Obtenir le profil de l'utilisateur connecté
994
+ getMyProfile: () => FetchApi.get(`${USERS_API_URL}me/`)
937
995
  };
938
996
 
939
997
  // src/contexts/ToastContext.tsx
@@ -960,9 +1018,10 @@ var ToastProvider = ({ children }) => {
960
1018
  };
961
1019
  const addToast = useCallback((toast) => {
962
1020
  const id = generateId();
1021
+ const defaultDuration = toast.type === "error" ? 7e3 : 3e3;
963
1022
  const newToast = {
964
1023
  id,
965
- duration: 5e3,
1024
+ duration: toast.duration ?? defaultDuration,
966
1025
  ...toast
967
1026
  };
968
1027
  setToasts((prev) => [...prev, newToast]);
@@ -1676,7 +1735,30 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
1676
1735
  const [showThemeMenu, setShowThemeMenu] = useState5(false);
1677
1736
  const [showCenterMenu, setShowCenterMenu] = useState5(false);
1678
1737
  const [showModulesMenu, setShowModulesMenu] = useState5(false);
1738
+ const [showProfileModal, setShowProfileModal] = useState5(false);
1739
+ const [showEditProfileModal, setShowEditProfileModal] = useState5(false);
1740
+ const [showChangePasswordModal, setShowChangePasswordModal] = useState5(false);
1679
1741
  const [currentSlide, setCurrentSlide] = useState5(0);
1742
+ const [editProfileData, setEditProfileData] = useState5({
1743
+ first_name: "",
1744
+ last_name: "",
1745
+ email: "",
1746
+ phonenumber: "",
1747
+ job_title: "",
1748
+ department: ""
1749
+ });
1750
+ const [savingProfile, setSavingProfile] = useState5(false);
1751
+ const [uploadingPhoto, setUploadingPhoto] = useState5(false);
1752
+ const [passwordData, setPasswordData] = useState5({
1753
+ current_password: "",
1754
+ new_password: "",
1755
+ confirm_password: ""
1756
+ });
1757
+ const [savingPassword, setSavingPassword] = useState5(false);
1758
+ const [showCurrentPassword, setShowCurrentPassword] = useState5(false);
1759
+ const [showNewPassword, setShowNewPassword] = useState5(false);
1760
+ const [showConfirmPassword, setShowConfirmPassword] = useState5(false);
1761
+ const fileInputRef = React4.useRef(null);
1680
1762
  const slides = [
1681
1763
  {
1682
1764
  title: "Rappel \u2013 Gestion des jours de cong\xE9",
@@ -1795,6 +1877,133 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
1795
1877
  showError("Erreur lors du marquage de la notification comme lue");
1796
1878
  }
1797
1879
  };
1880
+ const openEditProfileModal = () => {
1881
+ setEditProfileData({
1882
+ first_name: loggedUser?.first_name || "",
1883
+ last_name: loggedUser?.last_name || "",
1884
+ email: loggedUser?.email || "",
1885
+ phonenumber: loggedUser?.phonenumber || "",
1886
+ job_title: loggedUser?.job_title || "",
1887
+ department: loggedUser?.department || ""
1888
+ });
1889
+ setShowEditProfileModal(true);
1890
+ };
1891
+ const handleSaveProfile = async () => {
1892
+ setSavingProfile(true);
1893
+ try {
1894
+ const response = await UserServices.updateMyProfile(editProfileData);
1895
+ if (response.success) {
1896
+ success("Profil mis \xE0 jour avec succ\xE8s");
1897
+ setShowEditProfileModal(false);
1898
+ window.location.reload();
1899
+ } else {
1900
+ showError(response.message || "Erreur lors de la mise \xE0 jour du profil");
1901
+ }
1902
+ } catch (error) {
1903
+ console.error("Erreur lors de la mise \xE0 jour du profil:", error);
1904
+ showError("Erreur lors de la mise \xE0 jour du profil");
1905
+ } finally {
1906
+ setSavingProfile(false);
1907
+ }
1908
+ };
1909
+ const handlePhotoChange = async (event) => {
1910
+ const file = event.target.files?.[0];
1911
+ if (!file) return;
1912
+ const allowedTypes = ["image/jpeg", "image/png", "image/gif", "image/webp"];
1913
+ if (!allowedTypes.includes(file.type)) {
1914
+ showError("Format de fichier non support\xE9. Utilisez JPG, PNG, GIF ou WebP.");
1915
+ return;
1916
+ }
1917
+ const maxSize = 5 * 1024 * 1024;
1918
+ if (file.size > maxSize) {
1919
+ showError("La taille du fichier ne doit pas d\xE9passer 5 MB");
1920
+ return;
1921
+ }
1922
+ setUploadingPhoto(true);
1923
+ try {
1924
+ const response = await UserServices.updateProfilePicture(file);
1925
+ if (response.success) {
1926
+ success("Photo de profil mise \xE0 jour avec succ\xE8s");
1927
+ window.location.reload();
1928
+ } else {
1929
+ showError(response.message || "Erreur lors du t\xE9l\xE9chargement de la photo");
1930
+ }
1931
+ } catch (error) {
1932
+ console.error("Erreur lors du t\xE9l\xE9chargement de la photo:", error);
1933
+ showError("Erreur lors du t\xE9l\xE9chargement de la photo");
1934
+ } finally {
1935
+ setUploadingPhoto(false);
1936
+ if (fileInputRef.current) {
1937
+ fileInputRef.current.value = "";
1938
+ }
1939
+ }
1940
+ };
1941
+ const handleDeletePhoto = async () => {
1942
+ setUploadingPhoto(true);
1943
+ try {
1944
+ const response = await UserServices.deleteProfilePicture();
1945
+ if (response.success) {
1946
+ success("Photo de profil supprim\xE9e");
1947
+ window.location.reload();
1948
+ } else {
1949
+ showError(response.message || "Erreur lors de la suppression de la photo");
1950
+ }
1951
+ } catch (error) {
1952
+ console.error("Erreur lors de la suppression de la photo:", error);
1953
+ showError("Erreur lors de la suppression de la photo");
1954
+ } finally {
1955
+ setUploadingPhoto(false);
1956
+ }
1957
+ };
1958
+ const openChangePasswordModal = () => {
1959
+ setPasswordData({
1960
+ current_password: "",
1961
+ new_password: "",
1962
+ confirm_password: ""
1963
+ });
1964
+ setShowCurrentPassword(false);
1965
+ setShowNewPassword(false);
1966
+ setShowConfirmPassword(false);
1967
+ setShowChangePasswordModal(true);
1968
+ };
1969
+ const handleChangePassword = async () => {
1970
+ if (!passwordData.current_password) {
1971
+ showError("Veuillez entrer votre mot de passe actuel");
1972
+ return;
1973
+ }
1974
+ if (!passwordData.new_password) {
1975
+ showError("Veuillez entrer un nouveau mot de passe");
1976
+ return;
1977
+ }
1978
+ if (passwordData.new_password.length < 8) {
1979
+ showError("Le nouveau mot de passe doit contenir au moins 8 caract\xE8res");
1980
+ return;
1981
+ }
1982
+ if (passwordData.new_password !== passwordData.confirm_password) {
1983
+ showError("Les mots de passe ne correspondent pas");
1984
+ return;
1985
+ }
1986
+ setSavingPassword(true);
1987
+ try {
1988
+ const response = await UserServices.changePassword(passwordData);
1989
+ if (response.success) {
1990
+ success("Mot de passe chang\xE9 avec succ\xE8s");
1991
+ setShowChangePasswordModal(false);
1992
+ setPasswordData({
1993
+ current_password: "",
1994
+ new_password: "",
1995
+ confirm_password: ""
1996
+ });
1997
+ } else {
1998
+ showError(response.message || "Erreur lors du changement de mot de passe");
1999
+ }
2000
+ } catch (error) {
2001
+ console.error("Erreur lors du changement de mot de passe:", error);
2002
+ showError("Mot de passe actuel incorrect ou erreur serveur");
2003
+ } finally {
2004
+ setSavingPassword(false);
2005
+ }
2006
+ };
1798
2007
  return /* @__PURE__ */ jsxs6("div", { className: "flex h-screen bg-[var(--color-background)] overflow-hidden", children: [
1799
2008
  /* @__PURE__ */ jsx9(
1800
2009
  "a",
@@ -2344,6 +2553,10 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2344
2553
  /* @__PURE__ */ jsxs6(
2345
2554
  "button",
2346
2555
  {
2556
+ onClick: () => {
2557
+ setShowProfileModal(true);
2558
+ setShowUserMenu(false);
2559
+ },
2347
2560
  className: "w-full flex items-center gap-3 px-3 py-2 rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
2348
2561
  role: "menuitem",
2349
2562
  children: [
@@ -2641,6 +2854,418 @@ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "De
2641
2854
  }
2642
2855
  )
2643
2856
  }
2857
+ ),
2858
+ /* @__PURE__ */ jsx9(
2859
+ Modals_default,
2860
+ {
2861
+ title: "Mon Profil",
2862
+ description: "G\xE9rez vos informations personnelles",
2863
+ width: "max-w-2xl",
2864
+ open: showProfileModal,
2865
+ onClose: () => setShowProfileModal(false),
2866
+ children: /* @__PURE__ */ jsxs6("div", { className: "space-y-6", children: [
2867
+ /* @__PURE__ */ jsx9(
2868
+ "input",
2869
+ {
2870
+ ref: fileInputRef,
2871
+ type: "file",
2872
+ accept: "image/jpeg,image/png,image/gif,image/webp",
2873
+ onChange: handlePhotoChange,
2874
+ className: "hidden"
2875
+ }
2876
+ ),
2877
+ /* @__PURE__ */ jsxs6("div", { className: "flex flex-col sm:flex-row items-center gap-6 pb-6 border-b border-[var(--color-border)]", children: [
2878
+ /* @__PURE__ */ jsxs6("div", { className: "relative group", children: [
2879
+ /* @__PURE__ */ jsx9("div", { className: "w-24 h-24 bg-gradient-to-br from-[var(--color-primary)] to-[var(--color-accent)] rounded-full flex items-center justify-center shadow-lg overflow-hidden", children: uploadingPhoto ? /* @__PURE__ */ jsx9(Loader2, { className: "w-8 h-8 text-white animate-spin" }) : loggedUser?.profile_picture ? /* @__PURE__ */ jsx9(
2880
+ "img",
2881
+ {
2882
+ src: loggedUser.profile_picture,
2883
+ alt: "Photo de profil",
2884
+ className: "w-full h-full rounded-full object-cover"
2885
+ }
2886
+ ) : /* @__PURE__ */ jsxs6("span", { className: "text-3xl font-bold text-white", children: [
2887
+ loggedUser?.first_name?.charAt(0) || loggedUser?.username?.charAt(0) || "U",
2888
+ loggedUser?.last_name?.charAt(0) || ""
2889
+ ] }) }),
2890
+ /* @__PURE__ */ jsxs6("div", { className: "absolute -bottom-1 -right-1 flex gap-1", children: [
2891
+ /* @__PURE__ */ jsx9(
2892
+ "button",
2893
+ {
2894
+ onClick: () => fileInputRef.current?.click(),
2895
+ disabled: uploadingPhoto,
2896
+ className: "w-8 h-8 bg-[var(--color-primary)] border-2 border-[var(--color-background)] rounded-full flex items-center justify-center shadow-md hover:bg-[var(--color-primary-dark)] transition-colors disabled:opacity-50",
2897
+ title: "Changer la photo",
2898
+ children: /* @__PURE__ */ jsx9(Camera, { className: "w-4 h-4 text-white" })
2899
+ }
2900
+ ),
2901
+ loggedUser?.profile_picture && /* @__PURE__ */ jsx9(
2902
+ "button",
2903
+ {
2904
+ onClick: handleDeletePhoto,
2905
+ disabled: uploadingPhoto,
2906
+ className: "w-8 h-8 bg-red-500 border-2 border-[var(--color-background)] rounded-full flex items-center justify-center shadow-md hover:bg-red-600 transition-colors disabled:opacity-50",
2907
+ title: "Supprimer la photo",
2908
+ children: /* @__PURE__ */ jsx9(Trash2, { className: "w-4 h-4 text-white" })
2909
+ }
2910
+ )
2911
+ ] })
2912
+ ] }),
2913
+ /* @__PURE__ */ jsxs6("div", { className: "text-center sm:text-left flex-1", children: [
2914
+ /* @__PURE__ */ jsx9("h2", { className: "text-xl font-bold text-[var(--color-text-primary)]", children: loggedUser?.first_name && loggedUser?.last_name ? `${loggedUser.first_name} ${loggedUser.last_name}` : loggedUser?.username || "Utilisateur" }),
2915
+ /* @__PURE__ */ jsx9("p", { className: "text-[var(--color-text-secondary)] mt-1", children: loggedUser?.job_title || "Membre de l'\xE9quipe" }),
2916
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-center sm:justify-start gap-2 mt-2", children: [
2917
+ /* @__PURE__ */ jsx9("span", { className: cn(
2918
+ "px-2 py-1 text-xs font-medium rounded-full",
2919
+ loggedUser?.is_active ? "bg-green-100 text-green-700" : "bg-gray-100 text-gray-600"
2920
+ ), children: loggedUser?.is_active ? "Actif" : "Inactif" }),
2921
+ loggedUser?.is_staff && /* @__PURE__ */ jsx9("span", { className: "px-2 py-1 text-xs font-medium rounded-full bg-blue-100 text-blue-700", children: "Staff" })
2922
+ ] })
2923
+ ] }),
2924
+ /* @__PURE__ */ jsxs6(
2925
+ "button",
2926
+ {
2927
+ onClick: openEditProfileModal,
2928
+ className: "flex items-center gap-2 px-4 py-2 bg-[var(--color-primary)] text-white rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors",
2929
+ title: "Modifier le profil",
2930
+ children: [
2931
+ /* @__PURE__ */ jsx9(Edit3, { className: "w-4 h-4" }),
2932
+ /* @__PURE__ */ jsx9("span", { className: "text-sm font-medium", children: "Modifier" })
2933
+ ]
2934
+ }
2935
+ )
2936
+ ] }),
2937
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
2938
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
2939
+ /* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx9(Mail, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
2940
+ /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
2941
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "Email" }),
2942
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.email || "Non renseign\xE9" })
2943
+ ] })
2944
+ ] }),
2945
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
2946
+ /* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx9(Phone, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
2947
+ /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
2948
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "T\xE9l\xE9phone" }),
2949
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.phonenumber || "Non renseign\xE9" })
2950
+ ] })
2951
+ ] }),
2952
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
2953
+ /* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx9(User, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
2954
+ /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
2955
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "Nom d'utilisateur" }),
2956
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.username || "Non renseign\xE9" })
2957
+ ] })
2958
+ ] }),
2959
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center gap-3 p-4 bg-[var(--color-surface)] rounded-lg border border-[var(--color-border)]", children: [
2960
+ /* @__PURE__ */ jsx9("div", { className: "w-10 h-10 bg-[var(--color-primary-light)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx9(Briefcase, { className: "w-5 h-5 text-[var(--color-primary)]" }) }),
2961
+ /* @__PURE__ */ jsxs6("div", { className: "flex-1 min-w-0", children: [
2962
+ /* @__PURE__ */ jsx9("p", { className: "text-xs text-[var(--color-text-tertiary)] uppercase tracking-wide", children: "D\xE9partement" }),
2963
+ /* @__PURE__ */ jsx9("p", { className: "text-sm font-medium text-[var(--color-text-primary)] truncate", children: loggedUser?.department || "Non renseign\xE9" })
2964
+ ] })
2965
+ ] })
2966
+ ] }),
2967
+ loggedUser?.centers_access && loggedUser.centers_access.length > 0 && /* @__PURE__ */ jsxs6("div", { className: "pt-4 border-t border-[var(--color-border)]", children: [
2968
+ /* @__PURE__ */ jsxs6("h3", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-3 flex items-center gap-2", children: [
2969
+ /* @__PURE__ */ jsx9(Building2, { className: "w-4 h-4 text-[var(--color-primary)]" }),
2970
+ "Centres d'acc\xE8s (",
2971
+ loggedUser.centers_access.length,
2972
+ ")"
2973
+ ] }),
2974
+ /* @__PURE__ */ jsx9("div", { className: "flex flex-wrap gap-2", children: loggedUser.centers_access.map((center) => /* @__PURE__ */ jsx9(
2975
+ "span",
2976
+ {
2977
+ className: cn(
2978
+ "px-3 py-1.5 text-sm rounded-lg border transition-colors",
2979
+ activeBusinessEntity?.id === center.id ? "bg-[var(--color-primary)] text-white border-[var(--color-primary)]" : "bg-[var(--color-surface)] text-[var(--color-text-secondary)] border-[var(--color-border)] hover:bg-[var(--color-surface-hover)]"
2980
+ ),
2981
+ children: center.legal_name
2982
+ },
2983
+ center.id
2984
+ )) })
2985
+ ] }),
2986
+ /* @__PURE__ */ jsxs6("div", { className: "pt-4 border-t border-[var(--color-border)]", children: [
2987
+ /* @__PURE__ */ jsxs6("h3", { className: "text-sm font-semibold text-[var(--color-text-primary)] mb-3 flex items-center gap-2", children: [
2988
+ /* @__PURE__ */ jsx9(Shield, { className: "w-4 h-4 text-[var(--color-primary)]" }),
2989
+ "S\xE9curit\xE9 du compte"
2990
+ ] }),
2991
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-3", children: [
2992
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface)] rounded-lg", children: [
2993
+ /* @__PURE__ */ jsx9("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Derni\xE8re connexion" }),
2994
+ /* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: loggedUser?.last_login ? new Date(loggedUser.last_login).toLocaleDateString("fr-FR", {
2995
+ day: "numeric",
2996
+ month: "short",
2997
+ year: "numeric",
2998
+ hour: "2-digit",
2999
+ minute: "2-digit"
3000
+ }) : "Aujourd'hui" })
3001
+ ] }),
3002
+ /* @__PURE__ */ jsxs6("div", { className: "flex items-center justify-between p-3 bg-[var(--color-surface)] rounded-lg", children: [
3003
+ /* @__PURE__ */ jsx9("span", { className: "text-sm text-[var(--color-text-secondary)]", children: "Membre depuis" }),
3004
+ /* @__PURE__ */ jsx9("span", { className: "text-sm font-medium text-[var(--color-text-primary)]", children: loggedUser?.date_joined ? new Date(loggedUser.date_joined).toLocaleDateString("fr-FR", {
3005
+ day: "numeric",
3006
+ month: "short",
3007
+ year: "numeric"
3008
+ }) : "N/A" })
3009
+ ] })
3010
+ ] }),
3011
+ /* @__PURE__ */ jsxs6(
3012
+ "button",
3013
+ {
3014
+ onClick: openChangePasswordModal,
3015
+ className: "mt-4 w-full flex items-center justify-center gap-2 px-4 py-2.5 border border-[var(--color-border)] text-[var(--color-text-secondary)] rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
3016
+ children: [
3017
+ /* @__PURE__ */ jsx9(Lock, { className: "w-4 h-4" }),
3018
+ /* @__PURE__ */ jsx9("span", { className: "text-sm font-medium", children: "Changer le mot de passe" })
3019
+ ]
3020
+ }
3021
+ )
3022
+ ] })
3023
+ ] })
3024
+ }
3025
+ ),
3026
+ /* @__PURE__ */ jsx9(
3027
+ Modals_default,
3028
+ {
3029
+ title: "Modifier mon profil",
3030
+ description: "Mettez \xE0 jour vos informations personnelles",
3031
+ width: "max-w-lg",
3032
+ open: showEditProfileModal,
3033
+ onClose: () => setShowEditProfileModal(false),
3034
+ children: /* @__PURE__ */ jsxs6("div", { className: "space-y-4", children: [
3035
+ /* @__PURE__ */ jsxs6("div", { className: "grid grid-cols-2 gap-4", children: [
3036
+ /* @__PURE__ */ jsxs6("div", { children: [
3037
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Pr\xE9nom" }),
3038
+ /* @__PURE__ */ jsx9(
3039
+ "input",
3040
+ {
3041
+ type: "text",
3042
+ value: editProfileData.first_name,
3043
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, first_name: e.target.value })),
3044
+ className: "w-full px-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3045
+ placeholder: "Votre pr\xE9nom"
3046
+ }
3047
+ )
3048
+ ] }),
3049
+ /* @__PURE__ */ jsxs6("div", { children: [
3050
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Nom" }),
3051
+ /* @__PURE__ */ jsx9(
3052
+ "input",
3053
+ {
3054
+ type: "text",
3055
+ value: editProfileData.last_name,
3056
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, last_name: e.target.value })),
3057
+ className: "w-full px-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3058
+ placeholder: "Votre nom"
3059
+ }
3060
+ )
3061
+ ] })
3062
+ ] }),
3063
+ /* @__PURE__ */ jsxs6("div", { children: [
3064
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Email" }),
3065
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3066
+ /* @__PURE__ */ jsx9(Mail, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3067
+ /* @__PURE__ */ jsx9(
3068
+ "input",
3069
+ {
3070
+ type: "email",
3071
+ value: editProfileData.email,
3072
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, email: e.target.value })),
3073
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3074
+ placeholder: "votre@email.com"
3075
+ }
3076
+ )
3077
+ ] })
3078
+ ] }),
3079
+ /* @__PURE__ */ jsxs6("div", { children: [
3080
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "T\xE9l\xE9phone" }),
3081
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3082
+ /* @__PURE__ */ jsx9(Phone, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3083
+ /* @__PURE__ */ jsx9(
3084
+ "input",
3085
+ {
3086
+ type: "tel",
3087
+ value: editProfileData.phonenumber,
3088
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, phonenumber: e.target.value })),
3089
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3090
+ placeholder: "+225 XX XX XX XX"
3091
+ }
3092
+ )
3093
+ ] })
3094
+ ] }),
3095
+ /* @__PURE__ */ jsxs6("div", { children: [
3096
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Poste / Titre" }),
3097
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3098
+ /* @__PURE__ */ jsx9(Briefcase, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3099
+ /* @__PURE__ */ jsx9(
3100
+ "input",
3101
+ {
3102
+ type: "text",
3103
+ value: editProfileData.job_title,
3104
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, job_title: e.target.value })),
3105
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3106
+ placeholder: "Ex: Responsable Commercial"
3107
+ }
3108
+ )
3109
+ ] })
3110
+ ] }),
3111
+ /* @__PURE__ */ jsxs6("div", { children: [
3112
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "D\xE9partement" }),
3113
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3114
+ /* @__PURE__ */ jsx9(Building2, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3115
+ /* @__PURE__ */ jsx9(
3116
+ "input",
3117
+ {
3118
+ type: "text",
3119
+ value: editProfileData.department,
3120
+ onChange: (e) => setEditProfileData((prev) => ({ ...prev, department: e.target.value })),
3121
+ className: "w-full pl-10 pr-3 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3122
+ placeholder: "Ex: Ventes"
3123
+ }
3124
+ )
3125
+ ] })
3126
+ ] }),
3127
+ /* @__PURE__ */ jsxs6("div", { className: "flex justify-end gap-3 pt-4 border-t border-[var(--color-border)]", children: [
3128
+ /* @__PURE__ */ jsx9(
3129
+ "button",
3130
+ {
3131
+ onClick: () => setShowEditProfileModal(false),
3132
+ className: "px-4 py-2 text-sm font-medium text-[var(--color-text-secondary)] bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
3133
+ children: "Annuler"
3134
+ }
3135
+ ),
3136
+ /* @__PURE__ */ jsxs6(
3137
+ "button",
3138
+ {
3139
+ onClick: handleSaveProfile,
3140
+ disabled: savingProfile,
3141
+ className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[var(--color-primary)] rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors disabled:opacity-50",
3142
+ children: [
3143
+ savingProfile ? /* @__PURE__ */ jsx9(Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ jsx9(Save, { className: "w-4 h-4" }),
3144
+ savingProfile ? "Enregistrement..." : "Enregistrer"
3145
+ ]
3146
+ }
3147
+ )
3148
+ ] })
3149
+ ] })
3150
+ }
3151
+ ),
3152
+ /* @__PURE__ */ jsx9(
3153
+ Modals_default,
3154
+ {
3155
+ title: "Changer le mot de passe",
3156
+ description: "Entrez votre mot de passe actuel et choisissez un nouveau mot de passe",
3157
+ width: "max-w-md",
3158
+ open: showChangePasswordModal,
3159
+ onClose: () => setShowChangePasswordModal(false),
3160
+ children: /* @__PURE__ */ jsxs6("div", { className: "space-y-4", children: [
3161
+ /* @__PURE__ */ jsxs6("div", { children: [
3162
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Mot de passe actuel" }),
3163
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3164
+ /* @__PURE__ */ jsx9(Lock, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3165
+ /* @__PURE__ */ jsx9(
3166
+ "input",
3167
+ {
3168
+ type: showCurrentPassword ? "text" : "password",
3169
+ value: passwordData.current_password,
3170
+ onChange: (e) => setPasswordData((prev) => ({ ...prev, current_password: e.target.value })),
3171
+ className: "w-full pl-10 pr-10 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3172
+ placeholder: "Votre mot de passe actuel"
3173
+ }
3174
+ ),
3175
+ /* @__PURE__ */ jsx9(
3176
+ "button",
3177
+ {
3178
+ type: "button",
3179
+ onClick: () => setShowCurrentPassword(!showCurrentPassword),
3180
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
3181
+ children: showCurrentPassword ? /* @__PURE__ */ jsx9(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx9(Eye2, { className: "w-4 h-4" })
3182
+ }
3183
+ )
3184
+ ] })
3185
+ ] }),
3186
+ /* @__PURE__ */ jsxs6("div", { children: [
3187
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Nouveau mot de passe" }),
3188
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3189
+ /* @__PURE__ */ jsx9(Lock, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3190
+ /* @__PURE__ */ jsx9(
3191
+ "input",
3192
+ {
3193
+ type: showNewPassword ? "text" : "password",
3194
+ value: passwordData.new_password,
3195
+ onChange: (e) => setPasswordData((prev) => ({ ...prev, new_password: e.target.value })),
3196
+ className: "w-full pl-10 pr-10 py-2 border border-[var(--color-border)] rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3197
+ placeholder: "Au moins 8 caract\xE8res"
3198
+ }
3199
+ ),
3200
+ /* @__PURE__ */ jsx9(
3201
+ "button",
3202
+ {
3203
+ type: "button",
3204
+ onClick: () => setShowNewPassword(!showNewPassword),
3205
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
3206
+ children: showNewPassword ? /* @__PURE__ */ jsx9(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx9(Eye2, { className: "w-4 h-4" })
3207
+ }
3208
+ )
3209
+ ] }),
3210
+ passwordData.new_password && passwordData.new_password.length < 8 && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-xs text-red-500", children: "Le mot de passe doit contenir au moins 8 caract\xE8res" })
3211
+ ] }),
3212
+ /* @__PURE__ */ jsxs6("div", { children: [
3213
+ /* @__PURE__ */ jsx9("label", { className: "block text-sm font-medium text-[var(--color-text-secondary)] mb-1", children: "Confirmer le nouveau mot de passe" }),
3214
+ /* @__PURE__ */ jsxs6("div", { className: "relative", children: [
3215
+ /* @__PURE__ */ jsx9(Lock, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--color-text-tertiary)]" }),
3216
+ /* @__PURE__ */ jsx9(
3217
+ "input",
3218
+ {
3219
+ type: showConfirmPassword ? "text" : "password",
3220
+ value: passwordData.confirm_password,
3221
+ onChange: (e) => setPasswordData((prev) => ({ ...prev, confirm_password: e.target.value })),
3222
+ className: cn(
3223
+ "w-full pl-10 pr-10 py-2 border rounded-lg focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)] focus:border-transparent bg-[var(--color-background)] text-[var(--color-text-primary)]",
3224
+ passwordData.confirm_password && passwordData.new_password !== passwordData.confirm_password ? "border-red-500" : "border-[var(--color-border)]"
3225
+ ),
3226
+ placeholder: "R\xE9p\xE9tez le nouveau mot de passe"
3227
+ }
3228
+ ),
3229
+ /* @__PURE__ */ jsx9(
3230
+ "button",
3231
+ {
3232
+ type: "button",
3233
+ onClick: () => setShowConfirmPassword(!showConfirmPassword),
3234
+ className: "absolute right-3 top-1/2 -translate-y-1/2 text-[var(--color-text-tertiary)] hover:text-[var(--color-text-secondary)]",
3235
+ children: showConfirmPassword ? /* @__PURE__ */ jsx9(EyeOff, { className: "w-4 h-4" }) : /* @__PURE__ */ jsx9(Eye2, { className: "w-4 h-4" })
3236
+ }
3237
+ )
3238
+ ] }),
3239
+ passwordData.confirm_password && passwordData.new_password !== passwordData.confirm_password && /* @__PURE__ */ jsx9("p", { className: "mt-1 text-xs text-red-500", children: "Les mots de passe ne correspondent pas" }),
3240
+ passwordData.confirm_password && passwordData.new_password === passwordData.confirm_password && passwordData.new_password.length >= 8 && /* @__PURE__ */ jsxs6("p", { className: "mt-1 text-xs text-green-600 flex items-center gap-1", children: [
3241
+ /* @__PURE__ */ jsx9(Check2, { className: "w-3 h-3" }),
3242
+ " Les mots de passe correspondent"
3243
+ ] })
3244
+ ] }),
3245
+ /* @__PURE__ */ jsxs6("div", { className: "flex justify-end gap-3 pt-4 border-t border-[var(--color-border)]", children: [
3246
+ /* @__PURE__ */ jsx9(
3247
+ "button",
3248
+ {
3249
+ onClick: () => setShowChangePasswordModal(false),
3250
+ className: "px-4 py-2 text-sm font-medium text-[var(--color-text-secondary)] bg-[var(--color-surface)] border border-[var(--color-border)] rounded-lg hover:bg-[var(--color-surface-hover)] transition-colors",
3251
+ children: "Annuler"
3252
+ }
3253
+ ),
3254
+ /* @__PURE__ */ jsxs6(
3255
+ "button",
3256
+ {
3257
+ onClick: handleChangePassword,
3258
+ disabled: savingPassword || !passwordData.current_password || !passwordData.new_password || passwordData.new_password !== passwordData.confirm_password || passwordData.new_password.length < 8,
3259
+ className: "flex items-center gap-2 px-4 py-2 text-sm font-medium text-white bg-[var(--color-primary)] rounded-lg hover:bg-[var(--color-primary-dark)] transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
3260
+ children: [
3261
+ savingPassword ? /* @__PURE__ */ jsx9(Loader2, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ jsx9(Shield, { className: "w-4 h-4" }),
3262
+ savingPassword ? "Modification..." : "Changer le mot de passe"
3263
+ ]
3264
+ }
3265
+ )
3266
+ ] })
3267
+ ] })
3268
+ }
2644
3269
  )
2645
3270
  ] });
2646
3271
  };
@@ -2792,7 +3417,7 @@ var Pages_default = Pages;
2792
3417
  // src/components/common/FDrawer.tsx
2793
3418
  import React7, { useEffect as useEffect6, useState as useState8, useRef } from "react";
2794
3419
  import { useLocation as useLocation2, useNavigate as useNavigate2, useSearchParams as useSearchParams2, Link as Link2 } from "react-router-dom";
2795
- import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, AlertCircle as AlertCircle3, CheckCircle2 as CheckCircle22, ChevronDown, Columns3, Copy, Download as Download2, FileSpreadsheet, Filter, Maximize2, Minimize2, MoreVertical, Plus, Printer, RefreshCw, Settings2 as Settings22, Trash2, Upload, X as X5, Search as Search2, SquareIcon } from "lucide-react";
3420
+ import { ArrowDownAZ, ArrowDownUp, ArrowUpAZ, AlertCircle as AlertCircle3, CheckCircle2 as CheckCircle22, ChevronDown, Columns3, Copy, Download as Download2, FileSpreadsheet, Filter, Maximize2, Minimize2, MoreVertical, Plus, Printer, RefreshCw, Settings2 as Settings22, Trash2 as Trash22, Upload, X as X5, Search as Search2, SquareIcon } from "lucide-react";
2796
3421
  import { Fragment as Fragment4, jsx as jsx12, jsxs as jsxs9 } from "react/jsx-runtime";
2797
3422
  var ExcelImportModal = ({
2798
3423
  isOpen,
@@ -3050,7 +3675,7 @@ var ExcelImportModal = ({
3050
3675
  type: "button",
3051
3676
  onClick: () => removeMappingRow(index),
3052
3677
  className: "p-2 text-red-500 hover:bg-red-50 rounded-lg mt-5",
3053
- children: /* @__PURE__ */ jsx12(Trash2, { className: "h-4 w-4" })
3678
+ children: /* @__PURE__ */ jsx12(Trash22, { className: "h-4 w-4" })
3054
3679
  }
3055
3680
  )
3056
3681
  ] }, index)) }),
@@ -3700,7 +4325,7 @@ var FDrawer = ({
3700
4325
  onClick: handleBulkDelete,
3701
4326
  className: "px-3 py-1.5 bg-red-500 text-white rounded-lg text-sm flex items-center gap-2 hover:bg-red-600",
3702
4327
  children: [
3703
- /* @__PURE__ */ jsx12(Trash2, { className: "h-4 w-4" }),
4328
+ /* @__PURE__ */ jsx12(Trash22, { className: "h-4 w-4" }),
3704
4329
  "Supprimer"
3705
4330
  ]
3706
4331
  }
@@ -4091,7 +4716,7 @@ var SearchableSelect = ({
4091
4716
  };
4092
4717
 
4093
4718
  // src/components/common/ApprovalWorkflow.tsx
4094
- import { X as X7, Plus as Plus3, Trash2 as Trash22, Users, Loader as Loader2, RotateCcw, Ban, Eye as Eye3, FileText as FileText2, History } from "lucide-react";
4719
+ import { X as X7, Plus as Plus3, Trash2 as Trash23, Users, Loader as Loader3, RotateCcw, Ban, Eye as Eye4, FileText as FileText2, History } from "lucide-react";
4095
4720
  import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs11 } from "react/jsx-runtime";
4096
4721
  var ApprovalWorkflow = ({
4097
4722
  process,
@@ -4427,7 +5052,7 @@ var ApprovalWorkflow = ({
4427
5052
  ] });
4428
5053
  };
4429
5054
  if (loading) {
4430
- return /* @__PURE__ */ jsx14(RewiseBasicCard, { title, children: /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx14(Loader2, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) });
5055
+ return /* @__PURE__ */ jsx14(RewiseBasicCard, { title, children: /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx14(Loader3, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) });
4431
5056
  }
4432
5057
  const renderTabContent = () => {
4433
5058
  switch (activeTab) {
@@ -4506,14 +5131,14 @@ var ApprovalWorkflow = ({
4506
5131
  dangerouslySetInnerHTML: { __html: caseData.html_content }
4507
5132
  }
4508
5133
  ) : /* @__PURE__ */ jsxs11("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
4509
- /* @__PURE__ */ jsx14(Eye3, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
5134
+ /* @__PURE__ */ jsx14(Eye4, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
4510
5135
  /* @__PURE__ */ jsx14("p", { className: "text-[#767676]", children: "Aucun aper\xE7u disponible" })
4511
5136
  ] })
4512
5137
  ] }) });
4513
5138
  case "history":
4514
5139
  return /* @__PURE__ */ jsxs11("div", { className: "space-y-6", children: [
4515
5140
  /* @__PURE__ */ jsx14("h3", { className: "text-lg font-semibold text-[#191919]", children: "Historique des versions" }),
4516
- loadingHistory ? /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx14(Loader2, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) : history.length === 0 ? /* @__PURE__ */ jsxs11("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
5141
+ loadingHistory ? /* @__PURE__ */ jsx14("div", { className: "flex items-center justify-center py-12", children: /* @__PURE__ */ jsx14(Loader3, { className: "w-8 h-8 animate-spin text-[#6A8A82]" }) }) : history.length === 0 ? /* @__PURE__ */ jsxs11("div", { className: "text-center py-12 border-2 border-dashed border-[#D9D9D9] rounded-lg bg-[#FAFAFA]", children: [
4517
5142
  /* @__PURE__ */ jsx14(History, { className: "w-12 h-12 text-[#767676] mx-auto mb-4" }),
4518
5143
  /* @__PURE__ */ jsx14("p", { className: "text-[#767676]", children: "Aucun historique disponible" })
4519
5144
  ] }) : /* @__PURE__ */ jsx14("div", { className: "space-y-4", children: history.map((item, index) => /* @__PURE__ */ jsx14("div", { className: "border border-[#D9D9D9] rounded-lg p-4 bg-white hover:shadow-md transition-shadow", children: /* @__PURE__ */ jsx14("div", { className: "flex items-start justify-between", children: /* @__PURE__ */ jsxs11("div", { className: "flex-1", children: [
@@ -4615,7 +5240,7 @@ var ApprovalWorkflow = ({
4615
5240
  onClick: () => setActiveTab("preview"),
4616
5241
  className: `px-4 py-3 text-sm font-medium transition-colors flex items-center gap-2 ${activeTab === "preview" ? "border-b-2 border-[#6A8A82] text-[#6A8A82]" : "text-[#767676] hover:text-[#191919]"}`,
4617
5242
  children: [
4618
- /* @__PURE__ */ jsx14(Eye3, { className: "w-4 h-4" }),
5243
+ /* @__PURE__ */ jsx14(Eye4, { className: "w-4 h-4" }),
4619
5244
  "Aper\xE7u"
4620
5245
  ]
4621
5246
  }
@@ -4706,7 +5331,7 @@ var StageRow = ({
4706
5331
  onClick: onRemove,
4707
5332
  className: "text-[#B85450] hover:text-red-700 transition-colors",
4708
5333
  title: "Supprimer",
4709
- children: /* @__PURE__ */ jsx14(Trash22, { className: "w-4 h-4" })
5334
+ children: /* @__PURE__ */ jsx14(Trash23, { className: "w-4 h-4" })
4710
5335
  }
4711
5336
  ) }),
4712
5337
  /* @__PURE__ */ jsx14("td", { className: "border border-gray-300 px-4 py-2 text-center", children: index + 1 }),
@@ -5072,614 +5697,11 @@ var useAlert = () => {
5072
5697
  };
5073
5698
 
5074
5699
  // src/components/common/CommonSelect.tsx
5075
- import { useEffect as useEffect17, useState as useState27 } from "react";
5076
-
5077
- // dist/index.js
5078
- import { jsx as jsx17 } from "react/jsx-runtime";
5079
- import { jsx as jsx22, jsxs as jsxs14 } from "react/jsx-runtime";
5080
- import { Link as Link3 } from "react-router-dom";
5081
- import { jsx as jsx32, jsxs as jsxs22 } from "react/jsx-runtime";
5082
- import React42, { useState as useState52, useEffect as useEffect42 } from "react";
5083
- import { useLocation as useLocation3, useNavigate as useNavigate3 } from "react-router-dom";
5084
- import {
5085
- Settings as Settings3,
5086
- ChevronLeft as ChevronLeft3,
5087
- ChevronRight as ChevronRight2,
5088
- Search as Search4,
5089
- Bell as Bell2,
5090
- User as User2,
5091
- LogOut as LogOut2,
5092
- Menu as Menu3,
5093
- X as X32,
5094
- Palette as Palette2,
5095
- DollarSign as DollarSign2,
5096
- HelpCircle as HelpCircle22,
5097
- Building2 as Building22,
5098
- LayoutGrid as LayoutGrid2
5099
- } from "lucide-react";
5100
- import { clsx as clsx2 } from "clsx";
5101
- import { twMerge as twMerge2 } from "tailwind-merge";
5102
- import { createContext as createContext5, useContext as useContext5, useState as useState12, useEffect as useEffect9 } from "react";
5103
- import { jsx as jsx42 } from "react/jsx-runtime";
5104
- import { createContext as createContext22, useContext as useContext22, useEffect as useEffect22, useState as useState22 } from "react";
5105
- import { jsx as jsx52 } from "react/jsx-runtime";
5106
- import { createContext as createContext32, useContext as useContext32, useState as useState32, useCallback as useCallback3 } from "react";
5107
- import { AlertTriangle as AlertTriangle3, HelpCircle as HelpCircle3, AlertCircle as AlertCircle4, X as X8 } from "lucide-react";
5108
- import { jsx as jsx62, jsxs as jsxs32 } from "react/jsx-runtime";
5109
- import { useState as useState42, useEffect as useEffect32 } from "react";
5110
- import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
5111
- import { X as X22, Loader as Loader3, Eye as Eye4, FileText as FileText3, Check as Check2, XCircle as XCircle3, Edit as Edit2, CheckCircle as CheckCircle3, Clock as Clock2, AlertCircle as AlertCircle22, User as UserIcon2, Send as Send2 } from "lucide-react";
5112
- import { useParams as useParams2, useSearchParams as useSearchParams3 } from "react-router-dom";
5113
- import { Fragment as Fragment7, jsx as jsx82, jsxs as jsxs52 } from "react/jsx-runtime";
5114
- import { Fragment as Fragment22, jsx as jsx92, jsxs as jsxs62 } from "react/jsx-runtime";
5115
- import { useEffect as useEffect52, useState as useState62 } from "react";
5116
- import { CheckCircle as CheckCircle23, XCircle as XCircle22, AlertTriangle as AlertTriangle22, Info as Info22, X as X42 } from "lucide-react";
5117
- import { jsx as jsx102, jsxs as jsxs72 } from "react/jsx-runtime";
5118
- import { ChevronLeft as ChevronLeft22, Download as Download3, Menu as Menu22, Settings as Settings23 } from "lucide-react";
5119
- import { useState as useState72 } from "react";
5120
- import { Fragment as Fragment32, jsx as jsx112, jsxs as jsxs82 } from "react/jsx-runtime";
5121
- import React72, { useEffect as useEffect62, useState as useState82, useRef as useRef3 } from "react";
5122
- import { useLocation as useLocation22, useNavigate as useNavigate22, useSearchParams as useSearchParams22, Link as Link22 } from "react-router-dom";
5123
- import { ArrowDownAZ as ArrowDownAZ2, ArrowDownUp as ArrowDownUp2, ArrowUpAZ as ArrowUpAZ2, AlertCircle as AlertCircle32, CheckCircle2 as CheckCircle222, ChevronDown as ChevronDown3, Columns3 as Columns32, Copy as Copy2, Download as Download22, FileSpreadsheet as FileSpreadsheet2, Filter as Filter2, Maximize2 as Maximize22, Minimize2 as Minimize22, MoreVertical as MoreVertical2, Plus as Plus4, Printer as Printer2, RefreshCw as RefreshCw3, Settings2 as Settings222, Trash2 as Trash23, Upload as Upload2, X as X52, Search as Search22, SquareIcon as SquareIcon2 } from "lucide-react";
5124
- import { Fragment as Fragment42, jsx as jsx122, jsxs as jsxs92 } from "react/jsx-runtime";
5125
- import { useState as useState102, useEffect as useEffect82 } from "react";
5126
- import { useState as useState92, useRef as useRef22, useEffect as useEffect72 } from "react";
5127
- import { Search as Search32, ChevronDown as ChevronDown22, X as X62, RefreshCw as RefreshCw22, Plus as Plus22 } from "lucide-react";
5128
- import { Fragment as Fragment52, jsx as jsx132, jsxs as jsxs102 } from "react/jsx-runtime";
5129
- import { X as X72, Plus as Plus32, Trash2 as Trash222, Users as Users2, Loader as Loader22, RotateCcw as RotateCcw2, Ban as Ban2, Eye as Eye32, FileText as FileText22, History as History2 } from "lucide-react";
5130
- import { Fragment as Fragment62, jsx as jsx142, jsxs as jsxs112 } from "react/jsx-runtime";
5131
- import { createContext as createContext42, useContext as useContext42, useState as useState112, useCallback as useCallback22 } from "react";
5132
- import { jsx as jsx152, jsxs as jsxs122 } from "react/jsx-runtime";
5133
- import { jsx as jsx162, jsxs as jsxs132 } from "react/jsx-runtime";
5134
- import { useEffect as useEffect16, useState as useState25 } from "react";
5135
- import { jsx as jsx172 } from "react/jsx-runtime";
5136
- import { jsx as jsx222, jsxs as jsxs142 } from "react/jsx-runtime";
5137
- import { Link as Link32 } from "react-router-dom";
5138
- import { jsx as jsx322, jsxs as jsxs222 } from "react/jsx-runtime";
5139
- import React422, { useState as useState522, useEffect as useEffect422 } from "react";
5140
- import { useLocation as useLocation32, useNavigate as useNavigate32 } from "react-router-dom";
5141
- import {
5142
- Settings as Settings32,
5143
- ChevronLeft as ChevronLeft32,
5144
- ChevronRight as ChevronRight22,
5145
- Search as Search42,
5146
- Bell as Bell22,
5147
- User as User22,
5148
- LogOut as LogOut22,
5149
- Menu as Menu32,
5150
- X as X222,
5151
- Palette as Palette22,
5152
- DollarSign as DollarSign22,
5153
- HelpCircle as HelpCircle32,
5154
- Building2 as Building222
5155
- } from "lucide-react";
5156
- import { clsx as clsx22 } from "clsx";
5157
- import { twMerge as twMerge22 } from "tailwind-merge";
5158
- import { createContext as createContext52, useContext as useContext52, useState as useState122, useEffect as useEffect92 } from "react";
5159
- import { jsx as jsx422 } from "react/jsx-runtime";
5160
- import { createContext as createContext222, useContext as useContext222, useEffect as useEffect222, useState as useState222 } from "react";
5161
- import { jsx as jsx522 } from "react/jsx-runtime";
5162
- import { createContext as createContext322, useContext as useContext322, useState as useState322, useCallback as useCallback32 } from "react";
5163
- import { jsx as jsx622 } from "react/jsx-runtime";
5164
- import { useState as useState422, useEffect as useEffect322 } from "react";
5165
- import { jsx as jsx722, jsxs as jsxs322 } from "react/jsx-runtime";
5166
- import { X as X82, Loader as Loader32, Eye as Eye42, FileText as FileText32, Check as Check22, XCircle as XCircle32, Edit as Edit22, CheckCircle as CheckCircle32, Clock as Clock22, AlertCircle as AlertCircle42, User as UserIcon22, Send as Send22 } from "lucide-react";
5167
- import { useParams as useParams22, useSearchParams as useSearchParams32 } from "react-router-dom";
5168
- import { Fragment as Fragment72, jsx as jsx822, jsxs as jsxs422 } from "react/jsx-runtime";
5169
- import { Fragment as Fragment222, jsx as jsx922, jsxs as jsxs522 } from "react/jsx-runtime";
5170
- import { useEffect as useEffect522, useState as useState622 } from "react";
5171
- import { CheckCircle as CheckCircle232, XCircle as XCircle222, AlertTriangle as AlertTriangle32, Info as Info3, X as X322 } from "lucide-react";
5172
- import { jsx as jsx1022, jsxs as jsxs622 } from "react/jsx-runtime";
5173
- import { ChevronLeft as ChevronLeft222, Download as Download32, Menu as Menu222, Settings as Settings232 } from "lucide-react";
5174
- import { useState as useState722 } from "react";
5175
- import { Fragment as Fragment322, jsx as jsx1122, jsxs as jsxs722 } from "react/jsx-runtime";
5176
- import { useEffect as useEffect622, useState as useState822 } from "react";
5177
- import { useLocation as useLocation222, useNavigate as useNavigate222, useSearchParams as useSearchParams222, Link as Link222 } from "react-router-dom";
5178
- import { ArrowDownAZ as ArrowDownAZ22, ArrowDownUp as ArrowDownUp22, ArrowUpAZ as ArrowUpAZ22, Download as Download222, Filter as Filter22, MoreVertical as MoreVertical22, Printer as Printer22, Search as Search222 } from "lucide-react";
5179
- import { Fragment as Fragment422, jsx as jsx1222, jsxs as jsxs822 } from "react/jsx-runtime";
5180
- import { useState as useState1022, useEffect as useEffect822 } from "react";
5181
- import { useState as useState922, useRef as useRef32, useEffect as useEffect722 } from "react";
5182
- import { Search as Search322, ChevronDown as ChevronDown32, X as X422, RefreshCw as RefreshCw32, Plus as Plus42 } from "lucide-react";
5183
- import { Fragment as Fragment522, jsx as jsx1322, jsxs as jsxs922 } from "react/jsx-runtime";
5184
- import { X as X522, Plus as Plus222, Trash2 as Trash232, Users as Users22, Loader as Loader222, RotateCcw as RotateCcw22, Ban as Ban22, Eye as Eye22, FileText as FileText222, History as History22 } from "lucide-react";
5185
- import { Fragment as Fragment622, jsx as jsx1422, jsxs as jsxs1022 } from "react/jsx-runtime";
5186
- import { createContext as createContext422, useContext as useContext422, useState as useState1122, useCallback as useCallback222 } from "react";
5187
- import { jsx as jsx1522, jsxs as jsxs1122 } from "react/jsx-runtime";
5188
- import { jsx as jsx1622, jsxs as jsxs1222 } from "react/jsx-runtime";
5189
- import { useEffect as useEffect15, useState as useState23 } from "react";
5190
- import { jsx as jsx1722 } from "react/jsx-runtime";
5191
- import { jsx as jsx2222, jsxs as jsxs1322 } from "react/jsx-runtime";
5192
- import { Link as Link322 } from "react-router-dom";
5193
- import { jsx as jsx3222, jsxs as jsxs2222 } from "react/jsx-runtime";
5194
- import React4222, { useState as useState5222, useEffect as useEffect4222 } from "react";
5195
- import { useLocation as useLocation322, useNavigate as useNavigate322 } from "react-router-dom";
5196
- import {
5197
- Settings as Settings322,
5198
- ChevronLeft as ChevronLeft322,
5199
- ChevronRight as ChevronRight222,
5200
- Search as Search422,
5201
- Bell as Bell222,
5202
- User as User222,
5203
- LogOut as LogOut222,
5204
- Menu as Menu322,
5205
- X as X2222,
5206
- Palette as Palette222,
5207
- DollarSign as DollarSign222,
5208
- HelpCircle as HelpCircle222,
5209
- Building2 as Building2222
5210
- } from "lucide-react";
5211
- import { clsx as clsx222 } from "clsx";
5212
- import { twMerge as twMerge222 } from "tailwind-merge";
5213
- import { createContext as createContext522, useContext as useContext522, useState as useState1222, useEffect as useEffect922 } from "react";
5214
- import { jsx as jsx4222 } from "react/jsx-runtime";
5215
- import { createContext as createContext2222, useContext as useContext2222, useEffect as useEffect2222, useState as useState2222 } from "react";
5216
- import { jsx as jsx5222 } from "react/jsx-runtime";
5217
- import { createContext as createContext3222, useContext as useContext3222, useState as useState3222, useCallback as useCallback322 } from "react";
5218
- import { jsx as jsx6222 } from "react/jsx-runtime";
5219
- import { useState as useState4222, useEffect as useEffect3222 } from "react";
5220
- import { jsx as jsx7222, jsxs as jsxs3222 } from "react/jsx-runtime";
5221
- import { X as X622, Loader as Loader322, Eye as Eye322, FileText as FileText322, Check as Check222, XCircle as XCircle322, Edit as Edit222, CheckCircle as CheckCircle322, Clock as Clock222, AlertCircle as AlertCircle222, User as UserIcon222, Send as Send222 } from "lucide-react";
5222
- import { useParams as useParams222, useSearchParams as useSearchParams322 } from "react-router-dom";
5223
- import { Fragment as Fragment722, jsx as jsx8222, jsxs as jsxs4222 } from "react/jsx-runtime";
5224
- import { Fragment as Fragment2222, jsx as jsx9222, jsxs as jsxs5222 } from "react/jsx-runtime";
5225
- import { useEffect as useEffect5222, useState as useState6222 } from "react";
5226
- import { CheckCircle as CheckCircle2222, XCircle as XCircle2222, AlertTriangle as AlertTriangle222, Info as Info222, X as X3222 } from "lucide-react";
5227
- import { jsx as jsx10222, jsxs as jsxs6222 } from "react/jsx-runtime";
5228
- import { ChevronLeft as ChevronLeft2222, Download as Download322, Menu as Menu2222, Settings as Settings2222 } from "lucide-react";
5229
- import { useState as useState7222 } from "react";
5230
- import { Fragment as Fragment3222, jsx as jsx11222, jsxs as jsxs7222 } from "react/jsx-runtime";
5231
- import { useEffect as useEffect6222, useState as useState8222 } from "react";
5232
- import { useLocation as useLocation2222, useNavigate as useNavigate2222, useSearchParams as useSearchParams2222, Link as Link2222 } from "react-router-dom";
5233
- import { ArrowDownAZ as ArrowDownAZ222, ArrowDownUp as ArrowDownUp222, ArrowUpAZ as ArrowUpAZ222, Download as Download2222, Filter as Filter222, MoreVertical as MoreVertical222, Printer as Printer222, Search as Search2222 } from "lucide-react";
5234
- import { Fragment as Fragment4222, jsx as jsx12222, jsxs as jsxs8222 } from "react/jsx-runtime";
5235
- import { useState as useState10222, useEffect as useEffect8222 } from "react";
5236
- import { useState as useState9222, useRef as useRef222, useEffect as useEffect7222 } from "react";
5237
- import { Search as Search3222, ChevronDown as ChevronDown222, X as X4222, RefreshCw as RefreshCw222, Plus as Plus322 } from "lucide-react";
5238
- import { Fragment as Fragment5222, jsx as jsx13222, jsxs as jsxs9222 } from "react/jsx-runtime";
5239
- import { X as X5222, Plus as Plus2222, Trash2 as Trash2222, Users as Users222, Loader as Loader2222, RotateCcw as RotateCcw222, Ban as Ban222, Eye as Eye222, FileText as FileText2222, History as History222 } from "lucide-react";
5240
- import { Fragment as Fragment6222, jsx as jsx14222, jsxs as jsxs10222 } from "react/jsx-runtime";
5241
- import { createContext as createContext4222, useContext as useContext4222, useState as useState11222, useCallback as useCallback2222 } from "react";
5242
- import { jsx as jsx15222, jsxs as jsxs11222 } from "react/jsx-runtime";
5243
- import { jsx as jsx16222, jsxs as jsxs12222 } from "react/jsx-runtime";
5244
- import { useEffect as useEffect14, useState as useState20 } from "react";
5245
- import { jsx as jsx17222 } from "react/jsx-runtime";
5246
- import { jsx as jsx22222, jsxs as jsxs13222 } from "react/jsx-runtime";
5247
- import { Link as Link3222 } from "react-router-dom";
5248
- import { jsx as jsx32222, jsxs as jsxs22222 } from "react/jsx-runtime";
5249
- import React42222, { useState as useState52222, useEffect as useEffect42222 } from "react";
5250
- import { useLocation as useLocation3222, useNavigate as useNavigate3222 } from "react-router-dom";
5251
- import {
5252
- Settings as Settings3222,
5253
- ChevronLeft as ChevronLeft3222,
5254
- ChevronRight as ChevronRight2222,
5255
- Search as Search4222,
5256
- Bell as Bell2222,
5257
- User as User2222,
5258
- LogOut as LogOut2222,
5259
- Menu as Menu3222,
5260
- X as X22222,
5261
- Palette as Palette2222,
5262
- DollarSign as DollarSign2222,
5263
- HelpCircle as HelpCircle2222,
5264
- Building2 as Building22222
5265
- } from "lucide-react";
5266
- import { clsx as clsx2222 } from "clsx";
5267
- import { twMerge as twMerge2222 } from "tailwind-merge";
5268
- import { createContext as createContext5222, useContext as useContext5222, useState as useState12222, useEffect as useEffect9222 } from "react";
5269
- import { jsx as jsx42222 } from "react/jsx-runtime";
5270
- import { createContext as createContext22222, useContext as useContext22222, useEffect as useEffect22222, useState as useState22222 } from "react";
5271
- import { jsx as jsx52222 } from "react/jsx-runtime";
5272
- import { createContext as createContext32222, useContext as useContext32222, useState as useState32222, useCallback as useCallback3222 } from "react";
5273
- import { jsx as jsx62222 } from "react/jsx-runtime";
5274
- import { useState as useState42222, useEffect as useEffect32222 } from "react";
5275
- import { jsx as jsx72222, jsxs as jsxs32222 } from "react/jsx-runtime";
5276
- import { X as X6222, Loader as Loader3222, Eye as Eye3222, FileText as FileText3222, Check as Check2222, XCircle as XCircle3222, Edit as Edit2222, CheckCircle as CheckCircle3222, Clock as Clock2222, AlertCircle as AlertCircle2222, User as UserIcon2222, Send as Send2222 } from "lucide-react";
5277
- import { useParams as useParams2222, useSearchParams as useSearchParams3222 } from "react-router-dom";
5278
- import { Fragment as Fragment7222, jsx as jsx82222, jsxs as jsxs42222 } from "react/jsx-runtime";
5279
- import { Fragment as Fragment22222, jsx as jsx92222, jsxs as jsxs52222 } from "react/jsx-runtime";
5280
- import { useEffect as useEffect52222, useState as useState62222 } from "react";
5281
- import { CheckCircle as CheckCircle22222, XCircle as XCircle22222, AlertTriangle as AlertTriangle2222, Info as Info2222, X as X32222 } from "lucide-react";
5282
- import { jsx as jsx102222, jsxs as jsxs62222 } from "react/jsx-runtime";
5283
- import { ChevronLeft as ChevronLeft22222, Download as Download3222, Menu as Menu22222, Settings as Settings22222 } from "lucide-react";
5284
- import { useState as useState72222 } from "react";
5285
- import { Fragment as Fragment32222, jsx as jsx112222, jsxs as jsxs72222 } from "react/jsx-runtime";
5286
- import { useEffect as useEffect62222, useState as useState82222 } from "react";
5287
- import { useLocation as useLocation22222, useNavigate as useNavigate22222, useSearchParams as useSearchParams22222, Link as Link22222 } from "react-router-dom";
5288
- import { ArrowDownAZ as ArrowDownAZ2222, ArrowDownUp as ArrowDownUp2222, ArrowUpAZ as ArrowUpAZ2222, Download as Download22222, Filter as Filter2222, MoreVertical as MoreVertical2222, Printer as Printer2222, Search as Search22222 } from "lucide-react";
5289
- import { Fragment as Fragment42222, jsx as jsx122222, jsxs as jsxs82222 } from "react/jsx-runtime";
5290
- import { useState as useState102222, useEffect as useEffect82222 } from "react";
5291
- import { useState as useState92222, useRef as useRef2222, useEffect as useEffect72222 } from "react";
5292
- import { Search as Search32222, ChevronDown as ChevronDown2222, X as X42222, RefreshCw as RefreshCw2222, Plus as Plus3222 } from "lucide-react";
5293
- import { Fragment as Fragment52222, jsx as jsx132222, jsxs as jsxs92222 } from "react/jsx-runtime";
5294
- import { X as X52222, Plus as Plus22222, Trash2 as Trash22222, Users as Users2222, Loader as Loader22222, RotateCcw as RotateCcw2222, Ban as Ban2222, Eye as Eye2222, FileText as FileText22222, History as History2222 } from "lucide-react";
5295
- import { Fragment as Fragment62222, jsx as jsx142222, jsxs as jsxs102222 } from "react/jsx-runtime";
5296
- import { createContext as createContext42222, useContext as useContext42222, useState as useState112222, useCallback as useCallback22222 } from "react";
5297
- import { jsx as jsx152222, jsxs as jsxs112222 } from "react/jsx-runtime";
5298
- import { jsx as jsx162222, jsxs as jsxs122222 } from "react/jsx-runtime";
5299
- import { useEffect as useEffect13, useState as useState18 } from "react";
5300
- import { jsx as jsx172222 } from "react/jsx-runtime";
5301
- import { jsx as jsx222222, jsxs as jsxs132222 } from "react/jsx-runtime";
5302
- import { Link as Link32222 } from "react-router-dom";
5303
- import { jsx as jsx322222, jsxs as jsxs222222 } from "react/jsx-runtime";
5304
- import React422222, { useState as useState522222, useEffect as useEffect422222 } from "react";
5305
- import { useLocation as useLocation32222, useNavigate as useNavigate32222 } from "react-router-dom";
5306
- import {
5307
- Settings as Settings32222,
5308
- ChevronLeft as ChevronLeft32222,
5309
- ChevronRight as ChevronRight22222,
5310
- Search as Search42222,
5311
- Bell as Bell22222,
5312
- User as User22222,
5313
- LogOut as LogOut22222,
5314
- Menu as Menu32222,
5315
- X as X222222,
5316
- Palette as Palette22222,
5317
- DollarSign as DollarSign22222,
5318
- HelpCircle as HelpCircle22222,
5319
- Building2 as Building222222
5320
- } from "lucide-react";
5321
- import { clsx as clsx22222 } from "clsx";
5322
- import { twMerge as twMerge22222 } from "tailwind-merge";
5323
- import { createContext as createContext52222, useContext as useContext52222, useState as useState122222, useEffect as useEffect92222 } from "react";
5324
- import { jsx as jsx422222 } from "react/jsx-runtime";
5325
- import { createContext as createContext222222, useContext as useContext222222, useEffect as useEffect222222, useState as useState222222 } from "react";
5326
- import { jsx as jsx522222 } from "react/jsx-runtime";
5327
- import { createContext as createContext322222, useContext as useContext322222, useState as useState322222, useCallback as useCallback32222 } from "react";
5328
- import { jsx as jsx622222 } from "react/jsx-runtime";
5329
- import { useState as useState422222, useEffect as useEffect322222 } from "react";
5330
- import { jsx as jsx722222, jsxs as jsxs322222 } from "react/jsx-runtime";
5331
- import { X as X62222, Loader as Loader32222, Eye as Eye32222, FileText as FileText32222, Check as Check22222, XCircle as XCircle32222, Edit as Edit22222, CheckCircle as CheckCircle32222, Clock as Clock22222, AlertCircle as AlertCircle22222, User as UserIcon22222, Send as Send22222 } from "lucide-react";
5332
- import { useParams as useParams22222, useSearchParams as useSearchParams32222 } from "react-router-dom";
5333
- import { Fragment as Fragment72222, jsx as jsx822222, jsxs as jsxs422222 } from "react/jsx-runtime";
5334
- import { Fragment as Fragment222222, jsx as jsx922222, jsxs as jsxs522222 } from "react/jsx-runtime";
5335
- import { useEffect as useEffect522222, useState as useState622222 } from "react";
5336
- import { CheckCircle as CheckCircle222222, XCircle as XCircle222222, AlertTriangle as AlertTriangle22222, Info as Info22222, X as X322222 } from "lucide-react";
5337
- import { jsx as jsx1022222, jsxs as jsxs622222 } from "react/jsx-runtime";
5338
- import { ChevronLeft as ChevronLeft222222, Download as Download32222, Menu as Menu222222, Settings as Settings222222 } from "lucide-react";
5339
- import { useState as useState722222 } from "react";
5340
- import { Fragment as Fragment322222, jsx as jsx1122222, jsxs as jsxs722222 } from "react/jsx-runtime";
5341
- import { useEffect as useEffect622222, useState as useState822222 } from "react";
5342
- import { useLocation as useLocation222222, useNavigate as useNavigate222222, useSearchParams as useSearchParams222222, Link as Link222222 } from "react-router-dom";
5343
- import { ArrowDownAZ as ArrowDownAZ22222, ArrowDownUp as ArrowDownUp22222, ArrowUpAZ as ArrowUpAZ22222, Download as Download222222, Filter as Filter22222, MoreVertical as MoreVertical22222, Printer as Printer22222, Search as Search222222 } from "lucide-react";
5344
- import { Fragment as Fragment422222, jsx as jsx1222222, jsxs as jsxs822222 } from "react/jsx-runtime";
5345
- import { useState as useState1022222, useEffect as useEffect822222 } from "react";
5346
- import { useState as useState922222, useRef as useRef22222, useEffect as useEffect722222 } from "react";
5347
- import { Search as Search322222, ChevronDown as ChevronDown22222, X as X422222, RefreshCw as RefreshCw22222, Plus as Plus32222 } from "lucide-react";
5348
- import { Fragment as Fragment522222, jsx as jsx1322222, jsxs as jsxs922222 } from "react/jsx-runtime";
5349
- import { X as X522222, Plus as Plus222222, Trash2 as Trash222222, Users as Users22222, Loader as Loader222222, RotateCcw as RotateCcw22222, Ban as Ban22222, Eye as Eye22222, FileText as FileText222222, History as History22222 } from "lucide-react";
5350
- import { Fragment as Fragment622222, jsx as jsx1422222, jsxs as jsxs1022222 } from "react/jsx-runtime";
5351
- import { createContext as createContext422222, useContext as useContext422222, useState as useState1122222, useCallback as useCallback222222 } from "react";
5352
- import { jsx as jsx1522222, jsxs as jsxs1122222 } from "react/jsx-runtime";
5353
- import { jsx as jsx1622222, jsxs as jsxs1222222 } from "react/jsx-runtime";
5354
- import { useEffect as useEffect12, useState as useState16 } from "react";
5355
- import { jsx as jsx1722222 } from "react/jsx-runtime";
5356
- import { jsx as jsx2222222, jsxs as jsxs1322222 } from "react/jsx-runtime";
5357
- import { Link as Link322222 } from "react-router-dom";
5358
- import { jsx as jsx3222222, jsxs as jsxs2222222 } from "react/jsx-runtime";
5359
- import React4222222, { useState as useState5222222, useEffect as useEffect4222222 } from "react";
5360
- import { useLocation as useLocation322222, useNavigate as useNavigate322222 } from "react-router-dom";
5361
- import {
5362
- Settings as Settings322222,
5363
- ChevronLeft as ChevronLeft322222,
5364
- ChevronRight as ChevronRight222222,
5365
- Search as Search422222,
5366
- Bell as Bell222222,
5367
- User as User222222,
5368
- LogOut as LogOut222222,
5369
- Menu as Menu322222,
5370
- X as X2222222,
5371
- Palette as Palette222222,
5372
- DollarSign as DollarSign222222,
5373
- HelpCircle as HelpCircle222222,
5374
- Building2 as Building2222222
5375
- } from "lucide-react";
5376
- import { clsx as clsx222222 } from "clsx";
5377
- import { twMerge as twMerge222222 } from "tailwind-merge";
5378
- import { createContext as createContext522222, useContext as useContext522222, useState as useState1222222, useEffect as useEffect922222 } from "react";
5379
- import { jsx as jsx4222222 } from "react/jsx-runtime";
5380
- import { createContext as createContext2222222, useContext as useContext2222222, useEffect as useEffect2222222, useState as useState2222222 } from "react";
5381
- import { jsx as jsx5222222 } from "react/jsx-runtime";
5382
- import { createContext as createContext3222222, useContext as useContext3222222, useState as useState3222222, useCallback as useCallback322222 } from "react";
5383
- import { jsx as jsx6222222 } from "react/jsx-runtime";
5384
- import { useState as useState4222222, useEffect as useEffect3222222 } from "react";
5385
- import { jsx as jsx7222222, jsxs as jsxs3222222 } from "react/jsx-runtime";
5386
- import { X as X622222, Loader as Loader322222, Eye as Eye322222, FileText as FileText322222, Check as Check222222, XCircle as XCircle322222, Edit as Edit222222, CheckCircle as CheckCircle322222, Clock as Clock222222, AlertCircle as AlertCircle222222, User as UserIcon222222, Send as Send222222 } from "lucide-react";
5387
- import { useParams as useParams222222, useSearchParams as useSearchParams322222 } from "react-router-dom";
5388
- import { Fragment as Fragment722222, jsx as jsx8222222, jsxs as jsxs4222222 } from "react/jsx-runtime";
5389
- import { Fragment as Fragment2222222, jsx as jsx9222222, jsxs as jsxs5222222 } from "react/jsx-runtime";
5390
- import { useEffect as useEffect5222222, useState as useState6222222 } from "react";
5391
- import { CheckCircle as CheckCircle2222222, XCircle as XCircle2222222, AlertTriangle as AlertTriangle222222, Info as Info222222, X as X3222222 } from "lucide-react";
5392
- import { jsx as jsx10222222, jsxs as jsxs6222222 } from "react/jsx-runtime";
5393
- import { ChevronLeft as ChevronLeft2222222, Download as Download322222, Menu as Menu2222222, Settings as Settings2222222 } from "lucide-react";
5394
- import { useState as useState7222222 } from "react";
5395
- import { Fragment as Fragment3222222, jsx as jsx11222222, jsxs as jsxs7222222 } from "react/jsx-runtime";
5396
- import { useEffect as useEffect6222222, useState as useState8222222 } from "react";
5397
- import { useLocation as useLocation2222222, useNavigate as useNavigate2222222, useSearchParams as useSearchParams2222222, Link as Link2222222 } from "react-router-dom";
5398
- import { ArrowDownAZ as ArrowDownAZ222222, ArrowDownUp as ArrowDownUp222222, ArrowUpAZ as ArrowUpAZ222222, Download as Download2222222, Filter as Filter222222, MoreVertical as MoreVertical222222, Printer as Printer222222, Search as Search2222222 } from "lucide-react";
5399
- import { Fragment as Fragment4222222, jsx as jsx12222222, jsxs as jsxs8222222 } from "react/jsx-runtime";
5400
- import { useState as useState10222222, useEffect as useEffect8222222 } from "react";
5401
- import { useState as useState9222222, useRef as useRef222222, useEffect as useEffect7222222 } from "react";
5402
- import { Search as Search3222222, ChevronDown as ChevronDown222222, X as X4222222, RefreshCw as RefreshCw222222, Plus as Plus322222 } from "lucide-react";
5403
- import { Fragment as Fragment5222222, jsx as jsx13222222, jsxs as jsxs9222222 } from "react/jsx-runtime";
5404
- import { X as X5222222, Plus as Plus2222222, Trash2 as Trash2222222, Users as Users222222, Loader as Loader2222222, RotateCcw as RotateCcw222222, Ban as Ban222222, Eye as Eye222222, FileText as FileText2222222, History as History222222 } from "lucide-react";
5405
- import { Fragment as Fragment6222222, jsx as jsx14222222, jsxs as jsxs10222222 } from "react/jsx-runtime";
5406
- import { createContext as createContext4222222, useContext as useContext4222222, useState as useState11222222, useCallback as useCallback2222222 } from "react";
5407
- import { jsx as jsx15222222, jsxs as jsxs11222222 } from "react/jsx-runtime";
5408
- import { jsx as jsx16222222, jsxs as jsxs12222222 } from "react/jsx-runtime";
5409
- import { useEffect as useEffect11, useState as useState14 } from "react";
5410
- import { jsx as jsx17222222 } from "react/jsx-runtime";
5411
- import { jsx as jsx22222222, jsxs as jsxs13222222 } from "react/jsx-runtime";
5412
- import { Link as Link3222222 } from "react-router-dom";
5413
- import { jsx as jsx32222222, jsxs as jsxs22222222 } from "react/jsx-runtime";
5414
- import React42222222, { useState as useState52222222, useEffect as useEffect42222222 } from "react";
5415
- import { useLocation as useLocation3222222, useNavigate as useNavigate3222222 } from "react-router-dom";
5416
- import {
5417
- Settings as Settings3222222,
5418
- ChevronLeft as ChevronLeft3222222,
5419
- ChevronRight as ChevronRight2222222,
5420
- Search as Search4222222,
5421
- Bell as Bell2222222,
5422
- User as User2222222,
5423
- LogOut as LogOut2222222,
5424
- Menu as Menu3222222,
5425
- X as X22222222,
5426
- Palette as Palette2222222,
5427
- DollarSign as DollarSign2222222,
5428
- HelpCircle as HelpCircle2222222,
5429
- Building2 as Building22222222
5430
- } from "lucide-react";
5431
- import { clsx as clsx2222222 } from "clsx";
5432
- import { twMerge as twMerge2222222 } from "tailwind-merge";
5433
- import { createContext as createContext5222222, useContext as useContext5222222, useState as useState12222222, useEffect as useEffect9222222 } from "react";
5434
- import { jsx as jsx42222222 } from "react/jsx-runtime";
5435
- import { createContext as createContext22222222, useContext as useContext22222222, useEffect as useEffect22222222, useState as useState22222222 } from "react";
5436
- import { jsx as jsx52222222 } from "react/jsx-runtime";
5437
- import { createContext as createContext32222222, useContext as useContext32222222, useState as useState32222222, useCallback as useCallback3222222 } from "react";
5438
- import { jsx as jsx62222222 } from "react/jsx-runtime";
5439
- import { useState as useState42222222, useEffect as useEffect32222222 } from "react";
5440
- import { jsx as jsx72222222, jsxs as jsxs32222222 } from "react/jsx-runtime";
5441
- import { X as X6222222, Loader as Loader3222222, Eye as Eye3222222, FileText as FileText3222222, Check as Check2222222, XCircle as XCircle3222222, Edit as Edit2222222, CheckCircle as CheckCircle3222222, Clock as Clock2222222, AlertCircle as AlertCircle2222222, User as UserIcon2222222, Send as Send2222222 } from "lucide-react";
5442
- import { useParams as useParams2222222, useSearchParams as useSearchParams3222222 } from "react-router-dom";
5443
- import { Fragment as Fragment7222222, jsx as jsx82222222, jsxs as jsxs42222222 } from "react/jsx-runtime";
5444
- import { Fragment as Fragment22222222, jsx as jsx92222222, jsxs as jsxs52222222 } from "react/jsx-runtime";
5445
- import { useEffect as useEffect52222222, useState as useState62222222 } from "react";
5446
- import { CheckCircle as CheckCircle22222222, XCircle as XCircle22222222, AlertTriangle as AlertTriangle2222222, Info as Info2222222, X as X32222222 } from "lucide-react";
5447
- import { jsx as jsx102222222, jsxs as jsxs62222222 } from "react/jsx-runtime";
5448
- import { ChevronLeft as ChevronLeft22222222, Download as Download3222222, Menu as Menu22222222, Settings as Settings22222222 } from "lucide-react";
5449
- import { useState as useState72222222 } from "react";
5450
- import { Fragment as Fragment32222222, jsx as jsx112222222, jsxs as jsxs72222222 } from "react/jsx-runtime";
5451
- import { useEffect as useEffect62222222, useState as useState82222222 } from "react";
5452
- import { useLocation as useLocation22222222, useNavigate as useNavigate22222222, useSearchParams as useSearchParams22222222, Link as Link22222222 } from "react-router-dom";
5453
- import { ArrowDownAZ as ArrowDownAZ2222222, ArrowDownUp as ArrowDownUp2222222, ArrowUpAZ as ArrowUpAZ2222222, Download as Download22222222, Filter as Filter2222222, MoreVertical as MoreVertical2222222, Printer as Printer2222222, Search as Search22222222 } from "lucide-react";
5454
- import { Fragment as Fragment42222222, jsx as jsx122222222, jsxs as jsxs82222222 } from "react/jsx-runtime";
5455
- import { useState as useState102222222, useEffect as useEffect82222222 } from "react";
5456
- import { useState as useState92222222, useRef as useRef2222222, useEffect as useEffect72222222 } from "react";
5457
- import { Search as Search32222222, ChevronDown as ChevronDown2222222, X as X42222222 } from "lucide-react";
5458
- import { Fragment as Fragment52222222, jsx as jsx132222222, jsxs as jsxs92222222 } from "react/jsx-runtime";
5459
- import { X as X52222222, Plus as Plus3222222, Trash2 as Trash22222222, Users as Users2222222, Loader as Loader22222222, RotateCcw as RotateCcw2222222, Ban as Ban2222222, Eye as Eye2222222, FileText as FileText22222222, History as History2222222 } from "lucide-react";
5460
- import { Fragment as Fragment62222222, jsx as jsx142222222, jsxs as jsxs102222222 } from "react/jsx-runtime";
5461
- import { createContext as createContext42222222, useContext as useContext42222222, useState as useState112222222, useCallback as useCallback22222222 } from "react";
5462
- import { jsx as jsx152222222, jsxs as jsxs112222222 } from "react/jsx-runtime";
5463
- import { jsx as jsx162222222, jsxs as jsxs122222222 } from "react/jsx-runtime";
5464
- import { useState as useState13 } from "react";
5465
- import { jsx as jsx18, jsxs as jsxs1422 } from "react/jsx-runtime";
5466
- import { jsx as jsx19, jsxs as jsxs15 } from "react/jsx-runtime";
5467
- import { useState as useState15 } from "react";
5468
- import { jsx as jsx20, jsxs as jsxs16 } from "react/jsx-runtime";
5469
- import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
5470
- import { jsx as jsx23 } from "react/jsx-runtime";
5471
- import { useState as useState17 } from "react";
5472
- import { jsx as jsx24, jsxs as jsxs18 } from "react/jsx-runtime";
5473
- import { jsx as jsx25, jsxs as jsxs19 } from "react/jsx-runtime";
5474
- import { jsx as jsx26 } from "react/jsx-runtime";
5475
- import { useState as useState19 } from "react";
5476
- import { jsx as jsx27, jsxs as jsxs20 } from "react/jsx-runtime";
5477
- import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
5478
- import { jsx as jsx29 } from "react/jsx-runtime";
5479
- import { useState as useState21 } from "react";
5480
- import { jsx as jsx30, jsxs as jsxs23 } from "react/jsx-runtime";
5481
- import { jsx as jsx31, jsxs as jsxs24 } from "react/jsx-runtime";
5482
- import { jsx as jsx33 } from "react/jsx-runtime";
5483
- import { useState as useState24 } from "react";
5484
- import { jsx as jsx34, jsxs as jsxs25 } from "react/jsx-runtime";
5485
- import { jsx as jsx35, jsxs as jsxs26 } from "react/jsx-runtime";
5486
- import { jsx as jsx36 } from "react/jsx-runtime";
5487
- var PrimaryButton2 = ({
5488
- loading = false,
5489
- children,
5490
- classname = "",
5491
- variant = "full",
5492
- ...props
5493
- }) => /* @__PURE__ */ jsx17(
5494
- "button",
5495
- {
5496
- type: "submit",
5497
- disabled: loading || props.disabled,
5498
- className: `px-4 py-2 text-sm rounded-lg hover:bg-opacity-80 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex justify-center items-center ${classname} ${variant === "full" ? "bg-[#6A8A82] text-white" : variant === "outline" ? "border border-[#6A8A82] text-[#6A8A82] bg-transparent" : "bg-transparent text-[#6A8A82]"}`,
5499
- ...props,
5500
- children: loading ? "Connexion en cours..." : children
5501
- }
5502
- );
5503
- var Buttons_default2 = PrimaryButton2;
5504
- var Modal2 = ({ title, description, width = "max-w-lg", open, onClose, children }) => {
5505
- if (!open) return null;
5506
- return /* @__PURE__ */ jsx22("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50", children: /* @__PURE__ */ jsxs14("div", { className: `bg-white rounded-lg p-6 mx-4 w-full ${width}`, children: [
5507
- /* @__PURE__ */ jsxs14("div", { className: "flex justify-between items-start mb-6", children: [
5508
- /* @__PURE__ */ jsxs14("div", { children: [
5509
- /* @__PURE__ */ jsx22("h3", { className: "text-xl font-semibold text-tuatara flex items-center space-x-2", children: /* @__PURE__ */ jsx22("span", { children: title }) }),
5510
- description && /* @__PURE__ */ jsx22("p", { className: "text-sm text-gray-600 mt-1", children: description })
5511
- ] }),
5512
- /* @__PURE__ */ jsx22(
5513
- "button",
5514
- {
5515
- onClick: onClose,
5516
- className: "text-gray-400 hover:text-gray-600 text-xl",
5517
- "aria-label": "Close modal",
5518
- children: "\u2715"
5519
- }
5520
- )
5521
- ] }),
5522
- /* @__PURE__ */ jsx22("div", { className: "w-full max-h-[80vh] overflow-y-auto", children })
5523
- ] }) });
5524
- };
5525
- var Modals_default2 = Modal2;
5526
- var InputField2 = ({
5527
- label,
5528
- name,
5529
- type = "text",
5530
- value,
5531
- placeholder,
5532
- required = false,
5533
- disabled = false,
5534
- error,
5535
- onChange,
5536
- onBlur
5537
- }) => {
5538
- return /* @__PURE__ */ jsxs22("div", { className: "flex flex-col gap-1 w-full", children: [
5539
- label && /* @__PURE__ */ jsxs22("label", { htmlFor: name, className: "block text-gray-700 text-sm font-medium mb-2", children: [
5540
- label,
5541
- " ",
5542
- required && /* @__PURE__ */ jsx32("span", { className: "text-red-500", children: "*" })
5543
- ] }),
5544
- /* @__PURE__ */ jsx32(
5545
- "input",
5546
- {
5547
- id: name,
5548
- name,
5549
- type,
5550
- value,
5551
- placeholder,
5552
- required,
5553
- disabled,
5554
- onChange,
5555
- onBlur,
5556
- className: `w-full px-3 py-2 border border-[#D9D9D9] focus:ring-2 focus:ring-[#6A8A82]/20
5557
- ${error ? "border-red-500" : "border-gray-300"}
5558
- ${disabled ? "bg-gray-100 cursor-not-allowed" : ""}
5559
- `
5560
- }
5561
- ),
5562
- error && /* @__PURE__ */ jsx32("p", { className: "text-xs text-red-500", children: error })
5563
- ] });
5564
- };
5565
- var TextInput2 = (props) => {
5566
- return /* @__PURE__ */ jsx32(InputField2, { ...props, type: "text" });
5567
- };
5568
- var ThemeContext2 = createContext5(void 0);
5569
- var chooseEnv2 = localStorage.getItem("env") ?? "prod";
5570
- var ADDRESS_IP2 = chooseEnv2 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5571
- var ADDRESS_IP_URL2 = chooseEnv2 === "prod" ? `https://${ADDRESS_IP2}/` : `http://${ADDRESS_IP2}/`;
5572
- var API_URL2 = `${ADDRESS_IP_URL2}api`;
5573
- var API_BASE_URL3 = `${API_URL2}/core/auth/`;
5574
- var VENDORS_API_URL2 = `${API_URL2}/accounting/vendors/`;
5575
- var SessionContext2 = createContext22(void 0);
5576
- var API_BASE_URL22 = `${API_URL2}/core/auth/`;
5577
- var USERS_API_URL2 = `${API_URL2}/core/users/`;
5578
- var ToastContext2 = createContext32(void 0);
5579
- var APPROVAL_API_URL2 = `${API_URL2}/approvals/cases/`;
5580
- var AlertContext2 = createContext42(void 0);
5581
- var ThemeContext22 = createContext52(void 0);
5582
- var chooseEnv22 = localStorage.getItem("env") ?? "prod";
5583
- var ADDRESS_IP22 = chooseEnv22 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5584
- var ADDRESS_IP_URL22 = chooseEnv22 === "prod" ? `https://${ADDRESS_IP22}/` : `http://${ADDRESS_IP22}/`;
5585
- var API_URL22 = `${ADDRESS_IP_URL22}api`;
5586
- var API_BASE_URL32 = `${API_URL22}/core/auth/`;
5587
- var SessionContext22 = createContext222(void 0);
5588
- var API_BASE_URL222 = `${API_URL22}/core/auth/`;
5589
- var USERS_API_URL22 = `${API_URL22}/core/users/`;
5590
- var ToastContext22 = createContext322(void 0);
5591
- var APPROVAL_API_URL22 = `${API_URL22}/approvals/cases/`;
5592
- var AlertContext22 = createContext422(void 0);
5593
- var VENDORS_API_URL22 = `${API_URL22}/accounting/vendors/`;
5594
- var ThemeContext222 = createContext522(void 0);
5595
- var chooseEnv222 = localStorage.getItem("env") ?? "prod";
5596
- var ADDRESS_IP222 = chooseEnv222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5597
- var ADDRESS_IP_URL222 = chooseEnv222 === "prod" ? `https://${ADDRESS_IP222}/` : `http://${ADDRESS_IP222}/`;
5598
- var API_URL222 = `${ADDRESS_IP_URL222}api`;
5599
- var API_BASE_URL322 = `${API_URL222}/core/auth/`;
5600
- var SessionContext222 = createContext2222(void 0);
5601
- var API_BASE_URL2222 = `${API_URL222}/core/auth/`;
5602
- var USERS_API_URL222 = `${API_URL222}/core/users/`;
5603
- var ToastContext222 = createContext3222(void 0);
5604
- var APPROVAL_API_URL222 = `${API_URL222}/approvals/cases/`;
5605
- var AlertContext222 = createContext4222(void 0);
5606
- var VENDORS_API_URL222 = `${API_URL222}/accounting/vendors/`;
5607
- var ThemeContext2222 = createContext5222(void 0);
5608
- var chooseEnv2222 = localStorage.getItem("env") ?? "prod";
5609
- var ADDRESS_IP2222 = chooseEnv2222 === "prod" ? "back.rewise.praeduim-tech.com" : "localhost:8000";
5610
- var ADDRESS_IP_URL2222 = chooseEnv2222 === "prod" ? `https://${ADDRESS_IP2222}/` : `http://${ADDRESS_IP2222}/`;
5611
- var API_URL2222 = `${ADDRESS_IP_URL2222}api`;
5612
- var API_BASE_URL3222 = `${API_URL2222}/core/auth/`;
5613
- var SessionContext2222 = createContext22222(void 0);
5614
- var API_BASE_URL22222 = `${API_URL2222}/core/auth/`;
5615
- var USERS_API_URL2222 = `${API_URL2222}/core/users/`;
5616
- var ToastContext2222 = createContext32222(void 0);
5617
- var APPROVAL_API_URL2222 = `${API_URL2222}/approvals/cases/`;
5618
- var AlertContext2222 = createContext42222(void 0);
5619
- var VENDORS_API_URL2222 = `${API_URL2222}/accounting/vendors/`;
5620
- var ThemeContext22222 = createContext52222(void 0);
5621
- var ADDRESS_IP22222 = "localhost:8000";
5622
- var ADDRESS_IP_URL22222 = `http://${ADDRESS_IP22222}/`;
5623
- var API_URL22222 = `${ADDRESS_IP_URL22222}api`;
5624
- var API_BASE_URL32222 = `${API_URL22222}/core/auth/`;
5625
- var SessionContext22222 = createContext222222(void 0);
5626
- var API_BASE_URL222222 = `${API_URL22222}/core/auth/`;
5627
- var USERS_API_URL22222 = `${API_URL22222}/core/users/`;
5628
- var ToastContext22222 = createContext322222(void 0);
5629
- var APPROVAL_API_URL22222 = `${API_URL22222}/approvals/cases/`;
5630
- var AlertContext22222 = createContext422222(void 0);
5631
- var VENDORS_API_URL22222 = `${API_URL22222}/accounting/vendors/`;
5632
- var ThemeContext222222 = createContext522222(void 0);
5633
- var ADDRESS_IP222222 = "localhost:8000";
5634
- var ADDRESS_IP_URL222222 = `http://${ADDRESS_IP222222}/`;
5635
- var API_URL222222 = `${ADDRESS_IP_URL222222}api`;
5636
- var API_BASE_URL322222 = `${API_URL222222}/core/auth/`;
5637
- var SessionContext222222 = createContext2222222(void 0);
5638
- var API_BASE_URL2222222 = `${API_URL222222}/core/auth/`;
5639
- var USERS_API_URL222222 = `${API_URL222222}/core/users/`;
5640
- var ToastContext222222 = createContext3222222(void 0);
5641
- var APPROVAL_API_URL222222 = `${API_URL222222}/approvals/cases/`;
5642
- var AlertContext222222 = createContext4222222(void 0);
5643
- var VENDORS_API_URL222222 = `${API_URL222222}/accounting/vendors/`;
5644
- var ThemeContext2222222 = createContext5222222(void 0);
5645
- var ADDRESS_IP2222222 = "localhost:8000";
5646
- var ADDRESS_IP_URL2222222 = `http://${ADDRESS_IP2222222}/`;
5647
- var API_URL2222222 = `${ADDRESS_IP_URL2222222}api`;
5648
- var API_BASE_URL3222222 = `${API_URL2222222}/core/auth/`;
5649
- var SessionContext2222222 = createContext22222222(void 0);
5650
- var API_BASE_URL22222222 = `${API_URL2222222}/core/auth/`;
5651
- var USERS_API_URL2222222 = `${API_URL2222222}/core/users/`;
5652
- var ToastContext2222222 = createContext32222222(void 0);
5653
- var APPROVAL_API_URL2222222 = `${API_URL2222222}/approvals/cases/`;
5654
- var AlertContext2222222 = createContext42222222(void 0);
5655
- var URI = `${API_URL222222}/core/departments/`;
5656
- var URI2 = `${API_URL222222}/accounting/profit-or-cost-center/`;
5657
- var COST_URI = `${API_URL222222}/accounting/cost-center/`;
5658
- var PROFIT_URI = `${API_URL222222}/accounting/profit-center/`;
5659
- var URI3 = `${API_URL22222}/core/departments/`;
5660
- var URI4 = `${API_URL22222}/accounting/profit-or-cost-center/`;
5661
- var COST_URI2 = `${API_URL22222}/accounting/cost-center/`;
5662
- var PROFIT_URI2 = `${API_URL22222}/accounting/profit-center/`;
5663
- var URI5 = `${API_URL2222}/core/departments/`;
5664
- var URI6 = `${API_URL2222}/accounting/profit-or-cost-center/`;
5665
- var COST_URI3 = `${API_URL2222}/accounting/cost-center/`;
5666
- var PROFIT_URI3 = `${API_URL2222}/accounting/profit-center/`;
5667
- var URI7 = `${API_URL222}/core/departments/`;
5668
- var URI8 = `${API_URL222}/accounting/profit-or-cost-center/`;
5669
- var COST_URI4 = `${API_URL222}/accounting/cost-center/`;
5670
- var PROFIT_URI4 = `${API_URL222}/accounting/profit-center/`;
5671
- var URI9 = `${API_URL22}/core/departments/`;
5672
- var URI10 = `${API_URL22}/accounting/profit-or-cost-center/`;
5673
- var COST_URI5 = `${API_URL22}/accounting/cost-center/`;
5674
- var PROFIT_URI5 = `${API_URL22}/accounting/profit-center/`;
5675
- var URI11 = `${API_URL2}/core/departments/`;
5676
- var URI12 = `${API_URL2}/accounting/profit-or-cost-center/`;
5677
- var COST_URI6 = `${API_URL2}/accounting/cost-center/`;
5678
- var PROFIT_URI6 = `${API_URL2}/accounting/profit-center/`;
5700
+ import { useEffect as useEffect10, useState as useState13 } from "react";
5679
5701
 
5680
5702
  // src/components/common/FormVendor.tsx
5681
- import { useState as useState26 } from "react";
5682
- import { jsx as jsx37, jsxs as jsxs27 } from "react/jsx-runtime";
5703
+ import { useState as useState12 } from "react";
5704
+ import { jsx as jsx17, jsxs as jsxs14 } from "react/jsx-runtime";
5683
5705
  var MinimalVendorForm = ({
5684
5706
  isOpen,
5685
5707
  onClose,
@@ -5688,13 +5710,13 @@ var MinimalVendorForm = ({
5688
5710
  refresh = () => {
5689
5711
  }
5690
5712
  }) => {
5691
- const [formData, setFormData] = useState26(object || {
5713
+ const [formData, setFormData] = useState12(object || {
5692
5714
  from_module: from ?? null,
5693
5715
  legal_name: "",
5694
5716
  trading_name: ""
5695
5717
  });
5696
- const [errors, setErrors] = useState26({});
5697
- const [loading, setLoading] = useState26(false);
5718
+ const [errors, setErrors] = useState12({});
5719
+ const [loading, setLoading] = useState12(false);
5698
5720
  const { token } = useSession();
5699
5721
  const { success, error: showError } = useToast();
5700
5722
  const handleInputChange = (e) => {
@@ -5753,18 +5775,18 @@ var MinimalVendorForm = ({
5753
5775
  }
5754
5776
  };
5755
5777
  if (!isOpen) return null;
5756
- return /* @__PURE__ */ jsx37(
5757
- Modals_default2,
5778
+ return /* @__PURE__ */ jsx17(
5779
+ Modals_default,
5758
5780
  {
5759
5781
  title: "Ajouter un fournisseur",
5760
5782
  width: "w-[100%]",
5761
5783
  description: ``,
5762
5784
  open: isOpen,
5763
5785
  onClose,
5764
- children: /* @__PURE__ */ jsxs27("form", { onSubmit: handleSubmit, className: "p-", children: [
5765
- /* @__PURE__ */ jsx37("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs27("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5766
- /* @__PURE__ */ jsx37(
5767
- TextInput2,
5786
+ children: /* @__PURE__ */ jsxs14("form", { onSubmit: handleSubmit, className: "p-", children: [
5787
+ /* @__PURE__ */ jsx17("div", { className: "space-y-4", children: /* @__PURE__ */ jsxs14("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
5788
+ /* @__PURE__ */ jsx17(
5789
+ TextInput,
5768
5790
  {
5769
5791
  label: "Raison sociale",
5770
5792
  name: "legal_name",
@@ -5775,8 +5797,8 @@ var MinimalVendorForm = ({
5775
5797
  onChange: handleInputChange
5776
5798
  }
5777
5799
  ),
5778
- /* @__PURE__ */ jsx37(
5779
- TextInput2,
5800
+ /* @__PURE__ */ jsx17(
5801
+ TextInput,
5780
5802
  {
5781
5803
  label: "Nom commercial",
5782
5804
  name: "trading_name",
@@ -5786,8 +5808,8 @@ var MinimalVendorForm = ({
5786
5808
  }
5787
5809
  )
5788
5810
  ] }) }),
5789
- /* @__PURE__ */ jsxs27("div", { className: "flex justify-between pt-6 mt-8", children: [
5790
- /* @__PURE__ */ jsx37(
5811
+ /* @__PURE__ */ jsxs14("div", { className: "flex justify-between pt-6 mt-8", children: [
5812
+ /* @__PURE__ */ jsx17(
5791
5813
  "button",
5792
5814
  {
5793
5815
  type: "button",
@@ -5796,8 +5818,8 @@ var MinimalVendorForm = ({
5796
5818
  children: "Annuler"
5797
5819
  }
5798
5820
  ),
5799
- /* @__PURE__ */ jsx37(
5800
- Buttons_default2,
5821
+ /* @__PURE__ */ jsx17(
5822
+ Buttons_default,
5801
5823
  {
5802
5824
  type: "button",
5803
5825
  onClick: handleSubmit,
@@ -5812,43 +5834,43 @@ var MinimalVendorForm = ({
5812
5834
  };
5813
5835
 
5814
5836
  // src/services/DepartmentServices.ts
5815
- var URI13 = `${API_URL}/core/departments/`;
5837
+ var URI = `${API_URL}/core/departments/`;
5816
5838
  var DepartmentServices = {
5817
- create: (data) => FetchApi.post(`${URI13}`, data),
5818
- get: (id) => FetchApi.get(`${URI13}${id}/`),
5819
- list: (params) => FetchApi.get(`${URI13}?${new URLSearchParams(params).toString()}`),
5820
- update: (id, data) => FetchApi.put(`${URI13}${id}/`, data),
5821
- delete: (id) => FetchApi.delete(`${URI13}${id}/`)
5839
+ create: (data) => FetchApi.post(`${URI}`, data),
5840
+ get: (id) => FetchApi.get(`${URI}${id}/`),
5841
+ list: (params) => FetchApi.get(`${URI}?${new URLSearchParams(params).toString()}`),
5842
+ update: (id, data) => FetchApi.put(`${URI}${id}/`, data),
5843
+ delete: (id) => FetchApi.delete(`${URI}${id}/`)
5822
5844
  };
5823
5845
 
5824
5846
  // src/services/ProfitCostsServices.ts
5825
- var URI14 = `${API_URL}/accounting/profit-or-cost-center/`;
5826
- var COST_URI7 = `${API_URL}/accounting/cost-center/`;
5847
+ var URI2 = `${API_URL}/accounting/profit-or-cost-center/`;
5848
+ var COST_URI = `${API_URL}/accounting/cost-center/`;
5827
5849
  var CostServices = {
5828
- create: (data) => FetchApi.post(`${COST_URI7}`, data),
5829
- get: (id) => FetchApi.get(`${COST_URI7}${id}/`),
5830
- list: (params) => FetchApi.get(`${COST_URI7}?${new URLSearchParams(params).toString()}`),
5831
- update: (id, data) => FetchApi.put(`${COST_URI7}${id}/`, data),
5832
- delete: (id) => FetchApi.delete(`${COST_URI7}${id}/`)
5850
+ create: (data) => FetchApi.post(`${COST_URI}`, data),
5851
+ get: (id) => FetchApi.get(`${COST_URI}${id}/`),
5852
+ list: (params) => FetchApi.get(`${COST_URI}?${new URLSearchParams(params).toString()}`),
5853
+ update: (id, data) => FetchApi.put(`${COST_URI}${id}/`, data),
5854
+ delete: (id) => FetchApi.delete(`${COST_URI}${id}/`)
5833
5855
  };
5834
- var PROFIT_URI7 = `${API_URL}/accounting/profit-center/`;
5856
+ var PROFIT_URI = `${API_URL}/accounting/profit-center/`;
5835
5857
 
5836
5858
  // src/components/common/CommonSelect.tsx
5837
- import { jsx as jsx38, jsxs as jsxs28 } from "react/jsx-runtime";
5859
+ import { jsx as jsx18, jsxs as jsxs15 } from "react/jsx-runtime";
5838
5860
  var SelectVendor = ({
5839
5861
  value,
5840
5862
  onSelect
5841
5863
  }) => {
5842
- const [showModal, setShowModal] = useState27(false);
5843
- const [selectedVendor, setSelectedVendor] = useState27(null);
5864
+ const [showModal, setShowModal] = useState13(false);
5865
+ const [selectedVendor, setSelectedVendor] = useState13(null);
5844
5866
  const { token, activeBusinessEntity } = useSession();
5845
- const [vendors, setVendors] = useState27(() => {
5867
+ const [vendors, setVendors] = useState13(() => {
5846
5868
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
5847
5869
  const cached = sessionStorage.getItem(cacheKey);
5848
5870
  return cached ? JSON.parse(cached) : [];
5849
5871
  });
5850
- const [loadingVendors, setLoadingVendors] = useState27(false);
5851
- useEffect17(() => {
5872
+ const [loadingVendors, setLoadingVendors] = useState13(false);
5873
+ useEffect10(() => {
5852
5874
  const cacheKey = `vendors_cache_${activeBusinessEntity?.id || "default"}`;
5853
5875
  const cached = sessionStorage.getItem(cacheKey);
5854
5876
  if (!cached) {
@@ -5886,9 +5908,9 @@ var SelectVendor = ({
5886
5908
  sessionStorage.removeItem(cacheKey);
5887
5909
  loadVendors();
5888
5910
  };
5889
- return /* @__PURE__ */ jsxs28("div", { children: [
5890
- /* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
5891
- /* @__PURE__ */ jsx38(
5911
+ return /* @__PURE__ */ jsxs15("div", { children: [
5912
+ /* @__PURE__ */ jsx18("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx18("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "Ajouter un fournisseur" }) }),
5913
+ /* @__PURE__ */ jsx18(
5892
5914
  SearchableSelect,
5893
5915
  {
5894
5916
  value,
@@ -5904,8 +5926,8 @@ var SelectVendor = ({
5904
5926
  },
5905
5927
  "fourni" + value
5906
5928
  ),
5907
- loadingVendors && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
5908
- showModal && /* @__PURE__ */ jsx38(
5929
+ loadingVendors && /* @__PURE__ */ jsx18("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des fournisseurs..." }),
5930
+ showModal && /* @__PURE__ */ jsx18(
5909
5931
  MinimalVendorForm,
5910
5932
  {
5911
5933
  object: selectedVendor,
@@ -5922,13 +5944,13 @@ var SelectUser = ({
5922
5944
  onSelect
5923
5945
  }) => {
5924
5946
  const { token, activeBusinessEntity } = useSession();
5925
- const [users, setUsers] = useState27(() => {
5947
+ const [users, setUsers] = useState13(() => {
5926
5948
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
5927
5949
  const cached = sessionStorage.getItem(cacheKey);
5928
5950
  return cached ? JSON.parse(cached) : [];
5929
5951
  });
5930
- const [loading, setLoading] = useState27(false);
5931
- useEffect17(() => {
5952
+ const [loading, setLoading] = useState13(false);
5953
+ useEffect10(() => {
5932
5954
  const cacheKey = `users_cache_${activeBusinessEntity?.id || "default"}`;
5933
5955
  const cached = sessionStorage.getItem(cacheKey);
5934
5956
  if (!cached) {
@@ -5964,19 +5986,19 @@ var SelectUser = ({
5964
5986
  return users.map((user) => ({
5965
5987
  value: user.id,
5966
5988
  label: `${user.first_name} ${user.last_name}`,
5967
- content: /* @__PURE__ */ jsx38("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs28("div", { className: "flex-1", children: [
5968
- /* @__PURE__ */ jsxs28("div", { className: "font-medium text-gray-900", children: [
5989
+ content: /* @__PURE__ */ jsx18("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs15("div", { className: "flex-1", children: [
5990
+ /* @__PURE__ */ jsxs15("div", { className: "font-medium text-gray-900", children: [
5969
5991
  user.first_name,
5970
5992
  " ",
5971
5993
  user.last_name
5972
5994
  ] }),
5973
- /* @__PURE__ */ jsx38("div", { className: "text-sm text-gray-500", children: user.email })
5995
+ /* @__PURE__ */ jsx18("div", { className: "text-sm text-gray-500", children: user.email })
5974
5996
  ] }) })
5975
5997
  }));
5976
5998
  };
5977
- return /* @__PURE__ */ jsxs28("div", { children: [
5978
- /* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
5979
- /* @__PURE__ */ jsx38(
5999
+ return /* @__PURE__ */ jsxs15("div", { children: [
6000
+ /* @__PURE__ */ jsx18("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx18("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un utilisateur" }) }),
6001
+ /* @__PURE__ */ jsx18(
5980
6002
  SearchableSelect,
5981
6003
  {
5982
6004
  value,
@@ -5989,7 +6011,7 @@ var SelectUser = ({
5989
6011
  },
5990
6012
  "user" + value
5991
6013
  ),
5992
- loading && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
6014
+ loading && /* @__PURE__ */ jsx18("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des utilisateurs..." })
5993
6015
  ] });
5994
6016
  };
5995
6017
  var SelectDepartment = ({
@@ -5997,13 +6019,13 @@ var SelectDepartment = ({
5997
6019
  onSelect
5998
6020
  }) => {
5999
6021
  const { token, activeBusinessEntity } = useSession();
6000
- const [departments, setDepartments] = useState27(() => {
6022
+ const [departments, setDepartments] = useState13(() => {
6001
6023
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
6002
6024
  const cached = sessionStorage.getItem(cacheKey);
6003
6025
  return cached ? JSON.parse(cached) : [];
6004
6026
  });
6005
- const [loading, setLoading] = useState27(false);
6006
- useEffect17(() => {
6027
+ const [loading, setLoading] = useState13(false);
6028
+ useEffect10(() => {
6007
6029
  const cacheKey = `departments_cache_${activeBusinessEntity?.id || "default"}`;
6008
6030
  const cached = sessionStorage.getItem(cacheKey);
6009
6031
  if (!cached) {
@@ -6039,9 +6061,9 @@ var SelectDepartment = ({
6039
6061
  label: dept.name
6040
6062
  }));
6041
6063
  };
6042
- return /* @__PURE__ */ jsxs28("div", { children: [
6043
- /* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
6044
- /* @__PURE__ */ jsx38(
6064
+ return /* @__PURE__ */ jsxs15("div", { children: [
6065
+ /* @__PURE__ */ jsx18("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx18("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un d\xE9partement" }) }),
6066
+ /* @__PURE__ */ jsx18(
6045
6067
  SearchableSelect,
6046
6068
  {
6047
6069
  value,
@@ -6054,7 +6076,7 @@ var SelectDepartment = ({
6054
6076
  },
6055
6077
  "dept" + value
6056
6078
  ),
6057
- loading && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
6079
+ loading && /* @__PURE__ */ jsx18("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des d\xE9partements..." })
6058
6080
  ] });
6059
6081
  };
6060
6082
  var SelectCostCenter = ({
@@ -6062,13 +6084,13 @@ var SelectCostCenter = ({
6062
6084
  onSelect
6063
6085
  }) => {
6064
6086
  const { token, activeBusinessEntity } = useSession();
6065
- const [costCenters, setCostCenters] = useState27(() => {
6087
+ const [costCenters, setCostCenters] = useState13(() => {
6066
6088
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
6067
6089
  const cached = sessionStorage.getItem(cacheKey);
6068
6090
  return cached ? JSON.parse(cached) : [];
6069
6091
  });
6070
- const [loading, setLoading] = useState27(false);
6071
- useEffect17(() => {
6092
+ const [loading, setLoading] = useState13(false);
6093
+ useEffect10(() => {
6072
6094
  const cacheKey = `cost_centers_cache_${activeBusinessEntity?.id || "default"}`;
6073
6095
  const cached = sessionStorage.getItem(cacheKey);
6074
6096
  if (!cached) {
@@ -6102,18 +6124,18 @@ var SelectCostCenter = ({
6102
6124
  return costCenters.map((center) => ({
6103
6125
  value: center.id,
6104
6126
  label: `${center.code ? `[${center.code}] ` : ""}${center.name}`,
6105
- content: /* @__PURE__ */ jsx38("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs28("div", { className: "flex-1", children: [
6106
- /* @__PURE__ */ jsx38("div", { className: "font-medium text-gray-900", children: center.name }),
6107
- center.code && /* @__PURE__ */ jsxs28("div", { className: "text-sm text-gray-500", children: [
6127
+ content: /* @__PURE__ */ jsx18("div", { className: "flex items-center space-x-3", children: /* @__PURE__ */ jsxs15("div", { className: "flex-1", children: [
6128
+ /* @__PURE__ */ jsx18("div", { className: "font-medium text-gray-900", children: center.name }),
6129
+ center.code && /* @__PURE__ */ jsxs15("div", { className: "text-sm text-gray-500", children: [
6108
6130
  "Code: ",
6109
6131
  center.code
6110
6132
  ] })
6111
6133
  ] }) })
6112
6134
  }));
6113
6135
  };
6114
- return /* @__PURE__ */ jsxs28("div", { children: [
6115
- /* @__PURE__ */ jsx38("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx38("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
6116
- /* @__PURE__ */ jsx38(
6136
+ return /* @__PURE__ */ jsxs15("div", { children: [
6137
+ /* @__PURE__ */ jsx18("div", { className: "flex justify-between ", children: /* @__PURE__ */ jsx18("label", { className: "block text-sm font-medium text-gray-700 mb-2", children: "S\xE9lectionner un centre de co\xFBt" }) }),
6138
+ /* @__PURE__ */ jsx18(
6117
6139
  SearchableSelect,
6118
6140
  {
6119
6141
  value,
@@ -6126,12 +6148,12 @@ var SelectCostCenter = ({
6126
6148
  },
6127
6149
  "cost" + value
6128
6150
  ),
6129
- loading && /* @__PURE__ */ jsx38("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
6151
+ loading && /* @__PURE__ */ jsx18("p", { className: "text-sm text-gray-500 mt-2", children: "Chargement des centres de co\xFBt..." })
6130
6152
  ] });
6131
6153
  };
6132
6154
 
6133
6155
  // src/components/common/Choices.tsx
6134
- import { jsx as jsx39 } from "react/jsx-runtime";
6156
+ import { jsx as jsx19 } from "react/jsx-runtime";
6135
6157
  var CHOICES = {
6136
6158
  INVOICE_TYPES: [
6137
6159
  { value: "sale", label: { fr: "Vente", en: "Sale", default: "Sale" } },
@@ -6389,7 +6411,7 @@ var InvoiceTypeSelector = ({
6389
6411
  value: item.value,
6390
6412
  label: item.label[language]
6391
6413
  }));
6392
- return /* @__PURE__ */ jsx39(
6414
+ return /* @__PURE__ */ jsx19(
6393
6415
  SearchableSelect,
6394
6416
  {
6395
6417
  value,
@@ -6412,7 +6434,7 @@ var PaymentMethodSelector = ({
6412
6434
  value: item.value,
6413
6435
  label: item.label[language]
6414
6436
  }));
6415
- return /* @__PURE__ */ jsx39(
6437
+ return /* @__PURE__ */ jsx19(
6416
6438
  SearchableSelect,
6417
6439
  {
6418
6440
  value,
@@ -6435,7 +6457,7 @@ var TemplateFNESelector = ({
6435
6457
  value: item.value,
6436
6458
  label: item.label[language]
6437
6459
  }));
6438
- return /* @__PURE__ */ jsx39(
6460
+ return /* @__PURE__ */ jsx19(
6439
6461
  SearchableSelect,
6440
6462
  {
6441
6463
  value,
@@ -6458,7 +6480,7 @@ var ForeignCurrencySelector = ({
6458
6480
  value: item.value,
6459
6481
  label: item.label[language]
6460
6482
  }));
6461
- return /* @__PURE__ */ jsx39(
6483
+ return /* @__PURE__ */ jsx19(
6462
6484
  SearchableSelect,
6463
6485
  {
6464
6486
  value,
@@ -6482,7 +6504,7 @@ var TaxSelector = ({
6482
6504
  value: item.value,
6483
6505
  label: item.label[language]
6484
6506
  }));
6485
- return /* @__PURE__ */ jsx39(
6507
+ return /* @__PURE__ */ jsx19(
6486
6508
  SearchableSelect,
6487
6509
  {
6488
6510
  value,
@@ -6510,7 +6532,7 @@ var LegalFormSelector = ({
6510
6532
  value: item.value,
6511
6533
  label: item.label[language] ?? item.label.default
6512
6534
  }));
6513
- return /* @__PURE__ */ jsx39(
6535
+ return /* @__PURE__ */ jsx19(
6514
6536
  SearchableSelect,
6515
6537
  {
6516
6538
  value,
@@ -6533,7 +6555,7 @@ var CountrySelector = ({
6533
6555
  value: item.value,
6534
6556
  label: item.label[language]
6535
6557
  }));
6536
- return /* @__PURE__ */ jsx39(
6558
+ return /* @__PURE__ */ jsx19(
6537
6559
  SearchableSelect,
6538
6560
  {
6539
6561
  value,