@nivaro/react 0.3.113 → 0.3.115

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 (285) hide show
  1. package/dist/components/ScreenShareHost.js +24 -0
  2. package/dist/full.css +50 -2
  3. package/dist/hooks/useSessionRecorder.js +61 -60
  4. package/dist/index.d.ts +1727 -19
  5. package/dist/index.js +1091 -950
  6. package/dist/shared/components/ActivityEntry.js +209 -97
  7. package/dist/shared/components/AgentPresenceChip.js +51 -0
  8. package/dist/shared/components/AnnouncementBanner.js +56 -41
  9. package/dist/shared/components/AutolinkedText.js +98 -85
  10. package/dist/shared/components/BroadcastView.js +149 -141
  11. package/dist/shared/components/CacheStamp.js +78 -30
  12. package/dist/shared/components/CollectionBrowserView.js +4088 -3592
  13. package/dist/shared/components/ConfigChangeStrip.js +63 -0
  14. package/dist/shared/components/ConfigReachNote.js +107 -0
  15. package/dist/shared/components/ConformanceView.js +389 -319
  16. package/dist/shared/components/DataTable.js +544 -504
  17. package/dist/shared/components/DelegateCoverLine.js +164 -0
  18. package/dist/shared/components/EnvironmentNotice.js +56 -65
  19. package/dist/shared/components/FilePreviewLightbox.js +89 -43
  20. package/dist/shared/components/FindingFixedMark.js +23 -0
  21. package/dist/shared/components/GridPresenceLine.js +100 -0
  22. package/dist/shared/components/IdleReloadWatcher.js +82 -43
  23. package/dist/shared/components/InStep.js +46 -0
  24. package/dist/shared/components/ItemEditForm.js +5504 -4889
  25. package/dist/shared/components/LiveAnnouncer.js +62 -0
  26. package/dist/shared/components/LiveCount.js +54 -0
  27. package/dist/shared/components/LiveFigure.js +28 -0
  28. package/dist/shared/components/LiveListControls.js +114 -0
  29. package/dist/shared/components/LiveNewMatchesPill.js +25 -0
  30. package/dist/shared/components/LiveOffNote.js +44 -0
  31. package/dist/shared/components/LivePreferenceHost.js +42 -0
  32. package/dist/shared/components/LiveRowMark.js +25 -20
  33. package/dist/shared/components/LiveTraceView.js +257 -0
  34. package/dist/shared/components/MapView.js +30 -29
  35. package/dist/shared/components/MatrixEditor.js +497 -462
  36. package/dist/shared/components/MyWorkView.js +346 -272
  37. package/dist/shared/components/NotificationBell.js +215 -201
  38. package/dist/shared/components/PageRenderer.js +636 -599
  39. package/dist/shared/components/PresenceDot.js +21 -0
  40. package/dist/shared/components/ProfileView.js +656 -536
  41. package/dist/shared/components/RealtimeStatusBanner.js +25 -25
  42. package/dist/shared/components/RecentRecordsRail.js +51 -48
  43. package/dist/shared/components/RecordCompare.js +241 -150
  44. package/dist/shared/components/RecordDrilldownSheet.js +66 -64
  45. package/dist/shared/components/RecordGridEditor.js +350 -311
  46. package/dist/shared/components/RecordHoverCard.js +147 -0
  47. package/dist/shared/components/RecordPeekHost.js +111 -0
  48. package/dist/shared/components/RecordReadView.js +414 -412
  49. package/dist/shared/components/RelativeTime.js +16 -0
  50. package/dist/shared/components/ReportView.js +1396 -1304
  51. package/dist/shared/components/ScreenRefreshButton.js +77 -0
  52. package/dist/shared/components/TabCountHost.js +10 -0
  53. package/dist/shared/components/TickerNumber.js +19 -18
  54. package/dist/shared/components/TipLayer.js +70 -58
  55. package/dist/shared/components/WidgetImageMenu.js +59 -0
  56. package/dist/shared/components/WidgetSlot.js +571 -524
  57. package/dist/shared/components/activity/RecordActivityStream.js +317 -0
  58. package/dist/shared/components/bulk/BulkSelectionNotices.js +220 -0
  59. package/dist/shared/components/cbv/approval-changed.js +20 -0
  60. package/dist/shared/components/cbv/changed-by-others.js +251 -0
  61. package/dist/shared/components/cbv/column-totals.js +75 -67
  62. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +320 -0
  63. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  65. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  66. package/dist/shared/components/change-proposals/types.js +4 -0
  67. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  68. package/dist/shared/components/chat/Composer.js +276 -298
  69. package/dist/shared/components/chat/room-due.js +13 -0
  70. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  71. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  72. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  73. package/dist/shared/components/imports/ImportConsole.js +159 -155
  74. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  75. package/dist/shared/components/integrations/SendStatus.js +202 -0
  76. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  77. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  78. package/dist/shared/components/integrations/console/api.js +161 -117
  79. package/dist/shared/components/integrations/console/tone.js +15 -12
  80. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  81. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  82. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  83. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  84. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  85. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  86. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  87. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  88. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  89. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  90. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  91. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  92. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  93. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  94. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  95. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  96. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  97. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  98. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  99. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  100. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  101. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  102. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  103. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  104. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  105. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  106. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  107. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  108. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  109. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  110. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  111. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  112. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  113. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  114. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  115. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  116. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  117. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  118. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  119. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  120. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  121. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  122. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  123. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  124. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  125. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  126. package/dist/shared/components/item-edit/file-live.js +77 -0
  127. package/dist/shared/components/item-edit/file-processing.js +87 -0
  128. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  129. package/dist/shared/components/item-edit/live-related.js +23 -0
  130. package/dist/shared/components/item-edit/live-title.js +66 -0
  131. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  132. package/dist/shared/components/item-edit/removed-line.js +58 -0
  133. package/dist/shared/components/item-edit/render-stability.js +70 -59
  134. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  135. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  136. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  137. package/dist/shared/components/list/InlineEdit.js +504 -208
  138. package/dist/shared/components/list/ListViewers.js +81 -0
  139. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  140. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  141. package/dist/shared/components/merge/merge-values.js +110 -0
  142. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  143. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  144. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  145. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  146. package/dist/shared/components/notifications/bundles.js +21 -19
  147. package/dist/shared/components/notifications/resolved-line.js +25 -0
  148. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  149. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  150. package/dist/shared/components/panels/AlertBanners.js +132 -0
  151. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  152. package/dist/shared/components/panels/BranchLanes.js +82 -54
  153. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  154. package/dist/shared/components/panels/CommentImages.js +219 -0
  155. package/dist/shared/components/panels/CommentPanel.js +649 -530
  156. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  157. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  158. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  159. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  160. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  161. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  162. package/dist/shared/components/panels/SlaClock.js +130 -99
  163. package/dist/shared/components/panels/TaskPanel.js +308 -287
  164. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  165. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  166. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  167. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  168. package/dist/shared/components/profile/AgentNameField.js +141 -0
  169. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  170. package/dist/shared/components/profile/PersonAccess.js +398 -330
  171. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  172. package/dist/shared/components/profile/PersonProfile.js +81 -73
  173. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  174. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  175. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  176. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  177. package/dist/shared/components/queue/QueueWorklist.js +2076 -1686
  178. package/dist/shared/components/queue/queue-totals.js +92 -0
  179. package/dist/shared/components/queue/worklist-helpers.js +18 -14
  180. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  181. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  182. package/dist/shared/components/support/ReportProblem.js +1 -0
  183. package/dist/shared/components/support/ScreenShare.js +554 -0
  184. package/dist/shared/components/support/SupportView.js +160 -129
  185. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  186. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  187. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  188. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  189. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  190. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  191. package/dist/shared/lib/activity-sentence.js +87 -75
  192. package/dist/shared/lib/agent-presence.js +46 -0
  193. package/dist/shared/lib/approval-progress.js +49 -0
  194. package/dist/shared/lib/attention-prefs.js +27 -0
  195. package/dist/shared/lib/cell-locks.js +56 -0
  196. package/dist/shared/lib/co-edit.js +166 -0
  197. package/dist/shared/lib/coedit-registry.js +44 -0
  198. package/dist/shared/lib/comment-awareness.js +124 -0
  199. package/dist/shared/lib/comment-images.js +45 -0
  200. package/dist/shared/lib/config-watch.js +94 -0
  201. package/dist/shared/lib/copy-rules.js +65 -0
  202. package/dist/shared/lib/count-step.js +30 -0
  203. package/dist/shared/lib/deadline-ticker.js +68 -0
  204. package/dist/shared/lib/derived-causes.js +115 -0
  205. package/dist/shared/lib/draft-store.js +114 -85
  206. package/dist/shared/lib/error-hints.js +1 -0
  207. package/dist/shared/lib/field-merge.js +126 -0
  208. package/dist/shared/lib/filter-sentence.js +10 -10
  209. package/dist/shared/lib/focus-mode.js +16 -12
  210. package/dist/shared/lib/grid-cursors.js +77 -0
  211. package/dist/shared/lib/grid-presence.js +182 -0
  212. package/dist/shared/lib/idle-reload.js +100 -73
  213. package/dist/shared/lib/in-step.js +45 -0
  214. package/dist/shared/lib/integration-chip.js +19 -18
  215. package/dist/shared/lib/line-locks.js +141 -0
  216. package/dist/shared/lib/line-split.js +41 -0
  217. package/dist/shared/lib/linked-changes.js +150 -0
  218. package/dist/shared/lib/list-link.js +56 -50
  219. package/dist/shared/lib/list-return.js +231 -0
  220. package/dist/shared/lib/list-viewers.js +52 -0
  221. package/dist/shared/lib/live-announcer.js +86 -0
  222. package/dist/shared/lib/live-counts.js +85 -0
  223. package/dist/shared/lib/live-data-changed.js +108 -0
  224. package/dist/shared/lib/live-deltas.js +81 -0
  225. package/dist/shared/lib/live-findings.js +113 -0
  226. package/dist/shared/lib/live-groups.js +122 -0
  227. package/dist/shared/lib/live-link-labels.js +162 -0
  228. package/dist/shared/lib/live-list-flow.js +334 -0
  229. package/dist/shared/lib/live-list.js +143 -129
  230. package/dist/shared/lib/live-moves.js +51 -0
  231. package/dist/shared/lib/live-ops.js +26 -26
  232. package/dist/shared/lib/live-pickers.js +7 -0
  233. package/dist/shared/lib/live-preference.js +184 -0
  234. package/dist/shared/lib/live-queries.js +226 -181
  235. package/dist/shared/lib/live-screen.js +333 -0
  236. package/dist/shared/lib/live-search.js +108 -0
  237. package/dist/shared/lib/live-seen.js +35 -0
  238. package/dist/shared/lib/live-views.js +100 -0
  239. package/dist/shared/lib/live.js +159 -133
  240. package/dist/shared/lib/missed-updates.js +198 -0
  241. package/dist/shared/lib/newer-file.js +56 -0
  242. package/dist/shared/lib/notification-sound.js +42 -20
  243. package/dist/shared/lib/own-writes.js +59 -41
  244. package/dist/shared/lib/picker-badges.js +94 -0
  245. package/dist/shared/lib/presence-signals.js +131 -84
  246. package/dist/shared/lib/realtime.js +49 -24
  247. package/dist/shared/lib/record-gaps.js +85 -0
  248. package/dist/shared/lib/record-outbox.js +369 -222
  249. package/dist/shared/lib/record-peek.js +75 -0
  250. package/dist/shared/lib/record-tabs.js +92 -72
  251. package/dist/shared/lib/relative-ticker.js +42 -0
  252. package/dist/shared/lib/request-gate.js +119 -119
  253. package/dist/shared/lib/rollup-recalc.js +107 -0
  254. package/dist/shared/lib/room-gaps.js +40 -36
  255. package/dist/shared/lib/rum.js +137 -87
  256. package/dist/shared/lib/save-progress.js +20 -0
  257. package/dist/shared/lib/scheduled-countdown.js +67 -0
  258. package/dist/shared/lib/screen-refresh.js +160 -0
  259. package/dist/shared/lib/screen-share.js +234 -0
  260. package/dist/shared/lib/seen-since.js +74 -0
  261. package/dist/shared/lib/selection-watch.js +205 -0
  262. package/dist/shared/lib/send-status.js +132 -0
  263. package/dist/shared/lib/send-view.js +23 -0
  264. package/dist/shared/lib/socket-liveness.js +155 -0
  265. package/dist/shared/lib/socket-realtime.js +168 -140
  266. package/dist/shared/lib/state-census.js +53 -0
  267. package/dist/shared/lib/summary-mode.js +61 -39
  268. package/dist/shared/lib/tab-attention.js +143 -32
  269. package/dist/shared/lib/table-density.js +64 -0
  270. package/dist/shared/lib/track-travel.js +40 -0
  271. package/dist/shared/lib/unseen-changes.js +68 -0
  272. package/dist/shared/lib/upload-file.js +33 -0
  273. package/dist/shared/lib/upload-presence.js +127 -0
  274. package/dist/shared/lib/urgent-chime.js +65 -0
  275. package/dist/shared/lib/use-online-users.js +32 -11
  276. package/dist/shared/lib/user-sync.js +155 -39
  277. package/dist/shared/lib/waiting-count.js +44 -0
  278. package/dist/shared/lib/watch-desktop.js +83 -0
  279. package/dist/shared/lib/watch-list.js +447 -0
  280. package/dist/shared/lib/widget-image-render.js +64 -0
  281. package/dist/shared/lib/widget-image.js +111 -0
  282. package/dist/shared/lib/worker-socket.js +130 -104
  283. package/dist/shared/lib/write-to-screen.js +133 -0
  284. package/package.json +1 -1
  285. package/styles.css +49 -1
@@ -1,78 +1,81 @@
1
1
  import { jsx as n, jsxs as p } from "react/jsx-runtime";
2
- import { useQuery as C } from "@tanstack/react-query";
3
- import { ChevronDown as me, Loader2 as we, AlertTriangle as Ue, X as _e, Check as Ne, Mail as st } from "lucide-react";
2
+ import { useQuery as O } from "@tanstack/react-query";
3
+ import { ChevronDown as fe, Loader2 as we, AlertTriangle as Ue, X as _e, Check as Ne, Mail as st } from "lucide-react";
4
4
  import { useState as Q, useRef as Ce, useEffect as qe } from "react";
5
- import { useNivaroClient as Oe, useItemEditAuth as Ie, useDrilldown as it } from "../../context.js";
5
+ import { useNivaroClient as Oe, useItemEditAuth as Pe, useDrilldown as it } from "../../context.js";
6
6
  import { parseAllowedCollections as at } from "../../lib/allowed-collections.js";
7
7
  import { get as $ } from "../../lib/commands.js";
8
- import { compareByMatch as Pe } from "../../lib/picker-rank.js";
9
- import { useRecordReader as ot } from "../../lib/record-loader.js";
8
+ import { pickerOptionsMeta as ot } from "../../lib/live-pickers.js";
9
+ import { useOptionBadges as ct } from "../../lib/picker-badges.js";
10
+ import { compareByMatch as Ie } from "../../lib/picker-rank.js";
11
+ import { useRecordReader as dt } from "../../lib/record-loader.js";
10
12
  import { useOnlineUsers as De } from "../../lib/use-online-users.js";
11
- import { cn as Z, userOptionFilter as Ee, matchesAllTokens as ct } from "../../lib/utils.js";
12
- import { UserAvatar as Me } from "../UserAvatar.js";
13
- import { Command as Je, CommandInput as ze, CommandList as Ge, CommandEmpty as Ve, CommandGroup as Le, CommandItem as Fe } from "../ui/command.js";
14
- import { Popover as Be, PopoverTrigger as We, PopoverContent as Ze } from "../ui/popover.js";
15
- import { applyDisplayTemplate as fe } from "./helpers.js";
16
- import { useM2MStaging as Qe } from "./M2MStagingContext.js";
17
- import { onlyCloseMatches as dt } from "./picker-search.js";
18
- import { useStaleTip as ut, RelatedItemLabel as de } from "./RelationCombobox.js";
19
- function Re(t) {
13
+ import { cn as Z, userOptionFilter as Me, matchesAllTokens as ut } from "../../lib/utils.js";
14
+ import { UserAvatar as Ee } from "../UserAvatar.js";
15
+ import { RecordPickerBadges as mt, PickerBadgeList as ft } from "./PickerBadges.js";
16
+ import { Command as Je, CommandInput as ze, CommandList as Be, CommandEmpty as Ge, CommandGroup as Le, CommandItem as Fe } from "../ui/command.js";
17
+ import { Popover as Ve, PopoverTrigger as Re, PopoverContent as We } from "../ui/popover.js";
18
+ import { applyDisplayTemplate as pe } from "./helpers.js";
19
+ import { useM2MStaging as Ze } from "./M2MStagingContext.js";
20
+ import { onlyCloseMatches as pt } from "./picker-search.js";
21
+ import { useStaleTip as ht, RelatedItemLabel as ue } from "./RelationCombobox.js";
22
+ function Qe(t) {
20
23
  return t.replace(/\(.*$/, "").trim().split(/\s+/).map((l) => l[0]).filter(Boolean).slice(0, 2).join("").toUpperCase() || "?";
21
24
  }
22
- function se(t) {
25
+ function ie(t) {
23
26
  return at(t == null ? void 0 : t.one_allowed_collections);
24
27
  }
25
- const mt = /^m2a:([A-Za-z_][A-Za-z0-9_]*):(.+)$/;
28
+ const yt = /^m2a:([A-Za-z_][A-Za-z0-9_]*):(.+)$/;
26
29
  function Te(t, l) {
27
30
  return `m2a:${t}:${String(l)}`;
28
31
  }
29
- function ue(t) {
32
+ function me(t) {
30
33
  if (typeof t != "string") return null;
31
- const l = t.match(mt);
34
+ const l = t.match(yt);
32
35
  return l ? { collection: l[1], id: l[2] } : null;
33
36
  }
34
- function ft(t) {
37
+ function bt(t) {
35
38
  if (!t || t.one_collection) return [];
36
- const l = se(t);
39
+ const l = ie(t);
37
40
  return l.length < 2 ? [] : l.filter((d) => d !== "directus_users" && d !== "nivaro_users");
38
41
  }
39
- function Xe(t, l, d, a) {
40
- const o = ft(l), { data: k } = C({
41
- queryKey: ["m2a-extra-options", o.join(",")],
42
+ function Xe(t, l, d, o) {
43
+ const c = bt(l), { data: v } = O({
44
+ queryKey: ["m2a-extra-options", c.join(",")],
42
45
  queryFn: async () => {
43
46
  const f = [];
44
- for (const m of o) {
45
- const [q, r] = await Promise.all([
46
- t.request($(`/collections/${m}`)).then((b) => b.data).catch(() => null),
47
- t.request($(`/items/${m}`, { limit: 500 })).then((b) => b.data ?? []).catch(() => [])
47
+ for (const m of c) {
48
+ const [L, r] = await Promise.all([
49
+ t.request($(`/collections/${m}`)).then((h) => h.data).catch(() => null),
50
+ t.request($(`/items/${m}`, { limit: 500 })).then((h) => h.data ?? []).catch(() => [])
48
51
  ]);
49
- for (const b of r)
52
+ for (const h of r)
50
53
  f.push({
51
- token: Te(m, b.id),
54
+ token: Te(m, h.id),
52
55
  collection: m,
53
- label: fe((q == null ? void 0 : q.display_template) ?? null, b)
56
+ label: pe((L == null ? void 0 : L.display_template) ?? null, h)
54
57
  });
55
58
  }
56
59
  return f;
57
60
  },
58
- enabled: a && o.length > 0,
61
+ enabled: o && c.length > 0,
59
62
  staleTime: 6e4
60
63
  }), x = d.trim().toLowerCase();
61
- return (k ?? []).filter((f) => !x || f.label.toLowerCase().includes(x)).sort((f, m) => f.label.localeCompare(m.label)).slice(0, 25);
64
+ return (v ?? []).filter((f) => !x || f.label.toLowerCase().includes(x)).sort((f, m) => f.label.localeCompare(m.label)).slice(0, 25);
62
65
  }
63
66
  function He({
64
67
  options: t,
65
68
  isSelected: l,
66
69
  onPick: d,
67
- round: a
70
+ round: o
68
71
  }) {
69
- return t.length === 0 ? null : /* @__PURE__ */ n(Le, { heading: "External emails", "data-m2a-extra-options": "", children: t.map((o) => {
70
- const k = l(o.token);
72
+ return t.length === 0 ? null : /* @__PURE__ */ n(Le, { heading: "External emails", "data-m2a-extra-options": "", children: t.map((c) => {
73
+ const v = l(c.token);
71
74
  return /* @__PURE__ */ p(
72
75
  Fe,
73
76
  {
74
- value: o.token,
75
- onSelect: () => d(o.token),
77
+ value: c.token,
78
+ onSelect: () => d(c.token),
76
79
  className: "flex items-center gap-2 text-[12px]",
77
80
  children: [
78
81
  /* @__PURE__ */ n(
@@ -80,51 +83,51 @@ function He({
80
83
  {
81
84
  className: Z(
82
85
  "flex h-4 w-4 shrink-0 items-center justify-center border transition-colors",
83
- a ? "rounded-full" : "rounded",
84
- k ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
86
+ o ? "rounded-full" : "rounded",
87
+ v ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
85
88
  ),
86
- children: k && /* @__PURE__ */ n(Ne, { className: "h-2.5 w-2.5 text-white" })
89
+ children: v && /* @__PURE__ */ n(Ne, { className: "h-2.5 w-2.5 text-white" })
87
90
  }
88
91
  ),
89
92
  /* @__PURE__ */ n(st, { className: "h-3.5 w-3.5 shrink-0 text-slate-400", "aria-hidden": !0 }),
90
- /* @__PURE__ */ n("span", { className: "truncate", children: o.label })
93
+ /* @__PURE__ */ n("span", { className: "truncate", children: c.label })
91
94
  ]
92
95
  },
93
- o.token
96
+ c.token
94
97
  );
95
98
  }) });
96
99
  }
97
100
  function Ye(t) {
98
- return !t || t.one_collection || se(t).length < 2 ? null : t.one_collection_field || "collection";
101
+ return !t || t.one_collection || ie(t).length < 2 ? null : t.one_collection_field || "collection";
99
102
  }
100
103
  function Se(t, l, d) {
101
104
  if (!l || !t) return d;
102
- const a = t[l];
103
- if (typeof a != "string" || !a.trim()) return d;
104
- const o = a.trim();
105
- return o === "directus_users" || o === "nivaro_users" ? "nivaro_users" : o;
105
+ const o = t[l];
106
+ if (typeof o != "string" || !o.trim()) return d;
107
+ const c = o.trim();
108
+ return c === "directus_users" || c === "nivaro_users" ? "nivaro_users" : c;
106
109
  }
107
110
  function je({ collection: t, id: l }) {
108
- const d = Oe(), { data: a } = C({
111
+ const d = Oe(), { data: o } = O({
109
112
  queryKey: ["col-meta", t],
110
- queryFn: () => d.request($(`/collections/${t}`)).then((o) => o.data),
113
+ queryFn: () => d.request($(`/collections/${t}`)).then((c) => c.data),
111
114
  staleTime: 3e5,
112
115
  retry: !1
113
116
  });
114
- return /* @__PURE__ */ n("span", { "data-m2a-collection": t, children: /* @__PURE__ */ n(de, { collection: t, id: l, displayTemplate: a == null ? void 0 : a.display_template }) });
117
+ return /* @__PURE__ */ n("span", { "data-m2a-collection": t, children: /* @__PURE__ */ n(ue, { collection: t, id: l, displayTemplate: o == null ? void 0 : o.display_template }) });
115
118
  }
116
- function At(t) {
117
- return !t || t.one_collection ? 0 : se(t).length;
119
+ function Mt(t) {
120
+ return !t || t.one_collection ? 0 : ie(t).length;
118
121
  }
119
122
  function et(t) {
120
123
  if (!t) return null;
121
124
  if (t.one_collection) return t.one_collection;
122
- const l = se(t);
125
+ const l = ie(t);
123
126
  return l.length === 0 ? null : l.some((d) => d === "directus_users" || d === "nivaro_users") ? "nivaro_users" : l[0];
124
127
  }
125
- function Kt(t) {
128
+ function Et(t) {
126
129
  if (!t || t.one_collection) return null;
127
- const l = se(t);
130
+ const l = ie(t);
128
131
  if (l.length === 0) return null;
129
132
  const d = l.includes("directus_users") ? "directus_users" : l.includes("nivaro_users") ? "nivaro_users" : l[0];
130
133
  return { field: t.one_collection_field ?? "collection", value: d };
@@ -132,109 +135,113 @@ function Kt(t) {
132
135
  function W(t) {
133
136
  return String(t).toLowerCase();
134
137
  }
135
- function jt({
138
+ function Jt({
136
139
  relation: t,
137
140
  parentId: l,
138
141
  allRelations: d,
139
- extraFilter: a,
140
- optionSort: o,
141
- requiredParent: k,
142
+ extraFilter: o,
143
+ optionSort: c,
144
+ requiredParent: v,
142
145
  onCountChange: x,
143
146
  drilldown: f
144
147
  }) {
145
- const m = Oe(), q = it(), r = Qe(), [b, O] = Q(!1), [h, j] = Q(""), S = d.find(
148
+ const m = Oe(), L = it(), r = Ze(), [h, A] = Q(!1), [b, F] = Q(""), j = d.find(
146
149
  (e) => e.many_collection === t.many_collection && e.many_field === t.junction_field && e.id !== t.id
147
- ), i = et(S), L = t.junction_field ?? "", R = t.many_field ?? "", g = t.one_field ?? `${t.many_collection}.${L}`, F = Ye(S), { data: y } = C({
150
+ ), i = et(j), _ = t.junction_field ?? "", X = t.many_field ?? "", g = t.one_field ?? `${t.many_collection}.${_}`, T = Ye(j), { data: y } = O({
148
151
  queryKey: ["col-meta", i],
149
152
  queryFn: () => m.request($(`/collections/${i}`)).then((e) => e.data),
150
153
  enabled: !!i,
151
154
  staleTime: 3e5,
152
155
  retry: !1
153
- }), { data: ie = [] } = C({
156
+ }), { data: ae = [] } = O({
154
157
  // An M2A read carries the discriminator: its own key (same prefix, so every
155
158
  // ['m2m-items', junction, …] invalidation still refreshes it).
156
159
  queryKey: [
157
160
  "m2m-items",
158
161
  t.many_collection,
159
- R,
162
+ X,
160
163
  l,
161
- ...F ? ["m2a"] : []
164
+ ...T ? ["m2a"] : []
162
165
  ],
163
166
  queryFn: () => m.request(
164
167
  $(`/items/${t.many_collection}`, {
165
- filter: JSON.stringify({ [R]: { _eq: l } }),
168
+ filter: JSON.stringify({ [X]: { _eq: l } }),
166
169
  limit: 200,
167
- fields: `id,${L}${F ? `,${F}` : ""}`
170
+ fields: `id,${_}${T ? `,${T}` : ""}`
168
171
  })
169
172
  ).then((e) => e.data ?? []),
170
173
  staleTime: 3e4,
171
174
  enabled: !!l && l !== "new"
172
- }), X = (e) => Se(e, F, i), he = Ie().isAdmin, D = i === "nivaro_users" ? Ee(he) : null, ye = De(i === "nivaro_users"), H = a ? D ? { _and: [a, D] } : a : D, Y = H ? JSON.stringify(H) : void 0, ee = o && !/^-?label$/.test(o) ? o : void 0, be = (() => {
175
+ }), H = (e) => Se(e, T, i), ye = Pe().isAdmin, I = i === "nivaro_users" ? Me(ye) : null, be = De(i === "nivaro_users"), Y = o ? I ? { _and: [o, I] } : o : I, ee = Y ? JSON.stringify(Y) : void 0, te = c && !/^-?label$/.test(c) ? c : void 0, xe = (() => {
173
176
  const e = y == null ? void 0 : y.display_template;
174
177
  if (!e || !e.includes(".")) return null;
175
- const c = [...e.matchAll(/\{\{([^}]+)\}\}/g)].map((u) => u[1].trim());
176
- return c.length === 0 ? null : ["id", ...c].join(",");
178
+ const a = [...e.matchAll(/\{\{([^}]+)\}\}/g)].map((u) => u[1].trim());
179
+ return a.length === 0 ? null : ["id", ...a].join(",");
177
180
  })(), {
178
- options: te,
179
- isLoading: E,
180
- localSearch: ae,
181
+ options: B,
182
+ isLoading: D,
183
+ localSearch: oe,
181
184
  closeMatches: ne
182
185
  } = tt({
183
186
  client: m,
184
187
  relatedCollection: i,
185
- search: h,
186
- filterParam: Y,
187
- serverSort: ee,
188
- templateNestedFields: be,
189
- enabled: b && !!i,
190
- labelOf: K
191
- }), xe = rt(!!ne, h), ge = Xe(m, S, h, b), U = (r == null ? void 0 : r.getStagedLinks(g)) ?? [], z = (r == null ? void 0 : r.getStagedUnlinks(g)) ?? /* @__PURE__ */ new Set(), v = ie.filter((e) => !z.has(e.id));
192
- new Set(v.map((e) => String(e[L])));
193
- const G = (e) => {
194
- const c = X(e);
195
- return c && c !== i ? Te(c, e[L]) : e[L];
196
- }, N = [
188
+ search: b,
189
+ filterParam: ee,
190
+ serverSort: te,
191
+ templateNestedFields: xe,
192
+ enabled: h && !!i,
193
+ labelOf: N
194
+ }), ge = rt(!!ne, b), ke = Xe(m, j, b, h), U = (r == null ? void 0 : r.getStagedLinks(g)) ?? [], G = (r == null ? void 0 : r.getStagedUnlinks(g)) ?? /* @__PURE__ */ new Set(), k = ae.filter((e) => !G.has(e.id));
195
+ new Set(k.map((e) => String(e[_])));
196
+ const V = (e) => {
197
+ const a = H(e);
198
+ return a && a !== i ? Te(a, e[_]) : e[_];
199
+ }, q = [
197
200
  ...new Set(
198
- v.filter((e) => X(e) === i).map((e) => String(e[L]))
201
+ k.filter((e) => H(e) === i).map((e) => String(e[_]))
199
202
  )
200
- ], _ = JSON.stringify(a ? { _and: [{ id: { _in: N } }, a] } : { id: { _in: N } }), { data: re } = C({
201
- queryKey: ["m2m-avail", i, N.join(","), Y],
203
+ ], S = JSON.stringify(o ? { _and: [{ id: { _in: q } }, o] } : { id: { _in: q } }), { data: re } = O({
204
+ queryKey: ["m2m-avail", i, q.join(","), ee],
202
205
  queryFn: () => m.request(
203
206
  $(`/items/${i}`, {
204
- filter: _,
207
+ filter: S,
205
208
  picker: "1",
206
209
  limit: 200,
207
210
  fields: "id"
208
211
  })
209
212
  ).then((e) => e.data ?? []),
210
- enabled: !!i && N.length > 0,
213
+ enabled: !!i && q.length > 0,
211
214
  staleTime: 3e4
212
- }), V = new Set((re ?? []).map((e) => String(e.id))), M = re !== void 0 ? new Set(N.filter((e) => !V.has(e))) : /* @__PURE__ */ new Set(), A = new Set(U.map(W)), I = /* @__PURE__ */ new Set([
213
- ...v.map((e) => W(G(e))),
214
- ...A
215
- ]), P = Ce(x);
216
- P.current = x, qe(() => {
215
+ }), R = new Set((re ?? []).map((e) => String(e.id))), M = re !== void 0 ? new Set(q.filter((e) => !R.has(e))) : /* @__PURE__ */ new Set(), K = new Set(U.map(W)), P = /* @__PURE__ */ new Set([
216
+ ...k.map((e) => W(V(e))),
217
+ ...K
218
+ ]), le = ct(
219
+ i,
220
+ (B ?? []).map((e) => e.id),
221
+ h && i !== "nivaro_users"
222
+ ), E = Ce(x);
223
+ E.current = x, qe(() => {
217
224
  var e;
218
- (e = P.current) == null || e.call(P, I.size);
219
- }, [I.size]);
220
- function le(e) {
221
- const c = W(e);
222
- if (A.has(c)) {
225
+ (e = E.current) == null || e.call(E, P.size);
226
+ }, [P.size]);
227
+ function se(e) {
228
+ const a = W(e);
229
+ if (K.has(a)) {
223
230
  r == null || r.unstageLink(g, e);
224
231
  return;
225
232
  }
226
- const u = ie.find((T) => W(G(T)) === c);
233
+ const u = ae.find((C) => W(V(C)) === a);
227
234
  if (u) {
228
- z.has(u.id) ? r == null || r.unstageUnlink(g, u.id) : r == null || r.stageUnlink(g, u.id);
235
+ G.has(u.id) ? r == null || r.unstageUnlink(g, u.id) : r == null || r.stageUnlink(g, u.id);
229
236
  return;
230
237
  }
231
238
  r == null || r.stageLink(g, e);
232
239
  }
233
- function K(e) {
234
- const c = (y == null ? void 0 : y.display_template) ?? null;
235
- return c ? fe(c, e) : String(e._display ?? e.id ?? "");
240
+ function N(e) {
241
+ const a = (y == null ? void 0 : y.display_template) ?? null;
242
+ return a ? pe(a, e) : String(e._display ?? e.id ?? "");
236
243
  }
237
- return k ? /* @__PURE__ */ p(
244
+ return v ? /* @__PURE__ */ p(
238
245
  "button",
239
246
  {
240
247
  type: "button",
@@ -243,35 +250,35 @@ function jt({
243
250
  children: [
244
251
  /* @__PURE__ */ p("span", { className: "truncate", children: [
245
252
  "Select ",
246
- k,
253
+ v,
247
254
  " first"
248
255
  ] }),
249
- /* @__PURE__ */ n(me, { className: "h-4 w-4 shrink-0 opacity-50" })
256
+ /* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
250
257
  ]
251
258
  }
252
259
  ) : /* @__PURE__ */ n("div", { children: /* @__PURE__ */ p(
253
- Be,
260
+ Ve,
254
261
  {
255
- open: b,
262
+ open: h,
256
263
  onOpenChange: (e) => {
257
- O(e), e || j("");
264
+ A(e), e || F("");
258
265
  },
259
266
  children: [
260
- /* @__PURE__ */ n(We, { asChild: !0, children: /* @__PURE__ */ p(
267
+ /* @__PURE__ */ n(Re, { asChild: !0, children: /* @__PURE__ */ p(
261
268
  "div",
262
269
  {
263
270
  role: "button",
264
271
  tabIndex: 0,
265
272
  onKeyDown: (e) => {
266
- if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (b || h !== "" || e.key !== " ")) {
273
+ if (e.key.length === 1 && !e.ctrlKey && !e.metaKey && !e.altKey && (h || b !== "" || e.key !== " ")) {
267
274
  e.preventDefault();
268
275
  const u = e.key;
269
- j((T) => u === " " && (T === "" || T.endsWith(" ")) ? T : T + u), b || O(!0);
270
- } else (e.key === "Enter" || e.key === " " || !b && e.key === "ArrowDown") && (e.preventDefault(), O((u) => !u));
276
+ F((C) => u === " " && (C === "" || C.endsWith(" ")) ? C : C + u), h || A(!0);
277
+ } else (e.key === "Enter" || e.key === " " || !h && e.key === "ArrowDown") && (e.preventDefault(), A((u) => !u));
271
278
  },
272
279
  className: "flex min-h-9 w-full cursor-pointer items-center justify-between gap-2 rounded-md border border-input bg-background px-3 py-1 text-sm text-left font-normal hover:bg-muted",
273
280
  children: [
274
- I.size > 0 ? /* @__PURE__ */ p(
281
+ P.size > 0 ? /* @__PURE__ */ p(
275
282
  "span",
276
283
  {
277
284
  className: "flex min-w-0 flex-1 flex-wrap items-center gap-1",
@@ -279,51 +286,52 @@ function jt({
279
286
  e.target.closest("button") && e.stopPropagation();
280
287
  },
281
288
  children: [
282
- v.map((e) => {
283
- const c = e[L], u = X(e), T = u !== i, B = !T && M.has(String(c));
289
+ k.map((e) => {
290
+ const a = e[_], u = H(e), C = u !== i, J = !C && M.has(String(a));
284
291
  return /* @__PURE__ */ p(
285
292
  "span",
286
293
  {
287
- title: B ? "This record is no longer an available option" : void 0,
294
+ title: J ? "This record is no longer an available option" : void 0,
288
295
  className: Z(
289
296
  "inline-flex items-center gap-1 rounded-full border pl-2.5 pr-1.5 py-0.5 text-[12px]",
290
- B ? "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-600 dark:bg-amber-950/30 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-slate-200"
297
+ J ? "border-amber-300 bg-amber-50 text-amber-700 dark:border-amber-600 dark:bg-amber-950/30 dark:text-amber-400" : "border-slate-200 bg-slate-50 text-slate-700 dark:border-border dark:bg-muted dark:text-slate-200"
291
298
  ),
292
299
  children: [
293
- B && /* @__PURE__ */ n(Ue, { className: "h-3 w-3 shrink-0 text-amber-500" }),
294
- u && (T ? (
300
+ J && /* @__PURE__ */ n(Ue, { className: "h-3 w-3 shrink-0 text-amber-500" }),
301
+ u && (C ? (
295
302
  // An external email (or another allowed kind): its own
296
303
  // table, its own label — never read as a person.
297
- /* @__PURE__ */ n(je, { collection: u, id: c })
298
- ) : f && q ? /* @__PURE__ */ n(
304
+ /* @__PURE__ */ n(je, { collection: u, id: a })
305
+ ) : f && L ? /* @__PURE__ */ n(
299
306
  "button",
300
307
  {
301
308
  type: "button",
302
309
  title: "Open detail panel",
303
- onClick: () => q.open({
310
+ onClick: () => L.open({
304
311
  collection: u,
305
- itemId: String(c),
312
+ itemId: String(a),
306
313
  layoutId: f.layout_id,
307
314
  width: f.width
308
315
  }),
309
316
  className: "underline decoration-slate-300 decoration-dotted underline-offset-2 hover:text-[#172940] hover:decoration-nvr-cyan dark:hover:text-nvr-cyan",
310
317
  children: /* @__PURE__ */ n(
311
- de,
318
+ ue,
312
319
  {
313
320
  collection: u,
314
- id: c,
321
+ id: a,
315
322
  displayTemplate: y == null ? void 0 : y.display_template
316
323
  }
317
324
  )
318
325
  }
319
326
  ) : /* @__PURE__ */ n(
320
- de,
327
+ ue,
321
328
  {
322
329
  collection: u,
323
- id: c,
330
+ id: a,
324
331
  displayTemplate: y == null ? void 0 : y.display_template
325
332
  }
326
333
  )),
334
+ u && !C && u !== "nivaro_users" && /* @__PURE__ */ n(mt, { collection: u, id: a }),
327
335
  /* @__PURE__ */ n(
328
336
  "button",
329
337
  {
@@ -344,14 +352,14 @@ function jt({
344
352
  {
345
353
  className: "inline-flex items-center gap-1 rounded-full border border-dashed border-nvr-cyan/50 bg-nvr-cyan/5 pl-2.5 pr-1.5 py-0.5 text-[12px] text-slate-600 dark:text-slate-300",
346
354
  children: [
347
- ue(e) ? /* @__PURE__ */ n(
355
+ me(e) ? /* @__PURE__ */ n(
348
356
  je,
349
357
  {
350
- collection: ue(e).collection,
351
- id: ue(e).id
358
+ collection: me(e).collection,
359
+ id: me(e).id
352
360
  }
353
361
  ) : i ? /* @__PURE__ */ n(
354
- de,
362
+ ue,
355
363
  {
356
364
  collection: i,
357
365
  id: e,
@@ -375,48 +383,48 @@ function jt({
375
383
  ]
376
384
  }
377
385
  ) : /* @__PURE__ */ n("span", { className: "truncate text-muted-foreground", children: "Select items…" }),
378
- /* @__PURE__ */ n(me, { className: "h-4 w-4 shrink-0 opacity-50" })
386
+ /* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
379
387
  ]
380
388
  }
381
389
  ) }),
382
- /* @__PURE__ */ n(Ze, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ p(
390
+ /* @__PURE__ */ n(We, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ p(
383
391
  Je,
384
392
  {
385
393
  shouldFilter: !1,
386
- ...xe,
394
+ ...ge,
387
395
  children: [
388
396
  /* @__PURE__ */ n(
389
397
  ze,
390
398
  {
391
399
  placeholder: "Search…",
392
- value: h,
393
- onValueChange: j,
400
+ value: b,
401
+ onValueChange: F,
394
402
  className: "h-9 text-[13px]"
395
403
  }
396
404
  ),
397
- /* @__PURE__ */ p(Ge, { children: [
398
- E ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(we, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(Ve, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
399
- !E && ne && /* @__PURE__ */ p(
405
+ /* @__PURE__ */ p(Be, { children: [
406
+ D ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(we, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(Ge, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
407
+ !D && ne && /* @__PURE__ */ p(
400
408
  "p",
401
409
  {
402
410
  "data-picker-close-matches": !0,
403
411
  className: "px-3 pb-1 pt-2 text-[11.5px] text-muted-foreground",
404
412
  children: [
405
413
  "No exact match for “",
406
- h.trim(),
414
+ b.trim(),
407
415
  "” — did you mean:"
408
416
  ]
409
417
  }
410
418
  ),
411
- /* @__PURE__ */ n(Le, { children: !E && (ee ? [...pe(te, h, ae, K)] : [...pe(te, h, ae, K)].sort(
412
- (e, c) => Pe(K(e), K(c), h, o === "-label")
419
+ /* @__PURE__ */ n(Le, { children: !D && (te ? [...he(B, b, oe, N)] : [...he(B, b, oe, N)].sort(
420
+ (e, a) => Ie(N(e), N(a), b, c === "-label")
413
421
  )).map((e) => {
414
- const c = String(e.id), u = I.has(W(c));
422
+ const a = String(e.id), u = P.has(W(a));
415
423
  return /* @__PURE__ */ p(
416
424
  Fe,
417
425
  {
418
- value: c,
419
- onSelect: () => le(e.id),
426
+ value: a,
427
+ onSelect: () => se(e.id),
420
428
  className: "flex items-center gap-2 text-[13px]",
421
429
  children: [
422
430
  /* @__PURE__ */ n(
@@ -430,32 +438,33 @@ function jt({
430
438
  }
431
439
  ),
432
440
  i === "nivaro_users" && /* @__PURE__ */ n(
433
- Me,
441
+ Ee,
434
442
  {
435
- userId: c,
443
+ userId: a,
436
444
  className: "h-4 w-4",
437
- fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Re(K(e)) })
445
+ fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Qe(N(e)) })
438
446
  }
439
447
  ),
440
- i === "nivaro_users" && ye.has(c.toUpperCase()) && /* @__PURE__ */ n(
448
+ i === "nivaro_users" && be.has(a.toUpperCase()) && /* @__PURE__ */ n(
441
449
  "span",
442
450
  {
443
451
  className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
444
452
  "data-tip": "Online now"
445
453
  }
446
454
  ),
447
- /* @__PURE__ */ n("span", { className: "truncate", children: K(e) })
455
+ /* @__PURE__ */ n("span", { className: "truncate", children: N(e) }),
456
+ /* @__PURE__ */ n(ft, { badges: le[a] })
448
457
  ]
449
458
  },
450
- c
459
+ a
451
460
  );
452
461
  }) }),
453
462
  /* @__PURE__ */ n(
454
463
  He,
455
464
  {
456
- options: ge,
457
- isSelected: (e) => I.has(W(e)),
458
- onPick: (e) => le(e),
465
+ options: ke,
466
+ isSelected: (e) => P.has(W(e)),
467
+ onPick: (e) => se(e),
459
468
  round: !1
460
469
  }
461
470
  )
@@ -468,150 +477,152 @@ function jt({
468
477
  ) });
469
478
  }
470
479
  function tt(t) {
471
- const { client: l, relatedCollection: d, search: a, filterParam: o, serverSort: k, templateNestedFields: x } = t, f = (S) => l.request(
480
+ const { client: l, relatedCollection: d, search: o, filterParam: c, serverSort: v, templateNestedFields: x } = t, f = (i) => l.request(
472
481
  $(`/items/${d}`, {
473
482
  limit: nt,
474
- search: S || void 0,
483
+ search: i || void 0,
475
484
  // Typo pass (fix11-search): close matches only when the exact search finds nothing.
476
- ...S ? { typo: "1" } : {},
477
- filter: o,
485
+ ...i ? { typo: "1" } : {},
486
+ filter: c,
478
487
  picker: "1",
479
488
  // A dotted display template ({{core_category.name}}) needs the
480
489
  // nested expansion — a bare row only carries the FK id.
481
490
  ...x ? { fields: x } : {},
482
- ...k ? { sort: k } : {}
491
+ ...v ? { sort: v } : {}
483
492
  })
484
- ).then((i) => i.data ?? []), m = (S) => [
493
+ ).then((_) => _.data ?? []), m = (i) => [
485
494
  "m2m-options",
486
495
  d,
487
- S,
488
- o,
489
- k ?? "",
496
+ i,
497
+ c,
498
+ v ?? "",
490
499
  x ?? ""
491
- ], q = o ? 0 : 3e4, { data: r, isFetching: b } = C({
500
+ ], L = c ? 0 : 3e4, r = ot(d), { data: h, isFetching: A } = O({
492
501
  queryKey: m(""),
493
502
  queryFn: () => f(""),
494
503
  enabled: t.enabled,
495
- staleTime: q
496
- }), O = pt(r, a, t.labelOf), { data: h, isFetching: j } = C({
497
- queryKey: m(a),
498
- queryFn: () => f(a),
499
- enabled: t.enabled && O,
500
- staleTime: q
504
+ staleTime: L,
505
+ meta: r
506
+ }), b = xt(h, o, t.labelOf), { data: F, isFetching: j } = O({
507
+ queryKey: m(o),
508
+ queryFn: () => f(o),
509
+ enabled: t.enabled && b,
510
+ staleTime: L,
511
+ meta: r
501
512
  });
502
- return O ? {
503
- options: h ?? [],
504
- isLoading: !h && j,
513
+ return b ? {
514
+ options: F ?? [],
515
+ isLoading: !F && j,
505
516
  localSearch: !1,
506
- closeMatches: dt(h)
507
- } : { options: r ?? [], isLoading: !r && b, localSearch: !!a };
517
+ closeMatches: pt(F)
518
+ } : { options: h ?? [], isLoading: !h && A, localSearch: !!o };
508
519
  }
509
520
  const nt = 200;
510
- function pt(t, l, d) {
511
- return l.trim() ? !t || t.length >= nt ? !0 : pe(t, l, !0, d).length === 0 : !1;
521
+ function xt(t, l, d) {
522
+ return l.trim() ? !t || t.length >= nt ? !0 : he(t, l, !0, d).length === 0 : !1;
512
523
  }
513
- function pe(t, l, d, a) {
514
- return !d || !l.trim() ? t : t.filter((o) => ct(a(o), l));
524
+ function he(t, l, d, o) {
525
+ return !d || !l.trim() ? t : t.filter((c) => ut(o(c), l));
515
526
  }
516
- function Ut({
527
+ function zt({
517
528
  relation: t,
518
529
  parentId: l,
519
530
  allRelations: d,
520
- extraFilter: a,
521
- optionSort: o,
522
- requiredParent: k,
531
+ extraFilter: o,
532
+ optionSort: c,
533
+ requiredParent: v,
523
534
  onCountChange: x,
524
535
  readOnly: f
525
536
  }) {
526
- const m = Oe(), q = ot(), r = Qe(), [b, O] = Q(!1), [h, j] = Q(""), S = d.find(
537
+ const m = Oe(), L = dt(), r = Ze(), [h, A] = Q(!1), [b, F] = Q(""), j = d.find(
527
538
  (s) => s.many_collection === t.many_collection && s.many_field === t.junction_field && s.id !== t.id
528
- ), i = et(S), L = t.junction_field ?? "", R = t.many_field ?? "", g = t.one_field ?? `${t.many_collection}.${L}`, { data: F } = C({
539
+ ), i = et(j), _ = t.junction_field ?? "", X = t.many_field ?? "", g = t.one_field ?? `${t.many_collection}.${_}`, { data: T } = O({
529
540
  queryKey: ["col-meta", i],
530
541
  queryFn: () => m.request($(`/collections/${i}`)).then((s) => s.data),
531
542
  enabled: !!i,
532
543
  staleTime: 3e5,
533
544
  retry: !1
534
- }), y = Ye(S), { data: ie = [], isFetching: X } = C({
545
+ }), y = Ye(j), { data: ae = [], isFetching: H } = O({
535
546
  queryKey: [
536
547
  "m2m-items",
537
548
  t.many_collection,
538
- R,
549
+ X,
539
550
  l,
540
551
  ...y ? ["m2a"] : []
541
552
  ],
542
553
  queryFn: () => m.request(
543
554
  $(`/items/${t.many_collection}`, {
544
- filter: JSON.stringify({ [R]: { _eq: l } }),
555
+ filter: JSON.stringify({ [X]: { _eq: l } }),
545
556
  limit: 1,
546
- fields: `id,${L}${y ? `,${y}` : ""}`
557
+ fields: `id,${_}${y ? `,${y}` : ""}`
547
558
  })
548
559
  ).then((s) => s.data ?? []),
549
560
  staleTime: 3e4,
550
561
  enabled: !!l && l !== "new"
551
- }), he = Ie().isAdmin, D = i === "nivaro_users" ? Ee(he) : null, ye = De(i === "nivaro_users"), H = a ? D ? { _and: [a, D] } : a : D, Y = H ? JSON.stringify(H) : void 0, ee = o && !/^-?label$/.test(o) ? o : void 0, be = (() => {
552
- const s = F == null ? void 0 : F.display_template;
562
+ }), ye = Pe().isAdmin, I = i === "nivaro_users" ? Me(ye) : null, be = De(i === "nivaro_users"), Y = o ? I ? { _and: [o, I] } : o : I, ee = Y ? JSON.stringify(Y) : void 0, te = c && !/^-?label$/.test(c) ? c : void 0, xe = (() => {
563
+ const s = T == null ? void 0 : T.display_template;
553
564
  if (!s || !s.includes(".")) return null;
554
- const w = [...s.matchAll(/\{\{([^}]+)\}\}/g)].map((ce) => ce[1].trim());
565
+ const w = [...s.matchAll(/\{\{([^}]+)\}\}/g)].map((de) => de[1].trim());
555
566
  return w.length === 0 ? null : ["id", ...w].join(",");
556
567
  })(), {
557
- options: te,
558
- isLoading: E,
559
- localSearch: ae,
568
+ options: B,
569
+ isLoading: D,
570
+ localSearch: oe,
560
571
  closeMatches: ne
561
572
  } = tt({
562
573
  client: m,
563
574
  relatedCollection: i,
564
- search: h,
565
- filterParam: Y,
566
- serverSort: ee,
567
- templateNestedFields: be,
568
- enabled: b && !!i,
569
- labelOf: J
570
- }), xe = rt(!!ne, h), ge = Xe(m, S, h, b), U = (r == null ? void 0 : r.getStagedLinks(g)) ?? [], z = (r == null ? void 0 : r.getStagedUnlinks(g)) ?? /* @__PURE__ */ new Set(), v = ie.find((s) => !z.has(s.id)) ?? null, G = v ? v[L] : null, N = U.length > 0 ? U[U.length - 1] : null, _ = N ?? G, re = U.length > 0 || z.size > 0, V = Ce(x);
571
- V.current = x, qe(() => {
575
+ search: b,
576
+ filterParam: ee,
577
+ serverSort: te,
578
+ templateNestedFields: xe,
579
+ enabled: h && !!i,
580
+ labelOf: z
581
+ }), ge = rt(!!ne, b), ke = Xe(m, j, b, h), U = (r == null ? void 0 : r.getStagedLinks(g)) ?? [], G = (r == null ? void 0 : r.getStagedUnlinks(g)) ?? /* @__PURE__ */ new Set(), k = ae.find((s) => !G.has(s.id)) ?? null, V = k ? k[_] : null, q = U.length > 0 ? U[U.length - 1] : null, S = q ?? V, re = U.length > 0 || G.size > 0, R = Ce(x);
582
+ R.current = x, qe(() => {
572
583
  var s;
573
- (s = V.current) == null || s.call(V, _ != null ? 1 : 0);
574
- }, [_]);
575
- const M = ue(N), A = N != null ? (M == null ? void 0 : M.collection) ?? i : Se(v, y, i), I = M ? M.id : _, P = Se(v, y, i), le = v == null ? null : P && P !== i ? Te(P, G) : String(G), K = N != null ? String(N) : le, e = A !== i, { data: c } = C({
576
- queryKey: ["col-meta", A],
577
- queryFn: () => m.request($(`/collections/${A}`)).then((s) => s.data),
578
- enabled: e && !!A,
584
+ (s = R.current) == null || s.call(R, S != null ? 1 : 0);
585
+ }, [S]);
586
+ const M = me(q), K = q != null ? (M == null ? void 0 : M.collection) ?? i : Se(k, y, i), P = M ? M.id : S, le = Se(k, y, i), E = k == null ? null : le && le !== i ? Te(le, V) : String(V), se = q != null ? String(q) : E, N = K !== i, { data: e } = O({
587
+ queryKey: ["col-meta", K],
588
+ queryFn: () => m.request($(`/collections/${K}`)).then((s) => s.data),
589
+ enabled: N && !!K,
579
590
  staleTime: 3e5,
580
591
  retry: !1
581
- }), { data: u } = C({
582
- queryKey: ["relation-single", A, String(I)],
583
- queryFn: () => q(A, I),
584
- enabled: !!A && I != null,
592
+ }), { data: a } = O({
593
+ queryKey: ["relation-single", K, String(P)],
594
+ queryFn: () => L(K, P),
595
+ enabled: !!K && P != null,
585
596
  staleTime: 6e4
586
- }), T = JSON.stringify(a ? { _and: [{ id: { _eq: _ } }, a] } : { id: { _eq: _ } }), { data: B } = C({
587
- queryKey: ["relation-avail", i, String(_), Y],
597
+ }), u = JSON.stringify(o ? { _and: [{ id: { _eq: S } }, o] } : { id: { _eq: S } }), { data: C } = O({
598
+ queryKey: ["relation-avail", i, String(S), ee],
588
599
  queryFn: () => m.request(
589
600
  $(`/items/${i}`, {
590
- filter: T,
601
+ filter: u,
591
602
  picker: "1",
592
603
  limit: 1,
593
604
  fields: "id"
594
605
  })
595
606
  ).then((s) => s.data ?? []),
596
- enabled: !!i && !e && _ != null && !!u,
607
+ enabled: !!i && !N && S != null && !!a,
597
608
  staleTime: 3e4
598
- }), ve = !e && B !== void 0 && B.length === 0, $e = ut(ve);
599
- function J(s) {
600
- const w = (F == null ? void 0 : F.display_template) ?? null;
601
- return w ? fe(w, s) : String(s.name ?? s.title ?? s.label ?? s.id ?? "");
609
+ }), J = !N && C !== void 0 && C.length === 0, $e = ht(J);
610
+ function z(s) {
611
+ const w = (T == null ? void 0 : T.display_template) ?? null;
612
+ return w ? pe(w, s) : String(s.name ?? s.title ?? s.label ?? s.id ?? "");
602
613
  }
603
- const oe = e ? u : te.find((s) => String(s.id) === String(_)) ?? u, Ae = _ != null && !u && !oe, ke = oe ? e ? fe((c == null ? void 0 : c.display_template) ?? null, oe) : J(oe) : null;
614
+ const ce = N ? a : B.find((s) => String(s.id) === String(S)) ?? a, Ae = S != null && !a && !ce, ve = ce ? N ? pe((e == null ? void 0 : e.display_template) ?? null, ce) : z(ce) : null;
604
615
  if (f)
605
- return /* @__PURE__ */ n("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: Ae ? "…" : ke ?? "—" });
616
+ return /* @__PURE__ */ n("span", { className: "block truncate text-[12px] text-slate-700 dark:text-slate-200", children: Ae ? "…" : ve ?? "—" });
606
617
  function Ke(s) {
607
618
  for (const w of U) r == null || r.unstageLink(g, w);
608
- v && !z.has(v.id) && (r == null || r.stageUnlink(g, v.id)), String(s) === le && v ? r == null || r.unstageUnlink(g, v.id) : String(s) !== K && (r == null || r.stageLink(g, s)), O(!1), j("");
619
+ k && !G.has(k.id) && (r == null || r.stageUnlink(g, k.id)), String(s) === E && k ? r == null || r.unstageUnlink(g, k.id) : String(s) !== se && (r == null || r.stageLink(g, s)), A(!1), F("");
609
620
  }
610
621
  function lt() {
611
622
  for (const s of U) r == null || r.unstageLink(g, s);
612
- v && (r == null || r.stageUnlink(g, v.id)), O(!1);
623
+ k && (r == null || r.stageUnlink(g, k.id)), A(!1);
613
624
  }
614
- return k ? /* @__PURE__ */ p(
625
+ return v ? /* @__PURE__ */ p(
615
626
  "button",
616
627
  {
617
628
  type: "button",
@@ -620,68 +631,68 @@ function Ut({
620
631
  children: [
621
632
  /* @__PURE__ */ p("span", { className: "truncate text-muted-foreground", children: [
622
633
  "Select ",
623
- k,
634
+ v,
624
635
  " first"
625
636
  ] }),
626
- /* @__PURE__ */ n(me, { className: "h-4 w-4 shrink-0 opacity-50" })
637
+ /* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
627
638
  ]
628
639
  }
629
640
  ) : /* @__PURE__ */ p("div", { ...$e.bind, children: [
630
641
  /* @__PURE__ */ p(
631
- Be,
642
+ Ve,
632
643
  {
633
- open: b,
644
+ open: h,
634
645
  onOpenChange: (s) => {
635
- O(s), s || j("");
646
+ A(s), s || F("");
636
647
  },
637
648
  children: [
638
- /* @__PURE__ */ n(We, { asChild: !0, children: /* @__PURE__ */ p(
649
+ /* @__PURE__ */ n(Re, { asChild: !0, children: /* @__PURE__ */ p(
639
650
  "button",
640
651
  {
641
652
  type: "button",
642
653
  className: Z(
643
654
  "w-full h-9 px-3 text-[12px] border rounded-md bg-background text-left flex items-center justify-between hover:bg-muted cursor-pointer transition-colors disabled:pointer-events-none disabled:opacity-50",
644
- ve ? "border-amber-300 dark:border-amber-600" : re ? "border-nvr-cyan/50" : "border-input"
655
+ J ? "border-amber-300 dark:border-amber-600" : re ? "border-nvr-cyan/50" : "border-input"
645
656
  ),
646
657
  children: [
647
- Ae || X && N == null && l !== "new" ? /* @__PURE__ */ n(we, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ p(
658
+ Ae || H && q == null && l !== "new" ? /* @__PURE__ */ n(we, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : /* @__PURE__ */ p(
648
659
  "span",
649
660
  {
650
661
  className: Z(
651
662
  "flex items-center gap-1.5 truncate min-w-0",
652
- ke ? re ? "text-nvr-cyan" : "text-slate-800 dark:text-slate-100" : "text-muted-foreground"
663
+ ve ? re ? "text-nvr-cyan" : "text-slate-800 dark:text-slate-100" : "text-muted-foreground"
653
664
  ),
654
665
  children: [
655
- ve && /* @__PURE__ */ n(Ue, { className: "h-3.5 w-3.5 shrink-0 text-amber-500" }),
656
- /* @__PURE__ */ n("span", { className: "truncate", children: ke ?? "Select…" })
666
+ J && /* @__PURE__ */ n(Ue, { className: "h-3.5 w-3.5 shrink-0 text-amber-500" }),
667
+ /* @__PURE__ */ n("span", { className: "truncate", children: ve ?? "Select…" })
657
668
  ]
658
669
  }
659
670
  ),
660
- /* @__PURE__ */ n(me, { className: "h-4 w-4 shrink-0 opacity-50" })
671
+ /* @__PURE__ */ n(fe, { className: "h-4 w-4 shrink-0 opacity-50" })
661
672
  ]
662
673
  }
663
674
  ) }),
664
- /* @__PURE__ */ n(Ze, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ p(
675
+ /* @__PURE__ */ n(We, { className: "w-[320px] p-0", align: "start", children: /* @__PURE__ */ p(
665
676
  Je,
666
677
  {
667
678
  shouldFilter: !1,
668
- ...xe,
679
+ ...ge,
669
680
  children: [
670
681
  /* @__PURE__ */ n(
671
682
  ze,
672
683
  {
673
684
  placeholder: "Search…",
674
- value: h,
675
- onValueChange: j,
685
+ value: b,
686
+ onValueChange: F,
676
687
  className: "h-9 text-[12px]"
677
688
  }
678
689
  ),
679
- _ != null && /* @__PURE__ */ p(
690
+ S != null && /* @__PURE__ */ p(
680
691
  "button",
681
692
  {
682
693
  type: "button",
683
694
  onClick: () => {
684
- lt(), O(!1);
695
+ lt(), A(!1);
685
696
  },
686
697
  className: "flex w-full items-center gap-2 px-3 py-1.5 text-[13px] text-slate-500 hover:bg-muted border-b border-slate-100 dark:text-slate-400 dark:border-border",
687
698
  children: [
@@ -690,24 +701,24 @@ function Ut({
690
701
  ]
691
702
  }
692
703
  ),
693
- /* @__PURE__ */ p(Ge, { children: [
694
- E ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(we, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(Ve, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
695
- !E && ne && /* @__PURE__ */ p(
704
+ /* @__PURE__ */ p(Be, { children: [
705
+ D ? /* @__PURE__ */ n("div", { className: "flex items-center justify-center py-4", children: /* @__PURE__ */ n(we, { className: "h-4 w-4 animate-spin text-muted-foreground" }) }) : /* @__PURE__ */ n(Ge, { className: "py-3 text-left text-[12px] text-muted-foreground px-3", children: "No results" }),
706
+ !D && ne && /* @__PURE__ */ p(
696
707
  "p",
697
708
  {
698
709
  "data-picker-close-matches": !0,
699
710
  className: "px-3 pb-1 pt-2 text-[11.5px] text-muted-foreground",
700
711
  children: [
701
712
  "No exact match for “",
702
- h.trim(),
713
+ b.trim(),
703
714
  "” — did you mean:"
704
715
  ]
705
716
  }
706
717
  ),
707
- !E && /* @__PURE__ */ n(Le, { children: [...pe(te, h, ae, J)].sort(
708
- (s, w) => ee ? 0 : Pe(J(s), J(w), h, o === "-label")
718
+ !D && /* @__PURE__ */ n(Le, { children: [...he(B, b, oe, z)].sort(
719
+ (s, w) => te ? 0 : Ie(z(s), z(w), b, c === "-label")
709
720
  ).map((s) => {
710
- const w = String(s.id), ce = String(_) === w;
721
+ const w = String(s.id), de = String(S) === w;
711
722
  return /* @__PURE__ */ p(
712
723
  Fe,
713
724
  {
@@ -720,27 +731,27 @@ function Ut({
720
731
  {
721
732
  className: Z(
722
733
  "flex h-4 w-4 shrink-0 items-center justify-center rounded-full border transition-colors",
723
- ce ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
734
+ de ? "border-nvr-cyan bg-nvr-cyan" : "border-slate-300 dark:border-slate-500"
724
735
  ),
725
- children: ce && /* @__PURE__ */ n(Ne, { className: "h-2.5 w-2.5 text-white" })
736
+ children: de && /* @__PURE__ */ n(Ne, { className: "h-2.5 w-2.5 text-white" })
726
737
  }
727
738
  ),
728
739
  i === "nivaro_users" && /* @__PURE__ */ n(
729
- Me,
740
+ Ee,
730
741
  {
731
742
  userId: w,
732
743
  className: "h-4 w-4",
733
- fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Re(J(s)) })
744
+ fallback: /* @__PURE__ */ n("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[8px] font-bold text-nvr-navy dark:text-nvr-cyan", children: Qe(z(s)) })
734
745
  }
735
746
  ),
736
- i === "nivaro_users" && ye.has(w.toUpperCase()) && /* @__PURE__ */ n(
747
+ i === "nivaro_users" && be.has(w.toUpperCase()) && /* @__PURE__ */ n(
737
748
  "span",
738
749
  {
739
750
  className: "h-1.5 w-1.5 shrink-0 rounded-full bg-emerald-500",
740
751
  "data-tip": "Online now"
741
752
  }
742
753
  ),
743
- /* @__PURE__ */ n("span", { className: "truncate", children: J(s) })
754
+ /* @__PURE__ */ n("span", { className: "truncate", children: z(s) })
744
755
  ]
745
756
  },
746
757
  w
@@ -749,8 +760,8 @@ function Ut({
749
760
  /* @__PURE__ */ n(
750
761
  He,
751
762
  {
752
- options: ge,
753
- isSelected: (s) => K === s,
763
+ options: ke,
764
+ isSelected: (s) => se === s,
754
765
  onPick: (s) => Ke(s),
755
766
  round: !0
756
767
  }
@@ -766,13 +777,13 @@ function Ut({
766
777
  ] });
767
778
  }
768
779
  function rt(t, l) {
769
- const [d, a] = Q(null), [o, k] = Q(!1), x = Ce(!1);
780
+ const [d, o] = Q(null), [c, v] = Q(!1), x = Ce(!1);
770
781
  return qe(() => {
771
- a(null), x.current = !1;
782
+ o(null), x.current = !1;
772
783
  }, [l]), t ? {
773
- value: d ?? (o ? " " : ""),
784
+ value: d ?? (c ? " " : ""),
774
785
  onValueChange: (f) => {
775
- x.current ? a(f) : k((m) => !m);
786
+ x.current ? o(f) : v((m) => !m);
776
787
  },
777
788
  onKeyDownCapture: (f) => {
778
789
  f.key === "ArrowDown" || f.key === "ArrowUp" ? x.current = !0 : f.key === "Enter" && !x.current && (f.preventDefault(), f.stopPropagation());
@@ -783,18 +794,18 @@ function rt(t, l) {
783
794
  } : {};
784
795
  }
785
796
  export {
786
- jt as M2MCombobox,
787
- Ut as M2MSingleSelectCombobox,
797
+ Jt as M2MCombobox,
798
+ zt as M2MSingleSelectCombobox,
788
799
  je as OwnCollectionLabel,
789
- At as m2aAllowedCount,
800
+ Mt as m2aAllowedCount,
790
801
  Ye as m2aDiscriminator,
791
- ft as m2aExtraCollections,
802
+ bt as m2aExtraCollections,
792
803
  Se as m2aRowCollection,
793
804
  Te as m2aToken,
794
- Kt as m2aWriteMeta,
795
- pt as m2mAsksServer,
805
+ Et as m2aWriteMeta,
806
+ xt as m2mAsksServer,
796
807
  W as m2mIdKey,
797
- pe as narrowM2MOptions,
798
- ue as parseM2aToken,
808
+ he as narrowM2MOptions,
809
+ me as parseM2aToken,
799
810
  et as resolveM2MRelatedCollection
800
811
  };