@rebasepro/core 0.2.3 → 0.2.5

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 (40) hide show
  1. package/dist/components/LoginView/LoginView.d.ts +25 -1
  2. package/dist/components/common/types.d.ts +10 -7
  3. package/dist/components/common/useDebouncedData.d.ts +1 -1
  4. package/dist/core/RebaseProps.d.ts +13 -2
  5. package/dist/core/RebaseRouter.d.ts +1 -1
  6. package/dist/hooks/data/useCollectionFetch.d.ts +12 -1
  7. package/dist/hooks/index.d.ts +0 -1
  8. package/dist/index.es.js +565 -454
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.umd.js +565 -454
  11. package/dist/index.umd.js.map +1 -1
  12. package/dist/util/entity_cache.d.ts +0 -5
  13. package/dist/util/index.d.ts +0 -2
  14. package/dist/util/useStorageUploadController.d.ts +2 -2
  15. package/package.json +6 -6
  16. package/src/components/BootstrapAdminBanner.tsx +12 -3
  17. package/src/components/LoginView/LoginView.tsx +177 -10
  18. package/src/components/UserSettingsView.tsx +95 -2
  19. package/src/components/common/types.tsx +7 -7
  20. package/src/components/common/useDebouncedData.ts +2 -2
  21. package/src/core/Rebase.tsx +3 -2
  22. package/src/core/RebaseProps.tsx +15 -2
  23. package/src/core/RebaseRouter.tsx +1 -1
  24. package/src/hooks/data/useCollectionFetch.tsx +27 -4
  25. package/src/hooks/data/useUserSelector.tsx +1 -1
  26. package/src/hooks/index.tsx +0 -1
  27. package/src/hooks/useResolvedComponent.tsx +4 -3
  28. package/src/locales/en.ts +13 -0
  29. package/src/locales/es.ts +11 -1
  30. package/src/util/entity_cache.ts +1 -27
  31. package/src/util/icon_list.ts +2 -2
  32. package/src/util/index.ts +2 -2
  33. package/src/util/previews.ts +9 -1
  34. package/src/util/useStorageUploadController.tsx +4 -4
  35. package/dist/hooks/useValidateAuthenticator.d.ts +0 -21
  36. package/dist/util/icon_synonyms.d.ts +0 -1
  37. package/dist/util/useTraceUpdate.d.ts +0 -2
  38. package/src/hooks/useValidateAuthenticator.tsx +0 -116
  39. package/src/util/icon_synonyms.ts +0 -1
  40. package/src/util/useTraceUpdate.tsx +0 -24
package/dist/index.es.js CHANGED
@@ -7,8 +7,8 @@ import { EntityRelation, isLazyComponentRef, EntityReference, Vector, GeoPoint }
7
7
  import { useBlocker, useLocation, Link, createBrowserRouter, RouterProvider, Routes } from "react-router-dom";
8
8
  import { stripCollectionPath, canCreateEntity, canEditEntity, canDeleteEntity, canReadCollection, getSubcollections, buildRebaseData, removeInitialAndTrailingSlashes, resolveStorageFilenameString, resolveStoragePathString, isPropertyBuilder, getLabelOrConfigFrom } from "@rebasepro/common";
9
9
  import { mergeDeep, slugify, hashString, isObject, isPlainObject, randomString } from "@rebasepro/utils";
10
- import { deepEqual } from "fast-equals";
11
10
  import { useTranslation as useTranslation$1, initReactI18next, I18nextProvider } from "react-i18next";
11
+ import { deepEqual } from "fast-equals";
12
12
  import i18next from "i18next";
13
13
  import Fuse from "fuse.js";
14
14
  import Compressor from "compressorjs";
@@ -268,13 +268,15 @@ const useData = () => {
268
268
  return useContext(RebaseDataContext);
269
269
  };
270
270
  function useCollectionFetch(t0) {
271
- const $ = c(25);
271
+ const $ = c(30);
272
272
  const {
273
273
  path,
274
274
  collection,
275
275
  filterValues,
276
276
  sortBy,
277
277
  itemCount,
278
+ offset,
279
+ page,
278
280
  searchString
279
281
  } = t0;
280
282
  const dataClient = useData();
@@ -318,8 +320,9 @@ function useCollectionFetch(t0) {
318
320
  const [dataLoading, setDataLoading] = useState(false);
319
321
  const [dataLoadingError, setDataLoadingError] = useState();
320
322
  const [noMoreToLoad, setNoMoreToLoad] = useState(false);
323
+ const [totalCount, setTotalCount] = useState();
321
324
  let t3;
322
- if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== orderByParams || $[7] !== path || $[8] !== searchString || $[9] !== whereParams) {
325
+ if ($[3] !== collection.properties || $[4] !== dataClient || $[5] !== itemCount || $[6] !== offset || $[7] !== orderByParams || $[8] !== page || $[9] !== path || $[10] !== searchString || $[11] !== whereParams) {
323
326
  t3 = () => {
324
327
  setDataLoading(true);
325
328
  const onEntitiesUpdate = async (res) => {
@@ -328,12 +331,14 @@ function useCollectionFetch(t0) {
328
331
  setDataLoadingError(void 0);
329
332
  setData(entities.map(_temp$7));
330
333
  setNoMoreToLoad(!res.meta.hasMore);
334
+ setTotalCount(res.meta.total);
331
335
  };
332
336
  const onError = (error) => {
333
337
  console.error("ERROR", error);
334
338
  setDataLoading(false);
335
339
  setData([]);
336
340
  setDataLoadingError(error);
341
+ setTotalCount(void 0);
337
342
  };
338
343
  const accessor = dataClient.collection(path);
339
344
  const hasRelations = collection.properties && Object.values(collection.properties).some(_temp2$4);
@@ -342,6 +347,8 @@ function useCollectionFetch(t0) {
342
347
  return accessor.listen({
343
348
  where: whereParams,
344
349
  limit: itemCount,
350
+ offset,
351
+ page,
345
352
  orderBy: orderByParams,
346
353
  searchString,
347
354
  include: includeParams
@@ -353,6 +360,8 @@ function useCollectionFetch(t0) {
353
360
  accessor.find({
354
361
  where: whereParams,
355
362
  limit: itemCount,
363
+ offset,
364
+ page,
356
365
  orderBy: orderByParams,
357
366
  searchString,
358
367
  include: includeParams
@@ -366,46 +375,52 @@ function useCollectionFetch(t0) {
366
375
  $[3] = collection.properties;
367
376
  $[4] = dataClient;
368
377
  $[5] = itemCount;
369
- $[6] = orderByParams;
370
- $[7] = path;
371
- $[8] = searchString;
372
- $[9] = whereParams;
373
- $[10] = t3;
378
+ $[6] = offset;
379
+ $[7] = orderByParams;
380
+ $[8] = page;
381
+ $[9] = path;
382
+ $[10] = searchString;
383
+ $[11] = whereParams;
384
+ $[12] = t3;
374
385
  } else {
375
- t3 = $[10];
386
+ t3 = $[12];
376
387
  }
377
388
  let t4;
378
- if ($[11] !== collection || $[12] !== currentSort || $[13] !== dataClient || $[14] !== filterValues || $[15] !== itemCount || $[16] !== path || $[17] !== searchString || $[18] !== sortByProperty) {
379
- t4 = [path, itemCount, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
380
- $[11] = collection;
381
- $[12] = currentSort;
382
- $[13] = dataClient;
383
- $[14] = filterValues;
384
- $[15] = itemCount;
385
- $[16] = path;
386
- $[17] = searchString;
387
- $[18] = sortByProperty;
388
- $[19] = t4;
389
- } else {
390
- t4 = $[19];
389
+ if ($[13] !== collection || $[14] !== currentSort || $[15] !== dataClient || $[16] !== filterValues || $[17] !== itemCount || $[18] !== offset || $[19] !== page || $[20] !== path || $[21] !== searchString || $[22] !== sortByProperty) {
390
+ t4 = [path, itemCount, offset, page, currentSort, sortByProperty, filterValues, searchString, dataClient, collection];
391
+ $[13] = collection;
392
+ $[14] = currentSort;
393
+ $[15] = dataClient;
394
+ $[16] = filterValues;
395
+ $[17] = itemCount;
396
+ $[18] = offset;
397
+ $[19] = page;
398
+ $[20] = path;
399
+ $[21] = searchString;
400
+ $[22] = sortByProperty;
401
+ $[23] = t4;
402
+ } else {
403
+ t4 = $[23];
391
404
  }
392
405
  useEffect(t3, t4);
393
406
  let t5;
394
407
  let t6;
395
- if ($[20] !== data || $[21] !== dataLoading || $[22] !== dataLoadingError || $[23] !== noMoreToLoad) {
408
+ if ($[24] !== data || $[25] !== dataLoading || $[26] !== dataLoadingError || $[27] !== noMoreToLoad || $[28] !== totalCount) {
396
409
  t6 = {
397
410
  data,
398
411
  dataLoading,
399
412
  dataLoadingError,
400
- noMoreToLoad
413
+ noMoreToLoad,
414
+ totalCount
401
415
  };
402
- $[20] = data;
403
- $[21] = dataLoading;
404
- $[22] = dataLoadingError;
405
- $[23] = noMoreToLoad;
406
- $[24] = t6;
416
+ $[24] = data;
417
+ $[25] = dataLoading;
418
+ $[26] = dataLoadingError;
419
+ $[27] = noMoreToLoad;
420
+ $[28] = totalCount;
421
+ $[29] = t6;
407
422
  } else {
408
- t6 = $[24];
423
+ t6 = $[29];
409
424
  }
410
425
  t5 = t6;
411
426
  return t5;
@@ -883,7 +898,7 @@ function useUserSelector({
883
898
  };
884
899
  }, []);
885
900
  const getUser = useCallback((uid) => {
886
- return userManagement?.getUser(uid) ?? null;
901
+ return userManagement?.getUser?.(uid) ?? null;
887
902
  }, [userManagement]);
888
903
  return useMemo(() => ({
889
904
  items,
@@ -1753,128 +1768,6 @@ function useBuildModeController() {
1753
1768
  setMode: setModeInternal
1754
1769
  }), [mode, setModeInternal]);
1755
1770
  }
1756
- function useValidateAuthenticator(t0) {
1757
- const $ = c(17);
1758
- const {
1759
- disabled,
1760
- authController,
1761
- authenticator,
1762
- storageSource,
1763
- data
1764
- } = t0;
1765
- const authenticationEnabled = Boolean(authenticator);
1766
- const [authLoading, setAuthLoading] = useState(authenticationEnabled);
1767
- const [notAllowedError, setNotAllowedError] = useState(false);
1768
- const [authVerified, setAuthVerified] = useState(!authenticationEnabled || Boolean(authController.loginSkipped));
1769
- const canAccessMainView = authVerified && (!authenticationEnabled || Boolean(authController.user) || Boolean(authController.loginSkipped)) && !notAllowedError;
1770
- let t1;
1771
- let t2;
1772
- if ($[0] !== authController.loginSkipped) {
1773
- t1 = () => {
1774
- if (authController.loginSkipped) {
1775
- setAuthVerified(true);
1776
- }
1777
- };
1778
- t2 = [authController.loginSkipped];
1779
- $[0] = authController.loginSkipped;
1780
- $[1] = t1;
1781
- $[2] = t2;
1782
- } else {
1783
- t1 = $[1];
1784
- t2 = $[2];
1785
- }
1786
- useEffect(t1, t2);
1787
- const checkedUserRef = useRef(void 0);
1788
- let t3;
1789
- if ($[3] !== authController || $[4] !== authenticator || $[5] !== data || $[6] !== disabled || $[7] !== storageSource) {
1790
- t3 = async () => {
1791
- if (disabled) {
1792
- return;
1793
- }
1794
- if (authController.initialLoading) {
1795
- return;
1796
- }
1797
- if (!authController.user && !authController.loginSkipped) {
1798
- checkedUserRef.current = void 0;
1799
- setAuthLoading(false);
1800
- setAuthVerified(false);
1801
- return;
1802
- }
1803
- const delegateUser = authController.user;
1804
- if (authenticator instanceof Function && delegateUser && !deepEqual(checkedUserRef.current?.uid, delegateUser.uid)) {
1805
- setAuthLoading(true);
1806
- try {
1807
- const allowed = await authenticator({
1808
- user: delegateUser,
1809
- authController,
1810
- data,
1811
- storageSource
1812
- });
1813
- if (!allowed) {
1814
- authController.signOut();
1815
- setNotAllowedError(true);
1816
- }
1817
- } catch (t42) {
1818
- const e = t42;
1819
- setNotAllowedError(e);
1820
- authController.signOut();
1821
- }
1822
- setAuthLoading(false);
1823
- setAuthVerified(true);
1824
- checkedUserRef.current = delegateUser;
1825
- } else {
1826
- setAuthLoading(false);
1827
- }
1828
- if (!authController.initialLoading && !delegateUser) {
1829
- setAuthVerified(true);
1830
- }
1831
- };
1832
- $[3] = authController;
1833
- $[4] = authenticator;
1834
- $[5] = data;
1835
- $[6] = disabled;
1836
- $[7] = storageSource;
1837
- $[8] = t3;
1838
- } else {
1839
- t3 = $[8];
1840
- }
1841
- const checkAuthentication = t3;
1842
- let t4;
1843
- let t5;
1844
- if ($[9] !== checkAuthentication) {
1845
- t4 = () => {
1846
- checkAuthentication();
1847
- };
1848
- t5 = [checkAuthentication];
1849
- $[9] = checkAuthentication;
1850
- $[10] = t4;
1851
- $[11] = t5;
1852
- } else {
1853
- t4 = $[10];
1854
- t5 = $[11];
1855
- }
1856
- useEffect(t4, t5);
1857
- let t6;
1858
- const t7 = authenticationEnabled && authLoading;
1859
- let t8;
1860
- if ($[12] !== authVerified || $[13] !== canAccessMainView || $[14] !== notAllowedError || $[15] !== t7) {
1861
- t8 = {
1862
- canAccessMainView,
1863
- authLoading: t7,
1864
- notAllowedError,
1865
- authVerified
1866
- };
1867
- $[12] = authVerified;
1868
- $[13] = canAccessMainView;
1869
- $[14] = notAllowedError;
1870
- $[15] = t7;
1871
- $[16] = t8;
1872
- } else {
1873
- t8 = $[16];
1874
- }
1875
- t6 = t8;
1876
- return t6;
1877
- }
1878
1771
  const RegistryDispatchContext = createContext(void 0);
1879
1772
  const RegistryStateContext = createContext({
1880
1773
  cmsConfig: null,
@@ -5638,11 +5531,18 @@ function UserSettingsView() {
5638
5531
  const {
5639
5532
  t
5640
5533
  } = useTranslation();
5534
+ const hasPasswordChange = !!authController.changePassword;
5641
5535
  const [activeTab, setActiveTab] = useState("profile");
5642
5536
  const [displayName, setDisplayName] = useState(user?.displayName || "");
5643
5537
  const [photoURL, setPhotoURL] = useState(user?.photoURL || "");
5644
5538
  const [savingProfile, setSavingProfile] = useState(false);
5645
5539
  const [profileError, setProfileError] = useState(null);
5540
+ const [currentPassword, setCurrentPassword] = useState("");
5541
+ const [newPassword, setNewPassword] = useState("");
5542
+ const [confirmPassword, setConfirmPassword] = useState("");
5543
+ const [changingPassword, setChangingPassword] = useState(false);
5544
+ const [passwordError, setPasswordError] = useState(null);
5545
+ const [passwordSuccess, setPasswordSuccess] = useState(null);
5646
5546
  const [sessions, setSessions] = useState([]);
5647
5547
  const [loadingSessions, setLoadingSessions] = useState(false);
5648
5548
  const [sessionsError, setSessionsError] = useState(null);
@@ -5670,6 +5570,35 @@ function UserSettingsView() {
5670
5570
  setSavingProfile(false);
5671
5571
  }
5672
5572
  };
5573
+ const handleChangePassword = async () => {
5574
+ setPasswordError(null);
5575
+ setPasswordSuccess(null);
5576
+ if (newPassword.length < 8) {
5577
+ setPasswordError(t("password_too_short"));
5578
+ return;
5579
+ }
5580
+ if (newPassword !== confirmPassword) {
5581
+ setPasswordError(t("passwords_dont_match"));
5582
+ return;
5583
+ }
5584
+ setChangingPassword(true);
5585
+ try {
5586
+ if (authController.changePassword) {
5587
+ await authController.changePassword(currentPassword, newPassword);
5588
+ setPasswordSuccess(t("password_changed"));
5589
+ setCurrentPassword("");
5590
+ setNewPassword("");
5591
+ setConfirmPassword("");
5592
+ setTimeout(() => {
5593
+ authController.signOut();
5594
+ }, 2e3);
5595
+ }
5596
+ } catch (e_0) {
5597
+ setPasswordError(e_0 instanceof Error ? e_0.message : String(e_0));
5598
+ } finally {
5599
+ setChangingPassword(false);
5600
+ }
5601
+ };
5673
5602
  const loadSessions = async () => {
5674
5603
  setLoadingSessions(true);
5675
5604
  setSessionsError(null);
@@ -5681,8 +5610,8 @@ function UserSettingsView() {
5681
5610
  } else {
5682
5611
  throw new Error("fetchSessions not implemented in this auth controller.");
5683
5612
  }
5684
- } catch (e_0) {
5685
- setSessionsError(e_0 instanceof Error ? e_0.message : String(e_0));
5613
+ } catch (e_1) {
5614
+ setSessionsError(e_1 instanceof Error ? e_1.message : String(e_1));
5686
5615
  } finally {
5687
5616
  setLoadingSessions(false);
5688
5617
  }
@@ -5699,8 +5628,8 @@ function UserSettingsView() {
5699
5628
  } else {
5700
5629
  throw new Error("revokeSession not implemented in this auth controller.");
5701
5630
  }
5702
- } catch (e_1) {
5703
- setSessionsError(e_1 instanceof Error ? e_1.message : String(e_1));
5631
+ } catch (e_2) {
5632
+ setSessionsError(e_2 instanceof Error ? e_2.message : String(e_2));
5704
5633
  } finally {
5705
5634
  setRevokingSessionId(null);
5706
5635
  }
@@ -5713,8 +5642,8 @@ function UserSettingsView() {
5713
5642
  } else {
5714
5643
  throw new Error("revokeAllSessions not implemented in this auth controller.");
5715
5644
  }
5716
- } catch (e_2) {
5717
- setSessionsError(e_2 instanceof Error ? e_2.message : String(e_2));
5645
+ } catch (e_3) {
5646
+ setSessionsError(e_3 instanceof Error ? e_3.message : String(e_3));
5718
5647
  } finally {
5719
5648
  setRevokingAll(false);
5720
5649
  }
@@ -5724,15 +5653,25 @@ function UserSettingsView() {
5724
5653
  /* @__PURE__ */ jsx(Typography, { variant: "h4", className: "mb-8", children: t("account_settings") }),
5725
5654
  /* @__PURE__ */ jsxs(Tabs, { value: activeTab, onValueChange: (v) => setActiveTab(v), className: "mb-8", children: [
5726
5655
  /* @__PURE__ */ jsx(Tab, { value: "profile", children: t("profile") }),
5656
+ hasPasswordChange && /* @__PURE__ */ jsx(Tab, { value: "security", children: t("security") }),
5727
5657
  /* @__PURE__ */ jsx(Tab, { value: "sessions", children: t("sessions") })
5728
5658
  ] }),
5729
5659
  activeTab === "profile" && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 max-w-xl", children: [
5730
5660
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-6 mb-2", children: /* @__PURE__ */ jsx(Avatar, { src: photoURL || void 0, className: "w-24 h-24 text-3xl", children: displayName ? displayName[0].toUpperCase() : user.email ? user.email[0].toUpperCase() : "A" }) }),
5731
- /* @__PURE__ */ jsx(TextField, { label: t("display_name"), value: displayName, onChange: (e_3) => setDisplayName(e_3.target.value) }),
5732
- /* @__PURE__ */ jsx(TextField, { label: t("photo_url"), value: photoURL, onChange: (e_4) => setPhotoURL(e_4.target.value) }),
5661
+ /* @__PURE__ */ jsx(TextField, { label: t("display_name"), value: displayName, onChange: (e_4) => setDisplayName(e_4.target.value) }),
5662
+ /* @__PURE__ */ jsx(TextField, { label: t("photo_url"), value: photoURL, onChange: (e_5) => setPhotoURL(e_5.target.value) }),
5733
5663
  profileError && /* @__PURE__ */ jsx(Typography, { color: "error", children: profileError }),
5734
5664
  /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: handleSaveProfile, disabled: savingProfile, children: savingProfile ? t("saving") : t("save_profile") }) })
5735
5665
  ] }),
5666
+ activeTab === "security" && hasPasswordChange && /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 max-w-xl", children: [
5667
+ /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-2", children: t("change_password") }),
5668
+ /* @__PURE__ */ jsx(TextField, { label: t("current_password"), type: "password", value: currentPassword, onChange: (e_6) => setCurrentPassword(e_6.target.value), autoComplete: "current-password" }),
5669
+ /* @__PURE__ */ jsx(TextField, { label: t("new_password"), type: "password", value: newPassword, onChange: (e_7) => setNewPassword(e_7.target.value), autoComplete: "new-password" }),
5670
+ /* @__PURE__ */ jsx(TextField, { label: t("confirm_password"), type: "password", value: confirmPassword, onChange: (e_8) => setConfirmPassword(e_8.target.value), autoComplete: "new-password" }),
5671
+ passwordError && /* @__PURE__ */ jsx(Typography, { color: "error", children: passwordError }),
5672
+ passwordSuccess && /* @__PURE__ */ jsx(Typography, { className: "text-emerald-600 dark:text-emerald-400", children: passwordSuccess }),
5673
+ /* @__PURE__ */ jsx("div", { className: "mt-4", children: /* @__PURE__ */ jsx(Button, { variant: "filled", onClick: handleChangePassword, disabled: changingPassword || !currentPassword || !newPassword || !confirmPassword, children: changingPassword ? t("changing_password") : t("change_password") }) })
5674
+ ] }),
5736
5675
  activeTab === "sessions" && /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 max-w-3xl", children: loadingSessions ? /* @__PURE__ */ jsx("div", { className: "flex justify-center p-8", children: /* @__PURE__ */ jsx(CircularProgress, {}) }) : sessionsError ? /* @__PURE__ */ jsx(Typography, { color: "error", children: sessionsError }) : sessions.length === 0 ? /* @__PURE__ */ jsx(Typography, { children: t("no_active_sessions") }) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
5737
5676
  /* @__PURE__ */ jsx("div", { className: "flex justify-end mb-2", children: /* @__PURE__ */ jsx(Button, { variant: "text", color: "error", onClick: handleRevokeAll, disabled: revokingAll, children: revokingAll ? t("revoking") : t("revoke_all_sessions") }) }),
5738
5677
  sessions.map((session) => /* @__PURE__ */ jsxs("div", { className: "flex justify-between items-center p-4 bg-white dark:bg-surface-950 border rounded-lg dark:border-surface-700 shadow-sm", children: [
@@ -6431,7 +6370,7 @@ function UserDisplay(t0) {
6431
6370
  return t8;
6432
6371
  }
6433
6372
  function LoginView(t0) {
6434
- const $ = c(87);
6373
+ const $ = c(111);
6435
6374
  const {
6436
6375
  logo,
6437
6376
  authController,
@@ -6440,8 +6379,15 @@ function LoginView(t0) {
6440
6379
  disabled: t2,
6441
6380
  notAllowedError,
6442
6381
  googleClientId,
6382
+ githubClientId,
6383
+ linkedinClientId,
6384
+ title,
6385
+ subtitle,
6443
6386
  needsSetup,
6444
- registrationEnabled
6387
+ registrationEnabled,
6388
+ additionalComponent,
6389
+ defaultEmail,
6390
+ defaultPassword
6445
6391
  } = t0;
6446
6392
  const disableSignupScreen = t1 === void 0 ? false : t1;
6447
6393
  const disabled = t2 === void 0 ? false : t2;
@@ -6492,26 +6438,76 @@ function LoginView(t0) {
6492
6438
  t5 = $[6];
6493
6439
  }
6494
6440
  const hasGoogleLogin = t5;
6495
- const hasPasswordReset = caps.passwordReset ?? !!authController.forgotPassword;
6496
- const showRegistration = !disableSignupScreen && canRegister;
6497
6441
  let t6;
6442
+ if ($[7] !== caps.enabledProviders || $[8] !== githubClientId) {
6443
+ t6 = githubClientId && (caps.enabledProviders?.includes("github") ?? false);
6444
+ $[7] = caps.enabledProviders;
6445
+ $[8] = githubClientId;
6446
+ $[9] = t6;
6447
+ } else {
6448
+ t6 = $[9];
6449
+ }
6450
+ const hasGitHubLogin = t6;
6498
6451
  let t7;
6499
- if ($[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6500
- t6 = () => {
6452
+ if ($[10] !== caps.enabledProviders || $[11] !== linkedinClientId) {
6453
+ t7 = linkedinClientId && (caps.enabledProviders?.includes("linkedin") ?? false);
6454
+ $[10] = caps.enabledProviders;
6455
+ $[11] = linkedinClientId;
6456
+ $[12] = t7;
6457
+ } else {
6458
+ t7 = $[12];
6459
+ }
6460
+ const hasLinkedinLogin = t7;
6461
+ const hasPasswordReset = caps.passwordReset ?? !!authController.forgotPassword;
6462
+ const showRegistration = !disableSignupScreen && canRegister;
6463
+ let t8;
6464
+ let t9;
6465
+ if ($[13] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6466
+ t8 = () => {
6501
6467
  const timer = setTimeout(() => setFadeIn(true), 50);
6502
6468
  return () => clearTimeout(timer);
6503
6469
  };
6504
- t7 = [];
6505
- $[7] = t6;
6506
- $[8] = t7;
6470
+ t9 = [];
6471
+ $[13] = t8;
6472
+ $[14] = t9;
6507
6473
  } else {
6508
- t6 = $[7];
6509
- t7 = $[8];
6474
+ t8 = $[13];
6475
+ t9 = $[14];
6510
6476
  }
6511
- useEffect(t6, t7);
6512
- let t8;
6513
- if ($[9] !== authController.authProviderError || $[10] !== authController.user) {
6514
- t8 = function buildErrorView2() {
6477
+ useEffect(t8, t9);
6478
+ let t10;
6479
+ let t11;
6480
+ if ($[15] !== authController) {
6481
+ t10 = () => {
6482
+ const params = new URLSearchParams(window.location.search);
6483
+ const code = params.get("code");
6484
+ const provider = localStorage.getItem("rebase_oauth_provider");
6485
+ if (code && provider) {
6486
+ localStorage.removeItem("rebase_oauth_provider");
6487
+ const cleanUrl = window.location.origin + window.location.pathname;
6488
+ window.history.replaceState({}, document.title, cleanUrl);
6489
+ if (authController.oauthLogin) {
6490
+ authController.oauthLogin(provider, {
6491
+ code,
6492
+ redirectUri: cleanUrl
6493
+ }).catch((err) => {
6494
+ console.error(`${provider} login failed:`, err);
6495
+ });
6496
+ }
6497
+ }
6498
+ };
6499
+ t11 = [authController];
6500
+ $[15] = authController;
6501
+ $[16] = t10;
6502
+ $[17] = t11;
6503
+ } else {
6504
+ t10 = $[16];
6505
+ t11 = $[17];
6506
+ }
6507
+ useEffect(t10, t11);
6508
+ let t12;
6509
+ if ($[18] !== authController.authProviderError || $[19] !== authController.user) {
6510
+ t12 = function buildErrorView2() {
6515
6511
  if (!authController.authProviderError) {
6516
6512
  return null;
6517
6513
  }
@@ -6521,44 +6517,44 @@ function LoginView(t0) {
6521
6517
  const errorMsg = authController.authProviderError instanceof Error ? authController.authProviderError.message : String(authController.authProviderError);
6522
6518
  return /* @__PURE__ */ jsx("div", { className: "w-full", children: /* @__PURE__ */ jsx(ErrorView, { error: errorMsg }) });
6523
6519
  };
6524
- $[9] = authController.authProviderError;
6525
- $[10] = authController.user;
6526
- $[11] = t8;
6520
+ $[18] = authController.authProviderError;
6521
+ $[19] = authController.user;
6522
+ $[20] = t12;
6527
6523
  } else {
6528
- t8 = $[11];
6524
+ t12 = $[20];
6529
6525
  }
6530
- const buildErrorView = t8;
6526
+ const buildErrorView = t12;
6531
6527
  let logoComponent;
6532
6528
  if (logo) {
6533
- let t92;
6534
- if ($[12] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6535
- t92 = {
6529
+ let t132;
6530
+ if ($[21] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6531
+ t132 = {
6536
6532
  height: "100%",
6537
6533
  width: "100%",
6538
6534
  objectFit: "cover"
6539
6535
  };
6540
- $[12] = t92;
6536
+ $[21] = t132;
6541
6537
  } else {
6542
- t92 = $[12];
6538
+ t132 = $[21];
6543
6539
  }
6544
- let t102;
6545
- if ($[13] !== logo) {
6546
- t102 = /* @__PURE__ */ jsx("img", { src: logo, style: t92, alt: "Logo" });
6547
- $[13] = logo;
6548
- $[14] = t102;
6540
+ let t142;
6541
+ if ($[22] !== logo) {
6542
+ t142 = /* @__PURE__ */ jsx("img", { src: logo, style: t132, alt: "Logo" });
6543
+ $[22] = logo;
6544
+ $[23] = t142;
6549
6545
  } else {
6550
- t102 = $[14];
6546
+ t142 = $[23];
6551
6547
  }
6552
- logoComponent = t102;
6548
+ logoComponent = t142;
6553
6549
  } else {
6554
- let t92;
6555
- if ($[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6556
- t92 = /* @__PURE__ */ jsx(RebaseLogo, {});
6557
- $[15] = t92;
6550
+ let t132;
6551
+ if ($[24] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6552
+ t132 = /* @__PURE__ */ jsx(RebaseLogo, {});
6553
+ $[24] = t132;
6558
6554
  } else {
6559
- t92 = $[15];
6555
+ t132 = $[24];
6560
6556
  }
6561
- logoComponent = t92;
6557
+ logoComponent = t132;
6562
6558
  }
6563
6559
  let notAllowedMessage;
6564
6560
  if (notAllowedError) {
@@ -6568,277 +6564,316 @@ function LoginView(t0) {
6568
6564
  if (notAllowedError instanceof Error) {
6569
6565
  notAllowedMessage = notAllowedError.message;
6570
6566
  } else {
6571
- notAllowedMessage = "It looks like you don't have access, based on the specified Authenticator configuration";
6567
+ notAllowedMessage = "It looks like you don't have access, based on the specified access configuration";
6572
6568
  }
6573
6569
  }
6574
6570
  }
6575
- const t9 = fadeIn ? "opacity-100" : "opacity-0";
6576
- let t10;
6577
- if ($[16] !== t9) {
6578
- t10 = cls("relative flex items-center justify-center h-screen w-screen p-4 transition-opacity duration-500 bg-surface-50 dark:bg-surface-800", t9);
6579
- $[16] = t9;
6580
- $[17] = t10;
6581
- } else {
6582
- t10 = $[17];
6583
- }
6584
- let t11;
6585
- if ($[18] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6586
- t11 = /* @__PURE__ */ jsx(LanguageToggle, {});
6587
- $[18] = t11;
6588
- } else {
6589
- t11 = $[18];
6590
- }
6591
- let t12;
6592
- if ($[19] !== colorMode) {
6593
- t12 = /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Toggle theme", children: colorMode === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.small }) : /* @__PURE__ */ jsx(SunIcon, { size: iconSize.small }) });
6594
- $[19] = colorMode;
6595
- $[20] = t12;
6596
- } else {
6597
- t12 = $[20];
6598
- }
6599
- let t13;
6600
- if ($[21] !== setColorMode) {
6601
- t13 = () => setColorMode("dark");
6602
- $[21] = setColorMode;
6603
- $[22] = t13;
6604
- } else {
6605
- t13 = $[22];
6606
- }
6571
+ const t13 = fadeIn ? "opacity-100" : "opacity-0";
6607
6572
  let t14;
6608
- if ($[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6609
- t14 = /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.smallest });
6610
- $[23] = t14;
6573
+ if ($[25] !== t13) {
6574
+ t14 = cls("relative flex items-center justify-center h-screen w-screen p-4 transition-opacity duration-500 bg-surface-50 dark:bg-surface-950 overflow-hidden", t13);
6575
+ $[25] = t13;
6576
+ $[26] = t14;
6611
6577
  } else {
6612
- t14 = $[23];
6578
+ t14 = $[26];
6613
6579
  }
6614
6580
  let t15;
6615
- if ($[24] !== t) {
6616
- t15 = t("dark_mode");
6617
- $[24] = t;
6618
- $[25] = t15;
6619
- } else {
6620
- t15 = $[25];
6621
- }
6622
6581
  let t16;
6623
- if ($[26] !== t13 || $[27] !== t15) {
6624
- t16 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t13, children: [
6625
- t14,
6626
- " ",
6627
- t15
6628
- ] });
6629
- $[26] = t13;
6582
+ if ($[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6583
+ t15 = /* @__PURE__ */ jsx("div", { className: "absolute top-[-10%] left-[-10%] w-[50%] h-[50%] rounded-full bg-primary-500/10 blur-[120px] pointer-events-none" });
6584
+ t16 = /* @__PURE__ */ jsx("div", { className: "absolute bottom-[-10%] right-[-10%] w-[50%] h-[50%] rounded-full bg-indigo-500/10 blur-[120px] pointer-events-none" });
6630
6585
  $[27] = t15;
6631
6586
  $[28] = t16;
6632
6587
  } else {
6588
+ t15 = $[27];
6633
6589
  t16 = $[28];
6634
6590
  }
6635
6591
  let t17;
6636
- if ($[29] !== setColorMode) {
6637
- t17 = () => setColorMode("light");
6638
- $[29] = setColorMode;
6639
- $[30] = t17;
6592
+ if ($[29] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6593
+ t17 = /* @__PURE__ */ jsx(LanguageToggle, {});
6594
+ $[29] = t17;
6640
6595
  } else {
6641
- t17 = $[30];
6596
+ t17 = $[29];
6642
6597
  }
6643
6598
  let t18;
6644
- if ($[31] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6645
- t18 = /* @__PURE__ */ jsx(SunIcon, { size: iconSize.smallest });
6599
+ if ($[30] !== colorMode) {
6600
+ t18 = /* @__PURE__ */ jsx(IconButton, { color: "inherit", "aria-label": "Toggle theme", children: colorMode === "dark" ? /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.small }) : /* @__PURE__ */ jsx(SunIcon, { size: iconSize.small }) });
6601
+ $[30] = colorMode;
6646
6602
  $[31] = t18;
6647
6603
  } else {
6648
6604
  t18 = $[31];
6649
6605
  }
6650
6606
  let t19;
6651
- if ($[32] !== t) {
6652
- t19 = t("light_mode");
6653
- $[32] = t;
6607
+ if ($[32] !== setColorMode) {
6608
+ t19 = () => setColorMode("dark");
6609
+ $[32] = setColorMode;
6654
6610
  $[33] = t19;
6655
6611
  } else {
6656
6612
  t19 = $[33];
6657
6613
  }
6658
6614
  let t20;
6659
- if ($[34] !== t17 || $[35] !== t19) {
6660
- t20 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t17, children: [
6661
- t18,
6662
- " ",
6663
- t19
6664
- ] });
6665
- $[34] = t17;
6666
- $[35] = t19;
6667
- $[36] = t20;
6615
+ if ($[34] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6616
+ t20 = /* @__PURE__ */ jsx(MoonIcon, { size: iconSize.smallest });
6617
+ $[34] = t20;
6668
6618
  } else {
6669
- t20 = $[36];
6619
+ t20 = $[34];
6670
6620
  }
6671
6621
  let t21;
6672
- if ($[37] !== setColorMode) {
6673
- t21 = () => setColorMode("system");
6674
- $[37] = setColorMode;
6675
- $[38] = t21;
6622
+ if ($[35] !== t) {
6623
+ t21 = t("dark_mode");
6624
+ $[35] = t;
6625
+ $[36] = t21;
6676
6626
  } else {
6677
- t21 = $[38];
6627
+ t21 = $[36];
6678
6628
  }
6679
6629
  let t22;
6680
- if ($[39] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6681
- t22 = /* @__PURE__ */ jsx(SunMoonIcon, { size: iconSize.smallest });
6630
+ if ($[37] !== t19 || $[38] !== t21) {
6631
+ t22 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t19, children: [
6632
+ t20,
6633
+ " ",
6634
+ t21
6635
+ ] });
6636
+ $[37] = t19;
6637
+ $[38] = t21;
6682
6638
  $[39] = t22;
6683
6639
  } else {
6684
6640
  t22 = $[39];
6685
6641
  }
6686
6642
  let t23;
6687
- if ($[40] !== t) {
6688
- t23 = t("system_mode");
6689
- $[40] = t;
6643
+ if ($[40] !== setColorMode) {
6644
+ t23 = () => setColorMode("light");
6645
+ $[40] = setColorMode;
6690
6646
  $[41] = t23;
6691
6647
  } else {
6692
6648
  t23 = $[41];
6693
6649
  }
6694
6650
  let t24;
6695
- if ($[42] !== t21 || $[43] !== t23) {
6696
- t24 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t21, children: [
6697
- t22,
6698
- " ",
6699
- t23
6700
- ] });
6701
- $[42] = t21;
6702
- $[43] = t23;
6703
- $[44] = t24;
6651
+ if ($[42] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6652
+ t24 = /* @__PURE__ */ jsx(SunIcon, { size: iconSize.smallest });
6653
+ $[42] = t24;
6704
6654
  } else {
6705
- t24 = $[44];
6655
+ t24 = $[42];
6706
6656
  }
6707
6657
  let t25;
6708
- if ($[45] !== t12 || $[46] !== t16 || $[47] !== t20 || $[48] !== t24) {
6709
- t25 = /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex items-center gap-1 z-10", children: [
6710
- t11,
6711
- /* @__PURE__ */ jsxs(Menu, { trigger: t12, children: [
6712
- t16,
6713
- t20,
6714
- t24
6715
- ] })
6716
- ] });
6717
- $[45] = t12;
6718
- $[46] = t16;
6719
- $[47] = t20;
6720
- $[48] = t24;
6721
- $[49] = t25;
6658
+ if ($[43] !== t) {
6659
+ t25 = t("light_mode");
6660
+ $[43] = t;
6661
+ $[44] = t25;
6722
6662
  } else {
6723
- t25 = $[49];
6663
+ t25 = $[44];
6724
6664
  }
6725
6665
  let t26;
6726
- if ($[50] !== logoComponent) {
6727
- t26 = /* @__PURE__ */ jsx("div", { className: "w-32 h-32 m-2 mb-6", children: logoComponent });
6728
- $[50] = logoComponent;
6729
- $[51] = t26;
6666
+ if ($[45] !== t23 || $[46] !== t25) {
6667
+ t26 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t23, children: [
6668
+ t24,
6669
+ " ",
6670
+ t25
6671
+ ] });
6672
+ $[45] = t23;
6673
+ $[46] = t25;
6674
+ $[47] = t26;
6730
6675
  } else {
6731
- t26 = $[51];
6676
+ t26 = $[47];
6732
6677
  }
6733
6678
  let t27;
6734
- if ($[52] !== notAllowedMessage) {
6735
- t27 = notAllowedMessage && /* @__PURE__ */ jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsx(ErrorView, { error: notAllowedMessage }) });
6736
- $[52] = notAllowedMessage;
6737
- $[53] = t27;
6679
+ if ($[48] !== setColorMode) {
6680
+ t27 = () => setColorMode("system");
6681
+ $[48] = setColorMode;
6682
+ $[49] = t27;
6738
6683
  } else {
6739
- t27 = $[53];
6684
+ t27 = $[49];
6740
6685
  }
6741
6686
  let t28;
6742
- if ($[54] !== buildErrorView || $[55] !== mode) {
6743
- t28 = mode !== "forgot" && buildErrorView();
6744
- $[54] = buildErrorView;
6745
- $[55] = mode;
6746
- $[56] = t28;
6687
+ if ($[50] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
6688
+ t28 = /* @__PURE__ */ jsx(SunMoonIcon, { size: iconSize.smallest });
6689
+ $[50] = t28;
6747
6690
  } else {
6748
- t28 = $[56];
6691
+ t28 = $[50];
6692
+ }
6693
+ let t29;
6694
+ if ($[51] !== t) {
6695
+ t29 = t("system_mode");
6696
+ $[51] = t;
6697
+ $[52] = t29;
6698
+ } else {
6699
+ t29 = $[52];
6749
6700
  }
6750
- const t29 = viewVisible ? "opacity-100" : "opacity-0";
6751
6701
  let t30;
6752
- if ($[57] !== t29) {
6753
- t30 = cls("w-full transition-opacity duration-150", t29);
6754
- $[57] = t29;
6755
- $[58] = t30;
6702
+ if ($[53] !== t27 || $[54] !== t29) {
6703
+ t30 = /* @__PURE__ */ jsxs(MenuItem, { onClick: t27, children: [
6704
+ t28,
6705
+ " ",
6706
+ t29
6707
+ ] });
6708
+ $[53] = t27;
6709
+ $[54] = t29;
6710
+ $[55] = t30;
6756
6711
  } else {
6757
- t30 = $[58];
6712
+ t30 = $[55];
6758
6713
  }
6759
6714
  let t31;
6760
- if ($[59] !== authController || $[60] !== isBootstrapMode || $[61] !== noUserComponent) {
6761
- t31 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true });
6762
- $[59] = authController;
6763
- $[60] = isBootstrapMode;
6764
- $[61] = noUserComponent;
6765
- $[62] = t31;
6715
+ if ($[56] !== t18 || $[57] !== t22 || $[58] !== t26 || $[59] !== t30) {
6716
+ t31 = /* @__PURE__ */ jsxs("div", { className: "absolute top-4 right-4 flex items-center gap-1 z-10", children: [
6717
+ t17,
6718
+ /* @__PURE__ */ jsxs(Menu, { trigger: t18, children: [
6719
+ t22,
6720
+ t26,
6721
+ t30
6722
+ ] })
6723
+ ] });
6724
+ $[56] = t18;
6725
+ $[57] = t22;
6726
+ $[58] = t26;
6727
+ $[59] = t30;
6728
+ $[60] = t31;
6766
6729
  } else {
6767
- t31 = $[62];
6730
+ t31 = $[60];
6768
6731
  }
6769
6732
  let t32;
6770
- if ($[63] !== authController || $[64] !== disableSignupScreen || $[65] !== disabled || $[66] !== googleClientId || $[67] !== hasGoogleLogin || $[68] !== hasPasswordReset || $[69] !== isBootstrapMode || $[70] !== mode || $[71] !== noUserComponent || $[72] !== showRegistration) {
6771
- t32 = !isBootstrapMode && /* @__PURE__ */ jsxs(Fragment, { children: [
6733
+ if ($[61] !== logoComponent) {
6734
+ t32 = /* @__PURE__ */ jsx("div", { className: "w-24 h-24 m-2 mb-4 drop-shadow-md", children: logoComponent });
6735
+ $[61] = logoComponent;
6736
+ $[62] = t32;
6737
+ } else {
6738
+ t32 = $[62];
6739
+ }
6740
+ let t33;
6741
+ if ($[63] !== notAllowedMessage) {
6742
+ t33 = notAllowedMessage && /* @__PURE__ */ jsx("div", { className: "p-4 w-full", children: /* @__PURE__ */ jsx(ErrorView, { error: notAllowedMessage }) });
6743
+ $[63] = notAllowedMessage;
6744
+ $[64] = t33;
6745
+ } else {
6746
+ t33 = $[64];
6747
+ }
6748
+ let t34;
6749
+ if ($[65] !== buildErrorView || $[66] !== mode) {
6750
+ t34 = mode !== "forgot" && buildErrorView();
6751
+ $[65] = buildErrorView;
6752
+ $[66] = mode;
6753
+ $[67] = t34;
6754
+ } else {
6755
+ t34 = $[67];
6756
+ }
6757
+ const t35 = viewVisible ? "opacity-100" : "opacity-0";
6758
+ let t36;
6759
+ if ($[68] !== t35) {
6760
+ t36 = cls("w-full transition-opacity duration-150", t35);
6761
+ $[68] = t35;
6762
+ $[69] = t36;
6763
+ } else {
6764
+ t36 = $[69];
6765
+ }
6766
+ let t37;
6767
+ if ($[70] !== authController || $[71] !== defaultEmail || $[72] !== defaultPassword || $[73] !== isBootstrapMode || $[74] !== noUserComponent) {
6768
+ t37 = isBootstrapMode && !authController.user && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: _temp, onForgotPassword: _temp2, noUserComponent, disableSignupScreen: false, bootstrapMode: true, defaultEmail, defaultPassword });
6769
+ $[70] = authController;
6770
+ $[71] = defaultEmail;
6771
+ $[72] = defaultPassword;
6772
+ $[73] = isBootstrapMode;
6773
+ $[74] = noUserComponent;
6774
+ $[75] = t37;
6775
+ } else {
6776
+ t37 = $[75];
6777
+ }
6778
+ let t38;
6779
+ if ($[76] !== authController || $[77] !== defaultEmail || $[78] !== defaultPassword || $[79] !== disableSignupScreen || $[80] !== disabled || $[81] !== githubClientId || $[82] !== googleClientId || $[83] !== hasGitHubLogin || $[84] !== hasGoogleLogin || $[85] !== hasLinkedinLogin || $[86] !== hasPasswordReset || $[87] !== isBootstrapMode || $[88] !== linkedinClientId || $[89] !== mode || $[90] !== noUserComponent || $[91] !== showRegistration || $[92] !== subtitle || $[93] !== title) {
6780
+ t38 = !isBootstrapMode && /* @__PURE__ */ jsxs(Fragment, { children: [
6772
6781
  mode === "buttons" && /* @__PURE__ */ jsxs("div", { className: "w-full flex flex-col gap-3 mt-2", children: [
6782
+ (title || subtitle) && /* @__PURE__ */ jsxs("div", { className: "text-center mb-2", children: [
6783
+ title && /* @__PURE__ */ jsx(Typography, { variant: "h6", className: "mb-0.5 font-bold", children: title }),
6784
+ subtitle && /* @__PURE__ */ jsx(Typography, { variant: "body2", color: "secondary", className: "mb-4", children: subtitle })
6785
+ ] }),
6773
6786
  /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Sign in with email", icon: /* @__PURE__ */ jsx(MailIcon, {}), onClick: () => switchMode("login") }),
6774
6787
  hasGoogleLogin && googleClientId && /* @__PURE__ */ jsx(GoogleLoginButton, { disabled, googleClientId, authController }),
6788
+ hasGitHubLogin && githubClientId && /* @__PURE__ */ jsx(GitHubLoginButton, { disabled, githubClientId }),
6789
+ hasLinkedinLogin && linkedinClientId && /* @__PURE__ */ jsx(LinkedInLoginButton, { disabled, linkedinClientId }),
6775
6790
  showRegistration && /* @__PURE__ */ jsx("div", { className: "mt-2 text-center", children: /* @__PURE__ */ jsxs(Typography, { variant: "body2", color: "secondary", children: [
6776
6791
  "Don't have an account?",
6777
6792
  " ",
6778
6793
  /* @__PURE__ */ jsx("button", { type: "button", className: "font-semibold hover:underline cursor-pointer text-primary-600 dark:text-primary-400", onClick: () => switchMode("register"), children: "Create one" })
6779
6794
  ] }) })
6780
6795
  ] }),
6781
- mode === "login" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0 }),
6782
- mode === "register" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login") }),
6796
+ mode === "login" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: false, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToRegister: showRegistration ? () => switchMode("register") : void 0, defaultEmail, defaultPassword }),
6797
+ mode === "register" && /* @__PURE__ */ jsx(LoginForm, { authController, registrationMode: true, onClose: () => switchMode("buttons"), onForgotPassword: hasPasswordReset ? () => switchMode("forgot") : void 0, noUserComponent, disableSignupScreen, switchToLogin: () => switchMode("login"), defaultEmail, defaultPassword }),
6783
6798
  mode === "forgot" && authController.forgotPassword && /* @__PURE__ */ jsx(ForgotPasswordForm, { authController, onClose: () => switchMode("login") })
6784
6799
  ] });
6785
- $[63] = authController;
6786
- $[64] = disableSignupScreen;
6787
- $[65] = disabled;
6788
- $[66] = googleClientId;
6789
- $[67] = hasGoogleLogin;
6790
- $[68] = hasPasswordReset;
6791
- $[69] = isBootstrapMode;
6792
- $[70] = mode;
6793
- $[71] = noUserComponent;
6794
- $[72] = showRegistration;
6795
- $[73] = t32;
6796
- } else {
6797
- t32 = $[73];
6800
+ $[76] = authController;
6801
+ $[77] = defaultEmail;
6802
+ $[78] = defaultPassword;
6803
+ $[79] = disableSignupScreen;
6804
+ $[80] = disabled;
6805
+ $[81] = githubClientId;
6806
+ $[82] = googleClientId;
6807
+ $[83] = hasGitHubLogin;
6808
+ $[84] = hasGoogleLogin;
6809
+ $[85] = hasLinkedinLogin;
6810
+ $[86] = hasPasswordReset;
6811
+ $[87] = isBootstrapMode;
6812
+ $[88] = linkedinClientId;
6813
+ $[89] = mode;
6814
+ $[90] = noUserComponent;
6815
+ $[91] = showRegistration;
6816
+ $[92] = subtitle;
6817
+ $[93] = title;
6818
+ $[94] = t38;
6819
+ } else {
6820
+ t38 = $[94];
6798
6821
  }
6799
- let t33;
6800
- if ($[74] !== t30 || $[75] !== t31 || $[76] !== t32) {
6801
- t33 = /* @__PURE__ */ jsxs("div", { className: t30, children: [
6802
- t31,
6803
- t32
6822
+ let t39;
6823
+ if ($[95] !== t36 || $[96] !== t37 || $[97] !== t38) {
6824
+ t39 = /* @__PURE__ */ jsxs("div", { className: t36, children: [
6825
+ t37,
6826
+ t38
6804
6827
  ] });
6805
- $[74] = t30;
6806
- $[75] = t31;
6807
- $[76] = t32;
6808
- $[77] = t33;
6828
+ $[95] = t36;
6829
+ $[96] = t37;
6830
+ $[97] = t38;
6831
+ $[98] = t39;
6809
6832
  } else {
6810
- t33 = $[77];
6833
+ t39 = $[98];
6811
6834
  }
6812
- let t34;
6813
- if ($[78] !== t26 || $[79] !== t27 || $[80] !== t28 || $[81] !== t33) {
6814
- t34 = /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center w-[480px] max-w-full p-8 sm:p-10", children: [
6815
- t26,
6816
- t27,
6817
- t28,
6818
- t33
6835
+ let t40;
6836
+ if ($[99] !== additionalComponent) {
6837
+ t40 = additionalComponent && /* @__PURE__ */ jsx("div", { className: "w-full", children: additionalComponent });
6838
+ $[99] = additionalComponent;
6839
+ $[100] = t40;
6840
+ } else {
6841
+ t40 = $[100];
6842
+ }
6843
+ let t41;
6844
+ if ($[101] !== t32 || $[102] !== t33 || $[103] !== t34 || $[104] !== t39 || $[105] !== t40) {
6845
+ t41 = /* @__PURE__ */ jsxs("div", { className: "relative flex flex-col items-center w-[440px] max-w-full p-8 sm:p-10 bg-white/70 dark:bg-surface-900/60 backdrop-blur-xl border border-surface-200/50 dark:border-surface-800/50 rounded-2xl shadow-2xl z-10 transition-all duration-300 hover:shadow-primary-500/5", children: [
6846
+ t32,
6847
+ t33,
6848
+ t34,
6849
+ t39,
6850
+ t40
6819
6851
  ] });
6820
- $[78] = t26;
6821
- $[79] = t27;
6822
- $[80] = t28;
6823
- $[81] = t33;
6824
- $[82] = t34;
6852
+ $[101] = t32;
6853
+ $[102] = t33;
6854
+ $[103] = t34;
6855
+ $[104] = t39;
6856
+ $[105] = t40;
6857
+ $[106] = t41;
6825
6858
  } else {
6826
- t34 = $[82];
6859
+ t41 = $[106];
6827
6860
  }
6828
- let t35;
6829
- if ($[83] !== t10 || $[84] !== t25 || $[85] !== t34) {
6830
- t35 = /* @__PURE__ */ jsxs("div", { className: t10, children: [
6831
- t25,
6832
- t34
6861
+ let t42;
6862
+ if ($[107] !== t14 || $[108] !== t31 || $[109] !== t41) {
6863
+ t42 = /* @__PURE__ */ jsxs("div", { className: t14, children: [
6864
+ t15,
6865
+ t16,
6866
+ t31,
6867
+ t41
6833
6868
  ] });
6834
- $[83] = t10;
6835
- $[84] = t25;
6836
- $[85] = t34;
6837
- $[86] = t35;
6869
+ $[107] = t14;
6870
+ $[108] = t31;
6871
+ $[109] = t41;
6872
+ $[110] = t42;
6838
6873
  } else {
6839
- t35 = $[86];
6874
+ t42 = $[110];
6840
6875
  }
6841
- return t35;
6876
+ return t42;
6842
6877
  }
6843
6878
  function _temp2() {
6844
6879
  }
@@ -6882,7 +6917,7 @@ function LoginButton(t0) {
6882
6917
  }
6883
6918
  let t4;
6884
6919
  if ($[7] !== disabled || $[8] !== onClick || $[9] !== t3) {
6885
- t4 = /* @__PURE__ */ jsx(Button, { disabled, className: "w-full", variant: "outlined", size: "large", onClick, children: t3 });
6920
+ t4 = /* @__PURE__ */ jsx(Button, { disabled, className: "w-full transition-transform duration-200 active:scale-[0.98]", variant: "outlined", size: "large", onClick, children: t3 });
6886
6921
  $[7] = disabled;
6887
6922
  $[8] = onClick;
6888
6923
  $[9] = t3;
@@ -6994,6 +7029,102 @@ function GoogleLoginButton(t0) {
6994
7029
  }
6995
7030
  return t5;
6996
7031
  }
7032
+ const GitHubIcon = () => {
7033
+ const $ = c(1);
7034
+ let t0;
7035
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7036
+ t0 = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.115 2.504.337 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.579.688.481C19.137 20.162 22 16.418 22 12c0-5.523-4.477-10-10-10z" }) });
7037
+ $[0] = t0;
7038
+ } else {
7039
+ t0 = $[0];
7040
+ }
7041
+ return t0;
7042
+ };
7043
+ function GitHubLoginButton(t0) {
7044
+ const $ = c(6);
7045
+ const {
7046
+ disabled,
7047
+ githubClientId
7048
+ } = t0;
7049
+ let t1;
7050
+ if ($[0] !== githubClientId) {
7051
+ t1 = () => {
7052
+ localStorage.setItem("rebase_oauth_provider", "github");
7053
+ const redirectUri = encodeURIComponent(window.location.origin + window.location.pathname);
7054
+ window.location.href = `https://github.com/login/oauth/authorize?client_id=${githubClientId}&redirect_uri=${redirectUri}&scope=${"read:user,user:email"}`;
7055
+ };
7056
+ $[0] = githubClientId;
7057
+ $[1] = t1;
7058
+ } else {
7059
+ t1 = $[1];
7060
+ }
7061
+ const handleClick = t1;
7062
+ let t2;
7063
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7064
+ t2 = /* @__PURE__ */ jsx(GitHubIcon, {});
7065
+ $[2] = t2;
7066
+ } else {
7067
+ t2 = $[2];
7068
+ }
7069
+ let t3;
7070
+ if ($[3] !== disabled || $[4] !== handleClick) {
7071
+ t3 = /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Sign in with GitHub", icon: t2, onClick: handleClick });
7072
+ $[3] = disabled;
7073
+ $[4] = handleClick;
7074
+ $[5] = t3;
7075
+ } else {
7076
+ t3 = $[5];
7077
+ }
7078
+ return t3;
7079
+ }
7080
+ const LinkedInIcon = () => {
7081
+ const $ = c(1);
7082
+ let t0;
7083
+ if ($[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7084
+ t0 = /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "currentColor", children: /* @__PURE__ */ jsx("path", { d: "M19 0h-14c-2.761 0-5 2.239-5 5v14c0 2.761 2.239 5 5 5h14c2.762 0 5-2.239 5-5v-14c0-2.761-2.238-5-5-5zm-11 19h-3v-11h3v11zm-1.5-12.268c-.966 0-1.75-.79-1.75-1.764s.784-1.764 1.75-1.764 1.75.79 1.75 1.764-.783 1.764-1.75 1.764zm13.5 12.268h-3v-5.604c0-3.368-4-3.113-4 0v5.604h-3v-11h3v1.765c1.396-2.586 7-2.777 7 2.476v6.759z" }) });
7085
+ $[0] = t0;
7086
+ } else {
7087
+ t0 = $[0];
7088
+ }
7089
+ return t0;
7090
+ };
7091
+ function LinkedInLoginButton(t0) {
7092
+ const $ = c(6);
7093
+ const {
7094
+ disabled,
7095
+ linkedinClientId
7096
+ } = t0;
7097
+ let t1;
7098
+ if ($[0] !== linkedinClientId) {
7099
+ t1 = () => {
7100
+ localStorage.setItem("rebase_oauth_provider", "linkedin");
7101
+ const redirectUri = encodeURIComponent(window.location.origin + window.location.pathname);
7102
+ window.location.href = `https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id=${linkedinClientId}&redirect_uri=${redirectUri}&scope=${"openid profile email"}`;
7103
+ };
7104
+ $[0] = linkedinClientId;
7105
+ $[1] = t1;
7106
+ } else {
7107
+ t1 = $[1];
7108
+ }
7109
+ const handleClick = t1;
7110
+ let t2;
7111
+ if ($[2] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel")) {
7112
+ t2 = /* @__PURE__ */ jsx(LinkedInIcon, {});
7113
+ $[2] = t2;
7114
+ } else {
7115
+ t2 = $[2];
7116
+ }
7117
+ let t3;
7118
+ if ($[3] !== disabled || $[4] !== handleClick) {
7119
+ t3 = /* @__PURE__ */ jsx(LoginButton, { disabled, text: "Sign in with LinkedIn", icon: t2, onClick: handleClick });
7120
+ $[3] = disabled;
7121
+ $[4] = handleClick;
7122
+ $[5] = t3;
7123
+ } else {
7124
+ t3 = $[5];
7125
+ }
7126
+ return t3;
7127
+ }
6997
7128
  function LoginForm(t0) {
6998
7129
  const $ = c(67);
6999
7130
  const {
@@ -7004,12 +7135,14 @@ function LoginForm(t0) {
7004
7135
  noUserComponent,
7005
7136
  bootstrapMode: t1,
7006
7137
  switchToRegister,
7007
- switchToLogin
7138
+ switchToLogin,
7139
+ defaultEmail,
7140
+ defaultPassword
7008
7141
  } = t0;
7009
7142
  const bootstrapMode = t1 === void 0 ? false : t1;
7010
7143
  const passwordRef = useRef(null);
7011
- const [email, setEmail] = useState();
7012
- const [password, setPassword] = useState();
7144
+ const [email, setEmail] = useState(defaultEmail);
7145
+ const [password, setPassword] = useState(defaultPassword);
7013
7146
  const [displayName, setDisplayName] = useState();
7014
7147
  let t2;
7015
7148
  let t3;
@@ -7551,14 +7684,18 @@ function BootstrapAdminBanner({
7551
7684
  if (!userManagement || !loggedInUser) {
7552
7685
  return null;
7553
7686
  }
7687
+ const loggedInUserRoles = loggedInUser.roles ?? [];
7688
+ const isLoggedInUserAdmin = loggedInUserRoles.length === 0 || loggedInUserRoles.some((r) => r === "admin");
7689
+ if (!isLoggedInUserAdmin) {
7690
+ return null;
7691
+ }
7554
7692
  const {
7555
- users,
7693
+ hasAdminUsers,
7556
7694
  loading: delegateLoading,
7557
7695
  bootstrapAdmin,
7558
7696
  usersError
7559
7697
  } = userManagement;
7560
- const hasAdmin = users.some((u) => u.roles?.includes("admin"));
7561
- if (delegateLoading || hasAdmin || usersError || !bootstrapAdmin) {
7698
+ if (delegateLoading || hasAdminUsers || usersError || !bootstrapAdmin) {
7562
7699
  return null;
7563
7700
  }
7564
7701
  const handleBootstrap = async () => {
@@ -7732,6 +7869,9 @@ const en = {
7732
7869
  navigation_drawer: "Navigation drawer",
7733
7870
  collapse: "Collapse",
7734
7871
  expand: "Expand",
7872
+ change_language: "Change language",
7873
+ toggle_theme: "Toggle theme",
7874
+ user_menu: "User menu",
7735
7875
  // ─── Error states ─────────────────────────────────────────────
7736
7876
  error: "Error",
7737
7877
  error_uploading_file: "Error uploading file",
@@ -7993,7 +8133,17 @@ const en = {
7993
8133
  select_references: "Select references",
7994
8134
  account_settings: "Account Settings",
7995
8135
  profile: "Profile",
8136
+ security: "Security",
7996
8137
  sessions: "Sessions",
8138
+ change_password: "Change Password",
8139
+ current_password: "Current Password",
8140
+ new_password: "New Password",
8141
+ confirm_password: "Confirm New Password",
8142
+ password_changed: "Password changed successfully. You will be logged out.",
8143
+ passwords_dont_match: "Passwords don't match",
8144
+ password_too_short: "Password must be at least 8 characters",
8145
+ password_change_not_available: "Password change is not available for accounts using external sign-in providers.",
8146
+ changing_password: "Changing...",
7997
8147
  display_name: "Display Name",
7998
8148
  photo_url: "Photo URL",
7999
8149
  save_profile: "Save Profile",
@@ -9060,7 +9210,17 @@ const es = {
9060
9210
  select_references: "Select references",
9061
9211
  account_settings: "Account Settings",
9062
9212
  profile: "Profile",
9063
- sessions: "Sessions",
9213
+ sessions: "Sesiones",
9214
+ security: "Seguridad",
9215
+ change_password: "Cambiar Contraseña",
9216
+ current_password: "Contraseña Actual",
9217
+ new_password: "Nueva Contraseña",
9218
+ confirm_password: "Confirmar Nueva Contraseña",
9219
+ password_changed: "Contraseña cambiada con éxito. Se cerrará tu sesión.",
9220
+ passwords_dont_match: "Las contraseñas no coinciden",
9221
+ password_too_short: "La contraseña debe tener al menos 8 caracteres",
9222
+ password_change_not_available: "El cambio de contraseña no está disponible para cuentas que usan proveedores de inicio de sesión externos.",
9223
+ changing_password: "Cambiando...",
9064
9224
  display_name: "Display Name",
9065
9225
  photo_url: "Photo URL",
9066
9226
  save_profile: "Save Profile",
@@ -13676,7 +13836,8 @@ function Rebase(props) {
13676
13836
  apiKey,
13677
13837
  userManagement: _userManagement,
13678
13838
  effectiveRoleController,
13679
- apiUrl
13839
+ apiUrl,
13840
+ translations
13680
13841
  } = props;
13681
13842
  const plugins = pluginsProp;
13682
13843
  if (plugins) {
@@ -13751,7 +13912,7 @@ function Rebase(props) {
13751
13912
  if (authController.authError) {
13752
13913
  return /* @__PURE__ */ jsx(CenteredView, { maxWidth: "md", children: /* @__PURE__ */ jsx(ErrorView, { title: "Error loading auth", error: authController.authError }) });
13753
13914
  }
13754
- const content = /* @__PURE__ */ jsx(RebaseI18nProvider, { locale, children: /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(ModeControllerProvider, { value: modeController, children: /* @__PURE__ */ jsx(AdminModeControllerProvider, { value: adminModeController, children: /* @__PURE__ */ jsx(RebaseClientInstanceContext.Provider, { value: client, children: /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, { value: resolvedStorage, children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, { value: resolvedData, children: /* @__PURE__ */ jsx(DatabaseAdminContext.Provider, { value: resolvedDatabaseAdmin, children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsx(EffectiveRoleControllerContext.Provider, { value: activeEffectiveRoleController, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsx(RebaseInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
13915
+ const content = /* @__PURE__ */ jsx(RebaseI18nProvider, { locale, translations, children: /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(ModeControllerProvider, { value: modeController, children: /* @__PURE__ */ jsx(AdminModeControllerProvider, { value: adminModeController, children: /* @__PURE__ */ jsx(RebaseClientInstanceContext.Provider, { value: client, children: /* @__PURE__ */ jsx(AnalyticsContext.Provider, { value: analyticsController, children: /* @__PURE__ */ jsx(CustomizationControllerContext.Provider, { value: customizationController, children: /* @__PURE__ */ jsx(UserConfigurationPersistenceContext.Provider, { value: userConfigPersistence, children: /* @__PURE__ */ jsx(StorageSourceContext.Provider, { value: resolvedStorage, children: /* @__PURE__ */ jsx(RebaseDataContext.Provider, { value: resolvedData, children: /* @__PURE__ */ jsx(DatabaseAdminContext.Provider, { value: resolvedDatabaseAdmin, children: /* @__PURE__ */ jsx(AuthControllerContext.Provider, { value: authController, children: /* @__PURE__ */ jsx(InternalUserManagementContext.Provider, { value: userManagement, children: /* @__PURE__ */ jsx(EffectiveRoleControllerContext.Provider, { value: activeEffectiveRoleController, children: /* @__PURE__ */ jsx(DialogsProvider, { children: /* @__PURE__ */ jsx(RebaseRegistryProvider, { children: /* @__PURE__ */ jsx(RebaseInternal, { loading, children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) });
13755
13916
  const resolvedApiUrl = apiUrl ?? client?.baseUrl;
13756
13917
  if (resolvedApiUrl) {
13757
13918
  return /* @__PURE__ */ jsx(ApiConfigProvider, { apiUrl: resolvedApiUrl, getAuthToken: authController.getAuthToken, children: content });
@@ -14193,9 +14354,6 @@ function saveEntityToMemoryCache(path, data) {
14193
14354
  function getEntityFromMemoryCache(path) {
14194
14355
  return entityCache.get(path);
14195
14356
  }
14196
- function hasEntityInCache(path) {
14197
- return entityCache.has(path);
14198
- }
14199
14357
  function getEntityFromCache(path) {
14200
14358
  if (isSessionStorageAvailable) {
14201
14359
  try {
@@ -14223,23 +14381,6 @@ function removeEntityFromCache(path) {
14223
14381
  }
14224
14382
  }
14225
14383
  }
14226
- function clearEntityCache() {
14227
- entityCache.clear();
14228
- if (isSessionStorageAvailable) {
14229
- try {
14230
- const keysToRemove = [];
14231
- for (let i = 0; i < sessionStorage.length; i++) {
14232
- const fullKey = sessionStorage.key(i);
14233
- if (fullKey && fullKey.startsWith(LOCAL_STORAGE_PREFIX)) {
14234
- keysToRemove.push(fullKey);
14235
- }
14236
- }
14237
- keysToRemove.forEach((key) => sessionStorage.removeItem(key));
14238
- } catch (error) {
14239
- console.error("Failed to clear entity cache from sessionStorage:", error);
14240
- }
14241
- }
14242
- }
14243
14384
  function flattenKeys(obj, prefix = "", result = []) {
14244
14385
  if (isObject(obj) || Array.isArray(obj)) {
14245
14386
  const plainObject = isPlainObject(obj);
@@ -14478,37 +14619,6 @@ async function resizeImage(file, imageResize) {
14478
14619
  });
14479
14620
  });
14480
14621
  }
14481
- function printChanged(props, prev, path = "", depth = 0, maxDepth = 10) {
14482
- if (depth > maxDepth) {
14483
- return;
14484
- }
14485
- if (props && prev && typeof props === "object" && typeof prev === "object") {
14486
- Object.keys(props).forEach((key) => {
14487
- printChanged(props[key], prev[key], path + "." + key, depth + 1, maxDepth);
14488
- });
14489
- } else if (props !== prev) {
14490
- console.log("Changed props:", path);
14491
- }
14492
- }
14493
- function useTraceUpdate(props, t0) {
14494
- const $ = c(3);
14495
- const maxDepth = t0 === void 0 ? 3 : t0;
14496
- const prev = useRef(props);
14497
- let t1;
14498
- if ($[0] !== maxDepth || $[1] !== props) {
14499
- t1 = () => {
14500
- console.log("Changed props:");
14501
- printChanged(props, prev.current, "", 0, maxDepth);
14502
- prev.current = props;
14503
- };
14504
- $[0] = maxDepth;
14505
- $[1] = props;
14506
- $[2] = t1;
14507
- } else {
14508
- t1 = $[2];
14509
- }
14510
- useEffect(t1);
14511
- }
14512
14622
  function isReferenceProperty(property) {
14513
14623
  if (!property) return null;
14514
14624
  if (property.type === "reference") return true;
@@ -14527,6 +14637,10 @@ function isRelationProperty(property) {
14527
14637
  }
14528
14638
  return false;
14529
14639
  }
14640
+ function isHiddenProperty(property) {
14641
+ if (!property) return false;
14642
+ return Boolean(property.ui?.hideFromCollection);
14643
+ }
14530
14644
  function getEntityPreviewKeys(authController, targetCollection, fields, previewProperties, limit = 3) {
14531
14645
  const allProperties = Object.keys(targetCollection.properties);
14532
14646
  let listProperties = previewProperties?.filter((p) => allProperties.includes(p));
@@ -14543,7 +14657,7 @@ function getEntityPreviewKeys(authController, targetCollection, fields, previewP
14543
14657
  return !isIdProp && key !== "id";
14544
14658
  }).filter((key) => {
14545
14659
  const property = targetCollection.properties[key];
14546
- return property && !isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property);
14660
+ return property && !isPropertyBuilder(property) && !isReferenceProperty(property) && !isRelationProperty(property) && !isHiddenProperty(property);
14547
14661
  }).slice(0, limit);
14548
14662
  }
14549
14663
  }
@@ -14557,6 +14671,9 @@ function getEntityTitlePropertyKey(collection, propertyConfigs) {
14557
14671
  const property = collection.properties[key];
14558
14672
  if (property && !isPropertyBuilder(property)) {
14559
14673
  const prop = property;
14674
+ if (isHiddenProperty(prop)) {
14675
+ continue;
14676
+ }
14560
14677
  if (prop.type === "string" && !prop.ui?.multiline && !prop.ui?.markdown && !prop.storage && !prop.isId) {
14561
14678
  if (!firstStringCandidate) {
14562
14679
  firstStringCandidate = key;
@@ -14955,7 +15072,6 @@ export {
14955
15072
  UserSettingsView,
14956
15073
  buildCollapsedDefaults,
14957
15074
  buildEnumLabel,
14958
- clearEntityCache,
14959
15075
  clearEntityFetchCache,
14960
15076
  createFormexStub,
14961
15077
  deleteEntityWithCallbacks,
@@ -14972,12 +15088,9 @@ export {
14972
15088
  getIcon,
14973
15089
  getRowHeight,
14974
15090
  getSubcollectionColumnId,
14975
- hasEntityInCache,
14976
- iconSynonyms,
14977
15091
  iconsSearch,
14978
15092
  isEnumValueDisabled,
14979
15093
  populateEntityFetchCache,
14980
- printChanged,
14981
15094
  removeEntityFromCache,
14982
15095
  removeEntityFromMemoryCache,
14983
15096
  resolveComponentRef,
@@ -15028,11 +15141,9 @@ export {
15028
15141
  useStudioNavigationState,
15029
15142
  useStudioSideEntityController,
15030
15143
  useStudioUrlController,
15031
- useTraceUpdate,
15032
15144
  useTranslation,
15033
15145
  useUnsavedChangesDialog,
15034
15146
  useUserConfigurationPersistence,
15035
- useUserSelector,
15036
- useValidateAuthenticator
15147
+ useUserSelector
15037
15148
  };
15038
15149
  //# sourceMappingURL=index.es.js.map