@nivaro/react 0.3.114 → 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 (281) 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 +1717 -21
  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 +1 -0
  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/change-proposals/ChangeProposalsPanel.js +320 -0
  62. package/dist/shared/components/change-proposals/ProposalValue.js +28 -0
  63. package/dist/shared/components/change-proposals/ProposeChangeButton.js +44 -0
  64. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +359 -0
  65. package/dist/shared/components/change-proposals/types.js +4 -0
  66. package/dist/shared/components/chat/ChatPanel.js +1571 -1528
  67. package/dist/shared/components/chat/Composer.js +276 -298
  68. package/dist/shared/components/chat/room-due.js +13 -0
  69. package/dist/shared/components/collections-directory/CollectionRow.js +76 -75
  70. package/dist/shared/components/collections-directory/CollectionsDirectory.js +415 -395
  71. package/dist/shared/components/collections-directory/directory-data.js +75 -63
  72. package/dist/shared/components/imports/ImportConsole.js +159 -155
  73. package/dist/shared/components/imports/ImportDuplicatesNotice.js +46 -31
  74. package/dist/shared/components/integrations/SendStatus.js +202 -0
  75. package/dist/shared/components/integrations/console/IntegrationsConsole.js +45 -36
  76. package/dist/shared/components/integrations/console/ReadyToSendView.js +453 -0
  77. package/dist/shared/components/integrations/console/api.js +161 -117
  78. package/dist/shared/components/integrations/console/tone.js +15 -12
  79. package/dist/shared/components/item-edit/CatalogPickerField.js +1353 -1245
  80. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +162 -0
  81. package/dist/shared/components/item-edit/CloneDialog.js +208 -206
  82. package/dist/shared/components/item-edit/DerivedCauseNote.js +57 -0
  83. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +81 -70
  84. package/dist/shared/components/item-edit/DuplicateNotice.js +169 -101
  85. package/dist/shared/components/item-edit/FieldAffordances.js +294 -385
  86. package/dist/shared/components/item-edit/FieldComments.js +159 -116
  87. package/dist/shared/components/item-edit/FieldPointer.js +132 -0
  88. package/dist/shared/components/item-edit/FieldRenderer.js +277 -273
  89. package/dist/shared/components/item-edit/FieldRow.js +519 -439
  90. package/dist/shared/components/item-edit/FieldSourceBadge.js +88 -0
  91. package/dist/shared/components/item-edit/FilePickerField.js +454 -369
  92. package/dist/shared/components/item-edit/GroupSection.js +618 -567
  93. package/dist/shared/components/item-edit/HeldEditsChip.js +113 -0
  94. package/dist/shared/components/item-edit/InlineTableField.js +2891 -2723
  95. package/dist/shared/components/item-edit/ListNeighborNav.js +79 -0
  96. package/dist/shared/components/item-edit/LiveTraceSheet.js +26 -0
  97. package/dist/shared/components/item-edit/M2MCombobox.js +284 -273
  98. package/dist/shared/components/item-edit/OutboxReviewTray.js +313 -0
  99. package/dist/shared/components/item-edit/PickerBadges.js +52 -0
  100. package/dist/shared/components/item-edit/PlanGrid.js +434 -439
  101. package/dist/shared/components/item-edit/RecalcValue.js +55 -0
  102. package/dist/shared/components/item-edit/RecordChatActions.js +76 -64
  103. package/dist/shared/components/item-edit/RecordChatMentionsChip.js +103 -0
  104. package/dist/shared/components/item-edit/RecordGrantTools.js +87 -86
  105. package/dist/shared/components/item-edit/RecordHelpChip.js +70 -0
  106. package/dist/shared/components/item-edit/RecordLiveSync.js +230 -217
  107. package/dist/shared/components/item-edit/RecordOutbox.js +53 -52
  108. package/dist/shared/components/item-edit/RecordRecapStrip.js +109 -36
  109. package/dist/shared/components/item-edit/RelationCombobox.js +229 -217
  110. package/dist/shared/components/item-edit/RelationGroupedCombobox.js +105 -100
  111. package/dist/shared/components/item-edit/RemoteChangeUi.js +454 -0
  112. package/dist/shared/components/item-edit/RemoteUploads.js +55 -0
  113. package/dist/shared/components/item-edit/RemovedLineNote.js +92 -0
  114. package/dist/shared/components/item-edit/RichTextEditorImpl.js +298 -223
  115. package/dist/shared/components/item-edit/ScheduledChangeChip.js +244 -0
  116. package/dist/shared/components/item-edit/SectionPresence.js +78 -0
  117. package/dist/shared/components/item-edit/SplitLinesButton.js +166 -0
  118. package/dist/shared/components/item-edit/catalog-line-watch.js +94 -0
  119. package/dist/shared/components/item-edit/coedit/collab.js +84 -0
  120. package/dist/shared/components/item-edit/coedit/context.js +24 -0
  121. package/dist/shared/components/item-edit/coedit/cursors.js +103 -0
  122. package/dist/shared/components/item-edit/coedit/safe-link.js +15 -0
  123. package/dist/shared/components/item-edit/coedit/session.js +382 -0
  124. package/dist/shared/components/item-edit/coedit/useCoedit.js +49 -0
  125. package/dist/shared/components/item-edit/file-live.js +77 -0
  126. package/dist/shared/components/item-edit/file-processing.js +87 -0
  127. package/dist/shared/components/item-edit/layout-switch.js +148 -0
  128. package/dist/shared/components/item-edit/live-related.js +23 -0
  129. package/dist/shared/components/item-edit/live-title.js +66 -0
  130. package/dist/shared/components/item-edit/partner-needs.js +142 -0
  131. package/dist/shared/components/item-edit/removed-line.js +58 -0
  132. package/dist/shared/components/item-edit/render-stability.js +70 -59
  133. package/dist/shared/components/layout-editor/ChangeNote.js +36 -34
  134. package/dist/shared/components/layout-editor/CollabParts.js +72 -70
  135. package/dist/shared/components/layout-editor/LayoutEditor.js +306 -303
  136. package/dist/shared/components/list/InlineEdit.js +504 -208
  137. package/dist/shared/components/list/ListViewers.js +81 -0
  138. package/dist/shared/components/merge/MergeRecordsDialog.js +1227 -0
  139. package/dist/shared/components/merge/MergeWithFlow.js +290 -0
  140. package/dist/shared/components/merge/merge-values.js +110 -0
  141. package/dist/shared/components/monitoring/InactiveUserLinksView.js +285 -258
  142. package/dist/shared/components/notifications/NotificationCenterView.js +388 -321
  143. package/dist/shared/components/notifications/NotificationDetailBits.js +205 -130
  144. package/dist/shared/components/notifications/NotificationRulesEditor.js +72 -52
  145. package/dist/shared/components/notifications/bundles.js +21 -19
  146. package/dist/shared/components/notifications/resolved-line.js +25 -0
  147. package/dist/shared/components/ops/OpsTasksView.js +45 -44
  148. package/dist/shared/components/panels/AccessGrantedNote.js +85 -0
  149. package/dist/shared/components/panels/AlertBanners.js +132 -0
  150. package/dist/shared/components/panels/AsyncUserPicker.js +54 -45
  151. package/dist/shared/components/panels/BranchLanes.js +82 -54
  152. package/dist/shared/components/panels/CommentAwareness.js +332 -0
  153. package/dist/shared/components/panels/CommentImages.js +219 -0
  154. package/dist/shared/components/panels/CommentPanel.js +649 -530
  155. package/dist/shared/components/panels/ExternalRequestsChip.js +98 -80
  156. package/dist/shared/components/panels/NewSinceChip.js +16 -0
  157. package/dist/shared/components/panels/OwnerOpenedLine.js +85 -0
  158. package/dist/shared/components/panels/PipelinePanel.js +1644 -1494
  159. package/dist/shared/components/panels/ResubmissionDiff.js +293 -0
  160. package/dist/shared/components/panels/SlaBreachBanner.js +30 -29
  161. package/dist/shared/components/panels/SlaClock.js +130 -99
  162. package/dist/shared/components/panels/TaskPanel.js +308 -287
  163. package/dist/shared/components/panels/unseen-move-check.js +101 -0
  164. package/dist/shared/components/pipeline/OwnerMatrix.js +80 -71
  165. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +495 -0
  166. package/dist/shared/components/pipeline/PipelineEditorView.js +1855 -1771
  167. package/dist/shared/components/profile/AgentNameField.js +141 -0
  168. package/dist/shared/components/profile/AgentsPanel.js +55 -46
  169. package/dist/shared/components/profile/PersonAccess.js +398 -330
  170. package/dist/shared/components/profile/PersonAdminTools.js +127 -113
  171. package/dist/shared/components/profile/PersonProfile.js +81 -73
  172. package/dist/shared/components/profile/SignInTroubleshooter.js +361 -0
  173. package/dist/shared/components/queue/QueueBulkBar.js +101 -84
  174. package/dist/shared/components/queue/QueueItemSheet.js +66 -66
  175. package/dist/shared/components/queue/QueueTeamStrip.js +279 -0
  176. package/dist/shared/components/queue/QueueWorklist.js +1927 -1635
  177. package/dist/shared/components/send-view/SendViewButton.js +136 -0
  178. package/dist/shared/components/send-view/SentViewCards.js +147 -0
  179. package/dist/shared/components/support/ReportProblem.js +1 -0
  180. package/dist/shared/components/support/ScreenShare.js +554 -0
  181. package/dist/shared/components/support/SupportView.js +160 -129
  182. package/dist/shared/components/support/TicketDetailSheet.js +101 -89
  183. package/dist/shared/components/watch-list/WatchDock.js +1044 -0
  184. package/dist/shared/components/watch-list/WatchExtras.js +723 -0
  185. package/dist/shared/components/watch-list/WatchListButton.js +46 -0
  186. package/dist/shared/components/watch-list/WatchPinButton.js +67 -0
  187. package/dist/shared/components/watch-list/WatchRows.js +348 -0
  188. package/dist/shared/lib/activity-sentence.js +87 -75
  189. package/dist/shared/lib/agent-presence.js +46 -0
  190. package/dist/shared/lib/approval-progress.js +49 -0
  191. package/dist/shared/lib/attention-prefs.js +27 -0
  192. package/dist/shared/lib/cell-locks.js +56 -0
  193. package/dist/shared/lib/co-edit.js +166 -0
  194. package/dist/shared/lib/coedit-registry.js +44 -0
  195. package/dist/shared/lib/comment-awareness.js +124 -0
  196. package/dist/shared/lib/comment-images.js +45 -0
  197. package/dist/shared/lib/config-watch.js +94 -0
  198. package/dist/shared/lib/copy-rules.js +65 -0
  199. package/dist/shared/lib/count-step.js +30 -0
  200. package/dist/shared/lib/deadline-ticker.js +68 -0
  201. package/dist/shared/lib/derived-causes.js +115 -0
  202. package/dist/shared/lib/draft-store.js +114 -85
  203. package/dist/shared/lib/error-hints.js +1 -0
  204. package/dist/shared/lib/field-merge.js +126 -0
  205. package/dist/shared/lib/filter-sentence.js +10 -10
  206. package/dist/shared/lib/focus-mode.js +16 -12
  207. package/dist/shared/lib/grid-cursors.js +77 -0
  208. package/dist/shared/lib/grid-presence.js +182 -0
  209. package/dist/shared/lib/idle-reload.js +100 -73
  210. package/dist/shared/lib/in-step.js +45 -0
  211. package/dist/shared/lib/integration-chip.js +19 -18
  212. package/dist/shared/lib/line-locks.js +141 -0
  213. package/dist/shared/lib/line-split.js +41 -0
  214. package/dist/shared/lib/linked-changes.js +150 -0
  215. package/dist/shared/lib/list-return.js +231 -0
  216. package/dist/shared/lib/list-viewers.js +52 -0
  217. package/dist/shared/lib/live-announcer.js +86 -0
  218. package/dist/shared/lib/live-counts.js +85 -0
  219. package/dist/shared/lib/live-data-changed.js +108 -0
  220. package/dist/shared/lib/live-deltas.js +81 -0
  221. package/dist/shared/lib/live-findings.js +113 -0
  222. package/dist/shared/lib/live-groups.js +122 -0
  223. package/dist/shared/lib/live-link-labels.js +162 -0
  224. package/dist/shared/lib/live-list-flow.js +334 -0
  225. package/dist/shared/lib/live-list.js +143 -129
  226. package/dist/shared/lib/live-moves.js +51 -0
  227. package/dist/shared/lib/live-ops.js +26 -26
  228. package/dist/shared/lib/live-pickers.js +7 -0
  229. package/dist/shared/lib/live-preference.js +184 -0
  230. package/dist/shared/lib/live-queries.js +226 -181
  231. package/dist/shared/lib/live-screen.js +333 -0
  232. package/dist/shared/lib/live-search.js +108 -0
  233. package/dist/shared/lib/live-seen.js +35 -0
  234. package/dist/shared/lib/live-views.js +100 -0
  235. package/dist/shared/lib/live.js +159 -133
  236. package/dist/shared/lib/missed-updates.js +198 -0
  237. package/dist/shared/lib/newer-file.js +56 -0
  238. package/dist/shared/lib/notification-sound.js +42 -20
  239. package/dist/shared/lib/own-writes.js +59 -41
  240. package/dist/shared/lib/picker-badges.js +94 -0
  241. package/dist/shared/lib/presence-signals.js +131 -84
  242. package/dist/shared/lib/realtime.js +49 -24
  243. package/dist/shared/lib/record-gaps.js +85 -0
  244. package/dist/shared/lib/record-outbox.js +369 -222
  245. package/dist/shared/lib/record-peek.js +75 -0
  246. package/dist/shared/lib/record-tabs.js +92 -72
  247. package/dist/shared/lib/relative-ticker.js +42 -0
  248. package/dist/shared/lib/request-gate.js +119 -119
  249. package/dist/shared/lib/rollup-recalc.js +107 -0
  250. package/dist/shared/lib/room-gaps.js +40 -36
  251. package/dist/shared/lib/rum.js +137 -87
  252. package/dist/shared/lib/save-progress.js +20 -0
  253. package/dist/shared/lib/scheduled-countdown.js +67 -0
  254. package/dist/shared/lib/screen-refresh.js +160 -0
  255. package/dist/shared/lib/screen-share.js +234 -0
  256. package/dist/shared/lib/seen-since.js +74 -0
  257. package/dist/shared/lib/selection-watch.js +205 -0
  258. package/dist/shared/lib/send-status.js +132 -0
  259. package/dist/shared/lib/send-view.js +23 -0
  260. package/dist/shared/lib/socket-liveness.js +155 -0
  261. package/dist/shared/lib/socket-realtime.js +168 -140
  262. package/dist/shared/lib/state-census.js +53 -0
  263. package/dist/shared/lib/summary-mode.js +61 -39
  264. package/dist/shared/lib/tab-attention.js +143 -32
  265. package/dist/shared/lib/table-density.js +64 -0
  266. package/dist/shared/lib/track-travel.js +40 -0
  267. package/dist/shared/lib/unseen-changes.js +68 -0
  268. package/dist/shared/lib/upload-file.js +33 -0
  269. package/dist/shared/lib/upload-presence.js +127 -0
  270. package/dist/shared/lib/urgent-chime.js +65 -0
  271. package/dist/shared/lib/use-online-users.js +32 -11
  272. package/dist/shared/lib/user-sync.js +155 -39
  273. package/dist/shared/lib/waiting-count.js +44 -0
  274. package/dist/shared/lib/watch-desktop.js +83 -0
  275. package/dist/shared/lib/watch-list.js +447 -0
  276. package/dist/shared/lib/widget-image-render.js +64 -0
  277. package/dist/shared/lib/widget-image.js +111 -0
  278. package/dist/shared/lib/worker-socket.js +130 -104
  279. package/dist/shared/lib/write-to-screen.js +133 -0
  280. package/package.json +1 -1
  281. package/styles.css +49 -1
@@ -0,0 +1,554 @@
1
+ import { jsx as n, jsxs as d, Fragment as re } from "react/jsx-runtime";
2
+ import { useQueryClient as ne, useQuery as ue } from "@tanstack/react-query";
3
+ import { MonitorUp as Q, Minus as he, ShieldCheck as me, Loader2 as ae, Minimize2 as fe, Maximize2 as pe, Eye as be } from "lucide-react";
4
+ import { useEffect as k, useState as S, useRef as z, useCallback as ge, useMemo as xe } from "react";
5
+ import { createPortal as X } from "react-dom";
6
+ import { useNivaroClient as Y, useApiFetchConfig as ve } from "../../context.js";
7
+ import { get as we, del as se, post as ye } from "../../lib/commands.js";
8
+ import { describeError as ke } from "../../lib/error-message.js";
9
+ import { useOptionalRealtime as ie } from "../../lib/realtime.js";
10
+ import { registerScreenShareRuntime as Ne, useScreenShareAvailable as Se, useScreenShareStatus as oe, stopScreenShare as le, screenShareRuntime as Re, startScreenShare as _e, createFrameAssembler as Ee } from "../../lib/screen-share.js";
11
+ const H = (e) => ["support-screen-share", e];
12
+ function Me() {
13
+ const e = ie(), i = Y(), { apiBase: u, authHeaders: a, credentials: l } = ve();
14
+ return xe(() => e ? {
15
+ emit: (o, c) => e.emit(o, c),
16
+ on: (o, c) => e.on(o, c),
17
+ stop: async (o, c, t) => {
18
+ const m = `/support/tickets/${o}/screen-share?share=${encodeURIComponent(c)}${t ? `&reason=${t}` : ""}`;
19
+ if (t) {
20
+ try {
21
+ fetch(`${u}${m}`, {
22
+ method: "DELETE",
23
+ keepalive: !0,
24
+ credentials: l,
25
+ headers: a
26
+ }).catch(() => {
27
+ });
28
+ } catch {
29
+ }
30
+ return;
31
+ }
32
+ await i.request(se(m));
33
+ }
34
+ } : null, [e, i, u, a, l]);
35
+ }
36
+ function Ve({ runtime: e }) {
37
+ return k(() => e ? Ne(e) : void 0, [e]), /* @__PURE__ */ n(Ae, {});
38
+ }
39
+ function $e(e) {
40
+ const [i, u] = S(() => Date.now());
41
+ if (k(() => {
42
+ if (e == null) return;
43
+ const l = setInterval(() => u(Date.now()), 1e3);
44
+ return () => clearInterval(l);
45
+ }, [e]), e == null) return "";
46
+ const a = Math.max(0, Math.round((e - i) / 1e3));
47
+ return `${Math.floor(a / 60)}:${String(a % 60).padStart(2, "0")}`;
48
+ }
49
+ function ce(e) {
50
+ return e.to.kind === "team" ? `the ${e.to.name} team` : e.to.name;
51
+ }
52
+ const Z = 340;
53
+ function qe(e, i, u) {
54
+ const a = e.filter(
55
+ (t) => t.right - t.left > 0 && t.bottom - t.top > 0 && t.bottom > u - 120
56
+ );
57
+ if (a.length === 0) return { kind: "free" };
58
+ const l = Math.min(...a.map((t) => t.left)), o = Math.max(...a.map((t) => t.right)), c = Math.min(...a.map((t) => t.top));
59
+ return l >= Z ? { kind: "beside", left: 0, width: l } : i - o >= Z ? { kind: "beside", left: o, width: i - o } : c >= 96 ? { kind: "above", bottom: u - c + 12 } : { kind: "covered" };
60
+ }
61
+ function Te(e) {
62
+ const [i, u] = S({ kind: "free" });
63
+ return k(() => {
64
+ if (!e || typeof document > "u") return;
65
+ let a = 0;
66
+ const l = new ResizeObserver(() => o());
67
+ function o() {
68
+ cancelAnimationFrame(a), a = requestAnimationFrame(() => {
69
+ l.disconnect();
70
+ const f = [
71
+ ...document.querySelectorAll('[role="dialog"], [role="alertdialog"]')
72
+ ].filter((r) => r.isConnected && getComputedStyle(r).visibility !== "hidden");
73
+ for (const r of f) l.observe(r);
74
+ const x = qe(
75
+ f.map((r) => r.getBoundingClientRect()),
76
+ window.innerWidth,
77
+ window.innerHeight
78
+ );
79
+ u((r) => JSON.stringify(r) === JSON.stringify(x) ? r : x);
80
+ });
81
+ }
82
+ let c;
83
+ const t = () => {
84
+ o(), clearTimeout(c), c = setTimeout(o, 400);
85
+ }, m = new MutationObserver(t);
86
+ return m.observe(document.body, { childList: !0 }), window.addEventListener("resize", t), t(), () => {
87
+ m.disconnect(), l.disconnect(), cancelAnimationFrame(a), clearTimeout(c), window.removeEventListener("resize", t);
88
+ };
89
+ }, [e]), i;
90
+ }
91
+ function Ae() {
92
+ const e = oe(), i = !!e && !e.ended, u = $e(i ? (e == null ? void 0 : e.share.expires_at) ?? null : null), a = Te(!!e), [l, o] = S(null), c = e == null ? void 0 : e.share.id;
93
+ k(() => {
94
+ c && o(null);
95
+ }, [c]);
96
+ const t = !!e, m = t && a.kind === "covered";
97
+ if (k(() => {
98
+ if (!(!t || typeof document > "u"))
99
+ return document.documentElement.setAttribute("data-screen-sharing", ""), () => document.documentElement.removeAttribute("data-screen-sharing");
100
+ }, [t]), k(() => {
101
+ if (!(!m || typeof document > "u"))
102
+ return document.documentElement.setAttribute("data-screen-share-covered", ""), () => document.documentElement.removeAttribute("data-screen-share-covered");
103
+ }, [m]), !e || typeof document > "u") return null;
104
+ const { share: f, watching: x, ended: r } = e, y = ce(f), R = x.length === 0 ? "not opened yet" : f.to.kind === "user" ? "watching now" : `${x.length === 1 ? x[0] : `${x.length} people`} watching`, b = !r && (l ?? a.kind === "covered"), g = u ? `Sharing stops by itself in ${u}` : void 0;
105
+ if (b)
106
+ return X(
107
+ /* @__PURE__ */ d(
108
+ "button",
109
+ {
110
+ type: "button",
111
+ "data-replay-block": !0,
112
+ "data-screen-share-bar": "minimised",
113
+ onClick: () => o(!1),
114
+ "aria-label": `Sharing this app with ${y}, ${R}. Show the sharing controls`,
115
+ "data-tip": g,
116
+ className: `nvr-no-record fixed bottom-[max(1rem,env(safe-area-inset-bottom))] z-[160] flex h-9 items-center gap-2 rounded-full border border-white/10 bg-[#111827] pl-2.5 pr-3 text-[12px] font-medium text-slate-100 shadow-[0_6px_18px_-6px_rgba(15,23,42,0.5)] transition-colors hover:bg-[#1f2937] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300 ${a.kind === "covered" ? "left-3" : "right-3 sm:right-20"}`,
117
+ children: [
118
+ /* @__PURE__ */ n(ee, {}),
119
+ /* @__PURE__ */ n(te, {}),
120
+ "Sharing"
121
+ ]
122
+ }
123
+ ),
124
+ document.body
125
+ );
126
+ const p = a.kind === "beside" ? { left: a.left, width: a.width } : a.kind === "above" ? { bottom: a.bottom } : {};
127
+ return X(
128
+ /* @__PURE__ */ d(
129
+ "div",
130
+ {
131
+ role: "status",
132
+ "aria-live": "polite",
133
+ "data-replay-block": !0,
134
+ "data-screen-share-bar": r ? "ended" : "live",
135
+ "data-placement": a.kind,
136
+ style: p,
137
+ className: `nvr-no-record pointer-events-none fixed bottom-[max(0.75rem,env(safe-area-inset-bottom))] z-[160] flex justify-center px-3 sm:px-4 ${a.kind === "beside" ? "" : "inset-x-0"}`,
138
+ children: [
139
+ /* @__PURE__ */ n(ee, {}),
140
+ /* @__PURE__ */ n("div", { className: "pointer-events-auto flex w-full items-center gap-2.5 rounded-full border border-white/10 bg-[#111827] py-1 pl-3.5 pr-1 text-[12.5px] text-slate-100 shadow-[0_8px_24px_-6px_rgba(15,23,42,0.45)] sm:w-auto sm:max-w-full sm:gap-3 sm:py-1.5 sm:pr-1.5", children: r ? /* @__PURE__ */ n("span", { className: "px-1 py-1 text-slate-300", children: r }) : /* @__PURE__ */ d(re, { children: [
141
+ /* @__PURE__ */ n("span", { "data-tip": g, className: "flex shrink-0", children: /* @__PURE__ */ n(te, {}) }),
142
+ /* @__PURE__ */ d("span", { className: "min-w-0 flex-1 truncate sm:flex-none", children: [
143
+ /* @__PURE__ */ n("span", { className: "sm:hidden", children: "Sharing" }),
144
+ /* @__PURE__ */ d("span", { className: "hidden sm:inline", children: [
145
+ "Sharing with ",
146
+ /* @__PURE__ */ n("b", { className: "font-semibold text-white", children: y })
147
+ ] }),
148
+ /* @__PURE__ */ d("span", { className: "text-slate-400", "data-screen-share-watching": !0, children: [
149
+ " · ",
150
+ R
151
+ ] })
152
+ ] }),
153
+ /* @__PURE__ */ n(
154
+ "button",
155
+ {
156
+ type: "button",
157
+ "data-screen-share-stop": !0,
158
+ onClick: () => le(),
159
+ className: "h-7 shrink-0 rounded-full bg-red-600 px-3 text-[12px] font-semibold text-white transition-colors hover:bg-red-500 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300 focus-visible:ring-offset-2 focus-visible:ring-offset-[#111827] sm:px-3.5",
160
+ children: "Stop sharing"
161
+ }
162
+ ),
163
+ /* @__PURE__ */ n(
164
+ "button",
165
+ {
166
+ type: "button",
167
+ "data-screen-share-minimise": !0,
168
+ onClick: () => o(!0),
169
+ "aria-label": "Minimise the sharing controls",
170
+ "data-tip": "Minimise",
171
+ className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-slate-400 transition-colors hover:bg-white/10 hover:text-white focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-slate-400",
172
+ children: /* @__PURE__ */ n(he, { className: "h-3.5 w-3.5" })
173
+ }
174
+ )
175
+ ] }) })
176
+ ]
177
+ }
178
+ ),
179
+ document.body
180
+ );
181
+ }
182
+ function ee() {
183
+ return /* @__PURE__ */ n("style", { children: '@media (max-width: 639px){html[data-screen-sharing] [data-floating-help]{display:none!important}}html[data-screen-share-covered] [role="dialog"] [data-sheet-body]{padding-bottom:calc(2.25rem + 2rem + env(safe-area-inset-bottom))}' });
184
+ }
185
+ function te() {
186
+ return /* @__PURE__ */ d("span", { className: "relative flex h-2.5 w-2.5 shrink-0", "aria-hidden": !0, children: [
187
+ /* @__PURE__ */ n("span", { className: "absolute inset-0 rounded-full bg-red-500 motion-safe:animate-ping motion-safe:opacity-60" }),
188
+ /* @__PURE__ */ n("span", { className: "relative h-2.5 w-2.5 rounded-full bg-red-500" })
189
+ ] });
190
+ }
191
+ function Je({
192
+ ticketId: e,
193
+ onWideChange: i
194
+ }) {
195
+ const u = Y(), a = ne(), l = ie(), o = Se(), c = oe(), [t, m] = S(null), [f, x] = S(null), { data: r } = ue({
196
+ queryKey: H(e),
197
+ queryFn: () => u.request(we(`/support/tickets/${e}/screen-share`)).then((b) => b.data),
198
+ enabled: o,
199
+ staleTime: 5e3
200
+ });
201
+ k(() => {
202
+ if (!l) return;
203
+ const b = (h) => {
204
+ Number(h == null ? void 0 : h.ticket) === e && (a.invalidateQueries({ queryKey: H(e) }), a.invalidateQueries({ queryKey: ["support-ticket", e] }));
205
+ }, g = (h) => {
206
+ Number(h == null ? void 0 : h.ticket) === e && typeof (h == null ? void 0 : h.reason) == "string" && x(h.reason), b(h);
207
+ }, p = [l.on("screenshare:state", b), l.on("screenshare:ended", g)];
208
+ return () => {
209
+ for (const h of p) h();
210
+ };
211
+ }, [l, a, e]);
212
+ const y = r != null && r.active && r.can_watch && r.share ? r.share : null;
213
+ if (k(() => {
214
+ y && m(y);
215
+ }, [y]), !o || !(r != null && r.enabled)) return null;
216
+ const R = c && !c.ended && c.share.ticket === e;
217
+ return R || r.mine && r.active ? /* @__PURE__ */ n(
218
+ ze,
219
+ {
220
+ name: r.to_name,
221
+ onStop: async () => {
222
+ if (R) return le();
223
+ r.share && await u.request(
224
+ se(
225
+ `/support/tickets/${e}/screen-share?share=${encodeURIComponent(r.share.id)}`
226
+ )
227
+ ).catch(() => {
228
+ }), a.invalidateQueries({ queryKey: H(e) });
229
+ }
230
+ }
231
+ ) : r.can_start || r.start_refusal ? /* @__PURE__ */ n(Le, { ticketId: e, answer: r }) : r.active && r.can_watch && r.share && l ? /* @__PURE__ */ n(Oe, { share: r.share, rt: l, onWideChange: i }) : !r.active && t ? /* @__PURE__ */ d(
232
+ "p",
233
+ {
234
+ "data-screen-share-note": "ended",
235
+ className: "flex items-center gap-1.5 text-[12px] text-slate-500 dark:text-muted-foreground",
236
+ children: [
237
+ /* @__PURE__ */ n(Q, { className: "h-3.5 w-3.5 shrink-0" }),
238
+ de(t.sharer_name, f)
239
+ ]
240
+ }
241
+ ) : r.active && r.share ? /* @__PURE__ */ d(
242
+ "p",
243
+ {
244
+ "data-screen-share-note": !0,
245
+ className: "flex items-center gap-1.5 text-[12px] text-slate-500 dark:text-muted-foreground",
246
+ children: [
247
+ /* @__PURE__ */ n(Q, { className: "h-3.5 w-3.5 shrink-0" }),
248
+ r.share.sharer_name,
249
+ " is sharing their screen with ",
250
+ ce(r.share),
251
+ "."
252
+ ]
253
+ }
254
+ ) : null;
255
+ }
256
+ function de(e, i) {
257
+ switch (i) {
258
+ case "page":
259
+ case "stale":
260
+ return `${e}'s page closed, so sharing ended.`;
261
+ case "expired":
262
+ return "Sharing ended after 30 minutes.";
263
+ case "moved":
264
+ return "Sharing ended because the request moved to someone else.";
265
+ case "closed":
266
+ return "Sharing ended because the request was closed.";
267
+ default:
268
+ return `${e} stopped sharing their screen.`;
269
+ }
270
+ }
271
+ function ze({ name: e, onStop: i }) {
272
+ return /* @__PURE__ */ d(
273
+ "div",
274
+ {
275
+ "data-screen-share-card": "sharing",
276
+ className: "flex items-center gap-3 rounded-lg border border-slate-200 bg-slate-50 px-3.5 py-3 dark:border-border dark:bg-white/[0.03]",
277
+ children: [
278
+ /* @__PURE__ */ d("span", { className: "relative flex h-2.5 w-2.5 shrink-0", "aria-hidden": !0, children: [
279
+ /* @__PURE__ */ n("span", { className: "absolute inset-0 rounded-full bg-red-500 motion-safe:animate-ping motion-safe:opacity-60" }),
280
+ /* @__PURE__ */ n("span", { className: "relative h-2.5 w-2.5 rounded-full bg-red-500" })
281
+ ] }),
282
+ /* @__PURE__ */ d("p", { className: "mr-auto text-[12.5px] text-slate-700 dark:text-slate-200", children: [
283
+ "You are sharing this app with ",
284
+ /* @__PURE__ */ n("b", { className: "font-semibold", children: e ?? "support" }),
285
+ "."
286
+ ] }),
287
+ /* @__PURE__ */ n(
288
+ "button",
289
+ {
290
+ type: "button",
291
+ "data-screen-share-stop-card": !0,
292
+ onClick: i,
293
+ className: "h-7 shrink-0 rounded-md border border-red-300 bg-white px-3 text-[12px] font-medium text-red-700 hover:bg-red-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-red-300 dark:border-red-500/40 dark:bg-transparent dark:text-red-300 dark:hover:bg-red-500/10",
294
+ children: "Stop sharing"
295
+ }
296
+ )
297
+ ]
298
+ }
299
+ );
300
+ }
301
+ function Le({ ticketId: e, answer: i }) {
302
+ const u = Y(), a = ne(), l = Me(), [o, c] = S(!1), [t, m] = S(null), f = i.to_name ?? "support", x = i.can_start && !!l, r = async () => {
303
+ if (l) {
304
+ c(!0), m(null);
305
+ try {
306
+ const y = await u.request(
307
+ ye(`/support/tickets/${e}/screen-share`)
308
+ );
309
+ await _e({
310
+ share: y.data.share,
311
+ masking: y.data.masking,
312
+ transport: l
313
+ }) || (await Promise.resolve(l.stop(e, y.data.share.id)).catch(() => {
314
+ }), m("Sharing could not start on this page. Reload the page and try again."));
315
+ } catch (y) {
316
+ m(ke(y, "Sharing could not start").title);
317
+ } finally {
318
+ c(!1), a.invalidateQueries({ queryKey: H(e) }), a.invalidateQueries({ queryKey: ["support-ticket", e] });
319
+ }
320
+ }
321
+ };
322
+ return /* @__PURE__ */ n(
323
+ "section",
324
+ {
325
+ "data-screen-share-card": "start",
326
+ className: "rounded-lg border border-slate-200 px-4 py-3.5 dark:border-border",
327
+ children: /* @__PURE__ */ d("div", { className: "flex items-start gap-3", children: [
328
+ /* @__PURE__ */ n(Q, { className: "mt-0.5 h-4 w-4 shrink-0 text-slate-500 dark:text-slate-400" }),
329
+ /* @__PURE__ */ d("div", { className: "min-w-0 flex-1", children: [
330
+ /* @__PURE__ */ d("h3", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: [
331
+ "Show ",
332
+ x ? f : "support",
333
+ " your screen"
334
+ ] }),
335
+ /* @__PURE__ */ d("p", { className: "mt-1 text-[12px] leading-relaxed text-slate-600 dark:text-slate-300", children: [
336
+ x ? f : "Whoever picks this up",
337
+ " sees this app as you use it — not your other tabs or anything else on your computer. They can only watch."
338
+ ] }),
339
+ /* @__PURE__ */ d("p", { className: "mt-1.5 flex items-start gap-1.5 text-[11.5px] leading-relaxed text-slate-500 dark:text-muted-foreground", children: [
340
+ /* @__PURE__ */ n(me, { className: "mt-px h-3.5 w-3.5 shrink-0 text-emerald-600 dark:text-emerald-400" }),
341
+ "What you type and the values on records are hidden from them. Stops when you press Stop, close the page, or after 30 minutes."
342
+ ] }),
343
+ x ? /* @__PURE__ */ d(
344
+ "button",
345
+ {
346
+ type: "button",
347
+ "data-screen-share-start": !0,
348
+ disabled: o,
349
+ onClick: () => void r(),
350
+ className: "mt-3 inline-flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3.5 text-[12.5px] font-medium text-white transition-opacity hover:opacity-90 disabled:opacity-50",
351
+ children: [
352
+ o && /* @__PURE__ */ n(ae, { className: "h-3.5 w-3.5 animate-spin" }),
353
+ "Share my screen with ",
354
+ f
355
+ ]
356
+ }
357
+ ) : /* @__PURE__ */ n(
358
+ "p",
359
+ {
360
+ "data-screen-share-refusal": !0,
361
+ className: "mt-2.5 text-[12px] text-slate-500 dark:text-muted-foreground",
362
+ children: i.start_refusal ?? "Sharing needs a live connection. Reload the page and try again."
363
+ }
364
+ ),
365
+ t && /* @__PURE__ */ n("p", { role: "alert", className: "mt-2 text-[12px] text-red-600 dark:text-red-400", children: t })
366
+ ] })
367
+ ] })
368
+ }
369
+ );
370
+ }
371
+ const Fe = `
372
+ [data-screen-view] .replayer-wrapper { position: absolute; top: 0; left: 0; transform-origin: top left; }
373
+ [data-screen-view] .replayer-wrapper > iframe { border: 0; pointer-events: none; background: #fff; }
374
+ [data-screen-view] .replayer-mouse { position: absolute; width: 18px; height: 18px; margin: -2px 0 0 -2px;
375
+ border-radius: 9999px; background: rgba(0, 206, 255, 0.35); border: 2px solid #00ceff;
376
+ transition: left .05s linear, top .05s linear; pointer-events: none; z-index: 2; }
377
+ [data-screen-view] .replayer-mouse.active { background: rgba(0, 206, 255, 0.7); }
378
+ [data-screen-view] .replayer-mouse-tail { display: none; }
379
+ [data-screen-view] .replayer-mouse:not([style*="left"]) { display: none; }
380
+ `, Pe = [
381
+ "html.rrweb-paused *, html.rrweb-paused *::before, html.rrweb-paused *::after { animation-duration: 0s !important; animation-delay: 0s !important; }"
382
+ ];
383
+ function Oe({
384
+ share: e,
385
+ rt: i,
386
+ onWideChange: u
387
+ }) {
388
+ const a = z(null), l = z(null), o = z(null), c = z(null), [t, m] = S("joining"), [f, x] = S(!1), r = z(!1);
389
+ r.current = f;
390
+ const [y, R] = S(null), b = e.ticket, g = ge(() => {
391
+ var P, O;
392
+ const p = a.current, h = (P = o.current) == null ? void 0 : P.wrapper, v = (O = o.current) == null ? void 0 : O.iframe, M = Number(v == null ? void 0 : v.getAttribute("width")) || (v == null ? void 0 : v.offsetWidth) || 0, L = Number(v == null ? void 0 : v.getAttribute("height")) || (v == null ? void 0 : v.offsetHeight) || 0;
393
+ M > 0 && L > 0 && (c.current = { width: M, height: L });
394
+ const _ = c.current;
395
+ if (!p || !_ || !h) return;
396
+ const F = p.clientWidth, K = r.current ? Math.max(240, window.innerHeight - 140) : Number.POSITIVE_INFINITY, $ = Math.min(F / Math.max(1, _.width), K / Math.max(1, _.height));
397
+ h.style.transform = `scale(${$})`, h.style.left = `${Math.max(0, Math.round((F - _.width * $) / 2))}px`, p.style.height = `${Math.round(_.height * $)}px`;
398
+ }, []);
399
+ return k(() => {
400
+ var U, I;
401
+ let p = !0;
402
+ const h = Ee();
403
+ let v = 0, M = null;
404
+ const L = ((U = Re()) == null ? void 0 : U.loadReplayer().catch(() => null)) ?? Promise.resolve(null), _ = () => {
405
+ const s = Date.now();
406
+ s - v < 3e3 || (v = s, i.emit("screenshare:resync", { ticket: b }));
407
+ }, F = (s) => {
408
+ var j, V, J, G, W;
409
+ const w = l.current;
410
+ if (!w || !M) return;
411
+ try {
412
+ (V = (j = o.current) == null ? void 0 : j.destroy) == null || V.call(j);
413
+ } catch {
414
+ }
415
+ w.replaceChildren();
416
+ const N = s.find((q) => q.type === 4);
417
+ (J = N == null ? void 0 : N.data) != null && J.width && N.data.height && (c.current = { width: N.data.width, height: N.data.height });
418
+ const E = new M(s, {
419
+ root: w,
420
+ liveMode: !0,
421
+ mouseTail: !1,
422
+ triggerFocus: !1,
423
+ showWarning: !1,
424
+ UNSAFE_replayCanvas: !1,
425
+ insertStyleRules: Pe
426
+ });
427
+ (G = E.on) == null || G.call(E, "resize", (q) => {
428
+ const A = q;
429
+ A != null && A.width && A.height && (c.current = { width: A.width, height: A.height }), g();
430
+ });
431
+ const C = s.map((q) => q.timestamp).filter((q) => typeof q == "number");
432
+ E.play(C.length ? Math.max(0, C[C.length - 1] - C[0]) : 0), o.current = E, (W = E.on) == null || W.call(E, "fullsnapshot-rebuilded", () => {
433
+ g(), requestAnimationFrame(() => g());
434
+ }), g(), requestAnimationFrame(() => requestAnimationFrame(() => g())), m("live");
435
+ }, K = (s) => {
436
+ if (!p || !s || Number(s.ticket) !== b || s.share !== e.id) return;
437
+ const w = h.push(s);
438
+ if (w.gap && _(), !!w.events.length)
439
+ if (w.snapshot || !o.current) F(w.events);
440
+ else for (const N of w.events) o.current.addEvent(N);
441
+ }, $ = [
442
+ i.on("screenshare:frame", K),
443
+ i.on("screenshare:joined", (s) => {
444
+ p && Number(s == null ? void 0 : s.ticket) === b && m((w) => w === "live" ? w : "waiting");
445
+ }),
446
+ i.on("screenshare:denied", (s) => {
447
+ p && Number(s == null ? void 0 : s.ticket) === b && m("denied");
448
+ }),
449
+ i.on("screenshare:ended", (s) => {
450
+ !p || Number(s == null ? void 0 : s.ticket) !== b || (R(typeof (s == null ? void 0 : s.reason) == "string" ? s.reason : null), m("ended"));
451
+ })
452
+ ];
453
+ L.then((s) => {
454
+ if (p) {
455
+ if (!s) {
456
+ m("unavailable");
457
+ return;
458
+ }
459
+ M = s, i.emit("screenshare:watch", { ticket: b });
460
+ }
461
+ });
462
+ const P = setInterval(() => i.emit("screenshare:watch", { ticket: b }), 15e3), O = setInterval(() => {
463
+ o.current || _();
464
+ }, 6e3), B = (I = i.onStatus) == null ? void 0 : I.call(i, (s) => {
465
+ s.state === "live" && M && i.emit("screenshare:watch", { ticket: b });
466
+ });
467
+ B && $.push(B);
468
+ const T = typeof ResizeObserver < "u" ? new ResizeObserver(() => g()) : null;
469
+ a.current && (T == null || T.observe(a.current)), $.push(() => T == null ? void 0 : T.disconnect());
470
+ const D = () => g();
471
+ return window.addEventListener("resize", D), () => {
472
+ var s, w;
473
+ p = !1, clearInterval(P), clearInterval(O), window.removeEventListener("resize", D);
474
+ for (const N of $) N();
475
+ i.emit("screenshare:unwatch", { ticket: b });
476
+ try {
477
+ (w = (s = o.current) == null ? void 0 : s.destroy) == null || w.call(s);
478
+ } catch {
479
+ }
480
+ o.current = null;
481
+ };
482
+ }, [i, b, e.id, g]), k(() => {
483
+ t === "live" ? g() : a.current && (a.current.style.height = "");
484
+ }, [t, g]), k(() => {
485
+ u == null || u(f);
486
+ const p = setTimeout(() => {
487
+ var h;
488
+ g(), f && ((h = a.current) == null || h.scrollIntoView({ block: "start", behavior: "smooth" }));
489
+ }, 320);
490
+ return () => clearTimeout(p);
491
+ }, [f, u, g]), k(() => () => u == null ? void 0 : u(!1), [u]), /* @__PURE__ */ d("section", { "data-screen-share-view": t, className: "space-y-2", children: [
492
+ /* @__PURE__ */ n("style", { children: Fe }),
493
+ /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
494
+ /* @__PURE__ */ d("span", { className: "relative flex h-2 w-2 shrink-0", "aria-hidden": !0, children: [
495
+ t === "live" && /* @__PURE__ */ n("span", { className: "absolute inset-0 rounded-full bg-red-500 motion-safe:animate-ping motion-safe:opacity-60" }),
496
+ /* @__PURE__ */ n(
497
+ "span",
498
+ {
499
+ className: `relative h-2 w-2 rounded-full ${t === "live" ? "bg-red-500" : "bg-slate-300 dark:bg-slate-600"}`
500
+ }
501
+ )
502
+ ] }),
503
+ /* @__PURE__ */ d("h3", { className: "mr-auto text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: [
504
+ e.sharer_name,
505
+ "'s screen",
506
+ /* @__PURE__ */ n("span", { className: "ml-1.5 font-normal text-slate-500 dark:text-muted-foreground", children: t === "live" ? "· live, view only" : t === "ended" ? "· sharing stopped" : t === "denied" || t === "unavailable" ? "· not available here" : "· connecting…" })
507
+ ] }),
508
+ t === "live" && /* @__PURE__ */ d(
509
+ "button",
510
+ {
511
+ type: "button",
512
+ "data-screen-share-wide": !0,
513
+ onClick: () => x((p) => !p),
514
+ className: "inline-flex h-7 items-center gap-1 rounded-md px-2 text-[12px] text-slate-600 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-white/10",
515
+ children: [
516
+ f ? /* @__PURE__ */ n(fe, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ n(pe, { className: "h-3.5 w-3.5" }),
517
+ f ? "Smaller" : "Larger"
518
+ ]
519
+ }
520
+ )
521
+ ] }),
522
+ /* @__PURE__ */ d(
523
+ "div",
524
+ {
525
+ ref: a,
526
+ "data-screen-view": !0,
527
+ className: `relative w-full overflow-hidden rounded-lg border border-slate-200 bg-slate-100 dark:border-border dark:bg-white/[0.04] ${t === "live" ? "" : "h-[180px]"}`,
528
+ children: [
529
+ /* @__PURE__ */ n("div", { ref: l, className: t === "live" ? "" : "hidden" }),
530
+ t !== "live" && /* @__PURE__ */ n("div", { className: "absolute inset-0 flex flex-col items-center justify-center gap-1.5 px-6 text-center text-[12px] text-slate-500 dark:text-muted-foreground", children: t === "ended" ? /* @__PURE__ */ n("span", { children: de(e.sharer_name, y) }) : t === "denied" ? /* @__PURE__ */ n("span", { children: "This screen share is only for the person working this request." }) : t === "unavailable" ? /* @__PURE__ */ n("span", { children: "This app cannot show a live screen. Open the request in the admin app." }) : /* @__PURE__ */ d(re, { children: [
531
+ /* @__PURE__ */ n(ae, { className: "h-4 w-4 animate-spin" }),
532
+ /* @__PURE__ */ d("span", { children: [
533
+ "Waiting for ",
534
+ e.sharer_name,
535
+ "'s screen…"
536
+ ] })
537
+ ] }) })
538
+ ]
539
+ }
540
+ ),
541
+ /* @__PURE__ */ d("p", { className: "flex items-center gap-1.5 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
542
+ /* @__PURE__ */ n(be, { className: "h-3.5 w-3.5 shrink-0" }),
543
+ "Typed text and record values are hidden. You are named in the request's history."
544
+ ] })
545
+ ] });
546
+ }
547
+ export {
548
+ Oe as LiveScreenViewer,
549
+ Ae as ScreenShareBar,
550
+ Ve as ScreenShareHost,
551
+ Je as ScreenSharePanel,
552
+ de as endedSentence,
553
+ qe as pillPlacement
554
+ };