@carlonicora/nextjs-jsonapi 1.96.0 → 1.97.1

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.
@@ -47,7 +47,7 @@ import {
47
47
  TabsList,
48
48
  TabsTrigger,
49
49
  useCurrentUserContext
50
- } from "../chunk-QH4QZLBS.mjs";
50
+ } from "../chunk-A4EZFGFA.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -9226,7 +9226,7 @@ import { useRef as useRef15 } from "react";
9226
9226
  import dynamic from "next/dynamic";
9227
9227
  import React14 from "react";
9228
9228
  import { jsx as jsx73 } from "react/jsx-runtime";
9229
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-VPTC7JY3.mjs"), {
9229
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-74GNMOST.mjs"), {
9230
9230
  ssr: false
9231
9231
  });
9232
9232
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -13787,10 +13787,11 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
13787
13787
  // src/components/editors/BlockNoteEditorSuggestionMenuController.tsx
13788
13788
  import { SuggestionMenuController } from "@blocknote/react";
13789
13789
  import { autoUpdate, flip, shift } from "@floating-ui/react";
13790
- import React22, { useCallback as useCallback28 } from "react";
13790
+ import React22, { useCallback as useCallback28, useMemo as useMemo19 } from "react";
13791
13791
  import { jsx as jsx152 } from "react/jsx-runtime";
13792
13792
  var MentionInsertContext = React22.createContext(null);
13793
13793
  var useMentionInsert = /* @__PURE__ */ __name(() => React22.useContext(MentionInsertContext), "useMentionInsert");
13794
+ var KEEP_OPEN_SENTINEL_TITLE = "__blocknote_mention_keep_open__";
13794
13795
  function BlockNoteEditorMentionSuggestionMenu({
13795
13796
  editor,
13796
13797
  mentionSearchFn,
@@ -13812,7 +13813,7 @@ function BlockNoteEditorMentionSuggestionMenu({
13812
13813
  const getItems = useCallback28(
13813
13814
  async (query) => {
13814
13815
  const results = await mentionSearchFn(query, mentionSearchParams);
13815
- return results.map((item) => ({
13816
+ const items = results.map((item) => ({
13816
13817
  title: item.name,
13817
13818
  subtext: item.entityType,
13818
13819
  icon: item.icon,
@@ -13830,15 +13831,40 @@ function BlockNoteEditorMentionSuggestionMenu({
13830
13831
  ]);
13831
13832
  }, "onItemClick")
13832
13833
  }));
13834
+ if (items.length === 0) {
13835
+ items.push({ title: KEEP_OPEN_SENTINEL_TITLE, onItemClick: /* @__PURE__ */ __name(() => {
13836
+ }, "onItemClick") });
13837
+ }
13838
+ return items;
13833
13839
  },
13834
13840
  [editor, mentionSearchFn, mentionSearchParams]
13835
13841
  );
13842
+ const wrappedSuggestionMenuComponent = useMemo19(() => {
13843
+ if (!suggestionMenuComponent) return void 0;
13844
+ const Component2 = suggestionMenuComponent;
13845
+ const Wrapped = /* @__PURE__ */ __name((props) => {
13846
+ const isSentinelOnly = props.items.length === 1 && props.items[0]?.title === KEEP_OPEN_SENTINEL_TITLE;
13847
+ return /* @__PURE__ */ jsx152(
13848
+ Component2,
13849
+ {
13850
+ ...props,
13851
+ items: isSentinelOnly ? [] : props.items,
13852
+ selectedIndex: isSentinelOnly ? void 0 : props.selectedIndex,
13853
+ onItemClick: (item) => {
13854
+ if (item.title === KEEP_OPEN_SENTINEL_TITLE) return;
13855
+ props.onItemClick?.(item);
13856
+ }
13857
+ }
13858
+ );
13859
+ }, "Wrapped");
13860
+ return Wrapped;
13861
+ }, [suggestionMenuComponent]);
13836
13862
  return /* @__PURE__ */ jsx152(MentionInsertContext.Provider, { value: onMentionInsert, children: /* @__PURE__ */ jsx152("div", { className: "blocknote-suggestion-container", style: { position: "static" }, children: /* @__PURE__ */ jsx152(
13837
13863
  SuggestionMenuController,
13838
13864
  {
13839
13865
  triggerCharacter: "@",
13840
13866
  getItems,
13841
- suggestionMenuComponent,
13867
+ suggestionMenuComponent: wrappedSuggestionMenuComponent,
13842
13868
  floatingUIOptions: {
13843
13869
  useFloatingOptions: {
13844
13870
  strategy: "fixed",
@@ -14051,7 +14077,7 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
14051
14077
  }, "cellUrl");
14052
14078
 
14053
14079
  // src/client/context/JsonApiProvider.tsx
14054
- import { useEffect as useEffect42, useMemo as useMemo19 } from "react";
14080
+ import { useEffect as useEffect42, useMemo as useMemo20 } from "react";
14055
14081
  import { jsx as jsx160 } from "react/jsx-runtime";
14056
14082
  function JsonApiProvider({ config, children }) {
14057
14083
  useEffect42(() => {
@@ -14059,7 +14085,7 @@ function JsonApiProvider({ config, children }) {
14059
14085
  config.bootstrapper();
14060
14086
  }
14061
14087
  }, [config.bootstrapper]);
14062
- const memoizedConfig = useMemo19(() => config, [config]);
14088
+ const memoizedConfig = useMemo20(() => config, [config]);
14063
14089
  return /* @__PURE__ */ jsx160(JsonApiContext.Provider, { value: memoizedConfig, children });
14064
14090
  }
14065
14091
  __name(JsonApiProvider, "JsonApiProvider");
@@ -14265,16 +14291,16 @@ function useJsonApiMutation(config) {
14265
14291
  __name(useJsonApiMutation, "useJsonApiMutation");
14266
14292
 
14267
14293
  // src/client/hooks/useRehydration.ts
14268
- import { useMemo as useMemo20 } from "react";
14294
+ import { useMemo as useMemo21 } from "react";
14269
14295
  function useRehydration(classKey, data) {
14270
- return useMemo20(() => {
14296
+ return useMemo21(() => {
14271
14297
  if (!data) return null;
14272
14298
  return RehydrationFactory.rehydrate(classKey, data);
14273
14299
  }, [classKey, data]);
14274
14300
  }
14275
14301
  __name(useRehydration, "useRehydration");
14276
14302
  function useRehydrationList(classKey, data) {
14277
- return useMemo20(() => {
14303
+ return useMemo21(() => {
14278
14304
  if (!data || data.length === 0) return [];
14279
14305
  return RehydrationFactory.rehydrateList(classKey, data);
14280
14306
  }, [classKey, data]);
@@ -14283,13 +14309,13 @@ __name(useRehydrationList, "useRehydrationList");
14283
14309
 
14284
14310
  // src/features/company/hooks/useCompanyTableStructure.tsx
14285
14311
  import { useTranslations as useTranslations52 } from "next-intl";
14286
- import { useMemo as useMemo21 } from "react";
14312
+ import { useMemo as useMemo22 } from "react";
14287
14313
  import { jsx as jsx161 } from "react/jsx-runtime";
14288
14314
  var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
14289
14315
  const t = useTranslations52();
14290
14316
  const generateUrl = usePageUrlGenerator();
14291
14317
  const { hasRole } = useCurrentUserContext();
14292
- const tableData = useMemo21(() => {
14318
+ const tableData = useMemo22(() => {
14293
14319
  return params.data.map((company) => {
14294
14320
  const entry = {
14295
14321
  jsonApiData: company
@@ -14333,14 +14359,14 @@ var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
14333
14359
  title: t(`common.date.create`)
14334
14360
  })
14335
14361
  };
14336
- const columns = useMemo21(() => {
14362
+ const columns = useMemo22(() => {
14337
14363
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
14338
14364
  }, [params.fields, fieldColumnMap, t, generateUrl, hasRole]);
14339
- return useMemo21(() => ({ data: tableData, columns }), [tableData, columns]);
14365
+ return useMemo22(() => ({ data: tableData, columns }), [tableData, columns]);
14340
14366
  }, "useCompanyTableStructure");
14341
14367
 
14342
14368
  // src/features/company/hooks/useSubscriptionStatus.ts
14343
- import { useMemo as useMemo22 } from "react";
14369
+ import { useMemo as useMemo23 } from "react";
14344
14370
  var TRIAL_DAYS = 14;
14345
14371
  var GRACE_DAYS = 3;
14346
14372
  var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
@@ -14350,7 +14376,7 @@ var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
14350
14376
  }, "isAdministrator");
14351
14377
  function useSubscriptionStatus() {
14352
14378
  const { company, currentUser } = useCurrentUserContext();
14353
- return useMemo22(() => {
14379
+ return useMemo23(() => {
14354
14380
  if (currentUser === null) {
14355
14381
  return {
14356
14382
  status: "loading",
@@ -14415,12 +14441,12 @@ __name(useSubscriptionStatus, "useSubscriptionStatus");
14415
14441
 
14416
14442
  // src/features/role/hooks/useRoleTableStructure.tsx
14417
14443
  import { useTranslations as useTranslations53 } from "next-intl";
14418
- import { useMemo as useMemo23 } from "react";
14444
+ import { useMemo as useMemo24 } from "react";
14419
14445
  import { Fragment as Fragment24, jsx as jsx162 } from "react/jsx-runtime";
14420
14446
  var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
14421
14447
  const t = useTranslations53();
14422
14448
  const generateUrl = usePageUrlGenerator();
14423
- const tableData = useMemo23(() => {
14449
+ const tableData = useMemo24(() => {
14424
14450
  return params.data.map((role) => {
14425
14451
  const entry = {
14426
14452
  jsonApiData: role
@@ -14462,20 +14488,20 @@ var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
14462
14488
  title: t(`common.date.create`)
14463
14489
  })
14464
14490
  };
14465
- const columns = useMemo23(() => {
14491
+ const columns = useMemo24(() => {
14466
14492
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
14467
14493
  }, [params.fields, fieldColumnMap, t, generateUrl]);
14468
- return useMemo23(() => ({ data: tableData, columns }), [tableData, columns]);
14494
+ return useMemo24(() => ({ data: tableData, columns }), [tableData, columns]);
14469
14495
  }, "useRoleTableStructure");
14470
14496
 
14471
14497
  // src/features/content/hooks/useContentTableStructure.tsx
14472
14498
  import { useTranslations as useTranslations54 } from "next-intl";
14473
- import { useMemo as useMemo24 } from "react";
14499
+ import { useMemo as useMemo25 } from "react";
14474
14500
  import { Fragment as Fragment25, jsx as jsx163, jsxs as jsxs93 } from "react/jsx-runtime";
14475
14501
  var useContentTableStructure = /* @__PURE__ */ __name((params) => {
14476
14502
  const t = useTranslations54();
14477
14503
  const generateUrl = usePageUrlGenerator();
14478
- const tableData = useMemo24(() => {
14504
+ const tableData = useMemo25(() => {
14479
14505
  return params.data.map((content) => {
14480
14506
  const entry = {
14481
14507
  jsonApiData: content
@@ -14560,7 +14586,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
14560
14586
  title: t(`common.date.update`)
14561
14587
  })
14562
14588
  };
14563
- const columns = useMemo24(() => {
14589
+ const columns = useMemo25(() => {
14564
14590
  return params.fields.map((field) => {
14565
14591
  const localHandler = fieldColumnMap[field];
14566
14592
  if (localHandler) return localHandler();
@@ -14569,7 +14595,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
14569
14595
  return void 0;
14570
14596
  }).filter((col) => col !== void 0);
14571
14597
  }, [params.fields, fieldColumnMap, t, generateUrl, params.context?.customCells]);
14572
- return useMemo24(() => ({ data: tableData, columns }), [tableData, columns]);
14598
+ return useMemo25(() => ({ data: tableData, columns }), [tableData, columns]);
14573
14599
  }, "useContentTableStructure");
14574
14600
 
14575
14601
  // src/features/oauth/hooks/useOAuthClients.ts
@@ -14868,7 +14894,7 @@ registerTableGenerator("companies", useCompanyTableStructure);
14868
14894
  // src/components/tables/ContentListTable.tsx
14869
14895
  import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
14870
14896
  import { ChevronLeft, ChevronRight } from "lucide-react";
14871
- import { memo, useMemo as useMemo25, useState as useState55 } from "react";
14897
+ import React24, { memo, useMemo as useMemo26, useState as useState55 } from "react";
14872
14898
 
14873
14899
  // src/components/tables/ContentTableSearch.tsx
14874
14900
  import { RefreshCw, Search, X as X3 } from "lucide-react";
@@ -14963,6 +14989,17 @@ __name(ContentTableSearch, "ContentTableSearch");
14963
14989
  // src/components/tables/ContentListTable.tsx
14964
14990
  import { Fragment as Fragment26, jsx as jsx165, jsxs as jsxs95 } from "react/jsx-runtime";
14965
14991
  var EMPTY_ARRAY = [];
14992
+ function getGroupKeys(item, field) {
14993
+ const value = item.jsonApiData[field];
14994
+ if (Array.isArray(value)) {
14995
+ return value.filter((v) => v && typeof v === "object" && "name" in v).map((v) => v.name ?? String(v.id));
14996
+ }
14997
+ if (value && typeof value === "object" && "name" in value) {
14998
+ return [value.name ?? String(value.id)];
14999
+ }
15000
+ return [String(value ?? "")];
15001
+ }
15002
+ __name(getGroupKeys, "getGroupKeys");
14966
15003
  var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(props) {
14967
15004
  const { data, fields, checkedIds, toggleId, allowSearch, filters: _filters, fullWidth } = props;
14968
15005
  const [expanded, setExpanded] = useState55(
@@ -14976,7 +15013,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
14976
15013
  dataRetriever: data,
14977
15014
  context: props.context
14978
15015
  });
14979
- const columnVisibility = useMemo25(
15016
+ const columnVisibility = useMemo26(
14980
15017
  () => fields.reduce(
14981
15018
  (acc, columnId) => {
14982
15019
  acc[columnId] = true;
@@ -15001,6 +15038,26 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
15001
15038
  }
15002
15039
  });
15003
15040
  const rowModel = tableData ? table.getRowModel() : null;
15041
+ const groupedRows = useMemo26(() => {
15042
+ if (!props.groupBy || !rowModel?.rows?.length) return null;
15043
+ const groupMap = /* @__PURE__ */ new Map();
15044
+ for (const row of rowModel.rows) {
15045
+ const keys = getGroupKeys(row.original, props.groupBy);
15046
+ for (const key of keys) {
15047
+ let list = groupMap.get(key);
15048
+ if (!list) {
15049
+ list = [];
15050
+ groupMap.set(key, list);
15051
+ }
15052
+ list.push(row);
15053
+ }
15054
+ }
15055
+ const sortedKeys = [...groupMap.keys()].sort((a, b) => a.localeCompare(b));
15056
+ return sortedKeys.map((groupKey) => ({
15057
+ groupKey,
15058
+ rows: groupMap.get(groupKey)
15059
+ }));
15060
+ }, [props.groupBy, rowModel]);
15004
15061
  const showFooter = !!(data.next || data.previous);
15005
15062
  return /* @__PURE__ */ jsx165("div", { className: "flex w-full flex-col", children: /* @__PURE__ */ jsx165("div", { className: cn(`overflow-clip`, fullWidth ? `` : `rounded-md border`), children: /* @__PURE__ */ jsxs95(Table, { children: [
15006
15063
  /* @__PURE__ */ jsxs95(TableHeader, { className: "bg-muted font-semibold", children: [
@@ -15041,7 +15098,20 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
15041
15098
  return /* @__PURE__ */ jsx165(TableHead, { className: meta?.className, children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }, header.id);
15042
15099
  }) }, headerGroup.id))
15043
15100
  ] }),
15044
- /* @__PURE__ */ jsx165(TableBody, { children: rowModel && rowModel.rows?.length ? rowModel.rows.map((row) => /* @__PURE__ */ jsx165(TableRow, { children: row.getVisibleCells().map((cell) => {
15101
+ /* @__PURE__ */ jsx165(TableBody, { children: rowModel && rowModel.rows?.length ? groupedRows ? groupedRows.map((group) => /* @__PURE__ */ jsxs95(React24.Fragment, { children: [
15102
+ /* @__PURE__ */ jsx165(TableRow, { children: /* @__PURE__ */ jsx165(
15103
+ TableCell,
15104
+ {
15105
+ colSpan: tableColumns.length,
15106
+ className: "bg-muted text-muted-foreground px-4 py-2 text-sm font-semibold",
15107
+ children: group.groupKey
15108
+ }
15109
+ ) }),
15110
+ group.rows.map((row) => /* @__PURE__ */ jsx165(TableRow, { children: row.getVisibleCells().map((cell) => {
15111
+ const meta = cell.column.columnDef.meta;
15112
+ return /* @__PURE__ */ jsx165(TableCell, { className: meta?.className, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
15113
+ }) }, row.id))
15114
+ ] }, group.groupKey)) : rowModel.rows.map((row) => /* @__PURE__ */ jsx165(TableRow, { children: row.getVisibleCells().map((cell) => {
15045
15115
  const meta = cell.column.columnDef.meta;
15046
15116
  return /* @__PURE__ */ jsx165(TableCell, { className: meta?.className, children: flexRender(cell.column.columnDef.cell, cell.getContext()) }, cell.id);
15047
15117
  }) }, row.id)) : /* @__PURE__ */ jsx165(TableRow, { children: /* @__PURE__ */ jsx165(TableCell, { colSpan: tableColumns.length, className: "h-24 text-center", children: "No results." }) }) }),
@@ -15291,7 +15361,7 @@ var ItalianFiscalData_default = ItalianFiscalData;
15291
15361
  import Image8 from "next/image";
15292
15362
 
15293
15363
  // src/features/auth/contexts/AuthContext.tsx
15294
- import { createContext as createContext20, useContext as useContext21, useMemo as useMemo26, useState as useState58 } from "react";
15364
+ import { createContext as createContext20, useContext as useContext21, useMemo as useMemo27, useState as useState58 } from "react";
15295
15365
 
15296
15366
  // src/features/auth/components/forms/Register.tsx
15297
15367
  import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
@@ -15650,7 +15720,7 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
15650
15720
  const [componentType, setComponentType] = useState58(initialComponentType);
15651
15721
  const [params, setParams] = useState58(initialParams);
15652
15722
  const [pendingTwoFactor, setPendingTwoFactor] = useState58();
15653
- const activeComponent = useMemo26(() => {
15723
+ const activeComponent = useMemo27(() => {
15654
15724
  if (componentType === void 0) return null;
15655
15725
  switch (componentType) {
15656
15726
  case 0 /* Login */:
@@ -17315,12 +17385,12 @@ __name(RelevantContentsList, "RelevantContentsList");
17315
17385
  // src/features/how-to/components/containers/HowToCommand.tsx
17316
17386
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
17317
17387
  import { useTranslations as useTranslations78 } from "next-intl";
17318
- import { useCallback as useCallback37, useEffect as useEffect59, useMemo as useMemo28, useRef as useRef30, useState as useState75 } from "react";
17388
+ import { useCallback as useCallback37, useEffect as useEffect59, useMemo as useMemo29, useRef as useRef30, useState as useState75 } from "react";
17319
17389
 
17320
17390
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
17321
17391
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
17322
17392
  import { useTranslations as useTranslations77 } from "next-intl";
17323
- import { useMemo as useMemo27 } from "react";
17393
+ import { useMemo as useMemo28 } from "react";
17324
17394
 
17325
17395
  // src/features/how-to/utils/blocknote.ts
17326
17396
  function extractTextFromContent(content) {
@@ -17392,8 +17462,8 @@ __name(extractHeadings, "extractHeadings");
17392
17462
  import { jsx as jsx194, jsxs as jsxs117 } from "react/jsx-runtime";
17393
17463
  function HowToCommandViewer({ howTo, onBack, onStartChat }) {
17394
17464
  const t = useTranslations77();
17395
- const readingTime = useMemo27(() => calculateReadingTime(howTo.description), [howTo.description]);
17396
- const headings = useMemo27(() => extractHeadings(howTo.description), [howTo.description]);
17465
+ const readingTime = useMemo28(() => calculateReadingTime(howTo.description), [howTo.description]);
17466
+ const headings = useMemo28(() => extractHeadings(howTo.description), [howTo.description]);
17397
17467
  return /* @__PURE__ */ jsxs117("div", { className: "flex h-full flex-col", children: [
17398
17468
  /* @__PURE__ */ jsxs117("div", { className: "flex items-center gap-3 border-b px-4 py-3", children: [
17399
17469
  /* @__PURE__ */ jsxs117(Button, { variant: "ghost", size: "sm", onClick: onBack, className: "h-8 px-2", children: [
@@ -17452,7 +17522,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
17452
17522
  retrieverParams: {},
17453
17523
  module: Modules.HowTo
17454
17524
  });
17455
- const { relevantHowTos, otherHowTos } = useMemo28(() => {
17525
+ const { relevantHowTos, otherHowTos } = useMemo29(() => {
17456
17526
  if (!data.data) return { relevantHowTos: [], otherHowTos: [] };
17457
17527
  const relevant = [];
17458
17528
  const other = [];
@@ -17649,12 +17719,12 @@ import { useTranslations as useTranslations81 } from "next-intl";
17649
17719
 
17650
17720
  // src/features/how-to/hooks/useHowToTableStructure.tsx
17651
17721
  import { useTranslations as useTranslations80 } from "next-intl";
17652
- import { useMemo as useMemo29 } from "react";
17722
+ import { useMemo as useMemo30 } from "react";
17653
17723
  import { Fragment as Fragment41, jsx as jsx199 } from "react/jsx-runtime";
17654
17724
  var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
17655
17725
  const t = useTranslations80();
17656
17726
  const generateUrl = usePageUrlGenerator();
17657
- const tableData = useMemo29(() => {
17727
+ const tableData = useMemo30(() => {
17658
17728
  return params.data.map((howTo) => {
17659
17729
  const entry = {
17660
17730
  jsonApiData: howTo
@@ -17708,10 +17778,10 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
17708
17778
  title: t(`common.date.update`)
17709
17779
  })
17710
17780
  };
17711
- const columns = useMemo29(() => {
17781
+ const columns = useMemo30(() => {
17712
17782
  return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
17713
17783
  }, [params.fields, fieldColumnMap, t, generateUrl]);
17714
- return useMemo29(() => ({ data: tableData, columns }), [tableData, columns]);
17784
+ return useMemo30(() => ({ data: tableData, columns }), [tableData, columns]);
17715
17785
  }, "useHowToTableStructure");
17716
17786
  registerTableGenerator("howtos", useHowToTableStructure);
17717
17787
 
@@ -18100,10 +18170,10 @@ import ReactMarkdown3 from "react-markdown";
18100
18170
  import remarkGfm3 from "remark-gfm";
18101
18171
 
18102
18172
  // src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
18103
- import { useEffect as useEffect61, useMemo as useMemo31, useState as useState82 } from "react";
18173
+ import { useEffect as useEffect61, useMemo as useMemo32, useState as useState82 } from "react";
18104
18174
 
18105
18175
  // src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
18106
- import { useMemo as useMemo30, useState as useState81 } from "react";
18176
+ import { useMemo as useMemo31, useState as useState81 } from "react";
18107
18177
  import { useTranslations as useTranslations92 } from "next-intl";
18108
18178
  import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
18109
18179
 
@@ -18392,7 +18462,7 @@ __name(SuggestedQuestionsTab, "SuggestedQuestionsTab");
18392
18462
  import { jsx as jsx214, jsxs as jsxs130 } from "react/jsx-runtime";
18393
18463
  function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sources, users }) {
18394
18464
  const t = useTranslations92();
18395
- const visibleReferences = useMemo30(
18465
+ const visibleReferences = useMemo31(
18396
18466
  () => message.references.filter((ref) => {
18397
18467
  try {
18398
18468
  return !!ModuleRegistry.findByName(ref.type).pageUrl;
@@ -18405,7 +18475,7 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
18405
18475
  const refsCount = visibleReferences.length;
18406
18476
  const citationsCount = message.citations.length;
18407
18477
  const suggestionsCount = isLatestAssistant ? message.suggestedQuestions.length : 0;
18408
- const contentsCount = useMemo30(() => {
18478
+ const contentsCount = useMemo31(() => {
18409
18479
  if (sources) return sources.size;
18410
18480
  const ids = /* @__PURE__ */ new Set();
18411
18481
  for (const c of message.citations) {
@@ -18482,7 +18552,7 @@ var SourcesFetcher = class extends ClientAbstractService {
18482
18552
  }
18483
18553
  };
18484
18554
  function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp }) {
18485
- const groups = useMemo31(() => {
18555
+ const groups = useMemo32(() => {
18486
18556
  const map = /* @__PURE__ */ new Map();
18487
18557
  for (const chunk of message.citations) {
18488
18558
  if (!chunk.nodeType || !chunk.nodeId) continue;
@@ -18495,7 +18565,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
18495
18565
  }
18496
18566
  return map;
18497
18567
  }, [message.citations]);
18498
- const groupsKey = useMemo31(() => {
18568
+ const groupsKey = useMemo32(() => {
18499
18569
  const parts = [];
18500
18570
  for (const [nodeType, ids] of groups) {
18501
18571
  parts.push(`${nodeType}:${Array.from(ids).sort().join(",")}`);
@@ -18537,12 +18607,12 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
18537
18607
  cancelled = true;
18538
18608
  };
18539
18609
  }, [groupsKey, groups]);
18540
- const sources = useMemo31(() => {
18610
+ const sources = useMemo32(() => {
18541
18611
  const map = /* @__PURE__ */ new Map();
18542
18612
  for (const entity of resolved) map.set(entity.id, entity);
18543
18613
  return map;
18544
18614
  }, [resolved]);
18545
- const users = useMemo31(() => {
18615
+ const users = useMemo32(() => {
18546
18616
  const userMap = /* @__PURE__ */ new Map();
18547
18617
  for (const entity of resolved) {
18548
18618
  const author = entity._author ?? (() => {
@@ -18839,7 +18909,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
18839
18909
  // src/features/notification/components/modals/NotificationModal.tsx
18840
18910
  import { BellIcon } from "lucide-react";
18841
18911
  import { useTranslations as useTranslations97 } from "next-intl";
18842
- import { Fragment as Fragment47, useCallback as useCallback39, useEffect as useEffect63, useMemo as useMemo32, useRef as useRef33, useState as useState83 } from "react";
18912
+ import { Fragment as Fragment47, useCallback as useCallback39, useEffect as useEffect63, useMemo as useMemo33, useRef as useRef33, useState as useState83 } from "react";
18843
18913
  import { jsx as jsx224, jsxs as jsxs138 } from "react/jsx-runtime";
18844
18914
  function NotificationModalContent({ isOpen, setIsOpen }) {
18845
18915
  const _instanceId = useRef33(Math.random().toString(36).substr(2, 9));
@@ -18884,7 +18954,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18884
18954
  }
18885
18955
  return !breaker.isOpen;
18886
18956
  }, []);
18887
- const { unreadCount, unreadIds } = useMemo32(() => {
18957
+ const { unreadCount, unreadIds } = useMemo33(() => {
18888
18958
  const unreadNotifications2 = notifications.filter((notif) => !notif.isRead);
18889
18959
  return {
18890
18960
  unreadCount: unreadNotifications2.length,
@@ -20876,7 +20946,7 @@ __name(WaitlistList, "WaitlistList");
20876
20946
  // src/features/rbac/components/RbacContainer.tsx
20877
20947
  import { Loader2Icon as Loader2Icon3 } from "lucide-react";
20878
20948
  import { useTranslations as useTranslations110 } from "next-intl";
20879
- import { memo as memo2, useCallback as useCallback49, useEffect as useEffect71, useMemo as useMemo33, useRef as useRef36, useState as useState96 } from "react";
20949
+ import { memo as memo2, useCallback as useCallback49, useEffect as useEffect71, useMemo as useMemo34, useRef as useRef36, useState as useState96 } from "react";
20880
20950
 
20881
20951
  // src/features/rbac/components/RbacPermissionCell.tsx
20882
20952
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
@@ -21231,11 +21301,11 @@ function RbacContainer() {
21231
21301
  setSelectedModuleId(id);
21232
21302
  setActivePicker(null);
21233
21303
  }, []);
21234
- const sortedModuleIds = useMemo33(() => {
21304
+ const sortedModuleIds = useMemo34(() => {
21235
21305
  if (!matrix) return [];
21236
21306
  return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
21237
21307
  }, [matrix, moduleNames]);
21238
- const roleIds = useMemo33(() => {
21308
+ const roleIds = useMemo34(() => {
21239
21309
  if (roleNames) {
21240
21310
  return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
21241
21311
  }
@@ -21253,14 +21323,14 @@ function RbacContainer() {
21253
21323
  setSelectedModuleId(sortedModuleIds[0]);
21254
21324
  }
21255
21325
  }, [selectedModuleId, sortedModuleIds]);
21256
- const activeValue = useMemo33(() => {
21326
+ const activeValue = useMemo34(() => {
21257
21327
  if (!activePicker || !matrix) return void 0;
21258
21328
  const block = matrix[activePicker.moduleId];
21259
21329
  if (!block) return void 0;
21260
21330
  const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
21261
21331
  return cellValue(tokens, activePicker.action);
21262
21332
  }, [activePicker, matrix]);
21263
- const activeSegments = useMemo33(() => {
21333
+ const activeSegments = useMemo34(() => {
21264
21334
  if (!activePicker) return [];
21265
21335
  return modulePaths[activePicker.moduleId] ?? [];
21266
21336
  }, [activePicker, modulePaths]);
@@ -21331,7 +21401,7 @@ __name(RbacContainer, "RbacContainer");
21331
21401
  // src/features/rbac/components/RbacByRoleContainer.tsx
21332
21402
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
21333
21403
  import { useTranslations as useTranslations111 } from "next-intl";
21334
- import { Fragment as Fragment55, memo as memo3, useCallback as useCallback50, useEffect as useEffect72, useMemo as useMemo34, useRef as useRef37, useState as useState97 } from "react";
21404
+ import { Fragment as Fragment55, memo as memo3, useCallback as useCallback50, useEffect as useEffect72, useMemo as useMemo35, useRef as useRef37, useState as useState97 } from "react";
21335
21405
  import { jsx as jsx256, jsxs as jsxs166 } from "react/jsx-runtime";
21336
21406
  function findToken2(tokens, action) {
21337
21407
  if (!tokens) return void 0;
@@ -21381,11 +21451,11 @@ function RbacByRoleContainer() {
21381
21451
  setSelectedRoleId(id);
21382
21452
  setActivePicker(null);
21383
21453
  }, []);
21384
- const sortedRoleIds = useMemo34(() => {
21454
+ const sortedRoleIds = useMemo35(() => {
21385
21455
  if (!roleNames) return [];
21386
21456
  return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
21387
21457
  }, [roleNames]);
21388
- const sortedModuleIds = useMemo34(() => {
21458
+ const sortedModuleIds = useMemo35(() => {
21389
21459
  if (!matrix) return [];
21390
21460
  return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
21391
21461
  }, [matrix, moduleNames]);
@@ -21394,14 +21464,14 @@ function RbacByRoleContainer() {
21394
21464
  setSelectedRoleId(sortedRoleIds[0]);
21395
21465
  }
21396
21466
  }, [selectedRoleId, sortedRoleIds]);
21397
- const activeValue = useMemo34(() => {
21467
+ const activeValue = useMemo35(() => {
21398
21468
  if (!activePicker || !matrix) return void 0;
21399
21469
  const block = matrix[activePicker.moduleId];
21400
21470
  if (!block) return void 0;
21401
21471
  const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
21402
21472
  return cellValue2(tokens, activePicker.action);
21403
21473
  }, [activePicker, matrix]);
21404
- const activeSegments = useMemo34(() => {
21474
+ const activeSegments = useMemo35(() => {
21405
21475
  if (!activePicker) return [];
21406
21476
  return modulePaths[activePicker.moduleId] ?? [];
21407
21477
  }, [activePicker, modulePaths]);
@@ -22018,4 +22088,4 @@ export {
22018
22088
  useOAuthClients,
22019
22089
  useOAuthClient
22020
22090
  };
22021
- //# sourceMappingURL=chunk-QH4QZLBS.mjs.map
22091
+ //# sourceMappingURL=chunk-A4EZFGFA.mjs.map