@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
@@ -0,0 +1,251 @@
1
+ import { jsxs as l, jsx as a } from "react/jsx-runtime";
2
+ import { History as C, X as P, Check as $ } from "lucide-react";
3
+ import { useState as p } from "react";
4
+ import { cn as S, formatDateTime as T } from "../../lib/utils.js";
5
+ import { Popover as H, PopoverTrigger as D, PopoverContent as _ } from "../ui/popover.js";
6
+ const d = "$changed", L = "Changed by others", x = [
7
+ { value: "1h", label: "Last hour", short: "last hour" },
8
+ { value: "24h", label: "Last 24 hours", short: "last 24 hours" },
9
+ { value: "2d", label: "Last 2 days", short: "last 2 days" },
10
+ { value: "5d", label: "Last 5 days", short: "last 5 days" },
11
+ { value: "7d", label: "Last 7 days", short: "last 7 days" }
12
+ ];
13
+ function M(e) {
14
+ return e.path[0] === d && e.path.length === 1;
15
+ }
16
+ function A(e, t) {
17
+ const n = e ? new Date(e) : null, r = t ? new Date(t) : null;
18
+ return !n || Number.isNaN(n.getTime()) || r && (Number.isNaN(r.getTime()) || r.getTime() < n.getTime()) ? null : `custom:${n.toISOString()}..${r ? r.toISOString() : ""}`;
19
+ }
20
+ function c(e) {
21
+ if (!e.startsWith("custom:")) return null;
22
+ const [t, n] = e.slice(7).split("..");
23
+ return t ? { since: t, until: n || null } : null;
24
+ }
25
+ function V(e) {
26
+ const t = String(e.value ?? "24h"), n = c(t), r = n ? { since: n.since, ...n.until ? { until: n.until } : {}, others: !0 } : { window: x.some((s) => s.value === t) ? t : "24h", others: !0 };
27
+ return { path: [d], op: e.not ? "_neq" : "_eq", value: r };
28
+ }
29
+ function b(e) {
30
+ var r;
31
+ const t = String(e ?? ""), n = c(t);
32
+ if (n) {
33
+ const s = T(n.since);
34
+ return n.until ? `${s} – ${T(n.until)}` : `since ${s}`;
35
+ }
36
+ return ((r = x.find((s) => s.value === t)) == null ? void 0 : r.short) ?? "last 24 hours";
37
+ }
38
+ const E = {
39
+ "1h": "1 hour",
40
+ "24h": "24 hours",
41
+ "2d": "2 days",
42
+ "5d": "5 days",
43
+ "7d": "7 days"
44
+ };
45
+ function F(e) {
46
+ const t = String(e ?? ""), n = c(t);
47
+ if (n) {
48
+ const r = (s) => new Date(s).toLocaleDateString(void 0, { month: "short", day: "numeric" });
49
+ return `${r(n.since)} – ${n.until ? r(n.until) : "now"}`;
50
+ }
51
+ return E[t] ?? "24 hours";
52
+ }
53
+ function R(e) {
54
+ const t = b(e.value), n = c(String(e.value ?? "")) ? t : `in the ${t}`;
55
+ return `Records someone else ${e.not ? "did not change" : "created, edited or moved"} ${n}. Click to change the period.`;
56
+ }
57
+ function X(e) {
58
+ const t = b(e.value), n = c(String(e.value ?? "")) ? t : `in the ${t}`;
59
+ return `${e.not ? "not " : ""}changed by others ${n}`;
60
+ }
61
+ function I(e, t) {
62
+ return {
63
+ id: t ?? `${d}-${Date.now()}`,
64
+ path: [d],
65
+ pathLabels: [L],
66
+ fieldType: "changed",
67
+ op: "_changed",
68
+ value: e
69
+ };
70
+ }
71
+ function g(e) {
72
+ const t = (n) => String(n).padStart(2, "0");
73
+ return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
74
+ }
75
+ function Y({
76
+ filter: e,
77
+ onChange: t
78
+ }) {
79
+ const [n, r] = p(!1), s = e ? String(e.value ?? "") : null, i = s ? c(s) : null, [v, y] = p(!1), [m, w] = p(""), [f, k] = p(""), O = (o) => {
80
+ if (r(o), o) {
81
+ y(!!i);
82
+ const h = /* @__PURE__ */ new Date();
83
+ w(
84
+ g(i ? new Date(i.since) : new Date(h.getTime() - 864e5))
85
+ ), k(i != null && i.until ? g(new Date(i.until)) : "");
86
+ }
87
+ }, N = (o) => {
88
+ t(I(o, e == null ? void 0 : e.id)), r(!1);
89
+ }, u = A(m, f);
90
+ return /* @__PURE__ */ l(H, { open: n, onOpenChange: O, children: [
91
+ e ? /* @__PURE__ */ l(
92
+ "span",
93
+ {
94
+ "data-cbv-changed-chip": "on",
95
+ className: "nvr-pop-in inline-flex h-8 min-w-0 max-w-full items-center gap-1 overflow-hidden whitespace-nowrap rounded-full border border-nvr-cyan/50 bg-nvr-cyan/10 pl-2.5 pr-1 text-[12px] font-medium text-slate-700 dark:text-slate-100",
96
+ children: [
97
+ /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ l(
98
+ "button",
99
+ {
100
+ type: "button",
101
+ "aria-label": `${e.not ? "Not changed" : "Changed"} by others, ${b(s)}. Change the period`,
102
+ "data-tip": R(e),
103
+ className: "inline-flex min-w-0 items-center gap-1",
104
+ children: [
105
+ /* @__PURE__ */ a(
106
+ C,
107
+ {
108
+ "aria-hidden": !0,
109
+ className: "h-3.5 w-3.5 shrink-0 text-[#0089a8] dark:text-nvr-cyan"
110
+ }
111
+ ),
112
+ /* @__PURE__ */ a("span", { className: "ml-0.5 shrink-0", children: e.not ? "Not changed" : "Changed" }),
113
+ /* @__PURE__ */ a("span", { className: "min-w-0 truncate", children: "by others" }),
114
+ /* @__PURE__ */ a("span", { "aria-hidden": !0, className: "shrink-0 text-slate-400", children: "·" }),
115
+ /* @__PURE__ */ a("span", { className: "shrink-0 font-semibold text-[#04516b] dark:text-nvr-cyan", children: F(s) })
116
+ ]
117
+ }
118
+ ) }),
119
+ /* @__PURE__ */ a(
120
+ "button",
121
+ {
122
+ type: "button",
123
+ onClick: () => t(null),
124
+ "aria-label": "Remove the changed by others filter",
125
+ className: "inline-flex h-5 w-5 shrink-0 items-center justify-center rounded text-slate-400 hover:bg-white/60 hover:text-slate-700 dark:hover:bg-slate-800 dark:hover:text-slate-200",
126
+ children: /* @__PURE__ */ a(P, { className: "h-3 w-3" })
127
+ }
128
+ )
129
+ ]
130
+ }
131
+ ) : /* @__PURE__ */ a(D, { asChild: !0, children: /* @__PURE__ */ l(
132
+ "button",
133
+ {
134
+ type: "button",
135
+ "data-cbv-changed-chip": "off",
136
+ "data-tip": "Show only records other people changed recently",
137
+ className: "inline-flex h-8 shrink-0 items-center gap-1.5 whitespace-nowrap rounded-full border border-dashed border-slate-300 px-2.5 text-[12.5px] text-slate-500 hover:border-slate-400 hover:text-slate-700 dark:border-slate-600 dark:text-slate-400 dark:hover:border-slate-500 dark:hover:text-slate-200",
138
+ children: [
139
+ /* @__PURE__ */ a(C, { "aria-hidden": !0, className: "h-3.5 w-3.5" }),
140
+ L
141
+ ]
142
+ }
143
+ ) }),
144
+ /* @__PURE__ */ l(
145
+ _,
146
+ {
147
+ align: "start",
148
+ collisionPadding: 16,
149
+ className: "w-64 max-w-[calc(100vw-32px)] p-1",
150
+ "data-cbv-changed-picker": "",
151
+ children: [
152
+ /* @__PURE__ */ a("p", { className: "px-2 pb-1 pt-1.5 text-[11px] text-slate-500 dark:text-slate-400", children: "Records someone else created, edited or moved" }),
153
+ x.map((o) => {
154
+ const h = s === o.value;
155
+ return /* @__PURE__ */ l(
156
+ "button",
157
+ {
158
+ type: "button",
159
+ "aria-pressed": h,
160
+ "data-changed-period": o.value,
161
+ onClick: () => N(o.value),
162
+ className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12.5px] hover:bg-muted",
163
+ children: [
164
+ /* @__PURE__ */ a($, { className: S("h-3.5 w-3.5 shrink-0", h ? "opacity-100" : "opacity-0") }),
165
+ o.label
166
+ ]
167
+ },
168
+ o.value
169
+ );
170
+ }),
171
+ /* @__PURE__ */ l(
172
+ "button",
173
+ {
174
+ type: "button",
175
+ "aria-pressed": !!i,
176
+ "aria-expanded": v,
177
+ "data-changed-period": "custom",
178
+ onClick: () => y((o) => !o),
179
+ className: "flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-[12.5px] hover:bg-muted",
180
+ children: [
181
+ /* @__PURE__ */ a($, { className: S("h-3.5 w-3.5 shrink-0", i ? "opacity-100" : "opacity-0") }),
182
+ "Custom range…"
183
+ ]
184
+ }
185
+ ),
186
+ v && /* @__PURE__ */ l("div", { className: "mx-1 mb-1 mt-0.5 space-y-2 rounded-md border border-slate-200 p-2 dark:border-slate-700", children: [
187
+ /* @__PURE__ */ l("label", { className: "block text-[11px] text-slate-500 dark:text-slate-400", children: [
188
+ "From",
189
+ /* @__PURE__ */ a(
190
+ "input",
191
+ {
192
+ type: "datetime-local",
193
+ value: m,
194
+ onChange: (o) => w(o.target.value),
195
+ className: "mt-0.5 h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12.5px] text-slate-800 outline-none focus:border-nvr-cyan/50 focus:ring-2 focus:ring-nvr-cyan/30 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100 dark:[color-scheme:dark]"
196
+ }
197
+ )
198
+ ] }),
199
+ /* @__PURE__ */ l("label", { className: "block text-[11px] text-slate-500 dark:text-slate-400", children: [
200
+ "To",
201
+ /* @__PURE__ */ a(
202
+ "input",
203
+ {
204
+ type: "datetime-local",
205
+ value: f,
206
+ onChange: (o) => k(o.target.value),
207
+ className: "mt-0.5 h-8 w-full rounded-md border border-slate-200 bg-white px-2 text-[12.5px] text-slate-800 outline-none focus:border-nvr-cyan/50 focus:ring-2 focus:ring-nvr-cyan/30 dark:border-slate-700 dark:bg-slate-900 dark:text-slate-100 dark:[color-scheme:dark]"
208
+ }
209
+ )
210
+ ] }),
211
+ /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-500 dark:text-slate-400", children: "Leave To empty to include everything up to now." }),
212
+ m && !u && /* @__PURE__ */ a("p", { className: "text-[11px] text-amber-700 dark:text-amber-400", children: "The end must come after the start." }),
213
+ /* @__PURE__ */ a(
214
+ "button",
215
+ {
216
+ type: "button",
217
+ disabled: !u,
218
+ onClick: () => u && N(u),
219
+ className: "h-7 w-full rounded-md bg-nvr-cyan text-[12px] font-medium text-white disabled:opacity-40",
220
+ children: "Apply range"
221
+ }
222
+ )
223
+ ] })
224
+ ]
225
+ }
226
+ )
227
+ ] });
228
+ }
229
+ function z(e, t) {
230
+ return [...e, { path: [d], op: "_eq", value: { since: t, others: !0 } }];
231
+ }
232
+ function J(e) {
233
+ return `${e.toLocaleString()} changed since you last opened this view`;
234
+ }
235
+ export {
236
+ L as CHANGED_LABEL,
237
+ d as CHANGED_PATH,
238
+ x as CHANGED_PERIODS,
239
+ Y as ChangedByOthersChip,
240
+ V as changedCondition,
241
+ I as changedFilterEntry,
242
+ X as changedPhrase,
243
+ R as changedTip,
244
+ F as changedWindowShort,
245
+ b as changedWindowText,
246
+ A as customChangedValue,
247
+ M as isChangedFilter,
248
+ c as parseCustomChanged,
249
+ z as viewChangedConditions,
250
+ J as viewChangedTip
251
+ };
@@ -1,5 +1,5 @@
1
1
  import { formatValue as S } from "../../lib/format-value.js";
2
- const p = [
2
+ const g = [
3
3
  { fn: "sum", label: "Sum", short: "Sum" },
4
4
  { fn: "avg", label: "Average", short: "Avg" },
5
5
  { fn: "min", label: "Minimum", short: "Min" },
@@ -7,66 +7,72 @@ const p = [
7
7
  { fn: "count", label: "Count (filled in)", short: "Count" }
8
8
  ];
9
9
  function b(e) {
10
- return typeof e == "string" && p.some((n) => n.fn === e);
10
+ return typeof e == "string" && g.some((n) => n.fn === e);
11
11
  }
12
12
  function v(e) {
13
13
  return /^[A-Za-z_][A-Za-z0-9_]*$/.test(e);
14
14
  }
15
- function O(e, n, t) {
15
+ function w(e, n, t) {
16
16
  return {
17
17
  [n]: e,
18
18
  ...t.search ? { search: t.search } : {},
19
19
  ...t.conditions ? { conditions: t.conditions } : {}
20
20
  };
21
21
  }
22
- function x(e, n, t) {
23
- var s, l, a;
24
- const r = (a = (l = (s = e == null ? void 0 : e.data) == null ? void 0 : s[0]) == null ? void 0 : l[t]) == null ? void 0 : a[n];
22
+ function M(e, n, t) {
23
+ var i, l, c;
24
+ const r = (c = (l = (i = e == null ? void 0 : e.data) == null ? void 0 : i[0]) == null ? void 0 : l[t]) == null ? void 0 : c[n];
25
25
  if (r == null || r === "") return null;
26
26
  const o = Number(r);
27
27
  return Number.isFinite(o) ? o : null;
28
28
  }
29
- function k(e, n, t) {
29
+ function $(e, n, t) {
30
30
  return n === "count" ? Math.round(e).toLocaleString("en-US") : (t == null ? void 0 : t.type) === "number" ? S(String(e), t) : (Math.round(e * 100) / 100).toLocaleString("en-US", { maximumFractionDigits: 2 });
31
31
  }
32
- const d = (e) => `nvr_cbv_totals_${e}`, _ = (e) => e === "off" || b(e);
33
- function w(e) {
32
+ const p = (e) => `nvr_cbv_totals_${e}`, _ = (e) => e === "off" || b(e);
33
+ function k(e) {
34
+ return y(p(e), v);
35
+ }
36
+ function z(e, n) {
37
+ T(p(e), n);
38
+ }
39
+ function y(e, n) {
34
40
  try {
35
- const n = localStorage.getItem(d(e)), t = n ? JSON.parse(n) : null;
36
- if (!t || typeof t != "object") return {};
37
- const r = t.v === 2 && t.o && typeof t.o == "object" ? t.o : t, o = {};
38
- for (const [s, l] of Object.entries(r)) v(s) && _(l) && (o[s] = l);
39
- return o;
41
+ const t = localStorage.getItem(e), r = t ? JSON.parse(t) : null;
42
+ if (!r || typeof r != "object") return {};
43
+ const o = r.v === 2 && r.o && typeof r.o == "object" ? r.o : r, i = {};
44
+ for (const [l, c] of Object.entries(o)) n(l) && _(c) && (i[l] = c);
45
+ return i;
40
46
  } catch {
41
47
  return {};
42
48
  }
43
49
  }
44
- function M(e, n) {
50
+ function T(e, n) {
45
51
  try {
46
- Object.keys(n).length === 0 ? localStorage.removeItem(d(e)) : localStorage.setItem(d(e), JSON.stringify({ v: 2, o: n }));
52
+ Object.keys(n).length === 0 ? localStorage.removeItem(e) : localStorage.setItem(e, JSON.stringify({ v: 2, o: n }));
47
53
  } catch {
48
54
  }
49
55
  }
50
- function $(e, n) {
56
+ function j(e, n) {
51
57
  const t = { ...e };
52
58
  for (const [r, o] of Object.entries(n))
53
59
  o === "off" ? delete t[r] : t[r] = o;
54
60
  return t;
55
61
  }
56
- function z(e, n, t) {
62
+ function N(e, n, t) {
57
63
  return { ...e, [n]: t ?? "off" };
58
64
  }
59
- function j(e, n) {
65
+ function Z(e, n) {
60
66
  const t = {};
61
67
  for (const [r, o] of Object.entries(e))
62
68
  (o === "off" ? !n[r] : n[r] === o) || (t[r] = o);
63
69
  return t;
64
70
  }
65
- function g(e) {
71
+ function h(e) {
66
72
  return !e.computed_formula || !!e.computed_store;
67
73
  }
68
- const y = /* @__PURE__ */ new Set(["integer", "bigInteger", "biginteger", "decimal", "float"]);
69
- function T(e) {
74
+ const A = /* @__PURE__ */ new Set(["integer", "bigInteger", "biginteger", "decimal", "float"]);
75
+ function O(e) {
70
76
  const n = String(e ?? "").trim();
71
77
  if (!n) return null;
72
78
  let t = 0;
@@ -74,53 +80,53 @@ function T(e) {
74
80
  for (; t < n.length && /\s/.test(n[t]); ) t++;
75
81
  }, o = () => {
76
82
  r();
77
- const u = n.slice(t), i = /^item\.([A-Za-z_][A-Za-z0-9_]*)/.exec(u);
78
- if (i)
79
- return t += i[0].length, i[1];
80
- const c = /^\{\{\s*([A-Za-z_][A-Za-z0-9_]*)\s*\}\}/.exec(u);
81
- if (c)
82
- return t += c[0].length, c[1];
83
- const f = /^coalesce\s*\(/i.exec(u);
83
+ const a = n.slice(t), s = /^item\.([A-Za-z_][A-Za-z0-9_]*)/.exec(a);
84
+ if (s)
85
+ return t += s[0].length, s[1];
86
+ const u = /^\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/.exec(a);
87
+ if (u)
88
+ return t += u[0].length, u[1];
89
+ const f = /^coalesce\s*\(/i.exec(a);
84
90
  if (f) {
85
91
  t += f[0].length;
86
- const m = o(), h = /^\s*,\s*0(?:\.0+)?\s*\)/.exec(n.slice(t));
87
- return !m || !h ? null : (t += h[0].length, m);
92
+ const d = o(), m = /^\s*,\s*0(?:\.0+)?\s*\)/.exec(n.slice(t));
93
+ return !d || !m ? null : (t += m[0].length, d);
88
94
  }
89
95
  return null;
90
- }, s = /* @__PURE__ */ new Map(), l = (u) => {
91
- let i = !0;
96
+ }, i = /* @__PURE__ */ new Map(), l = (a) => {
97
+ let s = !0;
92
98
  for (; ; ) {
93
99
  r();
94
- let c = u;
100
+ let u = a;
95
101
  if (n[t] === "+" || n[t] === "-")
96
- n[t] === "-" && (c = c === 1 ? -1 : 1), t++, r();
97
- else if (!i) return !1;
98
- if (i = !1, n[t] === "(") {
99
- if (t++, !l(c) || (r(), n[t] !== ")")) return !1;
102
+ n[t] === "-" && (u = u === 1 ? -1 : 1), t++, r();
103
+ else if (!s) return !1;
104
+ if (s = !1, n[t] === "(") {
105
+ if (t++, !l(u) || (r(), n[t] !== ")")) return !1;
100
106
  t++;
101
107
  } else {
102
108
  const f = o();
103
109
  if (!f) return !1;
104
- s.set(f, (s.get(f) ?? 0) + c);
110
+ i.set(f, (i.get(f) ?? 0) + u);
105
111
  }
106
112
  if (r(), t >= n.length || n[t] === ")") return !0;
107
113
  if (n[t] !== "+" && n[t] !== "-") return !1;
108
114
  }
109
115
  };
110
116
  if (!l(1) || (r(), t !== n.length)) return null;
111
- const a = [];
112
- for (const [u, i] of s)
113
- if (i === 1 || i === -1) a.push({ field: u, sign: i });
114
- else if (i !== 0) return null;
115
- return a.length ? a : null;
116
- }
117
- function N(e, n) {
118
- if (g(e)) return { kind: "server" };
117
+ const c = [];
118
+ for (const [a, s] of i)
119
+ if (s === 1 || s === -1) c.push({ field: a, sign: s });
120
+ else if (s !== 0) return null;
121
+ return c.length ? c : null;
122
+ }
123
+ function C(e, n) {
124
+ if (h(e)) return { kind: "server" };
119
125
  if (e.computed_type !== "rollup") {
120
- const t = T(e.computed_formula ?? "");
126
+ const t = O(e.computed_formula ?? "");
121
127
  if (t != null && t.every((r) => {
122
128
  const o = n(r.field);
123
- return !!o && g(o) && y.has(String(o.type ?? ""));
129
+ return !!o && h(o) && A.has(String(o.type ?? ""));
124
130
  }))
125
131
  return { kind: "derived", terms: t };
126
132
  }
@@ -129,7 +135,7 @@ function N(e, n) {
129
135
  why: e.computed_type === "rollup" ? "Worked out from linked records each time the list is read, so it has no total." : "Calculated each time the list is read from a formula that does more than add and subtract stored columns, so it has no total."
130
136
  };
131
137
  }
132
- function Z(e, n) {
138
+ function F(e, n) {
133
139
  let t = 0;
134
140
  for (const r of e) {
135
141
  const o = n(r.field);
@@ -138,26 +144,28 @@ function Z(e, n) {
138
144
  }
139
145
  return Math.round(t * 1e6) / 1e6;
140
146
  }
141
- function C(e, n, t) {
142
- var s;
143
- const r = ((s = p.find((l) => l.fn === e)) == null ? void 0 : s.label.toLowerCase()) ?? e, o = t == null ? "all matching records" : `all ${t.toLocaleString("en-US")} matching records`;
147
+ function L(e, n, t) {
148
+ var i;
149
+ const r = ((i = g.find((l) => l.fn === e)) == null ? void 0 : i.label.toLowerCase()) ?? e, o = t == null ? "all matching records" : `all ${t.toLocaleString("en-US")} matching records`;
144
150
  return e === "count" ? `Records with ${n} filled in, across ${o}` : `${r.charAt(0).toUpperCase()}${r.slice(1)} of ${n} across ${o}`;
145
151
  }
146
152
  export {
147
- p as TOTAL_FNS,
148
- Z as combineTerms,
149
- k as formatTotal,
150
- g as isStoredField,
153
+ g as TOTAL_FNS,
154
+ F as combineTerms,
155
+ $ as formatTotal,
156
+ h as isStoredField,
151
157
  b as isTotalFn,
152
- T as linearSumTerms,
153
- w as loadTotalOverrides,
154
- j as overridesAfterSave,
155
- x as readTotal,
156
- M as rememberTotalOverrides,
157
- z as setOverride,
158
- $ as shownTotals,
159
- C as totalTip,
158
+ O as linearSumTerms,
159
+ k as loadTotalOverrides,
160
+ y as loadTotalOverridesAt,
161
+ Z as overridesAfterSave,
162
+ M as readTotal,
163
+ z as rememberTotalOverrides,
164
+ T as rememberTotalOverridesAt,
165
+ N as setOverride,
166
+ j as shownTotals,
167
+ L as totalTip,
160
168
  v as totalsEligibleKey,
161
- O as totalsParams,
162
- N as totalsSupport
169
+ w as totalsParams,
170
+ C as totalsSupport
163
171
  };