@cupcodev/ui 1.2.3 → 1.2.51

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -2275,7 +2275,7 @@ ModalDescription.displayName = DialogPrimitive.Description.displayName;
2275
2275
 
2276
2276
  // src/components/cupcode/NavbarCupcode.tsx
2277
2277
  import * as React10 from "react";
2278
- import { Menu, X as X3 } from "lucide-react";
2278
+ import { Menu } from "lucide-react";
2279
2279
  import { jsx as jsx21, jsxs as jsxs17 } from "react/jsx-runtime";
2280
2280
  var NavbarCupcode = ({
2281
2281
  logo,
@@ -2284,9 +2284,54 @@ var NavbarCupcode = ({
2284
2284
  className
2285
2285
  }) => {
2286
2286
  const [isOpen, setIsOpen] = React10.useState(false);
2287
+ const navRef = React10.useRef(null);
2288
+ const mobileMenuId = React10.useId();
2289
+ React10.useEffect(() => {
2290
+ if (!isOpen) return;
2291
+ const handlePointerDown = (event) => {
2292
+ var _a65;
2293
+ const target = event.target;
2294
+ if (!(target instanceof Node)) return;
2295
+ if (!((_a65 = navRef.current) == null ? void 0 : _a65.contains(target))) {
2296
+ setIsOpen(false);
2297
+ }
2298
+ };
2299
+ const handleEscape = (event) => {
2300
+ if (event.key === "Escape") {
2301
+ setIsOpen(false);
2302
+ }
2303
+ };
2304
+ document.addEventListener("pointerdown", handlePointerDown);
2305
+ document.addEventListener("keydown", handleEscape);
2306
+ return () => {
2307
+ document.removeEventListener("pointerdown", handlePointerDown);
2308
+ document.removeEventListener("keydown", handleEscape);
2309
+ };
2310
+ }, [isOpen]);
2311
+ React10.useEffect(() => {
2312
+ if (!isOpen) return;
2313
+ const { style } = document.body;
2314
+ const previousOverflow = style.overflow;
2315
+ style.overflow = "hidden";
2316
+ return () => {
2317
+ style.overflow = previousOverflow;
2318
+ };
2319
+ }, [isOpen]);
2320
+ React10.useEffect(() => {
2321
+ const handleResize = () => {
2322
+ if (window.innerWidth >= 768) {
2323
+ setIsOpen(false);
2324
+ }
2325
+ };
2326
+ window.addEventListener("resize", handleResize);
2327
+ return () => {
2328
+ window.removeEventListener("resize", handleResize);
2329
+ };
2330
+ }, []);
2287
2331
  return /* @__PURE__ */ jsx21(
2288
2332
  "nav",
2289
2333
  {
2334
+ ref: navRef,
2290
2335
  className: cn(
2291
2336
  "fixed top-0 left-0 right-0 z-[200] pointer-events-auto",
2292
2337
  "glass border-b border-border",
@@ -2345,45 +2390,56 @@ var NavbarCupcode = ({
2345
2390
  /* @__PURE__ */ jsx21(
2346
2391
  "button",
2347
2392
  {
2393
+ type: "button",
2348
2394
  onClick: () => setIsOpen(!isOpen),
2349
- className: "md:hidden p-2 rounded-lg hover:bg-primary/10 transition-colors",
2350
- children: isOpen ? /* @__PURE__ */ jsx21(X3, { className: "h-6 w-6 text-foreground" }) : /* @__PURE__ */ jsx21(Menu, { className: "h-6 w-6 text-foreground" })
2395
+ "aria-controls": mobileMenuId,
2396
+ "aria-expanded": isOpen,
2397
+ "aria-label": isOpen ? "Fechar menu de navega\xE7\xE3o" : "Abrir menu de navega\xE7\xE3o",
2398
+ className: "md:hidden inline-flex h-10 w-10 items-center justify-center rounded-lg transition-colors hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
2399
+ children: /* @__PURE__ */ jsx21(Menu, { className: cn("h-6 w-6 text-foreground", isOpen && "text-primary") })
2351
2400
  }
2352
2401
  )
2353
2402
  ] }),
2354
- isOpen && /* @__PURE__ */ jsxs17("div", { className: "md:hidden py-4 space-y-3 animate-slide-up", children: [
2355
- items.map((item, index) => {
2356
- const key = `${item.label}-${index}`;
2357
- const isActive = item.isActive;
2358
- const classes = cn(
2359
- "flex items-center gap-2 px-4 py-2 text-sm font-semibold text-foreground hover:bg-primary/10 rounded-lg transition-colors",
2360
- isActive && "text-primary"
2361
- );
2362
- const handleClick = (event) => {
2363
- var _a65;
2364
- (_a65 = item.onClick) == null ? void 0 : _a65.call(item, event);
2365
- setIsOpen(false);
2366
- };
2367
- if (item.href.startsWith("#")) {
2368
- return /* @__PURE__ */ jsxs17("a", { href: item.href, className: classes, onClick: handleClick, children: [
2369
- item.icon && /* @__PURE__ */ jsx21("span", { children: item.icon }),
2370
- item.label
2371
- ] }, key);
2372
- }
2373
- return /* @__PURE__ */ jsxs17("a", { href: item.href, className: classes, onClick: handleClick, children: [
2374
- item.icon && /* @__PURE__ */ jsx21("span", { children: item.icon }),
2375
- item.label
2376
- ] }, key);
2377
- }),
2378
- actions && /* @__PURE__ */ jsx21("div", { className: "px-4 pt-2", children: actions })
2379
- ] })
2403
+ isOpen && /* @__PURE__ */ jsxs17(
2404
+ "div",
2405
+ {
2406
+ id: mobileMenuId,
2407
+ className: "md:hidden max-h-[calc(100dvh-4rem)] space-y-3 overflow-y-auto border-t border-border/60 py-4 animate-slide-up",
2408
+ children: [
2409
+ items.map((item, index) => {
2410
+ const key = `${item.label}-${index}`;
2411
+ const isActive = item.isActive;
2412
+ const classes = cn(
2413
+ "flex min-h-11 items-center gap-2 rounded-lg px-4 py-2.5 text-sm font-semibold text-foreground transition-colors hover:bg-primary/10 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary/40",
2414
+ isActive && "text-primary"
2415
+ );
2416
+ const handleClick = (event) => {
2417
+ var _a65;
2418
+ (_a65 = item.onClick) == null ? void 0 : _a65.call(item, event);
2419
+ setIsOpen(false);
2420
+ };
2421
+ if (item.href.startsWith("#")) {
2422
+ return /* @__PURE__ */ jsxs17("a", { href: item.href, className: classes, onClick: handleClick, children: [
2423
+ item.icon && /* @__PURE__ */ jsx21("span", { children: item.icon }),
2424
+ item.label
2425
+ ] }, key);
2426
+ }
2427
+ return /* @__PURE__ */ jsxs17("a", { href: item.href, className: classes, onClick: handleClick, children: [
2428
+ item.icon && /* @__PURE__ */ jsx21("span", { children: item.icon }),
2429
+ item.label
2430
+ ] }, key);
2431
+ }),
2432
+ actions && /* @__PURE__ */ jsx21("div", { className: "px-4 pb-[max(env(safe-area-inset-bottom),0.5rem)] pt-2", children: actions })
2433
+ ]
2434
+ }
2435
+ )
2380
2436
  ] })
2381
2437
  }
2382
2438
  );
2383
2439
  };
2384
2440
 
2385
2441
  // src/components/cupcode/MainNavbar.tsx
2386
- import { useCallback as useCallback6, useEffect as useEffect15, useMemo as useMemo8, useRef as useRef11, useState as useState13 } from "react";
2442
+ import { useCallback as useCallback6, useEffect as useEffect16, useMemo as useMemo8, useRef as useRef12, useState as useState13 } from "react";
2387
2443
 
2388
2444
  // src/components/cupcode/TelescupImage.tsx
2389
2445
  import { jsx as jsx22 } from "react/jsx-runtime";
@@ -2471,13 +2527,13 @@ import {
2471
2527
  UserRound,
2472
2528
  UsersRound,
2473
2529
  Volume2,
2474
- X as X5
2530
+ X as X4
2475
2531
  } from "lucide-react";
2476
2532
  import {
2477
2533
  useCallback as useCallback5,
2478
- useEffect as useEffect13,
2534
+ useEffect as useEffect14,
2479
2535
  useMemo as useMemo7,
2480
- useRef as useRef10,
2536
+ useRef as useRef11,
2481
2537
  useState as useState11
2482
2538
  } from "react";
2483
2539
 
@@ -2818,7 +2874,7 @@ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
2818
2874
  // src/components/ui/dialog.tsx
2819
2875
  import * as React16 from "react";
2820
2876
  import * as DialogPrimitive2 from "@radix-ui/react-dialog";
2821
- import { X as X4 } from "lucide-react";
2877
+ import { X as X3 } from "lucide-react";
2822
2878
  import { jsx as jsx28, jsxs as jsxs21 } from "react/jsx-runtime";
2823
2879
  var Dialog = DialogPrimitive2.Root;
2824
2880
  var DialogTrigger = DialogPrimitive2.Trigger;
@@ -2850,7 +2906,7 @@ var DialogContent = React16.forwardRef(({ className, children, ...props }, ref)
2850
2906
  children: [
2851
2907
  children,
2852
2908
  /* @__PURE__ */ jsxs21(DialogPrimitive2.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-accent data-[state=open]:text-muted-foreground hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
2853
- /* @__PURE__ */ jsx28(X4, { className: "h-4 w-4" }),
2909
+ /* @__PURE__ */ jsx28(X3, { className: "h-4 w-4" }),
2854
2910
  /* @__PURE__ */ jsx28("span", { className: "sr-only", children: "Close" })
2855
2911
  ] })
2856
2912
  ]
@@ -3017,7 +3073,7 @@ function useToast() {
3017
3073
  }
3018
3074
 
3019
3075
  // src/components/cupcode/TelescupUpload.tsx
3020
- import React27, { useCallback as useCallback4, useEffect as useEffect12, useMemo as useMemo6, useState as useState10 } from "react";
3076
+ import React27, { useCallback as useCallback4, useEffect as useEffect13, useMemo as useMemo6, useState as useState10 } from "react";
3021
3077
 
3022
3078
  // src/lib/telescupClient.ts
3023
3079
  var TelescupClientError = class extends Error {
@@ -4305,7 +4361,7 @@ var createTelescupClient = (config) => ({
4305
4361
  import React21, { useCallback as useCallback2, useMemo as useMemo3, useState as useState7 } from "react";
4306
4362
 
4307
4363
  // src/hooks/useTelescupAssets.ts
4308
- import { useCallback, useEffect as useEffect10, useMemo as useMemo2, useRef as useRef7, useState as useState6 } from "react";
4364
+ import { useCallback, useEffect as useEffect11, useMemo as useMemo2, useRef as useRef8, useState as useState6 } from "react";
4309
4365
  var DEFAULT_CACHE_MS = 3e4;
4310
4366
  var listCache = /* @__PURE__ */ new Map();
4311
4367
  var inFlight = /* @__PURE__ */ new Map();
@@ -4340,8 +4396,8 @@ function useTelescupAssets(options) {
4340
4396
  const [isLoading, setIsLoading] = useState6(false);
4341
4397
  const [isLoadingMore, setIsLoadingMore] = useState6(false);
4342
4398
  const [error, setError] = useState6(null);
4343
- const aliveRef = useRef7(true);
4344
- const requestSeqRef = useRef7(0);
4399
+ const aliveRef = useRef8(true);
4400
+ const requestSeqRef = useRef8(0);
4345
4401
  const fetchFirst = useCallback(
4346
4402
  async (skipCache = false) => {
4347
4403
  if (!enabled) return;
@@ -4420,7 +4476,7 @@ function useTelescupAssets(options) {
4420
4476
  if (aliveRef.current && requestSeq === requestSeqRef.current) setIsLoadingMore(false);
4421
4477
  }
4422
4478
  }, [cacheKey, filters, isLoading, isLoadingMore, pageSize, resolvedClient, state.facets, state.items, state.nextCursor, state.total]);
4423
- useEffect10(() => {
4479
+ useEffect11(() => {
4424
4480
  aliveRef.current = true;
4425
4481
  setState({ items: [] });
4426
4482
  setIsLoadingMore(false);
@@ -4782,10 +4838,10 @@ var TelescupAssetPicker = ({
4782
4838
  };
4783
4839
 
4784
4840
  // src/components/cupcode/TelescupUploader.tsx
4785
- import { useMemo as useMemo5, useRef as useRef9, useState as useState9 } from "react";
4841
+ import { useMemo as useMemo5, useRef as useRef10, useState as useState9 } from "react";
4786
4842
 
4787
4843
  // src/hooks/useTelescupUploadQueue.tsx
4788
- import { useCallback as useCallback3, useEffect as useEffect11, useMemo as useMemo4, useRef as useRef8, useState as useState8 } from "react";
4844
+ import { useCallback as useCallback3, useEffect as useEffect12, useMemo as useMemo4, useRef as useRef9, useState as useState8 } from "react";
4789
4845
  var DEFAULT_CONCURRENCY = 3;
4790
4846
  var TELESCUP_UPLOAD_MODE = getRuntimeEnvOr("VITE_TELESCUP_UPLOAD_MODE", "standard").trim().toLowerCase();
4791
4847
  var makeId = () => Math.random().toString(36).slice(2, 10);
@@ -4841,9 +4897,9 @@ function useTelescupUploadQueue(options) {
4841
4897
  onItemError
4842
4898
  } = options;
4843
4899
  const [queue, setQueue] = useState8([]);
4844
- const queueRef = useRef8(queue);
4845
- const activeRef = useRef8(0);
4846
- useEffect11(() => {
4900
+ const queueRef = useRef9(queue);
4901
+ const activeRef = useRef9(0);
4902
+ useEffect12(() => {
4847
4903
  queueRef.current = queue;
4848
4904
  }, [queue]);
4849
4905
  const enqueueFiles = useCallback3(
@@ -4972,7 +5028,7 @@ function useTelescupUploadQueue(options) {
4972
5028
  };
4973
5029
  void run();
4974
5030
  }, [client, conflictPolicy, concurrency, folderId, onItemComplete, onItemError, updateItem]);
4975
- useEffect11(() => {
5031
+ useEffect12(() => {
4976
5032
  processQueue();
4977
5033
  }, [processQueue, queue]);
4978
5034
  const removeItem = useCallback3((id) => {
@@ -5050,7 +5106,7 @@ var TelescupUploader = ({
5050
5106
  onAssetUploaded
5051
5107
  }) => {
5052
5108
  var _a65;
5053
- const inputRef = useRef9(null);
5109
+ const inputRef = useRef10(null);
5054
5110
  const [dragActive, setDragActive] = useState9(false);
5055
5111
  const {
5056
5112
  queue,
@@ -5432,7 +5488,7 @@ var TelescupMetaEditor = ({
5432
5488
  const [drafts, setDrafts] = useState10({});
5433
5489
  const [saving, setSaving] = useState10(false);
5434
5490
  const [aiLoading, setAiLoading] = useState10(false);
5435
- useEffect12(() => {
5491
+ useEffect13(() => {
5436
5492
  if (!assets.length) {
5437
5493
  setActiveAssetId("");
5438
5494
  return;
@@ -5660,7 +5716,7 @@ var TelescupUpload = ({
5660
5716
  const [stagedSelection, setStagedSelection] = useState10(null);
5661
5717
  const [assetRevision, setAssetRevision] = useState10(0);
5662
5718
  const assetMapRef = React27.useRef(/* @__PURE__ */ new Map());
5663
- useEffect12(() => {
5719
+ useEffect13(() => {
5664
5720
  if (value) {
5665
5721
  setInternalSelection(value);
5666
5722
  }
@@ -5709,7 +5765,7 @@ var TelescupUpload = ({
5709
5765
  if (!isControlled) setInternalOpen(false);
5710
5766
  onClose == null ? void 0 : onClose();
5711
5767
  }, [isControlled, onClose]);
5712
- useEffect12(() => {
5768
+ useEffect13(() => {
5713
5769
  if (isOpen) return;
5714
5770
  setStagedSelection(null);
5715
5771
  }, [isOpen]);
@@ -6555,21 +6611,21 @@ var UserMenuCupcode = ({
6555
6611
  const [pendingLatestMessagesCount, setPendingLatestMessagesCount] = useState11(0);
6556
6612
  const [activeReactionPicker, setActiveReactionPicker] = useState11(null);
6557
6613
  const [internalStatus, setInternalStatus] = useState11(defaultStatus);
6558
- const emojiPickerRef = useRef10(null);
6559
- const reactionPickerRef = useRef10(null);
6560
- const chatMessagesPaneRef = useRef10(null);
6561
- const pendingReadRequestsRef = useRef10(/* @__PURE__ */ new Set());
6562
- const seenIncomingMessageIdsRef = useRef10(/* @__PURE__ */ new Set());
6563
- const hasBootstrappedIncomingMessagesRef = useRef10(false);
6564
- const wasFocusModeActiveRef = useRef10(false);
6565
- const previousChatUnreadCountRef = useRef10(0);
6566
- const chatIndicatorHideTimeoutRef = useRef10(null);
6567
- const chatIndicatorIntroTimeoutRef = useRef10(null);
6568
- const chatBadgePulseTimeoutRef = useRef10(null);
6569
- const activeConversationIdRef = useRef10(null);
6570
- const activeConversationMessageIdsRef = useRef10(/* @__PURE__ */ new Set());
6571
- const shouldAutoScrollToBottomRef = useRef10(false);
6572
- const autoScrollArmTimeoutRef = useRef10(null);
6614
+ const emojiPickerRef = useRef11(null);
6615
+ const reactionPickerRef = useRef11(null);
6616
+ const chatMessagesPaneRef = useRef11(null);
6617
+ const pendingReadRequestsRef = useRef11(/* @__PURE__ */ new Set());
6618
+ const seenIncomingMessageIdsRef = useRef11(/* @__PURE__ */ new Set());
6619
+ const hasBootstrappedIncomingMessagesRef = useRef11(false);
6620
+ const wasFocusModeActiveRef = useRef11(false);
6621
+ const previousChatUnreadCountRef = useRef11(0);
6622
+ const chatIndicatorHideTimeoutRef = useRef11(null);
6623
+ const chatIndicatorIntroTimeoutRef = useRef11(null);
6624
+ const chatBadgePulseTimeoutRef = useRef11(null);
6625
+ const activeConversationIdRef = useRef11(null);
6626
+ const activeConversationMessageIdsRef = useRef11(/* @__PURE__ */ new Set());
6627
+ const shouldAutoScrollToBottomRef = useRef11(false);
6628
+ const autoScrollArmTimeoutRef = useRef11(null);
6573
6629
  const isChatMessagesControlled = typeof chatMessages !== "undefined";
6574
6630
  const isChatReactionsControlled = typeof chatReactions !== "undefined";
6575
6631
  const initials = useMemo7(() => buildInitials(displayName, email), [displayName, email]);
@@ -6808,7 +6864,7 @@ var UserMenuCupcode = ({
6808
6864
  });
6809
6865
  return unreadByUser;
6810
6866
  }, [conversationMetaByUserId]);
6811
- useEffect13(() => {
6867
+ useEffect14(() => {
6812
6868
  if (!normalizedNotificationFeed.length) return;
6813
6869
  setNotificationReadMap((current) => {
6814
6870
  let changed = false;
@@ -6955,37 +7011,37 @@ var UserMenuCupcode = ({
6955
7011
  });
6956
7012
  return normalized;
6957
7013
  }, [resolvedAllChatReactions, resolvedCurrentChatUserId]);
6958
- useEffect13(() => {
7014
+ useEffect14(() => {
6959
7015
  if (!isChatMessagesControlled) return;
6960
7016
  setInternalChatMessages(chatMessages != null ? chatMessages : []);
6961
7017
  }, [chatMessages, isChatMessagesControlled]);
6962
- useEffect13(() => {
7018
+ useEffect14(() => {
6963
7019
  if (!isChatReactionsControlled) return;
6964
7020
  setInternalChatReactions(chatReactions != null ? chatReactions : []);
6965
7021
  }, [chatReactions, isChatReactionsControlled]);
6966
- useEffect13(() => {
7022
+ useEffect14(() => {
6967
7023
  setProfileAvatarUrl(avatarUrl);
6968
7024
  }, [avatarUrl]);
6969
- useEffect13(() => {
7025
+ useEffect14(() => {
6970
7026
  if (!isLanguageControlled) return;
6971
7027
  setInternalLanguage(normalizeLanguage(language));
6972
7028
  }, [isLanguageControlled, language]);
6973
- useEffect13(() => {
7029
+ useEffect14(() => {
6974
7030
  persistChatSettings(chatSettings);
6975
7031
  }, [chatSettings]);
6976
- useEffect13(() => {
7032
+ useEffect14(() => {
6977
7033
  persistExperienceSettings(experienceSettings);
6978
7034
  }, [experienceSettings]);
6979
- useEffect13(() => {
7035
+ useEffect14(() => {
6980
7036
  persistIntegrationConnections(integrationConnections);
6981
7037
  }, [integrationConnections]);
6982
- useEffect13(() => {
7038
+ useEffect14(() => {
6983
7039
  applyThemePreference(experienceSettings.theme);
6984
7040
  }, [experienceSettings.theme]);
6985
- useEffect13(() => {
7041
+ useEffect14(() => {
6986
7042
  applyAccessibilityAttributes(experienceSettings);
6987
7043
  }, [experienceSettings]);
6988
- useEffect13(() => {
7044
+ useEffect14(() => {
6989
7045
  if (experienceSettings.theme !== "system" || typeof window === "undefined") return;
6990
7046
  const media = window.matchMedia("(prefers-color-scheme: dark)");
6991
7047
  const onSystemThemeChange = () => applyThemePreference("system");
@@ -6996,13 +7052,13 @@ var UserMenuCupcode = ({
6996
7052
  media.addListener(onSystemThemeChange);
6997
7053
  return () => media.removeListener(onSystemThemeChange);
6998
7054
  }, [experienceSettings.theme]);
6999
- useEffect13(() => {
7055
+ useEffect14(() => {
7000
7056
  persistNotificationPreferences(notificationPreferences);
7001
7057
  }, [notificationPreferences]);
7002
- useEffect13(() => {
7058
+ useEffect14(() => {
7003
7059
  setNotificationPermission(resolveNotificationPermission());
7004
7060
  }, []);
7005
- useEffect13(() => {
7061
+ useEffect14(() => {
7006
7062
  if (typeof window === "undefined") return;
7007
7063
  const mediaQuery = window.matchMedia("(prefers-reduced-motion: reduce)");
7008
7064
  const syncPreference = () => setPrefersReducedMotion(mediaQuery.matches);
@@ -7014,7 +7070,7 @@ var UserMenuCupcode = ({
7014
7070
  mediaQuery.addListener(syncPreference);
7015
7071
  return () => mediaQuery.removeListener(syncPreference);
7016
7072
  }, []);
7017
- useEffect13(() => {
7073
+ useEffect14(() => {
7018
7074
  const previousCount = previousChatUnreadCountRef.current;
7019
7075
  const nextCount = visibleChatUnreadCount;
7020
7076
  const hadUnread = previousCount > 0;
@@ -7064,7 +7120,7 @@ var UserMenuCupcode = ({
7064
7120
  }
7065
7121
  previousChatUnreadCountRef.current = nextCount;
7066
7122
  }, [prefersReducedMotion, visibleChatUnreadCount]);
7067
- useEffect13(() => {
7123
+ useEffect14(() => {
7068
7124
  return () => {
7069
7125
  if (chatIndicatorHideTimeoutRef.current) window.clearTimeout(chatIndicatorHideTimeoutRef.current);
7070
7126
  if (chatIndicatorIntroTimeoutRef.current) window.clearTimeout(chatIndicatorIntroTimeoutRef.current);
@@ -7072,7 +7128,7 @@ var UserMenuCupcode = ({
7072
7128
  if (autoScrollArmTimeoutRef.current) window.clearTimeout(autoScrollArmTimeoutRef.current);
7073
7129
  };
7074
7130
  }, []);
7075
- useEffect13(() => {
7131
+ useEffect14(() => {
7076
7132
  if (!isAuthenticated) {
7077
7133
  seenIncomingMessageIdsRef.current.clear();
7078
7134
  hasBootstrappedIncomingMessagesRef.current = false;
@@ -7106,15 +7162,15 @@ var UserMenuCupcode = ({
7106
7162
  }
7107
7163
  }
7108
7164
  }, [isAuthenticated]);
7109
- useEffect13(() => {
7165
+ useEffect14(() => {
7110
7166
  if (activeTab === "notifications") return;
7111
7167
  if (!isNotificationsPreferencesBackVisible) return;
7112
7168
  setIsNotificationsPreferencesBackVisible(false);
7113
7169
  }, [activeTab, isNotificationsPreferencesBackVisible]);
7114
- useEffect13(() => {
7170
+ useEffect14(() => {
7115
7171
  setIsNotificationsExpanded(false);
7116
7172
  }, [activeTab, notificationReadFilter, notificationTypeFilter, notificationPreferences.grouping]);
7117
- useEffect13(() => {
7173
+ useEffect14(() => {
7118
7174
  if (!notificationPreferences.focusUntil) return;
7119
7175
  const deadline = new Date(notificationPreferences.focusUntil).getTime();
7120
7176
  if (Number.isNaN(deadline) || deadline <= Date.now()) {
@@ -7128,7 +7184,7 @@ var UserMenuCupcode = ({
7128
7184
  window.clearTimeout(timer);
7129
7185
  };
7130
7186
  }, [notificationPreferences.focusUntil]);
7131
- useEffect13(() => {
7187
+ useEffect14(() => {
7132
7188
  const wasFocusModeActive = wasFocusModeActiveRef.current;
7133
7189
  if (wasFocusModeActive && !isFocusModeActive && suppressedFocusNotifications.length) {
7134
7190
  const byType = suppressedFocusNotifications.reduce((acc, notification) => {
@@ -7158,7 +7214,7 @@ var UserMenuCupcode = ({
7158
7214
  }
7159
7215
  wasFocusModeActiveRef.current = isFocusModeActive;
7160
7216
  }, [isFocusModeActive, suppressedFocusNotifications]);
7161
- useEffect13(() => {
7217
+ useEffect14(() => {
7162
7218
  if (!chatUsersList.length) {
7163
7219
  setActiveChatUserId("");
7164
7220
  return;
@@ -7169,18 +7225,18 @@ var UserMenuCupcode = ({
7169
7225
  return (_b5 = (_a66 = filteredAndSortedChatUsers[0]) == null ? void 0 : _a66.id) != null ? _b5 : chatUsersList[0].id;
7170
7226
  });
7171
7227
  }, [chatUsersList, filteredAndSortedChatUsers]);
7172
- useEffect13(() => {
7228
+ useEffect14(() => {
7173
7229
  if (activeTab === "chat" && open) return;
7174
7230
  setIsChatSidebarExpanded(false);
7175
7231
  setIsChatSidebarPinned(false);
7176
7232
  }, [activeTab, open]);
7177
- useEffect13(() => {
7233
+ useEffect14(() => {
7178
7234
  if (!(chatOpenRequest == null ? void 0 : chatOpenRequest.userId)) return;
7179
7235
  setOpen(true);
7180
7236
  setActiveTab("chat");
7181
7237
  setActiveChatUserId(chatOpenRequest.userId);
7182
7238
  }, [chatOpenRequest == null ? void 0 : chatOpenRequest.at, chatOpenRequest == null ? void 0 : chatOpenRequest.userId]);
7183
- useEffect13(() => {
7239
+ useEffect14(() => {
7184
7240
  if (!showEmojiPicker && !activeReactionPickerMessageId) return;
7185
7241
  const onPointerDown = (event) => {
7186
7242
  const target = event.target;
@@ -7197,7 +7253,7 @@ var UserMenuCupcode = ({
7197
7253
  document.removeEventListener("mousedown", onPointerDown);
7198
7254
  };
7199
7255
  }, [activeReactionPickerMessageId, showEmojiPicker]);
7200
- useEffect13(() => {
7256
+ useEffect14(() => {
7201
7257
  if (!activeReactionPickerMessageId) return;
7202
7258
  const closePicker = () => setActiveReactionPicker(null);
7203
7259
  window.addEventListener("resize", closePicker);
@@ -7207,7 +7263,7 @@ var UserMenuCupcode = ({
7207
7263
  document.removeEventListener("scroll", closePicker, true);
7208
7264
  };
7209
7265
  }, [activeReactionPickerMessageId]);
7210
- useEffect13(() => {
7266
+ useEffect14(() => {
7211
7267
  var _a66;
7212
7268
  if (!hasBootstrappedIncomingMessagesRef.current && isChatLoading) return;
7213
7269
  const knownIncomingIds = seenIncomingMessageIdsRef.current;
@@ -7378,7 +7434,7 @@ var UserMenuCupcode = ({
7378
7434
  });
7379
7435
  return items;
7380
7436
  }, [activeChatMessages]);
7381
- useEffect13(() => {
7437
+ useEffect14(() => {
7382
7438
  var _a66;
7383
7439
  const conversationId = (_a66 = activeChatUser == null ? void 0 : activeChatUser.id) != null ? _a66 : null;
7384
7440
  if (!conversationId) {
@@ -7437,31 +7493,31 @@ var UserMenuCupcode = ({
7437
7493
  if (!replyToMessageId) return null;
7438
7494
  return (_a66 = activeChatMessagesMap.get(replyToMessageId)) != null ? _a66 : null;
7439
7495
  }, [activeChatMessagesMap, replyToMessageId]);
7440
- useEffect13(() => {
7496
+ useEffect14(() => {
7441
7497
  if (!replyToMessageId) return;
7442
7498
  if (!activeChatMessagesMap.has(replyToMessageId)) {
7443
7499
  setReplyToMessageId(null);
7444
7500
  }
7445
7501
  }, [activeChatMessagesMap, replyToMessageId]);
7446
- useEffect13(() => {
7502
+ useEffect14(() => {
7447
7503
  if (!activeReactionPickerMessageId) return;
7448
7504
  if (!activeChatMessagesMap.has(activeReactionPickerMessageId)) {
7449
7505
  setActiveReactionPicker(null);
7450
7506
  }
7451
7507
  }, [activeChatMessagesMap, activeReactionPickerMessageId]);
7452
- useEffect13(() => {
7508
+ useEffect14(() => {
7453
7509
  if (!editingMessageId) return;
7454
7510
  if (!activeChatMessagesMap.has(editingMessageId)) {
7455
7511
  setEditingMessageId(null);
7456
7512
  setEditingDraft("");
7457
7513
  }
7458
7514
  }, [activeChatMessagesMap, editingMessageId]);
7459
- useEffect13(() => {
7515
+ useEffect14(() => {
7460
7516
  if (!activeChatUser) {
7461
7517
  setIsChatLogsDialogOpen(false);
7462
7518
  }
7463
7519
  }, [activeChatUser]);
7464
- useEffect13(() => {
7520
+ useEffect14(() => {
7465
7521
  var _a66;
7466
7522
  if (!open || activeTab !== "chat" || !activeChatUser || activeChatUser.isGroup) return;
7467
7523
  const unreadCount = (_a66 = resolvedChatUnreadByUser[activeChatUser.id]) != null ? _a66 : 0;
@@ -8158,7 +8214,7 @@ var UserMenuCupcode = ({
8158
8214
  !hasTelescupAvatarSupport ? /* @__PURE__ */ jsx42("p", { className: "text-center text-xs text-muted-foreground", children: "Telescup indispon\xEDvel neste ambiente." }) : null
8159
8215
  ] }),
8160
8216
  /* @__PURE__ */ jsxs27(DialogPrimitive3.Close, { className: "absolute right-3 top-3 inline-flex h-8 w-8 items-center justify-center rounded-full border border-border/70 bg-background/70 text-muted-foreground transition-all hover:bg-background hover:text-foreground", children: [
8161
- /* @__PURE__ */ jsx42(X5, { className: "h-4 w-4" }),
8217
+ /* @__PURE__ */ jsx42(X4, { className: "h-4 w-4" }),
8162
8218
  /* @__PURE__ */ jsx42("span", { className: "sr-only", children: "Fechar" })
8163
8219
  ] })
8164
8220
  ] })
@@ -8373,7 +8429,7 @@ var UserMenuCupcode = ({
8373
8429
  onClick: () => setIsNotificationsPreferencesBackVisible(false),
8374
8430
  className: "inline-flex h-7 items-center gap-1 rounded-md border border-border/70 px-2 text-xs font-semibold text-foreground transition-all hover:bg-muted/45",
8375
8431
  children: [
8376
- /* @__PURE__ */ jsx42(X5, { className: "h-3 w-3" }),
8432
+ /* @__PURE__ */ jsx42(X4, { className: "h-3 w-3" }),
8377
8433
  "Voltar"
8378
8434
  ]
8379
8435
  }
@@ -9063,7 +9119,7 @@ var UserMenuCupcode = ({
9063
9119
  onClick: () => setReplyToMessageId(null),
9064
9120
  className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded-md border border-transparent text-muted-foreground transition-all hover:border-border/70 hover:bg-background/45 hover:text-foreground",
9065
9121
  "aria-label": "Cancelar resposta",
9066
- children: /* @__PURE__ */ jsx42(X5, { className: "h-3 w-3" })
9122
+ children: /* @__PURE__ */ jsx42(X4, { className: "h-3 w-3" })
9067
9123
  }
9068
9124
  )
9069
9125
  ] }) : null,
@@ -9777,7 +9833,7 @@ var UserMenuCupcode = ({
9777
9833
  type: "button",
9778
9834
  onClick: () => openChatPanel(),
9779
9835
  className: cn(
9780
- "relative z-0 inline-flex h-9 min-w-[2.55rem] origin-right items-center justify-center rounded-[12px] border border-border/70 bg-background/80 px-2.5 text-foreground shadow-[0_10px_22px_-18px_rgba(0,0,0,0.75)] transition-[transform,opacity] duration-[260ms] will-change-transform",
9836
+ "relative z-0 inline-flex h-9 min-w-[2.55rem] origin-right items-center justify-center rounded-[12px] border border-border/70 bg-background/80 px-2.5 text-foreground shadow-[0_10px_22px_-18px_rgba(0,0,0,0.75)] transition-[transform,opacity] [transition-duration:260ms] will-change-transform",
9781
9837
  prefersReducedMotion ? isChatIndicatorVisible ? "opacity-100" : "opacity-0" : isChatIndicatorVisible ? "translate-x-0 opacity-100" : "translate-x-[10px] opacity-0"
9782
9838
  ),
9783
9839
  style: {
@@ -9790,7 +9846,7 @@ var UserMenuCupcode = ({
9790
9846
  "span",
9791
9847
  {
9792
9848
  className: cn(
9793
- "relative inline-flex transition-[transform,opacity] duration-[220ms]",
9849
+ "relative inline-flex transition-[transform,opacity] [transition-duration:220ms]",
9794
9850
  prefersReducedMotion ? isChatIndicatorVisible ? "scale-100 opacity-100" : "scale-100 opacity-0" : isChatIndicatorVisible ? isChatIndicatorIntroAnimating ? "scale-[1.08] opacity-100" : "scale-100 opacity-100" : "scale-[0.84] opacity-0"
9795
9851
  ),
9796
9852
  style: {
@@ -9803,7 +9859,7 @@ var UserMenuCupcode = ({
9803
9859
  "span",
9804
9860
  {
9805
9861
  className: cn(
9806
- "absolute -right-1 -top-1 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full border border-background bg-destructive px-1 text-[9px] font-bold text-destructive-foreground transition-[transform,opacity] duration-[180ms]",
9862
+ "absolute -right-1 -top-1 inline-flex h-4 min-w-[1rem] items-center justify-center rounded-full border border-background bg-destructive px-1 text-[9px] font-bold text-destructive-foreground transition-[transform,opacity] [transition-duration:180ms]",
9807
9863
  prefersReducedMotion ? isChatIndicatorVisible ? "scale-100 opacity-100" : "scale-100 opacity-0" : isChatIndicatorVisible ? isChatBadgePulsing ? "scale-[1.14] opacity-100" : "scale-100 opacity-100" : "scale-[0.72] opacity-0"
9808
9864
  ),
9809
9865
  style: {
@@ -9844,7 +9900,7 @@ var UserMenuCupcode = ({
9844
9900
  /* @__PURE__ */ jsx42(DialogPrimitive3.Title, { className: "sr-only", children: "Menu do usu\xE1rio" }),
9845
9901
  /* @__PURE__ */ jsx42(DialogPrimitive3.Description, { className: "sr-only", children: "Painel lateral com perfil, notifica\xE7\xF5es, chat e configura\xE7\xF5es." }),
9846
9902
  /* @__PURE__ */ jsxs27(DialogPrimitive3.Close, { className: "absolute right-3 top-3 z-10 flex h-10 w-10 items-center justify-center rounded-full border border-border/70 bg-background/40 text-foreground transition-all hover:bg-muted/60 sm:-right-[58px]", children: [
9847
- /* @__PURE__ */ jsx42(X5, { className: "h-5 w-5" }),
9903
+ /* @__PURE__ */ jsx42(X4, { className: "h-5 w-5" }),
9848
9904
  /* @__PURE__ */ jsx42("span", { className: "sr-only", children: "Fechar menu" })
9849
9905
  ] }),
9850
9906
  /* @__PURE__ */ jsxs27("div", { className: "relative flex h-full flex-col p-3 sm:p-4", children: [
@@ -22432,7 +22488,7 @@ var MainNavbar = ({
22432
22488
  ctaHref = "/login",
22433
22489
  pathname,
22434
22490
  onNavigate,
22435
- authStatus = "unauthenticated",
22491
+ authStatus,
22436
22492
  authUser,
22437
22493
  presenceStatus,
22438
22494
  onPresenceStatusChange,
@@ -22453,8 +22509,8 @@ var MainNavbar = ({
22453
22509
  const [accountsLanguage, setAccountsLanguage] = useState13("pt-BR");
22454
22510
  const [accountsRecentActivity, setAccountsRecentActivity] = useState13([]);
22455
22511
  const [isAccountsActivityLoading, setIsAccountsActivityLoading] = useState13(false);
22456
- const chatMessagesRef = useRef11([]);
22457
- const chatFeatureFlagsRef = useRef11(readStoredChatFeatureFlags());
22512
+ const chatMessagesRef = useRef12([]);
22513
+ const chatFeatureFlagsRef = useRef12(readStoredChatFeatureFlags());
22458
22514
  const updateChatFeatureFlags = useCallback6((partial) => {
22459
22515
  const nextFlags = {
22460
22516
  ...chatFeatureFlagsRef.current,
@@ -22483,8 +22539,15 @@ var MainNavbar = ({
22483
22539
  }, []);
22484
22540
  const resolvedProfileAvatarUrl = (_b5 = (_a65 = resolveChatAvatarUrl(persistedProfileAvatarValue)) != null ? _a65 : authUser == null ? void 0 : authUser.picture) != null ? _b5 : void 0;
22485
22541
  const effectiveCurrentUserId = resolvedSenderId != null ? resolvedSenderId : currentUserId;
22486
- const isAuthenticated = authStatus === "authenticated";
22487
- useEffect15(() => {
22542
+ const resolvedAuthStatus = useMemo8(() => {
22543
+ if (authStatus) return authStatus;
22544
+ if ((authUser == null ? void 0 : authUser.sub) || (authUser == null ? void 0 : authUser.email)) {
22545
+ return "authenticated";
22546
+ }
22547
+ return "unauthenticated";
22548
+ }, [authStatus, authUser == null ? void 0 : authUser.email, authUser == null ? void 0 : authUser.sub]);
22549
+ const isAuthenticated = resolvedAuthStatus === "authenticated";
22550
+ useEffect16(() => {
22488
22551
  if (!isAuthenticated) {
22489
22552
  setResolvedSenderId(null);
22490
22553
  setPersistedProfileAvatarValue(void 0);
@@ -22563,7 +22626,7 @@ var MainNavbar = ({
22563
22626
  canceled = true;
22564
22627
  };
22565
22628
  }, [authEmail, currentUserId, isAuthenticated]);
22566
- useEffect15(() => {
22629
+ useEffect16(() => {
22567
22630
  if (!isAuthenticated) return;
22568
22631
  if (typeof window === "undefined") return;
22569
22632
  const controller = new AbortController();
@@ -22639,10 +22702,10 @@ var MainNavbar = ({
22639
22702
  controller.abort();
22640
22703
  };
22641
22704
  }, [getAccessToken, isAuthenticated, currentUserId]);
22642
- useEffect15(() => {
22705
+ useEffect16(() => {
22643
22706
  chatMessagesRef.current = chatMessages;
22644
22707
  }, [chatMessages]);
22645
- useEffect15(() => {
22708
+ useEffect16(() => {
22646
22709
  if (!isAuthenticated) {
22647
22710
  setChatUsers([]);
22648
22711
  setChatMessages([]);
@@ -23015,7 +23078,7 @@ var MainNavbar = ({
23015
23078
  canceled = true;
23016
23079
  };
23017
23080
  }, [effectiveCurrentUserId, isAuthenticated, isChatSuperAdmin, updateChatFeatureFlags]);
23018
- useEffect15(() => {
23081
+ useEffect16(() => {
23019
23082
  if (!isAuthenticated || !effectiveCurrentUserId) return;
23020
23083
  const supabase = getSupabase();
23021
23084
  if (!supabase) return;
@@ -23844,8 +23907,8 @@ var MainNavbar = ({
23844
23907
  actions: /* @__PURE__ */ jsx45("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx45(
23845
23908
  UserMenuCupcode,
23846
23909
  {
23847
- isAuthenticated: authStatus === "authenticated",
23848
- isLoading: authStatus === "loading",
23910
+ isAuthenticated: resolvedAuthStatus === "authenticated",
23911
+ isLoading: resolvedAuthStatus === "loading",
23849
23912
  loginLabel: ctaLabel,
23850
23913
  displayName: authUser == null ? void 0 : authUser.name,
23851
23914
  username: (_c = authUser == null ? void 0 : authUser.preferredUsername) != null ? _c : authUser == null ? void 0 : authUser.nickname,
@@ -23894,15 +23957,15 @@ var MainNavbar = ({
23894
23957
  };
23895
23958
 
23896
23959
  // src/components/cupcode/ParticleSystem.tsx
23897
- import { useEffect as useEffect16, useRef as useRef12 } from "react";
23960
+ import { useEffect as useEffect17, useRef as useRef13 } from "react";
23898
23961
  import { jsx as jsx46 } from "react/jsx-runtime";
23899
23962
  function ParticleSystem({
23900
23963
  count: count2 = 50,
23901
23964
  variant = "stars",
23902
23965
  className
23903
23966
  }) {
23904
- const canvasRef = useRef12(null);
23905
- useEffect16(() => {
23967
+ const canvasRef = useRef13(null);
23968
+ useEffect17(() => {
23906
23969
  const canvas = canvasRef.current;
23907
23970
  if (!canvas) return;
23908
23971
  const ctx = canvas.getContext("2d");
@@ -24549,7 +24612,7 @@ function Timeline({ items, variant = "vertical", className }) {
24549
24612
  }
24550
24613
 
24551
24614
  // src/components/cupcode/ToastCupcode.tsx
24552
- import { X as X6, CheckCircle, AlertCircle, Info as Info2, AlertTriangle as AlertTriangle2 } from "lucide-react";
24615
+ import { X as X5, CheckCircle, AlertCircle, Info as Info2, AlertTriangle as AlertTriangle2 } from "lucide-react";
24553
24616
  import { jsx as jsx56, jsxs as jsxs36 } from "react/jsx-runtime";
24554
24617
  var variantStyles2 = {
24555
24618
  success: {
@@ -24608,7 +24671,7 @@ var ToastCupcode = ({
24608
24671
  {
24609
24672
  onClick: onClose,
24610
24673
  className: "shrink-0 rounded-md p-1 hover:bg-cupcode-ink/10 transition-colors",
24611
- children: /* @__PURE__ */ jsx56(X6, { className: "h-4 w-4 text-cupcode-ink/50" })
24674
+ children: /* @__PURE__ */ jsx56(X5, { className: "h-4 w-4 text-cupcode-ink/50" })
24612
24675
  }
24613
24676
  )
24614
24677
  ] })
@@ -25986,7 +26049,7 @@ Separator5.displayName = SeparatorPrimitive.Root.displayName;
25986
26049
  // src/components/ui/sheet.tsx
25987
26050
  import * as SheetPrimitive from "@radix-ui/react-dialog";
25988
26051
  import { cva as cva6 } from "class-variance-authority";
25989
- import { X as X7 } from "lucide-react";
26052
+ import { X as X6 } from "lucide-react";
25990
26053
  import * as React56 from "react";
25991
26054
  import { jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
25992
26055
  var Sheet = SheetPrimitive.Root;
@@ -26022,14 +26085,31 @@ var sheetVariants = cva6(
26022
26085
  }
26023
26086
  );
26024
26087
  var SheetContent = React56.forwardRef(
26025
- ({ side = "right", className, children, ...props }, ref) => /* @__PURE__ */ jsxs47(SheetPortal, { children: [
26088
+ ({
26089
+ side = "right",
26090
+ className,
26091
+ children,
26092
+ showCloseButton = false,
26093
+ closeButtonClassName,
26094
+ closeButtonLabel = "Close",
26095
+ ...props
26096
+ }, ref) => /* @__PURE__ */ jsxs47(SheetPortal, { children: [
26026
26097
  /* @__PURE__ */ jsx79(SheetOverlay, {}),
26027
26098
  /* @__PURE__ */ jsxs47(SheetPrimitive.Content, { ref, className: cn(sheetVariants({ side }), className), ...props, children: [
26028
26099
  children,
26029
- /* @__PURE__ */ jsxs47(SheetPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none", children: [
26030
- /* @__PURE__ */ jsx79(X7, { className: "h-4 w-4" }),
26031
- /* @__PURE__ */ jsx79("span", { className: "sr-only", children: "Close" })
26032
- ] })
26100
+ showCloseButton ? /* @__PURE__ */ jsxs47(
26101
+ SheetPrimitive.Close,
26102
+ {
26103
+ className: cn(
26104
+ "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity data-[state=open]:bg-secondary hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none",
26105
+ closeButtonClassName
26106
+ ),
26107
+ children: [
26108
+ /* @__PURE__ */ jsx79(X6, { className: "h-4 w-4" }),
26109
+ /* @__PURE__ */ jsx79("span", { className: "sr-only", children: closeButtonLabel })
26110
+ ]
26111
+ }
26112
+ ) : null
26033
26113
  ] })
26034
26114
  ] })
26035
26115
  );
@@ -26160,7 +26240,7 @@ var Sidebar = React58.forwardRef(({ side = "left", variant = "sidebar", collapsi
26160
26240
  {
26161
26241
  "data-sidebar": "sidebar",
26162
26242
  "data-mobile": "true",
26163
- className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",
26243
+ className: "w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground",
26164
26244
  style: {
26165
26245
  "--sidebar-width": SIDEBAR_WIDTH_MOBILE
26166
26246
  },
@@ -26632,7 +26712,7 @@ TableCaption.displayName = "TableCaption";
26632
26712
  import * as React61 from "react";
26633
26713
  import * as ToastPrimitives from "@radix-ui/react-toast";
26634
26714
  import { cva as cva8 } from "class-variance-authority";
26635
- import { X as X8 } from "lucide-react";
26715
+ import { X as X7 } from "lucide-react";
26636
26716
  import { jsx as jsx83 } from "react/jsx-runtime";
26637
26717
  var ToastProvider = ToastPrimitives.Provider;
26638
26718
  var ToastViewport = React61.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx83(
@@ -26691,7 +26771,7 @@ var ToastClose = React61.forwardRef(({ className, onClick, ...props }, ref) => /
26691
26771
  },
26692
26772
  "toast-close": "",
26693
26773
  ...props,
26694
- children: /* @__PURE__ */ jsx83(X8, { className: "h-4 w-4" })
26774
+ children: /* @__PURE__ */ jsx83(X7, { className: "h-4 w-4" })
26695
26775
  }
26696
26776
  ));
26697
26777
  ToastClose.displayName = ToastPrimitives.Close.displayName;
@@ -26778,11 +26858,11 @@ var ToggleGroupItem = React63.forwardRef(({ className, children, variant, size,
26778
26858
  ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
26779
26859
 
26780
26860
  // src/hooks/useActiveSection.ts
26781
- import { useEffect as useEffect22, useState as useState18 } from "react";
26861
+ import { useEffect as useEffect23, useState as useState18 } from "react";
26782
26862
  var useActiveSection = (sectionIds, offset = 180) => {
26783
26863
  var _a65;
26784
26864
  const [activeId, setActiveId] = useState18((_a65 = sectionIds[0]) != null ? _a65 : "");
26785
- useEffect22(() => {
26865
+ useEffect23(() => {
26786
26866
  if (!sectionIds.length || typeof window === "undefined") return;
26787
26867
  const update = () => {
26788
26868
  let nextActive = sectionIds[0];
@@ -26809,7 +26889,7 @@ var useActiveSection = (sectionIds, offset = 180) => {
26809
26889
  };
26810
26890
 
26811
26891
  // src/lib/auth.tsx
26812
- import { createContext as createContext6, useCallback as useCallback9, useContext as useContext7, useEffect as useEffect23, useMemo as useMemo11, useRef as useRef13, useState as useState19 } from "react";
26892
+ import { createContext as createContext6, useCallback as useCallback9, useContext as useContext7, useEffect as useEffect24, useMemo as useMemo11, useRef as useRef14, useState as useState19 } from "react";
26813
26893
  import { jsx as jsx87 } from "react/jsx-runtime";
26814
26894
  var STORAGE_KEYS = {
26815
26895
  accessToken: "cc_access_token",
@@ -26912,13 +26992,13 @@ var AuthProvider = ({ children }) => {
26912
26992
  const [accessToken, setAccessToken] = useState19(null);
26913
26993
  const [user, setUser] = useState19(null);
26914
26994
  const [presenceStatus, setPresenceStatusState] = useState19(() => readStoredPresence());
26915
- const presenceStatusRef = useRef13(readStoredPresence());
26916
- const presenceSourceRef = useRef13(readStoredPresenceSource());
26917
- const lastManualPresenceRef = useRef13(
26995
+ const presenceStatusRef = useRef14(readStoredPresence());
26996
+ const presenceSourceRef = useRef14(readStoredPresenceSource());
26997
+ const lastManualPresenceRef = useRef14(
26918
26998
  readStoredPresence() === "offline" ? DEFAULT_PRESENCE_STATUS : readStoredPresence()
26919
26999
  );
26920
- const lastActivityAtRef = useRef13(Date.now());
26921
- const lastActivityBroadcastAtRef = useRef13(0);
27000
+ const lastActivityAtRef = useRef14(Date.now());
27001
+ const lastActivityBroadcastAtRef = useRef14(0);
26922
27002
  const storePresenceStatus = useCallback9((nextStatus) => {
26923
27003
  setPresenceStatusState(nextStatus);
26924
27004
  presenceStatusRef.current = nextStatus;
@@ -27038,7 +27118,7 @@ var AuthProvider = ({ children }) => {
27038
27118
  });
27039
27119
  return true;
27040
27120
  }, [startAuthorization]);
27041
- useEffect23(() => {
27121
+ useEffect24(() => {
27042
27122
  let cancelled = false;
27043
27123
  const initializeAuth = async () => {
27044
27124
  var _a65;
@@ -27075,11 +27155,11 @@ var AuthProvider = ({ children }) => {
27075
27155
  cancelled = true;
27076
27156
  };
27077
27157
  }, [attemptSilentLogin]);
27078
- useEffect23(() => {
27158
+ useEffect24(() => {
27079
27159
  if (status !== "authenticated") return;
27080
27160
  void loadPresenceFromDatabase(user);
27081
27161
  }, [loadPresenceFromDatabase, status, user]);
27082
- useEffect23(() => {
27162
+ useEffect24(() => {
27083
27163
  var _a65;
27084
27164
  if (status !== "authenticated") return;
27085
27165
  const initialFromStorage = Number((_a65 = localStorage.getItem(LOCAL_STORAGE_KEYS.lastActivityAt)) != null ? _a65 : "0");