@carlonicora/nextjs-jsonapi 1.122.0 → 1.123.0

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.
@@ -4416,17 +4416,34 @@ __name(TableCaption, "TableCaption");
4416
4416
  // src/shadcnui/ui/tabs.tsx
4417
4417
  import { Tabs as TabsPrimitive } from "@base-ui/react/tabs";
4418
4418
  import { cva as cva9 } from "class-variance-authority";
4419
+ import { createContext as createContext4, useContext as useContext5, useState as useState4 } from "react";
4419
4420
  import { jsx as jsx45 } from "react/jsx-runtime";
4420
- function Tabs({ className, orientation = "horizontal", ...props }) {
4421
- return /* @__PURE__ */ jsx45(
4421
+ var TabsActiveValueContext = createContext4(void 0);
4422
+ function Tabs({
4423
+ className,
4424
+ orientation = "horizontal",
4425
+ value,
4426
+ defaultValue,
4427
+ onValueChange,
4428
+ ...props
4429
+ }) {
4430
+ const [uncontrolledValue, setUncontrolledValue] = useState4(defaultValue);
4431
+ const activeValue = value !== void 0 ? value : uncontrolledValue;
4432
+ return /* @__PURE__ */ jsx45(TabsActiveValueContext.Provider, { value: activeValue, children: /* @__PURE__ */ jsx45(
4422
4433
  TabsPrimitive.Root,
4423
4434
  {
4424
4435
  "data-slot": "tabs",
4425
4436
  "data-orientation": orientation,
4426
4437
  className: cn("gap-2 group/tabs flex data-[orientation=horizontal]:flex-col", className),
4438
+ value,
4439
+ defaultValue,
4440
+ onValueChange: (newValue, eventDetails) => {
4441
+ setUncontrolledValue(newValue);
4442
+ onValueChange?.(newValue, eventDetails);
4443
+ },
4427
4444
  ...props
4428
4445
  }
4429
- );
4446
+ ) });
4430
4447
  }
4431
4448
  __name(Tabs, "Tabs");
4432
4449
  var tabsListVariants = cva9(
@@ -4476,13 +4493,21 @@ function TabsTrigger({ className, ...props }) {
4476
4493
  );
4477
4494
  }
4478
4495
  __name(TabsTrigger, "TabsTrigger");
4479
- function TabsContent({ className, ...props }) {
4496
+ function TabsContent({ className, value, keepMounted, children, ...props }) {
4497
+ const activeValue = useContext5(TabsActiveValueContext);
4498
+ const isActive = activeValue !== void 0 && activeValue === value;
4499
+ const [hasBeenActive, setHasBeenActive] = useState4(isActive);
4500
+ if (isActive && !hasBeenActive) setHasBeenActive(true);
4501
+ const shouldRenderChildren = !keepMounted || activeValue === void 0 || hasBeenActive;
4480
4502
  return /* @__PURE__ */ jsx45(
4481
4503
  TabsPrimitive.Panel,
4482
4504
  {
4483
4505
  "data-slot": "tabs-content",
4506
+ value,
4507
+ keepMounted,
4484
4508
  className: cn("text-xs/relaxed flex-1 outline-none", className),
4485
- ...props
4509
+ ...props,
4510
+ children: shouldRenderChildren ? children : null
4486
4511
  }
4487
4512
  );
4488
4513
  }
@@ -6151,7 +6176,7 @@ __name(EntityAvatar, "EntityAvatar");
6151
6176
 
6152
6177
  // src/features/company/contexts/CompanyContext.tsx
6153
6178
  import { useTranslations as useTranslations38 } from "next-intl";
6154
- import { Fragment as Fragment19, createContext as createContext9, useContext as useContext10, useState as useState34 } from "react";
6179
+ import { Fragment as Fragment19, createContext as createContext10, useContext as useContext11, useState as useState35 } from "react";
6155
6180
 
6156
6181
  // src/hooks/TableGeneratorRegistry.ts
6157
6182
  var TableGeneratorRegistry = class _TableGeneratorRegistry {
@@ -6259,14 +6284,14 @@ function useUrlRewriter() {
6259
6284
  __name(useUrlRewriter, "useUrlRewriter");
6260
6285
 
6261
6286
  // src/hooks/useDataListRetriever.ts
6262
- import { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef6, useState as useState7 } from "react";
6287
+ import { useCallback as useCallback7, useEffect as useEffect6, useMemo as useMemo7, useRef as useRef6, useState as useState8 } from "react";
6263
6288
  function useDataListRetriever(params) {
6264
- const [data, setData] = useState7(void 0);
6265
- const [total, setTotal] = useState7(void 0);
6266
- const [nextPage, setNextPage] = useState7(void 0);
6267
- const [previousPage, setPreviousPage] = useState7(void 0);
6268
- const [isLoaded, setIsLoaded] = useState7(false);
6269
- const [ready, setReady] = useState7(params.ready ?? true);
6289
+ const [data, setData] = useState8(void 0);
6290
+ const [total, setTotal] = useState8(void 0);
6291
+ const [nextPage, setNextPage] = useState8(void 0);
6292
+ const [previousPage, setPreviousPage] = useState8(void 0);
6293
+ const [isLoaded, setIsLoaded] = useState8(false);
6294
+ const [ready, setReady] = useState8(params.ready ?? true);
6270
6295
  const searchTermRef = useRef6("");
6271
6296
  const additionalParamsRef = useRef6({});
6272
6297
  const requestIdRef = useRef6(0);
@@ -7374,16 +7399,16 @@ function usePushNotifications() {
7374
7399
  __name(usePushNotifications, "usePushNotifications");
7375
7400
 
7376
7401
  // src/hooks/useSocket.ts
7377
- import { useEffect as useEffect12, useRef as useRef9, useState as useState8 } from "react";
7402
+ import { useEffect as useEffect12, useRef as useRef9, useState as useState9 } from "react";
7378
7403
  import io from "socket.io-client";
7379
7404
  function useSocket({ token }) {
7380
7405
  const _errorCount = useRef9(0);
7381
7406
  const shouldConnect = useRef9(true);
7382
7407
  const _hookInstanceId = useRef9(Math.random().toString(36).substring(2, 11));
7383
- const [socket, setSocket] = useState8(null);
7384
- const [isConnected, setIsConnected] = useState8(false);
7385
- const [messages, setMessages] = useState8([]);
7386
- const [socketNotifications, setSocketNotifications] = useState8([]);
7408
+ const [socket, setSocket] = useState9(null);
7409
+ const [isConnected, setIsConnected] = useState9(false);
7410
+ const [messages, setMessages] = useState9([]);
7411
+ const [socketNotifications, setSocketNotifications] = useState9([]);
7387
7412
  const socketRef = useRef9(null);
7388
7413
  useEffect12(() => {
7389
7414
  if (!token) return;
@@ -7529,10 +7554,10 @@ __name(useSocket, "useSocket");
7529
7554
  import { useAtom as useAtom2 } from "jotai";
7530
7555
  import { atomWithStorage as atomWithStorage2 } from "jotai/utils";
7531
7556
  import { usePathname as usePathname2 } from "next/navigation";
7532
- import { createContext as createContext6, useCallback as useCallback10, useContext as useContext7, useEffect as useEffect13, useRef as useRef10, useState as useState9 } from "react";
7557
+ import { createContext as createContext7, useCallback as useCallback10, useContext as useContext8, useEffect as useEffect13, useRef as useRef10, useState as useState10 } from "react";
7533
7558
 
7534
7559
  // src/contexts/SocketContext.tsx
7535
- import { createContext as createContext5, useContext as useContext6 } from "react";
7560
+ import { createContext as createContext6, useContext as useContext7 } from "react";
7536
7561
  import { jsx as jsx53 } from "react/jsx-runtime";
7537
7562
  var defaultContextValue = {
7538
7563
  socket: null,
@@ -7550,7 +7575,7 @@ var defaultContextValue = {
7550
7575
  clearSocketNotifications: /* @__PURE__ */ __name(() => {
7551
7576
  }, "clearSocketNotifications")
7552
7577
  };
7553
- var SocketContext = createContext5(defaultContextValue);
7578
+ var SocketContext = createContext6(defaultContextValue);
7554
7579
  var SocketProvider = /* @__PURE__ */ __name(({ token, children }) => {
7555
7580
  const socketHookData = token ? useSocket({ token }) : null;
7556
7581
  const sendMessage = /* @__PURE__ */ __name((event, data) => {
@@ -7568,7 +7593,7 @@ var SocketProvider = /* @__PURE__ */ __name(({ token, children }) => {
7568
7593
  return /* @__PURE__ */ jsx53(SocketContext.Provider, { value, children });
7569
7594
  }, "SocketProvider");
7570
7595
  var useSocketContext = /* @__PURE__ */ __name(() => {
7571
- const context = useContext6(SocketContext);
7596
+ const context = useContext7(SocketContext);
7572
7597
  if (!context) {
7573
7598
  throw new Error("useSocketContext must be used within a SocketProvider");
7574
7599
  }
@@ -7578,7 +7603,7 @@ var useSocketContext = /* @__PURE__ */ __name(() => {
7578
7603
  // src/features/user/contexts/CurrentUserContext.tsx
7579
7604
  import { jsx as jsx54 } from "react/jsx-runtime";
7580
7605
  var userAtom = atomWithStorage2("user", null);
7581
- var CurrentUserContext = createContext6(void 0);
7606
+ var CurrentUserContext = createContext7(void 0);
7582
7607
  var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
7583
7608
  const path = usePathname2();
7584
7609
  const [dehydratedUser, setDehydratedUser] = useAtom2(userAtom);
@@ -7634,7 +7659,7 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
7634
7659
  return response;
7635
7660
  }
7636
7661
  __name(hasPermissionToPath, "hasPermissionToPath");
7637
- const [isRefreshing, setIsRefreshing] = useState9(false);
7662
+ const [isRefreshing, setIsRefreshing] = useState10(false);
7638
7663
  const refreshUser = useCallback10(
7639
7664
  async (options) => {
7640
7665
  if (isRefreshing) {
@@ -7710,7 +7735,7 @@ var CurrentUserProvider = /* @__PURE__ */ __name(({ children }) => {
7710
7735
  );
7711
7736
  }, "CurrentUserProvider");
7712
7737
  function useCurrentUserContext() {
7713
- const context = useContext7(CurrentUserContext);
7738
+ const context = useContext8(CurrentUserContext);
7714
7739
  if (context === void 0) {
7715
7740
  throw new Error("useCurrentUserContext must be used within a UserProvider");
7716
7741
  }
@@ -7720,18 +7745,18 @@ __name(useCurrentUserContext, "useCurrentUserContext");
7720
7745
 
7721
7746
  // src/features/user/contexts/UserContext.tsx
7722
7747
  import { useTranslations as useTranslations21 } from "next-intl";
7723
- import { createContext as createContext8, useContext as useContext9, useState as useState31 } from "react";
7748
+ import { createContext as createContext9, useContext as useContext10, useState as useState32 } from "react";
7724
7749
 
7725
7750
  // src/features/user/components/forms/RoleUserAdd.tsx
7726
7751
  import { useTranslations } from "next-intl";
7727
- import { useEffect as useEffect14, useState as useState10 } from "react";
7752
+ import { useEffect as useEffect14, useState as useState11 } from "react";
7728
7753
  import { Fragment as Fragment5, jsx as jsx55, jsxs as jsxs27 } from "react/jsx-runtime";
7729
7754
  function AddUserToRoleInternal({ role, refresh }) {
7730
7755
  const { company } = useCurrentUserContext();
7731
- const [show, setShow] = useState10(false);
7732
- const [users, setUsers] = useState10([]);
7756
+ const [show, setShow] = useState11(false);
7757
+ const [users, setUsers] = useState11([]);
7733
7758
  const t = useTranslations();
7734
- const [existingUsers, setExistingUsers] = useState10(null);
7759
+ const [existingUsers, setExistingUsers] = useState11(null);
7735
7760
  useEffect14(() => {
7736
7761
  const fetchExistingUsers = /* @__PURE__ */ __name(async () => {
7737
7762
  setExistingUsers(await UserService.findMany({ roleId: role.id, fetchAll: true }));
@@ -7800,10 +7825,10 @@ __name(AddUserToRole, "AddUserToRole");
7800
7825
  import { UploadIcon } from "lucide-react";
7801
7826
  import { useTranslations as useTranslations2 } from "next-intl";
7802
7827
  import Image from "next/image";
7803
- import { useEffect as useEffect15, useState as useState11 } from "react";
7828
+ import { useEffect as useEffect15, useState as useState12 } from "react";
7804
7829
  import { jsx as jsx56, jsxs as jsxs28 } from "react/jsx-runtime";
7805
7830
  function UserAvatarEditor({ user, file, setFile, resetImage, setResetImage }) {
7806
- const [files, setFiles] = useState11(null);
7831
+ const [files, setFiles] = useState12(null);
7807
7832
  const t = useTranslations2();
7808
7833
  useEffect15(() => {
7809
7834
  if (files && files.length > 0) {
@@ -7893,7 +7918,7 @@ __name(UserDeleter, "UserDeleter");
7893
7918
  // src/features/user/components/forms/UserEditor.tsx
7894
7919
  import { zodResolver } from "@hookform/resolvers/zod";
7895
7920
  import { useTranslations as useTranslations4 } from "next-intl";
7896
- import { useCallback as useCallback11, useEffect as useEffect16, useMemo as useMemo9, useState as useState12 } from "react";
7921
+ import { useCallback as useCallback11, useEffect as useEffect16, useMemo as useMemo9, useState as useState13 } from "react";
7897
7922
  import { useForm } from "react-hook-form";
7898
7923
  import { v4 } from "uuid";
7899
7924
  import { z } from "zod";
@@ -7918,12 +7943,12 @@ function UserEditorInternal({
7918
7943
  } = useCurrentUserContext();
7919
7944
  const { company: companyFromContext } = useCompanyContext();
7920
7945
  const router = useI18nRouter();
7921
- const [roles, setRoles] = useState12([]);
7922
- const [file, setFile] = useState12(null);
7923
- const [contentType, setContentType] = useState12(null);
7924
- const [resetImage, setResetImage] = useState12(false);
7946
+ const [roles, setRoles] = useState13([]);
7947
+ const [file, setFile] = useState13(null);
7948
+ const [contentType, setContentType] = useState13(null);
7949
+ const [resetImage, setResetImage] = useState13(false);
7925
7950
  const t = useTranslations4();
7926
- const [company, setCompany] = useState12(companyFromContext || userCompany);
7951
+ const [company, setCompany] = useState13(companyFromContext || userCompany);
7927
7952
  useEffect16(() => {
7928
7953
  if (!companyFromContext && userCompany) setCompany(userCompany);
7929
7954
  }, [company]);
@@ -8165,7 +8190,7 @@ __name(UserEditor, "UserEditor");
8165
8190
  import { useTranslations as useTranslations5 } from "next-intl";
8166
8191
 
8167
8192
  // src/components/forms/EntityMultiSelector.tsx
8168
- import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo10, useRef as useRef11, useState as useState13 } from "react";
8193
+ import { useCallback as useCallback12, useEffect as useEffect17, useMemo as useMemo10, useRef as useRef11, useState as useState14 } from "react";
8169
8194
  import { useWatch } from "react-hook-form";
8170
8195
  import { CheckIcon as CheckIcon8, ChevronDownIcon as ChevronDownIcon7, SearchIcon as SearchIcon2, XIcon as XIcon5 } from "lucide-react";
8171
8196
 
@@ -8224,9 +8249,9 @@ function EntityMultiSelector({
8224
8249
  onChange,
8225
8250
  renderOption
8226
8251
  }) {
8227
- const [open, setOpen] = useState13(false);
8228
- const [searchTerm, setSearchTerm] = useState13("");
8229
- const [options, setOptions] = useState13([]);
8252
+ const [open, setOpen] = useState14(false);
8253
+ const [searchTerm, setSearchTerm] = useState14("");
8254
+ const [options, setOptions] = useState14([]);
8230
8255
  const searchInputRef = useRef11(null);
8231
8256
  const getLabelRef = useRef11(getLabel);
8232
8257
  const toFormValueRef = useRef11(toFormValue);
@@ -8482,10 +8507,10 @@ __name(UserMultiSelect, "UserMultiSelect");
8482
8507
  // src/features/user/components/forms/UserReactivator.tsx
8483
8508
  import { UserCheckIcon } from "lucide-react";
8484
8509
  import { useTranslations as useTranslations6 } from "next-intl";
8485
- import { useState as useState14 } from "react";
8510
+ import { useState as useState15 } from "react";
8486
8511
  import { jsx as jsx62, jsxs as jsxs33 } from "react/jsx-runtime";
8487
8512
  function UserReactivatorInterface({ user, propagateChanges }) {
8488
- const [open, setOpen] = useState14(false);
8513
+ const [open, setOpen] = useState15(false);
8489
8514
  const t = useTranslations6();
8490
8515
  const reactivateUser = /* @__PURE__ */ __name(async () => {
8491
8516
  try {
@@ -8535,10 +8560,10 @@ __name(UserReactivator, "UserReactivator");
8535
8560
  // src/features/user/components/forms/UserResentInvitationEmail.tsx
8536
8561
  import { MailIcon } from "lucide-react";
8537
8562
  import { useTranslations as useTranslations7 } from "next-intl";
8538
- import { useState as useState15 } from "react";
8563
+ import { useState as useState16 } from "react";
8539
8564
  import { jsx as jsx63, jsxs as jsxs34 } from "react/jsx-runtime";
8540
8565
  function UserResentInvitationEmailInternal({ user }) {
8541
- const [open, setOpen] = useState15(false);
8566
+ const [open, setOpen] = useState16(false);
8542
8567
  const t = useTranslations7();
8543
8568
  const sendInvitationEmail = /* @__PURE__ */ __name(async () => {
8544
8569
  try {
@@ -8590,11 +8615,11 @@ __name(UserResentInvitationEmail, "UserResentInvitationEmail");
8590
8615
  // src/features/user/components/forms/UserSelector.tsx
8591
8616
  import { CircleX, RefreshCwIcon as RefreshCwIcon2, SearchIcon as SearchIcon4, XIcon as XIcon8 } from "lucide-react";
8592
8617
  import { useTranslations as useTranslations20 } from "next-intl";
8593
- import { useCallback as useCallback18, useEffect as useEffect27, useRef as useRef18, useState as useState30 } from "react";
8618
+ import { useCallback as useCallback18, useEffect as useEffect27, useRef as useRef18, useState as useState31 } from "react";
8594
8619
 
8595
8620
  // src/components/forms/CommonAssociationForm.tsx
8596
8621
  import { useTranslations as useTranslations8 } from "next-intl";
8597
- import { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef12, useState as useState16 } from "react";
8622
+ import { useCallback as useCallback13, useEffect as useEffect18, useRef as useRef12, useState as useState17 } from "react";
8598
8623
  import { jsx as jsx64, jsxs as jsxs35 } from "react/jsx-runtime";
8599
8624
  function CommonAssociationTrigger({
8600
8625
  sourceType,
@@ -8622,7 +8647,7 @@ function CommonAssociationCommandDialog({
8622
8647
  }) {
8623
8648
  const t = useTranslations8();
8624
8649
  const searchTermRef = useRef12("");
8625
- const [searchTerm, setSearchTerm] = useState16("");
8650
+ const [searchTerm, setSearchTerm] = useState17("");
8626
8651
  const refreshList = useCallback13(
8627
8652
  async (searchedTerm) => {
8628
8653
  if (searchedTerm === searchTermRef.current) return;
@@ -8701,7 +8726,7 @@ var triggerAssociationToast = /* @__PURE__ */ __name((params) => {
8701
8726
 
8702
8727
  // src/components/forms/CommonDeleter.tsx
8703
8728
  import { LoaderCircleIcon, Trash2Icon } from "lucide-react";
8704
- import { useState as useState17 } from "react";
8729
+ import { useState as useState18 } from "react";
8705
8730
 
8706
8731
  // src/components/errors/ErrorDetails.tsx
8707
8732
  import Image2 from "next/image";
@@ -8757,8 +8782,8 @@ function CommonDeleter({
8757
8782
  }) {
8758
8783
  const t = useI18nTranslations();
8759
8784
  const router = useI18nRouter();
8760
- const [open, setOpen] = useState17(forceShow || false);
8761
- const [isDeleting, setIsDeleting] = useState17(false);
8785
+ const [open, setOpen] = useState18(forceShow || false);
8786
+ const [isDeleting, setIsDeleting] = useState18(false);
8762
8787
  const handleDelete = /* @__PURE__ */ __name(async () => {
8763
8788
  setIsDeleting(true);
8764
8789
  try {
@@ -8926,10 +8951,10 @@ var CommonAddTrigger = React15.forwardRef(
8926
8951
  CommonAddTrigger.displayName = "CommonAddTrigger";
8927
8952
 
8928
8953
  // src/components/forms/useEditorDialog.ts
8929
- import { useCallback as useCallback14, useEffect as useEffect19, useState as useState18 } from "react";
8954
+ import { useCallback as useCallback14, useEffect as useEffect19, useState as useState19 } from "react";
8930
8955
  function useEditorDialog(isFormDirty, options) {
8931
- const [open, setOpen] = useState18(false);
8932
- const [showDiscardConfirm, setShowDiscardConfirm] = useState18(false);
8956
+ const [open, setOpen] = useState19(false);
8957
+ const [showDiscardConfirm, setShowDiscardConfirm] = useState19(false);
8933
8958
  useEffect19(() => {
8934
8959
  if (options?.dialogOpen !== void 0) {
8935
8960
  setOpen(options.dialogOpen);
@@ -9141,7 +9166,7 @@ __name(EditorSheet, "EditorSheet");
9141
9166
  // src/components/forms/DatePickerPopover.tsx
9142
9167
  import { isValid, parse } from "date-fns";
9143
9168
  import { Calendar as CalendarIcon, CircleXIcon } from "lucide-react";
9144
- import { useMemo as useMemo11, useState as useState19 } from "react";
9169
+ import { useMemo as useMemo11, useState as useState20 } from "react";
9145
9170
  import { jsx as jsx72, jsxs as jsxs42 } from "react/jsx-runtime";
9146
9171
  var DatePickerPopover = /* @__PURE__ */ __name(({
9147
9172
  children,
@@ -9153,8 +9178,8 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9153
9178
  }) => {
9154
9179
  const locale = useI18nLocale();
9155
9180
  const dateFnsLocale = useI18nDateFnsLocale();
9156
- const [isOpen, setIsOpen] = useState19(false);
9157
- const [displayMonth, setDisplayMonth] = useState19(() => value || /* @__PURE__ */ new Date());
9181
+ const [isOpen, setIsOpen] = useState20(false);
9182
+ const [displayMonth, setDisplayMonth] = useState20(() => value || /* @__PURE__ */ new Date());
9158
9183
  const dateFormatter = useMemo11(
9159
9184
  () => new Intl.DateTimeFormat(locale, { day: "2-digit", month: "2-digit", year: "numeric" }),
9160
9185
  [locale]
@@ -9178,7 +9203,7 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9178
9203
  return part.value;
9179
9204
  }).join("");
9180
9205
  }, [dateFormatter]);
9181
- const [inputValue, setInputValue] = useState19(() => value ? formatDate(value) : "");
9206
+ const [inputValue, setInputValue] = useState20(() => value ? formatDate(value) : "");
9182
9207
  const currentYear = (/* @__PURE__ */ new Date()).getFullYear();
9183
9208
  const yearOptions = Array.from({ length: currentYear - 1900 + 11 }, (_, i) => 1900 + i);
9184
9209
  const monthNames = useMemo11(() => {
@@ -9303,22 +9328,22 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9303
9328
  import { format } from "date-fns";
9304
9329
  import { CalendarIcon as CalendarIcon2 } from "lucide-react";
9305
9330
  import { useTranslations as useTranslations14 } from "next-intl";
9306
- import { useEffect as useEffect21, useState as useState20 } from "react";
9331
+ import { useEffect as useEffect21, useState as useState21 } from "react";
9307
9332
  import { Fragment as Fragment10, jsx as jsx73, jsxs as jsxs43 } from "react/jsx-runtime";
9308
9333
  function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth }) {
9309
9334
  const t = useTranslations14();
9310
- const [date, setDate] = useState20(
9335
+ const [date, setDate] = useState21(
9311
9336
  avoidSettingDates ? void 0 : {
9312
9337
  from: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth(), 1),
9313
9338
  to: new Date((/* @__PURE__ */ new Date()).getFullYear(), (/* @__PURE__ */ new Date()).getMonth() + 1, 0)
9314
9339
  }
9315
9340
  );
9316
- const [open, setOpen] = useState20(false);
9317
- const [mounted, setMounted] = useState20(false);
9341
+ const [open, setOpen] = useState21(false);
9342
+ const [mounted, setMounted] = useState21(false);
9318
9343
  useEffect21(() => {
9319
9344
  setMounted(true);
9320
9345
  }, []);
9321
- const [prevRange, setPrevRange] = useState20(date);
9346
+ const [prevRange, setPrevRange] = useState21(date);
9322
9347
  useEffect21(() => {
9323
9348
  if (date?.from && date?.to && date.to > date.from && (prevRange?.from?.getTime() !== date.from.getTime() || prevRange?.to?.getTime() !== date.to.getTime())) {
9324
9349
  onDateChange(date);
@@ -9413,20 +9438,20 @@ __name(DateRangeSelector, "DateRangeSelector");
9413
9438
  import { Trash2 as RemoveIcon } from "lucide-react";
9414
9439
  import { useTranslations as useTranslations15 } from "next-intl";
9415
9440
  import {
9416
- createContext as createContext7,
9441
+ createContext as createContext8,
9417
9442
  forwardRef as forwardRef6,
9418
9443
  useCallback as useCallback16,
9419
- useContext as useContext8,
9444
+ useContext as useContext9,
9420
9445
  useEffect as useEffect22,
9421
9446
  useMemo as useMemo12,
9422
9447
  useRef as useRef14,
9423
- useState as useState21
9448
+ useState as useState22
9424
9449
  } from "react";
9425
9450
  import { useDropzone } from "react-dropzone";
9426
9451
  import { jsx as jsx74, jsxs as jsxs44 } from "react/jsx-runtime";
9427
- var FileUploaderContext = createContext7(null);
9452
+ var FileUploaderContext = createContext8(null);
9428
9453
  var useFileUpload = /* @__PURE__ */ __name(() => {
9429
- const context = useContext8(FileUploaderContext);
9454
+ const context = useContext9(FileUploaderContext);
9430
9455
  if (!context) {
9431
9456
  throw new Error("useFileUpload must be used within a FileUploaderProvider");
9432
9457
  }
@@ -9434,9 +9459,9 @@ var useFileUpload = /* @__PURE__ */ __name(() => {
9434
9459
  }, "useFileUpload");
9435
9460
  var FileUploader = forwardRef6(
9436
9461
  ({ className, dropzoneOptions, value, onValueChange, reSelect, orientation = "vertical", children, dir, ...props }, ref) => {
9437
- const [isFileTooBig, setIsFileTooBig] = useState21(false);
9438
- const [isLOF, setIsLOF] = useState21(false);
9439
- const [activeIndex, setActiveIndex] = useState21(-1);
9462
+ const [isFileTooBig, setIsFileTooBig] = useState22(false);
9463
+ const [isLOF, setIsLOF] = useState22(false);
9464
+ const [activeIndex, setActiveIndex] = useState22(-1);
9440
9465
  const { maxFiles = 1, maxSize = 4 * 1024 * 1024, multiple = true } = dropzoneOptions;
9441
9466
  const t = useTranslations15();
9442
9467
  const reSelectAll = maxFiles === 1 ? true : reSelect;
@@ -9705,7 +9730,7 @@ var FileInput = forwardRef6(
9705
9730
  FileInput.displayName = "FileInput";
9706
9731
 
9707
9732
  // src/components/forms/CurrencyInput.tsx
9708
- import { useState as useState22 } from "react";
9733
+ import { useState as useState23 } from "react";
9709
9734
  import { jsx as jsx75, jsxs as jsxs45 } from "react/jsx-runtime";
9710
9735
  function centsToInput(cents) {
9711
9736
  return (cents / 100).toFixed(2);
@@ -9751,7 +9776,7 @@ function CurrencyInput({
9751
9776
  className,
9752
9777
  testId
9753
9778
  }) {
9754
- const [draft, setDraft] = useState22(null);
9779
+ const [draft, setDraft] = useState23(null);
9755
9780
  const display = draft !== null ? draft : centsToInput(valueCents);
9756
9781
  const handleChange = /* @__PURE__ */ __name((e) => {
9757
9782
  setDraft(sanitizeKeystroke(e.target.value));
@@ -9813,7 +9838,7 @@ import { useRef as useRef15 } from "react";
9813
9838
  import dynamic from "next/dynamic";
9814
9839
  import React17 from "react";
9815
9840
  import { jsx as jsx77 } from "react/jsx-runtime";
9816
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-AY23XLHO.mjs"), {
9841
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-4TXISWF2.mjs"), {
9817
9842
  ssr: false
9818
9843
  });
9819
9844
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -9907,7 +9932,7 @@ __name(FormBlockNote, "FormBlockNote");
9907
9932
  // src/components/forms/FormDate.tsx
9908
9933
  import { isValid as isValid2, parse as parse2 } from "date-fns";
9909
9934
  import { Calendar as CalendarIcon3, CircleXIcon as CircleXIcon2 } from "lucide-react";
9910
- import { useMemo as useMemo13, useState as useState23 } from "react";
9935
+ import { useMemo as useMemo13, useState as useState24 } from "react";
9911
9936
  import { jsx as jsx79, jsxs as jsxs47 } from "react/jsx-runtime";
9912
9937
  function FormDate({
9913
9938
  form,
@@ -9924,8 +9949,8 @@ function FormDate({
9924
9949
  const t = useI18nTranslations();
9925
9950
  const locale = useI18nLocale();
9926
9951
  const dateFnsLocale = useI18nDateFnsLocale();
9927
- const [open, setOpen] = useState23(false);
9928
- const [displayMonth, setDisplayMonth] = useState23(() => {
9952
+ const [open, setOpen] = useState24(false);
9953
+ const [displayMonth, setDisplayMonth] = useState24(() => {
9929
9954
  const currentValue = form.getValues(id);
9930
9955
  return currentValue || defaultMonth || /* @__PURE__ */ new Date();
9931
9956
  });
@@ -9952,7 +9977,7 @@ function FormDate({
9952
9977
  return part.value;
9953
9978
  }).join("");
9954
9979
  }, [dateFormatter]);
9955
- const [inputValue, setInputValue] = useState23(() => {
9980
+ const [inputValue, setInputValue] = useState24(() => {
9956
9981
  const currentValue = form.getValues(id);
9957
9982
  return currentValue ? formatDate(currentValue) : "";
9958
9983
  });
@@ -10048,7 +10073,7 @@ __name(FormDate, "FormDate");
10048
10073
 
10049
10074
  // src/components/forms/FormDateTime.tsx
10050
10075
  import { Calendar as CalendarIcon4, CircleXIcon as CircleXIcon3 } from "lucide-react";
10051
- import { useMemo as useMemo14, useState as useState24 } from "react";
10076
+ import { useMemo as useMemo14, useState as useState25 } from "react";
10052
10077
  import { jsx as jsx80, jsxs as jsxs48 } from "react/jsx-runtime";
10053
10078
  function FormDateTime({
10054
10079
  form,
@@ -10062,11 +10087,11 @@ function FormDateTime({
10062
10087
  isRequired,
10063
10088
  description
10064
10089
  }) {
10065
- const [open, setOpen] = useState24(false);
10090
+ const [open, setOpen] = useState25(false);
10066
10091
  const t = useI18nTranslations();
10067
10092
  const locale = useI18nLocale();
10068
10093
  const dateFnsLocale = useI18nDateFnsLocale();
10069
- const [displayMonth, setDisplayMonth] = useState24(() => {
10094
+ const [displayMonth, setDisplayMonth] = useState25(() => {
10070
10095
  const currentValue = form.getValues(id);
10071
10096
  return currentValue || defaultMonth || /* @__PURE__ */ new Date();
10072
10097
  });
@@ -10082,8 +10107,8 @@ function FormDateTime({
10082
10107
  [locale]
10083
10108
  );
10084
10109
  const formatDateTime = /* @__PURE__ */ __name((date) => dateTimeFormatter.format(date), "formatDateTime");
10085
- const [selectedHours, setSelectedHours] = useState24((/* @__PURE__ */ new Date()).getHours());
10086
- const [selectedMinutes, setSelectedMinutes] = useState24(roundToNearestFiveMinutes((/* @__PURE__ */ new Date()).getMinutes()));
10110
+ const [selectedHours, setSelectedHours] = useState25((/* @__PURE__ */ new Date()).getHours());
10111
+ const [selectedMinutes, setSelectedMinutes] = useState25(roundToNearestFiveMinutes((/* @__PURE__ */ new Date()).getMinutes()));
10087
10112
  const hoursOptions = Array.from({ length: 24 }, (_, i) => {
10088
10113
  const hour = i;
10089
10114
  return {
@@ -10416,7 +10441,7 @@ function FormPassword({
10416
10441
  __name(FormPassword, "FormPassword");
10417
10442
 
10418
10443
  // src/components/forms/FormPlaceAutocomplete.tsx
10419
- import { useEffect as useEffect23, useRef as useRef16, useState as useState26 } from "react";
10444
+ import { useEffect as useEffect23, useRef as useRef16, useState as useState27 } from "react";
10420
10445
  import { jsx as jsx84, jsxs as jsxs51 } from "react/jsx-runtime";
10421
10446
  function FormPlaceAutocomplete({
10422
10447
  form,
@@ -10432,12 +10457,12 @@ function FormPlaceAutocomplete({
10432
10457
  includeTypes,
10433
10458
  languageCode = "en"
10434
10459
  }) {
10435
- const [inputValue, setInputValue] = useState26("");
10436
- const [suggestions, setSuggestions] = useState26([]);
10437
- const [isLoading, setIsLoading] = useState26(false);
10438
- const [showSuggestions, setShowSuggestions] = useState26(false);
10439
- const [loadError, setLoadError] = useState26(false);
10440
- const [apiKey, setApiKey] = useState26(null);
10460
+ const [inputValue, setInputValue] = useState27("");
10461
+ const [suggestions, setSuggestions] = useState27([]);
10462
+ const [isLoading, setIsLoading] = useState27(false);
10463
+ const [showSuggestions, setShowSuggestions] = useState27(false);
10464
+ const [loadError, setLoadError] = useState27(false);
10465
+ const [apiKey, setApiKey] = useState27(null);
10441
10466
  const debounceRef = useRef16(null);
10442
10467
  const containerRef = useRef16(null);
10443
10468
  useEffect23(() => {
@@ -10803,7 +10828,7 @@ __name(GdprConsentCheckbox, "GdprConsentCheckbox");
10803
10828
  // src/components/forms/MultiFileUploader.tsx
10804
10829
  import { FileIcon, FileImageIcon, FileSpreadsheetIcon, FileTextIcon, UploadIcon as UploadIcon2, XIcon as XIcon6 } from "lucide-react";
10805
10830
  import Image3 from "next/image";
10806
- import { useEffect as useEffect24, useState as useState27 } from "react";
10831
+ import { useEffect as useEffect24, useState as useState28 } from "react";
10807
10832
  import { jsx as jsx90, jsxs as jsxs56 } from "react/jsx-runtime";
10808
10833
  var dropzone = {
10809
10834
  multiple: false,
@@ -10915,14 +10940,14 @@ __name(UserAvatarList, "UserAvatarList");
10915
10940
  // src/features/user/components/widgets/UserSearchPopover.tsx
10916
10941
  import { RefreshCwIcon, SearchIcon as SearchIcon3, XIcon as XIcon7 } from "lucide-react";
10917
10942
  import { useTranslations as useTranslations19 } from "next-intl";
10918
- import { useEffect as useEffect26, useState as useState29 } from "react";
10943
+ import { useEffect as useEffect26, useState as useState30 } from "react";
10919
10944
 
10920
10945
  // src/features/user/hooks/useUserSearch.ts
10921
- import { useCallback as useCallback17, useEffect as useEffect25, useRef as useRef17, useState as useState28 } from "react";
10946
+ import { useCallback as useCallback17, useEffect as useEffect25, useRef as useRef17, useState as useState29 } from "react";
10922
10947
  var useUserSearch = /* @__PURE__ */ __name(() => {
10923
- const [users, setUsers] = useState28([]);
10924
- const [searchQuery, setSearchQuery] = useState28("");
10925
- const [isLoading, setIsLoading] = useState28(false);
10948
+ const [users, setUsers] = useState29([]);
10949
+ const [searchQuery, setSearchQuery] = useState29("");
10950
+ const [isLoading, setIsLoading] = useState29(false);
10926
10951
  const searchQueryRef = useRef17("");
10927
10952
  const loadUsers = useCallback17(
10928
10953
  async (search) => {
@@ -11064,7 +11089,7 @@ var useUserTableStructure = /* @__PURE__ */ __name((params) => {
11064
11089
  import { jsx as jsx95, jsxs as jsxs60 } from "react/jsx-runtime";
11065
11090
  var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "start", className }) => {
11066
11091
  const t = useTranslations19();
11067
- const [isOpen, setIsOpen] = useState29(false);
11092
+ const [isOpen, setIsOpen] = useState30(false);
11068
11093
  const { users, searchQuery, setSearchQuery, isLoading, loadUsers, clearSearch } = useUserSearch();
11069
11094
  useEffect26(() => {
11070
11095
  if (isOpen && users.length === 0 && !searchQuery) {
@@ -11123,10 +11148,10 @@ var UserSearchPopover = /* @__PURE__ */ __name(({ children, onSelect, align = "s
11123
11148
  import { Fragment as Fragment12, jsx as jsx96, jsxs as jsxs61 } from "react/jsx-runtime";
11124
11149
  function UserSelector({ id, form, label, placeholder, onChange, isRequired = false }) {
11125
11150
  const t = useTranslations20();
11126
- const [open, setOpen] = useState30(false);
11151
+ const [open, setOpen] = useState31(false);
11127
11152
  const searchTermRef = useRef18("");
11128
- const [searchTerm, setSearchTerm] = useState30("");
11129
- const [isSearching, setIsSearching] = useState30(false);
11153
+ const [searchTerm, setSearchTerm] = useState31("");
11154
+ const [isSearching, setIsSearching] = useState31(false);
11130
11155
  const data = useDataListRetriever({
11131
11156
  retriever: /* @__PURE__ */ __name((params) => {
11132
11157
  return UserService.findMany(params);
@@ -11225,12 +11250,12 @@ __name(UserSelector, "UserSelector");
11225
11250
 
11226
11251
  // src/features/user/contexts/UserContext.tsx
11227
11252
  import { jsx as jsx97 } from "react/jsx-runtime";
11228
- var UserContext = createContext8(void 0);
11253
+ var UserContext = createContext9(void 0);
11229
11254
  var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
11230
11255
  const generateUrl = usePageUrlGenerator();
11231
11256
  const { hasPermissionToModule } = useCurrentUserContext();
11232
11257
  const t = useTranslations21();
11233
- const [user, setUser] = useState31(
11258
+ const [user, setUser] = useState32(
11234
11259
  dehydratedUser ? rehydrate(Modules.User, dehydratedUser) : void 0
11235
11260
  );
11236
11261
  const breadcrumb = /* @__PURE__ */ __name(() => {
@@ -11279,7 +11304,7 @@ var UserProvider = /* @__PURE__ */ __name(({ children, dehydratedUser }) => {
11279
11304
  ) });
11280
11305
  }, "UserProvider");
11281
11306
  var useUserContext = /* @__PURE__ */ __name(() => {
11282
- const context = useContext9(UserContext);
11307
+ const context = useContext10(UserContext);
11283
11308
  if (context === void 0) {
11284
11309
  throw new Error("useUserContext must be used within a UserProvider");
11285
11310
  }
@@ -11998,15 +12023,15 @@ __name(CompanyConfigurationEditor, "CompanyConfigurationEditor");
11998
12023
  // src/features/company/components/forms/CompanyDeleter.tsx
11999
12024
  import { LoaderCircleIcon as LoaderCircleIcon2, Trash2Icon as Trash2Icon2 } from "lucide-react";
12000
12025
  import { useTranslations as useTranslations35 } from "next-intl";
12001
- import { useState as useState32 } from "react";
12026
+ import { useState as useState33 } from "react";
12002
12027
  import { Fragment as Fragment17, jsx as jsx122, jsxs as jsxs74 } from "react/jsx-runtime";
12003
12028
  function CompanyDeleterInternal({ company, isAdministrator: isAdministrator2 }) {
12004
12029
  const t = useTranslations35();
12005
12030
  const generateUrl = usePageUrlGenerator();
12006
- const [open, setOpen] = useState32(false);
12007
- const [finalWarningOpen, setFinalWarningOpen] = useState32(false);
12008
- const [isDeleting, setIsDeleting] = useState32(false);
12009
- const [companyName, setCompanyName] = useState32("");
12031
+ const [open, setOpen] = useState33(false);
12032
+ const [finalWarningOpen, setFinalWarningOpen] = useState33(false);
12033
+ const [isDeleting, setIsDeleting] = useState33(false);
12034
+ const [companyName, setCompanyName] = useState33("");
12010
12035
  const handleProceedToFinalWarning = /* @__PURE__ */ __name(() => {
12011
12036
  setOpen(false);
12012
12037
  setFinalWarningOpen(true);
@@ -12139,7 +12164,7 @@ import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
12139
12164
  import { UploadIcon as UploadIcon3 } from "lucide-react";
12140
12165
  import { useTranslations as useTranslations36 } from "next-intl";
12141
12166
  import Image6 from "next/image";
12142
- import { useCallback as useCallback19, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef19, useState as useState33 } from "react";
12167
+ import { useCallback as useCallback19, useEffect as useEffect29, useMemo as useMemo16, useRef as useRef19, useState as useState34 } from "react";
12143
12168
  import { useForm as useForm3 } from "react-hook-form";
12144
12169
  import { v4 as v42 } from "uuid";
12145
12170
  import { z as z2 } from "zod";
@@ -12156,10 +12181,10 @@ function CompanyEditorInternal({
12156
12181
  }) {
12157
12182
  const { hasRole, setUser } = useCurrentUserContext();
12158
12183
  const router = useI18nRouter();
12159
- const [features, setFeatures] = useState33([]);
12160
- const [file, setFile] = useState33(null);
12161
- const [files, setFiles] = useState33(null);
12162
- const [contentType, setContentType] = useState33(null);
12184
+ const [features, setFeatures] = useState34([]);
12185
+ const [file, setFile] = useState34(null);
12186
+ const [files, setFiles] = useState34(null);
12187
+ const [contentType, setContentType] = useState34(null);
12163
12188
  const t = useTranslations36();
12164
12189
  const fiscalRef = useRef19(null);
12165
12190
  const addressComponentsRef = useRef19({});
@@ -12372,7 +12397,7 @@ __name(CompaniesList, "CompaniesList");
12372
12397
 
12373
12398
  // src/features/company/contexts/CompanyContext.tsx
12374
12399
  import { jsx as jsx125 } from "react/jsx-runtime";
12375
- var CompanyContext = createContext9(void 0);
12400
+ var CompanyContext = createContext10(void 0);
12376
12401
  var defaultContextValue2 = {
12377
12402
  company: void 0,
12378
12403
  setCompany: /* @__PURE__ */ __name(() => {
@@ -12382,7 +12407,7 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany, con
12382
12407
  const generateUrl = usePageUrlGenerator();
12383
12408
  const t = useTranslations38();
12384
12409
  const { hasPermissionToModule, hasRole } = useCurrentUserContext();
12385
- const [company, setCompany] = useState34(
12410
+ const [company, setCompany] = useState35(
12386
12411
  dehydratedCompany ? rehydrate(Modules.Company, dehydratedCompany) : void 0
12387
12412
  );
12388
12413
  const breadcrumb = /* @__PURE__ */ __name(() => {
@@ -12422,16 +12447,16 @@ var CompanyProvider = /* @__PURE__ */ __name(({ children, dehydratedCompany, con
12422
12447
  ) });
12423
12448
  }, "CompanyProvider");
12424
12449
  var useCompanyContext = /* @__PURE__ */ __name(() => {
12425
- return useContext10(CompanyContext) ?? defaultContextValue2;
12450
+ return useContext11(CompanyContext) ?? defaultContextValue2;
12426
12451
  }, "useCompanyContext");
12427
12452
 
12428
12453
  // src/features/notification/contexts/NotificationContext.tsx
12429
12454
  import { useTranslations as useTranslations40 } from "next-intl";
12430
- import { createContext as createContext10, useCallback as useCallback20, useContext as useContext11, useEffect as useEffect31, useRef as useRef20, useState as useState36 } from "react";
12455
+ import { createContext as createContext11, useCallback as useCallback20, useContext as useContext12, useEffect as useEffect31, useRef as useRef20, useState as useState37 } from "react";
12431
12456
 
12432
12457
  // src/features/notification/components/notifications/Notification.tsx
12433
12458
  import { useTranslations as useTranslations39 } from "next-intl";
12434
- import { useEffect as useEffect30, useState as useState35 } from "react";
12459
+ import { useEffect as useEffect30, useState as useState36 } from "react";
12435
12460
  import { jsx as jsx126, jsxs as jsxs76 } from "react/jsx-runtime";
12436
12461
  var generateNotificationData = /* @__PURE__ */ __name((params) => {
12437
12462
  const response = {};
@@ -12468,7 +12493,7 @@ function NotificationToast(notification, t, generateUrl, reouter) {
12468
12493
  __name(NotificationToast, "NotificationToast");
12469
12494
  function NotificationMenuItem({ notification, closePopover }) {
12470
12495
  const generateUrl = usePageUrlGenerator();
12471
- const [isRead, setIsRead] = useState35(false);
12496
+ const [isRead, setIsRead] = useState36(false);
12472
12497
  const t = useTranslations39();
12473
12498
  useEffect30(() => {
12474
12499
  setIsRead(notification.isRead);
@@ -12493,15 +12518,15 @@ __name(NotificationMenuItem, "NotificationMenuItem");
12493
12518
 
12494
12519
  // src/features/notification/contexts/NotificationContext.tsx
12495
12520
  import { jsx as jsx127 } from "react/jsx-runtime";
12496
- var NotificationContext = createContext10(void 0);
12521
+ var NotificationContext = createContext11(void 0);
12497
12522
  var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
12498
12523
  const t = useTranslations40();
12499
12524
  const router = useI18nRouter();
12500
- const [notifications, setNotifications] = useState36([]);
12501
- const [isLoading, setIsLoading] = useState36(false);
12502
- const [error, setError] = useState36(null);
12503
- const [lastLoaded, setLastLoaded] = useState36(0);
12504
- const [hasInitiallyLoaded, setHasInitiallyLoaded] = useState36(false);
12525
+ const [notifications, setNotifications] = useState37([]);
12526
+ const [isLoading, setIsLoading] = useState37(false);
12527
+ const [error, setError] = useState37(null);
12528
+ const [lastLoaded, setLastLoaded] = useState37(0);
12529
+ const [hasInitiallyLoaded, setHasInitiallyLoaded] = useState37(false);
12505
12530
  const inFlightRef = useRef20(null);
12506
12531
  const { currentUser } = useCurrentUserContext();
12507
12532
  const shouldRefresh = Date.now() - lastLoaded > 5 * 60 * 1e3;
@@ -12620,7 +12645,7 @@ var NotificationContextProvider = /* @__PURE__ */ __name(({ children }) => {
12620
12645
  ) });
12621
12646
  }, "NotificationContextProvider");
12622
12647
  var useNotificationContext = /* @__PURE__ */ __name(() => {
12623
- const context = useContext11(NotificationContext);
12648
+ const context = useContext12(NotificationContext);
12624
12649
  if (context === void 0) {
12625
12650
  throw new Error(`Notification.messages.errors.use_context`);
12626
12651
  }
@@ -12628,7 +12653,7 @@ var useNotificationContext = /* @__PURE__ */ __name(() => {
12628
12653
  }, "useNotificationContext");
12629
12654
 
12630
12655
  // src/features/onboarding/contexts/OnboardingContext.tsx
12631
- import { createContext as createContext11, useCallback as useCallback21, useContext as useContext12, useEffect as useEffect32, useRef as useRef21, useState as useState37 } from "react";
12656
+ import { createContext as createContext12, useCallback as useCallback21, useContext as useContext13, useEffect as useEffect32, useRef as useRef21, useState as useState38 } from "react";
12632
12657
  import { createRoot } from "react-dom/client";
12633
12658
  import Shepherd from "shepherd.js";
12634
12659
  import "shepherd.js/dist/css/shepherd.css";
@@ -12686,7 +12711,7 @@ var DEFAULT_ONBOARDING_LABELS = {
12686
12711
 
12687
12712
  // src/features/onboarding/contexts/OnboardingContext.tsx
12688
12713
  import { jsx as jsx129 } from "react/jsx-runtime";
12689
- var OnboardingContext = createContext11(null);
12714
+ var OnboardingContext = createContext12(null);
12690
12715
  function OnboardingProvider({
12691
12716
  children,
12692
12717
  tours = [],
@@ -12695,10 +12720,10 @@ function OnboardingProvider({
12695
12720
  renderCard,
12696
12721
  zIndex: _zIndex = 9999
12697
12722
  }) {
12698
- const [isTourActive, setIsTourActive] = useState37(false);
12699
- const [activeTourId, setActiveTourId] = useState37(null);
12700
- const [currentStepIndex, setCurrentStepIndex] = useState37(0);
12701
- const [totalSteps, setTotalSteps] = useState37(0);
12723
+ const [isTourActive, setIsTourActive] = useState38(false);
12724
+ const [activeTourId, setActiveTourId] = useState38(null);
12725
+ const [currentStepIndex, setCurrentStepIndex] = useState38(0);
12726
+ const [totalSteps, setTotalSteps] = useState38(0);
12702
12727
  const tourRef = useRef21(null);
12703
12728
  const rootsRef = useRef21(/* @__PURE__ */ new Map());
12704
12729
  const cleanupRoots = useCallback21(() => {
@@ -12849,7 +12874,7 @@ function OnboardingProvider({
12849
12874
  }
12850
12875
  __name(OnboardingProvider, "OnboardingProvider");
12851
12876
  function useOnboarding() {
12852
- const context = useContext12(OnboardingContext);
12877
+ const context = useContext13(OnboardingContext);
12853
12878
  if (!context) {
12854
12879
  throw new Error("useOnboarding must be used within an OnboardingProvider");
12855
12880
  }
@@ -12859,13 +12884,13 @@ __name(useOnboarding, "useOnboarding");
12859
12884
 
12860
12885
  // src/features/role/contexts/RoleContext.tsx
12861
12886
  import { useTranslations as useTranslations41 } from "next-intl";
12862
- import { createContext as createContext12, useContext as useContext13, useState as useState38 } from "react";
12887
+ import { createContext as createContext13, useContext as useContext14, useState as useState39 } from "react";
12863
12888
  import { jsx as jsx130 } from "react/jsx-runtime";
12864
- var RoleContext = createContext12(void 0);
12889
+ var RoleContext = createContext13(void 0);
12865
12890
  var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
12866
12891
  const generateUrl = usePageUrlGenerator();
12867
12892
  const t = useTranslations41();
12868
- const [role, setRole] = useState38(
12893
+ const [role, setRole] = useState39(
12869
12894
  dehydratedRole ? rehydrate(Modules.Role, dehydratedRole) : void 0
12870
12895
  );
12871
12896
  const breadcrumb = /* @__PURE__ */ __name(() => {
@@ -12904,7 +12929,7 @@ var RoleProvider = /* @__PURE__ */ __name(({ children, dehydratedRole }) => {
12904
12929
  ) });
12905
12930
  }, "RoleProvider");
12906
12931
  var useRoleContext = /* @__PURE__ */ __name(() => {
12907
- const context = useContext13(RoleContext);
12932
+ const context = useContext14(RoleContext);
12908
12933
  if (context === void 0) {
12909
12934
  throw new Error("useRoleContext must be used within a RoleProvider");
12910
12935
  }
@@ -12912,14 +12937,14 @@ var useRoleContext = /* @__PURE__ */ __name(() => {
12912
12937
  }, "useRoleContext");
12913
12938
 
12914
12939
  // src/contexts/SharedContext.tsx
12915
- import { createContext as createContext13, useContext as useContext14 } from "react";
12940
+ import { createContext as createContext14, useContext as useContext15 } from "react";
12916
12941
  import { jsx as jsx131 } from "react/jsx-runtime";
12917
- var SharedContext = createContext13(null);
12942
+ var SharedContext = createContext14(null);
12918
12943
  var SharedProvider = /* @__PURE__ */ __name(({ children, value }) => {
12919
12944
  return /* @__PURE__ */ jsx131(SharedContext.Provider, { value, children });
12920
12945
  }, "SharedProvider");
12921
12946
  var useSharedContext = /* @__PURE__ */ __name(() => {
12922
- const context = useContext14(SharedContext);
12947
+ const context = useContext15(SharedContext);
12923
12948
  if (!context) {
12924
12949
  throw new Error("useSharedContext must be used within a SharedProvider");
12925
12950
  }
@@ -12952,7 +12977,7 @@ __name(HowToDeleter, "HowToDeleter");
12952
12977
  import { zodResolver as zodResolver4 } from "@hookform/resolvers/zod";
12953
12978
  import { PlusIcon, SearchIcon as SearchIcon5, XIcon as XIcon9 } from "lucide-react";
12954
12979
  import { useTranslations as useTranslations44 } from "next-intl";
12955
- import { useCallback as useCallback22, useEffect as useEffect33, useMemo as useMemo17, useRef as useRef22, useState as useState39 } from "react";
12980
+ import { useCallback as useCallback22, useEffect as useEffect33, useMemo as useMemo17, useRef as useRef22, useState as useState40 } from "react";
12956
12981
  import { useForm as useForm4 } from "react-hook-form";
12957
12982
  import { v4 as v43 } from "uuid";
12958
12983
  import { z as z3 } from "zod";
@@ -13001,8 +13026,8 @@ function PageSelector({
13001
13026
  onSelect,
13002
13027
  onRemove
13003
13028
  }) {
13004
- const [open, setOpen] = useState39(false);
13005
- const [search, setSearch] = useState39("");
13029
+ const [open, setOpen] = useState40(false);
13030
+ const [search, setSearch] = useState40("");
13006
13031
  const selectedLabel = value ? allPageUrls.find((opt) => opt.id === value) : void 0;
13007
13032
  const filteredOptions = useMemo17(() => {
13008
13033
  const available = allPageUrls.filter((opt) => opt.id === value || !selectedPages.includes(opt.id));
@@ -13315,13 +13340,13 @@ __name(HowToEditor, "HowToEditor");
13315
13340
 
13316
13341
  // src/features/how-to/contexts/HowToContext.tsx
13317
13342
  import { useTranslations as useTranslations45 } from "next-intl";
13318
- import { createContext as createContext14, useContext as useContext15, useState as useState40 } from "react";
13343
+ import { createContext as createContext15, useContext as useContext16, useState as useState41 } from "react";
13319
13344
  import { jsx as jsx135 } from "react/jsx-runtime";
13320
- var HowToContext = createContext14(void 0);
13345
+ var HowToContext = createContext15(void 0);
13321
13346
  var HowToProvider = /* @__PURE__ */ __name(({ children, dehydratedHowTo }) => {
13322
13347
  const generateUrl = usePageUrlGenerator();
13323
13348
  const t = useTranslations45();
13324
- const [howTo, setHowTo] = useState40(
13349
+ const [howTo, setHowTo] = useState41(
13325
13350
  dehydratedHowTo ? rehydrate(Modules.HowTo, dehydratedHowTo) : void 0
13326
13351
  );
13327
13352
  const reloadHowTo = /* @__PURE__ */ __name(async () => {
@@ -13370,7 +13395,7 @@ var HowToProvider = /* @__PURE__ */ __name(({ children, dehydratedHowTo }) => {
13370
13395
  ) });
13371
13396
  }, "HowToProvider");
13372
13397
  var useHowToContext = /* @__PURE__ */ __name(() => {
13373
- const context = useContext15(HowToContext);
13398
+ const context = useContext16(HowToContext);
13374
13399
  if (context === void 0) {
13375
13400
  throw new Error("useHowToContext must be used within a HowToProvider");
13376
13401
  }
@@ -13380,7 +13405,7 @@ var useHowToContext = /* @__PURE__ */ __name(() => {
13380
13405
  // src/features/rbac/contexts/RbacContext.tsx
13381
13406
  import { DownloadIcon, Loader2Icon as Loader2Icon3 } from "lucide-react";
13382
13407
  import { useTranslations as useTranslations46 } from "next-intl";
13383
- import { createContext as createContext15, useCallback as useCallback23, useContext as useContext16, useEffect as useEffect34, useMemo as useMemo18, useState as useState41 } from "react";
13408
+ import { createContext as createContext16, useCallback as useCallback23, useContext as useContext17, useEffect as useEffect34, useMemo as useMemo18, useState as useState42 } from "react";
13384
13409
  import { jsx as jsx136, jsxs as jsxs79 } from "react/jsx-runtime";
13385
13410
  var DEFAULT_OUTPUT_PATH = "apps/api/src/rbac/permissions.ts";
13386
13411
  function upsertToken(tokens, action, scope) {
@@ -13394,7 +13419,7 @@ function removeToken(tokens, action) {
13394
13419
  return (tokens ?? []).filter((t) => t.action !== action);
13395
13420
  }
13396
13421
  __name(removeToken, "removeToken");
13397
- var RbacContext = createContext15(void 0);
13422
+ var RbacContext = createContext16(void 0);
13398
13423
  var RbacProvider = /* @__PURE__ */ __name(({
13399
13424
  children,
13400
13425
  roleNames,
@@ -13403,11 +13428,11 @@ var RbacProvider = /* @__PURE__ */ __name(({
13403
13428
  }) => {
13404
13429
  const generateUrl = usePageUrlGenerator();
13405
13430
  const t = useTranslations46();
13406
- const [matrix, setMatrix] = useState41(null);
13407
- const [modulePaths, setModulePaths] = useState41({});
13408
- const [loading, setLoading] = useState41(true);
13409
- const [error, setError] = useState41(null);
13410
- const [saving, setSaving] = useState41(false);
13431
+ const [matrix, setMatrix] = useState42(null);
13432
+ const [modulePaths, setModulePaths] = useState42({});
13433
+ const [loading, setLoading] = useState42(true);
13434
+ const [error, setError] = useState42(null);
13435
+ const [saving, setSaving] = useState42(false);
13411
13436
  useEffect34(() => {
13412
13437
  let cancelled = false;
13413
13438
  setLoading(true);
@@ -13506,7 +13531,7 @@ var RbacProvider = /* @__PURE__ */ __name(({
13506
13531
  return /* @__PURE__ */ jsx136(SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ jsx136(RbacContext.Provider, { value: contextValue, children }) });
13507
13532
  }, "RbacProvider");
13508
13533
  var useRbacContext = /* @__PURE__ */ __name(() => {
13509
- const ctx = useContext16(RbacContext);
13534
+ const ctx = useContext17(RbacContext);
13510
13535
  if (!ctx) {
13511
13536
  throw new Error("useRbacContext must be used within an RbacProvider");
13512
13537
  }
@@ -13515,9 +13540,9 @@ var useRbacContext = /* @__PURE__ */ __name(() => {
13515
13540
 
13516
13541
  // src/features/assistant/contexts/AssistantContext.tsx
13517
13542
  import { useTranslations as useTranslations47 } from "next-intl";
13518
- import { createContext as createContext16, useCallback as useCallback24, useContext as useContext17, useEffect as useEffect35, useMemo as useMemo19, useState as useState42 } from "react";
13543
+ import { createContext as createContext17, useCallback as useCallback24, useContext as useContext18, useEffect as useEffect35, useMemo as useMemo19, useState as useState43 } from "react";
13519
13544
  import { jsx as jsx137 } from "react/jsx-runtime";
13520
- var AssistantContext = createContext16(void 0);
13545
+ var AssistantContext = createContext17(void 0);
13521
13546
  function stripOptimistic(list) {
13522
13547
  return list.filter((m) => !m.isOptimistic);
13523
13548
  }
@@ -13540,18 +13565,18 @@ __name(withPatchedTitle, "withPatchedTitle");
13540
13565
  function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages, manageUrl = true }) {
13541
13566
  const t = useTranslations47();
13542
13567
  const generateUrl = usePageUrlGenerator();
13543
- const [assistant, setAssistant] = useState42(
13568
+ const [assistant, setAssistant] = useState43(
13544
13569
  () => dehydratedAssistant ? rehydrate(Modules.Assistant, dehydratedAssistant) : void 0
13545
13570
  );
13546
- const [messages, setMessages] = useState42(
13571
+ const [messages, setMessages] = useState43(
13547
13572
  () => dehydratedMessages ? rehydrateList(Modules.AssistantMessage, dehydratedMessages) : []
13548
13573
  );
13549
- const [threads, setThreads] = useState42([]);
13550
- const [threadsLoading, setThreadsLoading] = useState42(true);
13551
- const [sending, setSending] = useState42(false);
13552
- const [status, setStatus] = useState42(void 0);
13553
- const [failedMessageIds, setFailedMessageIds] = useState42(() => /* @__PURE__ */ new Set());
13554
- const [operatorMode, setOperatorMode] = useState42(
13574
+ const [threads, setThreads] = useState43([]);
13575
+ const [threadsLoading, setThreadsLoading] = useState43(true);
13576
+ const [sending, setSending] = useState43(false);
13577
+ const [status, setStatus] = useState43(void 0);
13578
+ const [failedMessageIds, setFailedMessageIds] = useState43(() => /* @__PURE__ */ new Set());
13579
+ const [operatorMode, setOperatorMode] = useState43(
13555
13580
  () => dehydratedAssistant?.jsonApi?.attributes?.engine === "operator"
13556
13581
  );
13557
13582
  const { socket } = useSocketContext();
@@ -13736,7 +13761,7 @@ function AssistantProvider({ children, dehydratedAssistant, dehydratedMessages,
13736
13761
  }
13737
13762
  __name(AssistantProvider, "AssistantProvider");
13738
13763
  function useAssistantContext() {
13739
- const ctx = useContext17(AssistantContext);
13764
+ const ctx = useContext18(AssistantContext);
13740
13765
  if (!ctx) throw new Error("useAssistantContext must be used within AssistantProvider");
13741
13766
  return ctx;
13742
13767
  }
@@ -13744,9 +13769,9 @@ __name(useAssistantContext, "useAssistantContext");
13744
13769
 
13745
13770
  // src/contexts/CommonContext.tsx
13746
13771
  import { useTranslations as useTranslations48 } from "next-intl";
13747
- import { createContext as createContext17, useContext as useContext18 } from "react";
13772
+ import { createContext as createContext18, useContext as useContext19 } from "react";
13748
13773
  import { jsx as jsx138 } from "react/jsx-runtime";
13749
- var CommonContext = createContext17(void 0);
13774
+ var CommonContext = createContext18(void 0);
13750
13775
  var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
13751
13776
  const { company } = useCurrentUserContext();
13752
13777
  const t = useTranslations48();
@@ -13764,7 +13789,7 @@ var CommonProvider = /* @__PURE__ */ __name(({ children }) => {
13764
13789
  return /* @__PURE__ */ jsx138(SharedProvider, { value: { breadcrumbs: breadcrumb(), title: title() }, children: /* @__PURE__ */ jsx138(CommonContext.Provider, { value: {}, children }) });
13765
13790
  }, "CommonProvider");
13766
13791
  var useCommonContext = /* @__PURE__ */ __name(() => {
13767
- const context = useContext18(CommonContext);
13792
+ const context = useContext19(CommonContext);
13768
13793
  if (context === void 0) {
13769
13794
  throw new Error("useCommonContext must be used within a CommonProvider");
13770
13795
  }
@@ -13772,9 +13797,9 @@ var useCommonContext = /* @__PURE__ */ __name(() => {
13772
13797
  }, "useCommonContext");
13773
13798
 
13774
13799
  // src/contexts/HeaderChildrenContext.tsx
13775
- import { createContext as createContext18, useContext as useContext19 } from "react";
13800
+ import { createContext as createContext19, useContext as useContext20 } from "react";
13776
13801
  import { jsx as jsx139 } from "react/jsx-runtime";
13777
- var HeaderChildrenContext = createContext18({
13802
+ var HeaderChildrenContext = createContext19({
13778
13803
  headerChildren: null
13779
13804
  });
13780
13805
  function HeaderChildrenProvider({ children, content }) {
@@ -13782,15 +13807,15 @@ function HeaderChildrenProvider({ children, content }) {
13782
13807
  }
13783
13808
  __name(HeaderChildrenProvider, "HeaderChildrenProvider");
13784
13809
  function useHeaderChildren() {
13785
- const context = useContext19(HeaderChildrenContext);
13810
+ const context = useContext20(HeaderChildrenContext);
13786
13811
  return context.headerChildren;
13787
13812
  }
13788
13813
  __name(useHeaderChildren, "useHeaderChildren");
13789
13814
 
13790
13815
  // src/contexts/HeaderLeftContentContext.tsx
13791
- import { createContext as createContext19, useContext as useContext20 } from "react";
13816
+ import { createContext as createContext20, useContext as useContext21 } from "react";
13792
13817
  import { jsx as jsx140 } from "react/jsx-runtime";
13793
- var HeaderLeftContentContext = createContext19({
13818
+ var HeaderLeftContentContext = createContext20({
13794
13819
  headerLeftContent: null
13795
13820
  });
13796
13821
  function HeaderLeftContentProvider({ children, content }) {
@@ -13798,7 +13823,7 @@ function HeaderLeftContentProvider({ children, content }) {
13798
13823
  }
13799
13824
  __name(HeaderLeftContentProvider, "HeaderLeftContentProvider");
13800
13825
  function useHeaderLeftContent() {
13801
- const context = useContext20(HeaderLeftContentContext);
13826
+ const context = useContext21(HeaderLeftContentContext);
13802
13827
  return context.headerLeftContent;
13803
13828
  }
13804
13829
  __name(useHeaderLeftContent, "useHeaderLeftContent");
@@ -13806,7 +13831,7 @@ __name(useHeaderLeftContent, "useHeaderLeftContent");
13806
13831
  // src/components/EditableAvatar.tsx
13807
13832
  import { PencilIcon as PencilIcon3, Trash2Icon as Trash2Icon3 } from "lucide-react";
13808
13833
  import { useTranslations as useTranslations49 } from "next-intl";
13809
- import { useCallback as useCallback25, useRef as useRef23, useState as useState43 } from "react";
13834
+ import { useCallback as useCallback25, useRef as useRef23, useState as useState44 } from "react";
13810
13835
  import { jsx as jsx141, jsxs as jsxs80 } from "react/jsx-runtime";
13811
13836
  function EditableAvatar({
13812
13837
  entityId,
@@ -13821,8 +13846,8 @@ function EditableAvatar({
13821
13846
  const { company } = useCurrentUserContext();
13822
13847
  const t = useTranslations49();
13823
13848
  const fileInputRef = useRef23(null);
13824
- const [optimisticImage, setOptimisticImage] = useState43(null);
13825
- const [isUploading, setIsUploading] = useState43(false);
13849
+ const [optimisticImage, setOptimisticImage] = useState44(null);
13850
+ const [isUploading, setIsUploading] = useState44(false);
13826
13851
  const displayImage = optimisticImage ?? image;
13827
13852
  const generateS3Key = useCallback25(
13828
13853
  (file) => {
@@ -13956,7 +13981,7 @@ __name(TableCellAvatar, "TableCellAvatar");
13956
13981
 
13957
13982
  // src/components/navigations/Breadcrumb.tsx
13958
13983
  import { useTranslations as useTranslations50 } from "next-intl";
13959
- import { Fragment as Fragment20, useState as useState44 } from "react";
13984
+ import { Fragment as Fragment20, useState as useState45 } from "react";
13960
13985
  import { ChevronDownIcon as ChevronDownIcon8 } from "lucide-react";
13961
13986
  import { Fragment as Fragment21, jsx as jsx143, jsxs as jsxs82 } from "react/jsx-runtime";
13962
13987
  var ITEMS_TO_DISPLAY = 4;
@@ -13965,7 +13990,7 @@ function BreadcrumbDesktop({
13965
13990
  generateUrl,
13966
13991
  t
13967
13992
  }) {
13968
- const [open, setOpen] = useState44(false);
13993
+ const [open, setOpen] = useState45(false);
13969
13994
  return /* @__PURE__ */ jsx143(Breadcrumb, { children: /* @__PURE__ */ jsxs82(BreadcrumbList, { children: [
13970
13995
  /* @__PURE__ */ jsx143(BreadcrumbItem, { children: /* @__PURE__ */ jsx143(Link, { href: generateUrl({ page: `/` }), children: t(`common.home`) }) }),
13971
13996
  items.length > 0 && /* @__PURE__ */ jsx143(BreadcrumbSeparator, {}),
@@ -13993,7 +14018,7 @@ function BreadcrumbMobile({
13993
14018
  generateUrl,
13994
14019
  t
13995
14020
  }) {
13996
- const [open, setOpen] = useState44(false);
14021
+ const [open, setOpen] = useState45(false);
13997
14022
  const lastItem = items[items.length - 1];
13998
14023
  const allItems = [{ name: t(`common.home`), href: generateUrl({ page: `/` }) }, ...items];
13999
14024
  if (!lastItem && items.length === 0) {
@@ -14020,11 +14045,11 @@ function BreadcrumbNavigation({ items }) {
14020
14045
  __name(BreadcrumbNavigation, "BreadcrumbNavigation");
14021
14046
 
14022
14047
  // src/components/navigations/ContentTitle.tsx
14023
- import { useEffect as useEffect36, useState as useState45 } from "react";
14048
+ import { useEffect as useEffect36, useState as useState46 } from "react";
14024
14049
  import { jsx as jsx144, jsxs as jsxs83 } from "react/jsx-runtime";
14025
14050
  function ContentTitle({ module, type, element, functions, className, prioritizeFunctions }) {
14026
- const [clientFunctions, setClientFunctions] = useState45(null);
14027
- const [isClient, setIsClient] = useState45(false);
14051
+ const [clientFunctions, setClientFunctions] = useState46(null);
14052
+ const [isClient, setIsClient] = useState46(false);
14028
14053
  useEffect36(() => {
14029
14054
  setIsClient(true);
14030
14055
  setClientFunctions(functions);
@@ -14081,12 +14106,12 @@ __name(ModeToggleSwitch, "ModeToggleSwitch");
14081
14106
 
14082
14107
  // src/components/navigations/PageSection.tsx
14083
14108
  import { ChevronDownIcon as ChevronDownIcon9, ChevronRightIcon as ChevronRightIcon6 } from "lucide-react";
14084
- import { useEffect as useEffect37, useState as useState46 } from "react";
14109
+ import { useEffect as useEffect37, useState as useState47 } from "react";
14085
14110
  import { v4 as v44 } from "uuid";
14086
14111
  import { jsx as jsx147, jsxs as jsxs85 } from "react/jsx-runtime";
14087
14112
  function PageSection({ children, title, options, open, small, onToggle }) {
14088
- const [isOpen, setIsOpen] = useState46(open ?? true);
14089
- const [shouldRender, setShouldRender] = useState46(open ?? true);
14113
+ const [isOpen, setIsOpen] = useState47(open ?? true);
14114
+ const [shouldRender, setShouldRender] = useState47(open ?? true);
14090
14115
  useEffect37(() => {
14091
14116
  if (onToggle) {
14092
14117
  onToggle(isOpen);
@@ -14194,7 +14219,7 @@ __name(partitionTabs, "partitionTabs");
14194
14219
  // src/components/containers/ReactMarkdownContainer.tsx
14195
14220
  import { ChevronDown as ChevronDown2, ChevronUp } from "lucide-react";
14196
14221
  import { useTranslations as useTranslations52 } from "next-intl";
14197
- import { useEffect as useEffect38, useRef as useRef24, useState as useState47 } from "react";
14222
+ import { useEffect as useEffect38, useRef as useRef24, useState as useState48 } from "react";
14198
14223
  import ReactMarkdown from "react-markdown";
14199
14224
  import remarkGfm from "remark-gfm";
14200
14225
  import { jsx as jsx150, jsxs as jsxs88 } from "react/jsx-runtime";
@@ -14205,8 +14230,8 @@ function ReactMarkdownContainer({
14205
14230
  size = "normal"
14206
14231
  }) {
14207
14232
  const t = useTranslations52("ui.buttons");
14208
- const [isExpanded, setIsExpanded] = useState47(false);
14209
- const [showExpandButton, setShowExpandButton] = useState47(false);
14233
+ const [isExpanded, setIsExpanded] = useState48(false);
14234
+ const [showExpandButton, setShowExpandButton] = useState48(false);
14210
14235
  const contentRef = useRef24(null);
14211
14236
  useEffect38(() => {
14212
14237
  if (collapsible && contentRef.current && !isExpanded) {
@@ -14311,7 +14336,7 @@ __name(RoundPageContainerTitle, "RoundPageContainerTitle");
14311
14336
 
14312
14337
  // src/components/containers/RoundPageContainer.tsx
14313
14338
  import { useSearchParams } from "next/navigation";
14314
- import { Fragment as Fragment22, useCallback as useCallback26, useEffect as useEffect39, useMemo as useMemo20, useState as useState48 } from "react";
14339
+ import { Fragment as Fragment22, useCallback as useCallback26, useEffect as useEffect39, useMemo as useMemo20, useState as useState49 } from "react";
14315
14340
  import { Fragment as Fragment23, jsx as jsx152, jsxs as jsxs90 } from "react/jsx-runtime";
14316
14341
  var DETAILS_COOKIE_NAME = "round_page_details_state";
14317
14342
  var DETAILS_COOKIE_MAX_AGE = 60 * 60 * 24 * 7;
@@ -14336,9 +14361,9 @@ function RoundPageContainer({
14336
14361
  }) {
14337
14362
  const headerChildren = useHeaderChildren();
14338
14363
  const headerLeftContent = useHeaderLeftContent();
14339
- const [showDetails, setShowDetailsState] = useState48(false);
14364
+ const [showDetails, setShowDetailsState] = useState49(false);
14340
14365
  const isMobile = useIsMobile();
14341
- const [mounted, setMounted] = useState48(false);
14366
+ const [mounted, setMounted] = useState49(false);
14342
14367
  useEffect39(() => {
14343
14368
  const match = document.cookie.split("; ").find((row) => row.startsWith(`${DETAILS_COOKIE_NAME}=`));
14344
14369
  if (match?.split("=")[1] === "true") setShowDetailsState(true);
@@ -14354,7 +14379,7 @@ function RoundPageContainer({
14354
14379
  const section = searchParams.get("section");
14355
14380
  const rewriteUrl = useUrlRewriter();
14356
14381
  const initialValue = tabs ? (section && tabs.find((i) => tabValue(i) === section) ? section : null) || tabValue(tabs[0]) : void 0;
14357
- const [activeTab, setActiveTab] = useState48(initialValue);
14382
+ const [activeTab, setActiveTab] = useState49(initialValue);
14358
14383
  useEffect39(() => {
14359
14384
  if (tabs && section) {
14360
14385
  const tab = tabs.find((i) => tabValue(i) === section);
@@ -14623,14 +14648,14 @@ function AllowedUsersDetails({ showTitle, content }) {
14623
14648
  __name(AllowedUsersDetails, "AllowedUsersDetails");
14624
14649
 
14625
14650
  // src/components/editors/BlockNoteEditorMentionHoverCard.tsx
14626
- import { useCallback as useCallback27, useEffect as useEffect40, useRef as useRef25, useState as useState49 } from "react";
14651
+ import { useCallback as useCallback27, useEffect as useEffect40, useRef as useRef25, useState as useState50 } from "react";
14627
14652
  import { createPortal as createPortal3 } from "react-dom";
14628
14653
  import { jsx as jsx155 } from "react/jsx-runtime";
14629
14654
  function BlockNoteEditorMentionHoverCard({
14630
14655
  containerRef,
14631
14656
  mentionResolveFn
14632
14657
  }) {
14633
- const [hovered, setHovered] = useState49(null);
14658
+ const [hovered, setHovered] = useState50(null);
14634
14659
  const closeTimeoutRef = useRef25(null);
14635
14660
  const scheduleClose = useCallback27(() => {
14636
14661
  closeTimeoutRef.current = setTimeout(() => setHovered(null), 200);
@@ -14888,11 +14913,11 @@ var BlockNoteViewerContainer = React26.memo(/* @__PURE__ */ __name(function View
14888
14913
  }, "ViewerContainer"));
14889
14914
 
14890
14915
  // src/components/pages/PageContainerContentDetails.tsx
14891
- import { useEffect as useEffect41, useRef as useRef26, useState as useState50 } from "react";
14916
+ import { useEffect as useEffect41, useRef as useRef26, useState as useState51 } from "react";
14892
14917
  import { jsx as jsx159, jsxs as jsxs94 } from "react/jsx-runtime";
14893
14918
  function PageContainerContentDetails({ items, section, module, id }) {
14894
14919
  const rewriteUrl = useUrlRewriter();
14895
- const [isScrolled, setIsScrolled] = useState50(false);
14920
+ const [isScrolled, setIsScrolled] = useState51(false);
14896
14921
  const sentinelRef = useRef26(null);
14897
14922
  useEffect41(() => {
14898
14923
  const sentinel = sentinelRef.current;
@@ -14927,11 +14952,11 @@ function PageContainerContentDetails({ items, section, module, id }) {
14927
14952
  __name(PageContainerContentDetails, "PageContainerContentDetails");
14928
14953
 
14929
14954
  // src/components/pages/PageContentContainer.tsx
14930
- import { useEffect as useEffect42, useState as useState51 } from "react";
14955
+ import { useEffect as useEffect42, useState as useState52 } from "react";
14931
14956
  import { useDefaultLayout } from "react-resizable-panels";
14932
14957
  import { jsx as jsx160, jsxs as jsxs95 } from "react/jsx-runtime";
14933
14958
  function PageContentContainer({ header, details, footer, content, fullBleed }) {
14934
- const [mounted, setMounted] = useState51(false);
14959
+ const [mounted, setMounted] = useState52(false);
14935
14960
  const isMobile = useIsMobile();
14936
14961
  useEffect42(() => {
14937
14962
  setMounted(true);
@@ -15100,12 +15125,12 @@ function JsonApiProvider({ config, children }) {
15100
15125
  __name(JsonApiProvider, "JsonApiProvider");
15101
15126
 
15102
15127
  // src/client/hooks/useJsonApiGet.ts
15103
- import { useState as useState52, useEffect as useEffect44, useCallback as useCallback29, useRef as useRef27 } from "react";
15128
+ import { useState as useState53, useEffect as useEffect44, useCallback as useCallback29, useRef as useRef27 } from "react";
15104
15129
  function useJsonApiGet(params) {
15105
- const [data, setData] = useState52(null);
15106
- const [loading, setLoading] = useState52(false);
15107
- const [error, setError] = useState52(null);
15108
- const [response, setResponse] = useState52(null);
15130
+ const [data, setData] = useState53(null);
15131
+ const [loading, setLoading] = useState53(false);
15132
+ const [error, setError] = useState53(null);
15133
+ const [response, setResponse] = useState53(null);
15109
15134
  const isMounted = useRef27(true);
15110
15135
  const fetchData = useCallback29(async () => {
15111
15136
  if (params.options?.enabled === false) return;
@@ -15200,12 +15225,12 @@ function useJsonApiGet(params) {
15200
15225
  __name(useJsonApiGet, "useJsonApiGet");
15201
15226
 
15202
15227
  // src/client/hooks/useJsonApiMutation.ts
15203
- import { useState as useState53, useCallback as useCallback30 } from "react";
15228
+ import { useState as useState54, useCallback as useCallback30 } from "react";
15204
15229
  function useJsonApiMutation(config) {
15205
- const [data, setData] = useState53(null);
15206
- const [loading, setLoading] = useState53(false);
15207
- const [error, setError] = useState53(null);
15208
- const [response, setResponse] = useState53(null);
15230
+ const [data, setData] = useState54(null);
15231
+ const [loading, setLoading] = useState54(false);
15232
+ const [error, setError] = useState54(null);
15233
+ const [response, setResponse] = useState54(null);
15209
15234
  const reset = useCallback30(() => {
15210
15235
  setData(null);
15211
15236
  setLoading(false);
@@ -15724,15 +15749,15 @@ __name(useOAuthClients, "useOAuthClients");
15724
15749
 
15725
15750
  // src/features/oauth/hooks/useOAuthClient.ts
15726
15751
  import { useAtomValue as useAtomValue2, useSetAtom as useSetAtom2 } from "jotai";
15727
- import { useCallback as useCallback32, useEffect as useEffect46, useState as useState54 } from "react";
15752
+ import { useCallback as useCallback32, useEffect as useEffect46, useState as useState55 } from "react";
15728
15753
  function useOAuthClient(clientId) {
15729
15754
  const storedClient = useAtomValue2(oauthClientByIdAtom(clientId));
15730
15755
  const updateClientInStore = useSetAtom2(updateOAuthClientAtom);
15731
15756
  const removeClientFromStore = useSetAtom2(removeOAuthClientAtom);
15732
15757
  const setNewClientSecret = useSetAtom2(setNewClientSecretAtom);
15733
- const [fetchedClient, setFetchedClient] = useState54(null);
15734
- const [isLoading, setIsLoading] = useState54(false);
15735
- const [error, setError] = useState54(null);
15758
+ const [fetchedClient, setFetchedClient] = useState55(null);
15759
+ const [isLoading, setIsLoading] = useState55(false);
15760
+ const [error, setError] = useState55(null);
15736
15761
  const client = storedClient || fetchedClient;
15737
15762
  const fetchClient = useCallback32(async () => {
15738
15763
  if (!clientId) return;
@@ -15822,12 +15847,12 @@ function useOAuthClient(clientId) {
15822
15847
  __name(useOAuthClient, "useOAuthClient");
15823
15848
 
15824
15849
  // src/features/oauth/hooks/useOAuthConsent.ts
15825
- import { useCallback as useCallback33, useEffect as useEffect47, useState as useState55 } from "react";
15850
+ import { useCallback as useCallback33, useEffect as useEffect47, useState as useState56 } from "react";
15826
15851
  function useOAuthConsent(params) {
15827
- const [clientInfo, setClientInfo] = useState55(null);
15828
- const [isLoading, setIsLoading] = useState55(true);
15829
- const [error, setError] = useState55(null);
15830
- const [isSubmitting, setIsSubmitting] = useState55(false);
15852
+ const [clientInfo, setClientInfo] = useState56(null);
15853
+ const [isLoading, setIsLoading] = useState56(true);
15854
+ const [error, setError] = useState56(null);
15855
+ const [isSubmitting, setIsSubmitting] = useState56(false);
15831
15856
  useEffect47(() => {
15832
15857
  const fetchInfo = /* @__PURE__ */ __name(async () => {
15833
15858
  if (!params.clientId || !params.redirectUri || !params.scope) {
@@ -15903,20 +15928,20 @@ registerTableGenerator("companies", useCompanyTableStructure);
15903
15928
  // src/components/tables/ContentListTable.tsx
15904
15929
  import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
15905
15930
  import { ChevronLeft, ChevronRight } from "lucide-react";
15906
- import React28, { memo, useMemo as useMemo28, useState as useState57 } from "react";
15931
+ import React28, { memo, useMemo as useMemo28, useState as useState58 } from "react";
15907
15932
 
15908
15933
  // src/components/tables/ContentTableSearch.tsx
15909
15934
  import { RefreshCw, Search, X as X3 } from "lucide-react";
15910
15935
  import { useTranslations as useTranslations57 } from "next-intl";
15911
- import { useCallback as useCallback34, useEffect as useEffect48, useRef as useRef28, useState as useState56 } from "react";
15936
+ import { useCallback as useCallback34, useEffect as useEffect48, useRef as useRef28, useState as useState57 } from "react";
15912
15937
  import { jsx as jsx170, jsxs as jsxs97 } from "react/jsx-runtime";
15913
15938
  function ContentTableSearch({ data }) {
15914
15939
  const t = useTranslations57();
15915
15940
  const searchTermRef = useRef28("");
15916
15941
  const inputRef = useRef28(null);
15917
- const [searchTerm, setSearchTerm] = useState56("");
15918
- const [isFocused, setIsFocused] = useState56(false);
15919
- const [isSearching, setIsSearching] = useState56(false);
15942
+ const [searchTerm, setSearchTerm] = useState57("");
15943
+ const [isFocused, setIsFocused] = useState57(false);
15944
+ const [isSearching, setIsSearching] = useState57(false);
15920
15945
  const isExpanded = isFocused || searchTerm.length > 0;
15921
15946
  const search = useCallback34(
15922
15947
  async (searchedTerm) => {
@@ -16011,7 +16036,7 @@ function getGroupKeys(item, field) {
16011
16036
  __name(getGroupKeys, "getGroupKeys");
16012
16037
  var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(props) {
16013
16038
  const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth } = props;
16014
- const [expanded, setExpanded] = useState57(
16039
+ const [expanded, setExpanded] = useState58(
16015
16040
  props.defaultExpanded === true ? true : typeof props.defaultExpanded === "object" ? props.defaultExpanded : {}
16016
16041
  );
16017
16042
  const { data: tableData, columns: tableColumns } = useTableGenerator(props.tableGeneratorType, {
@@ -16257,15 +16282,15 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
16257
16282
 
16258
16283
  // src/components/fiscal/ItalianFiscalData.tsx
16259
16284
  import { useTranslations as useTranslations58 } from "next-intl";
16260
- import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef30, useState as useState58 } from "react";
16285
+ import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef30, useState as useState59 } from "react";
16261
16286
  import { z as z4 } from "zod";
16262
16287
  import { jsx as jsx173, jsxs as jsxs100 } from "react/jsx-runtime";
16263
16288
  var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
16264
16289
  const t = useTranslations58();
16265
16290
  const initialRef = useRef30(initialData);
16266
- const [fiscalData, setFiscalData] = useState58(initialData);
16291
+ const [fiscalData, setFiscalData] = useState59(initialData);
16267
16292
  const fiscalDataRef = useRef30(initialData);
16268
- const [fiscalErrors, setFiscalErrors] = useState58({});
16293
+ const [fiscalErrors, setFiscalErrors] = useState59({});
16269
16294
  const updateFiscalField = useCallback35((key, value) => {
16270
16295
  setFiscalData((prev) => {
16271
16296
  const next = { ...prev, [key]: value };
@@ -16370,7 +16395,7 @@ var ItalianFiscalData_default = ItalianFiscalData;
16370
16395
  import Image8 from "next/image";
16371
16396
 
16372
16397
  // src/features/auth/contexts/AuthContext.tsx
16373
- import { createContext as createContext20, useContext as useContext21, useMemo as useMemo29, useState as useState60 } from "react";
16398
+ import { createContext as createContext21, useContext as useContext22, useMemo as useMemo29, useState as useState61 } from "react";
16374
16399
 
16375
16400
  // src/features/auth/components/forms/Register.tsx
16376
16401
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
@@ -16378,7 +16403,7 @@ import { Loader2 as Loader23 } from "lucide-react";
16378
16403
  import { useTranslations as useTranslations60 } from "next-intl";
16379
16404
  import Image7 from "next/image";
16380
16405
  import { useSearchParams as useSearchParams2 } from "next/navigation";
16381
- import { useEffect as useEffect50, useState as useState59 } from "react";
16406
+ import { useEffect as useEffect50, useState as useState60 } from "react";
16382
16407
  import { useForm as useForm5 } from "react-hook-form";
16383
16408
  import { v4 as v45 } from "uuid";
16384
16409
  import { z as z5 } from "zod";
@@ -16449,13 +16474,13 @@ function Register() {
16449
16474
  const searchParams = useSearchParams2();
16450
16475
  const inviteCode = searchParams.get("invite");
16451
16476
  const registrationMode = getRegistrationMode();
16452
- const [showConfirmation, setShowConfirmation] = useState59(false);
16453
- const [inviteValidated, setInviteValidated] = useState59(false);
16454
- const [inviteError, setInviteError] = useState59("");
16455
- const [isValidatingInvite, setIsValidatingInvite] = useState59(
16477
+ const [showConfirmation, setShowConfirmation] = useState60(false);
16478
+ const [inviteValidated, setInviteValidated] = useState60(false);
16479
+ const [inviteError, setInviteError] = useState60("");
16480
+ const [isValidatingInvite, setIsValidatingInvite] = useState60(
16456
16481
  registrationMode === "waitlist" && !!inviteCode
16457
16482
  );
16458
- const [referralCode, setReferralCode2] = useState59(null);
16483
+ const [referralCode, setReferralCode2] = useState60(null);
16459
16484
  useEffect50(() => {
16460
16485
  const code = getReferralCode();
16461
16486
  setReferralCode2(code);
@@ -16720,15 +16745,15 @@ __name(Register, "Register");
16720
16745
 
16721
16746
  // src/features/auth/contexts/AuthContext.tsx
16722
16747
  import { jsx as jsx176 } from "react/jsx-runtime";
16723
- var AuthContext = createContext20(void 0);
16748
+ var AuthContext = createContext21(void 0);
16724
16749
  var AuthContextProvider = /* @__PURE__ */ __name(({
16725
16750
  children,
16726
16751
  initialComponentType,
16727
16752
  initialParams
16728
16753
  }) => {
16729
- const [componentType, setComponentType] = useState60(initialComponentType);
16730
- const [params, setParams] = useState60(initialParams);
16731
- const [pendingTwoFactor, setPendingTwoFactor] = useState60();
16754
+ const [componentType, setComponentType] = useState61(initialComponentType);
16755
+ const [params, setParams] = useState61(initialParams);
16756
+ const [pendingTwoFactor, setPendingTwoFactor] = useState61();
16732
16757
  const activeComponent = useMemo29(() => {
16733
16758
  if (componentType === void 0) return null;
16734
16759
  switch (componentType) {
@@ -16766,7 +16791,7 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
16766
16791
  );
16767
16792
  }, "AuthContextProvider");
16768
16793
  var useAuthContext = /* @__PURE__ */ __name(() => {
16769
- const context = useContext21(AuthContext);
16794
+ const context = useContext22(AuthContext);
16770
16795
  if (context === void 0) {
16771
16796
  throw new Error("useAuthContext must be used within a AuthComponentProvider");
16772
16797
  }
@@ -16790,20 +16815,20 @@ __name(InnerAuthContainer, "InnerAuthContainer");
16790
16815
  // src/features/auth/components/two-factor/TwoFactorSettings.tsx
16791
16816
  import { ShieldAlert, ShieldCheck } from "lucide-react";
16792
16817
  import { useTranslations as useTranslations67 } from "next-intl";
16793
- import { useCallback as useCallback36, useEffect as useEffect52, useState as useState68 } from "react";
16818
+ import { useCallback as useCallback36, useEffect as useEffect52, useState as useState69 } from "react";
16794
16819
  import { v4 as v48 } from "uuid";
16795
16820
 
16796
16821
  // src/features/auth/components/two-factor/BackupCodesDialog.tsx
16797
16822
  import { Copy, Download, RefreshCw as RefreshCw2 } from "lucide-react";
16798
16823
  import { useTranslations as useTranslations61 } from "next-intl";
16799
- import { useState as useState61 } from "react";
16824
+ import { useState as useState62 } from "react";
16800
16825
  import { jsx as jsx178, jsxs as jsxs103 } from "react/jsx-runtime";
16801
16826
  function BackupCodesDialog({ remainingCodes, onRegenerate, trigger }) {
16802
16827
  const t = useTranslations61();
16803
- const [open, setOpen] = useState61(false);
16804
- const [codes, setCodes] = useState61([]);
16805
- const [isLoading, setIsLoading] = useState61(false);
16806
- const [showCodes, setShowCodes] = useState61(false);
16828
+ const [open, setOpen] = useState62(false);
16829
+ const [codes, setCodes] = useState62([]);
16830
+ const [isLoading, setIsLoading] = useState62(false);
16831
+ const [showCodes, setShowCodes] = useState62(false);
16807
16832
  const handleGenerate = /* @__PURE__ */ __name(async () => {
16808
16833
  setIsLoading(true);
16809
16834
  try {
@@ -16898,13 +16923,13 @@ __name(BackupCodesDialog, "BackupCodesDialog");
16898
16923
 
16899
16924
  // src/features/auth/components/two-factor/DisableTwoFactorDialog.tsx
16900
16925
  import { useTranslations as useTranslations62 } from "next-intl";
16901
- import { useState as useState63 } from "react";
16926
+ import { useState as useState64 } from "react";
16902
16927
 
16903
16928
  // src/features/auth/components/two-factor/TotpInput.tsx
16904
- import { useEffect as useEffect51, useRef as useRef31, useState as useState62 } from "react";
16929
+ import { useEffect as useEffect51, useRef as useRef31, useState as useState63 } from "react";
16905
16930
  import { jsx as jsx179, jsxs as jsxs104 } from "react/jsx-runtime";
16906
16931
  function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
16907
- const [digits, setDigits] = useState62(["", "", "", "", "", ""]);
16932
+ const [digits, setDigits] = useState63(["", "", "", "", "", ""]);
16908
16933
  const inputRefs = useRef31([]);
16909
16934
  useEffect51(() => {
16910
16935
  if (autoFocus && inputRefs.current[0]) {
@@ -16968,9 +16993,9 @@ __name(TotpInput, "TotpInput");
16968
16993
  import { jsx as jsx180, jsxs as jsxs105 } from "react/jsx-runtime";
16969
16994
  function DisableTwoFactorDialog({ onSuccess, trigger }) {
16970
16995
  const t = useTranslations62();
16971
- const [open, setOpen] = useState63(false);
16972
- const [isLoading, setIsLoading] = useState63(false);
16973
- const [error, setError] = useState63();
16996
+ const [open, setOpen] = useState64(false);
16997
+ const [isLoading, setIsLoading] = useState64(false);
16998
+ const [error, setError] = useState64();
16974
16999
  const handleVerify = /* @__PURE__ */ __name(async (code) => {
16975
17000
  setIsLoading(true);
16976
17001
  setError(void 0);
@@ -17011,14 +17036,14 @@ __name(DisableTwoFactorDialog, "DisableTwoFactorDialog");
17011
17036
  // src/features/auth/components/two-factor/PasskeyList.tsx
17012
17037
  import { Edit, Key, Trash2 } from "lucide-react";
17013
17038
  import { useTranslations as useTranslations63 } from "next-intl";
17014
- import { useState as useState64 } from "react";
17039
+ import { useState as useState65 } from "react";
17015
17040
  import { Fragment as Fragment31, jsx as jsx181, jsxs as jsxs106 } from "react/jsx-runtime";
17016
17041
  function PasskeyList({ passkeys, onRefresh }) {
17017
17042
  const t = useTranslations63();
17018
- const [renameDialogOpen, setRenameDialogOpen] = useState64(false);
17019
- const [selectedPasskey, setSelectedPasskey] = useState64(null);
17020
- const [newName, setNewName] = useState64("");
17021
- const [isLoading, setIsLoading] = useState64(false);
17043
+ const [renameDialogOpen, setRenameDialogOpen] = useState65(false);
17044
+ const [selectedPasskey, setSelectedPasskey] = useState65(null);
17045
+ const [newName, setNewName] = useState65("");
17046
+ const [isLoading, setIsLoading] = useState65(false);
17022
17047
  const handleDelete = /* @__PURE__ */ __name(async (passkey) => {
17023
17048
  setIsLoading(true);
17024
17049
  try {
@@ -17132,14 +17157,14 @@ __name(PasskeyList, "PasskeyList");
17132
17157
  // src/features/auth/components/two-factor/PasskeySetupDialog.tsx
17133
17158
  import { startRegistration } from "@simplewebauthn/browser";
17134
17159
  import { useTranslations as useTranslations64 } from "next-intl";
17135
- import { useState as useState65 } from "react";
17160
+ import { useState as useState66 } from "react";
17136
17161
  import { v4 as v46 } from "uuid";
17137
17162
  import { jsx as jsx182, jsxs as jsxs107 } from "react/jsx-runtime";
17138
17163
  function PasskeySetupDialog({ open, onOpenChange, onSuccess }) {
17139
17164
  const t = useTranslations64();
17140
17165
  const { currentUser } = useCurrentUserContext();
17141
- const [name, setName] = useState65("");
17142
- const [isLoading, setIsLoading] = useState65(false);
17166
+ const [name, setName] = useState66("");
17167
+ const [isLoading, setIsLoading] = useState66(false);
17143
17168
  const handleRegister = /* @__PURE__ */ __name(async () => {
17144
17169
  if (!name.trim()) return;
17145
17170
  setIsLoading(true);
@@ -17203,11 +17228,11 @@ __name(PasskeySetupDialog, "PasskeySetupDialog");
17203
17228
  // src/features/auth/components/two-factor/TotpAuthenticatorList.tsx
17204
17229
  import { Smartphone, Trash2 as Trash22 } from "lucide-react";
17205
17230
  import { useTranslations as useTranslations65 } from "next-intl";
17206
- import { useState as useState66 } from "react";
17231
+ import { useState as useState67 } from "react";
17207
17232
  import { jsx as jsx183, jsxs as jsxs108 } from "react/jsx-runtime";
17208
17233
  function TotpAuthenticatorList({ authenticators, onDelete }) {
17209
17234
  const t = useTranslations65();
17210
- const [deletingId, setDeletingId] = useState66(null);
17235
+ const [deletingId, setDeletingId] = useState67(null);
17211
17236
  const handleDelete = /* @__PURE__ */ __name(async (id) => {
17212
17237
  setDeletingId(id);
17213
17238
  try {
@@ -17278,19 +17303,19 @@ __name(TotpAuthenticatorList, "TotpAuthenticatorList");
17278
17303
  // src/features/auth/components/two-factor/TotpSetupDialog.tsx
17279
17304
  import { useTranslations as useTranslations66 } from "next-intl";
17280
17305
  import { QRCodeSVG } from "qrcode.react";
17281
- import { useState as useState67 } from "react";
17306
+ import { useState as useState68 } from "react";
17282
17307
  import { v4 as v47 } from "uuid";
17283
17308
  import { jsx as jsx184, jsxs as jsxs109 } from "react/jsx-runtime";
17284
17309
  function TotpSetupDialog({ onSuccess, trigger }) {
17285
17310
  const t = useTranslations66();
17286
17311
  const { currentUser } = useCurrentUserContext();
17287
- const [open, setOpen] = useState67(false);
17288
- const [step, setStep] = useState67("name");
17289
- const [name, setName] = useState67("");
17290
- const [qrCodeUri, setQrCodeUri] = useState67("");
17291
- const [authenticatorId, setAuthenticatorId] = useState67("");
17292
- const [isLoading, setIsLoading] = useState67(false);
17293
- const [verifyError, setVerifyError] = useState67();
17312
+ const [open, setOpen] = useState68(false);
17313
+ const [step, setStep] = useState68("name");
17314
+ const [name, setName] = useState68("");
17315
+ const [qrCodeUri, setQrCodeUri] = useState68("");
17316
+ const [authenticatorId, setAuthenticatorId] = useState68("");
17317
+ const [isLoading, setIsLoading] = useState68(false);
17318
+ const [verifyError, setVerifyError] = useState68();
17294
17319
  const handleStartSetup = /* @__PURE__ */ __name(async () => {
17295
17320
  if (!name.trim()) return;
17296
17321
  setIsLoading(true);
@@ -17388,12 +17413,12 @@ __name(TotpSetupDialog, "TotpSetupDialog");
17388
17413
  import { Fragment as Fragment32, jsx as jsx185, jsxs as jsxs110 } from "react/jsx-runtime";
17389
17414
  function TwoFactorSettings() {
17390
17415
  const t = useTranslations67();
17391
- const [status, setStatus] = useState68(null);
17392
- const [authenticators, setAuthenticators] = useState68([]);
17393
- const [passkeys, setPasskeys] = useState68([]);
17394
- const [isLoading, setIsLoading] = useState68(true);
17395
- const [isEnabling, setIsEnabling] = useState68(false);
17396
- const [passkeyDialogOpen, setPasskeyDialogOpen] = useState68(false);
17416
+ const [status, setStatus] = useState69(null);
17417
+ const [authenticators, setAuthenticators] = useState69([]);
17418
+ const [passkeys, setPasskeys] = useState69([]);
17419
+ const [isLoading, setIsLoading] = useState69(true);
17420
+ const [isEnabling, setIsEnabling] = useState69(false);
17421
+ const [passkeyDialogOpen, setPasskeyDialogOpen] = useState69(false);
17397
17422
  const loadStatus = useCallback36(async () => {
17398
17423
  try {
17399
17424
  const [statusData, authenticatorsList, passkeysList] = await Promise.all([
@@ -17600,14 +17625,14 @@ __name(LandingComponent, "LandingComponent");
17600
17625
  import { zodResolver as zodResolver6 } from "@hookform/resolvers/zod";
17601
17626
  import { useTranslations as useTranslations69 } from "next-intl";
17602
17627
  import Image10 from "next/image";
17603
- import { useEffect as useEffect53, useState as useState69 } from "react";
17628
+ import { useEffect as useEffect53, useState as useState70 } from "react";
17604
17629
  import { useForm as useForm6 } from "react-hook-form";
17605
17630
  import { z as z6 } from "zod";
17606
17631
  import { Fragment as Fragment34, jsx as jsx189, jsxs as jsxs113 } from "react/jsx-runtime";
17607
17632
  function AcceptInvitation() {
17608
17633
  const { setComponentType, params, setParams } = useAuthContext();
17609
- const [showConfirmation, setShowConfirmation] = useState69(false);
17610
- const [error, setError] = useState69(void 0);
17634
+ const [showConfirmation, setShowConfirmation] = useState70(false);
17635
+ const [error, setError] = useState70(void 0);
17611
17636
  const t = useTranslations69();
17612
17637
  useEffect53(() => {
17613
17638
  async function validateCode(code) {
@@ -17702,12 +17727,12 @@ __name(AcceptInvitation, "AcceptInvitation");
17702
17727
  // src/features/auth/components/forms/ActivateAccount.tsx
17703
17728
  import { useTranslations as useTranslations70 } from "next-intl";
17704
17729
  import Image11 from "next/image";
17705
- import { useEffect as useEffect54, useState as useState70 } from "react";
17730
+ import { useEffect as useEffect54, useState as useState71 } from "react";
17706
17731
  import { Fragment as Fragment35, jsx as jsx190, jsxs as jsxs114 } from "react/jsx-runtime";
17707
17732
  function ActivateAccount() {
17708
17733
  const { setComponentType, params, setParams } = useAuthContext();
17709
- const [showConfirmation, setShowConfirmation] = useState70(false);
17710
- const [error, setError] = useState70(void 0);
17734
+ const [showConfirmation, setShowConfirmation] = useState71(false);
17735
+ const [error, setError] = useState71(void 0);
17711
17736
  const t = useTranslations70();
17712
17737
  useEffect54(() => {
17713
17738
  async function ActivateAccount2(code) {
@@ -17750,11 +17775,11 @@ function ActivateAccount() {
17750
17775
  __name(ActivateAccount, "ActivateAccount");
17751
17776
 
17752
17777
  // src/features/auth/components/forms/Cookies.tsx
17753
- import { useEffect as useEffect55, useState as useState71 } from "react";
17778
+ import { useEffect as useEffect55, useState as useState72 } from "react";
17754
17779
  function Cookies({ dehydratedAuth, page }) {
17755
17780
  const { setUser } = useCurrentUserContext();
17756
17781
  const router = useI18nRouter();
17757
- const [hasSaved, setHasSaved] = useState71(false);
17782
+ const [hasSaved, setHasSaved] = useState72(false);
17758
17783
  useEffect55(() => {
17759
17784
  if (hasSaved) return;
17760
17785
  async function saveTokenOnServer() {
@@ -17778,14 +17803,14 @@ __name(Cookies, "Cookies");
17778
17803
  import { zodResolver as zodResolver7 } from "@hookform/resolvers/zod";
17779
17804
  import { useTranslations as useTranslations71 } from "next-intl";
17780
17805
  import Image12 from "next/image";
17781
- import { useState as useState72 } from "react";
17806
+ import { useState as useState73 } from "react";
17782
17807
  import { useForm as useForm7 } from "react-hook-form";
17783
17808
  import { z as z7 } from "zod";
17784
17809
  import { Fragment as Fragment36, jsx as jsx191, jsxs as jsxs115 } from "react/jsx-runtime";
17785
17810
  function ForgotPassword() {
17786
17811
  const t = useTranslations71();
17787
17812
  const { setComponentType } = useAuthContext();
17788
- const [showConfirmation, setShowConfirmation] = useState72(false);
17813
+ const [showConfirmation, setShowConfirmation] = useState73(false);
17789
17814
  const formSchema = z7.object({
17790
17815
  email: z7.string().email({
17791
17816
  message: t(`common.errors.invalid_email`)
@@ -17850,7 +17875,7 @@ import { zodResolver as zodResolver8 } from "@hookform/resolvers/zod";
17850
17875
  import { useTranslations as useTranslations72 } from "next-intl";
17851
17876
  import Image13 from "next/image";
17852
17877
  import { useRouter, useSearchParams as useSearchParams3 } from "next/navigation";
17853
- import { useEffect as useEffect56, useState as useState73 } from "react";
17878
+ import { useEffect as useEffect56, useState as useState74 } from "react";
17854
17879
  import { useForm as useForm8 } from "react-hook-form";
17855
17880
  import { z as z8 } from "zod";
17856
17881
  import { Fragment as Fragment37, jsx as jsx192, jsxs as jsxs116 } from "react/jsx-runtime";
@@ -17863,7 +17888,7 @@ function Login() {
17863
17888
  const nativeRouter = useRouter();
17864
17889
  const searchParams = useSearchParams3();
17865
17890
  const callbackUrl = searchParams.get("callbackUrl");
17866
- const [referralCode, setReferralCode2] = useState73(null);
17891
+ const [referralCode, setReferralCode2] = useState74(null);
17867
17892
  useEffect56(() => {
17868
17893
  const cookies = document.cookie.split("; ");
17869
17894
  for (const cookie of cookies) {
@@ -18046,14 +18071,14 @@ __name(RefreshUser, "RefreshUser");
18046
18071
  import { zodResolver as zodResolver9 } from "@hookform/resolvers/zod";
18047
18072
  import { useTranslations as useTranslations73 } from "next-intl";
18048
18073
  import Image14 from "next/image";
18049
- import { useEffect as useEffect59, useState as useState74 } from "react";
18074
+ import { useEffect as useEffect59, useState as useState75 } from "react";
18050
18075
  import { useForm as useForm9 } from "react-hook-form";
18051
18076
  import { z as z9 } from "zod";
18052
18077
  import { Fragment as Fragment39, jsx as jsx194, jsxs as jsxs117 } from "react/jsx-runtime";
18053
18078
  function ResetPassword() {
18054
18079
  const { setComponentType, params, setParams } = useAuthContext();
18055
- const [showConfirmation, setShowConfirmation] = useState74(false);
18056
- const [error, setError] = useState74(void 0);
18080
+ const [showConfirmation, setShowConfirmation] = useState75(false);
18081
+ const [error, setError] = useState75(void 0);
18057
18082
  const t = useTranslations73();
18058
18083
  useEffect59(() => {
18059
18084
  async function validateResetPasswordCode(code) {
@@ -18132,18 +18157,18 @@ __name(ResetPassword, "ResetPassword");
18132
18157
  // src/features/auth/components/forms/TwoFactorChallenge.tsx
18133
18158
  import { useTranslations as useTranslations75 } from "next-intl";
18134
18159
  import { useRouter as useRouter2, useSearchParams as useSearchParams4 } from "next/navigation";
18135
- import { useState as useState76 } from "react";
18160
+ import { useState as useState77 } from "react";
18136
18161
  import { v4 as v410 } from "uuid";
18137
18162
 
18138
18163
  // src/features/auth/components/two-factor/PasskeyButton.tsx
18139
18164
  import { startAuthentication } from "@simplewebauthn/browser";
18140
18165
  import { useTranslations as useTranslations74 } from "next-intl";
18141
- import { useState as useState75 } from "react";
18166
+ import { useState as useState76 } from "react";
18142
18167
  import { v4 as v49 } from "uuid";
18143
18168
  import { jsx as jsx195 } from "react/jsx-runtime";
18144
18169
  function PasskeyButton({ pendingToken, onSuccess, onError, disabled = false }) {
18145
18170
  const t = useTranslations74();
18146
- const [isLoading, setIsLoading] = useState75(false);
18171
+ const [isLoading, setIsLoading] = useState76(false);
18147
18172
  const handleClick = /* @__PURE__ */ __name(async () => {
18148
18173
  setIsLoading(true);
18149
18174
  try {
@@ -18188,10 +18213,10 @@ function TwoFactorChallenge() {
18188
18213
  const nativeRouter = useRouter2();
18189
18214
  const searchParams = useSearchParams4();
18190
18215
  const callbackUrl = searchParams.get("callbackUrl");
18191
- const [isVerifying, setIsVerifying] = useState76(false);
18192
- const [totpError, setTotpError] = useState76();
18193
- const [backupCode, setBackupCode] = useState76("");
18194
- const [backupError, setBackupError] = useState76();
18216
+ const [isVerifying, setIsVerifying] = useState77(false);
18217
+ const [totpError, setTotpError] = useState77();
18218
+ const [backupCode, setBackupCode] = useState77("");
18219
+ const [backupError, setBackupError] = useState77();
18195
18220
  if (!pendingTwoFactor) {
18196
18221
  return null;
18197
18222
  }
@@ -18394,7 +18419,7 @@ __name(RelevantContentsList, "RelevantContentsList");
18394
18419
  // src/features/how-to/components/containers/HowToCommand.tsx
18395
18420
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
18396
18421
  import { useTranslations as useTranslations80 } from "next-intl";
18397
- import { useCallback as useCallback37, useEffect as useEffect60, useMemo as useMemo31, useRef as useRef32, useState as useState77 } from "react";
18422
+ import { useCallback as useCallback37, useEffect as useEffect60, useMemo as useMemo31, useRef as useRef32, useState as useState78 } from "react";
18398
18423
 
18399
18424
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
18400
18425
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
@@ -18520,10 +18545,10 @@ function matchPage(pathname, pattern) {
18520
18545
  __name(matchPage, "matchPage");
18521
18546
  function HowToCommand({ pathname, extraGroups, onStartChat }) {
18522
18547
  const t = useTranslations80();
18523
- const [dialogOpen, setDialogOpen] = useState77(false);
18524
- const [selectedHowTo, setSelectedHowTo] = useState77(null);
18548
+ const [dialogOpen, setDialogOpen] = useState78(false);
18549
+ const [selectedHowTo, setSelectedHowTo] = useState78(null);
18525
18550
  const searchTermRef = useRef32("");
18526
- const [searchTerm, setSearchTerm] = useState77("");
18551
+ const [searchTerm, setSearchTerm] = useState78("");
18527
18552
  const data = useDataListRetriever({
18528
18553
  retriever: /* @__PURE__ */ __name((params) => {
18529
18554
  return HowToService.findMany(params);
@@ -18832,7 +18857,7 @@ __name(HowToListContainer, "HowToListContainer");
18832
18857
  // src/features/how-to/components/forms/HowToSelector.tsx
18833
18858
  import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
18834
18859
  import { useTranslations as useTranslations84 } from "next-intl";
18835
- import { useCallback as useCallback38, useEffect as useEffect61, useRef as useRef33, useState as useState78 } from "react";
18860
+ import { useCallback as useCallback38, useEffect as useEffect61, useRef as useRef33, useState as useState79 } from "react";
18836
18861
  import { Fragment as Fragment43, jsx as jsx208, jsxs as jsxs123 } from "react/jsx-runtime";
18837
18862
  function HowToSelector({
18838
18863
  id,
@@ -18843,10 +18868,10 @@ function HowToSelector({
18843
18868
  isRequired = false
18844
18869
  }) {
18845
18870
  const t = useTranslations84();
18846
- const [open, setOpen] = useState78(false);
18871
+ const [open, setOpen] = useState79(false);
18847
18872
  const searchTermRef = useRef33("");
18848
- const [searchTerm, setSearchTerm] = useState78("");
18849
- const [isSearching, setIsSearching] = useState78(false);
18873
+ const [searchTerm, setSearchTerm] = useState79("");
18874
+ const [isSearching, setIsSearching] = useState79(false);
18850
18875
  const data = useDataListRetriever({
18851
18876
  retriever: /* @__PURE__ */ __name((params) => {
18852
18877
  return HowToService.findMany(params);
@@ -18995,18 +19020,18 @@ function AssistantSidebar({ threads, activeId, onSelect, onNew }) {
18995
19020
  __name(AssistantSidebar, "AssistantSidebar");
18996
19021
 
18997
19022
  // src/features/assistant/components/parts/AssistantEmptyState.tsx
18998
- import { useState as useState80 } from "react";
19023
+ import { useState as useState81 } from "react";
18999
19024
  import { useTranslations as useTranslations87 } from "next-intl";
19000
19025
  import { Sparkles } from "lucide-react";
19001
19026
 
19002
19027
  // src/features/assistant/components/parts/AssistantComposer.tsx
19003
- import { useState as useState79 } from "react";
19028
+ import { useState as useState80 } from "react";
19004
19029
  import { useTranslations as useTranslations86 } from "next-intl";
19005
19030
  import { ArrowUp } from "lucide-react";
19006
19031
  import { jsx as jsx210, jsxs as jsxs125 } from "react/jsx-runtime";
19007
19032
  function AssistantComposer({ onSend, disabled, value: controlled, onValueChange }) {
19008
19033
  const t = useTranslations86();
19009
- const [internal, setInternal] = useState79("");
19034
+ const [internal, setInternal] = useState80("");
19010
19035
  const value = controlled ?? internal;
19011
19036
  const setValue = onValueChange ?? setInternal;
19012
19037
  const canSend = value.trim().length > 0 && !disabled;
@@ -19052,7 +19077,7 @@ import { jsx as jsx211, jsxs as jsxs126 } from "react/jsx-runtime";
19052
19077
  var STARTER_KEYS = ["a", "b", "c", "d"];
19053
19078
  function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChange }) {
19054
19079
  const t = useTranslations87();
19055
- const [draft, setDraft] = useState80("");
19080
+ const [draft, setDraft] = useState81("");
19056
19081
  return /* @__PURE__ */ jsx211("div", { className: "flex h-full w-full items-center justify-center p-10", children: /* @__PURE__ */ jsxs126("div", { className: "flex w-full max-w-2xl flex-col gap-6", children: [
19057
19082
  /* @__PURE__ */ jsxs126("div", { className: "text-center", children: [
19058
19083
  /* @__PURE__ */ jsx211("div", { className: "mx-auto mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-gradient-to-br from-blue-400 to-violet-500 text-white", children: /* @__PURE__ */ jsx211(Sparkles, { className: "h-5 w-5" }) }),
@@ -19090,14 +19115,14 @@ function AssistantEmptyState({ onSend, operatorMode = false, onOperatorModeChang
19090
19115
  __name(AssistantEmptyState, "AssistantEmptyState");
19091
19116
 
19092
19117
  // src/features/assistant/components/parts/AssistantThreadHeader.tsx
19093
- import { useState as useState81 } from "react";
19118
+ import { useState as useState82 } from "react";
19094
19119
  import { useTranslations as useTranslations88 } from "next-intl";
19095
19120
  import { jsx as jsx212, jsxs as jsxs127 } from "react/jsx-runtime";
19096
19121
  function AssistantThreadHeader({ assistant, onRename, onDelete }) {
19097
19122
  const t = useTranslations88();
19098
- const [renameValue, setRenameValue] = useState81(assistant.title);
19099
- const [renameOpen, setRenameOpen] = useState81(false);
19100
- const [deleteOpen, setDeleteOpen] = useState81(false);
19123
+ const [renameValue, setRenameValue] = useState82(assistant.title);
19124
+ const [renameOpen, setRenameOpen] = useState82(false);
19125
+ const [deleteOpen, setDeleteOpen] = useState82(false);
19101
19126
  const handleRename = /* @__PURE__ */ __name(async () => {
19102
19127
  const trimmed = renameValue.trim() || assistant.title;
19103
19128
  await onRename(trimmed);
@@ -19159,10 +19184,10 @@ import ReactMarkdown3 from "react-markdown";
19159
19184
  import remarkGfm3 from "remark-gfm";
19160
19185
 
19161
19186
  // src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
19162
- import { useEffect as useEffect62, useMemo as useMemo34, useState as useState84 } from "react";
19187
+ import { useEffect as useEffect62, useMemo as useMemo34, useState as useState85 } from "react";
19163
19188
 
19164
19189
  // src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
19165
- import { useMemo as useMemo33, useState as useState83 } from "react";
19190
+ import { useMemo as useMemo33, useState as useState84 } from "react";
19166
19191
  import { useTranslations as useTranslations93 } from "next-intl";
19167
19192
  import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
19168
19193
 
@@ -19199,7 +19224,7 @@ function ReferencesTab({ references }) {
19199
19224
  __name(ReferencesTab, "ReferencesTab");
19200
19225
 
19201
19226
  // src/features/assistant-message/components/parts/tabs/CitationsTab.tsx
19202
- import { Fragment as Fragment45, useState as useState82 } from "react";
19227
+ import { Fragment as Fragment45, useState as useState83 } from "react";
19203
19228
  import { useTranslations as useTranslations90 } from "next-intl";
19204
19229
  import { ChevronDown as ChevronDown3, HelpCircle } from "lucide-react";
19205
19230
  import ReactMarkdown2 from "react-markdown";
@@ -19238,7 +19263,7 @@ __name(RelevanceMeter, "RelevanceMeter");
19238
19263
  import { jsx as jsx215, jsxs as jsxs130 } from "react/jsx-runtime";
19239
19264
  function CitationsTab({ citations, sources }) {
19240
19265
  const t = useTranslations90();
19241
- const [expanded, setExpanded] = useState82(/* @__PURE__ */ new Set());
19266
+ const [expanded, setExpanded] = useState83(/* @__PURE__ */ new Set());
19242
19267
  if (citations.length === 0) return null;
19243
19268
  const sorted = [...citations].sort((a, b) => (b.relevance ?? 0) - (a.relevance ?? 0));
19244
19269
  const toggle = /* @__PURE__ */ __name((id) => {
@@ -19487,8 +19512,8 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
19487
19512
  if (usersCount > 0) visibleTabs.push("users");
19488
19513
  const autoOpen = isLatestAssistant && suggestionsCount > 0;
19489
19514
  const initialTab = autoOpen ? "suggested" : visibleTabs[0];
19490
- const [open, setOpen] = useState83(autoOpen);
19491
- const [active, setActive] = useState83(initialTab);
19515
+ const [open, setOpen] = useState84(autoOpen);
19516
+ const [active, setActive] = useState84(initialTab);
19492
19517
  if (total === 0) return null;
19493
19518
  const panelId = `sources-panel-${message.id}`;
19494
19519
  return /* @__PURE__ */ jsxs133("div", { className: "mt-2 w-full min-w-0", children: [
@@ -19567,7 +19592,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
19567
19592
  }
19568
19593
  return parts.sort().join("|");
19569
19594
  }, [groups]);
19570
- const [resolved, setResolved] = useState84([]);
19595
+ const [resolved, setResolved] = useState85([]);
19571
19596
  useEffect62(() => {
19572
19597
  if (groups.size === 0) {
19573
19598
  setResolved([]);
@@ -19930,7 +19955,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
19930
19955
  // src/features/notification/components/modals/NotificationModal.tsx
19931
19956
  import { BellIcon } from "lucide-react";
19932
19957
  import { useTranslations as useTranslations98 } from "next-intl";
19933
- import { Fragment as Fragment48, useCallback as useCallback39, useEffect as useEffect64, useMemo as useMemo35, useRef as useRef35, useState as useState85 } from "react";
19958
+ import { Fragment as Fragment48, useCallback as useCallback39, useEffect as useEffect64, useMemo as useMemo35, useRef as useRef35, useState as useState86 } from "react";
19934
19959
  import { jsx as jsx229, jsxs as jsxs141 } from "react/jsx-runtime";
19935
19960
  function NotificationModalContent({ isOpen, setIsOpen }) {
19936
19961
  const _instanceId = useRef35(Math.random().toString(36).substr(2, 9));
@@ -19952,7 +19977,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
19952
19977
  } = useSocketContext();
19953
19978
  const t = useTranslations98();
19954
19979
  const generateUrl = usePageUrlGenerator();
19955
- const [newNotifications, setNewNotifications] = useState85(false);
19980
+ const [newNotifications, setNewNotifications] = useState86(false);
19956
19981
  const preventAutoClose = useRef35(false);
19957
19982
  const circuitBreakerRef = useRef35({
19958
19983
  count: 0,
@@ -20145,14 +20170,14 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
20145
20170
 
20146
20171
  // src/features/referral/components/ReferralWidget.tsx
20147
20172
  import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
20148
- import { useCallback as useCallback40, useRef as useRef36, useState as useState88 } from "react";
20173
+ import { useCallback as useCallback40, useRef as useRef36, useState as useState89 } from "react";
20149
20174
 
20150
20175
  // src/features/referral/hooks/useReferralInvite.ts
20151
- import { useState as useState86 } from "react";
20176
+ import { useState as useState87 } from "react";
20152
20177
  function useReferralInvite() {
20153
- const [sending, setSending] = useState86(false);
20154
- const [error, setError] = useState86(null);
20155
- const [success, setSuccess] = useState86(false);
20178
+ const [sending, setSending] = useState87(false);
20179
+ const [error, setError] = useState87(null);
20180
+ const [success, setSuccess] = useState87(false);
20156
20181
  const sendInvite = /* @__PURE__ */ __name(async (email) => {
20157
20182
  if (!isReferralEnabled()) {
20158
20183
  return;
@@ -20174,11 +20199,11 @@ function useReferralInvite() {
20174
20199
  __name(useReferralInvite, "useReferralInvite");
20175
20200
 
20176
20201
  // src/features/referral/hooks/useReferralStats.ts
20177
- import { useEffect as useEffect66, useState as useState87 } from "react";
20202
+ import { useEffect as useEffect66, useState as useState88 } from "react";
20178
20203
  function useReferralStats() {
20179
- const [stats, setStats] = useState87(null);
20180
- const [loading, setLoading] = useState87(true);
20181
- const [error, setError] = useState87(null);
20204
+ const [stats, setStats] = useState88(null);
20205
+ const [loading, setLoading] = useState88(true);
20206
+ const [error, setError] = useState88(null);
20182
20207
  useEffect66(() => {
20183
20208
  if (!isReferralEnabled()) {
20184
20209
  setLoading(false);
@@ -20249,8 +20274,8 @@ function ReferralWidget({
20249
20274
  const t = { ...DEFAULT_TRANSLATIONS, ...translations };
20250
20275
  const { stats, loading, error } = useReferralStats();
20251
20276
  const { sendInvite, sending } = useReferralInvite();
20252
- const [email, setEmail] = useState88("");
20253
- const [copied, setCopied] = useState88(false);
20277
+ const [email, setEmail] = useState89("");
20278
+ const [copied, setCopied] = useState89(false);
20254
20279
  const linkInputRef = useRef36(null);
20255
20280
  const config = getReferralConfig();
20256
20281
  const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
@@ -20463,11 +20488,11 @@ __name(FormRoles, "FormRoles");
20463
20488
 
20464
20489
  // src/features/role/components/forms/RemoveUserFromRole.tsx
20465
20490
  import { useTranslations as useTranslations101 } from "next-intl";
20466
- import { useEffect as useEffect67, useState as useState89 } from "react";
20491
+ import { useEffect as useEffect67, useState as useState90 } from "react";
20467
20492
  import { Fragment as Fragment51, jsx as jsx236, jsxs as jsxs146 } from "react/jsx-runtime";
20468
20493
  function RemoveUserFromRole({ role, user, refresh }) {
20469
- const [open, setOpen] = useState89(false);
20470
- const [canRemove, setCanRemove] = useState89(false);
20494
+ const [open, setOpen] = useState90(false);
20495
+ const [canRemove, setCanRemove] = useState90(false);
20471
20496
  const t = useTranslations101();
20472
20497
  useEffect67(() => {
20473
20498
  async function checkCompanyAdminDeletability() {
@@ -20539,13 +20564,13 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
20539
20564
  // src/features/role/components/forms/UserRoleAdd.tsx
20540
20565
  import { PlusCircle as PlusCircle2 } from "lucide-react";
20541
20566
  import { useTranslations as useTranslations102 } from "next-intl";
20542
- import { useCallback as useCallback41, useEffect as useEffect68, useRef as useRef37, useState as useState90 } from "react";
20567
+ import { useCallback as useCallback41, useEffect as useEffect68, useRef as useRef37, useState as useState91 } from "react";
20543
20568
  import { Fragment as Fragment52, jsx as jsx237, jsxs as jsxs147 } from "react/jsx-runtime";
20544
20569
  function UserRoleAdd({ user, refresh }) {
20545
- const [open, setOpen] = useState90(false);
20570
+ const [open, setOpen] = useState91(false);
20546
20571
  const inputRef = useRef37(null);
20547
- const [searchTerm, setSearchTerm] = useState90("");
20548
- const [roles, setRoles] = useState90([]);
20572
+ const [searchTerm, setSearchTerm] = useState91("");
20573
+ const [roles, setRoles] = useState91([]);
20549
20574
  const t = useTranslations102();
20550
20575
  const addUserToRole = /* @__PURE__ */ __name(async (role) => {
20551
20576
  await RoleService.addUserToRole({
@@ -20851,11 +20876,11 @@ function OAuthScopeSelector({
20851
20876
  __name(OAuthScopeSelector, "OAuthScopeSelector");
20852
20877
 
20853
20878
  // src/features/oauth/components/OAuthClientSecretDisplay.tsx
20854
- import { useState as useState91, useCallback as useCallback44 } from "react";
20879
+ import { useState as useState92, useCallback as useCallback44 } from "react";
20855
20880
  import { Copy as Copy3, Check, AlertTriangle } from "lucide-react";
20856
20881
  import { jsx as jsx242, jsxs as jsxs150 } from "react/jsx-runtime";
20857
20882
  function OAuthClientSecretDisplay({ secret, onDismiss, open, clientName }) {
20858
- const [copied, setCopied] = useState91(false);
20883
+ const [copied, setCopied] = useState92(false);
20859
20884
  const handleCopy = useCallback44(async () => {
20860
20885
  try {
20861
20886
  await navigator.clipboard.writeText(secret);
@@ -21048,18 +21073,18 @@ function OAuthClientList({
21048
21073
  __name(OAuthClientList, "OAuthClientList");
21049
21074
 
21050
21075
  // src/features/oauth/components/OAuthClientForm.tsx
21051
- import { useState as useState92, useCallback as useCallback45 } from "react";
21076
+ import { useState as useState93, useCallback as useCallback45 } from "react";
21052
21077
  import { jsx as jsx245, jsxs as jsxs153 } from "react/jsx-runtime";
21053
21078
  function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
21054
21079
  const isEditMode = !!client;
21055
- const [formState, setFormState] = useState92({
21080
+ const [formState, setFormState] = useState93({
21056
21081
  name: client?.name || "",
21057
21082
  description: client?.description || "",
21058
21083
  redirectUris: client?.redirectUris?.length ? client.redirectUris : [""],
21059
21084
  allowedScopes: client?.allowedScopes || [],
21060
21085
  isConfidential: client?.isConfidential ?? true
21061
21086
  });
21062
- const [errors, setErrors] = useState92({});
21087
+ const [errors, setErrors] = useState93({});
21063
21088
  const validate = useCallback45(() => {
21064
21089
  const newErrors = {};
21065
21090
  if (!formState.name.trim()) {
@@ -21182,7 +21207,7 @@ function OAuthClientForm({ client, onSubmit, onCancel, isLoading = false }) {
21182
21207
  __name(OAuthClientForm, "OAuthClientForm");
21183
21208
 
21184
21209
  // src/features/oauth/components/OAuthClientDetail.tsx
21185
- import { useState as useState93, useCallback as useCallback46 } from "react";
21210
+ import { useState as useState94, useCallback as useCallback46 } from "react";
21186
21211
  import { format as format2 } from "date-fns";
21187
21212
  import { Copy as Copy4, Check as Check2, RefreshCw as RefreshCw3, Pencil as Pencil2, Trash2 as Trash25, ExternalLink } from "lucide-react";
21188
21213
  import { Fragment as Fragment53, jsx as jsx246, jsxs as jsxs154 } from "react/jsx-runtime";
@@ -21193,11 +21218,11 @@ function OAuthClientDetail({
21193
21218
  onDelete,
21194
21219
  onRegenerateSecret
21195
21220
  }) {
21196
- const [copiedField, setCopiedField] = useState93(null);
21197
- const [showDeleteConfirm, setShowDeleteConfirm] = useState93(false);
21198
- const [showRegenerateConfirm, setShowRegenerateConfirm] = useState93(false);
21199
- const [isDeleting, setIsDeleting] = useState93(false);
21200
- const [isRegenerating, setIsRegenerating] = useState93(false);
21221
+ const [copiedField, setCopiedField] = useState94(null);
21222
+ const [showDeleteConfirm, setShowDeleteConfirm] = useState94(false);
21223
+ const [showRegenerateConfirm, setShowRegenerateConfirm] = useState94(false);
21224
+ const [isDeleting, setIsDeleting] = useState94(false);
21225
+ const [isRegenerating, setIsRegenerating] = useState94(false);
21201
21226
  const copyToClipboard2 = useCallback46(async (text, field) => {
21202
21227
  try {
21203
21228
  await navigator.clipboard.writeText(text);
@@ -21466,7 +21491,7 @@ __name(OAuthConsentScreen, "OAuthConsentScreen");
21466
21491
  import { zodResolver as zodResolver10 } from "@hookform/resolvers/zod";
21467
21492
  import { CheckCircle, Mail as Mail2 } from "lucide-react";
21468
21493
  import { useTranslations as useTranslations105 } from "next-intl";
21469
- import { useState as useState94 } from "react";
21494
+ import { useState as useState95 } from "react";
21470
21495
  import { useForm as useForm10 } from "react-hook-form";
21471
21496
  import { v4 as v411 } from "uuid";
21472
21497
  import { z as z10 } from "zod";
@@ -21567,8 +21592,8 @@ __name(WaitlistQuestionnaireRenderer, "WaitlistQuestionnaireRenderer");
21567
21592
  import { Fragment as Fragment54, jsx as jsx252, jsxs as jsxs160 } from "react/jsx-runtime";
21568
21593
  function WaitlistForm({ onSuccess }) {
21569
21594
  const t = useTranslations105();
21570
- const [isSubmitting, setIsSubmitting] = useState94(false);
21571
- const [isSuccess, setIsSuccess] = useState94(false);
21595
+ const [isSubmitting, setIsSubmitting] = useState95(false);
21596
+ const [isSuccess, setIsSuccess] = useState95(false);
21572
21597
  const config = getWaitlistConfig();
21573
21598
  const questionnaireFields = config.questionnaire ?? [];
21574
21599
  const questionnaireSchema = questionnaireFields.reduce(
@@ -21747,12 +21772,12 @@ __name(WaitlistSuccessState, "WaitlistSuccessState");
21747
21772
  // src/features/waitlist/components/sections/WaitlistConfirmation.tsx
21748
21773
  import { CheckCircle as CheckCircle4, Loader2 as Loader27, XCircle as XCircle2 } from "lucide-react";
21749
21774
  import { useTranslations as useTranslations107 } from "next-intl";
21750
- import { useEffect as useEffect69, useState as useState95 } from "react";
21775
+ import { useEffect as useEffect69, useState as useState96 } from "react";
21751
21776
  import { jsx as jsx255, jsxs as jsxs163 } from "react/jsx-runtime";
21752
21777
  function WaitlistConfirmation({ code }) {
21753
21778
  const t = useTranslations107();
21754
- const [state, setState] = useState95("loading");
21755
- const [errorMessage, setErrorMessage] = useState95("");
21779
+ const [state, setState] = useState96("loading");
21780
+ const [errorMessage, setErrorMessage] = useState96("");
21756
21781
  useEffect69(() => {
21757
21782
  async function confirmEmail() {
21758
21783
  try {
@@ -21793,7 +21818,7 @@ __name(WaitlistConfirmation, "WaitlistConfirmation");
21793
21818
  import { flexRender as flexRender2, getCoreRowModel as getCoreRowModel2, useReactTable as useReactTable2 } from "@tanstack/react-table";
21794
21819
  import { RefreshCw as RefreshCw4, Users as Users2 } from "lucide-react";
21795
21820
  import { useTranslations as useTranslations109 } from "next-intl";
21796
- import { useCallback as useCallback47, useEffect as useEffect70, useState as useState96 } from "react";
21821
+ import { useCallback as useCallback47, useEffect as useEffect70, useState as useState97 } from "react";
21797
21822
 
21798
21823
  // src/features/waitlist/hooks/useWaitlistTableStructure.tsx
21799
21824
  import { Send } from "lucide-react";
@@ -21890,10 +21915,10 @@ __name(useWaitlistTableStructure, "useWaitlistTableStructure");
21890
21915
  import { jsx as jsx257, jsxs as jsxs165 } from "react/jsx-runtime";
21891
21916
  function WaitlistList() {
21892
21917
  const t = useTranslations109();
21893
- const [entries, setEntries] = useState96([]);
21894
- const [total, setTotal] = useState96(0);
21895
- const [isLoading, setIsLoading] = useState96(true);
21896
- const [statusFilter, setStatusFilter] = useState96("all");
21918
+ const [entries, setEntries] = useState97([]);
21919
+ const [total, setTotal] = useState97(0);
21920
+ const [isLoading, setIsLoading] = useState97(true);
21921
+ const [statusFilter, setStatusFilter] = useState97("all");
21897
21922
  const loadEntries = useCallback47(async () => {
21898
21923
  setIsLoading(true);
21899
21924
  try {
@@ -21963,7 +21988,7 @@ __name(WaitlistList, "WaitlistList");
21963
21988
  // src/features/rbac/components/RbacContainer.tsx
21964
21989
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
21965
21990
  import { useTranslations as useTranslations111 } from "next-intl";
21966
- import { memo as memo2, useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo36, useRef as useRef38, useState as useState98 } from "react";
21991
+ import { memo as memo2, useCallback as useCallback49, useEffect as useEffect72, useMemo as useMemo36, useRef as useRef38, useState as useState99 } from "react";
21967
21992
 
21968
21993
  // src/features/rbac/components/RbacPermissionCell.tsx
21969
21994
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
@@ -22044,7 +22069,7 @@ __name(RbacPermissionCell, "RbacPermissionCell");
22044
22069
  import { Popover as PopoverPrimitive2 } from "@base-ui/react/popover";
22045
22070
  import { CheckIcon as CheckIcon10, MinusIcon as MinusIcon3, XIcon as XIcon12 } from "lucide-react";
22046
22071
  import { useTranslations as useTranslations110 } from "next-intl";
22047
- import { useCallback as useCallback48, useEffect as useEffect71, useState as useState97 } from "react";
22072
+ import { useCallback as useCallback48, useEffect as useEffect71, useState as useState98 } from "react";
22048
22073
  import { Fragment as Fragment55, jsx as jsx259, jsxs as jsxs167 } from "react/jsx-runtime";
22049
22074
  function RbacPermissionPicker({
22050
22075
  open,
@@ -22057,7 +22082,7 @@ function RbacPermissionPicker({
22057
22082
  onClose
22058
22083
  }) {
22059
22084
  const t = useTranslations110();
22060
- const [customSegment, setCustomSegment] = useState97("");
22085
+ const [customSegment, setCustomSegment] = useState98("");
22061
22086
  useEffect71(() => {
22062
22087
  if (!open) setCustomSegment("");
22063
22088
  }, [open]);
@@ -22306,8 +22331,8 @@ var ModuleEditor = memo2(/* @__PURE__ */ __name(function ModuleEditor2({
22306
22331
  function RbacContainer() {
22307
22332
  const t = useTranslations111();
22308
22333
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
22309
- const [selectedModuleId, setSelectedModuleId] = useState98(null);
22310
- const [activePicker, setActivePicker] = useState98(null);
22334
+ const [selectedModuleId, setSelectedModuleId] = useState99(null);
22335
+ const [activePicker, setActivePicker] = useState99(null);
22311
22336
  const openPicker = useCallback49((picker) => {
22312
22337
  setActivePicker(picker);
22313
22338
  }, []);
@@ -22418,7 +22443,7 @@ __name(RbacContainer, "RbacContainer");
22418
22443
  // src/features/rbac/components/RbacByRoleContainer.tsx
22419
22444
  import { Loader2Icon as Loader2Icon5 } from "lucide-react";
22420
22445
  import { useTranslations as useTranslations112 } from "next-intl";
22421
- import { Fragment as Fragment56, memo as memo3, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo37, useRef as useRef39, useState as useState99 } from "react";
22446
+ import { Fragment as Fragment56, memo as memo3, useCallback as useCallback50, useEffect as useEffect73, useMemo as useMemo37, useRef as useRef39, useState as useState100 } from "react";
22422
22447
  import { jsx as jsx261, jsxs as jsxs169 } from "react/jsx-runtime";
22423
22448
  function findToken2(tokens, action) {
22424
22449
  if (!tokens) return void 0;
@@ -22456,8 +22481,8 @@ var ACTION_LABELS2 = {
22456
22481
  function RbacByRoleContainer() {
22457
22482
  const t = useTranslations112();
22458
22483
  const { matrix, modulePaths, loading, error, roleNames, moduleNames, updateCell, clearCell } = useRbacContext();
22459
- const [selectedRoleId, setSelectedRoleId] = useState99(null);
22460
- const [activePicker, setActivePicker] = useState99(null);
22484
+ const [selectedRoleId, setSelectedRoleId] = useState100(null);
22485
+ const [activePicker, setActivePicker] = useState100(null);
22461
22486
  const openPicker = useCallback50((picker) => {
22462
22487
  setActivePicker(picker);
22463
22488
  }, []);
@@ -23119,4 +23144,4 @@ export {
23119
23144
  useOAuthClients,
23120
23145
  useOAuthClient
23121
23146
  };
23122
- //# sourceMappingURL=chunk-IRVHKT5I.mjs.map
23147
+ //# sourceMappingURL=chunk-BPGXWAKV.mjs.map