acai-ui-library 0.1.21 → 0.1.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (73) hide show
  1. package/dist/components/app-launcher.cjs +231 -0
  2. package/dist/components/app-launcher.cjs.map +1 -0
  3. package/dist/components/app-launcher.d.cts +24 -0
  4. package/dist/components/app-launcher.d.ts +24 -0
  5. package/dist/components/app-launcher.js +197 -0
  6. package/dist/components/app-launcher.js.map +1 -0
  7. package/dist/components/calendar.cjs +13 -5
  8. package/dist/components/calendar.cjs.map +1 -1
  9. package/dist/components/calendar.js +15 -7
  10. package/dist/components/calendar.js.map +1 -1
  11. package/dist/components/date-picker.cjs +17 -7
  12. package/dist/components/date-picker.cjs.map +1 -1
  13. package/dist/components/date-picker.js +23 -13
  14. package/dist/components/date-picker.js.map +1 -1
  15. package/dist/components/date-time-picker.cjs +13 -5
  16. package/dist/components/date-time-picker.cjs.map +1 -1
  17. package/dist/components/date-time-picker.js +28 -20
  18. package/dist/components/date-time-picker.js.map +1 -1
  19. package/dist/components/help-widget/app-id-typecheck.cjs +34 -0
  20. package/dist/components/help-widget/app-id-typecheck.cjs.map +1 -0
  21. package/dist/components/help-widget/app-id-typecheck.d.cts +17 -0
  22. package/dist/components/help-widget/app-id-typecheck.d.ts +17 -0
  23. package/dist/components/help-widget/app-id-typecheck.js +8 -0
  24. package/dist/components/help-widget/app-id-typecheck.js.map +1 -0
  25. package/dist/components/help-widget/consent-dialog.cjs +276 -0
  26. package/dist/components/help-widget/consent-dialog.cjs.map +1 -0
  27. package/dist/components/help-widget/consent-dialog.d.cts +17 -0
  28. package/dist/components/help-widget/consent-dialog.d.ts +17 -0
  29. package/dist/components/help-widget/consent-dialog.js +239 -0
  30. package/dist/components/help-widget/consent-dialog.js.map +1 -0
  31. package/dist/components/help-widget/help-session-banner.cjs +85 -0
  32. package/dist/components/help-widget/help-session-banner.cjs.map +1 -0
  33. package/dist/components/help-widget/help-session-banner.d.cts +17 -0
  34. package/dist/components/help-widget/help-session-banner.d.ts +17 -0
  35. package/dist/components/help-widget/help-session-banner.js +50 -0
  36. package/dist/components/help-widget/help-session-banner.js.map +1 -0
  37. package/dist/components/help-widget/help-widget.cjs +503 -0
  38. package/dist/components/help-widget/help-widget.cjs.map +1 -0
  39. package/dist/components/help-widget/help-widget.d.cts +32 -0
  40. package/dist/components/help-widget/help-widget.d.ts +32 -0
  41. package/dist/components/help-widget/help-widget.js +468 -0
  42. package/dist/components/help-widget/help-widget.js.map +1 -0
  43. package/dist/components/help-widget/highlight-overlay.cjs +84 -0
  44. package/dist/components/help-widget/highlight-overlay.cjs.map +1 -0
  45. package/dist/components/help-widget/highlight-overlay.d.cts +24 -0
  46. package/dist/components/help-widget/highlight-overlay.d.ts +24 -0
  47. package/dist/components/help-widget/highlight-overlay.js +49 -0
  48. package/dist/components/help-widget/highlight-overlay.js.map +1 -0
  49. package/dist/components/help-widget/use-help-session.cjs +85 -0
  50. package/dist/components/help-widget/use-help-session.cjs.map +1 -0
  51. package/dist/components/help-widget/use-help-session.d.cts +46 -0
  52. package/dist/components/help-widget/use-help-session.d.ts +46 -0
  53. package/dist/components/help-widget/use-help-session.js +50 -0
  54. package/dist/components/help-widget/use-help-session.js.map +1 -0
  55. package/dist/index.cjs +580 -82
  56. package/dist/index.cjs.map +1 -1
  57. package/dist/index.d.cts +8 -0
  58. package/dist/index.d.ts +8 -0
  59. package/dist/index.js +615 -126
  60. package/dist/index.js.map +1 -1
  61. package/dist/lib/app-ids.cjs +58 -0
  62. package/dist/lib/app-ids.cjs.map +1 -0
  63. package/dist/lib/app-ids.d.cts +12 -0
  64. package/dist/lib/app-ids.d.ts +12 -0
  65. package/dist/lib/app-ids.js +32 -0
  66. package/dist/lib/app-ids.js.map +1 -0
  67. package/dist/lib/mask-snapshot.cjs +66 -0
  68. package/dist/lib/mask-snapshot.cjs.map +1 -0
  69. package/dist/lib/mask-snapshot.d.cts +16 -0
  70. package/dist/lib/mask-snapshot.d.ts +16 -0
  71. package/dist/lib/mask-snapshot.js +41 -0
  72. package/dist/lib/mask-snapshot.js.map +1 -0
  73. package/package.json +2 -1
package/dist/index.cjs CHANGED
@@ -51,6 +51,7 @@ __export(src_exports, {
51
51
  AlertDialogTrigger: () => AlertDialogTrigger,
52
52
  AlertTitle: () => AlertTitle,
53
53
  AppHeader: () => AppHeader,
54
+ AppLauncher: () => AppLauncher,
54
55
  AspectRatio: () => AspectRatio,
55
56
  Avatar: () => Avatar,
56
57
  AvatarFallback: () => AvatarFallback,
@@ -103,6 +104,7 @@ __export(src_exports, {
103
104
  CommandList: () => CommandList,
104
105
  CommandSeparator: () => CommandSeparator,
105
106
  CommandShortcut: () => CommandShortcut,
107
+ ConsentDialog: () => ConsentDialog,
106
108
  ContextMenu: () => ContextMenu,
107
109
  ContextMenuCheckboxItem: () => ContextMenuCheckboxItem,
108
110
  ContextMenuContent: () => ContextMenuContent,
@@ -173,6 +175,9 @@ __export(src_exports, {
173
175
  H2: () => H2,
174
176
  H3: () => H3,
175
177
  H4: () => H4,
178
+ HelpSessionBanner: () => HelpSessionBanner,
179
+ HelpWidget: () => HelpWidget,
180
+ HighlightOverlay: () => HighlightOverlay,
176
181
  HoverCard: () => HoverCard,
177
182
  HoverCardContent: () => HoverCardContent,
178
183
  HoverCardTrigger: () => HoverCardTrigger,
@@ -240,6 +245,7 @@ __export(src_exports, {
240
245
  ResizableHandle: () => ResizableHandle,
241
246
  ResizablePanel: () => ResizablePanel,
242
247
  ResizablePanelGroup: () => ResizablePanelGroup,
248
+ SUPPORT_APP_IDS: () => SUPPORT_APP_IDS,
243
249
  ScrollArea: () => ScrollArea,
244
250
  ScrollBar: () => ScrollBar,
245
251
  Select: () => Select,
@@ -319,6 +325,8 @@ __export(src_exports, {
319
325
  formatRemaining: () => formatRemaining,
320
326
  inputVariants: () => inputVariants,
321
327
  isGuarded: () => isGuarded,
328
+ isSupportAppId: () => isSupportAppId,
329
+ maskSnapshot: () => maskSnapshot,
322
330
  modeOfOps: () => modeOfOps,
323
331
  navigationMenuTriggerStyle: () => navigationMenuTriggerStyle,
324
332
  readImpersonation: () => readImpersonation,
@@ -327,6 +335,7 @@ __export(src_exports, {
327
335
  toast: () => toast,
328
336
  toggleVariants: () => toggleVariants,
329
337
  useFormField: () => useFormField,
338
+ useHelpSession: () => useHelpSession,
330
339
  useImpersonation: () => useImpersonation,
331
340
  useSidebar: () => useSidebar,
332
341
  useTheme: () => import_next_themes3.useTheme
@@ -4006,6 +4015,12 @@ PaginationInfo.displayName = "PaginationInfo";
4006
4015
  var import_react_day_picker = require("react-day-picker");
4007
4016
  var import_lucide_react22 = require("lucide-react");
4008
4017
  var import_jsx_runtime48 = require("react/jsx-runtime");
4018
+ function CalendarSelect({ children, ...selectProps }) {
4019
+ return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
4020
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("select", { ...selectProps, children }),
4021
+ /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_lucide_react22.ChevronDown, { "aria-hidden": "true", className: "pointer-events-none absolute end-2 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" })
4022
+ ] });
4023
+ }
4009
4024
  var DEFAULT_YEARS_BACK = 10;
4010
4025
  var DEFAULT_YEARS_FORWARD = 10;
4011
4026
  function Calendar({
@@ -4028,16 +4043,16 @@ function Calendar({
4028
4043
  showOutsideDays,
4029
4044
  className: cn("w-[260px] rounded-lg p-3", className),
4030
4045
  classNames: {
4031
- months: "flex flex-col",
4046
+ months: "relative flex flex-col",
4032
4047
  month: "space-y-3",
4033
4048
  month_caption: "relative flex h-8 items-center justify-center",
4034
4049
  caption_label: "text-sm font-medium hidden",
4035
- nav: "flex items-center",
4050
+ nav: "absolute inset-x-0 top-0 flex h-8 items-center",
4036
4051
  button_previous: cn(
4037
- "absolute start-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
4052
+ "absolute start-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
4038
4053
  ),
4039
4054
  button_next: cn(
4040
- "absolute end-0 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
4055
+ "absolute end-0 top-1/2 -translate-y-1/2 inline-flex size-7 items-center justify-center rounded-md bg-transparent p-0 text-muted-foreground hover:bg-muted hover:text-foreground transition-colors cursor-pointer border-none"
4041
4056
  ),
4042
4057
  month_grid: "w-full border-collapse",
4043
4058
  weekdays: "flex w-full",
@@ -4054,8 +4069,9 @@ function Calendar({
4054
4069
  disabled: "[&>button]:text-muted-foreground [&>button]:opacity-40 [&>button]:cursor-default",
4055
4070
  range_middle: "[&>button]:bg-accent [&>button]:text-accent-foreground [&>button]:rounded-none",
4056
4071
  range_start: "[&>button]:rounded-e-none",
4072
+ dropdown_root: "relative",
4057
4073
  dropdowns: "flex items-center gap-1.5 justify-center",
4058
- dropdown: "h-7 rounded-md border border-input bg-background px-2 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1",
4074
+ dropdown: "h-7 appearance-none rounded-md border border-input bg-background ps-2 pe-6 text-xs font-medium text-foreground cursor-pointer outline-none accent-primary focus:border-ring focus:ring-[2px] focus:ring-ring/20 [&>option:checked]:bg-primary [&>option:checked]:text-primary-foreground [&>option]:py-1",
4059
4075
  months_dropdown: "w-[104px]",
4060
4076
  years_dropdown: "w-[72px]",
4061
4077
  hidden: "invisible",
@@ -4063,6 +4079,7 @@ function Calendar({
4063
4079
  },
4064
4080
  captionLayout,
4065
4081
  components: {
4082
+ Select: CalendarSelect,
4066
4083
  Chevron: ({ orientation }) => {
4067
4084
  const Icon2 = orientation === "left" ? import_lucide_react22.ChevronLeft : import_lucide_react22.ChevronRight;
4068
4085
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Icon2, { className: "size-4" });
@@ -4079,7 +4096,9 @@ var React44 = __toESM(require("react"), 1);
4079
4096
  var import_lucide_react23 = require("lucide-react");
4080
4097
  var import_jsx_runtime49 = require("react/jsx-runtime");
4081
4098
  function formatDate(d) {
4082
- return d.toLocaleDateString();
4099
+ const day = String(d.getDate()).padStart(2, "0");
4100
+ const month = String(d.getMonth() + 1).padStart(2, "0");
4101
+ return `${day}/${month}/${d.getFullYear()}`;
4083
4102
  }
4084
4103
  function DatePicker({
4085
4104
  date,
@@ -4100,7 +4119,7 @@ function DatePicker({
4100
4119
  if (range.from) return formatDate(range.from);
4101
4120
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { children: placeholder });
4102
4121
  }
4103
- return date.toLocaleDateString();
4122
+ return formatDate(date);
4104
4123
  }, [date, mode, placeholder]);
4105
4124
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Popover, { children: [
4106
4125
  /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
@@ -5104,8 +5123,168 @@ var AppHeader = React51.forwardRef(
5104
5123
  );
5105
5124
  AppHeader.displayName = "AppHeader";
5106
5125
 
5107
- // src/components/icon/bell-icon.tsx
5126
+ // src/components/app-launcher.tsx
5127
+ var React52 = __toESM(require("react"), 1);
5128
+ var import_lucide_react30 = require("lucide-react");
5108
5129
  var import_jsx_runtime57 = require("react/jsx-runtime");
5130
+ function loadPinnedIds(storageKey) {
5131
+ if (typeof window === "undefined") return [];
5132
+ try {
5133
+ return JSON.parse(localStorage.getItem(storageKey) ?? "[]");
5134
+ } catch {
5135
+ return [];
5136
+ }
5137
+ }
5138
+ var DefaultTrigger = React52.forwardRef(
5139
+ ({ active }, ref) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5140
+ "button",
5141
+ {
5142
+ ref,
5143
+ type: "button",
5144
+ "aria-label": "Apps",
5145
+ className: cn(
5146
+ "flex size-9 items-center justify-center rounded-md transition-colors",
5147
+ active ? "bg-muted text-foreground" : "text-muted-foreground hover:bg-muted/70 hover:text-foreground"
5148
+ ),
5149
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react30.LayoutGrid, { className: "size-[18px]" })
5150
+ }
5151
+ )
5152
+ );
5153
+ DefaultTrigger.displayName = "AppLauncherDefaultTrigger";
5154
+ function AppTile({
5155
+ app,
5156
+ pinned,
5157
+ pinningEnabled,
5158
+ onLaunch,
5159
+ onTogglePin
5160
+ }) {
5161
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
5162
+ "button",
5163
+ {
5164
+ type: "button",
5165
+ onClick: () => onLaunch(app),
5166
+ className: "group relative flex flex-col items-center gap-2 rounded-xl p-2.5 text-center outline-none transition-colors duration-150 hover:bg-muted/60 focus-visible:bg-muted/60",
5167
+ children: [
5168
+ pinningEnabled && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5169
+ "span",
5170
+ {
5171
+ role: "button",
5172
+ tabIndex: 0,
5173
+ "aria-label": pinned ? "Unpin app" : "Pin app",
5174
+ onClick: (e) => {
5175
+ e.stopPropagation();
5176
+ onTogglePin(app.id);
5177
+ },
5178
+ onKeyDown: (e) => {
5179
+ if (e.key === "Enter" || e.key === " ") {
5180
+ e.stopPropagation();
5181
+ e.preventDefault();
5182
+ onTogglePin(app.id);
5183
+ }
5184
+ },
5185
+ className: cn(
5186
+ "absolute right-1 top-1 z-10 flex h-5 w-5 items-center justify-center rounded-full text-muted-foreground transition-opacity",
5187
+ pinned ? "text-primary opacity-100" : "opacity-0 hover:text-foreground group-hover:opacity-100"
5188
+ ),
5189
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_lucide_react30.Pin, { className: cn("size-3", pinned && "fill-current") })
5190
+ }
5191
+ ),
5192
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "relative flex h-12 w-12 items-center justify-center rounded-2xl bg-muted/50 shadow-sm ring-1 ring-border/60 transition-transform duration-150 group-hover:scale-[1.06] group-hover:shadow-md", children: app.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("img", { src: app.iconUrl, alt: "", className: "h-full w-full rounded-2xl object-contain p-2" }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "flex h-full w-full items-center justify-center rounded-2xl text-sm font-semibold text-primary", children: app.displayName.slice(0, 1).toUpperCase() }) }),
5193
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "line-clamp-2 text-[11px] font-medium leading-tight text-foreground", children: app.displayName })
5194
+ ]
5195
+ }
5196
+ );
5197
+ }
5198
+ var AppLauncher = React52.forwardRef(
5199
+ ({
5200
+ apps,
5201
+ isLoading = false,
5202
+ onLaunch,
5203
+ title = "Apps",
5204
+ emptyLabel = "No apps available",
5205
+ pinStorageKey,
5206
+ maxPins = 4,
5207
+ trigger,
5208
+ open,
5209
+ onOpenChange,
5210
+ className
5211
+ }, ref) => {
5212
+ const [internalOpen, setInternalOpen] = React52.useState(false);
5213
+ const isOpen = open ?? internalOpen;
5214
+ const setOpen = onOpenChange ?? setInternalOpen;
5215
+ const [pinnedIds, setPinnedIds] = React52.useState([]);
5216
+ React52.useEffect(() => {
5217
+ if (pinStorageKey) setPinnedIds(loadPinnedIds(pinStorageKey));
5218
+ }, [pinStorageKey]);
5219
+ const togglePin = (id) => {
5220
+ if (!pinStorageKey) return;
5221
+ setPinnedIds((prev) => {
5222
+ const next = prev.includes(id) ? prev.filter((p) => p !== id) : [...prev, id].slice(-maxPins);
5223
+ localStorage.setItem(pinStorageKey, JSON.stringify(next));
5224
+ return next;
5225
+ });
5226
+ };
5227
+ const handleLaunch = (app) => {
5228
+ onLaunch(app);
5229
+ setOpen(false);
5230
+ };
5231
+ const pinningEnabled = !!pinStorageKey;
5232
+ const pinnedApps = pinningEnabled ? pinnedIds.map((id) => apps.find((a) => a.id === id)).filter((a) => !!a) : [];
5233
+ const restApps = pinningEnabled ? apps.filter((a) => !pinnedIds.includes(a.id)) : apps;
5234
+ return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Popover, { open: isOpen, onOpenChange: setOpen, children: [
5235
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(PopoverTrigger, { asChild: true, children: trigger ?? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(DefaultTrigger, { ref, active: isOpen }) }),
5236
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5237
+ PopoverContent,
5238
+ {
5239
+ align: "end",
5240
+ sideOffset: 10,
5241
+ className: cn("w-[22rem] border-none bg-transparent p-0 shadow-none", className),
5242
+ children: /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "overflow-hidden rounded-2xl border border-border/60 bg-card shadow-2xl shadow-black/10 ring-1 ring-border/50 dark:shadow-black/40", children: [
5243
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex items-center justify-between px-4 pb-3 pt-4", children: [
5244
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-[13px] font-semibold tracking-tight text-foreground", children: title }),
5245
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("span", { className: "text-[11px] font-medium text-muted-foreground", children: apps.length > 0 ? apps.length : "" })
5246
+ ] }),
5247
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "max-h-96 overflow-y-auto px-2 pb-3", children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "grid grid-cols-4 gap-1 p-1", children: Array.from({ length: 8 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("div", { className: "flex flex-col items-center gap-2 rounded-xl p-2.5", children: [
5248
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "h-12 w-12 animate-pulse rounded-2xl bg-muted/60" }),
5249
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "h-2.5 w-10 animate-pulse rounded-full bg-muted/60" })
5250
+ ] }, i)) }) : apps.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "py-10 text-center text-sm text-muted-foreground", children: emptyLabel }) : /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
5251
+ pinnedApps.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, { children: [
5252
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "px-1 pb-1.5 pt-1 text-[10px] font-semibold uppercase tracking-wide text-muted-foreground", children: "Pinned" }),
5253
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "grid grid-cols-4 gap-1", children: pinnedApps.map((app) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5254
+ AppTile,
5255
+ {
5256
+ app,
5257
+ pinned: true,
5258
+ pinningEnabled,
5259
+ onLaunch: handleLaunch,
5260
+ onTogglePin: togglePin
5261
+ },
5262
+ app.id
5263
+ )) }),
5264
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "my-2 border-t border-border/60" })
5265
+ ] }),
5266
+ /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { className: "grid grid-cols-4 gap-1", children: restApps.map((app) => /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5267
+ AppTile,
5268
+ {
5269
+ app,
5270
+ pinned: false,
5271
+ pinningEnabled,
5272
+ onLaunch: handleLaunch,
5273
+ onTogglePin: togglePin
5274
+ },
5275
+ app.id
5276
+ )) })
5277
+ ] }) })
5278
+ ] })
5279
+ }
5280
+ )
5281
+ ] });
5282
+ }
5283
+ );
5284
+ AppLauncher.displayName = "AppLauncher";
5285
+
5286
+ // src/components/icon/bell-icon.tsx
5287
+ var import_jsx_runtime58 = require("react/jsx-runtime");
5109
5288
  function BellIcon({
5110
5289
  size = 20,
5111
5290
  width,
@@ -5113,7 +5292,7 @@ function BellIcon({
5113
5292
  fill = "none",
5114
5293
  ...props
5115
5294
  }) {
5116
- return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
5295
+ return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
5117
5296
  "svg",
5118
5297
  {
5119
5298
  viewBox: "0 0 20 20",
@@ -5123,7 +5302,7 @@ function BellIcon({
5123
5302
  "aria-hidden": "true",
5124
5303
  ...props,
5125
5304
  children: [
5126
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5305
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5127
5306
  "path",
5128
5307
  {
5129
5308
  d: "M10 2.75a3.5 3.5 0 0 0-3.5 3.5v1.137c0 .647-.215 1.276-.611 1.788l-.82 1.062A2.25 2.25 0 0 0 6.85 13.75h6.3a2.25 2.25 0 0 0 1.781-3.513l-.82-1.062A2.935 2.935 0 0 1 13.5 7.387V6.25A3.5 3.5 0 0 0 10 2.75Z",
@@ -5133,7 +5312,7 @@ function BellIcon({
5133
5312
  strokeLinejoin: "round"
5134
5313
  }
5135
5314
  ),
5136
- /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
5315
+ /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5137
5316
  "path",
5138
5317
  {
5139
5318
  d: "M8.25 15.25a1.75 1.75 0 0 0 3.5 0",
@@ -5149,18 +5328,18 @@ function BellIcon({
5149
5328
  }
5150
5329
 
5151
5330
  // src/components/icon/icon-info-line-icon.tsx
5152
- var import_jsx_runtime58 = require("react/jsx-runtime");
5331
+ var import_jsx_runtime59 = require("react/jsx-runtime");
5153
5332
  function IconInfoLineIcon({ size = 16, width, height, fill, title, ...props }) {
5154
- return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("svg", { viewBox: "0 0 16 16", width: width ?? size, height: height ?? size, fill: fill ?? "none", "aria-hidden": title ? void 0 : true, role: title ? "img" : "presentation", ...props, children: [
5155
- /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("path", { d: "M7.99992 5.33333H8.00525M7.99992 10.6667V7.33333M14.6666 8C14.6666 11.682 11.6819 14.6667 7.99992 14.6667C4.31792 14.6667 1.33325 11.682 1.33325 8C1.33325 4.318 4.31792 1.33333 7.99992 1.33333C11.6819 1.33333 14.6666 4.318 14.6666 8Z", stroke: "black", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }),
5156
- title ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("title", { children: title }) : null
5333
+ return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)("svg", { viewBox: "0 0 16 16", width: width ?? size, height: height ?? size, fill: fill ?? "none", "aria-hidden": title ? void 0 : true, role: title ? "img" : "presentation", ...props, children: [
5334
+ /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("path", { d: "M7.99992 5.33333H8.00525M7.99992 10.6667V7.33333M14.6666 8C14.6666 11.682 11.6819 14.6667 7.99992 14.6667C4.31792 14.6667 1.33325 11.682 1.33325 8C1.33325 4.318 4.31792 1.33333 7.99992 1.33333C11.6819 1.33333 14.6666 4.318 14.6666 8Z", stroke: "black", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }),
5335
+ title ? /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("title", { children: title }) : null
5157
5336
  ] });
5158
5337
  }
5159
5338
 
5160
5339
  // src/components/sonner.tsx
5161
5340
  var import_next_themes = require("next-themes");
5162
5341
  var import_sonner = require("sonner");
5163
- var import_jsx_runtime59 = require("react/jsx-runtime");
5342
+ var import_jsx_runtime60 = require("react/jsx-runtime");
5164
5343
  var TOAST_DURATION_MS = 4e3;
5165
5344
  var ERROR_TOAST_MS = 7e3;
5166
5345
  var TOKENS = {
@@ -5186,7 +5365,7 @@ var CLASS_NAMES = {
5186
5365
  var TOAST_BOTTOM_OFFSET = "calc(16px + env(safe-area-inset-bottom, 0px))";
5187
5366
  var Toaster = ({ style, toastOptions, ...props }) => {
5188
5367
  const { resolvedTheme, forcedTheme } = (0, import_next_themes.useTheme)();
5189
- return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5368
+ return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5190
5369
  import_sonner.Toaster,
5191
5370
  {
5192
5371
  theme: (forcedTheme ?? resolvedTheme) === "dark" ? "dark" : "light",
@@ -5224,8 +5403,8 @@ var toast = Object.assign(
5224
5403
  );
5225
5404
 
5226
5405
  // src/components/typography.tsx
5227
- var React52 = __toESM(require("react"), 1);
5228
- var import_jsx_runtime60 = require("react/jsx-runtime");
5406
+ var React53 = __toESM(require("react"), 1);
5407
+ var import_jsx_runtime61 = require("react/jsx-runtime");
5229
5408
  var weightMap = {
5230
5409
  extrabold: "font-extrabold",
5231
5410
  bold: "font-bold",
@@ -5247,44 +5426,44 @@ function resolveColor(color, defaultColorClass) {
5247
5426
  if (!color || color === "default") return defaultColorClass;
5248
5427
  return colorMap[color];
5249
5428
  }
5250
- var H1 = React52.forwardRef(
5251
- ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h1", { ref, className: cn("scroll-m-20 text-3xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5429
+ var H1 = React53.forwardRef(
5430
+ ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h1", { ref, className: cn("scroll-m-20 text-3xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5252
5431
  );
5253
5432
  H1.displayName = "H1";
5254
- var H2 = React52.forwardRef(
5255
- ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h2", { ref, className: cn("scroll-m-20 text-2xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5433
+ var H2 = React53.forwardRef(
5434
+ ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h2", { ref, className: cn("scroll-m-20 text-2xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5256
5435
  );
5257
5436
  H2.displayName = "H2";
5258
- var H3 = React52.forwardRef(
5259
- ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h3", { ref, className: cn("scroll-m-20 text-xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5437
+ var H3 = React53.forwardRef(
5438
+ ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h3", { ref, className: cn("scroll-m-20 text-xl tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5260
5439
  );
5261
5440
  H3.displayName = "H3";
5262
- var H4 = React52.forwardRef(
5263
- ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("h4", { ref, className: cn("scroll-m-20 text-lg tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5441
+ var H4 = React53.forwardRef(
5442
+ ({ className, weight = "semibold", color, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("h4", { ref, className: cn("scroll-m-20 text-lg tracking-tight", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props, children })
5264
5443
  );
5265
5444
  H4.displayName = "H4";
5266
- var Body = React52.forwardRef(
5267
- ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { ref, className: cn("text-base leading-7", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
5445
+ var Body = React53.forwardRef(
5446
+ ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { ref, className: cn("text-base leading-7", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
5268
5447
  );
5269
5448
  Body.displayName = "Body";
5270
- var Small = React52.forwardRef(
5271
- ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { ref, className: cn("text-sm", resolveColor(color, "text-muted-foreground"), weightMap[weight], className), ...props })
5449
+ var Small = React53.forwardRef(
5450
+ ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { ref, className: cn("text-sm", resolveColor(color, "text-muted-foreground"), weightMap[weight], className), ...props })
5272
5451
  );
5273
5452
  Small.displayName = "Small";
5274
- var Caption = React52.forwardRef(
5275
- ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { ref, className: cn("text-xs", resolveColor(color, "text-muted-foreground"), weightMap[weight], className), ...props })
5453
+ var Caption = React53.forwardRef(
5454
+ ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { ref, className: cn("text-xs", resolveColor(color, "text-muted-foreground"), weightMap[weight], className), ...props })
5276
5455
  );
5277
5456
  Caption.displayName = "Caption";
5278
- var Lead = React52.forwardRef(
5279
- ({ className, weight = "medium", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { ref, className: cn("text-lg", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
5457
+ var Lead = React53.forwardRef(
5458
+ ({ className, weight = "medium", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { ref, className: cn("text-lg", resolveColor(color, "text-foreground"), weightMap[weight], className), ...props })
5280
5459
  );
5281
5460
  Lead.displayName = "Lead";
5282
- var Muted = React52.forwardRef(
5283
- ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("p", { ref, className: cn("text-sm", resolveColor(color, "text-muted-foreground"), weightMap[weight], className), ...props })
5461
+ var Muted = React53.forwardRef(
5462
+ ({ className, weight = "regular", color, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { ref, className: cn("text-sm", resolveColor(color, "text-muted-foreground"), weightMap[weight], className), ...props })
5284
5463
  );
5285
5464
  Muted.displayName = "Muted";
5286
- var Code = React52.forwardRef(
5287
- ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5465
+ var Code = React53.forwardRef(
5466
+ ({ className, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5288
5467
  "code",
5289
5468
  {
5290
5469
  ref,
@@ -5301,14 +5480,14 @@ Code.displayName = "Code";
5301
5480
  // src/components/theme-provider.tsx
5302
5481
  var import_next_themes2 = require("next-themes");
5303
5482
  var import_next_themes3 = require("next-themes");
5304
- var import_jsx_runtime61 = require("react/jsx-runtime");
5483
+ var import_jsx_runtime62 = require("react/jsx-runtime");
5305
5484
  function ThemeProvider({ children, ...props }) {
5306
- return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_next_themes2.ThemeProvider, { ...props, children });
5485
+ return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_next_themes2.ThemeProvider, { ...props, children });
5307
5486
  }
5308
5487
 
5309
5488
  // src/components/banner.tsx
5310
- var React53 = __toESM(require("react"), 1);
5311
- var import_jsx_runtime62 = require("react/jsx-runtime");
5489
+ var React54 = __toESM(require("react"), 1);
5490
+ var import_jsx_runtime63 = require("react/jsx-runtime");
5312
5491
  var variantStyles = {
5313
5492
  primary: "bg-[var(--hc-banner-primary-bg)] border border-[var(--hc-primary-200)]",
5314
5493
  muted: "bg-[var(--hc-color-muted)] border border-[var(--hc-color-border)]",
@@ -5323,23 +5502,23 @@ var iconBgStyles = {
5323
5502
  warning: "bg-[var(--hc-color-warning)]",
5324
5503
  destructive: "bg-[var(--hc-color-destructive)]"
5325
5504
  };
5326
- var Banner = React53.forwardRef(
5327
- ({ variant = "primary", icon, title, description, action, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5505
+ var Banner = React54.forwardRef(
5506
+ ({ variant = "primary", icon, title, description, action, className, children, ...props }, ref) => /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5328
5507
  "div",
5329
5508
  {
5330
5509
  ref,
5331
5510
  className: cn("rounded-lg px-6 py-5", variantStyles[variant], className),
5332
5511
  ...props,
5333
- children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4", children: [
5334
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { className: "flex items-center gap-3", children: [
5335
- icon && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: cn("h-10 w-10 rounded-full flex items-center justify-center shrink-0 text-white", iconBgStyles[variant]), children: icon }),
5336
- /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)("div", { children: [
5337
- title && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-sm font-bold text-foreground", children: title }),
5338
- description && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("p", { className: "text-xs mt-0.5 text-muted-foreground", children: description }),
5512
+ children: /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4", children: [
5513
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { className: "flex items-center gap-3", children: [
5514
+ icon && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: cn("h-10 w-10 rounded-full flex items-center justify-center shrink-0 text-white", iconBgStyles[variant]), children: icon }),
5515
+ /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("div", { children: [
5516
+ title && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-sm font-bold text-foreground", children: title }),
5517
+ description && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("p", { className: "text-xs mt-0.5 text-muted-foreground", children: description }),
5339
5518
  children
5340
5519
  ] })
5341
5520
  ] }),
5342
- action && /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { className: "shrink-0", children: action })
5521
+ action && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { className: "shrink-0", children: action })
5343
5522
  ] })
5344
5523
  }
5345
5524
  )
@@ -5347,8 +5526,8 @@ var Banner = React53.forwardRef(
5347
5526
  Banner.displayName = "Banner";
5348
5527
 
5349
5528
  // src/components/impersonation-banner.tsx
5350
- var React54 = __toESM(require("react"), 1);
5351
- var import_jsx_runtime63 = require("react/jsx-runtime");
5529
+ var React55 = __toESM(require("react"), 1);
5530
+ var import_jsx_runtime64 = require("react/jsx-runtime");
5352
5531
  function toMs(value) {
5353
5532
  if (value instanceof Date) return value.getTime();
5354
5533
  if (typeof value === "number") return value;
@@ -5363,21 +5542,21 @@ function formatRemaining(ms) {
5363
5542
  const pad = (n) => String(n).padStart(2, "0");
5364
5543
  return h > 0 ? `${h}:${pad(m)}:${pad(s)}` : `${m}:${pad(s)}`;
5365
5544
  }
5366
- var ImpersonationBanner = React54.forwardRef(
5545
+ var ImpersonationBanner = React55.forwardRef(
5367
5546
  ({ actorLabel, mode, expiresAt, onExit, targetLabel, ops, inline = false, onExpire, className }, ref) => {
5368
5547
  const endMs = toMs(expiresAt);
5369
- const [now, setNow] = React54.useState(() => Date.now());
5548
+ const [now, setNow] = React55.useState(() => Date.now());
5370
5549
  const remaining = endMs - now;
5371
5550
  const expired = remaining <= 0;
5372
- const onExpireRef = React54.useRef(onExpire);
5551
+ const onExpireRef = React55.useRef(onExpire);
5373
5552
  onExpireRef.current = onExpire;
5374
- React54.useEffect(() => {
5553
+ React55.useEffect(() => {
5375
5554
  if (expired) return void 0;
5376
5555
  const timer = setInterval(() => setNow(Date.now()), 1e3);
5377
5556
  return () => clearInterval(timer);
5378
5557
  }, [expired]);
5379
- const firedFor = React54.useRef(null);
5380
- React54.useEffect(() => {
5558
+ const firedFor = React55.useRef(null);
5559
+ React55.useEffect(() => {
5381
5560
  if (expired && firedFor.current !== endMs) {
5382
5561
  firedFor.current = endMs;
5383
5562
  onExpireRef.current?.();
@@ -5386,9 +5565,9 @@ var ImpersonationBanner = React54.forwardRef(
5386
5565
  const isRead = mode === "READ";
5387
5566
  const modeText = isRead ? "Read-only" : "Changes allowed";
5388
5567
  const opsText = ops && ops.length > 0 ? ops.join(", ") : null;
5389
- return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
5390
- inline ? null : /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("div", { "aria-hidden": "true", className: "h-12", "data-impersonation-spacer": "" }),
5391
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(
5568
+ return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
5569
+ inline ? null : /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { "aria-hidden": "true", className: "h-12", "data-impersonation-spacer": "" }),
5570
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
5392
5571
  "div",
5393
5572
  {
5394
5573
  ref,
@@ -5402,19 +5581,19 @@ var ImpersonationBanner = React54.forwardRef(
5402
5581
  className
5403
5582
  ),
5404
5583
  children: [
5405
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "shrink-0 rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wide ring-1 ring-current", children: "Support session" }),
5406
- /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)("p", { className: "min-w-0 flex-1 truncate", children: [
5407
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-semibold", children: actorLabel }),
5408
- targetLabel ? /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
5584
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "shrink-0 rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wide ring-1 ring-current", children: "Support session" }),
5585
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)("p", { className: "min-w-0 flex-1 truncate", children: [
5586
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "font-semibold", children: actorLabel }),
5587
+ targetLabel ? /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
5409
5588
  " is acting as ",
5410
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "font-semibold", children: targetLabel })
5589
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "font-semibold", children: targetLabel })
5411
5590
  ] }) : " is acting as this user",
5412
5591
  " \xB7 ",
5413
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { "data-testid": "impersonation-mode", children: modeText }),
5414
- opsText ? /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "hidden sm:inline", children: ` (${opsText})` }) : null
5592
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { "data-testid": "impersonation-mode", children: modeText }),
5593
+ opsText ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "hidden sm:inline", children: ` (${opsText})` }) : null
5415
5594
  ] }),
5416
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("span", { className: "shrink-0 tabular-nums", "aria-live": "off", title: "Time left in this support session", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)("time", { "data-testid": "impersonation-countdown", dateTime: new Date(endMs).toISOString(), children: expired ? "Expired" : formatRemaining(remaining) }) }),
5417
- /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5595
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("span", { className: "shrink-0 tabular-nums", "aria-live": "off", title: "Time left in this support session", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("time", { "data-testid": "impersonation-countdown", dateTime: new Date(endMs).toISOString(), children: expired ? "Expired" : formatRemaining(remaining) }) }),
5596
+ /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
5418
5597
  "button",
5419
5598
  {
5420
5599
  type: "button",
@@ -5435,20 +5614,20 @@ var ImpersonationBanner = React54.forwardRef(
5435
5614
  ImpersonationBanner.displayName = "ImpersonationBanner";
5436
5615
 
5437
5616
  // src/components/read-only-guard.tsx
5438
- var import_jsx_runtime64 = require("react/jsx-runtime");
5617
+ var import_jsx_runtime65 = require("react/jsx-runtime");
5439
5618
  var READ_ONLY_REASON = "Read-only support session: this action is turned off.";
5440
5619
  function isGuarded({ mode, ops, op = "WRITE" }) {
5441
5620
  if (ops) return !ops.includes(op);
5442
5621
  return mode === "READ";
5443
5622
  }
5444
5623
  function ReadOnlyGuard({ mode, ops, op = "WRITE", reason = READ_ONLY_REASON, className, children }) {
5445
- if (!isGuarded({ mode, ops, op })) return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_jsx_runtime64.Fragment, { children });
5624
+ if (!isGuarded({ mode, ops, op })) return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_jsx_runtime65.Fragment, { children });
5446
5625
  const swallow = (e) => {
5447
5626
  e.preventDefault();
5448
5627
  e.stopPropagation();
5449
5628
  };
5450
- return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TooltipProvider, { delayDuration: 150, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Tooltip, { children: [
5451
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
5629
+ return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TooltipProvider, { delayDuration: 150, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(Tooltip, { children: [
5630
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5452
5631
  "span",
5453
5632
  {
5454
5633
  tabIndex: 0,
@@ -5457,16 +5636,16 @@ function ReadOnlyGuard({ mode, ops, op = "WRITE", reason = READ_ONLY_REASON, cla
5457
5636
  className: cn("inline-flex cursor-not-allowed", className),
5458
5637
  onClickCapture: swallow,
5459
5638
  onSubmitCapture: swallow,
5460
- children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("fieldset", { disabled: true, className: "contents", children })
5639
+ children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("fieldset", { disabled: true, className: "contents", children })
5461
5640
  }
5462
5641
  ) }),
5463
- /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(TooltipContent, { children: reason })
5642
+ /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(TooltipContent, { children: reason })
5464
5643
  ] }) });
5465
5644
  }
5466
5645
  ReadOnlyGuard.displayName = "ReadOnlyGuard";
5467
5646
 
5468
5647
  // src/lib/impersonation.ts
5469
- var React55 = __toESM(require("react"), 1);
5648
+ var React56 = __toESM(require("react"), 1);
5470
5649
  var OPERATION_CLASSES = ["READ", "WRITE", "DESTRUCTIVE", "FINANCIAL", "SECURITY"];
5471
5650
  var PLATFORM_BLOCKED = /* @__PURE__ */ new Set(["FINANCIAL", "SECURITY"]);
5472
5651
  var INACTIVE_IMPERSONATION = Object.freeze({
@@ -5530,10 +5709,10 @@ function readImpersonation(token, now = Date.now()) {
5530
5709
  };
5531
5710
  }
5532
5711
  function useImpersonation(token) {
5533
- const [tick, setTick] = React55.useState(0);
5534
- const state = React55.useMemo(() => readImpersonation(token), [token, tick]);
5712
+ const [tick, setTick] = React56.useState(0);
5713
+ const state = React56.useMemo(() => readImpersonation(token), [token, tick]);
5535
5714
  const expiresAtMs = state.expiresAt?.getTime() ?? null;
5536
- React55.useEffect(() => {
5715
+ React56.useEffect(() => {
5537
5716
  if (expiresAtMs === null) return void 0;
5538
5717
  const delay = Math.max(0, expiresAtMs - Date.now());
5539
5718
  const timer = setTimeout(() => setTick((t) => t + 1), Math.min(delay + 50, 2147e6));
@@ -5541,6 +5720,316 @@ function useImpersonation(token) {
5541
5720
  }, [expiresAtMs]);
5542
5721
  return state;
5543
5722
  }
5723
+
5724
+ // src/components/help-widget/help-widget.tsx
5725
+ var React60 = __toESM(require("react"), 1);
5726
+
5727
+ // src/components/help-widget/consent-dialog.tsx
5728
+ var import_jsx_runtime66 = require("react/jsx-runtime");
5729
+ function ConsentDialog({ open, onAllow, onDeny }) {
5730
+ return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AlertDialog, { open, children: /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(AlertDialogContent, { size: "sm", children: [
5731
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(AlertDialogHeader, { children: [
5732
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AlertDialogTitle, { children: "Start a support session?" }),
5733
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AlertDialogDescription, { children: "An AI assistant will see this page and may be recorded (chat and voice). A human can join for anything it cannot resolve. You can stop the session at any time." })
5734
+ ] }),
5735
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(AlertDialogFooter, { children: [
5736
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AlertDialogCancel, { onClick: onDeny, children: "Deny" }),
5737
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(AlertDialogAction, { onClick: onAllow, children: "Allow" })
5738
+ ] })
5739
+ ] }) });
5740
+ }
5741
+
5742
+ // src/components/help-widget/help-session-banner.tsx
5743
+ var React57 = __toESM(require("react"), 1);
5744
+ var import_jsx_runtime67 = require("react/jsx-runtime");
5745
+ var HelpSessionBanner = React57.forwardRef(
5746
+ ({ onRevoke, className }, ref) => {
5747
+ return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_jsx_runtime67.Fragment, { children: [
5748
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { "aria-hidden": "true", className: "h-12", "data-help-session-spacer": "" }),
5749
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(
5750
+ "div",
5751
+ {
5752
+ ref,
5753
+ role: "status",
5754
+ "data-help-session-banner": "",
5755
+ className: cn(
5756
+ "fixed inset-x-0 top-0 z-[2147483000]",
5757
+ "flex h-12 items-center gap-3 border-b-2 border-border bg-primary px-4 text-sm font-medium text-primary-foreground shadow-md",
5758
+ className
5759
+ ),
5760
+ children: [
5761
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("span", { className: "shrink-0 rounded px-2 py-0.5 text-xs font-bold uppercase tracking-wide ring-1 ring-current", children: "Support session" }),
5762
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("p", { className: "min-w-0 flex-1 truncate", children: "AI support is active on this page and may be recorded." }),
5763
+ /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5764
+ "button",
5765
+ {
5766
+ type: "button",
5767
+ onClick: onRevoke,
5768
+ className: "shrink-0 rounded-md bg-background px-3 py-1 text-sm font-semibold text-foreground hover:bg-background/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
5769
+ children: "Stop"
5770
+ }
5771
+ )
5772
+ ]
5773
+ }
5774
+ )
5775
+ ] });
5776
+ }
5777
+ );
5778
+ HelpSessionBanner.displayName = "HelpSessionBanner";
5779
+
5780
+ // src/components/help-widget/highlight-overlay.tsx
5781
+ var React58 = __toESM(require("react"), 1);
5782
+ var import_jsx_runtime68 = require("react/jsx-runtime");
5783
+ function findTarget({ selector, role, name }) {
5784
+ if (selector) return document.querySelector(selector);
5785
+ if (role) {
5786
+ const candidates = document.querySelectorAll(`[role="${role}"]`);
5787
+ for (const el of candidates) {
5788
+ const accessibleName = el.getAttribute("aria-label") ?? el.textContent?.trim() ?? "";
5789
+ if (!name || accessibleName.includes(name)) return el;
5790
+ }
5791
+ }
5792
+ return null;
5793
+ }
5794
+ function HighlightOverlay({ target, onDismiss }) {
5795
+ const [rect, setRect] = React58.useState(null);
5796
+ React58.useEffect(() => {
5797
+ if (!target) {
5798
+ setRect(null);
5799
+ onDismiss?.();
5800
+ return;
5801
+ }
5802
+ const el = findTarget(target);
5803
+ setRect(el ? el.getBoundingClientRect() : null);
5804
+ }, [target, onDismiss]);
5805
+ if (!target || !rect) return null;
5806
+ return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5807
+ "div",
5808
+ {
5809
+ "data-help-widget-highlight": "",
5810
+ role: "presentation",
5811
+ "aria-hidden": "true",
5812
+ style: {
5813
+ position: "fixed",
5814
+ left: rect.left - 4,
5815
+ top: rect.top - 4,
5816
+ width: rect.width + 8,
5817
+ height: rect.height + 8,
5818
+ pointerEvents: "none",
5819
+ zIndex: 2147483e3
5820
+ },
5821
+ className: "rounded-md ring-2 ring-primary ring-offset-2"
5822
+ }
5823
+ );
5824
+ }
5825
+
5826
+ // src/components/help-widget/use-help-session.ts
5827
+ var React59 = __toESM(require("react"), 1);
5828
+ function defaultCreateSession(baseUrl) {
5829
+ return async (request) => {
5830
+ const res = await fetch(`${baseUrl}/support/ai/session`, {
5831
+ method: "POST",
5832
+ headers: { "Content-Type": "application/json" },
5833
+ body: JSON.stringify(request)
5834
+ });
5835
+ if (!res.ok) throw new Error(`support/ai/session failed: ${res.status}`);
5836
+ return await res.json();
5837
+ };
5838
+ }
5839
+ async function defaultConnectRoom(session) {
5840
+ const { Room } = await import("livekit-client");
5841
+ const room = new Room();
5842
+ await room.connect(session.url, session.token);
5843
+ return { disconnect: () => room.disconnect() };
5844
+ }
5845
+ function useHelpSession({
5846
+ appId,
5847
+ route,
5848
+ createSession,
5849
+ connectRoom = defaultConnectRoom,
5850
+ baseUrl = ""
5851
+ }) {
5852
+ const [status, setStatus] = React59.useState("idle");
5853
+ const [language, setLanguage] = React59.useState("en");
5854
+ const connectionRef = React59.useRef(null);
5855
+ const createSessionRef = React59.useRef(createSession ?? defaultCreateSession(baseUrl));
5856
+ createSessionRef.current = createSession ?? defaultCreateSession(baseUrl);
5857
+ const requestSession = React59.useCallback(() => setStatus("consent-pending"), []);
5858
+ const deny = React59.useCallback(() => setStatus("idle"), []);
5859
+ const allow = React59.useCallback(async () => {
5860
+ const session = await createSessionRef.current({ appId, language, route });
5861
+ connectionRef.current = await connectRoom(session);
5862
+ setStatus("active");
5863
+ }, [appId, language, route, connectRoom]);
5864
+ const stop = React59.useCallback(() => {
5865
+ connectionRef.current?.disconnect();
5866
+ connectionRef.current = null;
5867
+ setStatus("idle");
5868
+ }, []);
5869
+ React59.useEffect(() => () => connectionRef.current?.disconnect(), []);
5870
+ return { status, language, setLanguage, requestSession, allow, deny, stop };
5871
+ }
5872
+
5873
+ // src/components/help-widget/help-widget.tsx
5874
+ var import_jsx_runtime69 = require("react/jsx-runtime");
5875
+ var LANGUAGE_LABELS = {
5876
+ en: "English",
5877
+ hi: "Hindi",
5878
+ mr: "Marathi"
5879
+ };
5880
+ function HelpWidget({
5881
+ appId,
5882
+ route,
5883
+ defaultLanguage = "en",
5884
+ createSession,
5885
+ connectRoom,
5886
+ baseUrl,
5887
+ highlightTarget = null,
5888
+ className
5889
+ }) {
5890
+ const [open, setOpen] = React60.useState(false);
5891
+ const { status, language, setLanguage, requestSession, allow, deny, stop } = useHelpSession({
5892
+ appId,
5893
+ route,
5894
+ createSession,
5895
+ connectRoom,
5896
+ baseUrl
5897
+ });
5898
+ React60.useEffect(() => {
5899
+ setLanguage(defaultLanguage);
5900
+ }, []);
5901
+ return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: cn("relative", className), "data-help-widget": "", children: [
5902
+ status === "active" ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(HelpSessionBanner, { onRevoke: stop }) : null,
5903
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(HighlightOverlay, { target: status === "active" ? highlightTarget : null }),
5904
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5905
+ "button",
5906
+ {
5907
+ type: "button",
5908
+ "aria-haspopup": "dialog",
5909
+ "aria-expanded": open,
5910
+ onClick: () => {
5911
+ setOpen(true);
5912
+ if (status === "idle") requestSession();
5913
+ },
5914
+ className: "fixed bottom-6 end-6 z-[2147482999] rounded-full bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground shadow-lg hover:bg-primary/90 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
5915
+ children: "Help"
5916
+ }
5917
+ ),
5918
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5919
+ ConsentDialog,
5920
+ {
5921
+ open: open && status === "consent-pending",
5922
+ onAllow: () => {
5923
+ void allow();
5924
+ },
5925
+ onDeny: () => {
5926
+ deny();
5927
+ setOpen(false);
5928
+ }
5929
+ }
5930
+ ),
5931
+ open ? /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
5932
+ "div",
5933
+ {
5934
+ role: "dialog",
5935
+ "aria-label": "Help chat",
5936
+ "data-help-widget-panel": "",
5937
+ className: "fixed bottom-20 end-6 z-[2147482999] flex h-96 w-80 flex-col gap-3 rounded-lg border border-border bg-popover p-4 text-popover-foreground shadow-xl",
5938
+ children: [
5939
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
5940
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("label", { htmlFor: "help-widget-language", className: "text-xs font-medium text-muted-foreground", children: "Language" }),
5941
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5942
+ "select",
5943
+ {
5944
+ id: "help-widget-language",
5945
+ value: language,
5946
+ onChange: (e) => setLanguage(e.target.value),
5947
+ className: "rounded border border-border bg-background px-2 py-1 text-xs",
5948
+ children: Object.entries(LANGUAGE_LABELS).map(([value, label]) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("option", { value, children: label }, value))
5949
+ }
5950
+ )
5951
+ ] }),
5952
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("div", { "data-help-widget-chat": "", className: "flex-1 overflow-y-auto text-sm text-muted-foreground", children: status === "active" ? "Chat and voice are active." : "Waiting for consent." }),
5953
+ /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
5954
+ "button",
5955
+ {
5956
+ type: "button",
5957
+ onClick: () => setOpen(false),
5958
+ className: "self-end rounded-md px-3 py-1 text-sm font-medium text-muted-foreground hover:text-foreground",
5959
+ children: "Close"
5960
+ }
5961
+ )
5962
+ ]
5963
+ }
5964
+ ) : null
5965
+ ] });
5966
+ }
5967
+
5968
+ // src/lib/app-ids.ts
5969
+ var SUPPORT_APP_IDS = [
5970
+ "bill",
5971
+ "books",
5972
+ "contract",
5973
+ "crm",
5974
+ "hear",
5975
+ "hire",
5976
+ "interviewer",
5977
+ "itam",
5978
+ "itom",
5979
+ "itsm",
5980
+ "mobile",
5981
+ "notes",
5982
+ "pay",
5983
+ "people",
5984
+ "procure",
5985
+ "projects",
5986
+ "sign",
5987
+ "space",
5988
+ "spend",
5989
+ "transcribe",
5990
+ "workspace"
5991
+ ];
5992
+ function isSupportAppId(value) {
5993
+ return typeof value === "string" && SUPPORT_APP_IDS.includes(value);
5994
+ }
5995
+
5996
+ // src/lib/mask-snapshot.ts
5997
+ var MASK = "[masked]";
5998
+ var PATTERNS = [
5999
+ // PAN: AAAAA9999A
6000
+ /\b[A-Z]{5}[0-9]{4}[A-Z]\b/g,
6001
+ // Aadhaar: 12 digits, optionally grouped as 4-4-4 with spaces or hyphens
6002
+ /\b\d{4}[\s-]?\d{4}[\s-]?\d{4}\b/g,
6003
+ // IFSC: AAAA0999999
6004
+ /\b[A-Z]{4}0[A-Z0-9]{6}\b/g,
6005
+ // Bare bank account numbers: 9 to 18 digits not already matched as Aadhaar above
6006
+ /\b\d{9,18}\b/g
6007
+ ];
6008
+ function redactText(text) {
6009
+ return PATTERNS.reduce((acc, pattern) => acc.replace(pattern, MASK), text);
6010
+ }
6011
+ function maskControls(root) {
6012
+ const controls = root.querySelectorAll(
6013
+ "input, textarea, select"
6014
+ );
6015
+ controls.forEach((el) => {
6016
+ if ("value" in el) el.setAttribute("data-help-widget-masked-value", MASK);
6017
+ });
6018
+ }
6019
+ function maskSnapshot(root = document.body) {
6020
+ const clone = root.cloneNode(true);
6021
+ const container = clone instanceof Document ? clone.body : clone;
6022
+ maskControls(container);
6023
+ const controls = container.querySelectorAll(
6024
+ "input, textarea, select"
6025
+ );
6026
+ controls.forEach((el) => {
6027
+ const replacement = container.ownerDocument?.createTextNode(MASK) ?? document.createTextNode(MASK);
6028
+ el.replaceWith(replacement);
6029
+ });
6030
+ const text = container.textContent ?? "";
6031
+ return redactText(text);
6032
+ }
5544
6033
  // Annotate the CommonJS export names for ESM import in node:
5545
6034
  0 && (module.exports = {
5546
6035
  Accordion,
@@ -5564,6 +6053,7 @@ function useImpersonation(token) {
5564
6053
  AlertDialogTrigger,
5565
6054
  AlertTitle,
5566
6055
  AppHeader,
6056
+ AppLauncher,
5567
6057
  AspectRatio,
5568
6058
  Avatar,
5569
6059
  AvatarFallback,
@@ -5616,6 +6106,7 @@ function useImpersonation(token) {
5616
6106
  CommandList,
5617
6107
  CommandSeparator,
5618
6108
  CommandShortcut,
6109
+ ConsentDialog,
5619
6110
  ContextMenu,
5620
6111
  ContextMenuCheckboxItem,
5621
6112
  ContextMenuContent,
@@ -5686,6 +6177,9 @@ function useImpersonation(token) {
5686
6177
  H2,
5687
6178
  H3,
5688
6179
  H4,
6180
+ HelpSessionBanner,
6181
+ HelpWidget,
6182
+ HighlightOverlay,
5689
6183
  HoverCard,
5690
6184
  HoverCardContent,
5691
6185
  HoverCardTrigger,
@@ -5753,6 +6247,7 @@ function useImpersonation(token) {
5753
6247
  ResizableHandle,
5754
6248
  ResizablePanel,
5755
6249
  ResizablePanelGroup,
6250
+ SUPPORT_APP_IDS,
5756
6251
  ScrollArea,
5757
6252
  ScrollBar,
5758
6253
  Select,
@@ -5832,6 +6327,8 @@ function useImpersonation(token) {
5832
6327
  formatRemaining,
5833
6328
  inputVariants,
5834
6329
  isGuarded,
6330
+ isSupportAppId,
6331
+ maskSnapshot,
5835
6332
  modeOfOps,
5836
6333
  navigationMenuTriggerStyle,
5837
6334
  readImpersonation,
@@ -5840,6 +6337,7 @@ function useImpersonation(token) {
5840
6337
  toast,
5841
6338
  toggleVariants,
5842
6339
  useFormField,
6340
+ useHelpSession,
5843
6341
  useImpersonation,
5844
6342
  useSidebar,
5845
6343
  useTheme