@mieweb/ui 0.9.0-dev.0 → 0.9.0-dev.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.
Files changed (31) hide show
  1. package/dist/{chunk-WIAQQNFU.cjs → chunk-2A2FLQJC.cjs} +1138 -12
  2. package/dist/chunk-2A2FLQJC.cjs.map +1 -0
  3. package/dist/{chunk-5BVFVXHN.cjs → chunk-5VXRKOPR.cjs} +16 -525
  4. package/dist/chunk-5VXRKOPR.cjs.map +1 -0
  5. package/dist/{chunk-O6GJ4IYS.js → chunk-IF3X2WZP.js} +16 -521
  6. package/dist/chunk-IF3X2WZP.js.map +1 -0
  7. package/dist/{chunk-22CYDCXA.js → chunk-KATEJG2F.js} +1137 -13
  8. package/dist/chunk-KATEJG2F.js.map +1 -0
  9. package/dist/{chunk-FQBTGS3E.cjs → chunk-O425FKDI.cjs} +563 -55
  10. package/dist/chunk-O425FKDI.cjs.map +1 -0
  11. package/dist/{chunk-MXQ7J4BB.js → chunk-RPG2ZP2T.js} +557 -53
  12. package/dist/chunk-RPG2ZP2T.js.map +1 -0
  13. package/dist/components/SuperChat/index.cjs +36 -17
  14. package/dist/components/SuperChat/index.cjs.map +1 -1
  15. package/dist/components/SuperChat/index.d.cts +16 -3
  16. package/dist/components/SuperChat/index.d.ts +16 -3
  17. package/dist/components/SuperChat/index.js +31 -12
  18. package/dist/components/SuperChat/index.js.map +1 -1
  19. package/dist/components/SuperChat/plugins/index.cjs +3 -3
  20. package/dist/components/SuperChat/plugins/index.js +2 -2
  21. package/dist/index.cjs +820 -1930
  22. package/dist/index.cjs.map +1 -1
  23. package/dist/index.js +663 -1780
  24. package/dist/index.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/chunk-22CYDCXA.js.map +0 -1
  27. package/dist/chunk-5BVFVXHN.cjs.map +0 -1
  28. package/dist/chunk-FQBTGS3E.cjs.map +0 -1
  29. package/dist/chunk-MXQ7J4BB.js.map +0 -1
  30. package/dist/chunk-O6GJ4IYS.js.map +0 -1
  31. package/dist/chunk-WIAQQNFU.cjs.map +0 -1
package/dist/index.js CHANGED
@@ -25,12 +25,11 @@ export { SourceTip } from './chunk-PHK4XBO5.js';
25
25
  export { Sparkline } from './chunk-CG4ZKJLE.js';
26
26
  import { Spinner, SpinnerWithLabel } from './chunk-UA7E7PDS.js';
27
27
  export { FullPageSpinner, Spinner, SpinnerWithLabel, spinnerVariants } from './chunk-UA7E7PDS.js';
28
- import { SparklesIcon, RefreshIcon, CloseIcon, AIMessageDisplay } from './chunk-22CYDCXA.js';
29
- export { AILogoIcon, AIMessageDisplay, AITypingIndicator, ChatBubble, ChevronIcon, CloseIcon, CollapsiblePill, MCPToolCallDisplay, MessageAvatar, RefreshIcon, ResourceLink, SendIcon, SparklesIcon, SpinnerIcon, ToolStatusIcon, getToolIcon } from './chunk-22CYDCXA.js';
30
- import { EmptyState } from './chunk-MXQ7J4BB.js';
31
- export { AttachmentPreview, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, useMessageScroll, useMessages, useReadReceipts, useTypingIndicator } from './chunk-MXQ7J4BB.js';
32
- import { useMentionAutocomplete, validateFile, getFileType, generateAttachmentId, AttachmentPreviewItem, MentionMenu, DragDropZone, MessageComposer } from './chunk-O6GJ4IYS.js';
33
- export { AttachmentPicker, AttachmentPreviewItem, CameraButton, CharacterCounter, DragDropZone, MessageComposer, SendButton, generateAttachmentId, getFileType, sendButtonVariants, validateFile } from './chunk-O6GJ4IYS.js';
28
+ import { SparklesIcon, RefreshIcon, CloseIcon, AIMessageDisplay, ComposerModelSelector } from './chunk-KATEJG2F.js';
29
+ export { AILogoIcon, AIMessageDisplay, AITypingIndicator, ChatBubble, ChatComposer, ChevronIcon, CloseIcon, CollapsiblePill, ComposerModelSelector, MCPToolCallDisplay, MessageAvatar, RefreshIcon, ResourceLink, SendIcon, SparklesIcon, SpinnerIcon, ToolStatusIcon, getToolIcon } from './chunk-KATEJG2F.js';
30
+ import { MessageComposer, EmptyState } from './chunk-RPG2ZP2T.js';
31
+ export { AttachmentPreview, CharacterCounter, ConversationHeader, ConversationListItem, ConversationListSkeleton, DateSeparator, EmptyState, LightboxModal, LoadMoreButton, MessageBubble, MessageComposer, MessageList, MessageStatusIcon, MessageThread, MessagingSplitView, ReadReceiptIndicator, SendButton, SkeletonMessage, TypingIndicator, bubbleVariants, formatDateLabel, formatFileSize, formatLastSeen, getConversationSubtitle, getConversationTitle, groupMessagesByDate, headerVariants, isSameSenderGroup, sendButtonVariants, useMessageScroll, useMessages, useReadReceipts, useTypingIndicator } from './chunk-RPG2ZP2T.js';
32
+ export { AttachmentPicker, AttachmentPreviewItem, CameraButton, DragDropZone, generateAttachmentId, getFileType, validateFile } from './chunk-IF3X2WZP.js';
34
33
  import { RecordButton } from './chunk-VNWJTCBQ.js';
35
34
  export { RecordButton, formatDuration, recordButtonVariants } from './chunk-VNWJTCBQ.js';
36
35
  export { RichTextEditor, convertAngleBracketsToMustache, processDictation } from './chunk-5H7SAEQO.js';
@@ -115,7 +114,7 @@ export { Modal, ModalBody, ModalClose, ModalFooter, ModalHeader, ModalTitle, mod
115
114
  import './chunk-6NZXWKUE.js';
116
115
  import { Input, inputVariants } from './chunk-3IMM2PM4.js';
117
116
  export { Input, RequiredMark, floatingGroupLabelVariants, floatingGroupVariants, floatingLabelVariants, inputVariants } from './chunk-3IMM2PM4.js';
118
- import { Plus, GripVertical, RefreshCw, Pencil, AlertCircle, ArrowLeft, Users, FilePlus, CheckCircle, ChevronDown, AlertTriangle, Paperclip, Mic, Square, Loader2, ArrowUp, Check, Bot, ChevronUp, Clock, FileText, ClipboardList, Stethoscope, Mail, Phone, ClipboardCheck, Eye, Info, Link, History, StickyNote, ExternalLink, MoreVertical, Trash2, Send, Scan, TestTube2, Pill, Share, User, Download, ChevronRight as ChevronRight$1, Calendar, Printer, ClipboardPlus, FileCheck, Wheat, Bell, FileHeart, HeartPulse, HelpCircle, MoreHorizontal, Upload as Upload$1, Camera, X as X$1, ScanLine, Image } from './chunk-BKSPDTX4.js';
117
+ import { Plus, GripVertical, RefreshCw, Pencil, AlertCircle, ArrowLeft, Users, FilePlus, CheckCircle, ChevronDown, Clock, FileText, ClipboardList, Stethoscope, Mail, Phone, ClipboardCheck, Eye, Info, Link, ChevronUp, History, StickyNote, ExternalLink, MoreVertical, Trash2, Send, Scan, TestTube2, Pill, Share, User, Download, ChevronRight, Calendar, Printer, ClipboardPlus, FileCheck, Wheat, Bell, FileHeart, HeartPulse, Paperclip, HelpCircle, MoreHorizontal, AlertTriangle, Upload as Upload$1, Camera, Check as Check$1, X as X$1, ScanLine, Image } from './chunk-BKSPDTX4.js';
119
118
  export { Accessibility as AccessibilityIcon, Activity as ActivityIcon, AlertCircle as AlertCircleIcon, AlertTriangle as AlertTriangleIcon, Wheat as AllergyIcon, WheatOff as AllergyOffIcon, Ambulance as AmbulanceIcon, ArrowLeft as ArrowLeftIcon, ArrowRight as ArrowRightIcon, ArrowUpDown as ArrowUpDownIcon, ArrowUp as ArrowUpIcon, AtSign as AtSignIcon, Baby as BabyIcon, BadgeAlert as BadgeAlertIcon, BadgeCheck as BadgeCheckIcon, BadgeMinus as BadgeMinusIcon, BadgePlus as BadgePlusIcon, BadgeX as BadgeXIcon, Ban as BanIcon, Bandage as BandageIcon, BedDouble as BedDoubleIcon, Bed as BedIcon, BedSingle as BedSingleIcon, Bell as BellIcon, BellOff as BellOffIcon, Biohazard as BiohazardIcon, Bone as BoneIcon, BookOpenCheck as BookOpenCheckIcon, BookOpen as BookOpenIcon, Bookmark as BookmarkIcon, Bot as BotIcon, Brain as BrainIcon, Briefcase as BriefcaseIcon, BriefcaseMedical as BriefcaseMedicalIcon, Building as BuildingIcon, CalendarCheck as CalendarCheckIcon, Calendar as CalendarIcon, Camera as CameraIcon, Cannabis as CannabisIcon, BarChart3 as ChartIcon, CheckCircle as CheckCircleIcon, Check as CheckIcon, ChevronDown as ChevronDownIcon, ChevronLeft as ChevronLeftIcon, ChevronRight as ChevronRightIcon, ChevronUp as ChevronUpIcon, Cigarette as CigaretteIcon, CigaretteOff as CigaretteOffIcon, CircleDotDashed as CircleDotDashedIcon, CircleDot as CircleDotIcon, CircleUser as CircleUserIcon, ClipboardCheck as ClipboardCheckIcon, Clipboard as ClipboardIcon, ClipboardList as ClipboardListIcon, ClipboardPlus as ClipboardPlusIcon, Clock as ClockIcon, Cog as CogIcon, Columns as ColumnsIcon, Copy as CopyIcon, CreditCard as CreditCardIcon, Cross as CrossIcon, Dna as DnaIcon, DollarSign as DollarSignIcon, Download as DownloadIcon, Droplet as DropletIcon, Droplets as DropletsIcon, Ear as EarIcon, ExternalLink as ExternalLinkIcon, Eye as EyeIcon, EyeOff as EyeOffIcon, FileCheck2 as FileCheck2Icon, FileCheck as FileCheckIcon, FileHeart as FileHeartIcon, File as FileIcon, FilePlus2 as FilePlus2Icon, FilePlus as FilePlusIcon, FileText as FileTextIcon, Filter as FilterIcon, Fingerprint as FingerprintIcon, Flag as FlagIcon, FlaskConical as FlaskIcon, FlaskRound as FlaskRoundIcon, Folder as FolderIcon, FolderOpen as FolderOpenIcon, Footprints as FootprintsIcon, Glasses as GlassesIcon, Globe as GlobeIcon, LayoutGrid as GridIcon, GripVertical as GripVerticalIcon, Hand as HandIcon, HandMetal as HandMetalIcon, Hash as HashIcon, Heart as HeartIcon, HeartOff as HeartOffIcon, HeartPulse as HeartPulseIcon, HelpCircle as HelpCircleIcon, History as HistoryIcon, Home as HomeIcon, Hospital as HospitalIcon, Image as ImageIcon, Info as InfoIcon, Key as KeyIcon, Link as LinkIcon, List as ListIcon, Loader2 as LoaderIcon, Lock as LockIcon, LogIn as LogInIcon, LogOut as LogOutIcon, Mail as MailIcon, MapPin as MapPinIcon, Maximize as MaximizeIcon, Menu as MenuIcon, MessageSquare as MessageIcon, Mic as MicIcon, Microscope as MicroscopeIcon, Minimize as MinimizeIcon, Minus as MinusIcon, Monitor as MonitorIcon, Moon as MoonIcon, MoreHorizontal as MoreHorizontalIcon, MoreVertical as MoreVerticalIcon, NotebookPen as NotebookPenIcon, Palette as PaletteIcon, Paperclip as PaperclipIcon, CircleUserRound as PatientIcon, Pencil as PencilIcon, UserRound as PersonIcon, Phone as PhoneIcon, PieChart as PieChartIcon, Pill as PillIcon, Plus as PlusIcon, Printer as PrinterIcon, Radiation as RadiationIcon, Ruler as RulerIcon, Save as SaveIcon, Scale as ScaleIcon, Scaling as ScalingIcon, ScanEye as ScanEyeIcon, Scan as ScanIcon, ScanLine as ScanLineIcon, Search as SearchIcon, Settings as SettingsIcon, Share as ShareIcon, ShieldCheck as ShieldCheckIcon, Shield as ShieldIcon, ShieldPlus as ShieldPlusIcon, Sliders as SlidersIcon, Sparkle as SparkleIcon, Star as StarIcon, Stethoscope as StethoscopeIcon, StickyNote as StickyNoteIcon, Square as StopIcon, Sun as SunIcon, Syringe as SyringeIcon, Table as TableIcon, Tablets as TabletsIcon, Tag as TagIcon, TestTube2 as TestTubeIcon, TestTubes as TestTubesIcon, Thermometer as ThermometerIcon, ThermometerSun as ThermometerSunIcon, ThumbsDown as ThumbsDownIcon, ThumbsUp as ThumbsUpIcon, Timer as TimerIcon, Trash2 as TrashIcon, TrendingDown as TrendingDownIcon, TrendingUp as TrendingUpIcon, Truck as TruckIcon, Unlock as UnlockIcon, Upload as UploadIcon, UserCheck as UserCheckIcon, User as UserIcon, UserMinus as UserMinusIcon, UserPlus as UserPlusIcon, UserRoundCheck as UserRoundCheckIcon, UserRoundMinus as UserRoundMinusIcon, UserRoundPlus as UserRoundPlusIcon, UserRoundX as UserRoundXIcon, Users as UsersIcon, Weight as WeightIcon, Wrench as WrenchIcon, XCircle as XCircleIcon, X2 as XIcon, Zap as ZapIcon } from './chunk-BKSPDTX4.js';
120
119
  import { Badge } from './chunk-BMSG4NBH.js';
121
120
  export { Badge, badgeVariants } from './chunk-BMSG4NBH.js';
@@ -147,13 +146,13 @@ export { useClickOutside } from './chunk-62ZOA6PX.js';
147
146
  import { useAnchoredPosition } from './chunk-WSNMQQ4P.js';
148
147
  export { useAnchoredPosition } from './chunk-WSNMQQ4P.js';
149
148
  export { isDarkMode, useIsDarkMode } from './chunk-RUGHNFQG.js';
150
- import * as React13 from 'react';
151
- import React13__default, { createContext, useState, useEffect, useCallback, useMemo, useContext, useRef } from 'react';
149
+ import * as React12 from 'react';
150
+ import React12__default, { createContext, useState, useEffect, useCallback, useMemo, useContext, useRef } from 'react';
152
151
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
153
152
  import { cva } from 'class-variance-authority';
154
153
  import * as ReactDOM from 'react-dom';
155
154
  import { createPortal } from 'react-dom';
156
- import { FileUp, X, AlertCircle as AlertCircle$1, ChevronUp as ChevronUp$1, Check as Check$1, ChevronRight, ChevronLeft, Calendar as Calendar$1, ChevronDown as ChevronDown$1, Maximize2, Minimize2, FolderUp, Upload, Edit2, Phone as Phone$1, Mail as Mail$1, Clock as Clock$1, MapPin, Shield, Building2, SlidersHorizontal, Trash2 as Trash2$1, Pencil as Pencil$1, Plus as Plus$1, Link as Link$1, AlertTriangle as AlertTriangle$1, RefreshCw as RefreshCw$1 } from 'lucide-react';
155
+ import { FileUp, X, AlertCircle as AlertCircle$1, Calendar as Calendar$1, ChevronLeft, ChevronRight as ChevronRight$1, ChevronDown as ChevronDown$1, Maximize2, Minimize2, FolderUp, Upload, Edit2, Check, ChevronUp as ChevronUp$1, Phone as Phone$1, Mail as Mail$1, Clock as Clock$1, MapPin, Shield, Building2, SlidersHorizontal, Trash2 as Trash2$1, Pencil as Pencil$1, Plus as Plus$1, Link as Link$1, AlertTriangle as AlertTriangle$1, RefreshCw as RefreshCw$1 } from 'lucide-react';
157
156
 
158
157
  var SEX_OPTIONS = [
159
158
  { value: "F", label: "Female" },
@@ -622,8 +621,8 @@ function AdditionalFields({
622
621
  className,
623
622
  collapsible = true
624
623
  }) {
625
- const [isExpanded, setIsExpanded] = React13.useState(defaultExpanded);
626
- const contentId = React13.useId();
624
+ const [isExpanded, setIsExpanded] = React12.useState(defaultExpanded);
625
+ const contentId = React12.useId();
627
626
  const handleNameChange = (id, name) => {
628
627
  const updated = value.map(
629
628
  (entry) => entry.id === id ? { ...entry, name } : entry
@@ -1061,10 +1060,10 @@ function AddressForm({
1061
1060
  className,
1062
1061
  googlePlaces
1063
1062
  }) {
1064
- const generatedId = React13.useId();
1063
+ const generatedId = React12.useId();
1065
1064
  const idPrefix = id || generatedId;
1066
- const autocompleteRef = React13.useRef(null);
1067
- const inputRef = React13.useRef(null);
1065
+ const autocompleteRef = React12.useRef(null);
1066
+ const inputRef = React12.useRef(null);
1068
1067
  const mergedLabels = { ...DEFAULT_LABELS, ...labels };
1069
1068
  const mergedPlaceholders = { ...DEFAULT_PLACEHOLDERS, ...placeholders };
1070
1069
  const handleChange = (field, fieldValue) => {
@@ -1073,7 +1072,7 @@ function AddressForm({
1073
1072
  [field]: fieldValue
1074
1073
  });
1075
1074
  };
1076
- React13.useEffect(() => {
1075
+ React12.useEffect(() => {
1077
1076
  if (!googlePlaces?.enabled || !inputRef.current) return;
1078
1077
  const googleMaps = globalThis.window?.google;
1079
1078
  if (!googleMaps?.maps?.places?.Autocomplete) {
@@ -1492,13 +1491,13 @@ function AIChat({
1492
1491
  renderTextContent,
1493
1492
  renderMessageFooter
1494
1493
  }) {
1495
- const messagesContainerRef = React13.useRef(null);
1496
- const messages = React13.useMemo(
1494
+ const messagesContainerRef = React12.useRef(null);
1495
+ const messages = React12.useMemo(
1497
1496
  () => session?.messages || messagesProp || [],
1498
1497
  [session?.messages, messagesProp]
1499
1498
  );
1500
1499
  const isGenerating = session?.isGenerating || isGeneratingProp || false;
1501
- React13.useEffect(() => {
1500
+ React12.useEffect(() => {
1502
1501
  const container = messagesContainerRef.current;
1503
1502
  if (container) container.scrollTop = container.scrollHeight;
1504
1503
  }, [messages]);
@@ -1976,529 +1975,6 @@ function ToastContainer({
1976
1975
  }
1977
1976
  );
1978
1977
  }
1979
- var MENU_OFFSET_PX = 6;
1980
- var MENU_MAX_HEIGHT_PX = 320;
1981
- function optionKey(option) {
1982
- return `${option.provider}\0${option.model}`;
1983
- }
1984
- function renderedOptionKey(option, index) {
1985
- return `${option.id ?? optionKey(option)}\0${index}`;
1986
- }
1987
- function groupByProvider(models) {
1988
- const groups = /* @__PURE__ */ new Map();
1989
- for (const model of models) {
1990
- const group = groups.get(model.provider);
1991
- if (group) {
1992
- group.push(model);
1993
- } else {
1994
- groups.set(model.provider, [model]);
1995
- }
1996
- }
1997
- return Array.from(groups, ([provider, options]) => ({ provider, options }));
1998
- }
1999
- function getProviderLabel(models, provider) {
2000
- return models.find((model) => model.provider === provider && model.providerLabel)?.providerLabel ?? provider;
2001
- }
2002
- function ComposerModelSelector({
2003
- models,
2004
- value,
2005
- providerFilter,
2006
- onProviderFilterChange,
2007
- onChange,
2008
- disabled = false,
2009
- variant = "default",
2010
- className,
2011
- boundaryRef,
2012
- placeholder = "Model",
2013
- anyLabel = "Any",
2014
- emptyLabel = "No models",
2015
- ariaLabel = "Model",
2016
- effortOptions,
2017
- effort = null,
2018
- defaultEffort,
2019
- onEffortChange,
2020
- effortLabel = "Effort",
2021
- effortHint,
2022
- defaultBadgeLabel = "Default",
2023
- backLabel = "Back"
2024
- }) {
2025
- const [open, setOpen] = React13.useState(false);
2026
- const [view, setView] = React13.useState("models");
2027
- const [effortHighlight, setEffortHighlight] = React13.useState(0);
2028
- const [internalProviderFilter, setInternalProviderFilter] = React13.useState(null);
2029
- const [highlightedIndex, setHighlightedIndex] = React13.useState(0);
2030
- const listRef = React13.useRef(null);
2031
- const effortListRef = React13.useRef(null);
2032
- const menuId = React13.useId();
2033
- const {
2034
- anchorRef: triggerRef,
2035
- floatingRef: menuRef,
2036
- style: menuStyle
2037
- } = useAnchoredPosition({
2038
- open,
2039
- placement: "top-start",
2040
- offset: MENU_OFFSET_PX,
2041
- matchMinWidth: true,
2042
- maxHeight: MENU_MAX_HEIGHT_PX,
2043
- allowFlip: false,
2044
- boundaryRef
2045
- });
2046
- const activeProviderFilter = providerFilter === void 0 ? internalProviderFilter : providerFilter;
2047
- const selectedKey = value ? optionKey(value) : null;
2048
- const selectedOption = models.find(
2049
- (model) => optionKey(model) === selectedKey
2050
- );
2051
- const providers = React13.useMemo(
2052
- () => Array.from(new Set(models.map((model) => model.provider))),
2053
- [models]
2054
- );
2055
- const providerLabels = React13.useMemo(
2056
- () => new Map(
2057
- providers.map((provider) => [
2058
- provider,
2059
- getProviderLabel(models, provider)
2060
- ])
2061
- ),
2062
- [models, providers]
2063
- );
2064
- const filteredModels = React13.useMemo(
2065
- () => activeProviderFilter === null ? models : models.filter((model) => model.provider === activeProviderFilter),
2066
- [activeProviderFilter, models]
2067
- );
2068
- const groupedModels = React13.useMemo(
2069
- () => groupByProvider(filteredModels),
2070
- [filteredModels]
2071
- );
2072
- const groupedRenderedModels = React13.useMemo(() => {
2073
- let index = 0;
2074
- return groupedModels.map((group) => ({
2075
- provider: group.provider,
2076
- options: group.options.map((option) => {
2077
- const rendered = {
2078
- option,
2079
- index,
2080
- key: renderedOptionKey(option, index)
2081
- };
2082
- index += 1;
2083
- return rendered;
2084
- })
2085
- }));
2086
- }, [groupedModels]);
2087
- const renderedModels = React13.useMemo(
2088
- () => groupedRenderedModels.flatMap((group) => group.options),
2089
- [groupedRenderedModels]
2090
- );
2091
- const getOptionId = React13.useCallback(
2092
- (index) => `${menuId}-option-${index}`,
2093
- [menuId]
2094
- );
2095
- const getEffortOptionId = React13.useCallback(
2096
- (index) => `${menuId}-effort-option-${index}`,
2097
- [menuId]
2098
- );
2099
- const activeOptionId = open && renderedModels[highlightedIndex] ? getOptionId(highlightedIndex) : void 0;
2100
- const selectedRenderedIndex = React13.useMemo(
2101
- () => selectedKey ? renderedModels.findIndex(
2102
- (renderedModel) => optionKey(renderedModel.option) === selectedKey
2103
- ) : -1,
2104
- [renderedModels, selectedKey]
2105
- );
2106
- const setProvider = React13.useCallback(
2107
- (provider) => {
2108
- if (providerFilter === void 0) {
2109
- setInternalProviderFilter(provider);
2110
- }
2111
- onProviderFilterChange?.(provider);
2112
- },
2113
- [onProviderFilterChange, providerFilter]
2114
- );
2115
- const close = React13.useCallback(
2116
- (restoreFocus = true) => {
2117
- setOpen(false);
2118
- if (restoreFocus) {
2119
- triggerRef.current?.focus({ preventScroll: true });
2120
- }
2121
- },
2122
- [triggerRef]
2123
- );
2124
- const selectModel = React13.useCallback(
2125
- (model) => {
2126
- onChange({ provider: model.provider, model: model.model });
2127
- close();
2128
- },
2129
- [close, onChange]
2130
- );
2131
- const efforts = React13.useMemo(() => effortOptions ?? [], [effortOptions]);
2132
- const activeEffortOptionId = open && efforts[effortHighlight] ? getEffortOptionId(effortHighlight) : void 0;
2133
- const selectedEffortOption = efforts.find(
2134
- (option) => option.value === effort
2135
- );
2136
- const selectEffort = React13.useCallback(
2137
- (value2) => {
2138
- onEffortChange?.(value2);
2139
- close();
2140
- },
2141
- [close, onEffortChange]
2142
- );
2143
- const handleEffortKeyDown = (event) => {
2144
- if (efforts.length === 0) return;
2145
- if (event.key === "ArrowDown") {
2146
- event.preventDefault();
2147
- setEffortHighlight((current) => (current + 1) % efforts.length);
2148
- }
2149
- if (event.key === "ArrowUp") {
2150
- event.preventDefault();
2151
- setEffortHighlight(
2152
- (current) => (current - 1 + efforts.length) % efforts.length
2153
- );
2154
- }
2155
- if (event.key === "Home") {
2156
- event.preventDefault();
2157
- setEffortHighlight(0);
2158
- }
2159
- if (event.key === "End") {
2160
- event.preventDefault();
2161
- setEffortHighlight(efforts.length - 1);
2162
- }
2163
- if (event.key === "ArrowLeft" || event.key === "Backspace") {
2164
- event.preventDefault();
2165
- setView("models");
2166
- }
2167
- if (event.key === "Enter" || event.key === " ") {
2168
- event.preventDefault();
2169
- const highlighted = efforts[effortHighlight];
2170
- if (highlighted) selectEffort(highlighted.value);
2171
- }
2172
- };
2173
- const outsideRefs = React13.useMemo(
2174
- () => [triggerRef, menuRef],
2175
- [triggerRef, menuRef]
2176
- );
2177
- useClickOutside(outsideRefs, () => close(false), open);
2178
- useEscapeKey(close, open);
2179
- React13.useEffect(() => {
2180
- if (!open) return;
2181
- setHighlightedIndex(selectedRenderedIndex >= 0 ? selectedRenderedIndex : 0);
2182
- }, [activeProviderFilter, open, selectedRenderedIndex]);
2183
- React13.useEffect(() => {
2184
- if (!open) return;
2185
- setView("models");
2186
- }, [open]);
2187
- React13.useEffect(() => {
2188
- if (!open) return;
2189
- const current = efforts.findIndex((option) => option.value === effort);
2190
- setEffortHighlight(current >= 0 ? current : 0);
2191
- }, [effort, efforts, open]);
2192
- React13.useEffect(() => {
2193
- if (!open) return;
2194
- setHighlightedIndex(
2195
- (current) => Math.min(current, Math.max(renderedModels.length - 1, 0))
2196
- );
2197
- }, [open, renderedModels.length]);
2198
- React13.useEffect(() => {
2199
- if (!open) return;
2200
- requestAnimationFrame(() => {
2201
- const target = view === "effort" ? effortListRef.current : listRef.current;
2202
- target?.focus({ preventScroll: true });
2203
- });
2204
- }, [open, view]);
2205
- const handleTriggerKeyDown = (event) => {
2206
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
2207
- event.preventDefault();
2208
- setOpen(true);
2209
- }
2210
- };
2211
- const handleMenuKeyDown = (event) => {
2212
- if (renderedModels.length === 0) return;
2213
- if (event.key === "ArrowDown") {
2214
- event.preventDefault();
2215
- setHighlightedIndex((current) => (current + 1) % renderedModels.length);
2216
- }
2217
- if (event.key === "ArrowUp") {
2218
- event.preventDefault();
2219
- setHighlightedIndex(
2220
- (current) => (current - 1 + renderedModels.length) % renderedModels.length
2221
- );
2222
- }
2223
- if (event.key === "Home") {
2224
- event.preventDefault();
2225
- setHighlightedIndex(0);
2226
- }
2227
- if (event.key === "End") {
2228
- event.preventDefault();
2229
- setHighlightedIndex(renderedModels.length - 1);
2230
- }
2231
- if (event.key === "Enter" || event.key === " ") {
2232
- event.preventDefault();
2233
- const highlightedModel = renderedModels[highlightedIndex]?.option;
2234
- if (highlightedModel) {
2235
- selectModel(highlightedModel);
2236
- }
2237
- }
2238
- };
2239
- return /* @__PURE__ */ jsxs(Fragment, { children: [
2240
- /* @__PURE__ */ jsxs(
2241
- "button",
2242
- {
2243
- ref: triggerRef,
2244
- type: "button",
2245
- disabled,
2246
- "aria-haspopup": "listbox",
2247
- "aria-expanded": open,
2248
- "aria-controls": open ? menuId : void 0,
2249
- onClick: () => setOpen((current) => !current),
2250
- onKeyDown: handleTriggerKeyDown,
2251
- "data-slot": "composer-model-selector-trigger",
2252
- className: cn(
2253
- variant === "ghost" ? [
2254
- "inline-flex max-w-full min-w-0 items-center gap-1 rounded-md px-2 py-1 text-xs",
2255
- "text-neutral-600 dark:text-neutral-400",
2256
- "transition-colors duration-150",
2257
- "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-700 dark:hover:text-white",
2258
- "focus-visible:ring-primary-500 focus-visible:ring-2 focus-visible:outline-none",
2259
- "disabled:pointer-events-none disabled:opacity-40"
2260
- ] : [
2261
- "inline-flex h-8 max-w-full items-center gap-1.5 rounded-full border px-2.5 text-sm font-medium",
2262
- "border-border bg-background text-foreground shadow-sm",
2263
- "hover:bg-muted/50",
2264
- "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none",
2265
- "disabled:cursor-not-allowed disabled:opacity-50"
2266
- ],
2267
- className
2268
- ),
2269
- children: [
2270
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: selectedOption?.label ?? selectedOption?.model ?? placeholder }),
2271
- selectedEffortOption && /* @__PURE__ */ jsx(
2272
- "span",
2273
- {
2274
- "data-slot": "composer-model-selector-trigger-effort",
2275
- className: "text-muted-foreground min-w-0 truncate font-normal",
2276
- children: selectedEffortOption.label
2277
- }
2278
- ),
2279
- /* @__PURE__ */ jsx(
2280
- ChevronUp$1,
2281
- {
2282
- "aria-hidden": "true",
2283
- className: cn(
2284
- "shrink-0",
2285
- variant === "ghost" ? "h-3 w-3" : "h-3.5 w-3.5"
2286
- )
2287
- }
2288
- )
2289
- ]
2290
- }
2291
- ),
2292
- open && createPortal(
2293
- /* @__PURE__ */ jsxs(
2294
- "div",
2295
- {
2296
- ref: menuRef,
2297
- style: menuStyle,
2298
- "data-slot": "composer-model-selector-menu",
2299
- className: cn(
2300
- "border-border bg-card text-card-foreground flex w-80 max-w-full flex-col rounded-lg border shadow-lg",
2301
- "animate-in fade-in overflow-hidden duration-100"
2302
- ),
2303
- children: [
2304
- view === "models" && /* @__PURE__ */ jsxs(Fragment, { children: [
2305
- /* @__PURE__ */ jsx(
2306
- "div",
2307
- {
2308
- "data-slot": "composer-model-selector-provider-filter",
2309
- className: "border-border flex min-h-9 items-center gap-1 overflow-x-auto overflow-y-hidden border-b p-2",
2310
- children: [null, ...providers].map((provider) => {
2311
- const selected = activeProviderFilter === provider;
2312
- return /* @__PURE__ */ jsx(
2313
- "button",
2314
- {
2315
- type: "button",
2316
- "aria-pressed": selected,
2317
- onMouseDown: (event) => event.preventDefault(),
2318
- onClick: () => setProvider(provider),
2319
- className: cn(
2320
- "inline-flex h-6 shrink-0 items-center justify-center rounded-full px-2.5 text-xs font-medium whitespace-nowrap transition-colors",
2321
- "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none",
2322
- selected ? "bg-primary text-primary-foreground" : "text-muted-foreground hover:bg-muted hover:text-foreground"
2323
- ),
2324
- children: provider === null ? anyLabel : providerLabels.get(provider) ?? provider
2325
- },
2326
- provider ?? "all-providers"
2327
- );
2328
- })
2329
- }
2330
- ),
2331
- /* @__PURE__ */ jsx(
2332
- "div",
2333
- {
2334
- ref: listRef,
2335
- id: menuId,
2336
- role: "listbox",
2337
- "aria-label": ariaLabel,
2338
- "aria-activedescendant": activeOptionId,
2339
- tabIndex: -1,
2340
- onKeyDown: handleMenuKeyDown,
2341
- className: "min-h-0 flex-1 overflow-y-auto p-1",
2342
- children: groupedModels.length === 0 ? /* @__PURE__ */ jsx("div", { className: "text-muted-foreground px-3 py-4 text-center text-sm", children: emptyLabel }) : groupedRenderedModels.map((group) => /* @__PURE__ */ jsxs(
2343
- "div",
2344
- {
2345
- role: "group",
2346
- "aria-label": providerLabels.get(group.provider) ?? group.provider,
2347
- children: [
2348
- /* @__PURE__ */ jsx("div", { className: "text-muted-foreground px-3 py-1.5 text-xs font-semibold uppercase", children: providerLabels.get(group.provider) ?? group.provider }),
2349
- group.options.map((renderedModel) => {
2350
- const { index, key, option: model } = renderedModel;
2351
- const selected = optionKey(model) === selectedKey;
2352
- const highlighted = index === highlightedIndex;
2353
- return /* @__PURE__ */ jsxs(
2354
- "button",
2355
- {
2356
- id: getOptionId(index),
2357
- type: "button",
2358
- role: "option",
2359
- "aria-selected": selected,
2360
- onMouseDown: (event) => event.preventDefault(),
2361
- onClick: () => selectModel(model),
2362
- onMouseEnter: () => setHighlightedIndex(index),
2363
- className: cn(
2364
- "flex w-full items-center gap-2 rounded-md px-3 py-2 text-start text-sm",
2365
- "focus-visible:ring-ring transition-colors focus-visible:ring-2 focus-visible:outline-none",
2366
- highlighted && "bg-muted",
2367
- selected && "bg-primary/10 text-primary"
2368
- ),
2369
- children: [
2370
- /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: model.label ?? model.model }),
2371
- selected && /* @__PURE__ */ jsx(
2372
- Check$1,
2373
- {
2374
- "aria-hidden": "true",
2375
- className: "text-primary h-4 w-4 shrink-0"
2376
- }
2377
- )
2378
- ]
2379
- },
2380
- key
2381
- );
2382
- })
2383
- ]
2384
- },
2385
- group.provider
2386
- ))
2387
- }
2388
- ),
2389
- efforts.length > 0 && /* @__PURE__ */ jsx("div", { className: "border-border border-t p-1", children: /* @__PURE__ */ jsxs(
2390
- "button",
2391
- {
2392
- type: "button",
2393
- "data-slot": "composer-model-selector-effort-row",
2394
- "aria-haspopup": "listbox",
2395
- onMouseDown: (event) => event.preventDefault(),
2396
- onClick: () => setView("effort"),
2397
- className: cn(
2398
- "flex w-full items-center gap-2 rounded-md px-3 py-2 text-start text-sm",
2399
- "hover:bg-muted transition-colors",
2400
- "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none"
2401
- ),
2402
- children: [
2403
- /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: effortLabel }),
2404
- selectedEffortOption && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground min-w-0 truncate", children: selectedEffortOption.label }),
2405
- /* @__PURE__ */ jsx(
2406
- ChevronRight,
2407
- {
2408
- "aria-hidden": "true",
2409
- className: "text-muted-foreground h-4 w-4 shrink-0 rtl:-scale-x-100"
2410
- }
2411
- )
2412
- ]
2413
- }
2414
- ) })
2415
- ] }),
2416
- view === "effort" && /* @__PURE__ */ jsxs(Fragment, { children: [
2417
- /* @__PURE__ */ jsx("div", { className: "border-border flex items-center gap-1 border-b p-2", children: /* @__PURE__ */ jsxs(
2418
- "button",
2419
- {
2420
- type: "button",
2421
- "data-slot": "composer-model-selector-effort-back",
2422
- "aria-label": backLabel,
2423
- onMouseDown: (event) => event.preventDefault(),
2424
- onClick: () => setView("models"),
2425
- className: cn(
2426
- "inline-flex h-6 shrink-0 items-center gap-1 rounded-full px-2 text-xs font-medium",
2427
- "text-muted-foreground hover:bg-muted hover:text-foreground transition-colors",
2428
- "focus-visible:ring-ring focus-visible:ring-2 focus-visible:outline-none"
2429
- ),
2430
- children: [
2431
- /* @__PURE__ */ jsx(
2432
- ChevronLeft,
2433
- {
2434
- "aria-hidden": "true",
2435
- className: "h-3.5 w-3.5 rtl:-scale-x-100"
2436
- }
2437
- ),
2438
- effortLabel
2439
- ]
2440
- }
2441
- ) }),
2442
- effortHint && /* @__PURE__ */ jsx("p", { className: "text-muted-foreground px-3 pt-2 text-xs", children: effortHint }),
2443
- /* @__PURE__ */ jsx(
2444
- "div",
2445
- {
2446
- ref: effortListRef,
2447
- id: menuId,
2448
- role: "listbox",
2449
- "aria-label": effortLabel,
2450
- "aria-activedescendant": activeEffortOptionId,
2451
- tabIndex: -1,
2452
- onKeyDown: handleEffortKeyDown,
2453
- className: "min-h-0 flex-1 overflow-y-auto p-1",
2454
- children: efforts.map((option, index) => {
2455
- const selected = option.value === effort;
2456
- const highlighted = index === effortHighlight;
2457
- return /* @__PURE__ */ jsxs(
2458
- "button",
2459
- {
2460
- id: getEffortOptionId(index),
2461
- type: "button",
2462
- role: "option",
2463
- "aria-selected": selected,
2464
- onMouseDown: (event) => event.preventDefault(),
2465
- onClick: () => selectEffort(option.value),
2466
- onMouseEnter: () => setEffortHighlight(index),
2467
- className: cn(
2468
- "flex w-full items-center gap-2 rounded-md px-3 py-2 text-start text-sm",
2469
- "focus-visible:ring-ring transition-colors focus-visible:ring-2 focus-visible:outline-none",
2470
- highlighted && "bg-muted",
2471
- selected && "bg-primary/10 text-primary"
2472
- ),
2473
- children: [
2474
- /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
2475
- /* @__PURE__ */ jsx("span", { className: "block truncate", children: option.label }),
2476
- option.description && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground block truncate text-xs", children: option.description })
2477
- ] }),
2478
- option.value === defaultEffort && /* @__PURE__ */ jsx("span", { className: "bg-muted text-muted-foreground shrink-0 rounded px-1.5 py-0.5 text-xs", children: defaultBadgeLabel }),
2479
- selected && /* @__PURE__ */ jsx(
2480
- Check$1,
2481
- {
2482
- "aria-hidden": "true",
2483
- className: "text-primary h-4 w-4 shrink-0"
2484
- }
2485
- )
2486
- ]
2487
- },
2488
- option.value
2489
- );
2490
- })
2491
- }
2492
- )
2493
- ] })
2494
- ]
2495
- }
2496
- ),
2497
- document.body
2498
- )
2499
- ] });
2500
- }
2501
- ComposerModelSelector.displayName = "ComposerModelSelector";
2502
1978
  var THINKING_OPTIONS = [
2503
1979
  {
2504
1980
  value: "never",
@@ -2555,19 +2031,19 @@ function OzwellChat({
2555
2031
  footer = "Powered by Ozwell",
2556
2032
  className
2557
2033
  }) {
2558
- const shellRef = React13.useRef(null);
2559
- const [thinkingMenuOpen, setThinkingMenuOpen] = React13.useState(false);
2560
- const [messagesMenuOpen, setMessagesMenuOpen] = React13.useState(false);
2561
- const [messagesButtonFlare, setMessagesButtonFlare] = React13.useState(false);
2562
- const [isEditingQueuedMessage, setIsEditingQueuedMessage] = React13.useState(false);
2563
- const [queuedMessageDraft, setQueuedMessageDraft] = React13.useState("");
2564
- const hasFlaredRef = React13.useRef(false);
2565
- const queuedMessageEditorRef = React13.useRef(null);
2566
- const displayedMessages = React13.useMemo(
2034
+ const shellRef = React12.useRef(null);
2035
+ const [thinkingMenuOpen, setThinkingMenuOpen] = React12.useState(false);
2036
+ const [messagesMenuOpen, setMessagesMenuOpen] = React12.useState(false);
2037
+ const [messagesButtonFlare, setMessagesButtonFlare] = React12.useState(false);
2038
+ const [isEditingQueuedMessage, setIsEditingQueuedMessage] = React12.useState(false);
2039
+ const [queuedMessageDraft, setQueuedMessageDraft] = React12.useState("");
2040
+ const hasFlaredRef = React12.useRef(false);
2041
+ const queuedMessageEditorRef = React12.useRef(null);
2042
+ const displayedMessages = React12.useMemo(
2567
2043
  () => applyThinkingMode(messages, thinking?.mode ?? "auto"),
2568
2044
  [messages, thinking?.mode]
2569
2045
  );
2570
- const userMessageItems = React13.useMemo(
2046
+ const userMessageItems = React12.useMemo(
2571
2047
  () => displayedMessages.flatMap((message, chatIndex) => {
2572
2048
  if (message.role !== "user") return [];
2573
2049
  const text = message.content.filter((block) => block.type === "text" && block.text).map((block) => block.text).join(" ").trim();
@@ -2576,7 +2052,7 @@ function OzwellChat({
2576
2052
  [displayedMessages]
2577
2053
  );
2578
2054
  const showMessagesNav = userMessageItems.length >= 3;
2579
- const chatMessages = React13.useMemo(
2055
+ const chatMessages = React12.useMemo(
2580
2056
  () => queuedMessage ? [
2581
2057
  ...displayedMessages,
2582
2058
  {
@@ -2593,13 +2069,13 @@ function OzwellChat({
2593
2069
  (option) => option.value === thinking?.mode
2594
2070
  );
2595
2071
  const showModelSelector = Boolean(models?.value && models.options.length > 1);
2596
- React13.useEffect(() => {
2072
+ React12.useEffect(() => {
2597
2073
  if (!queuedMessage) setIsEditingQueuedMessage(false);
2598
2074
  }, [queuedMessage]);
2599
- React13.useEffect(() => {
2075
+ React12.useEffect(() => {
2600
2076
  if (isEditingQueuedMessage) queuedMessageEditorRef.current?.focus();
2601
2077
  }, [isEditingQueuedMessage]);
2602
- React13.useEffect(() => {
2078
+ React12.useEffect(() => {
2603
2079
  if (!showMessagesNav || hasFlaredRef.current) return;
2604
2080
  hasFlaredRef.current = true;
2605
2081
  setMessagesButtonFlare(true);
@@ -2678,7 +2154,7 @@ function OzwellChat({
2678
2154
  variant: "ghost",
2679
2155
  "aria-label": "Save queued message",
2680
2156
  onClick: saveQueuedMessage,
2681
- children: /* @__PURE__ */ jsx(Check, { size: 14, "aria-hidden": "true" })
2157
+ children: /* @__PURE__ */ jsx(Check$1, { size: 14, "aria-hidden": "true" })
2682
2158
  }
2683
2159
  ) }),
2684
2160
  /* @__PURE__ */ jsx(Tooltip, { content: "Cancel editing", children: /* @__PURE__ */ jsx(
@@ -2875,8 +2351,8 @@ function OzwellLogo({
2875
2351
  style,
2876
2352
  className
2877
2353
  }) {
2878
- const [failed, setFailed] = React13.useState(false);
2879
- React13.useEffect(() => setFailed(false), [src]);
2354
+ const [failed, setFailed] = React12.useState(false);
2355
+ React12.useEffect(() => setFailed(false), [src]);
2880
2356
  if (failed) {
2881
2357
  return /* @__PURE__ */ jsx(
2882
2358
  "span",
@@ -2933,9 +2409,9 @@ function HeyOzwellToggle({
2933
2409
  const octoScale = 1 + Math.min(0.28, lv * 2.2);
2934
2410
  const glowOpacity = active ? 0.4 + Math.min(0.55, lv * 4) : 0;
2935
2411
  const glowScale = 1 + Math.min(0.7, lv * 3);
2936
- const [doneFlash, setDoneFlash] = React13.useState(false);
2937
- const wasLoading = React13.useRef(loading);
2938
- React13.useEffect(() => {
2412
+ const [doneFlash, setDoneFlash] = React12.useState(false);
2413
+ const wasLoading = React12.useRef(loading);
2414
+ React12.useEffect(() => {
2939
2415
  if (wasLoading.current && !loading) {
2940
2416
  setDoneFlash(true);
2941
2417
  const t = window.setTimeout(() => setDoneFlash(false), 700);
@@ -2944,9 +2420,9 @@ function HeyOzwellToggle({
2944
2420
  }
2945
2421
  wasLoading.current = loading;
2946
2422
  }, [loading]);
2947
- const [warmFade, setWarmFade] = React13.useState(false);
2948
- const wasWarm = React13.useRef(warmActive);
2949
- React13.useEffect(() => {
2423
+ const [warmFade, setWarmFade] = React12.useState(false);
2424
+ const wasWarm = React12.useRef(warmActive);
2425
+ React12.useEffect(() => {
2950
2426
  if (wasWarm.current && !warmActive) {
2951
2427
  setWarmFade(true);
2952
2428
  const t = window.setTimeout(() => setWarmFade(false), 500);
@@ -2961,8 +2437,8 @@ function HeyOzwellToggle({
2961
2437
  const ringC = 2 * Math.PI * ringR;
2962
2438
  const hasProgress = typeof loadProgress === "number";
2963
2439
  const p = hasProgress ? Math.max(0, Math.min(1, loadProgress)) : 0;
2964
- const [synthP, setSynthP] = React13.useState(0);
2965
- React13.useEffect(() => {
2440
+ const [synthP, setSynthP] = React12.useState(0);
2441
+ React12.useEffect(() => {
2966
2442
  if (!(loading && !hasProgress)) {
2967
2443
  setSynthP(0);
2968
2444
  return;
@@ -2980,9 +2456,9 @@ function HeyOzwellToggle({
2980
2456
  const warmR = (warmBox - warmStroke) / 2;
2981
2457
  const warmC = 2 * Math.PI * warmR;
2982
2458
  const wp = typeof warmProgress === "number" ? Math.max(0, Math.min(1, warmProgress)) : 0;
2983
- const pressTimer = React13.useRef(void 0);
2984
- const longFiredRef = React13.useRef(false);
2985
- React13.useEffect(
2459
+ const pressTimer = React12.useRef(void 0);
2460
+ const longFiredRef = React12.useRef(false);
2461
+ React12.useEffect(
2986
2462
  () => () => {
2987
2463
  if (pressTimer.current) window.clearTimeout(pressTimer.current);
2988
2464
  },
@@ -3311,18 +2787,18 @@ function OzwellSettingsMenu({
3311
2787
  modelStatus,
3312
2788
  onManageVoices
3313
2789
  }) {
3314
- const [modelsOpen, setModelsOpen] = React13.useState(false);
3315
- const modelsRegionId = React13.useId();
3316
- const scrollRef = React13.useRef(null);
3317
- const [hasMore, setHasMore] = React13.useState(false);
3318
- const updateHasMore = React13.useCallback(() => {
2790
+ const [modelsOpen, setModelsOpen] = React12.useState(false);
2791
+ const modelsRegionId = React12.useId();
2792
+ const scrollRef = React12.useRef(null);
2793
+ const [hasMore, setHasMore] = React12.useState(false);
2794
+ const updateHasMore = React12.useCallback(() => {
3319
2795
  const el = scrollRef.current;
3320
2796
  if (el) setHasMore(el.scrollTop + el.clientHeight < el.scrollHeight - 4);
3321
2797
  }, []);
3322
- React13.useEffect(() => {
2798
+ React12.useEffect(() => {
3323
2799
  updateHasMore();
3324
2800
  }, [modelsOpen, open, modelStatus, updateHasMore]);
3325
- React13.useEffect(() => {
2801
+ React12.useEffect(() => {
3326
2802
  if (!open) setModelsOpen(false);
3327
2803
  }, [open]);
3328
2804
  const act = (fn) => () => {
@@ -3532,19 +3008,19 @@ function useWakeWord(opts = {}) {
3532
3008
  assetBase,
3533
3009
  registerServiceWorker = true
3534
3010
  } = opts;
3535
- const [state, setState] = React13.useState({
3011
+ const [state, setState] = React12.useState({
3536
3012
  ready: false,
3537
3013
  error: null,
3538
3014
  speech: 0,
3539
3015
  probs: {}
3540
3016
  });
3541
- const onWakeRef = React13.useRef(onWake);
3017
+ const onWakeRef = React12.useRef(onWake);
3542
3018
  onWakeRef.current = onWake;
3543
- const onUtteranceRef = React13.useRef(onUtterance);
3019
+ const onUtteranceRef = React12.useRef(onUtterance);
3544
3020
  onUtteranceRef.current = onUtterance;
3545
- const lastFiredRef = React13.useRef(null);
3546
- const hbRef = React13.useRef(null);
3547
- React13.useEffect(() => {
3021
+ const lastFiredRef = React12.useRef(null);
3022
+ const hbRef = React12.useRef(null);
3023
+ React12.useEffect(() => {
3548
3024
  if (!enabled) {
3549
3025
  setState(
3550
3026
  (s) => s.ready || s.error || s.speech ? { ready: false, error: null, speech: 0, probs: {} } : s
@@ -3656,7 +3132,7 @@ function useWakeWord(opts = {}) {
3656
3132
  }
3657
3133
  };
3658
3134
  }, [enabled, assetBase]);
3659
- React13.useEffect(() => {
3135
+ React12.useEffect(() => {
3660
3136
  const hb = hbRef.current;
3661
3137
  if (!hb) return;
3662
3138
  if (thresholds) hb.wakeWordThresholds = { ...thresholds };
@@ -4377,10 +3853,10 @@ function endsWithDone(text) {
4377
3853
  }
4378
3854
  function useSpeakerVerify(opts = {}) {
4379
3855
  const { enabled = true } = opts;
4380
- const [ready, setReady] = React13.useState(false);
4381
- const [error, setError] = React13.useState(null);
4382
- const svRef = React13.useRef(null);
4383
- React13.useEffect(() => {
3856
+ const [ready, setReady] = React12.useState(false);
3857
+ const [error, setError] = React12.useState(null);
3858
+ const svRef = React12.useRef(null);
3859
+ React12.useEffect(() => {
4384
3860
  if (!enabled) return;
4385
3861
  let cancelled = false;
4386
3862
  (async () => {
@@ -4600,15 +4076,15 @@ function useDiarization(options = {}) {
4600
4076
  minSegmentSeconds = 1
4601
4077
  } = options;
4602
4078
  const sv = useSpeakerVerify({ enabled });
4603
- const svRef = React13.useRef(sv);
4079
+ const svRef = React12.useRef(sv);
4604
4080
  svRef.current = sv;
4605
- const [busy, setBusy] = React13.useState(false);
4606
- const [error, setError] = React13.useState(null);
4607
- const [result, setResult] = React13.useState(null);
4608
- React13.useEffect(() => {
4081
+ const [busy, setBusy] = React12.useState(false);
4082
+ const [error, setError] = React12.useState(null);
4083
+ const [result, setResult] = React12.useState(null);
4084
+ React12.useEffect(() => {
4609
4085
  if (enabled) warmWhisper();
4610
4086
  }, [enabled]);
4611
- const diarize = React13.useCallback(
4087
+ const diarize = React12.useCallback(
4612
4088
  async (blob) => {
4613
4089
  setBusy(true);
4614
4090
  setError(null);
@@ -4956,11 +4432,11 @@ function stopTrimLeadIn() {
4956
4432
  return typeof v === "number" ? v : 0.35;
4957
4433
  }
4958
4434
  function useRoomLevel(getStream, ready) {
4959
- const [level, setLevel] = React13.useState(0);
4960
- const [listening, setListening] = React13.useState(false);
4961
- const getStreamRef = React13.useRef(getStream);
4435
+ const [level, setLevel] = React12.useState(0);
4436
+ const [listening, setListening] = React12.useState(false);
4437
+ const getStreamRef = React12.useRef(getStream);
4962
4438
  getStreamRef.current = getStream;
4963
- React13.useEffect(() => {
4439
+ React12.useEffect(() => {
4964
4440
  if (!ready) {
4965
4441
  setLevel(0);
4966
4442
  setListening(false);
@@ -5025,20 +4501,20 @@ function useHeyOzwell(options = {}) {
5025
4501
  reviewBeforeSend = false,
5026
4502
  diarizationOptions
5027
4503
  } = options;
5028
- const [active, setActive] = React13.useState(autoStart);
5029
- const [chatOpen, setChatOpen] = React13.useState(false);
5030
- const [settingsOpen, setSettingsOpen] = React13.useState(false);
5031
- const [messages, setMessages] = React13.useState([]);
5032
- const [generating, setGenerating] = React13.useState(false);
5033
- const [phase, setPhase] = React13.useState("listening");
5034
- const [typed, setTyped] = React13.useState("");
5035
- const dictLoad = React13.useSyncExternalStore(
4504
+ const [active, setActive] = React12.useState(autoStart);
4505
+ const [chatOpen, setChatOpen] = React12.useState(false);
4506
+ const [settingsOpen, setSettingsOpen] = React12.useState(false);
4507
+ const [messages, setMessages] = React12.useState([]);
4508
+ const [generating, setGenerating] = React12.useState(false);
4509
+ const [phase, setPhase] = React12.useState("listening");
4510
+ const [typed, setTyped] = React12.useState("");
4511
+ const dictLoad = React12.useSyncExternalStore(
5036
4512
  subscribeDictationLoad,
5037
4513
  getDictationLoad
5038
4514
  );
5039
- const wakeWarm2 = React13.useSyncExternalStore(subscribeWakeWarm, getWakeWarm);
5040
- const counterRef = React13.useRef(0);
5041
- const mkMsg = React13.useCallback(
4515
+ const wakeWarm2 = React12.useSyncExternalStore(subscribeWakeWarm, getWakeWarm);
4516
+ const counterRef = React12.useRef(0);
4517
+ const mkMsg = React12.useCallback(
5042
4518
  (role, text) => ({
5043
4519
  id: `${role}-${++counterRef.current}`,
5044
4520
  role,
@@ -5048,20 +4524,20 @@ function useHeyOzwell(options = {}) {
5048
4524
  }),
5049
4525
  []
5050
4526
  );
5051
- const messagesRef = React13.useRef(messages);
4527
+ const messagesRef = React12.useRef(messages);
5052
4528
  messagesRef.current = messages;
5053
- const phaseRef = React13.useRef(phase);
4529
+ const phaseRef = React12.useRef(phase);
5054
4530
  phaseRef.current = phase;
5055
- const recRef = React13.useRef(null);
5056
- const chunksRef = React13.useRef([]);
5057
- const streamAbortRef = React13.useRef(null);
5058
- const [liveText, setLiveText] = React13.useState("");
5059
- const liveRecRef = React13.useRef(null);
5060
- const liveTimerRef = React13.useRef(null);
5061
- const liveCommittedRef = React13.useRef("");
5062
- const liveCursorRef = React13.useRef(0);
5063
- const liveBusyRef = React13.useRef(false);
5064
- const stopLive = React13.useCallback(() => {
4531
+ const recRef = React12.useRef(null);
4532
+ const chunksRef = React12.useRef([]);
4533
+ const streamAbortRef = React12.useRef(null);
4534
+ const [liveText, setLiveText] = React12.useState("");
4535
+ const liveRecRef = React12.useRef(null);
4536
+ const liveTimerRef = React12.useRef(null);
4537
+ const liveCommittedRef = React12.useRef("");
4538
+ const liveCursorRef = React12.useRef(0);
4539
+ const liveBusyRef = React12.useRef(false);
4540
+ const stopLive = React12.useCallback(() => {
5065
4541
  if (liveTimerRef.current) window.clearInterval(liveTimerRef.current);
5066
4542
  liveTimerRef.current = null;
5067
4543
  liveRecRef.current?.close();
@@ -5071,18 +4547,18 @@ function useHeyOzwell(options = {}) {
5071
4547
  liveBusyRef.current = false;
5072
4548
  setLiveText("");
5073
4549
  }, []);
5074
- const wakeRef = React13.useRef(null);
4550
+ const wakeRef = React12.useRef(null);
5075
4551
  const sv = useSpeakerVerify({ enabled: requireDoctor });
5076
- const svRef = React13.useRef(sv);
4552
+ const svRef = React12.useRef(sv);
5077
4553
  svRef.current = sv;
5078
- const rollRef = React13.useRef(null);
4554
+ const rollRef = React12.useRef(null);
5079
4555
  const diar = useDiarization({
5080
4556
  ...diarizationOptions,
5081
4557
  enabled: conversationMode
5082
4558
  });
5083
- const diarRef = React13.useRef(diar);
4559
+ const diarRef = React12.useRef(diar);
5084
4560
  diarRef.current = diar;
5085
- const verified = React13.useCallback(
4561
+ const verified = React12.useCallback(
5086
4562
  (name) => {
5087
4563
  if (!requireDoctor) return true;
5088
4564
  const svh = svRef.current;
@@ -5104,9 +4580,9 @@ function useHeyOzwell(options = {}) {
5104
4580
  },
5105
4581
  [requireDoctor]
5106
4582
  );
5107
- const onSendRef = React13.useRef(onSend);
4583
+ const onSendRef = React12.useRef(onSend);
5108
4584
  onSendRef.current = onSend;
5109
- const send = React13.useCallback(
4585
+ const send = React12.useCallback(
5110
4586
  (text) => {
5111
4587
  const t = text.trim();
5112
4588
  if (!t) return;
@@ -5164,7 +4640,7 @@ function useHeyOzwell(options = {}) {
5164
4640
  },
5165
4641
  [mkMsg]
5166
4642
  );
5167
- const startDictation = React13.useCallback(() => {
4643
+ const startDictation = React12.useCallback(() => {
5168
4644
  const stream = wakeRef.current?.getStream();
5169
4645
  if (!stream) return;
5170
4646
  chunksRef.current = [];
@@ -5210,7 +4686,7 @@ function useHeyOzwell(options = {}) {
5210
4686
  }, 800);
5211
4687
  }
5212
4688
  }, [liveTranscript, transcription]);
5213
- const stopDictation = React13.useCallback(
4689
+ const stopDictation = React12.useCallback(
5214
4690
  (viaPhrase = false) => {
5215
4691
  const rec = recRef.current;
5216
4692
  if (!rec) return;
@@ -5286,7 +4762,7 @@ function useHeyOzwell(options = {}) {
5286
4762
  });
5287
4763
  wakeRef.current = wake;
5288
4764
  const { level, listening } = useRoomLevel(wake.getStream, wake.ready);
5289
- React13.useEffect(() => {
4765
+ React12.useEffect(() => {
5290
4766
  if (!requireDoctor || !active || !wake.ready) return;
5291
4767
  let cancelled = false;
5292
4768
  let tries = 0;
@@ -5307,11 +4783,11 @@ function useHeyOzwell(options = {}) {
5307
4783
  rollRef.current = null;
5308
4784
  };
5309
4785
  }, [requireDoctor, active, wake.ready]);
5310
- const hasListenedRef = React13.useRef(false);
5311
- React13.useEffect(() => {
4786
+ const hasListenedRef = React12.useRef(false);
4787
+ React12.useEffect(() => {
5312
4788
  if (listening) hasListenedRef.current = true;
5313
4789
  }, [listening]);
5314
- React13.useEffect(() => {
4790
+ React12.useEffect(() => {
5315
4791
  if (!active) hasListenedRef.current = false;
5316
4792
  }, [active]);
5317
4793
  const coldStarting = active && !listening && !hasListenedRef.current;
@@ -5325,13 +4801,13 @@ function useHeyOzwell(options = {}) {
5325
4801
  wake: wakeWarm2.done || wake.ready ? "ready" : ozLoading ? "loading" : "idle",
5326
4802
  transcription: dictLoad.done ? "ready" : dictLoad.active ? "loading" : "idle"
5327
4803
  };
5328
- React13.useEffect(() => {
4804
+ React12.useEffect(() => {
5329
4805
  void warmWakeModels(assetBase);
5330
4806
  }, [assetBase]);
5331
- React13.useEffect(() => {
4807
+ React12.useEffect(() => {
5332
4808
  if (active) warmWhisper();
5333
4809
  }, [active]);
5334
- const toggle = React13.useCallback(
4810
+ const toggle = React12.useCallback(
5335
4811
  (next) => {
5336
4812
  setActive(next);
5337
4813
  if (!next) {
@@ -5526,7 +5002,7 @@ function FloatingAIChat({
5526
5002
  pulse = false,
5527
5003
  ...chatProps
5528
5004
  }) {
5529
- const [internalOpen, setInternalOpen] = React13.useState(defaultOpen);
5005
+ const [internalOpen, setInternalOpen] = React12.useState(defaultOpen);
5530
5006
  const isControlled = controlledOpen !== void 0;
5531
5007
  const isOpen = isControlled ? controlledOpen : internalOpen;
5532
5008
  const handleOpenChange = (open) => {
@@ -5599,36 +5075,36 @@ var TIMEOUT_MS = 5e3;
5599
5075
  var delay = (ms) => new Promise((r) => setTimeout(r, ms));
5600
5076
  function useVoiceSetup(options = {}) {
5601
5077
  const { startAdding = false, voiceId, label } = options;
5602
- const [enrollVoiceId] = React13.useState(
5078
+ const [enrollVoiceId] = React12.useState(
5603
5079
  () => voiceId || (startAdding ? `voice-${Date.now()}-${Math.floor(Math.random() * 1e4)}` : "you")
5604
5080
  );
5605
5081
  const sv = useSpeakerVerify();
5606
- const expectRef = React13.useRef(null);
5607
- const resolveRef = React13.useRef(null);
5608
- const whatRef = React13.useRef({});
5609
- const recRef = React13.useRef(null);
5610
- const abortRef = React13.useRef(false);
5611
- const [level, setLevel] = React13.useState(0);
5082
+ const expectRef = React12.useRef(null);
5083
+ const resolveRef = React12.useRef(null);
5084
+ const whatRef = React12.useRef({});
5085
+ const recRef = React12.useRef(null);
5086
+ const abortRef = React12.useRef(false);
5087
+ const [level, setLevel] = React12.useState(0);
5612
5088
  const wake = useWakeWord({
5613
5089
  onWake: (name) => {
5614
5090
  if (expectRef.current && resolveRef.current) resolveRef.current(name);
5615
5091
  }
5616
5092
  });
5617
- const wakeRef = React13.useRef(wake);
5093
+ const wakeRef = React12.useRef(wake);
5618
5094
  wakeRef.current = wake;
5619
5095
  const bothReady = sv.ready && wake.ready;
5620
- const [phase, setPhase] = React13.useState("intro");
5621
- const [phrase, setPhrase] = React13.useState("hey ozwell");
5622
- const [step, setStep] = React13.useState(0);
5623
- const [adding, setAdding] = React13.useState(startAdding);
5096
+ const [phase, setPhase] = React12.useState("intro");
5097
+ const [phrase, setPhrase] = React12.useState("hey ozwell");
5098
+ const [step, setStep] = React12.useState(0);
5099
+ const [adding, setAdding] = React12.useState(startAdding);
5624
5100
  const total = PHRASES2.length * REPS;
5625
- React13.useEffect(() => {
5101
+ React12.useEffect(() => {
5626
5102
  warmWhisper();
5627
5103
  void loadWhatPrints().then((w) => {
5628
5104
  whatRef.current = w;
5629
5105
  });
5630
5106
  }, []);
5631
- React13.useEffect(() => {
5107
+ React12.useEffect(() => {
5632
5108
  if (!wake.ready) {
5633
5109
  setLevel(0);
5634
5110
  return;
@@ -5695,7 +5171,7 @@ function useVoiceSetup(options = {}) {
5695
5171
  };
5696
5172
  });
5697
5173
  };
5698
- const start = React13.useCallback(async () => {
5174
+ const start = React12.useCallback(async () => {
5699
5175
  if (!bothReady || phase !== "intro") return;
5700
5176
  for (let i = 0; i < 20 && !recRef.current; i++) await delay(50);
5701
5177
  if (!recRef.current) return;
@@ -5743,11 +5219,11 @@ function useVoiceSetup(options = {}) {
5743
5219
  setAdding(false);
5744
5220
  setPhase("done");
5745
5221
  }, [bothReady, phase, adding, sv, enrollVoiceId, label]);
5746
- const addAnotherSpot = React13.useCallback(() => {
5222
+ const addAnotherSpot = React12.useCallback(() => {
5747
5223
  setAdding(true);
5748
5224
  setPhase("intro");
5749
5225
  }, []);
5750
- const cancel = React13.useCallback(() => {
5226
+ const cancel = React12.useCallback(() => {
5751
5227
  abortRef.current = true;
5752
5228
  resolveRef.current?.("__cancelled__");
5753
5229
  setPhase("intro");
@@ -5995,12 +5471,12 @@ var ozBtn2 = "bg-ozwell hover:bg-ozwell active:bg-ozwell text-ozwell-foreground
5995
5471
  var dangerOutline = "border-destructive text-destructive hover:bg-destructive/10 hover:text-destructive";
5996
5472
  function VoiceManager({ logoSrc }) {
5997
5473
  const sv = useSpeakerVerify();
5998
- const [inSetup, setInSetup] = React13.useState(null);
5999
- const [, setTick] = React13.useState(0);
6000
- const [addName, setAddName] = React13.useState("");
6001
- const [editingId, setEditingId] = React13.useState(null);
6002
- const [editLabel, setEditLabel] = React13.useState("");
6003
- const [confirm, setConfirm] = React13.useState(null);
5474
+ const [inSetup, setInSetup] = React12.useState(null);
5475
+ const [, setTick] = React12.useState(0);
5476
+ const [addName, setAddName] = React12.useState("");
5477
+ const [editingId, setEditingId] = React12.useState(null);
5478
+ const [editLabel, setEditLabel] = React12.useState("");
5479
+ const [confirm, setConfirm] = React12.useState(null);
6004
5480
  const voices = sv.ready ? sv.listVoices() : [];
6005
5481
  if (inSetup) {
6006
5482
  return /* @__PURE__ */ jsx(
@@ -6209,7 +5685,7 @@ function HandsFreeChat({
6209
5685
  reviewBeforeSend
6210
5686
  });
6211
5687
  const { phase, ready, error } = oz;
6212
- const [voicesOpen, setVoicesOpen] = React13.useState(false);
5688
+ const [voicesOpen, setVoicesOpen] = React12.useState(false);
6213
5689
  const placeholder = !oz.active ? "Ozwell is off \u2014 tap the octopus to listen" : phase === "listening" ? ready ? "Say \u201Chey ozwell\u201D, or type\u2026" : error ? `\u26A0\uFE0F ${error}` : "\u2026 loading models" : oz.chatProps.inputPlaceholder;
6214
5690
  return /* @__PURE__ */ jsxs("div", { style: { height: "100vh", display: "flex", flexDirection: "column" }, children: [
6215
5691
  /* @__PURE__ */ jsxs("div", { style: { flex: 1, minHeight: 0, position: "relative" }, children: [
@@ -6285,30 +5761,30 @@ var LIVE_CHUNK_SECONDS = 7;
6285
5761
  function useVisitScribe(options = {}) {
6286
5762
  const { liveTranscript = false, ...diarOptions } = options;
6287
5763
  const diar = useDiarization(diarOptions);
6288
- const diarRef = React13.useRef(diar);
5764
+ const diarRef = React12.useRef(diar);
6289
5765
  diarRef.current = diar;
6290
- const liveOnRef = React13.useRef(liveTranscript);
5766
+ const liveOnRef = React12.useRef(liveTranscript);
6291
5767
  liveOnRef.current = liveTranscript;
6292
- const [recording, setRecording] = React13.useState(false);
6293
- const [elapsedMs, setElapsedMs] = React13.useState(0);
6294
- const [liveText, setLiveText] = React13.useState("");
6295
- const [startError, setStartError] = React13.useState(null);
6296
- const recRef = React13.useRef(null);
6297
- const streamRef = React13.useRef(null);
6298
- const chunksRef = React13.useRef([]);
6299
- const startedAtRef = React13.useRef(0);
6300
- const timerRef = React13.useRef(null);
6301
- const lastBlobRef = React13.useRef(null);
6302
- const [canReanalyze, setCanReanalyze] = React13.useState(false);
6303
- const liveRecRef = React13.useRef(null);
6304
- const liveTimerRef = React13.useRef(null);
6305
- const liveCursorRef = React13.useRef(0);
6306
- const liveBusyRef = React13.useRef(false);
6307
- const clearTimer = React13.useCallback(() => {
5768
+ const [recording, setRecording] = React12.useState(false);
5769
+ const [elapsedMs, setElapsedMs] = React12.useState(0);
5770
+ const [liveText, setLiveText] = React12.useState("");
5771
+ const [startError, setStartError] = React12.useState(null);
5772
+ const recRef = React12.useRef(null);
5773
+ const streamRef = React12.useRef(null);
5774
+ const chunksRef = React12.useRef([]);
5775
+ const startedAtRef = React12.useRef(0);
5776
+ const timerRef = React12.useRef(null);
5777
+ const lastBlobRef = React12.useRef(null);
5778
+ const [canReanalyze, setCanReanalyze] = React12.useState(false);
5779
+ const liveRecRef = React12.useRef(null);
5780
+ const liveTimerRef = React12.useRef(null);
5781
+ const liveCursorRef = React12.useRef(0);
5782
+ const liveBusyRef = React12.useRef(false);
5783
+ const clearTimer = React12.useCallback(() => {
6308
5784
  if (timerRef.current) window.clearInterval(timerRef.current);
6309
5785
  timerRef.current = null;
6310
5786
  }, []);
6311
- const stopLive = React13.useCallback(() => {
5787
+ const stopLive = React12.useCallback(() => {
6312
5788
  if (liveTimerRef.current) window.clearInterval(liveTimerRef.current);
6313
5789
  liveTimerRef.current = null;
6314
5790
  liveRecRef.current?.close();
@@ -6316,8 +5792,8 @@ function useVisitScribe(options = {}) {
6316
5792
  liveCursorRef.current = 0;
6317
5793
  liveBusyRef.current = false;
6318
5794
  }, []);
6319
- const startingRef = React13.useRef(false);
6320
- const start = React13.useCallback(async () => {
5795
+ const startingRef = React12.useRef(false);
5796
+ const start = React12.useCallback(async () => {
6321
5797
  if (startingRef.current || recRef.current) return;
6322
5798
  startingRef.current = true;
6323
5799
  setStartError(null);
@@ -6410,7 +5886,7 @@ function useVisitScribe(options = {}) {
6410
5886
  setRecording(true);
6411
5887
  startingRef.current = false;
6412
5888
  }, [clearTimer]);
6413
- const stop = React13.useCallback(() => {
5889
+ const stop = React12.useCallback(() => {
6414
5890
  clearTimer();
6415
5891
  stopLive();
6416
5892
  setRecording(false);
@@ -6422,19 +5898,19 @@ function useVisitScribe(options = {}) {
6422
5898
  streamRef.current?.getTracks().forEach((t) => t.stop());
6423
5899
  streamRef.current = null;
6424
5900
  }, [clearTimer, stopLive]);
6425
- const reanalyze = React13.useCallback(() => {
5901
+ const reanalyze = React12.useCallback(() => {
6426
5902
  const blob = lastBlobRef.current;
6427
5903
  if (blob) void diarRef.current.diarize(blob).catch(() => {
6428
5904
  });
6429
5905
  }, []);
6430
- const reset = React13.useCallback(() => {
5906
+ const reset = React12.useCallback(() => {
6431
5907
  setElapsedMs(0);
6432
5908
  setLiveText("");
6433
5909
  setStartError(null);
6434
5910
  lastBlobRef.current = null;
6435
5911
  setCanReanalyze(false);
6436
5912
  }, []);
6437
- React13.useEffect(() => {
5913
+ React12.useEffect(() => {
6438
5914
  return () => {
6439
5915
  clearTimer();
6440
5916
  stopLive();
@@ -6516,13 +5992,13 @@ function VisitScribe({
6516
5992
  diarizationOptions,
6517
5993
  className
6518
5994
  }) {
6519
- const [inferRoles, setInferRoles] = React13.useState(inferRolesProp);
6520
- const [live, setLive] = React13.useState(liveTranscriptProp);
6521
- const [showAdvanced, setShowAdvanced] = React13.useState(false);
6522
- const [threshold, setThreshold] = React13.useState(
5995
+ const [inferRoles, setInferRoles] = React12.useState(inferRolesProp);
5996
+ const [live, setLive] = React12.useState(liveTranscriptProp);
5997
+ const [showAdvanced, setShowAdvanced] = React12.useState(false);
5998
+ const [threshold, setThreshold] = React12.useState(
6523
5999
  diarizationOptions?.threshold ?? 0.65
6524
6000
  );
6525
- const [maxSpeakers, setMaxSpeakers] = React13.useState(
6001
+ const [maxSpeakers, setMaxSpeakers] = React12.useState(
6526
6002
  diarizationOptions?.maxSpeakers
6527
6003
  );
6528
6004
  const scribe = useVisitScribe({
@@ -6542,43 +6018,43 @@ function VisitScribe({
6542
6018
  elapsedMs,
6543
6019
  canReanalyze
6544
6020
  } = scribe;
6545
- const [labels, setLabels] = React13.useState({});
6546
- const [turnSpeaker, setTurnSpeaker] = React13.useState(
6021
+ const [labels, setLabels] = React12.useState({});
6022
+ const [turnSpeaker, setTurnSpeaker] = React12.useState(
6547
6023
  {}
6548
6024
  );
6549
- const [editing, setEditing] = React13.useState(false);
6550
- React13.useEffect(() => {
6025
+ const [editing, setEditing] = React12.useState(false);
6026
+ React12.useEffect(() => {
6551
6027
  setLabels({});
6552
6028
  setTurnSpeaker({});
6553
6029
  setEditing(false);
6554
6030
  }, [result]);
6555
- const effective = React13.useCallback(
6031
+ const effective = React12.useCallback(
6556
6032
  (sp) => labels[sp]?.trim() || sp,
6557
6033
  [labels]
6558
6034
  );
6559
- const speakers = React13.useMemo(() => {
6035
+ const speakers = React12.useMemo(() => {
6560
6036
  const seen = [];
6561
6037
  result?.forEach((t) => {
6562
6038
  if (!seen.includes(t.speaker)) seen.push(t.speaker);
6563
6039
  });
6564
6040
  return seen;
6565
6041
  }, [result]);
6566
- const origOf = React13.useCallback(
6042
+ const origOf = React12.useCallback(
6567
6043
  (i) => turnSpeaker[i] ?? result?.[i]?.speaker ?? "",
6568
6044
  [turnSpeaker, result]
6569
6045
  );
6570
- const resolved = React13.useMemo(
6046
+ const resolved = React12.useMemo(
6571
6047
  () => (result ?? []).map((t, i) => effective(turnSpeaker[i] ?? t.speaker)),
6572
6048
  [result, turnSpeaker, effective]
6573
6049
  );
6574
- const distinctLabels = React13.useMemo(() => {
6050
+ const distinctLabels = React12.useMemo(() => {
6575
6051
  const seen = [];
6576
6052
  resolved.forEach((l) => {
6577
6053
  if (!seen.includes(l)) seen.push(l);
6578
6054
  });
6579
6055
  return seen;
6580
6056
  }, [resolved]);
6581
- const colorByLabel = React13.useMemo(() => {
6057
+ const colorByLabel = React12.useMemo(() => {
6582
6058
  const m = /* @__PURE__ */ new Map();
6583
6059
  distinctLabels.forEach(
6584
6060
  (l, idx) => m.set(l, SPEAKER_COLORS[idx % SPEAKER_COLORS.length])
@@ -6937,7 +6413,7 @@ function ReconciliationProposalRow({
6937
6413
  editing: false,
6938
6414
  value: proposal.proposed
6939
6415
  };
6940
- const rowId = React13.useId();
6416
+ const rowId = React12.useId();
6941
6417
  const checkboxId = `${rowId}-accept`;
6942
6418
  const level = resolveConfidenceLevel(proposal);
6943
6419
  const render = proposal.renderValue ?? formatValueDefault;
@@ -7116,17 +6592,17 @@ function AIReconciliationPanel({
7116
6592
  onNothingToReconcile,
7117
6593
  className
7118
6594
  }) {
7119
- const effective = React13.useMemo(
6595
+ const effective = React12.useMemo(
7120
6596
  () => proposals.filter((p) => !isEqual(p.current, p.proposed)),
7121
6597
  [proposals, isEqual]
7122
6598
  );
7123
- const stateSignature = React13.useMemo(
6599
+ const stateSignature = React12.useMemo(
7124
6600
  () => effective.map(
7125
6601
  (p) => `${p.id}\u241F${safeStableStringify(p.proposed)}\u241F${p.defaultAccepted ?? ""}\u241F${p.required ?? ""}\u241F${p.confidence ?? ""}\u241F${p.confidenceLevel ?? ""}`
7126
6602
  ).join("|"),
7127
6603
  [effective]
7128
6604
  );
7129
- const [rowStates, setRowStates] = React13.useState(
6605
+ const [rowStates, setRowStates] = React12.useState(
7130
6606
  () => Object.fromEntries(
7131
6607
  effective.map((p) => [
7132
6608
  p.id,
@@ -7138,7 +6614,7 @@ function AIReconciliationPanel({
7138
6614
  ])
7139
6615
  )
7140
6616
  );
7141
- React13.useEffect(() => {
6617
+ React12.useEffect(() => {
7142
6618
  setRowStates(
7143
6619
  Object.fromEntries(
7144
6620
  effective.map((p) => [
@@ -7152,20 +6628,20 @@ function AIReconciliationPanel({
7152
6628
  )
7153
6629
  );
7154
6630
  }, [stateSignature]);
7155
- const reportedEmpty = React13.useRef(false);
7156
- React13.useEffect(() => {
6631
+ const reportedEmpty = React12.useRef(false);
6632
+ React12.useEffect(() => {
7157
6633
  if (effective.length === 0 && !reportedEmpty.current) {
7158
6634
  reportedEmpty.current = true;
7159
6635
  onNothingToReconcile?.();
7160
6636
  }
7161
6637
  if (effective.length > 0) reportedEmpty.current = false;
7162
6638
  }, [effective.length, onNothingToReconcile]);
7163
- const acceptedCount = React13.useMemo(
6639
+ const acceptedCount = React12.useMemo(
7164
6640
  () => Object.values(rowStates).filter((s) => s.accepted).length,
7165
6641
  [rowStates]
7166
6642
  );
7167
- const [submitting, setSubmitting] = React13.useState(false);
7168
- const setAllAccepted = React13.useCallback(
6643
+ const [submitting, setSubmitting] = React12.useState(false);
6644
+ const setAllAccepted = React12.useCallback(
7169
6645
  (accepted) => {
7170
6646
  setRowStates((prev) => {
7171
6647
  const next = { ...prev };
@@ -7183,7 +6659,7 @@ function AIReconciliationPanel({
7183
6659
  },
7184
6660
  [effective]
7185
6661
  );
7186
- const setRowAccepted = React13.useCallback(
6662
+ const setRowAccepted = React12.useCallback(
7187
6663
  (id, accepted) => {
7188
6664
  const proposal = effective.find((p) => p.id === id);
7189
6665
  setRowStates((prev) => {
@@ -7197,7 +6673,7 @@ function AIReconciliationPanel({
7197
6673
  },
7198
6674
  [effective]
7199
6675
  );
7200
- const setRowValue = React13.useCallback(
6676
+ const setRowValue = React12.useCallback(
7201
6677
  (id, value) => {
7202
6678
  const proposal = effective.find((p) => p.id === id);
7203
6679
  setRowStates((prev) => {
@@ -7211,7 +6687,7 @@ function AIReconciliationPanel({
7211
6687
  },
7212
6688
  [effective]
7213
6689
  );
7214
- const toggleRowEditing = React13.useCallback(
6690
+ const toggleRowEditing = React12.useCallback(
7215
6691
  (id) => {
7216
6692
  const proposal = effective.find((p) => p.id === id);
7217
6693
  setRowStates((prev) => {
@@ -7225,7 +6701,7 @@ function AIReconciliationPanel({
7225
6701
  },
7226
6702
  [effective]
7227
6703
  );
7228
- const handleApply = React13.useCallback(async () => {
6704
+ const handleApply = React12.useCallback(async () => {
7229
6705
  const accepted = effective.filter((p) => rowStates[p.id]?.accepted).map((p) => ({
7230
6706
  id: p.id,
7231
6707
  value: rowStates[p.id]?.value ?? p.proposed
@@ -7238,8 +6714,8 @@ function AIReconciliationPanel({
7238
6714
  setSubmitting(false);
7239
6715
  }
7240
6716
  }, [effective, rowStates, onApply]);
7241
- const containerRef = React13.useRef(null);
7242
- React13.useEffect(() => {
6717
+ const containerRef = React12.useRef(null);
6718
+ React12.useEffect(() => {
7243
6719
  const el = containerRef.current;
7244
6720
  if (!el) return void 0;
7245
6721
  const handler = (e) => {
@@ -7271,7 +6747,7 @@ function AIReconciliationPanel({
7271
6747
  const allAccepted = effective.length > 0 && acceptedCount === effective.length;
7272
6748
  const someAccepted = acceptedCount > 0 && !allAccepted;
7273
6749
  const resolvedApplyLabel = applyLabel ?? (acceptedCount === 1 ? "Apply 1 update" : `Apply ${acceptedCount} updates`);
7274
- const grouped = React13.useMemo(() => {
6750
+ const grouped = React12.useMemo(() => {
7275
6751
  const map = /* @__PURE__ */ new Map();
7276
6752
  for (const p of effective) {
7277
6753
  const key = p.group;
@@ -7322,7 +6798,7 @@ function AIReconciliationPanel({
7322
6798
  {
7323
6799
  "data-slot": "reconciliation-rows",
7324
6800
  className: "divide-border max-h-[60vh] overflow-y-auto",
7325
- children: grouped.map(([groupKey, items]) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
6801
+ children: grouped.map(([groupKey, items]) => /* @__PURE__ */ jsxs(React12.Fragment, { children: [
7326
6802
  groupKey && /* @__PURE__ */ jsx(
7327
6803
  "li",
7328
6804
  {
@@ -7940,7 +7416,7 @@ function ConcernRow({
7940
7416
  drag,
7941
7417
  onAction
7942
7418
  }) {
7943
- const [expanded, setExpanded] = React13.useState(false);
7419
+ const [expanded, setExpanded] = React12.useState(false);
7944
7420
  const current = currentAssertion(concern);
7945
7421
  const hasHistory = concern.assertions.length > 1;
7946
7422
  const visibleActions = actions.filter(
@@ -8058,7 +7534,7 @@ function ConcernRow({
8058
7534
  )
8059
7535
  );
8060
7536
  }
8061
- var ProblemList = React13.forwardRef(
7537
+ var ProblemList = React12.forwardRef(
8062
7538
  ({
8063
7539
  concerns,
8064
7540
  title = "Problem list",
@@ -8072,7 +7548,7 @@ var ProblemList = React13.forwardRef(
8072
7548
  "data-testid": dataTestId,
8073
7549
  ...props
8074
7550
  }, ref) => {
8075
- const [draft, setDraft] = React13.useState("");
7551
+ const [draft, setDraft] = React12.useState("");
8076
7552
  const [announcement, setAnnouncement] = useLiveAnnouncement();
8077
7553
  const submitDraft = () => {
8078
7554
  const text = draft.trim();
@@ -8080,7 +7556,7 @@ var ProblemList = React13.forwardRef(
8080
7556
  onAddProblem?.(text);
8081
7557
  setDraft("");
8082
7558
  };
8083
- const moveConcern = React13.useCallback(
7559
+ const moveConcern = React12.useCallback(
8084
7560
  (concern, dir) => {
8085
7561
  if (!onReorder || readOnly) return;
8086
7562
  const groupKey = concernGroupKey(concern);
@@ -8100,7 +7576,7 @@ var ProblemList = React13.forwardRef(
8100
7576
  },
8101
7577
  [concerns, onReorder, readOnly, setAnnouncement]
8102
7578
  );
8103
- const handleAction = React13.useCallback(
7579
+ const handleAction = React12.useCallback(
8104
7580
  (concern, action) => {
8105
7581
  if (action === "move-up") moveConcern(concern, -1);
8106
7582
  else if (action === "move-down") moveConcern(concern, 1);
@@ -8108,13 +7584,13 @@ var ProblemList = React13.forwardRef(
8108
7584
  },
8109
7585
  [moveConcern, onAction]
8110
7586
  );
8111
- const groupById = React13.useMemo(
7587
+ const groupById = React12.useMemo(
8112
7588
  () => new Map(
8113
7589
  concerns.map((c) => [c.concernId, concernGroupKey(c)])
8114
7590
  ),
8115
7591
  [concerns]
8116
7592
  );
8117
- const groupOf = React13.useCallback(
7593
+ const groupOf = React12.useCallback(
8118
7594
  (id) => groupById.get(id),
8119
7595
  [groupById]
8120
7596
  );
@@ -8319,8 +7795,8 @@ function OrderRow({
8319
7795
  controls?.moveWithin || controls?.moveToProblem || controls?.edit || controls?.editStart || controls?.remove
8320
7796
  );
8321
7797
  const canEdit = Boolean(controls?.edit || controls?.editStart);
8322
- const [editing, setEditing] = React13.useState(null);
8323
- const [menuOpen, setMenuOpen] = React13.useState(false);
7798
+ const [editing, setEditing] = React12.useState(null);
7799
+ const [menuOpen, setMenuOpen] = React12.useState(false);
8324
7800
  const pick = (fn) => () => {
8325
7801
  setMenuOpen(false);
8326
7802
  fn();
@@ -8564,12 +8040,12 @@ function AddOrderForm({
8564
8040
  onCancel,
8565
8041
  renderSearch
8566
8042
  }) {
8567
- const [type, setType] = React13.useState(
8043
+ const [type, setType] = React12.useState(
8568
8044
  renderSearch ? "auto" : "medication"
8569
8045
  );
8570
- const [display, setDisplay] = React13.useState("");
8571
- const inputRef = React13.useRef(null);
8572
- React13.useEffect(() => {
8046
+ const [display, setDisplay] = React12.useState("");
8047
+ const inputRef = React12.useRef(null);
8048
+ React12.useEffect(() => {
8573
8049
  inputRef.current?.focus();
8574
8050
  }, []);
8575
8051
  const submit = () => {
@@ -8679,7 +8155,7 @@ function AddOrderForm({
8679
8155
  }
8680
8156
  );
8681
8157
  }
8682
- var Assessment = React13.forwardRef(
8158
+ var Assessment = React12.forwardRef(
8683
8159
  ({
8684
8160
  concerns,
8685
8161
  items,
@@ -8704,17 +8180,17 @@ var Assessment = React13.forwardRef(
8704
8180
  "data-testid": dataTestId,
8705
8181
  ...props
8706
8182
  }, ref) => {
8707
- const [addingFor, setAddingFor] = React13.useState(null);
8708
- const [addMode, setAddMode] = React13.useState(
8183
+ const [addingFor, setAddingFor] = React12.useState(null);
8184
+ const [addMode, setAddMode] = React12.useState(
8709
8185
  defaultAddMode
8710
8186
  );
8711
- const [pendingFreeText, setPendingFreeText] = React13.useState(
8187
+ const [pendingFreeText, setPendingFreeText] = React12.useState(
8712
8188
  null
8713
8189
  );
8714
8190
  const [announcement, setAnnouncement] = useLiveAnnouncement();
8715
8191
  const ambientCodeLookup = useCodeLookupConfig();
8716
8192
  const effectiveRenderOrderSearch = renderOrderSearch === false ? void 0 : renderOrderSearch ?? (ambientCodeLookup ? contextOrderSearch(ambientCodeLookup) : void 0);
8717
- const concernById = React13.useMemo(
8193
+ const concernById = React12.useMemo(
8718
8194
  () => new Map(concerns.map((c) => [c.concernId, c])),
8719
8195
  [concerns]
8720
8196
  );
@@ -8729,7 +8205,7 @@ var Assessment = React13.forwardRef(
8729
8205
  onReorderItems(ids);
8730
8206
  }
8731
8207
  });
8732
- const problemLabel = React13.useCallback(
8208
+ const problemLabel = React12.useCallback(
8733
8209
  (concernId) => concernById.get(concernId)?.assertions.find(
8734
8210
  (a) => items.some(
8735
8211
  (i) => i.concernId === concernId && i.assertionId === a.id
@@ -8781,11 +8257,11 @@ var Assessment = React13.forwardRef(
8781
8257
  }))
8782
8258
  };
8783
8259
  const orderDragEnabled = !readOnly && Boolean(onReorderOrders || onLinkOrder);
8784
- const [draggingOrderId, setDraggingOrderId] = React13.useState(
8260
+ const [draggingOrderId, setDraggingOrderId] = React12.useState(
8785
8261
  null
8786
8262
  );
8787
- const draggingOrderRef = React13.useRef(null);
8788
- const [orderOver, setOrderOver] = React13.useState(null);
8263
+ const draggingOrderRef = React12.useRef(null);
8264
+ const [orderOver, setOrderOver] = React12.useState(null);
8789
8265
  const resetOrderDrag = () => {
8790
8266
  draggingOrderRef.current = null;
8791
8267
  setDraggingOrderId(null);
@@ -9230,10 +8706,10 @@ function AuthDialog({
9230
8706
  requireEmailVerification = false,
9231
8707
  className
9232
8708
  }) {
9233
- const [internalMode, setInternalMode] = React13.useState("login");
9234
- const [isLoading, setIsLoading] = React13.useState(false);
9235
- const [error, setError] = React13.useState(null);
9236
- const [success, setSuccess] = React13.useState(null);
8709
+ const [internalMode, setInternalMode] = React12.useState("login");
8710
+ const [isLoading, setIsLoading] = React12.useState(false);
8711
+ const [error, setError] = React12.useState(null);
8712
+ const [success, setSuccess] = React12.useState(null);
9237
8713
  const mode = controlledMode ?? internalMode;
9238
8714
  const setMode = (newMode) => {
9239
8715
  setError(null);
@@ -9244,14 +8720,14 @@ function AuthDialog({
9244
8720
  setInternalMode(newMode);
9245
8721
  }
9246
8722
  };
9247
- React13.useEffect(() => {
8723
+ React12.useEffect(() => {
9248
8724
  const handleEscape = (e) => {
9249
8725
  if (e.key === "Escape" && isOpen) onClose();
9250
8726
  };
9251
8727
  document.addEventListener("keydown", handleEscape);
9252
8728
  return () => document.removeEventListener("keydown", handleEscape);
9253
8729
  }, [isOpen, onClose]);
9254
- React13.useEffect(() => {
8730
+ React12.useEffect(() => {
9255
8731
  if (isOpen) {
9256
8732
  document.body.style.overflow = "hidden";
9257
8733
  } else {
@@ -9477,9 +8953,9 @@ function AuthDialog({
9477
8953
  );
9478
8954
  }
9479
8955
  function LoginForm({ onSubmit, isLoading, onForgotPassword }) {
9480
- const [email, setEmail] = React13.useState("");
9481
- const [password, setPassword] = React13.useState("");
9482
- const [showPassword, setShowPassword] = React13.useState(false);
8956
+ const [email, setEmail] = React12.useState("");
8957
+ const [password, setPassword] = React12.useState("");
8958
+ const [showPassword, setShowPassword] = React12.useState(false);
9483
8959
  const handleSubmit = (e) => {
9484
8960
  e.preventDefault();
9485
8961
  onSubmit(email, password);
@@ -9581,11 +9057,11 @@ function SignupForm({
9581
9057
  termsUrl,
9582
9058
  privacyUrl
9583
9059
  }) {
9584
- const [email, setEmail] = React13.useState("");
9585
- const [password, setPassword] = React13.useState("");
9586
- const [confirmPassword, setConfirmPassword] = React13.useState("");
9587
- const [acceptedTerms, setAcceptedTerms] = React13.useState(false);
9588
- const [showPassword, setShowPassword] = React13.useState(false);
9060
+ const [email, setEmail] = React12.useState("");
9061
+ const [password, setPassword] = React12.useState("");
9062
+ const [confirmPassword, setConfirmPassword] = React12.useState("");
9063
+ const [acceptedTerms, setAcceptedTerms] = React12.useState(false);
9064
+ const [showPassword, setShowPassword] = React12.useState(false);
9589
9065
  const passwordsMatch = password === confirmPassword;
9590
9066
  const handleSubmit = (e) => {
9591
9067
  e.preventDefault();
@@ -9734,7 +9210,7 @@ function ForgotPasswordForm({
9734
9210
  isLoading,
9735
9211
  onBack
9736
9212
  }) {
9737
- const [email, setEmail] = React13.useState("");
9213
+ const [email, setEmail] = React12.useState("");
9738
9214
  const handleSubmit = (e) => {
9739
9215
  e.preventDefault();
9740
9216
  onSubmit(email);
@@ -9785,9 +9261,9 @@ function ForgotPasswordForm({
9785
9261
  ] });
9786
9262
  }
9787
9263
  function ResetPasswordForm({ onSubmit, isLoading }) {
9788
- const [password, setPassword] = React13.useState("");
9789
- const [confirmPassword, setConfirmPassword] = React13.useState("");
9790
- const [showPassword, setShowPassword] = React13.useState(false);
9264
+ const [password, setPassword] = React12.useState("");
9265
+ const [confirmPassword, setConfirmPassword] = React12.useState("");
9266
+ const [showPassword, setShowPassword] = React12.useState(false);
9791
9267
  const passwordsMatch = password === confirmPassword;
9792
9268
  const handleSubmit = (e) => {
9793
9269
  e.preventDefault();
@@ -10153,10 +9629,10 @@ function ServiceSelect({
10153
9629
  error,
10154
9630
  className
10155
9631
  }) {
10156
- const [isOpen, setIsOpen] = React13.useState(false);
10157
- const dropdownRef = React13.useRef(null);
9632
+ const [isOpen, setIsOpen] = React12.useState(false);
9633
+ const dropdownRef = React12.useRef(null);
10158
9634
  const { anchorRef, floatingRef, style } = useAnchoredPosition({ open: isOpen, matchWidth: true, maxHeight: 240 });
10159
- const outsideRefs = React13.useMemo(
9635
+ const outsideRefs = React12.useMemo(
10160
9636
  () => [dropdownRef, floatingRef],
10161
9637
  [floatingRef]
10162
9638
  );
@@ -10335,7 +9811,7 @@ function DialogOverlay({
10335
9811
  className,
10336
9812
  titleId
10337
9813
  }) {
10338
- React13.useEffect(() => {
9814
+ React12.useEffect(() => {
10339
9815
  if (!isOpen || isStorybookDocsMode()) {
10340
9816
  return void 0;
10341
9817
  }
@@ -10389,8 +9865,8 @@ function BookingDialog({
10389
9865
  isLoading = false,
10390
9866
  className
10391
9867
  }) {
10392
- const titleId = React13.useId();
10393
- const [formData, setFormData] = React13.useState({
9868
+ const titleId = React12.useId();
9869
+ const [formData, setFormData] = React12.useState({
10394
9870
  firstName: defaultValues?.firstName || "",
10395
9871
  lastName: defaultValues?.lastName || "",
10396
9872
  phoneNumber: defaultValues?.phoneNumber || "",
@@ -10399,7 +9875,7 @@ function BookingDialog({
10399
9875
  consentEmail: defaultValues?.consentEmail ?? false,
10400
9876
  consentSms: defaultValues?.consentSms ?? false
10401
9877
  });
10402
- const [errors, setErrors] = React13.useState({});
9878
+ const [errors, setErrors] = React12.useState({});
10403
9879
  const validate = () => {
10404
9880
  const newErrors = {};
10405
9881
  if (!formData.firstName.trim()) {
@@ -10667,7 +10143,7 @@ function InlineBookingForm({
10667
10143
  isLoading = false,
10668
10144
  className
10669
10145
  }) {
10670
- const [formData, setFormData] = React13.useState({
10146
+ const [formData, setFormData] = React12.useState({
10671
10147
  firstName: defaultValues?.firstName || "",
10672
10148
  lastName: defaultValues?.lastName || "",
10673
10149
  phoneNumber: defaultValues?.phoneNumber || "",
@@ -10676,7 +10152,7 @@ function InlineBookingForm({
10676
10152
  consentEmail: defaultValues?.consentEmail ?? false,
10677
10153
  consentSms: defaultValues?.consentSms ?? false
10678
10154
  });
10679
- const [errors, setErrors] = React13.useState({});
10155
+ const [errors, setErrors] = React12.useState({});
10680
10156
  const validate = () => {
10681
10157
  const newErrors = {};
10682
10158
  if (!formData.firstName.trim()) {
@@ -11514,7 +10990,7 @@ function HoursSummary({
11514
10990
  defaultExpanded = false,
11515
10991
  className
11516
10992
  }) {
11517
- const [isExpanded, setIsExpanded] = React13.useState(defaultExpanded);
10993
+ const [isExpanded, setIsExpanded] = React12.useState(defaultExpanded);
11518
10994
  const isOpen = isCurrentlyOpen(schedule.officeHours);
11519
10995
  const todayHours = getTodayHours(schedule.officeHours, use24Hour);
11520
10996
  const hasStructuredHours = schedule.officeHours && schedule.officeHours.length > 0;
@@ -11908,12 +11384,12 @@ function BusinessHoursRulesEditor({
11908
11384
  className,
11909
11385
  addHoursLabel = "Add Hours"
11910
11386
  }) {
11911
- const [rules, setRules] = React13.useState(
11387
+ const [rules, setRules] = React12.useState(
11912
11388
  () => scheduleToRules(value)
11913
11389
  );
11914
11390
  const timeFormat = use24Hour ? "24-hour" : "12-hour";
11915
- const lastScheduleRef = React13.useRef(normalizeSchedule(value));
11916
- React13.useEffect(() => {
11391
+ const lastScheduleRef = React12.useRef(normalizeSchedule(value));
11392
+ React12.useEffect(() => {
11917
11393
  const incoming = normalizeSchedule(value);
11918
11394
  if (incoming !== lastScheduleRef.current) {
11919
11395
  lastScheduleRef.current = incoming;
@@ -12155,13 +11631,13 @@ function CopyIcon({ className }) {
12155
11631
  }
12156
11632
  );
12157
11633
  }
12158
- var ButtonGroup = React13.forwardRef(
11634
+ var ButtonGroup = React12.forwardRef(
12159
11635
  ({ orientation = "auto", split, className, children, ...props }, ref) => {
12160
- const innerRef = React13.useRef(null);
12161
- React13.useImperativeHandle(ref, () => innerRef.current);
12162
- const [stacked, setStacked] = React13.useState(false);
12163
- const requiredWidth = React13.useRef(0);
12164
- React13.useLayoutEffect(() => {
11636
+ const innerRef = React12.useRef(null);
11637
+ React12.useImperativeHandle(ref, () => innerRef.current);
11638
+ const [stacked, setStacked] = React12.useState(false);
11639
+ const requiredWidth = React12.useRef(0);
11640
+ React12.useLayoutEffect(() => {
12165
11641
  if (orientation !== "auto") return;
12166
11642
  const el = innerRef.current;
12167
11643
  if (!el) return;
@@ -12188,7 +11664,7 @@ var ButtonGroup = React13.forwardRef(
12188
11664
  return () => observer.disconnect();
12189
11665
  }, [orientation, stacked, children]);
12190
11666
  const isStacked = orientation === "vertical" || orientation === "auto" && stacked;
12191
- const items = React13.Children.toArray(children);
11667
+ const items = React12.Children.toArray(children);
12192
11668
  const splitCount = split === true ? 1 : typeof split === "number" ? split : 0;
12193
11669
  const splitIndex = !isStacked && splitCount > 0 && splitCount < items.length ? splitCount : 0;
12194
11670
  return /* @__PURE__ */ jsx(
@@ -12268,7 +11744,7 @@ function HeaderActionButton({
12268
11744
  )
12269
11745
  ] });
12270
11746
  }
12271
- var CaseContextBar = React13.forwardRef(
11747
+ var CaseContextBar = React12.forwardRef(
12272
11748
  ({
12273
11749
  caseInfo,
12274
11750
  showBackButton = false,
@@ -12335,7 +11811,7 @@ var CaseContextBar = React13.forwardRef(
12335
11811
  }
12336
11812
  );
12337
11813
  CaseContextBar.displayName = "CaseContextBar";
12338
- var CaseManagementHeader = React13.forwardRef(
11814
+ var CaseManagementHeader = React12.forwardRef(
12339
11815
  ({
12340
11816
  caseInfo,
12341
11817
  patient,
@@ -12359,9 +11835,9 @@ var CaseManagementHeader = React13.forwardRef(
12359
11835
  ...props
12360
11836
  }, ref) => {
12361
11837
  const l = { ...defaultCaseManagementHeaderLabels, ...labels };
12362
- const [internalExpanded, setInternalExpanded] = React13.useState(defaultExpanded);
11838
+ const [internalExpanded, setInternalExpanded] = React12.useState(defaultExpanded);
12363
11839
  const isExpanded = expanded ?? internalExpanded;
12364
- const detailsId = React13.useId();
11840
+ const detailsId = React12.useId();
12365
11841
  const days = caseInfo.daysOpen ?? computeDaysOpen(caseInfo.openedDate);
12366
11842
  const allDetails = days != null ? [...details, { label: l.daysOpenTerm, value: days }] : details;
12367
11843
  const hasDetails = allDetails.length > 0;
@@ -12499,599 +11975,6 @@ var CaseManagementHeader = React13.forwardRef(
12499
11975
  }
12500
11976
  );
12501
11977
  CaseManagementHeader.displayName = "CaseManagementHeader";
12502
- var iconButtonClasses = cn(
12503
- "flex h-8 w-8 shrink-0 items-center justify-center rounded-lg",
12504
- "text-neutral-500 dark:text-neutral-400",
12505
- "transition-colors duration-150",
12506
- "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-700 dark:hover:text-white",
12507
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
12508
- "disabled:pointer-events-none disabled:opacity-40"
12509
- );
12510
- var selectorTriggerClasses = cn(
12511
- "flex min-w-0 items-center gap-1 rounded-md px-2 py-1 text-xs",
12512
- "text-neutral-600 dark:text-neutral-400",
12513
- "transition-colors duration-150",
12514
- "hover:bg-neutral-100 hover:text-neutral-900 dark:hover:bg-neutral-700 dark:hover:text-white",
12515
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500",
12516
- "disabled:pointer-events-none disabled:opacity-40"
12517
- );
12518
- var MAX_INPUT_HEIGHT = 160;
12519
- var ChatComposer = React13.forwardRef(function ChatComposer2({
12520
- onSend,
12521
- value: controlledValue,
12522
- onValueChange,
12523
- placeholder = "Type a message\u2026",
12524
- disabled = false,
12525
- isSending = false,
12526
- autoFocus = false,
12527
- maxLength,
12528
- showCharacterCount = false,
12529
- canSendWhenEmpty = false,
12530
- maxHeight = MAX_INPUT_HEIGHT,
12531
- textareaProps,
12532
- addMenuItems,
12533
- allowAttachments = true,
12534
- acceptedFileTypes,
12535
- maxFileSize,
12536
- maxAttachments = 10,
12537
- mentionOptions,
12538
- showMic = false,
12539
- onMicClick,
12540
- micSlot,
12541
- micBehavior = "always",
12542
- isStreaming = false,
12543
- onStop,
12544
- showAgentSelector = false,
12545
- agents = [],
12546
- selectedAgent = null,
12547
- onAgentChange,
12548
- showModelSelector = false,
12549
- modelSelectorProps,
12550
- readOnly = false,
12551
- readOnlyMessage = "You have read-only access and cannot send messages.",
12552
- onError,
12553
- attachmentLimitLabel,
12554
- sendFailedLabel = "Failed to send message",
12555
- sendingLabel = "Sending message\u2026",
12556
- inputLabel = "Message input",
12557
- addMenuLabel = "Add to message",
12558
- attachFilesLabel = "Attach files",
12559
- micLabel = "Start voice input",
12560
- sendLabel = "Send message",
12561
- stopLabel = "Stop generating",
12562
- agentSelectorLabel = "Select agent",
12563
- mentionListLabel = "Mention",
12564
- dropFilesLabel = "Drop files here",
12565
- className
12566
- }, ref) {
12567
- const [internalValue, setInternalValue] = React13.useState("");
12568
- const isControlled = controlledValue !== void 0;
12569
- const value = isControlled ? controlledValue : internalValue;
12570
- const [attachments, setAttachments] = React13.useState([]);
12571
- const attachmentsRef = React13.useRef(attachments);
12572
- attachmentsRef.current = attachments;
12573
- const textareaRef = React13.useRef(null);
12574
- const fileInputRef = React13.useRef(null);
12575
- const [addMenuOpen, setAddMenuOpen] = React13.useState(false);
12576
- const [agentMenuOpen, setAgentMenuOpen] = React13.useState(false);
12577
- const hasText = value.trim().length > 0;
12578
- const hasContent = hasText || attachments.length > 0;
12579
- const isOverLimit = maxLength !== void 0 && value.length > maxLength;
12580
- const canSend = (hasContent || canSendWhenEmpty) && onSend !== void 0 && !disabled && !isSending && !isStreaming && !isOverLimit;
12581
- const setValue = React13.useCallback(
12582
- (next) => {
12583
- if (!isControlled) setInternalValue(next);
12584
- onValueChange?.(next);
12585
- },
12586
- [isControlled, onValueChange]
12587
- );
12588
- const mention = useMentionAutocomplete({
12589
- options: mentionOptions,
12590
- value,
12591
- setValue,
12592
- textareaRef
12593
- });
12594
- const resizeTextarea = React13.useCallback(() => {
12595
- const textarea = textareaRef.current;
12596
- if (!textarea) return;
12597
- textarea.style.height = "auto";
12598
- if (textarea.scrollHeight === 0) return;
12599
- textarea.style.height = `${textarea.scrollHeight}px`;
12600
- }, []);
12601
- React13.useLayoutEffect(resizeTextarea, [resizeTextarea, value]);
12602
- React13.useEffect(() => {
12603
- const textarea = textareaRef.current;
12604
- if (!textarea || typeof ResizeObserver === "undefined") return;
12605
- let frame = 0;
12606
- const observer = new ResizeObserver(() => {
12607
- cancelAnimationFrame(frame);
12608
- frame = requestAnimationFrame(resizeTextarea);
12609
- });
12610
- observer.observe(textarea);
12611
- return () => {
12612
- cancelAnimationFrame(frame);
12613
- observer.disconnect();
12614
- };
12615
- }, [resizeTextarea]);
12616
- const addFiles = React13.useCallback(
12617
- (files) => {
12618
- if (!allowAttachments || files.length === 0) return;
12619
- const limitMessage = attachmentLimitLabel ?? `Attachment limit reached (max ${maxAttachments})`;
12620
- const room = maxAttachments - attachmentsRef.current.length;
12621
- if (files.length > room) {
12622
- onError?.(limitMessage, { reason: "attachment-limit" });
12623
- if (room <= 0) return;
12624
- }
12625
- const staged = [];
12626
- for (const file of files.slice(0, Math.max(room, 0))) {
12627
- const typeCheck = validateFile(file, acceptedFileTypes, void 0);
12628
- if (!typeCheck.valid) {
12629
- onError?.(`${file.name}: ${typeCheck.error}`, {
12630
- reason: "file-type",
12631
- file
12632
- });
12633
- continue;
12634
- }
12635
- const sizeCheck = validateFile(file, void 0, maxFileSize);
12636
- if (!sizeCheck.valid) {
12637
- onError?.(`${file.name}: ${sizeCheck.error}`, {
12638
- reason: "file-size",
12639
- file
12640
- });
12641
- continue;
12642
- }
12643
- const type = getFileType(file.type);
12644
- staged.push({
12645
- id: generateAttachmentId(),
12646
- file,
12647
- type,
12648
- previewUrl: type === "image" || type === "video" ? URL.createObjectURL(file) : void 0
12649
- });
12650
- }
12651
- if (staged.length > 0) {
12652
- attachmentsRef.current = [...attachmentsRef.current, ...staged];
12653
- setAttachments((current) => [...current, ...staged]);
12654
- }
12655
- },
12656
- [
12657
- allowAttachments,
12658
- maxAttachments,
12659
- acceptedFileTypes,
12660
- maxFileSize,
12661
- onError,
12662
- attachmentLimitLabel
12663
- ]
12664
- );
12665
- const removeAttachment = React13.useCallback((id) => {
12666
- const target = attachmentsRef.current.find(
12667
- (attachment) => attachment.id === id
12668
- );
12669
- if (target?.previewUrl) URL.revokeObjectURL(target.previewUrl);
12670
- attachmentsRef.current = attachmentsRef.current.filter(
12671
- (attachment) => attachment.id !== id
12672
- );
12673
- setAttachments(
12674
- (current) => current.filter((attachment) => attachment.id !== id)
12675
- );
12676
- }, []);
12677
- React13.useEffect(() => {
12678
- return () => {
12679
- for (const attachment of attachmentsRef.current) {
12680
- if (attachment.previewUrl) URL.revokeObjectURL(attachment.previewUrl);
12681
- }
12682
- };
12683
- }, []);
12684
- const handleFileInputChange = (event) => {
12685
- const files = Array.from(event.target.files ?? []);
12686
- addFiles(files);
12687
- event.target.value = "";
12688
- };
12689
- const handlePaste = (event) => {
12690
- if (!allowAttachments) return;
12691
- const files = Array.from(event.clipboardData.files);
12692
- if (files.length > 0) {
12693
- event.preventDefault();
12694
- addFiles(files);
12695
- }
12696
- };
12697
- React13.useImperativeHandle(
12698
- ref,
12699
- () => ({
12700
- addFiles,
12701
- focus: () => textareaRef.current?.focus(),
12702
- getTextarea: () => textareaRef.current
12703
- }),
12704
- [addFiles]
12705
- );
12706
- const handleSend = () => {
12707
- if (!canSend || !onSend) return;
12708
- const message = {
12709
- content: value.trim(),
12710
- attachments: attachments.map((attachment) => attachment.file)
12711
- };
12712
- for (const attachment of attachments) {
12713
- if (attachment.previewUrl) URL.revokeObjectURL(attachment.previewUrl);
12714
- }
12715
- attachmentsRef.current = [];
12716
- setAttachments([]);
12717
- setValue("");
12718
- try {
12719
- Promise.resolve(onSend(message)).catch(() => {
12720
- onError?.(sendFailedLabel, { reason: "send-failed" });
12721
- });
12722
- } catch {
12723
- onError?.(sendFailedLabel, { reason: "send-failed" });
12724
- }
12725
- textareaRef.current?.focus();
12726
- };
12727
- const handleKeyDown = (event) => {
12728
- if (mention.handleKeyDown(event)) return;
12729
- if (event.key === "Enter" && !event.shiftKey) {
12730
- event.preventDefault();
12731
- handleSend();
12732
- }
12733
- };
12734
- if (readOnly) {
12735
- return /* @__PURE__ */ jsxs(
12736
- "div",
12737
- {
12738
- "data-slot": "chat-composer",
12739
- role: "status",
12740
- className: cn(
12741
- "flex items-center gap-2 rounded-xl border px-4 py-3 text-sm",
12742
- "border-amber-300 bg-amber-50 text-amber-900",
12743
- "dark:border-amber-700 dark:bg-amber-950 dark:text-amber-200",
12744
- className
12745
- ),
12746
- children: [
12747
- /* @__PURE__ */ jsx(AlertTriangle, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }),
12748
- /* @__PURE__ */ jsx("span", { "data-slot": "chat-composer-readonly", children: readOnlyMessage })
12749
- ]
12750
- }
12751
- );
12752
- }
12753
- const showAddMenu = allowAttachments || addMenuItems && addMenuItems.length > 0;
12754
- const micVisible = (showMic || onMicClick !== void 0 || micSlot !== void 0) && (micBehavior === "always" || !hasContent);
12755
- const showSelectorRow = showAgentSelector || showModelSelector;
12756
- const selectedAgentOption = agents.find((agent) => agent.id === selectedAgent) ?? null;
12757
- const cells = {
12758
- input: "col-span-3 col-start-1 row-start-1 px-1 pt-1 md:col-span-1 md:col-start-2 md:self-end md:px-0 md:py-1.5",
12759
- textarea: "px-2 pt-2 pb-1 md:py-1.5",
12760
- add: "col-start-1 row-start-2 pb-2 ps-2 md:row-start-1 md:self-end md:p-1.5 md:pe-0.5",
12761
- actions: "col-start-3 row-start-2 flex items-center gap-1 pb-2 pe-2 md:row-start-1 md:self-end md:gap-0.5 md:p-1.5 md:ps-0.5"
12762
- };
12763
- const composerCard = /* @__PURE__ */ jsxs(Fragment, { children: [
12764
- attachments.length > 0 && /* @__PURE__ */ jsx(
12765
- "div",
12766
- {
12767
- "data-slot": "chat-composer-attachments",
12768
- className: "flex flex-wrap gap-2 px-3 pt-3",
12769
- children: attachments.map((attachment) => /* @__PURE__ */ jsx(
12770
- AttachmentPreviewItem,
12771
- {
12772
- attachment: { ...attachment, state: "pending" },
12773
- onRemove: () => removeAttachment(attachment.id),
12774
- disabled
12775
- },
12776
- attachment.id
12777
- ))
12778
- }
12779
- ),
12780
- /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-[auto_minmax(0,1fr)_auto]", children: [
12781
- /* @__PURE__ */ jsxs("div", { className: cells.input, ref: mention.anchorRef, children: [
12782
- /* @__PURE__ */ jsx(
12783
- MentionMenu,
12784
- {
12785
- mention,
12786
- label: mentionListLabel,
12787
- dataSlot: "chat-composer-mention-list"
12788
- }
12789
- ),
12790
- /* @__PURE__ */ jsx(
12791
- "textarea",
12792
- {
12793
- ...textareaProps,
12794
- ref: textareaRef,
12795
- "data-slot": "chat-composer-input",
12796
- value,
12797
- onChange: (event) => {
12798
- textareaProps?.onChange?.(event);
12799
- setValue(event.target.value);
12800
- mention.sync(
12801
- event.target.value,
12802
- event.target.selectionStart ?? event.target.value.length
12803
- );
12804
- },
12805
- onKeyDown: (event) => {
12806
- textareaProps?.onKeyDown?.(event);
12807
- if (event.defaultPrevented) return;
12808
- handleKeyDown(event);
12809
- },
12810
- onClick: (event) => {
12811
- textareaProps?.onClick?.(event);
12812
- if (event.defaultPrevented) return;
12813
- const el = event.currentTarget;
12814
- mention.sync(el.value, el.selectionStart ?? el.value.length);
12815
- },
12816
- onPaste: (event) => {
12817
- textareaProps?.onPaste?.(event);
12818
- if (event.defaultPrevented) return;
12819
- handlePaste(event);
12820
- },
12821
- placeholder,
12822
- disabled,
12823
- autoFocus,
12824
- rows: 1,
12825
- "aria-label": inputLabel,
12826
- ...mention.inputProps,
12827
- style: {
12828
- ...textareaProps?.style,
12829
- maxHeight: typeof maxHeight === "number" ? `${maxHeight}px` : maxHeight
12830
- },
12831
- className: cn(
12832
- "block w-full resize-none bg-transparent",
12833
- "rounded-lg text-sm",
12834
- cells.textarea,
12835
- "text-neutral-900 placeholder:text-neutral-400 dark:text-white dark:placeholder:text-neutral-500",
12836
- // Ring the input itself on focus rather than the whole shell.
12837
- "focus:ring-primary-500 focus:ring-1 focus:outline-none",
12838
- "disabled:cursor-not-allowed",
12839
- textareaProps?.className
12840
- )
12841
- }
12842
- )
12843
- ] }),
12844
- showAddMenu && /* @__PURE__ */ jsx("div", { className: cells.add, children: /* @__PURE__ */ jsxs(
12845
- Dropdown,
12846
- {
12847
- placement: "top-start",
12848
- open: addMenuOpen,
12849
- onOpenChange: setAddMenuOpen,
12850
- trigger: /* @__PURE__ */ jsx(
12851
- "button",
12852
- {
12853
- type: "button",
12854
- "data-slot": "chat-composer-add-button",
12855
- "aria-label": addMenuLabel,
12856
- disabled,
12857
- className: iconButtonClasses,
12858
- children: /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4", "aria-hidden": "true" })
12859
- }
12860
- ),
12861
- children: [
12862
- allowAttachments && /* @__PURE__ */ jsx(
12863
- DropdownItem,
12864
- {
12865
- icon: /* @__PURE__ */ jsx(Paperclip, { className: "h-4 w-4", "aria-hidden": "true" }),
12866
- onClick: () => {
12867
- setAddMenuOpen(false);
12868
- fileInputRef.current?.click();
12869
- },
12870
- children: attachFilesLabel
12871
- }
12872
- ),
12873
- allowAttachments && addMenuItems && addMenuItems.length > 0 && /* @__PURE__ */ jsx(DropdownSeparator, {}),
12874
- addMenuItems?.map((item) => /* @__PURE__ */ jsx(
12875
- DropdownItem,
12876
- {
12877
- icon: item.icon,
12878
- disabled: item.disabled,
12879
- variant: item.variant,
12880
- checked: item.checked,
12881
- onClick: () => {
12882
- setAddMenuOpen(false);
12883
- item.onSelect?.();
12884
- },
12885
- children: /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: item.label })
12886
- },
12887
- item.id
12888
- ))
12889
- ]
12890
- }
12891
- ) }),
12892
- allowAttachments && /* @__PURE__ */ jsx(
12893
- "input",
12894
- {
12895
- ref: fileInputRef,
12896
- type: "file",
12897
- multiple: true,
12898
- accept: acceptedFileTypes?.join(","),
12899
- onChange: handleFileInputChange,
12900
- className: "hidden",
12901
- "aria-hidden": "true",
12902
- tabIndex: -1
12903
- }
12904
- ),
12905
- /* @__PURE__ */ jsxs("div", { className: cells.actions, children: [
12906
- showCharacterCount && maxLength !== void 0 && /* @__PURE__ */ jsxs(
12907
- "span",
12908
- {
12909
- "data-slot": "chat-composer-char-count",
12910
- "aria-live": "polite",
12911
- className: cn(
12912
- "pe-1 text-xs tabular-nums",
12913
- isOverLimit ? "font-medium text-red-700 dark:text-red-400" : "text-neutral-500 dark:text-neutral-400"
12914
- ),
12915
- children: [
12916
- value.length,
12917
- "/",
12918
- maxLength
12919
- ]
12920
- }
12921
- ),
12922
- micVisible && (micSlot != null ? (
12923
- // Normalize slot content (e.g. a RecordButton) to the 32px
12924
- // control row: taller content overflow-centers instead of
12925
- // inflating the pill and pushing the other cells apart. A div
12926
- // so block-level slot content stays valid HTML.
12927
- /* @__PURE__ */ jsx(
12928
- "div",
12929
- {
12930
- "data-slot": "chat-composer-mic-slot",
12931
- className: "flex h-8 shrink-0 items-center",
12932
- children: micSlot
12933
- }
12934
- )
12935
- ) : /* @__PURE__ */ jsx(
12936
- "button",
12937
- {
12938
- type: "button",
12939
- "data-slot": "chat-composer-mic-button",
12940
- "aria-label": micLabel,
12941
- disabled,
12942
- onClick: onMicClick,
12943
- className: iconButtonClasses,
12944
- children: /* @__PURE__ */ jsx(Mic, { className: "h-4 w-4", "aria-hidden": "true" })
12945
- }
12946
- )),
12947
- isStreaming && onStop ? /* @__PURE__ */ jsx(
12948
- "button",
12949
- {
12950
- type: "button",
12951
- "data-slot": "chat-composer-stop-button",
12952
- "aria-label": stopLabel,
12953
- disabled,
12954
- onClick: onStop,
12955
- className: cn(
12956
- iconButtonClasses,
12957
- "text-neutral-700 dark:text-neutral-200"
12958
- ),
12959
- children: /* @__PURE__ */ jsx(
12960
- Square,
12961
- {
12962
- className: "h-3.5 w-3.5 fill-current",
12963
- "aria-hidden": "true"
12964
- }
12965
- )
12966
- }
12967
- ) : /* @__PURE__ */ jsx(
12968
- "button",
12969
- {
12970
- type: "button",
12971
- "data-slot": "chat-composer-send-button",
12972
- "aria-label": isSending ? sendingLabel : sendLabel,
12973
- "aria-busy": isSending || void 0,
12974
- disabled: !canSend,
12975
- onClick: handleSend,
12976
- className: cn(
12977
- iconButtonClasses,
12978
- canSend && "bg-primary-800 hover:bg-primary-700 dark:bg-primary-600 dark:hover:bg-primary-500 text-white hover:text-white dark:hover:text-white"
12979
- ),
12980
- children: isSending ? /* @__PURE__ */ jsx(
12981
- Loader2,
12982
- {
12983
- className: "h-4 w-4 animate-spin",
12984
- "aria-hidden": "true"
12985
- }
12986
- ) : /* @__PURE__ */ jsx(ArrowUp, { className: "h-4 w-4", "aria-hidden": "true" })
12987
- }
12988
- )
12989
- ] })
12990
- ] })
12991
- ] });
12992
- const selectorsRow = showSelectorRow && /* @__PURE__ */ jsxs(
12993
- "div",
12994
- {
12995
- "data-slot": "chat-composer-selectors",
12996
- className: "flex items-center justify-between gap-2 px-2 pt-1",
12997
- children: [
12998
- showAgentSelector ? /* @__PURE__ */ jsx(
12999
- Dropdown,
13000
- {
13001
- placement: "top-start",
13002
- open: agentMenuOpen,
13003
- onOpenChange: setAgentMenuOpen,
13004
- trigger: /* @__PURE__ */ jsxs(
13005
- "button",
13006
- {
13007
- type: "button",
13008
- "data-slot": "chat-composer-agent-trigger",
13009
- "aria-label": selectedAgentOption ? `${agentSelectorLabel}: ${selectedAgentOption.label}` : agentSelectorLabel,
13010
- disabled,
13011
- className: selectorTriggerClasses,
13012
- children: [
13013
- selectedAgentOption?.icon ?? /* @__PURE__ */ jsx(Bot, { className: "h-3.5 w-3.5", "aria-hidden": "true" }),
13014
- /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: selectedAgentOption?.label ?? agentSelectorLabel }),
13015
- /* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3 shrink-0", "aria-hidden": "true" })
13016
- ]
13017
- }
13018
- ),
13019
- children: agents.map((agent) => /* @__PURE__ */ jsx(
13020
- DropdownItem,
13021
- {
13022
- icon: agent.icon,
13023
- role: "menuitemradio",
13024
- "aria-checked": agent.id === selectedAgent,
13025
- onClick: () => {
13026
- setAgentMenuOpen(false);
13027
- onAgentChange?.(agent.id);
13028
- },
13029
- children: /* @__PURE__ */ jsxs("span", { className: "flex w-full items-center justify-between gap-2", children: [
13030
- /* @__PURE__ */ jsxs("span", { className: "min-w-0", children: [
13031
- /* @__PURE__ */ jsx("span", { className: "block truncate", children: agent.label }),
13032
- agent.description && /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-neutral-500 dark:text-neutral-400", children: agent.description })
13033
- ] }),
13034
- agent.id === selectedAgent && /* @__PURE__ */ jsx(
13035
- Check,
13036
- {
13037
- className: "text-primary-600 dark:text-primary-400 h-4 w-4 shrink-0",
13038
- "aria-hidden": "true"
13039
- }
13040
- )
13041
- ] })
13042
- },
13043
- agent.id
13044
- ))
13045
- }
13046
- ) : /* @__PURE__ */ jsx("span", { "aria-hidden": "true" }),
13047
- showModelSelector && modelSelectorProps && /* @__PURE__ */ jsx(
13048
- ComposerModelSelector,
13049
- {
13050
- variant: "ghost",
13051
- ...modelSelectorProps,
13052
- disabled: disabled || modelSelectorProps.disabled
13053
- }
13054
- )
13055
- ]
13056
- }
13057
- );
13058
- const card = /* @__PURE__ */ jsx(
13059
- "div",
13060
- {
13061
- "data-slot": "chat-composer-card",
13062
- className: cn(
13063
- "rounded-2xl border border-neutral-200 bg-white shadow-sm",
13064
- "dark:border-[#2e2e30] dark:bg-[#1c1c1e]"
13065
- ),
13066
- children: composerCard
13067
- }
13068
- );
13069
- return /* @__PURE__ */ jsxs(
13070
- "div",
13071
- {
13072
- "data-slot": "chat-composer",
13073
- className: cn(
13074
- "flex w-full flex-col",
13075
- disabled && "opacity-60",
13076
- className
13077
- ),
13078
- children: [
13079
- allowAttachments ? /* @__PURE__ */ jsx(
13080
- DragDropZone,
13081
- {
13082
- onFilesDropped: addFiles,
13083
- maxFiles: Number.MAX_SAFE_INTEGER,
13084
- disabled,
13085
- overlayLabel: dropFilesLabel,
13086
- children: card
13087
- }
13088
- ) : card,
13089
- selectorsRow
13090
- ]
13091
- }
13092
- );
13093
- });
13094
- ChatComposer.displayName = "ChatComposer";
13095
11978
  var MODE_META = {
13096
11979
  add: { title: "Add problem", changeType: void 0 },
13097
11980
  observe: { title: "Progress observation", changeType: void 0 },
@@ -13232,19 +12115,19 @@ function ConditionEditor({
13232
12115
  const prior = concern ? currentAssertion(concern) : void 0;
13233
12116
  const ambientCodeLookup = useCodeLookupConfig();
13234
12117
  const effectiveRenderCodeSearch = renderCodeSearch === false ? void 0 : renderCodeSearch ?? (ambientCodeLookup ? contextConditionCodeSearch(ambientCodeLookup) : void 0);
13235
- const [text, setText] = React13.useState("");
13236
- const [coding, setCoding] = React13.useState([]);
13237
- const [verification, setVerification] = React13.useState("confirmed");
13238
- const [severity, setSeverity] = React13.useState();
13239
- const [onsetDate, setOnsetDate] = React13.useState("");
13240
- const [onsetFuzzy, setOnsetFuzzy] = React13.useState("");
13241
- const [note, setNote] = React13.useState("");
13242
- const [progression, setProgression] = React13.useState(false);
13243
- const [fields, setFields] = React13.useState({});
13244
- const [relType, setRelType] = React13.useState("caused-by");
13245
- const [relTarget, setRelTarget] = React13.useState("");
13246
- const [observation, setObservation] = React13.useState("");
13247
- React13.useEffect(() => {
12118
+ const [text, setText] = React12.useState("");
12119
+ const [coding, setCoding] = React12.useState([]);
12120
+ const [verification, setVerification] = React12.useState("confirmed");
12121
+ const [severity, setSeverity] = React12.useState();
12122
+ const [onsetDate, setOnsetDate] = React12.useState("");
12123
+ const [onsetFuzzy, setOnsetFuzzy] = React12.useState("");
12124
+ const [note, setNote] = React12.useState("");
12125
+ const [progression, setProgression] = React12.useState(false);
12126
+ const [fields, setFields] = React12.useState({});
12127
+ const [relType, setRelType] = React12.useState("caused-by");
12128
+ const [relTarget, setRelTarget] = React12.useState("");
12129
+ const [observation, setObservation] = React12.useState("");
12130
+ React12.useEffect(() => {
13248
12131
  if (!open) return;
13249
12132
  setText(prior?.text ?? "");
13250
12133
  setCoding(prior?.coding ?? []);
@@ -13700,17 +12583,17 @@ function CheckrIntegration({
13700
12583
  viewDetails = "View Details",
13701
12584
  noReportsSelected = "No reports selected"
13702
12585
  } = labels;
13703
- const [showInviteModal, setShowInviteModal] = React13.useState(false);
13704
- const [candidateName, setCandidateName] = React13.useState("");
13705
- const [candidateEmail, setCandidateEmail] = React13.useState("");
13706
- const [candidatePhone, setCandidatePhone] = React13.useState("");
13707
- const [selectedPackage, setSelectedPackage] = React13.useState(
12586
+ const [showInviteModal, setShowInviteModal] = React12.useState(false);
12587
+ const [candidateName, setCandidateName] = React12.useState("");
12588
+ const [candidateEmail, setCandidateEmail] = React12.useState("");
12589
+ const [candidatePhone, setCandidatePhone] = React12.useState("");
12590
+ const [selectedPackage, setSelectedPackage] = React12.useState(
13708
12591
  packages[0]?.id || ""
13709
12592
  );
13710
- const [selectedReports, setSelectedReports] = React13.useState(
12593
+ const [selectedReports, setSelectedReports] = React12.useState(
13711
12594
  /* @__PURE__ */ new Set()
13712
12595
  );
13713
- React13.useEffect(() => {
12596
+ React12.useEffect(() => {
13714
12597
  setSelectedReports((prev) => prev.size > 0 ? /* @__PURE__ */ new Set() : prev);
13715
12598
  }, [reports, connected]);
13716
12599
  const statusLabels = {
@@ -13744,7 +12627,7 @@ function CheckrIntegration({
13744
12627
  failed: "bg-destructive",
13745
12628
  expired: "bg-muted-foreground"
13746
12629
  };
13747
- const statusCounts = React13.useMemo(() => {
12630
+ const statusCounts = React12.useMemo(() => {
13748
12631
  const counts = {
13749
12632
  pending: 0,
13750
12633
  running: 0,
@@ -14283,7 +13166,7 @@ function CommandPaletteProvider({
14283
13166
  }
14284
13167
  }, [isOpen, open, close]);
14285
13168
  useCommandK(toggle, enableShortcut);
14286
- React13__default.useEffect(() => {
13169
+ React12__default.useEffect(() => {
14287
13170
  if (!customEventName) return;
14288
13171
  const handler = () => open();
14289
13172
  document.addEventListener(customEventName, handler);
@@ -15195,11 +14078,11 @@ function formatRetryTime(time) {
15195
14078
  }
15196
14079
  function useConnectionStatus(options = {}) {
15197
14080
  const { onDisconnect, onReconnect } = options;
15198
- const [isOnline, setIsOnline] = React13.useState(() => {
14081
+ const [isOnline, setIsOnline] = React12.useState(() => {
15199
14082
  if (typeof window === "undefined") return true;
15200
14083
  return navigator.onLine;
15201
14084
  });
15202
- React13.useEffect(() => {
14085
+ React12.useEffect(() => {
15203
14086
  const handleOnline = () => {
15204
14087
  setIsOnline(true);
15205
14088
  onReconnect?.();
@@ -15318,12 +14201,12 @@ function RowActionMenu({
15318
14201
  item,
15319
14202
  actions
15320
14203
  }) {
15321
- const [open, setOpen] = React13.useState(false);
15322
- const menuRef = React13.useRef(null);
15323
- const buttonRef = React13.useRef(null);
15324
- const outsideRefs = React13.useMemo(() => [menuRef, buttonRef], []);
14204
+ const [open, setOpen] = React12.useState(false);
14205
+ const menuRef = React12.useRef(null);
14206
+ const buttonRef = React12.useRef(null);
14207
+ const outsideRefs = React12.useMemo(() => [menuRef, buttonRef], []);
15325
14208
  useClickOutside(outsideRefs, () => setOpen(false), open);
15326
- React13.useEffect(() => {
14209
+ React12.useEffect(() => {
15327
14210
  if (!open) return;
15328
14211
  function handleKey(e) {
15329
14212
  if (e.key === "Escape") setOpen(false);
@@ -15331,8 +14214,8 @@ function RowActionMenu({
15331
14214
  document.addEventListener("keydown", handleKey);
15332
14215
  return () => document.removeEventListener("keydown", handleKey);
15333
14216
  }, [open]);
15334
- const [menuPos, setMenuPos] = React13.useState(null);
15335
- React13.useLayoutEffect(() => {
14217
+ const [menuPos, setMenuPos] = React12.useState(null);
14218
+ React12.useLayoutEffect(() => {
15336
14219
  if (!open || !buttonRef.current) return;
15337
14220
  const rect = buttonRef.current.getBoundingClientRect();
15338
14221
  setMenuPos({
@@ -15519,8 +14402,8 @@ function buildDefaultActions(onView, onEdit, onDelete) {
15519
14402
  function ViewModalActions({
15520
14403
  viewTarget
15521
14404
  }) {
15522
- const [shareOpen, setShareOpen] = React13.useState(false);
15523
- const shareRef = React13.useRef(null);
14405
+ const [shareOpen, setShareOpen] = React12.useState(false);
14406
+ const shareRef = React12.useRef(null);
15524
14407
  const {
15525
14408
  anchorRef: shareAnchorRef,
15526
14409
  floatingRef: shareFloatingRef,
@@ -15528,7 +14411,7 @@ function ViewModalActions({
15528
14411
  } = useAnchoredPosition({
15529
14412
  open: shareOpen
15530
14413
  });
15531
- const shareOutsideRefs = React13.useMemo(
14414
+ const shareOutsideRefs = React12.useMemo(
15532
14415
  () => [shareRef, shareFloatingRef],
15533
14416
  [shareFloatingRef]
15534
14417
  );
@@ -15674,7 +14557,7 @@ function ViewModalActions({
15674
14557
  )
15675
14558
  ] });
15676
14559
  }
15677
- var CountBadge = React13.forwardRef(
14560
+ var CountBadge = React12.forwardRef(
15678
14561
  ({
15679
14562
  className,
15680
14563
  variant,
@@ -15691,19 +14574,19 @@ var CountBadge = React13.forwardRef(
15691
14574
  showZero = false,
15692
14575
  ...props
15693
14576
  }, ref) => {
15694
- const [open, setOpen] = React13.useState(false);
15695
- const containerRef = React13.useRef(null);
15696
- const [deleteTarget, setDeleteTarget] = React13.useState(null);
15697
- const [editTarget, setEditTarget] = React13.useState(
14577
+ const [open, setOpen] = React12.useState(false);
14578
+ const containerRef = React12.useRef(null);
14579
+ const [deleteTarget, setDeleteTarget] = React12.useState(null);
14580
+ const [editTarget, setEditTarget] = React12.useState(
15698
14581
  null
15699
14582
  );
15700
- const [editForm, setEditForm] = React13.useState({});
15701
- const [viewTarget, setViewTarget] = React13.useState(
14583
+ const [editForm, setEditForm] = React12.useState({});
14584
+ const [viewTarget, setViewTarget] = React12.useState(
15702
14585
  null
15703
14586
  );
15704
14587
  const showMenu = items && items.length > 0;
15705
14588
  const hidden = count === 0 && !showZero;
15706
- React13.useEffect(() => {
14589
+ React12.useEffect(() => {
15707
14590
  if (hidden) setOpen(false);
15708
14591
  }, [hidden]);
15709
14592
  const {
@@ -15715,12 +14598,12 @@ var CountBadge = React13.forwardRef(
15715
14598
  placement: "bottom-end",
15716
14599
  offset: 8
15717
14600
  });
15718
- const outsideRefs = React13.useMemo(
14601
+ const outsideRefs = React12.useMemo(
15719
14602
  () => [containerRef, floatingRef],
15720
14603
  [floatingRef]
15721
14604
  );
15722
14605
  useClickOutside(outsideRefs, () => setOpen(false), open);
15723
- React13.useEffect(() => {
14606
+ React12.useEffect(() => {
15724
14607
  if (!open) return;
15725
14608
  const handleEscape = (e) => {
15726
14609
  if (e.key === "Escape") setOpen(false);
@@ -15728,13 +14611,13 @@ var CountBadge = React13.forwardRef(
15728
14611
  document.addEventListener("keydown", handleEscape);
15729
14612
  return () => document.removeEventListener("keydown", handleEscape);
15730
14613
  }, [open]);
15731
- const handleDeleteRequest = React13.useCallback((item) => {
14614
+ const handleDeleteRequest = React12.useCallback((item) => {
15732
14615
  setDeleteTarget(item);
15733
14616
  }, []);
15734
- const handleViewRequest = React13.useCallback((item) => {
14617
+ const handleViewRequest = React12.useCallback((item) => {
15735
14618
  setViewTarget(item);
15736
14619
  }, []);
15737
- const handleEditRequest = React13.useCallback((item) => {
14620
+ const handleEditRequest = React12.useCallback((item) => {
15738
14621
  setEditTarget(item);
15739
14622
  setEditForm({
15740
14623
  label: item.label,
@@ -16193,7 +15076,7 @@ function CookieConsentBanner({
16193
15076
  isMobileApp = false,
16194
15077
  className
16195
15078
  }) {
16196
- const [isAnimating, setIsAnimating] = React13.useState(false);
15079
+ const [isAnimating, setIsAnimating] = React12.useState(false);
16197
15080
  const handleAccept = () => {
16198
15081
  setIsAnimating(true);
16199
15082
  setTimeout(() => {
@@ -16252,7 +15135,7 @@ function CookieConsentBanner({
16252
15135
  appName,
16253
15136
  " you are agreeing to our",
16254
15137
  " ",
16255
- legalLinks.map((link, index) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
15138
+ legalLinks.map((link, index) => /* @__PURE__ */ jsxs(React12.Fragment, { children: [
16256
15139
  index > 0 && (index === legalLinks.length - 1 ? " and " : ", "),
16257
15140
  /* @__PURE__ */ jsx(
16258
15141
  "a",
@@ -16376,20 +15259,20 @@ function CompactCookieBanner({
16376
15259
  var COOKIE_CONSENT_KEY = "cookie-consent-accepted";
16377
15260
  function useCookieConsent(options = {}) {
16378
15261
  const { storageKey = COOKIE_CONSENT_KEY, onConsent } = options;
16379
- const [hasConsented, setHasConsented] = React13.useState(() => {
15262
+ const [hasConsented, setHasConsented] = React12.useState(() => {
16380
15263
  if (typeof window === "undefined") return false;
16381
15264
  return localStorage.getItem(storageKey) === "true";
16382
15265
  });
16383
- const acceptCookies = React13.useCallback(() => {
15266
+ const acceptCookies = React12.useCallback(() => {
16384
15267
  localStorage.setItem(storageKey, "true");
16385
15268
  setHasConsented(true);
16386
15269
  onConsent?.();
16387
15270
  }, [storageKey, onConsent]);
16388
- const declineCookies = React13.useCallback(() => {
15271
+ const declineCookies = React12.useCallback(() => {
16389
15272
  localStorage.setItem(storageKey, "declined");
16390
15273
  setHasConsented(true);
16391
15274
  }, [storageKey]);
16392
- const resetConsent = React13.useCallback(() => {
15275
+ const resetConsent = React12.useCallback(() => {
16393
15276
  localStorage.removeItem(storageKey);
16394
15277
  setHasConsented(false);
16395
15278
  }, [storageKey]);
@@ -16776,9 +15659,9 @@ function CSVFileUpload({
16776
15659
  selectFile = "Select a file to upload or drag and drop",
16777
15660
  selectButton = "Select File to Upload"
16778
15661
  } = labels;
16779
- const inputRef = React13.useRef(null);
16780
- const [isDragging, setIsDragging] = React13.useState(false);
16781
- const handleDrop = React13.useCallback(
15662
+ const inputRef = React12.useRef(null);
15663
+ const [isDragging, setIsDragging] = React12.useState(false);
15664
+ const handleDrop = React12.useCallback(
16782
15665
  (e) => {
16783
15666
  e.preventDefault();
16784
15667
  setIsDragging(false);
@@ -16789,14 +15672,14 @@ function CSVFileUpload({
16789
15672
  },
16790
15673
  [onFileSelect]
16791
15674
  );
16792
- const handleDragOver = React13.useCallback((e) => {
15675
+ const handleDragOver = React12.useCallback((e) => {
16793
15676
  e.preventDefault();
16794
15677
  setIsDragging(true);
16795
15678
  }, []);
16796
- const handleDragLeave = React13.useCallback(() => {
15679
+ const handleDragLeave = React12.useCallback(() => {
16797
15680
  setIsDragging(false);
16798
15681
  }, []);
16799
- const handleFileChange = React13.useCallback(
15682
+ const handleFileChange = React12.useCallback(
16800
15683
  (e) => {
16801
15684
  const file = e.target.files?.[0];
16802
15685
  if (file) {
@@ -16861,7 +15744,7 @@ var widgetVariants = cva("", {
16861
15744
  size: "md"
16862
15745
  }
16863
15746
  });
16864
- var DashboardWidget = React13.forwardRef(
15747
+ var DashboardWidget = React12.forwardRef(
16865
15748
  ({
16866
15749
  className,
16867
15750
  size,
@@ -16956,7 +15839,7 @@ var DashboardWidget = React13.forwardRef(
16956
15839
  }
16957
15840
  );
16958
15841
  DashboardWidget.displayName = "DashboardWidget";
16959
- var DashboardWidgetInfo = React13.forwardRef(({ className, items, columns = 2, layout = "stacked", ...props }, ref) => {
15842
+ var DashboardWidgetInfo = React12.forwardRef(({ className, items, columns = 2, layout = "stacked", ...props }, ref) => {
16960
15843
  const gridCols = {
16961
15844
  1: "grid-cols-1",
16962
15845
  2: "grid-cols-2",
@@ -17090,10 +15973,10 @@ function WidgetRowActionMenu({
17090
15973
  rowIndex,
17091
15974
  actions
17092
15975
  }) {
17093
- const [open, setOpen] = React13.useState(false);
17094
- const menuRef = React13.useRef(null);
17095
- const buttonRef = React13.useRef(null);
17096
- React13.useEffect(() => {
15976
+ const [open, setOpen] = React12.useState(false);
15977
+ const menuRef = React12.useRef(null);
15978
+ const buttonRef = React12.useRef(null);
15979
+ React12.useEffect(() => {
17097
15980
  if (!open) return;
17098
15981
  function handleClick(e) {
17099
15982
  if (menuRef.current && !menuRef.current.contains(e.target) && buttonRef.current && !buttonRef.current.contains(e.target)) {
@@ -17103,7 +15986,7 @@ function WidgetRowActionMenu({
17103
15986
  document.addEventListener("mousedown", handleClick);
17104
15987
  return () => document.removeEventListener("mousedown", handleClick);
17105
15988
  }, [open]);
17106
- React13.useEffect(() => {
15989
+ React12.useEffect(() => {
17107
15990
  if (!open) return;
17108
15991
  function handleKey(e) {
17109
15992
  if (e.key === "Escape") setOpen(false);
@@ -17111,8 +15994,8 @@ function WidgetRowActionMenu({
17111
15994
  document.addEventListener("keydown", handleKey);
17112
15995
  return () => document.removeEventListener("keydown", handleKey);
17113
15996
  }, [open]);
17114
- const [menuPos, setMenuPos] = React13.useState(null);
17115
- React13.useLayoutEffect(() => {
15997
+ const [menuPos, setMenuPos] = React12.useState(null);
15998
+ React12.useLayoutEffect(() => {
17116
15999
  if (!open || !buttonRef.current) return;
17117
16000
  const rect = buttonRef.current.getBoundingClientRect();
17118
16001
  setMenuPos({
@@ -17193,7 +16076,7 @@ function WidgetRowActionMenu({
17193
16076
  )
17194
16077
  ] });
17195
16078
  }
17196
- var DashboardWidgetTable = React13.forwardRef(DashboardWidgetTableInner);
16079
+ var DashboardWidgetTable = React12.forwardRef(DashboardWidgetTableInner);
17197
16080
  var actionColorMap = {
17198
16081
  primary: "bg-primary-100 text-primary-900 dark:bg-primary-900/40 dark:text-primary-300",
17199
16082
  green: "bg-emerald-100 text-emerald-700 dark:bg-emerald-900/40 dark:text-emerald-300",
@@ -17204,7 +16087,7 @@ var actionColorMap = {
17204
16087
  amber: "bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",
17205
16088
  neutral: "bg-neutral-100 text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300"
17206
16089
  };
17207
- var DashboardWidgetActions = React13.forwardRef(({ className, actions, columns = 2, ...props }, ref) => {
16090
+ var DashboardWidgetActions = React12.forwardRef(({ className, actions, columns = 2, ...props }, ref) => {
17208
16091
  const gridCols = {
17209
16092
  1: "grid-cols-1",
17210
16093
  2: "grid-cols-2",
@@ -17257,7 +16140,7 @@ var DashboardWidgetActions = React13.forwardRef(({ className, actions, columns =
17257
16140
  );
17258
16141
  });
17259
16142
  DashboardWidgetActions.displayName = "DashboardWidgetActions";
17260
- var DashboardWidgetDataCards = React13.forwardRef(({ className, items, columns = 2, footer, ...props }, ref) => {
16143
+ var DashboardWidgetDataCards = React12.forwardRef(({ className, items, columns = 2, footer, ...props }, ref) => {
17261
16144
  const gridCols = {
17262
16145
  2: "grid-cols-2",
17263
16146
  3: "grid-cols-3",
@@ -17459,24 +16342,24 @@ function DateRangePicker({
17459
16342
  labels = {}
17460
16343
  }) {
17461
16344
  const finalPresets = presets || getDefaultPresets(labels);
17462
- const [isCalendarOpen, setIsCalendarOpen] = React13.useState(false);
17463
- const [leftMonth, setLeftMonth] = React13.useState(
16345
+ const [isCalendarOpen, setIsCalendarOpen] = React12.useState(false);
16346
+ const [leftMonth, setLeftMonth] = React12.useState(
17464
16347
  () => value?.start?.getMonth() ?? (/* @__PURE__ */ new Date()).getMonth()
17465
16348
  );
17466
- const [leftYear, setLeftYear] = React13.useState(
16349
+ const [leftYear, setLeftYear] = React12.useState(
17467
16350
  () => value?.start?.getFullYear() ?? (/* @__PURE__ */ new Date()).getFullYear()
17468
16351
  );
17469
- const [rangeStart, setRangeStart] = React13.useState(
16352
+ const [rangeStart, setRangeStart] = React12.useState(
17470
16353
  value?.start ?? null
17471
16354
  );
17472
- const [rangeEnd, setRangeEnd] = React13.useState(
16355
+ const [rangeEnd, setRangeEnd] = React12.useState(
17473
16356
  value?.end ?? null
17474
16357
  );
17475
- const [selectingEnd, setSelectingEnd] = React13.useState(false);
17476
- const [hoverDate, setHoverDate] = React13.useState(null);
17477
- const calendarRef = React13.useRef(null);
17478
- const triggerRef = React13.useRef(null);
17479
- const [resolvedAlign, setResolvedAlign] = React13.useState(
16358
+ const [selectingEnd, setSelectingEnd] = React12.useState(false);
16359
+ const [hoverDate, setHoverDate] = React12.useState(null);
16360
+ const calendarRef = React12.useRef(null);
16361
+ const triggerRef = React12.useRef(null);
16362
+ const [resolvedAlign, setResolvedAlign] = React12.useState(
17480
16363
  align === "end" ? "end" : "start"
17481
16364
  );
17482
16365
  const isMobileVariant = variant === "mobile";
@@ -17486,7 +16369,7 @@ function DateRangePicker({
17486
16369
  );
17487
16370
  const rightMonth = leftMonth === 11 ? 0 : leftMonth + 1;
17488
16371
  const rightYear = leftMonth === 11 ? leftYear + 1 : leftYear;
17489
- React13.useEffect(() => {
16372
+ React12.useEffect(() => {
17490
16373
  if (!value) {
17491
16374
  setRangeStart(null);
17492
16375
  setRangeEnd(null);
@@ -17495,8 +16378,8 @@ function DateRangePicker({
17495
16378
  setRangeStart(value.start ?? null);
17496
16379
  setRangeEnd(value.end ?? null);
17497
16380
  }, [value]);
17498
- const wrapperRef = React13.useRef(null);
17499
- const outsideRefs = React13.useMemo(
16381
+ const wrapperRef = React12.useRef(null);
16382
+ const outsideRefs = React12.useMemo(
17500
16383
  () => [wrapperRef, calendarRef],
17501
16384
  [calendarRef]
17502
16385
  );
@@ -17517,7 +16400,7 @@ function DateRangePicker({
17517
16400
  setSelectingEnd(false);
17518
16401
  triggerRef.current?.focus();
17519
16402
  }, isCalendarOpen);
17520
- React13.useEffect(() => {
16403
+ React12.useEffect(() => {
17521
16404
  if (isStorybookDocsMode()) return;
17522
16405
  if (isMobileVariant && isCalendarOpen) {
17523
16406
  const prev = document.body.style.overflow;
@@ -17527,7 +16410,7 @@ function DateRangePicker({
17527
16410
  };
17528
16411
  }
17529
16412
  }, [isMobileVariant, isCalendarOpen]);
17530
- React13.useLayoutEffect(() => {
16413
+ React12.useLayoutEffect(() => {
17531
16414
  if (isMobileVariant || !isCalendarOpen) return;
17532
16415
  if (align === "start" || align === "end") {
17533
16416
  setResolvedAlign(align);
@@ -17632,7 +16515,7 @@ function DateRangePicker({
17632
16515
  return isSameDay(date, today);
17633
16516
  };
17634
16517
  const displayValue = value ? formatDateRange(value) : "";
17635
- const monthNames = React13.useMemo(
16518
+ const monthNames = React12.useMemo(
17636
16519
  () => Array.from(
17637
16520
  { length: 12 },
17638
16521
  (_, i) => new Intl.DateTimeFormat(void 0, { month: "long" }).format(
@@ -17641,7 +16524,7 @@ function DateRangePicker({
17641
16524
  ),
17642
16525
  []
17643
16526
  );
17644
- const weekdayNames = React13.useMemo(
16527
+ const weekdayNames = React12.useMemo(
17645
16528
  () => Array.from(
17646
16529
  { length: 7 },
17647
16530
  (_, i) => new Intl.DateTimeFormat(void 0, { weekday: "short" }).format(
@@ -17845,7 +16728,7 @@ function DateRangePicker({
17845
16728
  className: "hover:bg-muted rounded-md p-1 transition-colors",
17846
16729
  "aria-label": "Next month",
17847
16730
  "data-slot": "date-range-nav",
17848
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 rtl:-scale-x-100" })
16731
+ children: /* @__PURE__ */ jsx(ChevronRight$1, { className: "h-4 w-4 rtl:-scale-x-100" })
17849
16732
  }
17850
16733
  )
17851
16734
  ]
@@ -17976,7 +16859,7 @@ function DateRangePicker({
17976
16859
  className: "hover:bg-muted rounded-md p-1 transition-colors md:hidden",
17977
16860
  "aria-label": "Next month",
17978
16861
  "data-slot": "date-range-nav",
17979
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 rtl:-scale-x-100" })
16862
+ children: /* @__PURE__ */ jsx(ChevronRight$1, { className: "h-4 w-4 rtl:-scale-x-100" })
17980
16863
  }
17981
16864
  )
17982
16865
  ]
@@ -18011,7 +16894,7 @@ function DateRangePicker({
18011
16894
  className: "hover:bg-muted rounded-md p-1 transition-colors",
18012
16895
  "aria-label": "Next month",
18013
16896
  "data-slot": "date-range-nav",
18014
- children: /* @__PURE__ */ jsx(ChevronRight, { className: "h-4 w-4 rtl:-scale-x-100" })
16897
+ children: /* @__PURE__ */ jsx(ChevronRight$1, { className: "h-4 w-4 rtl:-scale-x-100" })
18015
16898
  }
18016
16899
  )
18017
16900
  ]
@@ -18079,11 +16962,11 @@ function DropZone({
18079
16962
  className,
18080
16963
  children
18081
16964
  }) {
18082
- const [isDragging, setIsDragging] = React13.useState(false);
18083
- const inputRef = React13.useRef(null);
18084
- const dropZoneRef = React13.useRef(null);
18085
- const dragCounter = React13.useRef(0);
18086
- const handleDragEnter = React13.useCallback(
16965
+ const [isDragging, setIsDragging] = React12.useState(false);
16966
+ const inputRef = React12.useRef(null);
16967
+ const dropZoneRef = React12.useRef(null);
16968
+ const dragCounter = React12.useRef(0);
16969
+ const handleDragEnter = React12.useCallback(
18087
16970
  (e) => {
18088
16971
  e.preventDefault();
18089
16972
  e.stopPropagation();
@@ -18095,7 +16978,7 @@ function DropZone({
18095
16978
  },
18096
16979
  [disabled]
18097
16980
  );
18098
- const handleDragLeave = React13.useCallback(
16981
+ const handleDragLeave = React12.useCallback(
18099
16982
  (e) => {
18100
16983
  e.preventDefault();
18101
16984
  e.stopPropagation();
@@ -18107,11 +16990,11 @@ function DropZone({
18107
16990
  },
18108
16991
  [disabled]
18109
16992
  );
18110
- const handleDragOver = React13.useCallback((e) => {
16993
+ const handleDragOver = React12.useCallback((e) => {
18111
16994
  e.preventDefault();
18112
16995
  e.stopPropagation();
18113
16996
  }, []);
18114
- const handleDrop = React13.useCallback(
16997
+ const handleDrop = React12.useCallback(
18115
16998
  (e) => {
18116
16999
  e.preventDefault();
18117
17000
  e.stopPropagation();
@@ -18124,12 +17007,12 @@ function DropZone({
18124
17007
  },
18125
17008
  [disabled, onFilesSelected]
18126
17009
  );
18127
- const handleClick = React13.useCallback(() => {
17010
+ const handleClick = React12.useCallback(() => {
18128
17011
  if (!disabled) {
18129
17012
  inputRef.current?.click();
18130
17013
  }
18131
17014
  }, [disabled]);
18132
- const handleKeyDown = React13.useCallback(
17015
+ const handleKeyDown = React12.useCallback(
18133
17016
  (e) => {
18134
17017
  if ((e.key === "Enter" || e.key === " ") && !disabled) {
18135
17018
  e.preventDefault();
@@ -18138,7 +17021,7 @@ function DropZone({
18138
17021
  },
18139
17022
  [disabled]
18140
17023
  );
18141
- const handleInputChange = React13.useCallback(
17024
+ const handleInputChange = React12.useCallback(
18142
17025
  (e) => {
18143
17026
  if (e.target.files && e.target.files.length > 0) {
18144
17027
  onFilesSelected(e.target.files);
@@ -18229,7 +17112,7 @@ DropZone.displayName = "DropZone";
18229
17112
  function FilePreviewItem({ file, onRemove, disabled }) {
18230
17113
  const isPdf = file.file.type === "application/pdf";
18231
17114
  const isImage = file.file.type.startsWith("image/");
18232
- const handleRemove = React13.useCallback(() => {
17115
+ const handleRemove = React12.useCallback(() => {
18233
17116
  onRemove(file.id);
18234
17117
  }, [file.id, onRemove]);
18235
17118
  return /* @__PURE__ */ jsxs(
@@ -18375,24 +17258,24 @@ function useCamera({
18375
17258
  width = 1920,
18376
17259
  height = 1080
18377
17260
  } = {}) {
18378
- const [permission, setPermission] = React13.useState("prompt");
18379
- const [stream, setStream] = React13.useState(null);
18380
- const [isReady, setIsReady] = React13.useState(false);
18381
- const [error, setError] = React13.useState(null);
18382
- const [currentFacingMode, setCurrentFacingMode] = React13.useState(initialFacingMode);
18383
- const videoRef = React13.useRef(null);
18384
- const canvasRef = React13.useRef(null);
18385
- React13.useEffect(() => {
17261
+ const [permission, setPermission] = React12.useState("prompt");
17262
+ const [stream, setStream] = React12.useState(null);
17263
+ const [isReady, setIsReady] = React12.useState(false);
17264
+ const [error, setError] = React12.useState(null);
17265
+ const [currentFacingMode, setCurrentFacingMode] = React12.useState(initialFacingMode);
17266
+ const videoRef = React12.useRef(null);
17267
+ const canvasRef = React12.useRef(null);
17268
+ React12.useEffect(() => {
18386
17269
  checkCameraPermission().then(setPermission);
18387
17270
  }, []);
18388
- React13.useEffect(() => {
17271
+ React12.useEffect(() => {
18389
17272
  return () => {
18390
17273
  if (stream) {
18391
17274
  stream.getTracks().forEach((track) => track.stop());
18392
17275
  }
18393
17276
  };
18394
17277
  }, [stream]);
18395
- const startCamera = React13.useCallback(async () => {
17278
+ const startCamera = React12.useCallback(async () => {
18396
17279
  if (!hasCameraSupport()) {
18397
17280
  setPermission("unavailable");
18398
17281
  setError(new Error("Camera is not supported on this device"));
@@ -18426,7 +17309,7 @@ function useCamera({
18426
17309
  }
18427
17310
  }
18428
17311
  }, [currentFacingMode, width, height]);
18429
- const stopCamera = React13.useCallback(() => {
17312
+ const stopCamera = React12.useCallback(() => {
18430
17313
  if (stream) {
18431
17314
  stream.getTracks().forEach((track) => track.stop());
18432
17315
  setStream(null);
@@ -18436,8 +17319,8 @@ function useCamera({
18436
17319
  videoRef.current.srcObject = null;
18437
17320
  }
18438
17321
  }, [stream]);
18439
- const shouldRestartRef = React13.useRef(false);
18440
- const switchCamera = React13.useCallback(() => {
17322
+ const shouldRestartRef = React12.useRef(false);
17323
+ const switchCamera = React12.useCallback(() => {
18441
17324
  const newFacingMode = currentFacingMode === "user" ? "environment" : "user";
18442
17325
  if (stream) {
18443
17326
  stream.getTracks().forEach((track) => track.stop());
@@ -18450,13 +17333,13 @@ function useCamera({
18450
17333
  }
18451
17334
  setCurrentFacingMode(newFacingMode);
18452
17335
  }, [currentFacingMode, stream]);
18453
- React13.useEffect(() => {
17336
+ React12.useEffect(() => {
18454
17337
  if (shouldRestartRef.current && !stream) {
18455
17338
  shouldRestartRef.current = false;
18456
17339
  startCamera();
18457
17340
  }
18458
17341
  }, [currentFacingMode, stream, startCamera]);
18459
- const capturePhoto = React13.useCallback(() => {
17342
+ const capturePhoto = React12.useCallback(() => {
18460
17343
  if (!videoRef.current || !isReady) {
18461
17344
  return null;
18462
17345
  }
@@ -18976,7 +17859,7 @@ function PhotoPreview({
18976
17859
  {
18977
17860
  variant: "primary",
18978
17861
  onClick: onConfirm,
18979
- leftIcon: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }),
17862
+ leftIcon: /* @__PURE__ */ jsx(Check$1, { className: "h-4 w-4" }),
18980
17863
  children: "Use this photo"
18981
17864
  }
18982
17865
  )
@@ -19003,14 +17886,14 @@ function WebcamModal({
19003
17886
  width: 1920,
19004
17887
  height: 1080
19005
17888
  });
19006
- const [capturedFile, setCapturedFile] = React13.useState(null);
19007
- const [previewUrl, setPreviewUrl] = React13.useState(null);
19008
- const [autoDetectEnabled, setAutoDetectEnabled] = React13.useState(enableAutoCapture);
19009
- const [videoDimensions, setVideoDimensions] = React13.useState({
17889
+ const [capturedFile, setCapturedFile] = React12.useState(null);
17890
+ const [previewUrl, setPreviewUrl] = React12.useState(null);
17891
+ const [autoDetectEnabled, setAutoDetectEnabled] = React12.useState(enableAutoCapture);
17892
+ const [videoDimensions, setVideoDimensions] = React12.useState({
19010
17893
  width: 0,
19011
17894
  height: 0
19012
17895
  });
19013
- const handleAutoCapture = React13.useCallback(() => {
17896
+ const handleAutoCapture = React12.useCallback(() => {
19014
17897
  const file = capturePhoto();
19015
17898
  if (file) {
19016
17899
  setCapturedFile(file);
@@ -19031,8 +17914,8 @@ function WebcamModal({
19031
17914
  },
19032
17915
  handleAutoCapture
19033
17916
  );
19034
- const hasStartedRef = React13.useRef(false);
19035
- React13.useEffect(() => {
17917
+ const hasStartedRef = React12.useRef(false);
17918
+ React12.useEffect(() => {
19036
17919
  const video = videoRef.current;
19037
17920
  if (video && isReady) {
19038
17921
  const updateDimensions = () => {
@@ -19046,7 +17929,7 @@ function WebcamModal({
19046
17929
  return () => video.removeEventListener("resize", updateDimensions);
19047
17930
  }
19048
17931
  }, [isReady, videoRef]);
19049
- React13.useEffect(() => {
17932
+ React12.useEffect(() => {
19050
17933
  if (open && permission !== "denied" && permission !== "unavailable") {
19051
17934
  if (!hasStartedRef.current) {
19052
17935
  hasStartedRef.current = true;
@@ -19065,7 +17948,7 @@ function WebcamModal({
19065
17948
  });
19066
17949
  }
19067
17950
  }, [open, permission]);
19068
- React13.useEffect(() => {
17951
+ React12.useEffect(() => {
19069
17952
  if (isReady && autoDetectEnabled && !capturedFile) {
19070
17953
  detection.startDetection();
19071
17954
  }
@@ -19073,7 +17956,7 @@ function WebcamModal({
19073
17956
  detection.stopDetection();
19074
17957
  };
19075
17958
  }, [isReady, autoDetectEnabled, capturedFile]);
19076
- const handleCapture = React13.useCallback(() => {
17959
+ const handleCapture = React12.useCallback(() => {
19077
17960
  const file = capturePhoto();
19078
17961
  if (file) {
19079
17962
  setCapturedFile(file);
@@ -19081,7 +17964,7 @@ function WebcamModal({
19081
17964
  stopCamera();
19082
17965
  }
19083
17966
  }, [capturePhoto, stopCamera]);
19084
- const handleRetake = React13.useCallback(() => {
17967
+ const handleRetake = React12.useCallback(() => {
19085
17968
  if (previewUrl) {
19086
17969
  URL.revokeObjectURL(previewUrl);
19087
17970
  }
@@ -19090,13 +17973,13 @@ function WebcamModal({
19090
17973
  detection.resetDetection();
19091
17974
  startCamera();
19092
17975
  }, [previewUrl, startCamera, detection]);
19093
- const handleConfirm = React13.useCallback(() => {
17976
+ const handleConfirm = React12.useCallback(() => {
19094
17977
  if (capturedFile) {
19095
17978
  onCapture(capturedFile);
19096
17979
  onOpenChange(false);
19097
17980
  }
19098
17981
  }, [capturedFile, onCapture, onOpenChange]);
19099
- const handleClose = React13.useCallback(() => {
17982
+ const handleClose = React12.useCallback(() => {
19100
17983
  stopCamera();
19101
17984
  detection.stopDetection();
19102
17985
  if (previewUrl) {
@@ -19248,13 +18131,13 @@ function useFileUpload({
19248
18131
  multiple = false,
19249
18132
  onValidationError
19250
18133
  } = {}) {
19251
- const [files, setFiles] = React13.useState([]);
19252
- React13.useEffect(() => {
18134
+ const [files, setFiles] = React12.useState([]);
18135
+ React12.useEffect(() => {
19253
18136
  return () => {
19254
18137
  files.forEach((f) => URL.revokeObjectURL(f.previewUrl));
19255
18138
  };
19256
18139
  }, []);
19257
- const addFiles = React13.useCallback(
18140
+ const addFiles = React12.useCallback(
19258
18141
  (fileList, source = "upload") => {
19259
18142
  const newFiles = [];
19260
18143
  const errors = [];
@@ -19286,7 +18169,7 @@ function useFileUpload({
19286
18169
  },
19287
18170
  [acceptedFileTypes, maxFileSizeMb, multiple, onValidationError]
19288
18171
  );
19289
- const addFile = React13.useCallback(
18172
+ const addFile = React12.useCallback(
19290
18173
  (file, source = "upload") => {
19291
18174
  const dataTransfer = new DataTransfer();
19292
18175
  dataTransfer.items.add(file);
@@ -19294,7 +18177,7 @@ function useFileUpload({
19294
18177
  },
19295
18178
  [addFiles]
19296
18179
  );
19297
- const removeFile = React13.useCallback((id) => {
18180
+ const removeFile = React12.useCallback((id) => {
19298
18181
  setFiles((prev) => {
19299
18182
  const fileToRemove = prev.find((f) => f.id === id);
19300
18183
  if (fileToRemove) {
@@ -19303,13 +18186,13 @@ function useFileUpload({
19303
18186
  return prev.filter((f) => f.id !== id);
19304
18187
  });
19305
18188
  }, []);
19306
- const clearFiles = React13.useCallback(() => {
18189
+ const clearFiles = React12.useCallback(() => {
19307
18190
  setFiles((prev) => {
19308
18191
  prev.forEach((f) => URL.revokeObjectURL(f.previewUrl));
19309
18192
  return [];
19310
18193
  });
19311
18194
  }, []);
19312
- const getFiles = React13.useCallback(() => {
18195
+ const getFiles = React12.useCallback(() => {
19313
18196
  return files.map((f) => f.file);
19314
18197
  }, [files]);
19315
18198
  return {
@@ -19337,12 +18220,12 @@ function DocumentScanner({
19337
18220
  onValidationError,
19338
18221
  onStateChange
19339
18222
  }) {
19340
- const [state, setState] = React13.useState("idle");
19341
- const [error, setError] = React13.useState(null);
19342
- const [isWebcamOpen, setIsWebcamOpen] = React13.useState(false);
19343
- const [validationErrors, setValidationErrors] = React13.useState([]);
18223
+ const [state, setState] = React12.useState("idle");
18224
+ const [error, setError] = React12.useState(null);
18225
+ const [isWebcamOpen, setIsWebcamOpen] = React12.useState(false);
18226
+ const [validationErrors, setValidationErrors] = React12.useState([]);
19344
18227
  const isMobile = useIsMobile();
19345
- const cameraInputRef = React13.useRef(null);
18228
+ const cameraInputRef = React12.useRef(null);
19346
18229
  const {
19347
18230
  files,
19348
18231
  addFiles,
@@ -19360,17 +18243,17 @@ function DocumentScanner({
19360
18243
  onValidationError?.(errors);
19361
18244
  }
19362
18245
  });
19363
- React13.useEffect(() => {
18246
+ React12.useEffect(() => {
19364
18247
  onStateChange?.(state);
19365
18248
  }, [state, onStateChange]);
19366
- React13.useEffect(() => {
18249
+ React12.useEffect(() => {
19367
18250
  if (hasFiles && state === "idle") {
19368
18251
  setState("preview");
19369
18252
  } else if (!hasFiles && state === "preview") {
19370
18253
  setState("idle");
19371
18254
  }
19372
18255
  }, [hasFiles, state]);
19373
- const handleFilesSelected = React13.useCallback(
18256
+ const handleFilesSelected = React12.useCallback(
19374
18257
  (fileList) => {
19375
18258
  setError(null);
19376
18259
  setValidationErrors([]);
@@ -19378,10 +18261,10 @@ function DocumentScanner({
19378
18261
  },
19379
18262
  [addFiles]
19380
18263
  );
19381
- const handleCameraCapture = React13.useCallback(() => {
18264
+ const handleCameraCapture = React12.useCallback(() => {
19382
18265
  cameraInputRef.current?.click();
19383
18266
  }, []);
19384
- const handleCameraInputChange = React13.useCallback(
18267
+ const handleCameraInputChange = React12.useCallback(
19385
18268
  (e) => {
19386
18269
  if (e.target.files && e.target.files.length > 0) {
19387
18270
  setError(null);
@@ -19392,7 +18275,7 @@ function DocumentScanner({
19392
18275
  },
19393
18276
  [addFiles]
19394
18277
  );
19395
- const handleWebcamCapture = React13.useCallback(
18278
+ const handleWebcamCapture = React12.useCallback(
19396
18279
  (file) => {
19397
18280
  setError(null);
19398
18281
  setValidationErrors([]);
@@ -19400,7 +18283,7 @@ function DocumentScanner({
19400
18283
  },
19401
18284
  [addFile]
19402
18285
  );
19403
- const handleScan = React13.useCallback(async () => {
18286
+ const handleScan = React12.useCallback(async () => {
19404
18287
  if (!hasFiles) return;
19405
18288
  try {
19406
18289
  setState("processing");
@@ -19419,11 +18302,11 @@ function DocumentScanner({
19419
18302
  setError(errorMessage);
19420
18303
  }
19421
18304
  }, [hasFiles, getFiles, onScan, onResult, clearFiles]);
19422
- const handleRetry = React13.useCallback(() => {
18305
+ const handleRetry = React12.useCallback(() => {
19423
18306
  setState("preview");
19424
18307
  setError(null);
19425
18308
  }, []);
19426
- const handleClearAll = React13.useCallback(() => {
18309
+ const handleClearAll = React12.useCallback(() => {
19427
18310
  clearFiles();
19428
18311
  setError(null);
19429
18312
  setValidationErrors([]);
@@ -19715,30 +18598,30 @@ function DockablePanel({
19715
18598
  container,
19716
18599
  className
19717
18600
  }) {
19718
- const panelRef = React13.useRef(null);
19719
- const contentRef = React13.useRef(null);
19720
- const onCloseRef = React13.useRef(onClose);
18601
+ const panelRef = React12.useRef(null);
18602
+ const contentRef = React12.useRef(null);
18603
+ const onCloseRef = React12.useRef(onClose);
19721
18604
  onCloseRef.current = onClose;
19722
- const onModeChangeRef = React13.useRef(onModeChange);
18605
+ const onModeChangeRef = React12.useRef(onModeChange);
19723
18606
  onModeChangeRef.current = onModeChange;
19724
- const dirtyRef = React13.useRef(dirty);
18607
+ const dirtyRef = React12.useRef(dirty);
19725
18608
  dirtyRef.current = dirty;
19726
- const modeRef = React13.useRef(mode);
18609
+ const modeRef = React12.useRef(mode);
19727
18610
  modeRef.current = mode;
19728
- const discardRef = React13.useRef(discardMessage);
18611
+ const discardRef = React12.useRef(discardMessage);
19729
18612
  discardRef.current = discardMessage;
19730
18613
  const dockable = Boolean(onModeChange);
19731
18614
  const docked = dockable && mode === "docked";
19732
- const contentId = React13.useId();
18615
+ const contentId = React12.useId();
19733
18616
  const [announcement, announce] = useLiveAnnouncement();
19734
- const requestClose = React13.useCallback(() => {
18617
+ const requestClose = React12.useCallback(() => {
19735
18618
  const view = panelRef.current?.ownerDocument.defaultView;
19736
18619
  if (dirtyRef.current && view?.confirm && !view.confirm(discardRef.current ?? `Discard ${title}?`)) {
19737
18620
  return;
19738
18621
  }
19739
18622
  onCloseRef.current();
19740
18623
  }, [title]);
19741
- React13.useEffect(() => {
18624
+ React12.useEffect(() => {
19742
18625
  const handleKeyDown = (event) => {
19743
18626
  if (event.key !== "Escape") return;
19744
18627
  if (modeRef.current === "docked" && !panelRef.current?.contains(event.target)) {
@@ -19754,7 +18637,7 @@ function DockablePanel({
19754
18637
  doc.addEventListener("keydown", handleKeyDown);
19755
18638
  return () => doc.removeEventListener("keydown", handleKeyDown);
19756
18639
  }, [dockable, requestClose]);
19757
- React13.useEffect(() => {
18640
+ React12.useEffect(() => {
19758
18641
  if (!dirty || typeof window === "undefined") return;
19759
18642
  const handleBeforeUnload = (event) => {
19760
18643
  event.preventDefault();
@@ -19763,7 +18646,7 @@ function DockablePanel({
19763
18646
  window.addEventListener("beforeunload", handleBeforeUnload);
19764
18647
  return () => window.removeEventListener("beforeunload", handleBeforeUnload);
19765
18648
  }, [dirty]);
19766
- React13.useEffect(() => {
18649
+ React12.useEffect(() => {
19767
18650
  const panel2 = panelRef.current;
19768
18651
  if (!panel2 || mode !== "full") return;
19769
18652
  const root = panel2.closest('[data-slot="dockable-panel-dock"]') ?? panel2;
@@ -19777,15 +18660,15 @@ function DockablePanel({
19777
18660
  for (const element of inerted) releaseInert(element);
19778
18661
  };
19779
18662
  }, [mode]);
19780
- React13.useEffect(() => {
18663
+ React12.useEffect(() => {
19781
18664
  contentRef.current?.toggleAttribute("inert", docked);
19782
18665
  }, [docked]);
19783
- React13.useEffect(() => {
18666
+ React12.useEffect(() => {
19784
18667
  if (docked) return;
19785
18668
  const target2 = contentRef.current?.querySelector(FOCUSABLE_SELECTOR) ?? panelRef.current;
19786
18669
  target2?.focus();
19787
18670
  }, [docked]);
19788
- React13.useEffect(() => {
18671
+ React12.useEffect(() => {
19789
18672
  if (!docked) return;
19790
18673
  announce(`${title} collapsed to dock`);
19791
18674
  panelRef.current?.querySelector('[data-slot="dockable-panel-restore"]')?.focus();
@@ -19982,10 +18865,10 @@ function useDropzone({
19982
18865
  multiple = false,
19983
18866
  disabled = false
19984
18867
  }) {
19985
- const [isDragging, setIsDragging] = React13.useState(false);
19986
- const inputRef = React13.useRef(null);
19987
- const dragCounter = React13.useRef(0);
19988
- const handleDragEnter = React13.useCallback(
18868
+ const [isDragging, setIsDragging] = React12.useState(false);
18869
+ const inputRef = React12.useRef(null);
18870
+ const dragCounter = React12.useRef(0);
18871
+ const handleDragEnter = React12.useCallback(
19989
18872
  (e) => {
19990
18873
  e.preventDefault();
19991
18874
  e.stopPropagation();
@@ -19997,11 +18880,11 @@ function useDropzone({
19997
18880
  },
19998
18881
  [disabled]
19999
18882
  );
20000
- const handleDragOver = React13.useCallback((e) => {
18883
+ const handleDragOver = React12.useCallback((e) => {
20001
18884
  e.preventDefault();
20002
18885
  e.stopPropagation();
20003
18886
  }, []);
20004
- const handleDragLeave = React13.useCallback((e) => {
18887
+ const handleDragLeave = React12.useCallback((e) => {
20005
18888
  e.preventDefault();
20006
18889
  e.stopPropagation();
20007
18890
  dragCounter.current--;
@@ -20009,7 +18892,7 @@ function useDropzone({
20009
18892
  setIsDragging(false);
20010
18893
  }
20011
18894
  }, []);
20012
- const handleDrop = React13.useCallback(
18895
+ const handleDrop = React12.useCallback(
20013
18896
  (e) => {
20014
18897
  e.preventDefault();
20015
18898
  e.stopPropagation();
@@ -20023,7 +18906,7 @@ function useDropzone({
20023
18906
  },
20024
18907
  [disabled, multiple, onDrop]
20025
18908
  );
20026
- const handleInputChange = React13.useCallback(
18909
+ const handleInputChange = React12.useCallback(
20027
18910
  (e) => {
20028
18911
  const files = e.target.files ? Array.from(e.target.files) : [];
20029
18912
  if (files.length > 0) {
@@ -20033,7 +18916,7 @@ function useDropzone({
20033
18916
  },
20034
18917
  [onDrop]
20035
18918
  );
20036
- const open = React13.useCallback(() => {
18919
+ const open = React12.useCallback(() => {
20037
18920
  if (!disabled) {
20038
18921
  inputRef.current?.click();
20039
18922
  }
@@ -20083,7 +18966,7 @@ function ClaimProviderForm({
20083
18966
  termsUrl = "/terms",
20084
18967
  className = ""
20085
18968
  }) {
20086
- const [formData, setFormData] = React13.useState({
18969
+ const [formData, setFormData] = React12.useState({
20087
18970
  firstName: "",
20088
18971
  lastName: "",
20089
18972
  email: "",
@@ -20386,14 +19269,14 @@ function CreateInvoiceModal({
20386
19269
  initialStep = 1,
20387
19270
  initialEmployerId = ""
20388
19271
  }) {
20389
- const [step, setStep] = React13.useState(initialStep);
20390
- const [employerId, setEmployerId] = React13.useState(initialEmployerId);
20391
- const [selectedOrders, setSelectedOrders] = React13.useState(
19272
+ const [step, setStep] = React12.useState(initialStep);
19273
+ const [employerId, setEmployerId] = React12.useState(initialEmployerId);
19274
+ const [selectedOrders, setSelectedOrders] = React12.useState(
20392
19275
  /* @__PURE__ */ new Set()
20393
19276
  );
20394
- const [dueDate, setDueDate] = React13.useState("");
20395
- const [notes, setNotes] = React13.useState("");
20396
- React13.useEffect(() => {
19277
+ const [dueDate, setDueDate] = React12.useState("");
19278
+ const [notes, setNotes] = React12.useState("");
19279
+ React12.useEffect(() => {
20397
19280
  if (!open) {
20398
19281
  setStep(initialStep);
20399
19282
  setEmployerId(initialEmployerId);
@@ -20402,7 +19285,7 @@ function CreateInvoiceModal({
20402
19285
  setNotes("");
20403
19286
  }
20404
19287
  }, [open, initialStep, initialEmployerId]);
20405
- React13.useEffect(() => {
19288
+ React12.useEffect(() => {
20406
19289
  if (!dueDate && open) {
20407
19290
  const date = /* @__PURE__ */ new Date();
20408
19291
  date.setDate(date.getDate() + defaultDueDays);
@@ -20825,14 +19708,14 @@ function CreateReferralModal({
20825
19708
  errorMessage,
20826
19709
  currency = "$"
20827
19710
  }) {
20828
- const [selectedServices, setSelectedServices] = React13.useState(
19711
+ const [selectedServices, setSelectedServices] = React12.useState(
20829
19712
  /* @__PURE__ */ new Set()
20830
19713
  );
20831
- const [notes, setNotes] = React13.useState("");
20832
- const [priority, setPriority] = React13.useState(
19714
+ const [notes, setNotes] = React12.useState("");
19715
+ const [priority, setPriority] = React12.useState(
20833
19716
  "normal"
20834
19717
  );
20835
- React13.useEffect(() => {
19718
+ React12.useEffect(() => {
20836
19719
  if (!open) {
20837
19720
  setSelectedServices(/* @__PURE__ */ new Set());
20838
19721
  setNotes("");
@@ -21133,15 +20016,15 @@ function EditUserRoleModal({
21133
20016
  isSubmitting = false,
21134
20017
  errorMessage
21135
20018
  }) {
21136
- const [selectedRoleId, setSelectedRoleId] = React13.useState(
20019
+ const [selectedRoleId, setSelectedRoleId] = React12.useState(
21137
20020
  user?.currentRoleId || ""
21138
20021
  );
21139
- React13.useEffect(() => {
20022
+ React12.useEffect(() => {
21140
20023
  if (user?.currentRoleId) {
21141
20024
  setSelectedRoleId(user.currentRoleId);
21142
20025
  }
21143
20026
  }, [user?.currentRoleId]);
21144
- React13.useEffect(() => {
20027
+ React12.useEffect(() => {
21145
20028
  if (!open && user?.currentRoleId) {
21146
20029
  setSelectedRoleId(user.currentRoleId);
21147
20030
  }
@@ -21312,24 +20195,24 @@ function EmployeeForm({
21312
20195
  emailRequired = "Email is required",
21313
20196
  dobRequired = "Date of birth is required"
21314
20197
  } = labels;
21315
- const [firstName, setFirstName] = React13.useState(initialData.firstName ?? "");
21316
- const [lastName, setLastName] = React13.useState(initialData.lastName ?? "");
21317
- const [email, setEmail] = React13.useState(initialData.email ?? "");
21318
- const [dob, setDob] = React13.useState(initialData.dob ?? "");
21319
- const [selectedDepartments, setSelectedDepartments] = React13.useState(initialData.departments ?? []);
21320
- const [title, setTitle] = React13.useState(initialData.title ?? "");
21321
- const [address, setAddress] = React13.useState(
20198
+ const [firstName, setFirstName] = React12.useState(initialData.firstName ?? "");
20199
+ const [lastName, setLastName] = React12.useState(initialData.lastName ?? "");
20200
+ const [email, setEmail] = React12.useState(initialData.email ?? "");
20201
+ const [dob, setDob] = React12.useState(initialData.dob ?? "");
20202
+ const [selectedDepartments, setSelectedDepartments] = React12.useState(initialData.departments ?? []);
20203
+ const [title, setTitle] = React12.useState(initialData.title ?? "");
20204
+ const [address, setAddress] = React12.useState(
21322
20205
  initialData.address ?? {}
21323
20206
  );
21324
- const [phones, setPhones] = React13.useState(
20207
+ const [phones, setPhones] = React12.useState(
21325
20208
  initialData.phones ?? [{ number: "", type: "cell" }]
21326
20209
  );
21327
- const [isActive, setIsActive] = React13.useState(initialData.isActive ?? true);
21328
- const [additionalInfo, setAdditionalInfo] = React13.useState(
20210
+ const [isActive, setIsActive] = React12.useState(initialData.isActive ?? true);
20211
+ const [additionalInfo, setAdditionalInfo] = React12.useState(
21329
20212
  initialData.additionalInfo ?? ""
21330
20213
  );
21331
- const [sendInvite, setSendInvite] = React13.useState(false);
21332
- const [errors, setErrors] = React13.useState({});
20214
+ const [sendInvite, setSendInvite] = React12.useState(false);
20215
+ const [errors, setErrors] = React12.useState({});
21333
20216
  const validate = () => {
21334
20217
  const newErrors = {};
21335
20218
  if (!firstName.trim()) newErrors.firstName = firstNameRequired;
@@ -21748,8 +20631,8 @@ function EmployeeProfileCard({
21748
20631
  className,
21749
20632
  labels = {}
21750
20633
  }) {
21751
- const [isExpanded, setIsExpanded] = React13.useState(defaultExpanded);
21752
- const fileInputRef = React13.useRef(null);
20634
+ const [isExpanded, setIsExpanded] = React12.useState(defaultExpanded);
20635
+ const fileInputRef = React12.useRef(null);
21753
20636
  const {
21754
20637
  moreDetails = "more details",
21755
20638
  lessDetails = "less details",
@@ -21825,7 +20708,7 @@ function EmployeeProfileCard({
21825
20708
  "flex h-5 w-5 items-center justify-center rounded-full text-white",
21826
20709
  employee.isActive ? "bg-success" : "bg-destructive"
21827
20710
  ),
21828
- children: employee.isActive ? /* @__PURE__ */ jsx(Check$1, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
20711
+ children: employee.isActive ? /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" }) : /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
21829
20712
  }
21830
20713
  ),
21831
20714
  /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold", children: fullName })
@@ -21939,7 +20822,7 @@ function EmployeeProfileCard({
21939
20822
  "data-cy": "header-payment-status",
21940
20823
  "data-slot": "employee-card-detail-row",
21941
20824
  children: employee.isPaid ? /* @__PURE__ */ jsxs(Fragment, { children: [
21942
- /* @__PURE__ */ jsx(Check$1, { className: "text-success-700 dark:text-success-400 h-4 w-4" }),
20825
+ /* @__PURE__ */ jsx(Check, { className: "text-success-700 dark:text-success-400 h-4 w-4" }),
21943
20826
  /* @__PURE__ */ jsx("span", { className: "text-success-700 dark:text-success-400", children: paid })
21944
20827
  ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
21945
20828
  /* @__PURE__ */ jsx(Clock$1, { className: "text-muted-foreground h-4 w-4" }),
@@ -22282,13 +21165,13 @@ function EmployerList({
22282
21165
  emptyMessage = "No employers linked yet",
22283
21166
  className = ""
22284
21167
  }) {
22285
- const [searchQuery, setSearchQuery] = React13.useState("");
21168
+ const [searchQuery, setSearchQuery] = React12.useState("");
22286
21169
  const handleSearch = (e) => {
22287
21170
  const query = e.target.value;
22288
21171
  setSearchQuery(query);
22289
21172
  onSearch?.(query);
22290
21173
  };
22291
- const filteredEmployers = React13.useMemo(() => {
21174
+ const filteredEmployers = React12.useMemo(() => {
22292
21175
  if (!searchQuery.trim()) return employers;
22293
21176
  const q = searchQuery.toLowerCase();
22294
21177
  return employers.filter(
@@ -22937,7 +21820,7 @@ function EmployerServiceModal({
22937
21820
  isSubmitting = false,
22938
21821
  errorMessage
22939
21822
  }) {
22940
- const [config, setConfig] = React13.useState({
21823
+ const [config, setConfig] = React12.useState({
22941
21824
  serviceId: service?.id || "",
22942
21825
  employerId: employer?.id || "",
22943
21826
  customPrice: existingConfig?.customPrice,
@@ -22949,7 +21832,7 @@ function EmployerServiceModal({
22949
21832
  notes: existingConfig?.notes,
22950
21833
  billingCode: existingConfig?.billingCode
22951
21834
  });
22952
- React13.useEffect(() => {
21835
+ React12.useEffect(() => {
22953
21836
  setConfig({
22954
21837
  serviceId: service?.id || "",
22955
21838
  employerId: employer?.id || "",
@@ -23826,8 +22709,8 @@ function FileManager({
23826
22709
  errorMessage,
23827
22710
  className = ""
23828
22711
  }) {
23829
- const [isDragging, setIsDragging] = React13.useState(false);
23830
- const fileInputRef = React13.useRef(null);
22712
+ const [isDragging, setIsDragging] = React12.useState(false);
22713
+ const fileInputRef = React12.useRef(null);
23831
22714
  const hasActions = !!(onPreview || onDownload || onDelete);
23832
22715
  const handleDragOver = (e) => {
23833
22716
  e.preventDefault();
@@ -24012,10 +22895,10 @@ function FileRowActionMenu({
24012
22895
  onDownload,
24013
22896
  onDelete
24014
22897
  }) {
24015
- const [open, setOpen] = React13.useState(false);
24016
- const menuRef = React13.useRef(null);
24017
- const buttonRef = React13.useRef(null);
24018
- React13.useEffect(() => {
22898
+ const [open, setOpen] = React12.useState(false);
22899
+ const menuRef = React12.useRef(null);
22900
+ const buttonRef = React12.useRef(null);
22901
+ React12.useEffect(() => {
24019
22902
  if (!open) return;
24020
22903
  function handleClick(e) {
24021
22904
  if (menuRef.current && !menuRef.current.contains(e.target) && buttonRef.current && !buttonRef.current.contains(e.target)) {
@@ -24025,7 +22908,7 @@ function FileRowActionMenu({
24025
22908
  document.addEventListener("mousedown", handleClick);
24026
22909
  return () => document.removeEventListener("mousedown", handleClick);
24027
22910
  }, [open]);
24028
- React13.useEffect(() => {
22911
+ React12.useEffect(() => {
24029
22912
  if (!open) return;
24030
22913
  function handleKey(e) {
24031
22914
  if (e.key === "Escape") setOpen(false);
@@ -24033,8 +22916,8 @@ function FileRowActionMenu({
24033
22916
  document.addEventListener("keydown", handleKey);
24034
22917
  return () => document.removeEventListener("keydown", handleKey);
24035
22918
  }, [open]);
24036
- const [menuPos, setMenuPos] = React13.useState(null);
24037
- React13.useLayoutEffect(() => {
22919
+ const [menuPos, setMenuPos] = React12.useState(null);
22920
+ React12.useLayoutEffect(() => {
24038
22921
  if (!open || !buttonRef.current) return;
24039
22922
  function updatePosition() {
24040
22923
  if (!buttonRef.current) return;
@@ -24160,7 +23043,7 @@ function fmtDate(iso) {
24160
23043
  if (!iso) return null;
24161
23044
  return iso.slice(0, 10);
24162
23045
  }
24163
- var HealthSurveillance = React13.forwardRef(
23046
+ var HealthSurveillance = React12.forwardRef(
24164
23047
  ({
24165
23048
  history,
24166
23049
  programs,
@@ -24174,13 +23057,13 @@ var HealthSurveillance = React13.forwardRef(
24174
23057
  "data-testid": dataTestId,
24175
23058
  ...props
24176
23059
  }, ref) => {
24177
- const items = React13.useMemo(
23060
+ const items = React12.useMemo(
24178
23061
  () => evaluateDue(history, programs, { enrolledKeys, now }),
24179
23062
  [history, programs, enrolledKeys, now]
24180
23063
  );
24181
23064
  const actionable = items.filter((i) => i.status !== "satisfied");
24182
23065
  const done = items.filter((i) => i.status === "satisfied");
24183
- const historyLabels = React13.useMemo(() => {
23066
+ const historyLabels = React12.useMemo(() => {
24184
23067
  const m = /* @__PURE__ */ new Map();
24185
23068
  const scan = (list) => {
24186
23069
  for (const e of list ?? []) {
@@ -24195,9 +23078,9 @@ var HealthSurveillance = React13.forwardRef(
24195
23078
  }, [history]);
24196
23079
  const orderLabel = (key) => orderLabels?.[key] ?? historyLabels.get(key) ?? key;
24197
23080
  const programLabel = (key) => programLabels?.[key] ?? key;
24198
- const [expanded, setExpanded] = React13.useState(null);
24199
- const [checked, setChecked] = React13.useState(/* @__PURE__ */ new Set());
24200
- const completedSet = React13.useMemo(() => completedKeys(history), [history]);
23081
+ const [expanded, setExpanded] = React12.useState(null);
23082
+ const [checked, setChecked] = React12.useState(/* @__PURE__ */ new Set());
23083
+ const completedSet = React12.useMemo(() => completedKeys(history), [history]);
24201
23084
  const specLevel = (spec, specs) => {
24202
23085
  let level = 0;
24203
23086
  let cur = spec.after;
@@ -24252,7 +23135,7 @@ var HealthSurveillance = React13.forwardRef(
24252
23135
  "aria-expanded": isOpen,
24253
23136
  "aria-label": `${isOpen ? "Hide" : "Show"} orders for ${programLabel(item.key)}`,
24254
23137
  className: "text-muted-foreground hover:text-foreground shrink-0",
24255
- children: isOpen ? /* @__PURE__ */ jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsx(ChevronRight$1, { size: 14, className: "rtl:-scale-x-100" })
23138
+ children: isOpen ? /* @__PURE__ */ jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsx(ChevronRight, { size: 14, className: "rtl:-scale-x-100" })
24256
23139
  }
24257
23140
  ) : /* @__PURE__ */ jsx("span", { className: "w-3.5 shrink-0" }),
24258
23141
  /* @__PURE__ */ jsx(Badge, { variant: badge.variant, size: "sm", children: badge.label }),
@@ -24384,14 +23267,14 @@ function HelpSupportPanel({
24384
23267
  successMessage,
24385
23268
  className = ""
24386
23269
  }) {
24387
- const [searchTerm, setSearchTerm] = React13.useState("");
24388
- const [expandedFaq, setExpandedFaq] = React13.useState(null);
24389
- const [formData, setFormData] = React13.useState({
23270
+ const [searchTerm, setSearchTerm] = React12.useState("");
23271
+ const [expandedFaq, setExpandedFaq] = React12.useState(null);
23272
+ const [formData, setFormData] = React12.useState({
24390
23273
  subject: "",
24391
23274
  message: "",
24392
23275
  email: ""
24393
23276
  });
24394
- const [showSuccess, setShowSuccess] = React13.useState(false);
23277
+ const [showSuccess, setShowSuccess] = React12.useState(false);
24395
23278
  const filteredFaqs = faqs.filter(
24396
23279
  (faq) => faq.question.toLowerCase().includes(searchTerm.toLowerCase()) || faq.answer.toLowerCase().includes(searchTerm.toLowerCase())
24397
23280
  );
@@ -24863,7 +23746,7 @@ function HRISProviderSelector({
24863
23746
  syncPending = "We are still waiting on data from your HRIS Provider. Please check back later.",
24864
23747
  supportEmail = "support@bluehive.com"
24865
23748
  } = labels;
24866
- const filteredProviders = React13.useMemo(() => {
23749
+ const filteredProviders = React12.useMemo(() => {
24867
23750
  if (!searchQuery.trim()) return providers;
24868
23751
  const query = searchQuery.toLowerCase();
24869
23752
  return providers.filter((p) => p.displayName.toLowerCase().includes(query));
@@ -25150,11 +24033,11 @@ function InventoryManager({
25150
24033
  isLoading = false,
25151
24034
  className = ""
25152
24035
  }) {
25153
- const [updateType, setUpdateType] = React13.useState(
24036
+ const [updateType, setUpdateType] = React12.useState(
25154
24037
  "credit"
25155
24038
  );
25156
- const [updateAmount, setUpdateAmount] = React13.useState("");
25157
- const [updateMemo, setUpdateMemo] = React13.useState("");
24039
+ const [updateAmount, setUpdateAmount] = React12.useState("");
24040
+ const [updateMemo, setUpdateMemo] = React12.useState("");
25158
24041
  const handleSubmit = () => {
25159
24042
  if (!updateAmount || !onUpdateSubmit) return;
25160
24043
  const amount = parseInt(updateAmount, 10);
@@ -25220,7 +24103,7 @@ function InventoryManager({
25220
24103
  /* @__PURE__ */ jsx("th", { className: "text-muted-foreground py-2 text-start text-xs font-medium tracking-wider uppercase", children: "Change" }),
25221
24104
  /* @__PURE__ */ jsx("th", { className: "text-muted-foreground py-2 text-end text-xs font-medium tracking-wider uppercase", children: "Quantity" })
25222
24105
  ] }) }),
25223
- /* @__PURE__ */ jsx("tbody", { className: "divide-border/50 divide-y", children: logEntries.map((entry) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
24106
+ /* @__PURE__ */ jsx("tbody", { className: "divide-border/50 divide-y", children: logEntries.map((entry) => /* @__PURE__ */ jsxs(React12.Fragment, { children: [
25224
24107
  /* @__PURE__ */ jsxs("tr", { children: [
25225
24108
  /* @__PURE__ */ jsx(
25226
24109
  "td",
@@ -25454,12 +24337,12 @@ function InviteUserModal({
25454
24337
  errorMessage,
25455
24338
  successMessage
25456
24339
  }) {
25457
- const [email, setEmail] = React13.useState("");
25458
- const [firstName, setFirstName] = React13.useState("");
25459
- const [lastName, setLastName] = React13.useState("");
25460
- const [roleId, setRoleId] = React13.useState(defaultRoleId || "");
25461
- const [message, setMessage] = React13.useState("");
25462
- React13.useEffect(() => {
24340
+ const [email, setEmail] = React12.useState("");
24341
+ const [firstName, setFirstName] = React12.useState("");
24342
+ const [lastName, setLastName] = React12.useState("");
24343
+ const [roleId, setRoleId] = React12.useState(defaultRoleId || "");
24344
+ const [message, setMessage] = React12.useState("");
24345
+ React12.useEffect(() => {
25463
24346
  if (!open) {
25464
24347
  setEmail("");
25465
24348
  setFirstName("");
@@ -25699,7 +24582,7 @@ function InvoiceList({
25699
24582
  currency = "$",
25700
24583
  className = ""
25701
24584
  }) {
25702
- const [searchQuery, setSearchQuery] = React13.useState("");
24585
+ const [searchQuery, setSearchQuery] = React12.useState("");
25703
24586
  const handleSearch = (e) => {
25704
24587
  const query = e.target.value;
25705
24588
  setSearchQuery(query);
@@ -25736,7 +24619,7 @@ function InvoiceList({
25736
24619
  { value: "overdue", label: "Overdue" },
25737
24620
  { value: "cancelled", label: "Cancelled" }
25738
24621
  ];
25739
- const filteredInvoices = React13.useMemo(() => {
24622
+ const filteredInvoices = React12.useMemo(() => {
25740
24623
  let result = invoices;
25741
24624
  if (statusFilter !== "all") {
25742
24625
  result = result.filter((inv) => inv.status === statusFilter);
@@ -25749,7 +24632,7 @@ function InvoiceList({
25749
24632
  }
25750
24633
  return result;
25751
24634
  }, [invoices, statusFilter, searchQuery]);
25752
- const totals = React13.useMemo(() => {
24635
+ const totals = React12.useMemo(() => {
25753
24636
  return {
25754
24637
  total: filteredInvoices.reduce((sum, inv) => sum + inv.amount, 0),
25755
24638
  paid: filteredInvoices.filter((inv) => inv.status === "paid").reduce((sum, inv) => sum + inv.amount, 0),
@@ -25973,16 +24856,16 @@ function InvoicePaymentPage({
25973
24856
  showStripeBranding = true,
25974
24857
  className = ""
25975
24858
  }) {
25976
- const [paymentMethod, setPaymentMethod] = React13.useState(
24859
+ const [paymentMethod, setPaymentMethod] = React12.useState(
25977
24860
  acceptedMethods[0] || "card"
25978
24861
  );
25979
- const [name, setName] = React13.useState("");
25980
- const [email, setEmail] = React13.useState("");
25981
- const [cardNumber, setCardNumber] = React13.useState("");
25982
- const [expiry, setExpiry] = React13.useState("");
25983
- const [cvc, setCvc] = React13.useState("");
25984
- const [routingNumber, setRoutingNumber] = React13.useState("");
25985
- const [accountNumber, setAccountNumber] = React13.useState("");
24862
+ const [name, setName] = React12.useState("");
24863
+ const [email, setEmail] = React12.useState("");
24864
+ const [cardNumber, setCardNumber] = React12.useState("");
24865
+ const [expiry, setExpiry] = React12.useState("");
24866
+ const [cvc, setCvc] = React12.useState("");
24867
+ const [routingNumber, setRoutingNumber] = React12.useState("");
24868
+ const [accountNumber, setAccountNumber] = React12.useState("");
25986
24869
  const formatCurrency3 = (amount) => {
25987
24870
  return `${currency}${amount.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
25988
24871
  };
@@ -26787,16 +25670,16 @@ function LanguageSelector({
26787
25670
  disabled = false,
26788
25671
  className
26789
25672
  }) {
26790
- const [isOpen, setIsOpen] = React13.useState(false);
26791
- const containerRef = React13.useRef(null);
25673
+ const [isOpen, setIsOpen] = React12.useState(false);
25674
+ const containerRef = React12.useRef(null);
26792
25675
  const { anchorRef, floatingRef, style } = useAnchoredPosition({ open: isOpen, matchMinWidth: true, maxHeight: 240 });
26793
25676
  const selectedLanguage = languages.find((l) => l.code === value);
26794
- const outsideRefs = React13.useMemo(
25677
+ const outsideRefs = React12.useMemo(
26795
25678
  () => [containerRef, floatingRef],
26796
25679
  [floatingRef]
26797
25680
  );
26798
25681
  useClickOutside(outsideRefs, () => setIsOpen(false), isOpen);
26799
- React13.useEffect(() => {
25682
+ React12.useEffect(() => {
26800
25683
  const handleEscape = (e) => {
26801
25684
  if (e.key === "Escape") setIsOpen(false);
26802
25685
  };
@@ -28212,13 +27095,13 @@ function OrderConfirmationWizard({
28212
27095
  stepTitles = ["Verify Employee", "Consent & ID", "Confirmation"],
28213
27096
  className = ""
28214
27097
  }) {
28215
- const [step, setStep] = React13.useState(initialStep);
28216
- const [employeeVerified, setEmployeeVerified] = React13.useState(false);
28217
- const [verificationNotes, setVerificationNotes] = React13.useState("");
28218
- const [consentObtained, setConsentObtained] = React13.useState(false);
28219
- const [idVerified, setIdVerified] = React13.useState(false);
28220
- const [idType, setIdType] = React13.useState("");
28221
- const [confirmationNotes, setConfirmationNotes] = React13.useState("");
27098
+ const [step, setStep] = React12.useState(initialStep);
27099
+ const [employeeVerified, setEmployeeVerified] = React12.useState(false);
27100
+ const [verificationNotes, setVerificationNotes] = React12.useState("");
27101
+ const [consentObtained, setConsentObtained] = React12.useState(false);
27102
+ const [idVerified, setIdVerified] = React12.useState(false);
27103
+ const [idType, setIdType] = React12.useState("");
27104
+ const [confirmationNotes, setConfirmationNotes] = React12.useState("");
28222
27105
  const handleStepChange = (newStep) => {
28223
27106
  setStep(newStep);
28224
27107
  onStepChange?.(newStep);
@@ -28246,7 +27129,7 @@ function OrderConfirmationWizard({
28246
27129
  const stepNum = index + 1;
28247
27130
  const isActive = step === stepNum;
28248
27131
  const isComplete = step > stepNum;
28249
- return /* @__PURE__ */ jsxs(React13.Fragment, { children: [
27132
+ return /* @__PURE__ */ jsxs(React12.Fragment, { children: [
28250
27133
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center", children: [
28251
27134
  /* @__PURE__ */ jsx(
28252
27135
  "div",
@@ -28831,7 +27714,7 @@ function OrderList({
28831
27714
  actions,
28832
27715
  className
28833
27716
  }) {
28834
- const filteredOrders = React13.useMemo(() => {
27717
+ const filteredOrders = React12.useMemo(() => {
28835
27718
  const activeTabConfig = tabs.find((t) => t.id === activeTab);
28836
27719
  if (!activeTabConfig?.statuses || !getOrderStatus) {
28837
27720
  return orders;
@@ -28840,7 +27723,7 @@ function OrderList({
28840
27723
  (order) => activeTabConfig.statuses.includes(getOrderStatus(order))
28841
27724
  );
28842
27725
  }, [orders, activeTab, tabs, getOrderStatus]);
28843
- const tabCounts = React13.useMemo(() => {
27726
+ const tabCounts = React12.useMemo(() => {
28844
27727
  if (!getOrderStatus) return {};
28845
27728
  const counts = {};
28846
27729
  tabs.forEach((tab) => {
@@ -29136,15 +28019,15 @@ function BaseOrderEditor({
29136
28019
  const config = TYPE_CONFIG[type];
29137
28020
  const ambientCodeLookup = useCodeLookupConfig();
29138
28021
  const effectiveCodeLookup = codeLookup === false ? void 0 : codeLookup ?? ambientCodeLookup ?? void 0;
29139
- const [draft, setDraft] = React13.useState(
28022
+ const [draft, setDraft] = React12.useState(
29140
28023
  () => order ?? {
29141
28024
  orderId: newId(),
29142
28025
  type,
29143
28026
  display: ""
29144
28027
  }
29145
28028
  );
29146
- const bodyRef = React13.useRef(null);
29147
- React13.useEffect(() => {
28029
+ const bodyRef = React12.useRef(null);
28030
+ React12.useEffect(() => {
29148
28031
  const input = bodyRef.current?.querySelector("input");
29149
28032
  input?.focus();
29150
28033
  }, []);
@@ -29372,7 +28255,7 @@ function OrderLookupForm({
29372
28255
  welcomeMessage = "Look up your order by entering the information below.",
29373
28256
  className = ""
29374
28257
  }) {
29375
- const [formData, setFormData] = React13.useState({
28258
+ const [formData, setFormData] = React12.useState({
29376
28259
  orderNumber: "",
29377
28260
  dateOfBirth: "",
29378
28261
  lastName: ""
@@ -29906,20 +28789,20 @@ function OverflowMenuItem({
29906
28789
  function PatientOverflowMenu({
29907
28790
  onAction
29908
28791
  }) {
29909
- const [open, setOpen] = React13.useState(false);
29910
- const menuRef = React13.useRef(null);
28792
+ const [open, setOpen] = React12.useState(false);
28793
+ const menuRef = React12.useRef(null);
29911
28794
  const { anchorRef, floatingRef, style } = useAnchoredPosition({ open, placement: "bottom-end" });
29912
- const outsideRefs = React13.useMemo(
28795
+ const outsideRefs = React12.useMemo(
29913
28796
  () => [menuRef, floatingRef],
29914
28797
  [floatingRef]
29915
28798
  );
29916
28799
  useClickOutside(
29917
28800
  outsideRefs,
29918
- React13.useCallback(() => setOpen(false), []),
28801
+ React12.useCallback(() => setOpen(false), []),
29919
28802
  open
29920
28803
  );
29921
28804
  useEscapeKey(
29922
- React13.useCallback(() => setOpen(false), []),
28805
+ React12.useCallback(() => setOpen(false), []),
29923
28806
  open
29924
28807
  );
29925
28808
  const handleAction = (action) => {
@@ -30118,7 +29001,7 @@ function AlertRow({ comments }) {
30118
29001
  /* @__PURE__ */ jsx("span", { className: "text-foreground text-sm", children: comments.join("; ") })
30119
29002
  ] });
30120
29003
  }
30121
- var PatientHeader = React13.forwardRef(
29004
+ var PatientHeader = React12.forwardRef(
30122
29005
  ({
30123
29006
  patient,
30124
29007
  allergies = [],
@@ -30148,13 +29031,13 @@ var PatientHeader = React13.forwardRef(
30148
29031
  const hasComments = showCommentsBanner && comments.length > 0;
30149
29032
  const hasProviders = showProviderBanner && !!(patient.attendingProvider || patient.familyProvider);
30150
29033
  const hasInfoRows = hasAllergies || hasMedications || hasComments || hasProviders;
30151
- const [addModalType, setAddModalType] = React13.useState(null);
30152
- const [addForm, setAddForm] = React13.useState({});
29034
+ const [addModalType, setAddModalType] = React12.useState(null);
29035
+ const [addForm, setAddForm] = React12.useState({});
30153
29036
  const addEntityLabel = addModalType ? ADD_ENTITY_LABELS[addModalType] ?? "" : "";
30154
- const [contactModalOpen, setContactModalOpen] = React13.useState(false);
30155
- const [editPatientOpen, setEditPatientOpen] = React13.useState(false);
30156
- const [editPatientForm, setEditPatientForm] = React13.useState({});
30157
- const handleOverflowAction = React13.useCallback(
29037
+ const [contactModalOpen, setContactModalOpen] = React12.useState(false);
29038
+ const [editPatientOpen, setEditPatientOpen] = React12.useState(false);
29039
+ const [editPatientForm, setEditPatientForm] = React12.useState({});
29040
+ const handleOverflowAction = React12.useCallback(
30158
29041
  (action) => {
30159
29042
  if (action === "contact") {
30160
29043
  setContactModalOpen(true);
@@ -31637,7 +30520,7 @@ function PermissionItem({
31637
30520
  parentChecked
31638
30521
  }) {
31639
30522
  const hasChildren = permission.children && permission.children.length > 0;
31640
- const [isExpanded, setIsExpanded] = React13.useState(true);
30523
+ const [isExpanded, setIsExpanded] = React12.useState(true);
31641
30524
  const handleChange = (checked) => {
31642
30525
  onToggle(permission.id, checked);
31643
30526
  if (!checked && hasChildren) {
@@ -31660,7 +30543,7 @@ function PermissionItem({
31660
30543
  "aria-expanded": isExpanded,
31661
30544
  "aria-label": isExpanded ? `Collapse ${permission.name}` : `Expand ${permission.name}`,
31662
30545
  "data-slot": "perm-item-toggle",
31663
- children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown$1, { className: "text-muted-foreground h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground h-4 w-4 rtl:-scale-x-100" })
30546
+ children: isExpanded ? /* @__PURE__ */ jsx(ChevronDown$1, { className: "text-muted-foreground h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight$1, { className: "text-muted-foreground h-4 w-4 rtl:-scale-x-100" })
31664
30547
  }
31665
30548
  ),
31666
30549
  !hasChildren && /* @__PURE__ */ jsx("span", { className: "w-5" }),
@@ -31719,12 +30602,12 @@ function PermissionsEditor({
31719
30602
  summary = "Summary",
31720
30603
  all = "All"
31721
30604
  } = labels;
31722
- const [expandedGroups, setExpandedGroups] = React13.useState(
30605
+ const [expandedGroups, setExpandedGroups] = React12.useState(
31723
30606
  () => new Set(
31724
30607
  groups.filter((g) => g.defaultExpanded !== false).map((g) => g.id)
31725
30608
  )
31726
30609
  );
31727
- const permissionMap = React13.useMemo(() => {
30610
+ const permissionMap = React12.useMemo(() => {
31728
30611
  const map = /* @__PURE__ */ new Map();
31729
30612
  const processPermissions = (permissions) => {
31730
30613
  permissions.forEach((perm) => {
@@ -31768,7 +30651,7 @@ function PermissionsEditor({
31768
30651
  onEmployersChange([...selectedEmployers, employerId]);
31769
30652
  }
31770
30653
  };
31771
- const assignedPermissionNames = React13.useMemo(() => {
30654
+ const assignedPermissionNames = React12.useMemo(() => {
31772
30655
  return assignedPermissions.map((id) => permissionMap.get(id)?.name).filter(Boolean);
31773
30656
  }, [assignedPermissions, permissionMap]);
31774
30657
  return /* @__PURE__ */ jsxs("div", { className: cn("space-y-6", className), "data-slot": "perm-editor", children: [
@@ -31804,7 +30687,7 @@ function PermissionsEditor({
31804
30687
  className: "hover:bg-muted/50 -ms-2 flex w-full items-center gap-2 rounded py-2 ps-2 text-start",
31805
30688
  "data-slot": "perm-group-header",
31806
30689
  children: [
31807
- expandedGroups.has(group.id) ? /* @__PURE__ */ jsx(ChevronDown$1, { className: "text-muted-foreground h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight, { className: "text-muted-foreground h-4 w-4 rtl:-scale-x-100" }),
30690
+ expandedGroups.has(group.id) ? /* @__PURE__ */ jsx(ChevronDown$1, { className: "text-muted-foreground h-4 w-4" }) : /* @__PURE__ */ jsx(ChevronRight$1, { className: "text-muted-foreground h-4 w-4 rtl:-scale-x-100" }),
31808
30691
  /* @__PURE__ */ jsx("span", { className: "font-semibold", "data-slot": "perm-group-name", children: group.name })
31809
30692
  ]
31810
30693
  }
@@ -32012,7 +30895,7 @@ function RelevanceControl({
32012
30895
  }
32013
30896
  );
32014
30897
  }
32015
- var PresentingProblems = React13.forwardRef(
30898
+ var PresentingProblems = React12.forwardRef(
32016
30899
  ({
32017
30900
  patientConcerns,
32018
30901
  presenting,
@@ -32028,11 +30911,11 @@ var PresentingProblems = React13.forwardRef(
32028
30911
  "data-testid": dataTestId,
32029
30912
  ...props
32030
30913
  }, ref) => {
32031
- const [draft, setDraft] = React13.useState("");
30914
+ const [draft, setDraft] = React12.useState("");
32032
30915
  const [announcement, setAnnouncement] = useLiveAnnouncement();
32033
30916
  const scopeMeta = SCOPE_META[scope];
32034
30917
  const ScopeIcon = scopeMeta.icon;
32035
- const relevanceById = React13.useMemo(
30918
+ const relevanceById = React12.useMemo(
32036
30919
  () => new Map(presenting.map((p) => [p.concernId, p.relevance])),
32037
30920
  [presenting]
32038
30921
  );
@@ -32491,7 +31374,7 @@ var logoContainerVariants = cva(
32491
31374
  }
32492
31375
  );
32493
31376
  var ProviderLogo = ({ logoURL, name, variant }) => {
32494
- const [hasError, setHasError] = React13.useState(false);
31377
+ const [hasError, setHasError] = React12.useState(false);
32495
31378
  if (!logoURL || hasError) {
32496
31379
  return /* @__PURE__ */ jsx(
32497
31380
  "div",
@@ -32626,7 +31509,7 @@ function formatAddressSingleLine2(address) {
32626
31509
  parts.push(`${address.city}, ${address.state} ${address.postalCode}`);
32627
31510
  return parts.join(", ");
32628
31511
  }
32629
- var ProviderCard = React13.forwardRef(
31512
+ var ProviderCard = React12.forwardRef(
32630
31513
  ({
32631
31514
  provider,
32632
31515
  variant = "compact",
@@ -33111,7 +31994,7 @@ function ProviderLogo2({
33111
31994
  size = "md",
33112
31995
  className
33113
31996
  }) {
33114
- const [hasError, setHasError] = React13.useState(false);
31997
+ const [hasError, setHasError] = React12.useState(false);
33115
31998
  const initials = name.split(" ").map((word) => word[0]).join("").toUpperCase().slice(0, 2);
33116
31999
  if (!src || hasError) {
33117
32000
  return /* @__PURE__ */ jsx(
@@ -33549,7 +32432,7 @@ function ProviderDetailHeaderSkeleton({
33549
32432
  /* @__PURE__ */ jsx("div", { className: "h-3 w-12 rounded bg-gray-200 dark:bg-gray-700" })
33550
32433
  ] }, i)) }),
33551
32434
  /* @__PURE__ */ jsxs("div", { className: "container mx-auto px-4 py-6", children: [
33552
- /* @__PURE__ */ jsx("div", { className: "mb-4 hidden items-center gap-2 sm:flex", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
32435
+ /* @__PURE__ */ jsx("div", { className: "mb-4 hidden items-center gap-2 sm:flex", children: [1, 2, 3, 4].map((i) => /* @__PURE__ */ jsxs(React12.Fragment, { children: [
33553
32436
  i > 1 && /* @__PURE__ */ jsx("div", { className: "h-4 w-4 rounded-full bg-gray-200 dark:bg-gray-700" }),
33554
32437
  /* @__PURE__ */ jsx("div", { className: "h-4 w-16 rounded bg-gray-200 dark:bg-gray-700" })
33555
32438
  ] }, i)) }),
@@ -34475,7 +33358,7 @@ var SearchResultsMessage = ({
34475
33358
  }
34476
33359
  );
34477
33360
  };
34478
- var ProviderSearchBar = React13.forwardRef(
33361
+ var ProviderSearchBar = React12.forwardRef(
34479
33362
  ({
34480
33363
  onSearch,
34481
33364
  onGeolocate,
@@ -34496,10 +33379,10 @@ var ProviderSearchBar = React13.forwardRef(
34496
33379
  className,
34497
33380
  ...props
34498
33381
  }, ref) => {
34499
- const [internalValue, setInternalValue] = React13.useState(
33382
+ const [internalValue, setInternalValue] = React12.useState(
34500
33383
  defaultValue || ""
34501
33384
  );
34502
- const [validationError, setValidationError] = React13.useState(
33385
+ const [validationError, setValidationError] = React12.useState(
34503
33386
  null
34504
33387
  );
34505
33388
  const zipValue = value ?? internalValue;
@@ -34779,7 +33662,7 @@ function XMarkIcon({ className }) {
34779
33662
  );
34780
33663
  }
34781
33664
  function InputField({ label, icon, className, id, ...props }) {
34782
- const generatedId = React13.useId();
33665
+ const generatedId = React12.useId();
34783
33666
  const inputId = id || generatedId;
34784
33667
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
34785
33668
  label && /* @__PURE__ */ jsx("label", { htmlFor: inputId, className: labelVariants2(), children: label }),
@@ -34803,7 +33686,7 @@ function SelectField({
34803
33686
  id,
34804
33687
  ...props
34805
33688
  }) {
34806
- const generatedId = React13.useId();
33689
+ const generatedId = React12.useId();
34807
33690
  const selectId = id || generatedId;
34808
33691
  return /* @__PURE__ */ jsxs("div", { children: [
34809
33692
  label && /* @__PURE__ */ jsx("label", { htmlFor: selectId, className: labelVariants2(), children: label }),
@@ -34856,25 +33739,25 @@ function ServiceMultiSelect({
34856
33739
  disabled = false,
34857
33740
  showCounts = false
34858
33741
  }) {
34859
- const [isOpen, setIsOpen] = React13.useState(false);
34860
- const [searchTerm, setSearchTerm] = React13.useState("");
34861
- const containerRef = React13.useRef(null);
34862
- const inputRef = React13.useRef(null);
34863
- const listboxId = React13.useId();
33742
+ const [isOpen, setIsOpen] = React12.useState(false);
33743
+ const [searchTerm, setSearchTerm] = React12.useState("");
33744
+ const containerRef = React12.useRef(null);
33745
+ const inputRef = React12.useRef(null);
33746
+ const listboxId = React12.useId();
34864
33747
  const { anchorRef, floatingRef, style } = useAnchoredPosition({ open: isOpen, matchWidth: true, maxHeight: 240 });
34865
- const outsideRefs = React13.useMemo(
33748
+ const outsideRefs = React12.useMemo(
34866
33749
  () => [containerRef, floatingRef],
34867
33750
  [floatingRef]
34868
33751
  );
34869
33752
  useClickOutside(outsideRefs, () => setIsOpen(false), isOpen);
34870
- const filteredServices = React13.useMemo(() => {
33753
+ const filteredServices = React12.useMemo(() => {
34871
33754
  if (!searchTerm) return services;
34872
33755
  const lowerSearch = searchTerm.toLowerCase();
34873
33756
  return services.filter(
34874
33757
  (service) => service.label.toLowerCase().includes(lowerSearch) || service.category?.toLowerCase().includes(lowerSearch)
34875
33758
  );
34876
33759
  }, [services, searchTerm]);
34877
- const groupedServices = React13.useMemo(() => {
33760
+ const groupedServices = React12.useMemo(() => {
34878
33761
  const groups = {};
34879
33762
  filteredServices.forEach((service) => {
34880
33763
  const category = service.category || "Other";
@@ -34883,7 +33766,7 @@ function ServiceMultiSelect({
34883
33766
  });
34884
33767
  return groups;
34885
33768
  }, [filteredServices]);
34886
- const selectedServiceObjects = React13.useMemo(
33769
+ const selectedServiceObjects = React12.useMemo(
34887
33770
  () => services.filter((s) => selectedServices.includes(s.value)),
34888
33771
  [services, selectedServices]
34889
33772
  );
@@ -35399,16 +34282,16 @@ function ProviderSelector({
35399
34282
  size = "md",
35400
34283
  className
35401
34284
  }) {
35402
- const [isOpen, setIsOpen] = React13.useState(false);
35403
- const [searchQuery, setSearchQuery] = React13.useState("");
35404
- const containerRef = React13.useRef(null);
34285
+ const [isOpen, setIsOpen] = React12.useState(false);
34286
+ const [searchQuery, setSearchQuery] = React12.useState("");
34287
+ const containerRef = React12.useRef(null);
35405
34288
  const { anchorRef, floatingRef, style } = useAnchoredPosition({ open: isOpen, matchWidth: true });
35406
- const outsideRefs = React13.useMemo(
34289
+ const outsideRefs = React12.useMemo(
35407
34290
  () => [containerRef, floatingRef],
35408
34291
  [floatingRef]
35409
34292
  );
35410
34293
  useClickOutside(outsideRefs, () => setIsOpen(false), isOpen);
35411
- React13.useEffect(() => {
34294
+ React12.useEffect(() => {
35412
34295
  function handleEscape(event) {
35413
34296
  if (event.key === "Escape") {
35414
34297
  setIsOpen(false);
@@ -35417,12 +34300,12 @@ function ProviderSelector({
35417
34300
  document.addEventListener("keydown", handleEscape);
35418
34301
  return () => document.removeEventListener("keydown", handleEscape);
35419
34302
  }, []);
35420
- React13.useEffect(() => {
34303
+ React12.useEffect(() => {
35421
34304
  if (!isOpen) {
35422
34305
  setSearchQuery("");
35423
34306
  }
35424
34307
  }, [isOpen]);
35425
- const filteredProviders = React13.useMemo(() => {
34308
+ const filteredProviders = React12.useMemo(() => {
35426
34309
  if (!searchQuery) return providers;
35427
34310
  const query = searchQuery.toLowerCase();
35428
34311
  return providers.filter(
@@ -35720,9 +34603,9 @@ function ProviderSettings({
35720
34603
  defaultTab = "general",
35721
34604
  className = ""
35722
34605
  }) {
35723
- const [settings, setSettings] = React13.useState(initialSettings);
35724
- const [hasChanges, setHasChanges] = React13.useState(false);
35725
- React13.useEffect(() => {
34606
+ const [settings, setSettings] = React12.useState(initialSettings);
34607
+ const [hasChanges, setHasChanges] = React12.useState(false);
34608
+ React12.useEffect(() => {
35726
34609
  setSettings(initialSettings);
35727
34610
  setHasChanges(false);
35728
34611
  }, [initialSettings]);
@@ -36954,11 +35837,11 @@ function RecurringServiceSetupModal({
36954
35837
  cancel = "Cancel",
36955
35838
  save = "Save"
36956
35839
  } = labels;
36957
- const instanceId = React13.useId();
35840
+ const instanceId = React12.useId();
36958
35841
  const providerSelectId = `${instanceId}-provider`;
36959
35842
  const serviceSelectId = `${instanceId}-service`;
36960
35843
  const occurrenceSelectId = `${instanceId}-occurrence`;
36961
- const [formData, setFormData] = React13.useState(
35844
+ const [formData, setFormData] = React12.useState(
36962
35845
  initialData || {
36963
35846
  providerId: "",
36964
35847
  serviceId: "",
@@ -36966,7 +35849,7 @@ function RecurringServiceSetupModal({
36966
35849
  overrideConsent: false
36967
35850
  }
36968
35851
  );
36969
- React13.useEffect(() => {
35852
+ React12.useEffect(() => {
36970
35853
  if (initialData) {
36971
35854
  setFormData(initialData);
36972
35855
  } else {
@@ -37179,9 +36062,9 @@ function RejectionModal({
37179
36062
  isSubmitting = false,
37180
36063
  variant = "danger"
37181
36064
  }) {
37182
- const [selectedReasonId, setSelectedReasonId] = React13.useState("");
37183
- const [details, setDetails] = React13.useState("");
37184
- React13.useEffect(() => {
36065
+ const [selectedReasonId, setSelectedReasonId] = React12.useState("");
36066
+ const [details, setDetails] = React12.useState("");
36067
+ React12.useEffect(() => {
37185
36068
  if (!open) {
37186
36069
  setSelectedReasonId("");
37187
36070
  setDetails("");
@@ -37638,7 +36521,7 @@ function ReportDashboard({
37638
36521
  )
37639
36522
  ] });
37640
36523
  }
37641
- var ResultsEntryForm = React13.forwardRef(function ResultsEntryForm2({
36524
+ var ResultsEntryForm = React12.forwardRef(function ResultsEntryForm2({
37642
36525
  employeeFirstName,
37643
36526
  employeeLastName,
37644
36527
  initialData = {},
@@ -37666,30 +36549,30 @@ var ResultsEntryForm = React13.forwardRef(function ResultsEntryForm2({
37666
36549
  addProviderContact = "Click here to add a provider contact",
37667
36550
  pleaseSelectResult = "Please select a result"
37668
36551
  } = labels;
37669
- const [result, setResult] = React13.useState(
36552
+ const [result, setResult] = React12.useState(
37670
36553
  initialData.result ?? null
37671
36554
  );
37672
- const [alternateText, setAlternateText] = React13.useState(
36555
+ const [alternateText, setAlternateText] = React12.useState(
37673
36556
  initialData.alternateText ?? ""
37674
36557
  );
37675
- const [dateDrawnValue, setDateDrawnValue] = React13.useState(
36558
+ const [dateDrawnValue, setDateDrawnValue] = React12.useState(
37676
36559
  initialData.dateDrawn ?? ""
37677
36560
  );
37678
- const [dateCompletedValue, setDateCompletedValue] = React13.useState(
36561
+ const [dateCompletedValue, setDateCompletedValue] = React12.useState(
37679
36562
  initialData.dateCompleted ?? ""
37680
36563
  );
37681
- const [recommendations, setRecommendations] = React13.useState(
36564
+ const [recommendations, setRecommendations] = React12.useState(
37682
36565
  initialData.recommendations ?? ""
37683
36566
  );
37684
- const [files, setFiles] = React13.useState(initialData.files ?? []);
37685
- const [selectedContacts, setSelectedContacts] = React13.useState(
36567
+ const [files, setFiles] = React12.useState(initialData.files ?? []);
36568
+ const [selectedContacts, setSelectedContacts] = React12.useState(
37686
36569
  initialData.providerContacts ?? []
37687
36570
  );
37688
- const [applyToAll, setApplyToAll] = React13.useState(
36571
+ const [applyToAll, setApplyToAll] = React12.useState(
37689
36572
  initialData.applyToAllServices ?? false
37690
36573
  );
37691
- const [showError, setShowError] = React13.useState(false);
37692
- const fileInputRef = React13.useRef(null);
36574
+ const [showError, setShowError] = React12.useState(false);
36575
+ const fileInputRef = React12.useRef(null);
37693
36576
  const handleFileSelect = (e) => {
37694
36577
  const selectedFiles = Array.from(e.target.files || []);
37695
36578
  setFiles((prev) => [...prev, ...selectedFiles]);
@@ -37705,7 +36588,7 @@ var ResultsEntryForm = React13.forwardRef(function ResultsEntryForm2({
37705
36588
  (prev) => prev.includes(contactId) ? prev.filter((id) => id !== contactId) : [...prev, contactId]
37706
36589
  );
37707
36590
  };
37708
- const validateAndSubmit = React13.useCallback(() => {
36591
+ const validateAndSubmit = React12.useCallback(() => {
37709
36592
  if (!result) {
37710
36593
  setShowError(true);
37711
36594
  return;
@@ -37732,7 +36615,7 @@ var ResultsEntryForm = React13.forwardRef(function ResultsEntryForm2({
37732
36615
  applyToAll,
37733
36616
  onSubmit
37734
36617
  ]);
37735
- React13.useImperativeHandle(
36618
+ React12.useImperativeHandle(
37736
36619
  ref,
37737
36620
  () => ({
37738
36621
  submit: validateAndSubmit
@@ -38008,7 +36891,7 @@ function ResultsEntryModal({
38008
36891
  ...props
38009
36892
  }) {
38010
36893
  const { submit = "Submit", close = "Close" } = labels;
38011
- const formRef = React13.useRef(null);
36894
+ const formRef = React12.useRef(null);
38012
36895
  const employeeName = employeeFirstName || employeeLastName ? `${employeeFirstName ?? ""} ${employeeLastName ?? ""}`.trim() : void 0;
38013
36896
  const handleSubmitClick = () => {
38014
36897
  formRef.current?.submit();
@@ -38138,7 +37021,7 @@ function ScheduleCalendar({
38138
37021
  isLoading = false,
38139
37022
  className = ""
38140
37023
  }) {
38141
- const [currentDate, setCurrentDate] = React13.useState(selectedDate);
37024
+ const [currentDate, setCurrentDate] = React12.useState(selectedDate);
38142
37025
  const formatTime4 = (date) => {
38143
37026
  const d = typeof date === "string" ? new Date(date) : date;
38144
37027
  return d.toLocaleTimeString("en-US", {
@@ -38478,19 +37361,19 @@ function PillSelect({
38478
37361
  disabled = false,
38479
37362
  className
38480
37363
  }) {
38481
- const [internalValue, setInternalValue] = React13.useState(
37364
+ const [internalValue, setInternalValue] = React12.useState(
38482
37365
  defaultValue ?? options[0]?.value ?? ""
38483
37366
  );
38484
- const [expanded, setExpanded] = React13.useState(false);
38485
- const triggerRef = React13.useRef(null);
38486
- const menuRef = React13.useRef(null);
38487
- const selectedOptionRef = React13.useRef(null);
38488
- const firstEnabledOptionRef = React13.useRef(null);
38489
- const listboxId = React13.useId();
38490
- const [menuStyle, setMenuStyle] = React13.useState({});
37367
+ const [expanded, setExpanded] = React12.useState(false);
37368
+ const triggerRef = React12.useRef(null);
37369
+ const menuRef = React12.useRef(null);
37370
+ const selectedOptionRef = React12.useRef(null);
37371
+ const firstEnabledOptionRef = React12.useRef(null);
37372
+ const listboxId = React12.useId();
37373
+ const [menuStyle, setMenuStyle] = React12.useState({});
38491
37374
  const value = controlledValue !== void 0 ? controlledValue : internalValue;
38492
37375
  const selectedOption = options.find((o) => o.value === value);
38493
- const close = React13.useCallback((restoreFocus = false) => {
37376
+ const close = React12.useCallback((restoreFocus = false) => {
38494
37377
  setExpanded(false);
38495
37378
  if (restoreFocus) {
38496
37379
  requestAnimationFrame(
@@ -38498,7 +37381,7 @@ function PillSelect({
38498
37381
  );
38499
37382
  }
38500
37383
  }, []);
38501
- const updateMenuPosition = React13.useCallback(() => {
37384
+ const updateMenuPosition = React12.useCallback(() => {
38502
37385
  const trigger = triggerRef.current;
38503
37386
  if (!trigger) return;
38504
37387
  const rect = trigger.getBoundingClientRect();
@@ -38519,7 +37402,7 @@ function PillSelect({
38519
37402
  zIndex: 9999
38520
37403
  });
38521
37404
  }, []);
38522
- React13.useEffect(() => {
37405
+ React12.useEffect(() => {
38523
37406
  if (!expanded) return;
38524
37407
  updateMenuPosition();
38525
37408
  window.addEventListener("scroll", updateMenuPosition, true);
@@ -38529,7 +37412,7 @@ function PillSelect({
38529
37412
  window.removeEventListener("resize", updateMenuPosition);
38530
37413
  };
38531
37414
  }, [expanded, updateMenuPosition]);
38532
- React13.useEffect(() => {
37415
+ React12.useEffect(() => {
38533
37416
  if (!expanded) return;
38534
37417
  const handleClickOutside = (event) => {
38535
37418
  const target = event.target;
@@ -38541,7 +37424,7 @@ function PillSelect({
38541
37424
  document.addEventListener("mousedown", handleClickOutside);
38542
37425
  return () => document.removeEventListener("mousedown", handleClickOutside);
38543
37426
  }, [close, expanded]);
38544
- React13.useEffect(() => {
37427
+ React12.useEffect(() => {
38545
37428
  if (!expanded) return;
38546
37429
  requestAnimationFrame(() => {
38547
37430
  (selectedOptionRef.current ?? firstEnabledOptionRef.current)?.focus({
@@ -38760,7 +37643,7 @@ function SubCategoryAccordion({
38760
37643
  onServiceClick,
38761
37644
  index
38762
37645
  }) {
38763
- const [isExpanded, setIsExpanded] = React13.useState(
37646
+ const [isExpanded, setIsExpanded] = React12.useState(
38764
37647
  subCategory.defaultExpanded ?? false
38765
37648
  );
38766
37649
  const contentId = `sub-content-${index}`;
@@ -38827,7 +37710,7 @@ function CategoryAccordionItem({
38827
37710
  onExpandChange
38828
37711
  }) {
38829
37712
  const isControlled = expandedCategories !== void 0;
38830
- const [internalExpanded, setInternalExpanded] = React13.useState(
37713
+ const [internalExpanded, setInternalExpanded] = React12.useState(
38831
37714
  category.defaultExpanded ?? false
38832
37715
  );
38833
37716
  const isExpanded = isControlled ? expandedCategories.includes(category.name) : internalExpanded;
@@ -38925,7 +37808,7 @@ function ServiceAccordion({
38925
37808
  className,
38926
37809
  "aria-label": ariaLabel = "Service categories"
38927
37810
  }) {
38928
- const [internalExpanded, setInternalExpanded] = React13.useState([]);
37811
+ const [internalExpanded, setInternalExpanded] = React12.useState([]);
38929
37812
  const isControlled = controlledExpanded !== void 0;
38930
37813
  const expanded = isControlled ? controlledExpanded : internalExpanded;
38931
37814
  const handleExpandChange = (categoryName, isExpanded) => {
@@ -39217,7 +38100,7 @@ function ServiceBadgeGroup({
39217
38100
  size = "md",
39218
38101
  onShowMore
39219
38102
  }) {
39220
- const badges = React13.Children.toArray(children);
38103
+ const badges = React12.Children.toArray(children);
39221
38104
  const visibleBadges = maxVisible ? badges.slice(0, maxVisible) : badges;
39222
38105
  const hiddenCount = maxVisible ? badges.length - maxVisible : 0;
39223
38106
  return /* @__PURE__ */ jsxs(
@@ -40070,15 +38953,15 @@ function ServicePicker({
40070
38953
  fullWidth = false,
40071
38954
  className
40072
38955
  }) {
40073
- const [searchQuery, setSearchQuery] = React13.useState("");
40074
- const [expandedGroups, setExpandedGroups] = React13.useState(
38956
+ const [searchQuery, setSearchQuery] = React12.useState("");
38957
+ const [expandedGroups, setExpandedGroups] = React12.useState(
40075
38958
  /* @__PURE__ */ new Set()
40076
38959
  );
40077
- const filteredGroups = React13.useMemo(
38960
+ const filteredGroups = React12.useMemo(
40078
38961
  () => filterServices(groups, searchQuery),
40079
38962
  [groups, searchQuery]
40080
38963
  );
40081
- const searchResults = React13.useMemo(
38964
+ const searchResults = React12.useMemo(
40082
38965
  () => searchQuery ? flattenServices(filteredGroups) : [],
40083
38966
  [filteredGroups, searchQuery]
40084
38967
  );
@@ -40527,16 +39410,16 @@ function ServicePricingManager({
40527
39410
  categories: _categories = [],
40528
39411
  className = ""
40529
39412
  }) {
40530
- const [searchTerm, setSearchTerm] = React13.useState("");
40531
- const [selectedCategory, setSelectedCategory] = React13.useState(
39413
+ const [searchTerm, setSearchTerm] = React12.useState("");
39414
+ const [selectedCategory, setSelectedCategory] = React12.useState(
40532
39415
  null
40533
39416
  );
40534
- const [editingService, setEditingService] = React13.useState(null);
40535
- const [editPrice, setEditPrice] = React13.useState("");
40536
- const [editEmployerPrice, setEditEmployerPrice] = React13.useState("");
40537
- const [showBulkModal, setShowBulkModal] = React13.useState(false);
40538
- const [bulkAdjustment, setBulkAdjustment] = React13.useState("");
40539
- const [bulkAdjustmentType, setBulkAdjustmentType] = React13.useState("percent");
39417
+ const [editingService, setEditingService] = React12.useState(null);
39418
+ const [editPrice, setEditPrice] = React12.useState("");
39419
+ const [editEmployerPrice, setEditEmployerPrice] = React12.useState("");
39420
+ const [showBulkModal, setShowBulkModal] = React12.useState(false);
39421
+ const [bulkAdjustment, setBulkAdjustment] = React12.useState("");
39422
+ const [bulkAdjustmentType, setBulkAdjustmentType] = React12.useState("percent");
40540
39423
  const formatCurrency3 = (amount) => {
40541
39424
  return new Intl.NumberFormat("en-US", {
40542
39425
  style: "currency",
@@ -40927,7 +39810,7 @@ function ServiceShippingSettings({
40927
39810
  isSaving = false,
40928
39811
  className = ""
40929
39812
  }) {
40930
- const [address, setAddress] = React13.useState(
39813
+ const [address, setAddress] = React12.useState(
40931
39814
  defaultAddress || {
40932
39815
  name: "",
40933
39816
  street1: "",
@@ -41129,7 +40012,7 @@ function SetupServiceModal({
41129
40012
  errorMessage,
41130
40013
  title = "Add New Service"
41131
40014
  }) {
41132
- const [formData, setFormData] = React13.useState({
40015
+ const [formData, setFormData] = React12.useState({
41133
40016
  name: "",
41134
40017
  description: "",
41135
40018
  price: 0,
@@ -41139,7 +40022,7 @@ function SetupServiceModal({
41139
40022
  initialInventory: void 0,
41140
40023
  autoAcceptReferrals: false
41141
40024
  });
41142
- React13.useEffect(() => {
40025
+ React12.useEffect(() => {
41143
40026
  if (!open) {
41144
40027
  setFormData({
41145
40028
  name: "",
@@ -42175,7 +41058,7 @@ function NewsletterForm({
42175
41058
  isLoading = false,
42176
41059
  className
42177
41060
  }) {
42178
- const [email, setEmail] = React13.useState("");
41061
+ const [email, setEmail] = React12.useState("");
42179
41062
  function handleSubmit(e) {
42180
41063
  e.preventDefault();
42181
41064
  if (email.trim()) {
@@ -42300,7 +41183,7 @@ function LegalLinks({
42300
41183
  {
42301
41184
  "data-slot": "site-footer-legal",
42302
41185
  className: cn("flex flex-wrap items-center gap-x-4 gap-y-1", className),
42303
- children: links.map((link, index) => /* @__PURE__ */ jsxs(React13.Fragment, { children: [
41186
+ children: links.map((link, index) => /* @__PURE__ */ jsxs(React12.Fragment, { children: [
42304
41187
  index > 0 && /* @__PURE__ */ jsx(
42305
41188
  "span",
42306
41189
  {
@@ -42791,9 +41674,9 @@ function UserMenu({
42791
41674
  menuItems = [],
42792
41675
  className
42793
41676
  }) {
42794
- const [isOpen, setIsOpen] = React13.useState(false);
42795
- const menuRef = React13.useRef(null);
42796
- React13.useEffect(() => {
41677
+ const [isOpen, setIsOpen] = React12.useState(false);
41678
+ const menuRef = React12.useRef(null);
41679
+ React12.useEffect(() => {
42797
41680
  function handleClickOutside(event) {
42798
41681
  if (menuRef.current && !menuRef.current.contains(event.target)) {
42799
41682
  setIsOpen(false);
@@ -43086,7 +41969,7 @@ function SiteHeader({
43086
41969
  userMenuItems,
43087
41970
  className
43088
41971
  }) {
43089
- const [mobileMenuOpen, setMobileMenuOpen] = React13.useState(false);
41972
+ const [mobileMenuOpen, setMobileMenuOpen] = React12.useState(false);
43090
41973
  const colorVariant = variant === "primary" || variant === "transparent" ? "light" : "dark";
43091
41974
  return /* @__PURE__ */ jsxs(Fragment, { children: [
43092
41975
  /* @__PURE__ */ jsx("div", { "data-slot": "site-header-spacer", className: "h-16", "aria-hidden": "true" }),
@@ -43458,29 +42341,29 @@ function SSOConfigForm({
43458
42341
  delete: deleteLabel = "Delete SSO",
43459
42342
  cancel = "Cancel"
43460
42343
  } = labels;
43461
- const [clientDomain, setClientDomain] = React13.useState(
42344
+ const [clientDomain, setClientDomain] = React12.useState(
43462
42345
  initialData.clientDomain ?? ""
43463
42346
  );
43464
- const [ssoLoginUrl, setSsoLoginUrl] = React13.useState(
42347
+ const [ssoLoginUrl, setSsoLoginUrl] = React12.useState(
43465
42348
  initialData.ssoLoginUrl ?? ""
43466
42349
  );
43467
- const [ssoLogoutUrl, setSsoLogoutUrl] = React13.useState(
42350
+ const [ssoLogoutUrl, setSsoLogoutUrl] = React12.useState(
43468
42351
  initialData.ssoLogoutUrl ?? ""
43469
42352
  );
43470
- const [forceReauth, setForceReauth] = React13.useState(
42353
+ const [forceReauth, setForceReauth] = React12.useState(
43471
42354
  initialData.forceReauthentication ?? false
43472
42355
  );
43473
- const [idpSigns, setIdpSigns] = React13.useState(
42356
+ const [idpSigns, setIdpSigns] = React12.useState(
43474
42357
  initialData.idpSignsRequest ?? false
43475
42358
  );
43476
- const [allowUnencrypted, setAllowUnencrypted] = React13.useState(
42359
+ const [allowUnencrypted, setAllowUnencrypted] = React12.useState(
43477
42360
  initialData.allowUnencryptedAssertion ?? false
43478
42361
  );
43479
- const [certificateFile, setCertificateFile] = React13.useState(
42362
+ const [certificateFile, setCertificateFile] = React12.useState(
43480
42363
  null
43481
42364
  );
43482
- const fileInputRef = React13.useRef(null);
43483
- const [errors, setErrors] = React13.useState({});
42365
+ const fileInputRef = React12.useRef(null);
42366
+ const [errors, setErrors] = React12.useState({});
43484
42367
  const validate = () => {
43485
42368
  const newErrors = {};
43486
42369
  if (!clientDomain.trim()) {
@@ -43838,7 +42721,7 @@ function StepIndicator({
43838
42721
  const status = getStepStatus(index);
43839
42722
  const isLast = index === steps.length - 1;
43840
42723
  const clickable = isClickable(index);
43841
- return /* @__PURE__ */ jsxs(React13.Fragment, { children: [
42724
+ return /* @__PURE__ */ jsxs(React12.Fragment, { children: [
43842
42725
  /* @__PURE__ */ jsxs("div", { className: `flex flex-row items-center ${sizes.gap}`, children: [
43843
42726
  circleButton(step, index, status, clickable),
43844
42727
  stepLabel(step, status, false)
@@ -44055,10 +42938,10 @@ function TableOfContents({
44055
42938
  scrollSpyOptions,
44056
42939
  className
44057
42940
  }) {
44058
- const [discoveredItems, setDiscoveredItems] = React13.useState([]);
42941
+ const [discoveredItems, setDiscoveredItems] = React12.useState([]);
44059
42942
  const flatItems = manualItems ?? discoveredItems;
44060
42943
  const contentEl = contentRef?.current ?? null;
44061
- React13.useEffect(() => {
42944
+ React12.useEffect(() => {
44062
42945
  if (manualItems) return;
44063
42946
  const container = contentEl ?? document;
44064
42947
  let frameId = null;
@@ -44089,7 +42972,7 @@ function TableOfContents({
44089
42972
  if (frameId !== null) cancelAnimationFrame(frameId);
44090
42973
  };
44091
42974
  }, [manualItems, selector, maxDepth, contentEl]);
44092
- const ids = React13.useMemo(() => flatItems.map((i) => i.id), [flatItems]);
42975
+ const ids = React12.useMemo(() => flatItems.map((i) => i.id), [flatItems]);
44093
42976
  const isControlled = controlledActiveId !== void 0;
44094
42977
  const { activeId: spyActiveId } = useScrollSpy({
44095
42978
  ids,
@@ -44098,12 +42981,12 @@ function TableOfContents({
44098
42981
  ...scrollSpyOptions
44099
42982
  });
44100
42983
  const activeId = isControlled ? controlledActiveId : spyActiveId;
44101
- React13.useEffect(() => {
42984
+ React12.useEffect(() => {
44102
42985
  if (!isControlled && onActiveChange) {
44103
42986
  onActiveChange(spyActiveId);
44104
42987
  }
44105
42988
  }, [spyActiveId, isControlled, onActiveChange]);
44106
- const handleClick = React13.useCallback(
42989
+ const handleClick = React12.useCallback(
44107
42990
  (e, id) => {
44108
42991
  if (e.button !== 0 || e.metaKey || e.ctrlKey || e.shiftKey || e.altKey) {
44109
42992
  return;
@@ -44124,7 +43007,7 @@ function TableOfContents({
44124
43007
  },
44125
43008
  [contentEl, scrollOffset, smooth]
44126
43009
  );
44127
- const tree = React13.useMemo(() => nestItems(flatItems), [flatItems]);
43010
+ const tree = React12.useMemo(() => nestItems(flatItems), [flatItems]);
44128
43011
  if (hideWhenEmpty && tree.length === 0) return null;
44129
43012
  return /* @__PURE__ */ jsxs("nav", { "aria-label": "Table of contents", className: cn("text-sm", className), children: [
44130
43013
  title && /* @__PURE__ */ jsx("p", { className: "text-foreground mb-3 font-semibold", children: title }),
@@ -44729,7 +43612,7 @@ function WebChartReportViewer({
44729
43612
  dateFrom = "From",
44730
43613
  dateTo = "To"
44731
43614
  } = labels;
44732
- const [modalOpen, setModalOpen] = React13.useState(false);
43615
+ const [modalOpen, setModalOpen] = React12.useState(false);
44733
43616
  const handleReportClick = (report) => {
44734
43617
  onReportSelect?.(report);
44735
43618
  setModalOpen(true);
@@ -44852,7 +43735,7 @@ function WebChartReportViewer({
44852
43735
  className: "flex items-center gap-3",
44853
43736
  children: [
44854
43737
  /* @__PURE__ */ jsx(ModalTitle, { children: currentReport?.name || "Report Results" }),
44855
- reportResult?.error ? /* @__PURE__ */ jsx(AlertTriangle$1, { className: "h-5 w-5 text-yellow-500" }) : reportResult?.success ? /* @__PURE__ */ jsx(Check$1, { className: "h-5 w-5 text-green-500" }) : null
43738
+ reportResult?.error ? /* @__PURE__ */ jsx(AlertTriangle$1, { className: "h-5 w-5 text-yellow-500" }) : reportResult?.success ? /* @__PURE__ */ jsx(Check, { className: "h-5 w-5 text-green-500" }) : null
44856
43739
  ]
44857
43740
  }
44858
43741
  ),
@@ -44967,7 +43850,7 @@ function ReportTimeRange({
44967
43850
  ],
44968
43851
  className
44969
43852
  }) {
44970
- const [preset, setPreset] = React13.useState("this-month");
43853
+ const [preset, setPreset] = React12.useState("this-month");
44971
43854
  const handlePresetChange = (value) => {
44972
43855
  setPreset(value);
44973
43856
  const now = /* @__PURE__ */ new Date();
@@ -45069,7 +43952,7 @@ function isValidUrl(url) {
45069
43952
  }
45070
43953
  }
45071
43954
  }
45072
- var WebsiteInput = React13.forwardRef(
43955
+ var WebsiteInput = React12.forwardRef(
45073
43956
  ({
45074
43957
  value = "",
45075
43958
  onChange,
@@ -45080,7 +43963,7 @@ var WebsiteInput = React13.forwardRef(
45080
43963
  error,
45081
43964
  ...props
45082
43965
  }, ref) => {
45083
- const [localError, setLocalError] = React13.useState();
43966
+ const [localError, setLocalError] = React12.useState();
45084
43967
  const handleChange = (e) => {
45085
43968
  onChange?.(e.target.value);
45086
43969
  if (localError) {
@@ -45162,7 +44045,7 @@ function WebsiteInputGroup({
45162
44045
  typeLabels,
45163
44046
  className
45164
44047
  }) {
45165
- const websites = React13.useMemo(() => {
44048
+ const websites = React12.useMemo(() => {
45166
44049
  if (value.length >= minEntries) return value;
45167
44050
  const padding = Array(minEntries - value.length).fill(null).map(() => ({ url: "", type: "website" }));
45168
44051
  return [...value, ...padding];
@@ -45310,6 +44193,6 @@ function WebsiteInputGroup({
45310
44193
  }
45311
44194
  WebsiteInputGroup.displayName = "WebsiteInputGroup";
45312
44195
 
45313
- export { AIChat, AIChatModal, AIChatTrigger, AIReconciliationPanel, AccessDeniedPage, ActionButton2 as ActionButton, ActionButtonsBar, ActiveFilters, AddContactModal, AddServiceCard, AdditionalFields, Address, AddressCard, AddressCompact, AddressDisplay, AddressForm, AddressInline, AppHeader, AppHeaderActions, AppHeaderBrand, AppHeaderDivider, AppHeaderIconButton, AppHeaderSearch, AppHeaderSection, AppHeaderTitle, AppHeaderUserMenu, Assessment, AuthButtons, AuthDialog, BookAppointmentButton, BookingDialog, BusinessHours, BusinessHoursEditor, ButtonGroup, CHANGE_TYPE_LABELS, CONCERN_STATUS_LABELS, CSVColumnMapper, CSVFileUpload, CardSkeleton, CaseContextBar, CaseManagementHeader, ChatComposer, CheckrIntegration, ClaimListingButton, ClaimProviderForm, CodingChips, CommandPalette, CommandPaletteProvider, CommandPaletteTrigger, CompactCookieBanner, CompactFilterBar, CompactHeader, CompactHours, CompactProviderHeader, ComposerModelSelector, ConditionEditor, ConnectionStatusBadge, ConnectionStatusBar, ConnectionStatusOverlay, ConsentSwitch, CookieConsentBanner, CopyrightText, CountBadge, CountryDropdown, CreateInvoiceModal, CreateReferralModal, DEFAULT_ERROR_CONFIGS, DEFAULT_LANGUAGES, DEFAULT_RADIUS_OPTIONS, DEFAULT_SOCIAL_PROVIDERS, DOTBadge, DashboardWidget, DashboardWidgetActions, DashboardWidgetDataCards, DashboardWidgetInfo, DashboardWidgetTable, DateRangeFilter, DateRangePicker, DialogOverlay, DisclaimerText, DockablePanel, DocumentDetectionOverlay, DocumentScanner, DropZone, DropzoneOverlay, EditUserRoleModal, EmployeeForm, EmployeeProfileCard, EmployerContactCard, EmployerList, EmployerPricingCard, EmployerServiceModal, EmployerView, ErrorPage, FileManager, FilePreview, FloatingAIChat, FloatingInput, FooterLinkSection, SocialMediaLinks2 as FooterSocialLinks, HRISProviderSelector, HandsFreeChat, HealthSurveillance, HelpSupportPanel, HeroSearchBar, HeyOzwell, HeyOzwellToggle, HoursSummary, ImagingOrderEditor, InlineBookingForm, InventoryManager, InviteUserModal, InvoiceList, InvoicePaymentPage, InvoiceView, LabOrderEditor, LanguageSelector, LanguageSelectorInline, LanguageSelectorNative, LegalLinks, LoadingBar, LoadingDots, LoadingOverlay, LoadingPage, LoadingSkeleton, MODEL_MANIFEST, MaintenancePage, MobileBackButton, MobileMenuButton, MobileMenuPanel, ModelInfoList, NavLinks, NewsletterForm, NotFoundPage, NotificationCenter, ORDER_TYPE_META, ORDER_TYPE_SEARCH_DOMAINS, OfflinePage, OnboardingCompletion, OnboardingStepQuestion, OnboardingWizard, OpenStatusBadge, OrderCard, OrderConfirmation, OrderConfirmationWizard, OrderDetailSidebar, OrderEditor, OrderList, OrderLookupForm, OrderSidebar, OrderSidebarTabs, OzwellChat, OzwellSettingsMenu, PageHeader, PatientHeader, PaymentHistoryTable, PaymentMethodBank, PaymentMethodCard, PaymentMethodList, PendingClaimsTable, PermissionsEditor, PillSelect, PresentingProblems, ProblemList, ProcedureOrderEditor, ProductVersion, ProductVersionBadge, Breadcrumb2 as ProviderBreadcrumb, ProviderCard, ProviderCardGrid, ProviderCardSkeleton, ProviderDetailHeader, ProviderDetailHeaderSkeleton, ProviderLogo2 as ProviderLogo, ProviderOverview, ProviderSearchBar, ProviderSearchFilters, ProviderSelector, ProviderSettings, SocialMediaLinks as ProviderSocialLinks, ProviderUsersTable, QuickBookCard, QuickLinksCard, RELEVANCE_LABELS, RecurringServiceAddCard, RecurringServiceCard, RecurringServiceGrid, RecurringServiceSetupModal, ReferralEditor, RejectionModal, ReportDashboard, ReportDatePicker, ReportLink, ReportTimeRange, ResultsEntryCard, ResultsEntryForm, ResultsEntryModal, SSOConfigForm, ScheduleCalendar, SearchResultsMessage, SelectedServicesBadges, ServerErrorPage, ServiceAccordion, ServiceBadge, ServiceBadgeGroup, ServiceCard, ServiceCategoryBadge, ServiceGeneralSettings, ServiceGrid, ServiceLink, ServiceList, ServiceMultiSelect, ServicePicker, ServicePricingManager, ServiceSelect, ServiceShippingSettings, ServiceTagCloud, ServiceTagCloudBadges, SetupServiceModal, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMobileToggle, SidebarNav, SidebarNavGroup, SidebarNavItem, SidebarProvider, SidebarSearch, SidebarToggle, SimpleFooter, SiteFooter, SiteHeader, SiteLogo, StepIndicator, StripeBadge, StripeSecureBadge, SuggestedActions, TableOfContents, TimelineEventList, TimelineProgress, Toast, ToastContainer, ToastProvider, UncertaintyBadge, UpdateAvailableOverlay, UserMenu, VerifiedBadge2 as VerifiedBadge, VisitScribe, VoiceManager, VoiceSetup, WEBSITE_TYPES, WebChartReportViewer, WebcamModal, WebsiteInput, WebsiteInputGroup, askOzwell, askOzwellStream, attributeSegments, calculateDateRange, centroid, chime, clearVoiceprints, clearWhatPrints, clusterEmbeddings, concernGroupKey, concernHistoryContent, cosine, countBadgeVariants, countChipVariants, create24HourSchedule, createDefaultSchedule, createWeekdaySchedule, currentAssertion, decodeTo16kMono, defaultCaseManagementHeaderLabels, defaultOrderTabs, defaultReconciliationIsEqual, endsWithDone, formatAddressLines, formatAddressSingleLine, formatCityState, formatCityStateZip, generateId, getDefaultPresets, getDictationLoad, getExtendedPresets, getGoogleMapsSearchUrl, getGoogleMapsUrl, getOzwellConfig, getVoiceprints, getWakeWarm, inferSpeakerRoles, isConditionCodetype, isOzwellConfigured, isValidUrl, isWhisperLoaded, labelClusters, loadWhatPrints, medicationToOrder, mergeTurns, openRollingRecorder, orderToMedication, orderTypeForCodetype, panelVariants as reconciliationPanelVariants, saveWhatPrints, setVoiceprints, stripStopPhrase, subscribeDictationLoad, subscribeWakeWarm, toOzwellMessages, transcribeBlob, transcribeGate, transcribeSamples, transcribeSegments, transcribeServer, trimTrailingStopPhrase, useCamera, useCommandPalette, useConnectionStatus, useCookieConsent, useDiarization, useDocumentDetection, useDropzone, useFileUpload, useHeyOzwell, useOptionalToast, useSidebar, useSpeakerVerify, useToast, useVisitScribe, useVoiceSetup, useWakeWord, warmStopGate, warmWakeModels, warmWhisper, widgetVariants };
44196
+ export { AIChat, AIChatModal, AIChatTrigger, AIReconciliationPanel, AccessDeniedPage, ActionButton2 as ActionButton, ActionButtonsBar, ActiveFilters, AddContactModal, AddServiceCard, AdditionalFields, Address, AddressCard, AddressCompact, AddressDisplay, AddressForm, AddressInline, AppHeader, AppHeaderActions, AppHeaderBrand, AppHeaderDivider, AppHeaderIconButton, AppHeaderSearch, AppHeaderSection, AppHeaderTitle, AppHeaderUserMenu, Assessment, AuthButtons, AuthDialog, BookAppointmentButton, BookingDialog, BusinessHours, BusinessHoursEditor, ButtonGroup, CHANGE_TYPE_LABELS, CONCERN_STATUS_LABELS, CSVColumnMapper, CSVFileUpload, CardSkeleton, CaseContextBar, CaseManagementHeader, CheckrIntegration, ClaimListingButton, ClaimProviderForm, CodingChips, CommandPalette, CommandPaletteProvider, CommandPaletteTrigger, CompactCookieBanner, CompactFilterBar, CompactHeader, CompactHours, CompactProviderHeader, ConditionEditor, ConnectionStatusBadge, ConnectionStatusBar, ConnectionStatusOverlay, ConsentSwitch, CookieConsentBanner, CopyrightText, CountBadge, CountryDropdown, CreateInvoiceModal, CreateReferralModal, DEFAULT_ERROR_CONFIGS, DEFAULT_LANGUAGES, DEFAULT_RADIUS_OPTIONS, DEFAULT_SOCIAL_PROVIDERS, DOTBadge, DashboardWidget, DashboardWidgetActions, DashboardWidgetDataCards, DashboardWidgetInfo, DashboardWidgetTable, DateRangeFilter, DateRangePicker, DialogOverlay, DisclaimerText, DockablePanel, DocumentDetectionOverlay, DocumentScanner, DropZone, DropzoneOverlay, EditUserRoleModal, EmployeeForm, EmployeeProfileCard, EmployerContactCard, EmployerList, EmployerPricingCard, EmployerServiceModal, EmployerView, ErrorPage, FileManager, FilePreview, FloatingAIChat, FloatingInput, FooterLinkSection, SocialMediaLinks2 as FooterSocialLinks, HRISProviderSelector, HandsFreeChat, HealthSurveillance, HelpSupportPanel, HeroSearchBar, HeyOzwell, HeyOzwellToggle, HoursSummary, ImagingOrderEditor, InlineBookingForm, InventoryManager, InviteUserModal, InvoiceList, InvoicePaymentPage, InvoiceView, LabOrderEditor, LanguageSelector, LanguageSelectorInline, LanguageSelectorNative, LegalLinks, LoadingBar, LoadingDots, LoadingOverlay, LoadingPage, LoadingSkeleton, MODEL_MANIFEST, MaintenancePage, MobileBackButton, MobileMenuButton, MobileMenuPanel, ModelInfoList, NavLinks, NewsletterForm, NotFoundPage, NotificationCenter, ORDER_TYPE_META, ORDER_TYPE_SEARCH_DOMAINS, OfflinePage, OnboardingCompletion, OnboardingStepQuestion, OnboardingWizard, OpenStatusBadge, OrderCard, OrderConfirmation, OrderConfirmationWizard, OrderDetailSidebar, OrderEditor, OrderList, OrderLookupForm, OrderSidebar, OrderSidebarTabs, OzwellChat, OzwellSettingsMenu, PageHeader, PatientHeader, PaymentHistoryTable, PaymentMethodBank, PaymentMethodCard, PaymentMethodList, PendingClaimsTable, PermissionsEditor, PillSelect, PresentingProblems, ProblemList, ProcedureOrderEditor, ProductVersion, ProductVersionBadge, Breadcrumb2 as ProviderBreadcrumb, ProviderCard, ProviderCardGrid, ProviderCardSkeleton, ProviderDetailHeader, ProviderDetailHeaderSkeleton, ProviderLogo2 as ProviderLogo, ProviderOverview, ProviderSearchBar, ProviderSearchFilters, ProviderSelector, ProviderSettings, SocialMediaLinks as ProviderSocialLinks, ProviderUsersTable, QuickBookCard, QuickLinksCard, RELEVANCE_LABELS, RecurringServiceAddCard, RecurringServiceCard, RecurringServiceGrid, RecurringServiceSetupModal, ReferralEditor, RejectionModal, ReportDashboard, ReportDatePicker, ReportLink, ReportTimeRange, ResultsEntryCard, ResultsEntryForm, ResultsEntryModal, SSOConfigForm, ScheduleCalendar, SearchResultsMessage, SelectedServicesBadges, ServerErrorPage, ServiceAccordion, ServiceBadge, ServiceBadgeGroup, ServiceCard, ServiceCategoryBadge, ServiceGeneralSettings, ServiceGrid, ServiceLink, ServiceList, ServiceMultiSelect, ServicePicker, ServicePricingManager, ServiceSelect, ServiceShippingSettings, ServiceTagCloud, ServiceTagCloudBadges, SetupServiceModal, Sidebar, SidebarContent, SidebarFooter, SidebarHeader, SidebarMobileToggle, SidebarNav, SidebarNavGroup, SidebarNavItem, SidebarProvider, SidebarSearch, SidebarToggle, SimpleFooter, SiteFooter, SiteHeader, SiteLogo, StepIndicator, StripeBadge, StripeSecureBadge, SuggestedActions, TableOfContents, TimelineEventList, TimelineProgress, Toast, ToastContainer, ToastProvider, UncertaintyBadge, UpdateAvailableOverlay, UserMenu, VerifiedBadge2 as VerifiedBadge, VisitScribe, VoiceManager, VoiceSetup, WEBSITE_TYPES, WebChartReportViewer, WebcamModal, WebsiteInput, WebsiteInputGroup, askOzwell, askOzwellStream, attributeSegments, calculateDateRange, centroid, chime, clearVoiceprints, clearWhatPrints, clusterEmbeddings, concernGroupKey, concernHistoryContent, cosine, countBadgeVariants, countChipVariants, create24HourSchedule, createDefaultSchedule, createWeekdaySchedule, currentAssertion, decodeTo16kMono, defaultCaseManagementHeaderLabels, defaultOrderTabs, defaultReconciliationIsEqual, endsWithDone, formatAddressLines, formatAddressSingleLine, formatCityState, formatCityStateZip, generateId, getDefaultPresets, getDictationLoad, getExtendedPresets, getGoogleMapsSearchUrl, getGoogleMapsUrl, getOzwellConfig, getVoiceprints, getWakeWarm, inferSpeakerRoles, isConditionCodetype, isOzwellConfigured, isValidUrl, isWhisperLoaded, labelClusters, loadWhatPrints, medicationToOrder, mergeTurns, openRollingRecorder, orderToMedication, orderTypeForCodetype, panelVariants as reconciliationPanelVariants, saveWhatPrints, setVoiceprints, stripStopPhrase, subscribeDictationLoad, subscribeWakeWarm, toOzwellMessages, transcribeBlob, transcribeGate, transcribeSamples, transcribeSegments, transcribeServer, trimTrailingStopPhrase, useCamera, useCommandPalette, useConnectionStatus, useCookieConsent, useDiarization, useDocumentDetection, useDropzone, useFileUpload, useHeyOzwell, useOptionalToast, useSidebar, useSpeakerVerify, useToast, useVisitScribe, useVoiceSetup, useWakeWord, warmStopGate, warmWakeModels, warmWhisper, widgetVariants };
45314
44197
  //# sourceMappingURL=index.js.map
45315
44198
  //# sourceMappingURL=index.js.map