strata-react 1.0.33 → 1.0.36

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 (62) hide show
  1. package/README.md +13 -3
  2. package/UPGRADING.md +2 -0
  3. package/dist/components/compare-parts.d.ts +16 -0
  4. package/dist/components/compare-video-grid.d.ts +5 -1
  5. package/dist/components/compare-video.d.ts +12 -1
  6. package/dist/components/compare.d.ts +8 -1
  7. package/dist/components/conversation.d.ts +67 -0
  8. package/dist/components/dialog.d.ts +1 -1
  9. package/dist/components/folder-picker.d.ts +42 -0
  10. package/dist/components/lightbox.d.ts +34 -0
  11. package/dist/components/markable-text.d.ts +56 -0
  12. package/dist/components/media-group.d.ts +25 -0
  13. package/dist/components/media-player.d.ts +80 -2
  14. package/dist/components/pair-vote.d.ts +3 -2
  15. package/dist/components/region-editor.d.ts +55 -0
  16. package/dist/components/sequence-timeline.d.ts +50 -0
  17. package/dist/components/transcript-view.d.ts +36 -0
  18. package/dist/components/tree.d.ts +41 -0
  19. package/dist/components/video-clock.d.ts +9 -1
  20. package/dist/components/viewport.d.ts +22 -0
  21. package/dist/components/waveform.d.ts +66 -0
  22. package/dist/{cursor-DplHNzj3.js → cursor-DDGBPiTJ.js} +2 -200
  23. package/dist/cursor-DDGBPiTJ.js.map +1 -0
  24. package/dist/field-7Z4N5r5g.js +178 -0
  25. package/dist/field-7Z4N5r5g.js.map +1 -0
  26. package/dist/format-B32-PVi2.js +201 -0
  27. package/dist/format-B32-PVi2.js.map +1 -0
  28. package/dist/hls/index.d.ts +19 -0
  29. package/dist/hls.js +84 -0
  30. package/dist/hls.js.map +1 -0
  31. package/dist/index.d.ts +17 -1
  32. package/dist/index.js +3646 -584
  33. package/dist/index.js.map +1 -1
  34. package/dist/lib/marks.d.ts +6 -0
  35. package/dist/lib/region.d.ts +46 -0
  36. package/dist/lib/rich-text.d.ts +44 -0
  37. package/dist/lib/sequence.d.ts +34 -0
  38. package/dist/lib/transcript.d.ts +28 -0
  39. package/dist/lib/waveform.d.ts +36 -0
  40. package/dist/map.js +4 -2
  41. package/dist/map.js.map +1 -1
  42. package/dist/panorama/gl.d.ts +16 -0
  43. package/dist/panorama/index.d.ts +2 -0
  44. package/dist/panorama/panorama-viewer.d.ts +56 -0
  45. package/dist/panorama/projection.d.ts +45 -0
  46. package/dist/panorama.js +657 -0
  47. package/dist/panorama.js.map +1 -0
  48. package/dist/{query-DgJMyXTT.js → query-BJcxJLhh.js} +3 -2
  49. package/dist/{query-DgJMyXTT.js.map → query-BJcxJLhh.js.map} +1 -1
  50. package/dist/{run-BqZGKhW9.js → run-DzyLrZlA.js} +23 -5
  51. package/dist/run-DzyLrZlA.js.map +1 -0
  52. package/dist/testing.js +2 -2
  53. package/dist/{theme-BgTOESmN.js → theme-CFNi6WUO.js} +5 -175
  54. package/dist/theme-CFNi6WUO.js.map +1 -0
  55. package/dist/value-controls-D6O9TsM6.js +356 -0
  56. package/dist/value-controls-D6O9TsM6.js.map +1 -0
  57. package/dist/visual-cli.js +1 -1
  58. package/dist/visual.js +1 -1
  59. package/package.json +19 -4
  60. package/dist/cursor-DplHNzj3.js.map +0 -1
  61. package/dist/run-BqZGKhW9.js.map +0 -1
  62. package/dist/theme-BgTOESmN.js.map +0 -1
@@ -0,0 +1,55 @@
1
+ import { Easing, Rect } from '../lib/region';
2
+ import * as React from "react";
3
+ /** The tone a window is drawn in: a role colour, never a hue of its own. */
4
+ export type RegionTone = "neutral" | "info" | "success" | "warning" | "danger";
5
+ /** One window on the picture, in the picture's coordinates. */
6
+ export type EditableRegion = Rect & {
7
+ id: string;
8
+ label: string;
9
+ tone?: RegionTone;
10
+ };
11
+ export type RegionEditorProps = {
12
+ /** Names the editor: "Crop for the cover photo". Required. */
13
+ label: string;
14
+ /** The picture, drawn to fill the frame (an `<img className="size-full object-cover">`). */
15
+ children: React.ReactNode;
16
+ /** The picture's width and height, which are the units of every window. */
17
+ size: readonly [number, number];
18
+ regions: readonly EditableRegion[];
19
+ /** A window was changed and kept. Receives the whole list, edited. */
20
+ onChange: (regions: readonly EditableRegion[]) => void;
21
+ /** Which window is chosen (controlled); leave out to let the editor keep it. */
22
+ selectedId?: string | null;
23
+ onSelectedChange?: (id: string | null) => void;
24
+ /** Width over height every window keeps. */
25
+ aspect?: number;
26
+ /** The smallest a window may be. Default a twentieth of the picture. */
27
+ min?: {
28
+ w: number;
29
+ h: number;
30
+ };
31
+ /** Where windows may be. Default the whole picture. */
32
+ bounds?: Rect;
33
+ /** An arrow key's step, in the picture's units. Default a hundredth of its longer side. */
34
+ step?: number;
35
+ /** A drag on the empty picture draws a new window and calls this with it; the app adds it. Without it nothing can be drawn. */
36
+ onDraw?: (rect: Rect) => void;
37
+ /** "move": the first window is the start and the second the end; draws a line between them and a Watch button. */
38
+ mode?: "single" | "move";
39
+ /** Called as Watch plays, with the rectangle at `t` (0 to 1) and `t`. Also drawn by the editor. */
40
+ onPreview?: (rect: Rect, t: number) => void;
41
+ /** How long Watch takes, in milliseconds. Default 1500. */
42
+ duration?: number;
43
+ easing?: Easing;
44
+ /** Show a number field for each side of the chosen window under the picture. Default true. */
45
+ fields?: boolean;
46
+ /** The unit of the numbers: "px". */
47
+ unit?: string;
48
+ /** The windows as they began; with it a Reset appears while they differ. */
49
+ defaults?: readonly EditableRegion[];
50
+ className?: string;
51
+ };
52
+ /** A window said in words. */
53
+ export declare const describeRegion: (r: EditableRegion) => string;
54
+ /** Draw and move one or two named windows on a picture, with pointer, keyboard and numbers kept in step; aspect and bounds hold through all three; two windows make a from/to move with a Watch preview. */
55
+ export declare function RegionEditor({ label, children, size, regions, onChange, selectedId, onSelectedChange, aspect, min, bounds, step, onDraw, mode, onPreview, duration, easing, fields, unit, defaults, className, }: RegionEditorProps): React.JSX.Element;
@@ -0,0 +1,50 @@
1
+ import { Grid } from '../lib/sequence';
2
+ import * as React from "react";
3
+ /** One window of the sequence. Windows tile the axis: each starts where the one before ends. */
4
+ export type SequenceItem = {
5
+ id: string;
6
+ label: string;
7
+ start: number;
8
+ end: number;
9
+ };
10
+ /** The room a cut has: the earliest and latest time it may take, with the reason for each end. */
11
+ export type CutRoom = {
12
+ min: number;
13
+ max: number;
14
+ minReason?: string;
15
+ maxReason?: string;
16
+ };
17
+ /** A cut's change: the two windows with their new edges. */
18
+ export type CutChange = {
19
+ before: SequenceItem;
20
+ after: SequenceItem;
21
+ };
22
+ export type SequenceTimelineProps = {
23
+ /** Names the sequence: "Film, windows in order". Required. */
24
+ label: string;
25
+ /** The windows in time order, each starting where the last ends. */
26
+ items: readonly SequenceItem[];
27
+ /** Pixels per second; leave out to fit the width. */
28
+ zoom?: number;
29
+ /** A cut was moved (dragged and let go, or stepped by key). The app applies it. */
30
+ onCutChange: (boundaryIndex: number, time: number, change: CutChange) => void;
31
+ /** The room for the cut between `items[i]` and `items[i + 1]`. Default: each window keeps `minLength`. */
32
+ room?: (boundaryIndex: number) => CutRoom;
33
+ /** The shortest a window may be when `room` is not given. Default 0.1 s. */
34
+ minLength?: number;
35
+ /** A beat grid: a step in seconds, or the beats' times. Cuts snap to it and arrows step along it. */
36
+ grid?: Grid;
37
+ /** The arrow-key step when there is no grid. Default 0.1 s. */
38
+ step?: number;
39
+ /** The windows chosen, as ids. */
40
+ selected?: readonly string[];
41
+ /** A window or a run (Shift+click) was chosen: ids in order. */
42
+ onSelectRange?: (ids: readonly string[]) => void;
43
+ /** The inside of a window, such as a thumbnail; it gets the window and whether it is chosen. */
44
+ renderItem?: (item: SequenceItem, selected: boolean) => React.ReactNode;
45
+ /** The height of the strip. Default 5rem. */
46
+ height?: string;
47
+ className?: string;
48
+ };
49
+ /** A gapless strip of windows whose cuts are dragged or stepped, snapping to a beat grid inside the room the app gives; each cut is a slider that announces both windows' new lengths; Shift+click chooses a run. */
50
+ export declare function SequenceTimeline({ label, items, zoom, onCutChange, room, minLength, grid, step, selected, onSelectRange, renderItem, height, className, }: SequenceTimelineProps): React.JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { TranscriptGroup, TranscriptPhrase } from '../lib/transcript';
2
+ import * as React from "react";
3
+ /** What a seek from the transcript says about where it came from. */
4
+ export type TranscriptSeek = {
5
+ phraseId: string; /** The word pressed, when a word was. */
6
+ wordIndex?: number;
7
+ };
8
+ export type TranscriptViewProps = {
9
+ /** Names the transcript. */
10
+ label: string;
11
+ /** Phrases by clip, in time order. */
12
+ groups: readonly TranscriptGroup[];
13
+ /** The player's time, seconds. */
14
+ time: number;
15
+ /** A word or phrase was pressed: seconds to play from, and which. */
16
+ onSeek: (time: number, from: TranscriptSeek) => void;
17
+ /** The mode shown: "original" (the words) or a key of the phrases' `alt`. Leave out to let the component hold it. */
18
+ mode?: string;
19
+ onModeChange?: (mode: string) => void;
20
+ /** Names for the modes: `{ translated: "English" }`. Default: the key, capitalised. */
21
+ modeLabels?: Readonly<Record<string, string>>;
22
+ /** Show one speaker's phrases: "all" or a speaker. Leave out to let the component hold it. */
23
+ speaker?: string;
24
+ onSpeakerChange?: (speaker: string) => void;
25
+ /** Scroll the heard phrase into view while the person has not scrolled away. Default true. */
26
+ follow?: boolean;
27
+ /** Say each phrase politely as it starts. Default false. */
28
+ announce?: boolean;
29
+ /** A control at the start of each phrase (a `PlayWindowButton`). */
30
+ renderPlay?: (phrase: TranscriptPhrase) => React.ReactNode;
31
+ /** Height of the scroll box once it is long enough to virtualise. Default 480. */
32
+ height?: number;
33
+ className?: string;
34
+ };
35
+ /** Timed text that follows playback: the heard word marked, any word or phrase pressed to play from, modes, speakers, follow and Jump to now. */
36
+ export declare function TranscriptView({ label, groups, time, onSeek, mode: controlledMode, onModeChange, modeLabels, speaker: controlledSpeaker, onSpeakerChange, follow, announce, renderPlay, height, className }: TranscriptViewProps): React.JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { Load } from './data-view';
2
+ import { Expanded } from './disclosure';
3
+ import * as React from "react";
4
+ /** A node's place in the tree, passed to `renderNode`. */
5
+ export type TreeNodeState = {
6
+ expanded: boolean;
7
+ selected: boolean;
8
+ level: number;
9
+ branch: boolean;
10
+ };
11
+ export type TreeProps<N> = {
12
+ /** Names the tree for assistive technology: "Folders". Required. */
13
+ label: string;
14
+ /** The top level, as one read: the skeleton, the failure and Try again come from `DataView`'s `Load`. */
15
+ roots: Load<readonly N[]>;
16
+ /** The children of an open node, as a hook (`useLoad` inside). Called only while the node is open. */
17
+ useChildren: (node: N) => Load<readonly N[]>;
18
+ /** A node's key, unique in the whole tree: a path, an id. */
19
+ nodeKey: (node: N) => string;
20
+ /** A node's name: shown, and what type-ahead matches. */
21
+ nodeLabel: (node: N) => string;
22
+ /** Whether a node can open. Default: every node can. */
23
+ isBranch?: (node: N) => boolean;
24
+ /** What a row shows after the icon. Default: the name, cut with an ellipsis. */
25
+ renderNode?: (node: N, state: TreeNodeState) => React.ReactNode;
26
+ /** The chosen node's key, or `null`. */
27
+ selected: string | null;
28
+ /** A node was chosen. */
29
+ onSelect: (key: string, node: N) => void;
30
+ /** Which nodes are open; from `useExpanded`, optionally in the URL. */
31
+ expanded: Expanded;
32
+ /** The skeleton row while a node's children load. Default: a muted bar. */
33
+ loadingRow?: React.ReactNode;
34
+ /** What an open node with nothing in it says: "No folders". Required, so an empty branch is never blank. */
35
+ emptyRow: string;
36
+ /** The tallest the tree may be before it scrolls, as a CSS length. Default 24rem. */
37
+ height?: string;
38
+ className?: string;
39
+ };
40
+ /** A hierarchy whose children load as each node opens (a `useChildren` hook per open node): a skeleton row, a Try again row and an "empty" row per node, type-ahead and arrow keys, single selection, open state optionally in the URL, always virtualised. */
41
+ export declare function Tree<N>({ label, roots, useChildren, nodeKey, nodeLabel, isBranch, renderNode, selected, onSelect, expanded, loadingRow, emptyRow, height, className }: TreeProps<N>): React.JSX.Element;
@@ -15,11 +15,17 @@ export type VideoClockOptions = {
15
15
  onLoopChange?: (loop: VideoLoop) => void;
16
16
  /** The index of the video whose sound is heard; none when `null`. */
17
17
  audio: number | null;
18
+ /** Start playing once every video has its metadata (and muted, unless the person chose a sound level), and again for each new `pairKey`. `"always"` also with reduced motion. Default off. */
19
+ autoPlay?: boolean | "always";
20
+ /** Loop from 0 to the natural end when no range is set. A range with both ends set wins. Default off. */
21
+ loopWhole?: boolean;
22
+ /** Names the pair on the clock: when it changes the clock starts again at 0, paused (or playing, with `autoPlay`). */
23
+ pairKey?: string;
18
24
  };
19
25
  /** The clock and everything a transport needs. */
20
26
  export type VideoClock = ReturnType<typeof useVideoClock>;
21
27
  /** Plays, pauses, seeks, steps and loops any number of videos together. */
22
- export declare function useVideoClock({ fps, loop: loopProp, onLoopChange, audio }: VideoClockOptions): {
28
+ export declare function useVideoClock({ fps, loop: loopProp, onLoopChange, audio, autoPlay, loopWhole, pairKey }: VideoClockOptions): {
23
29
  attach: (index: number) => (el: HTMLVideoElement | null) => void;
24
30
  restore: (e: React.SyntheticEvent<HTMLVideoElement>) => void;
25
31
  wanted: boolean;
@@ -38,6 +44,8 @@ export declare function useVideoClock({ fps, loop: loopProp, onLoopChange, audio
38
44
  failed: boolean;
39
45
  loop: VideoLoop;
40
46
  looping: boolean;
47
+ /** The whole clip loops: asked for, and no range set to override it. */
48
+ loopsWhole: boolean;
41
49
  setPoint: (point: "start" | "end") => void;
42
50
  clearLoop: () => void;
43
51
  volume: number;
@@ -7,6 +7,24 @@ export type ViewportState = {
7
7
  };
8
8
  /** Zoom and pan held in React state, to give to every `ViewportFrame` that should move together. */
9
9
  export declare function useViewport(initial?: Viewport): ViewportState;
10
+ /** Where a click on a frame would choose: a stretch of the frame's width as shares (0 to 1), what it chooses and what to say about it. */
11
+ export type PickZone = {
12
+ value: string;
13
+ from: number;
14
+ to: number;
15
+ hint: string;
16
+ };
17
+ /** How a frame takes a click as a choice. */
18
+ export type FramePick = {
19
+ /** The zone under a pointer at `x` (0 to 1 across the frame), or null where a click chooses nothing. */
20
+ zoneAt: (x: number) => PickZone | null;
21
+ /** A click happened in `zone`. */
22
+ onPick: (zone: PickZone) => void;
23
+ /** What the frame is described as for assistive technology: "Click to choose A". */
24
+ describe: string;
25
+ /** Names what is being judged. A choice still waiting out the double-click window is dropped if this changes or the pick goes away (the next pair came up, or an answer is pending). */
26
+ token?: string;
27
+ };
10
28
  /** Props for `ViewportFrame`. */
11
29
  export type ViewportFrameProps = ViewportState & {
12
30
  /** Names the frame for screen readers: "Picture A". Required. */
@@ -32,6 +50,8 @@ export type ViewportFrameProps = ViewportState & {
32
50
  }) => void;
33
51
  /** A box to outline on the whole picture (a region being pointed at), as shares of it. Drawn only while the picture is fitted. */
34
52
  outline?: ShareBox | null;
53
+ /** Take a click (not a drag, not a double click) as a choice: see the note at the top of the file. Without it a click does nothing, as before. */
54
+ pick?: FramePick;
35
55
  className?: string;
36
56
  };
37
57
  /** A clipped frame whose children zoom and pan together; the viewport is the caller's, so frames can share one. */
@@ -59,5 +79,7 @@ export declare const ViewportFrame: React.ForwardRefExoticComponent<ViewportStat
59
79
  }) => void;
60
80
  /** A box to outline on the whole picture (a region being pointed at), as shares of it. Drawn only while the picture is fitted. */
61
81
  outline?: ShareBox | null;
82
+ /** Take a click (not a drag, not a double click) as a choice: see the note at the top of the file. Without it a click does nothing, as before. */
83
+ pick?: FramePick;
62
84
  className?: string;
63
85
  } & React.RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,66 @@
1
+ import { DecodedAudio, WaveformPeaks } from '../lib/waveform';
2
+ import * as React from "react";
3
+ /** What a mark is, which sets how its line is drawn. */
4
+ export type WaveformMarkKind = "beat" | "bar" | "downbeat" | "chapter";
5
+ /** A moment on the waveform: a beat, a bar line, the first downbeat, a chapter. */
6
+ export type WaveformMark = {
7
+ time: number;
8
+ label?: string;
9
+ kind?: WaveformMarkKind; /** In the list for screen readers. Default: yes, except beats. */
10
+ listed?: boolean;
11
+ };
12
+ /** Shading tones for spans. */
13
+ export type WaveformTone = "neutral" | "info" | "success" | "warning" | "danger";
14
+ /** A stretch of the file: voice, silence, a chosen part. */
15
+ export type WaveformSpan = {
16
+ from: number;
17
+ to: number;
18
+ label: string;
19
+ tone?: WaveformTone;
20
+ };
21
+ type Common = {
22
+ /** Names the waveform: "Waveform of the interview". */
23
+ label: string;
24
+ /** Seconds. Needed with `peaks`; with `source` it defaults to the decoded file's. */
25
+ duration?: number;
26
+ /** The playhead, seconds. */
27
+ time: number;
28
+ /** A click, a drag or a key moved the playhead. */
29
+ onSeek: (time: number) => void;
30
+ marks?: readonly WaveformMark[];
31
+ spans?: readonly WaveformSpan[];
32
+ /** A picture under the plot on the same x axis (a spectrogram `<img>`): it is stretched to the file's length and follows the zoom. */
33
+ underlay?: React.ReactNode;
34
+ /** The chosen range, seconds, or null. Leave out to let the component hold it. */
35
+ range?: readonly [number, number] | null;
36
+ onRangeChange?: (range: [number, number] | null) => void;
37
+ /** Seconds an arrow key moves. Default 5. */
38
+ step?: number;
39
+ /** Seconds Shift or a Page key moves. Default 30. */
40
+ bigStep?: number;
41
+ /** The part of the file shown at first, seconds (zoomed in). The component keeps the view after that. */
42
+ defaultView?: readonly [number, number];
43
+ /** How many peaks a decoded file is reduced to. Default 2000. */
44
+ buckets?: number;
45
+ /** Turns a decoded file into samples. Default: the browser's `AudioContext.decodeAudioData`. */
46
+ decode?: (data: ArrayBuffer) => Promise<DecodedAudio>;
47
+ /** The words of the reading state; defaults say "Reading the waveform". */
48
+ words?: {
49
+ running: string;
50
+ finished: string;
51
+ failed: string;
52
+ };
53
+ disabled?: boolean;
54
+ className?: string;
55
+ };
56
+ /** `peaks` or a `source` to decode: one of them, so a waveform with nothing to draw cannot be written. */
57
+ export type WaveformProps = Common & ({
58
+ peaks: WaveformPeaks;
59
+ source?: never;
60
+ } | {
61
+ source: string | Blob;
62
+ peaks?: never;
63
+ });
64
+ /** An audio waveform with marks, spans and a playhead: one slider you click, drag or key to seek, zoom, and a range to select. */
65
+ export declare function Waveform({ label, peaks, source, duration: given, time, onSeek, marks, spans, underlay, range: controlledRange, onRangeChange, step, bigStep, defaultView, buckets, decode, words, disabled, className }: WaveformProps): React.JSX.Element;
66
+ export {};
@@ -1,203 +1,5 @@
1
1
  import * as React from "react";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- // src/lib/format.ts
4
- var NBSP = "\xA0";
5
- /** The placeholder printed for a value that is not known: an en dash. */
6
- var MISSING = "–";
7
- var BYTE_UNITS = [
8
- "B",
9
- "kB",
10
- "MB",
11
- "GB",
12
- "TB",
13
- "PB"
14
- ];
15
- var BYTE_SIZE = Object.fromEntries(BYTE_UNITS.map((u, i) => [u, 1e3 ** i]));
16
- /** A Date from a Date, an ISO string or epoch milliseconds; throws a RangeError naming the input when it is not a date. */
17
- function toDate(value) {
18
- const date = value instanceof Date ? value : new Date(value);
19
- if (Number.isNaN(date.getTime())) throw new RangeError(`Not a date: ${JSON.stringify(String(value))}`);
20
- return date;
21
- }
22
- function callableDate(df, missing) {
23
- const format = (value) => value == null ? missing : df.format(toDate(value));
24
- return Object.assign(format, {
25
- format,
26
- formatToParts: (value) => df.formatToParts(toDate(value)),
27
- formatRange: (start, end) => df.formatRange(toDate(start), toDate(end)),
28
- resolvedOptions: () => df.resolvedOptions()
29
- });
30
- }
31
- function callable(nf, missing) {
32
- const format = (value) => value == null ? missing : nf.format(value);
33
- return Object.assign(format, {
34
- format,
35
- formatToParts: (value) => nf.formatToParts(value),
36
- resolvedOptions: () => nf.resolvedOptions()
37
- });
38
- }
39
- var DAY = 864e5;
40
- var AGO_STEPS = [
41
- ["year", 365 * DAY],
42
- ["month", 30 * DAY],
43
- ["week", 7 * DAY],
44
- ["day", DAY],
45
- ["hour", 36e5],
46
- ["minute", 6e4]
47
- ];
48
- /** Intl formatters for one locale (and optionally one time zone): integers, decimals, percent, dates, times, units with a non-breaking space, byte sizes, and counted nouns. */
49
- function createFormat(locale, options = {}) {
50
- const { timeZone, missing = "–" } = options;
51
- const dates = (opts) => callableDate(new Intl.DateTimeFormat(locale, {
52
- ...opts,
53
- timeZone
54
- }), missing);
55
- const integer = callable(new Intl.NumberFormat(locale, { maximumFractionDigits: 0 }), missing);
56
- const decimal = callable(new Intl.NumberFormat(locale, { maximumFractionDigits: 1 }), missing);
57
- const percent = callable(new Intl.NumberFormat(locale, {
58
- style: "percent",
59
- maximumFractionDigits: 0
60
- }), missing);
61
- const compact = callable(new Intl.NumberFormat(locale, {
62
- notation: "compact",
63
- maximumFractionDigits: 1
64
- }), missing);
65
- const relative = new Intl.RelativeTimeFormat(locale, { numeric: "auto" });
66
- const plurals = new Intl.PluralRules(locale);
67
- const clock = dates({
68
- hour: "2-digit",
69
- minute: "2-digit"
70
- });
71
- const day = dates({
72
- weekday: "long",
73
- day: "numeric",
74
- month: "long"
75
- });
76
- const shortDay = dates({
77
- weekday: "short",
78
- hour: "2-digit",
79
- minute: "2-digit"
80
- });
81
- const date = dates({ dateStyle: "medium" });
82
- const dateTime = dates({
83
- dateStyle: "medium",
84
- timeStyle: "short"
85
- });
86
- const withUnit = (value, unit, fmt = integer) => `${fmt.format(value)} ${unit}`;
87
- return {
88
- locale,
89
- /** The zone times are shown in, or `undefined` for the viewer's own. */
90
- timeZone,
91
- /** Whole numbers with grouping: `format.integer(1222)` is "1,222". */
92
- integer,
93
- /** One decimal place at most: `format.decimal(3.14)` is "3.1". */
94
- decimal,
95
- /** A ratio as a whole percent: `format.percent(0.42)` is "42%". */
96
- percent,
97
- /**
98
- * A part's share of a whole, as `percent` but never misleading at the ends: a part above 0 that
99
- * rounds to 0 is "<1%", and one short of the whole that rounds to 100 is ">99%".
100
- * `format.share(2.4 / 512)` is "<1%".
101
- */
102
- share: (value) => {
103
- if (value == null || Number.isNaN(value)) return missing;
104
- if (value > 0 && value < .005) return `<${percent.format(.01)}`;
105
- if (value >= .995 && value < 1) return `>${percent.format(.99)}`;
106
- return percent.format(value);
107
- },
108
- /** A figure in short form for counts that run to thousands: `format.compact(1234)` is "1.2k" in en-GB, "1.2K" in en-US. */
109
- compact,
110
- /**
111
- * How long ago (or how far ahead) a time is, in the largest unit it reaches:
112
- * "3 weeks ago", "yesterday", "in 2 hours", "now" under a minute. Pass `now` in tests.
113
- */
114
- ago: (value, now = /* @__PURE__ */ new Date()) => {
115
- if (value == null) return missing;
116
- const diff = toDate(value).getTime() - toDate(now).getTime();
117
- const span = Math.abs(diff);
118
- for (const [unit, size] of AGO_STEPS) if (span >= size) return relative.format(Math.sign(diff) * Math.floor(span / size), unit);
119
- return relative.format(0, "second");
120
- },
121
- /**
122
- * A media running time from seconds, as a player shows it: "4:05", "1:02:09". Unknown
123
- * (null, negative, not finite) prints the placeholder. Set it in `tabular-nums`.
124
- */
125
- runningTime: (seconds) => {
126
- if (seconds == null || !Number.isFinite(seconds) || seconds < 0) return missing;
127
- const s = Math.floor(seconds);
128
- const two = (n) => String(n).padStart(2, "0");
129
- const [h, m] = [Math.floor(s / 3600), Math.floor(s % 3600 / 60)];
130
- return h > 0 ? `${h}:${two(m)}:${two(s % 60)}` : `${m}:${two(s % 60)}`;
131
- },
132
- /**
133
- * A position in media as an editor shows it, to a chosen precision: "4:05" (seconds), "4:05.250"
134
- * (`"ms"`), or "0:04:05:07" (`"frames"` at `fps`, the last part the frame). Hours appear only
135
- * from one hour, except in frames. Frames are always four parts, hours included, as SMPTE
136
- * timecode is (non-drop frame, with colons): a three-part "1:05:00" reads as one hour five, so
137
- * a frame count must never be three. Editors write the same four parts (strata-react issue
138
- * #122). Floors, never rounds up, so a time never reads ahead of the picture. Unknown (null,
139
- * negative, not finite) prints the placeholder. Set it in `tabular-nums`.
140
- */
141
- timecode: (seconds, { precision = "seconds", fps = 30 } = {}) => {
142
- if (seconds == null || !Number.isFinite(seconds) || seconds < 0) return missing;
143
- const whole = Math.floor(seconds);
144
- const two = (n) => String(n).padStart(2, "0");
145
- const [h, m] = [Math.floor(whole / 3600), Math.floor(whole % 3600 / 60)];
146
- const base = h > 0 ? `${h}:${two(m)}:${two(whole % 60)}` : `${m}:${two(whole % 60)}`;
147
- if (precision === "ms") return `${base}.${String(Math.min(Math.floor((seconds - whole) * 1e3 + 1e-6), 999)).padStart(3, "0")}`;
148
- if (precision === "frames") return `${h}:${two(m)}:${two(whole % 60)}:${two(Math.min(Math.floor((seconds - whole) * fps + 1e-6), Math.ceil(fps) - 1))}`;
149
- return base;
150
- },
151
- /** What a missing value prints as: an en dash unless `createFormat`'s `missing` says otherwise. */
152
- missing,
153
- /** A time of day: `format.clock(at)` is "06:05". */
154
- clock,
155
- /** A day without its year, for this week's things: `format.day(at)` is "Sunday 8 November". */
156
- day,
157
- /** A weekday and time, for chart axes and recent rows: `format.shortDay(at)` is "Sun 06:05". */
158
- shortDay,
159
- /** A date with its year, for a record or a deadline: `format.date(at)` is "8 Nov 2026". */
160
- date,
161
- /** A date and time, for a log or history row: `format.dateTime(at)` is "8 Nov 2026, 06:05". */
162
- dateTime,
163
- /** A figure and its unit joined by a non-breaking space (`NBSP`), so they never wrap apart. */
164
- withUnit,
165
- /** A temperature in °C, joined by a non-breaking space. */
166
- celsius: (value) => withUnit(value, "°C"),
167
- /**
168
- * A size in bytes in the largest decimal unit it reaches (kB, MB, GB, TB, as disks and
169
- * networks are sold): one decimal below 10 ("5.2 GB"), whole above ("431 GB"). Pass `unit`
170
- * to fix the unit, so figures compared side by side ("431 of 466 GB") share one.
171
- */
172
- bytes: (value, unit) => {
173
- const chosen = unit ?? [...BYTE_UNITS].reverse().find((u) => Math.abs(value) >= BYTE_SIZE[u]) ?? "B";
174
- const scaled = value / BYTE_SIZE[chosen];
175
- return withUnit(scaled, chosen, Math.abs(scaled) < 10 && chosen !== "B" ? decimal : integer);
176
- },
177
- /**
178
- * A distance in metres as a person says it: metres under a kilometre ("850 m"), then
179
- * kilometres, one decimal below 100 ("12.4 km"), whole above; `"imperial"` is feet under a
180
- * tenth of a mile ("320 ft"), then miles ("7.7 mi").
181
- */
182
- distance: (metres, system = "metric") => {
183
- if (system === "imperial") {
184
- const miles = metres / 1609.344;
185
- return miles < .1 ? withUnit(metres * 3.28084, "ft") : withUnit(miles, "mi", miles < 100 ? decimal : integer);
186
- }
187
- return Math.abs(metres) < 1e3 ? withUnit(metres, "m") : withUnit(metres / 1e3, "km", Math.abs(metres) < 1e5 ? decimal : integer);
188
- },
189
- /** The unit `bytes` would choose for a value, to share it across a set of figures. */
190
- byteUnit: (value) => [...BYTE_UNITS].reverse().find((u) => Math.abs(value) >= BYTE_SIZE[u]) ?? "B",
191
- /**
192
- * "1 piece", "6 pieces": the count and its noun, so copy never reads "1 pieces". They are
193
- * joined by a non-breaking space (`NBSP`), not a plain one: in a test, match with the same
194
- * call or a `\s` regex, not a typed "6 pieces" string in a role's `name`.
195
- */
196
- count: (value, one, many = `${one}s`, { compact: short = false } = {}) => value == null ? missing : `${(short ? compact : integer).format(value)} ${plurals.select(value) === "one" ? one : many}`
197
- };
198
- }
199
- /** The en-GB formatters. */
200
- var format = createFormat("en-GB");
201
3
  // src/lib/geo.ts
202
4
  var RAD = Math.PI / 180;
203
5
  var EARTH_RADIUS_M = 6371e3;
@@ -483,6 +285,6 @@ function useSharedCursor(source) {
483
285
  setPlayback
484
286
  ]);
485
287
  }
486
- export { NBSP as a, toDate as c, MISSING as i, useSharedCursor as n, createFormat as o, geo as r, format as s, CursorScope as t };
288
+ export { useSharedCursor as n, geo as r, CursorScope as t };
487
289
 
488
- //# sourceMappingURL=cursor-DplHNzj3.js.map
290
+ //# sourceMappingURL=cursor-DDGBPiTJ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cursor-DDGBPiTJ.js","names":[],"sources":["../src/lib/geo.ts","../src/components/cursor.tsx"],"sourcesContent":["// Geometry for routes on a map (strata-react issue #80; the helpers jonathanburnhams.com wrote by\n// hand for its activity maps). Pure functions on `[latitude, longitude]` pairs in degrees, no map\n// library, so they live in the main entry and an app can use them for a text alternative or a\n// profile without installing the map's peer.\n//\n// Distances are great-circle (haversine) on a 6,371 km sphere, which is within half a percent of\n// the true figure at any route length a person runs, rides or drives. Bearings use a flat\n// approximation between neighbouring points (the longitude scaled by the cosine of the mean\n// latitude), fine for the short hops a chevron or a heading needs and wrong for a leg of hundreds\n// of kilometres: `bearing` is for neighbouring points, not for a flight.\n\n/** A position: `[latitude, longitude]` in degrees. */\nexport type LatLng = readonly [lat: number, lng: number];\n\nconst RAD = Math.PI / 180;\nconst EARTH_RADIUS_M = 6_371_000;\n\n/** Great-circle distance between two positions, in metres. */\nexport function distance([lat1, lng1]: LatLng, [lat2, lng2]: LatLng): number {\n const a = Math.sin(((lat2 - lat1) * RAD) / 2) ** 2 + Math.cos(lat1 * RAD) * Math.cos(lat2 * RAD) * Math.sin(((lng2 - lng1) * RAD) / 2) ** 2;\n return 2 * EARTH_RADIUS_M * Math.asin(Math.sqrt(a));\n}\n\n/** The direction from `a` to `b` in degrees clockwise from north (0 to 360), for neighbouring points. */\nexport function bearing([lat1, lng1]: LatLng, [lat2, lng2]: LatLng): number {\n const dx = (lng2 - lng1) * Math.cos((((lat1 + lat2) / 2) * Math.PI) / 180);\n const dy = lat2 - lat1;\n return ((Math.atan2(dx, dy) * 180) / Math.PI + 360) % 360;\n}\n\n/** The running distance along a route at each point, in metres, starting at 0. */\nexport function cumulative(points: readonly LatLng[]): number[] {\n const out = points.length ? [0] : [];\n for (let i = 1; i < points.length; i++) out.push(out[i - 1] + distance(points[i - 1], points[i]));\n return out;\n}\n\n/** The length of a route in metres. */\nexport function length(points: readonly LatLng[]): number {\n let total = 0;\n for (let i = 1; i < points.length; i++) total += distance(points[i - 1], points[i]);\n return total;\n}\n\n/** The south-west and north-east corners that hold every point, or null for none. */\nexport function bounds(points: readonly LatLng[]): [LatLng, LatLng] | null {\n if (!points.length) return null;\n let south = Infinity;\n let north = -Infinity;\n let west = Infinity;\n let east = -Infinity;\n for (const [lat, lng] of points) {\n if (lat < south) south = lat;\n if (lat > north) north = lat;\n if (lng < west) west = lng;\n if (lng > east) east = lng;\n }\n return [\n [south, west],\n [north, east],\n ];\n}\n\n/** The position `metres` along a route (clamped to its ends), by linear interpolation, or null for no points. */\nexport function pointAlong(points: readonly LatLng[], metres: number, along: readonly number[] = cumulative(points)): LatLng | null {\n if (!points.length) return null;\n const total = along[along.length - 1];\n const d = Math.min(Math.max(metres, 0), total);\n if (points.length === 1 || total === 0) return points[0];\n let lo = 1;\n let hi = points.length - 1;\n while (lo < hi) {\n const mid = (lo + hi) >> 1;\n if (along[mid] < d) lo = mid + 1;\n else hi = mid;\n }\n const [p, q] = [points[lo - 1], points[lo]];\n const t = (d - along[lo - 1]) / (along[lo] - along[lo - 1] || 1);\n return [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t];\n}\n\n/**\n * `count` positions evenly spaced by distance along a route (the ends skipped), each with the\n * direction of travel there. The direction is smoothed: the bearing from a point a fraction\n * (`window`) of the spacing before to one the same distance after, so GPS jitter and a tight bend\n * do not turn a chevron sideways.\n */\nexport function arrows(points: readonly LatLng[], count = 5, window = 0.4): { position: LatLng; bearing: number }[] {\n if (points.length < 2 || count < 1) return [];\n const along = cumulative(points);\n const total = along[along.length - 1];\n if (total === 0) return [];\n const spacing = total / (count + 1);\n const half = spacing * window;\n return Array.from({ length: count }, (_, i) => {\n const target = spacing * (i + 1);\n const before = pointAlong(points, target - half, along)!;\n const after = pointAlong(points, target + half, along)!;\n return { position: pointAlong(points, target, along)!, bearing: bearing(before, after) };\n });\n}\n\n/** The first and last positions, and whether they are within `loopWithin` metres of each other (a loop), or null for no route. */\nexport function ends(points: readonly LatLng[], loopWithin = 50): { start: LatLng; finish: LatLng; loop: boolean } | null {\n if (!points.length) return null;\n const start = points[0];\n const finish = points[points.length - 1];\n return { start, finish, loop: distance(start, finish) <= loopWithin };\n}\n\n/** The index of the point nearest `position`, for \"where on the route is this?\". */\nexport function nearest(points: readonly LatLng[], position: LatLng): number {\n let best = -1;\n let bestD = Infinity;\n points.forEach((p, i) => {\n const d = distance(p, position);\n if (d < bestD) {\n bestD = d;\n best = i;\n }\n });\n return best;\n}\n\n/** The part of a route between two distances along it (metres, clamped, either order): the cut ends and every point between. Empty for no route. */\nexport function slice(points: readonly LatLng[], from: number, to: number, along: readonly number[] = cumulative(points)): LatLng[] {\n if (!points.length) return [];\n const [a, b] = from <= to ? [from, to] : [to, from];\n const start = pointAlong(points, a, along)!;\n const end = pointAlong(points, b, along)!;\n const lo = Math.max(a, 0);\n const hi = Math.min(b, along[along.length - 1]);\n const inside = points.filter((_, i) => along[i] > lo && along[i] < hi);\n return [start, ...inside, end];\n}\n\n/**\n * The nearest point on a route to `position`, not only its vertices: where it lies, how far along the\n * route that is, and how far `position` is from the route. The inverse of `pointAlong` (a cursor on a\n * map is a distance on a chart). Each leg is flattened around its own latitude, which is exact enough\n * for any leg a recording has; `index` is the leg's first point. Null for fewer than one point.\n */\nexport function snap(points: readonly LatLng[], position: LatLng, along: readonly number[] = cumulative(points)): { position: LatLng; metres: number; offset: number; index: number } | null {\n if (!points.length) return null;\n if (points.length === 1) return { position: points[0], metres: 0, offset: distance(points[0], position), index: 0 };\n let best: { position: LatLng; metres: number; offset: number; index: number } | null = null;\n for (let i = 1; i < points.length; i++) {\n const [p, q] = [points[i - 1], points[i]];\n const k = Math.cos((((p[0] + q[0]) / 2) * Math.PI) / 180);\n const [dx, dy] = [(q[1] - p[1]) * k, q[0] - p[0]];\n const len2 = dx * dx + dy * dy;\n const t = len2 === 0 ? 0 : Math.min(1, Math.max(0, (((position[1] - p[1]) * k) * dx + (position[0] - p[0]) * dy) / len2));\n const at: LatLng = [p[0] + (q[0] - p[0]) * t, p[1] + (q[1] - p[1]) * t];\n const offset = distance(at, position);\n if (!best || offset < best.offset) best = { position: at, metres: along[i - 1] + (along[i] - along[i - 1]) * t, offset, index: i - 1 };\n }\n return best;\n}\n\n/** Route geometry helpers: `geo.distance`, `bearing`, `length`, `cumulative`, `bounds`, `pointAlong`, `snap` (its inverse), `slice`, `arrows`, `ends`, `nearest`. */\nexport const geo = { distance, bearing, cumulative, length, bounds, pointAlong, snap, slice, arrows, ends, nearest };\n","import * as React from \"react\";\n\n// A shared cursor: one position that a map, several charts and a seek bar all show at once (strata-react\n// issue #184, from strata-360, where the cursor on the elevation and pace charts is the marker on the\n// route). Each of those components already draws one position well; what an app lacked was the wiring.\n//\n// One position in a canonical unit the app chooses (metres along a route, or seconds), and every member\n// says how its own x maps to it (`CursorMapping`; the identity when they already agree). The rules:\n//\n// - **A writer never reacts to its own writes.** Every member has a `source` id, and a position whose\n// source is its own is not drawn back at it (a chart's own pointer already draws its own rule).\n// - **Two owners, and the pointer wins.** Playback sets the cursor (sixty times a second); a pointer or\n// key over any member sets it too, and holds it until it leaves, and then playback's position is\n// still there. Stored as two entries, not one value, so \"pointer left\" has something to fall back to.\n// - **It is not announced as it moves.** The scope has one polite live region, written at most once a\n// second and only for a pointer or key (never playback): sixty announcements a second are worse than\n// silence (§3.22).\n// - **A store, not state in the scope.** Members subscribe to it; the scope's children do not render\n// when the cursor moves, only the members that read it.\n//\n// Checked: React Aria has no shared-pointer part; `useSyncExternalStore` is React's own.\n\n/** Who set the cursor: a pointer or key over a member, or playback (a player's clock). */\nexport type CursorOwner = \"pointer\" | \"playback\";\n\n/** How a member's own x relates to the scope's unit. Both default to the identity. */\nexport type CursorMapping = {\n /** From this member's x to the scope's unit (a chart in seconds in a scope in metres: look it up in the series). */\n toCursor?: (x: number) => number;\n /** From the scope's unit to this member's x. */\n fromCursor?: (at: number) => number;\n};\n\ntype Entry = { at: number; source: string };\ntype Snapshot = {\n /** The position now: the pointer's while there is one, else playback's; null when neither is set. */\n at: number | null;\n /** Who wrote `at`; a member ignores a position it wrote. */\n source: string | null;\n owner: CursorOwner | null;\n};\n\nconst EMPTY: Snapshot = { at: null, source: null, owner: null };\n\nclass CursorStore {\n private pointer: Entry | null = null;\n private playback: Entry | null = null;\n private listeners = new Set<() => void>();\n snapshot: Snapshot = EMPTY;\n subscribe = (fn: () => void) => {\n this.listeners.add(fn);\n return () => void this.listeners.delete(fn);\n };\n private publish() {\n const e = this.pointer ?? this.playback;\n const owner: CursorOwner | null = this.pointer ? \"pointer\" : this.playback ? \"playback\" : null;\n if (e?.at === this.snapshot.at && e?.source === this.snapshot.source && owner === this.snapshot.owner) return;\n this.snapshot = e ? { at: e.at, source: e.source, owner } : EMPTY;\n for (const l of this.listeners) l();\n }\n /** A pointer or key over a member. `null` means it left: it clears only if the pointer was this member's, so a stale leave cannot remove another member's position. */\n setPointer(at: number | null, source: string) {\n if (at === null) {\n if (this.pointer?.source !== source) return;\n this.pointer = null;\n } else this.pointer = { at, source };\n this.publish();\n }\n setPlayback(at: number | null, source: string) {\n this.playback = at === null ? null : { at, source };\n this.publish();\n }\n}\n\nconst Scope = React.createContext<CursorStore | null>(null);\n\nexport type CursorScopeProps = {\n children: React.ReactNode;\n /** Words for the position in the scope's unit (\"12.4 km along\", \"1:23\"), for the polite announcement. Without it nothing is announced. */\n format?: (at: number) => string;\n /** Milliseconds between announcements. Default 1000. */\n announceEvery?: number;\n};\n\n/** Holds one cursor position for the charts, map and seek bar inside it, with a throttled polite announcement of where a pointer or key has put it. */\nexport function CursorScope({ children, format, announceEvery = 1000 }: CursorScopeProps) {\n const store = React.useRef<CursorStore | null>(null);\n store.current ??= new CursorStore();\n return (\n <Scope.Provider value={store.current}>\n {children}\n {format && <CursorAnnouncer store={store.current} format={format} every={announceEvery} />}\n </Scope.Provider>\n );\n}\n\n/** The live region: the latest pointer position, at most once per `every` ms (a throttle, so a pointer that never rests is still announced). */\nfunction CursorAnnouncer({ store, format, every }: { store: CursorStore; format: (at: number) => string; every: number }) {\n const snap = React.useSyncExternalStore(store.subscribe, () => store.snapshot, () => EMPTY);\n const [text, setText] = React.useState(\"\");\n const latest = React.useRef({ snap, format });\n latest.current = { snap, format };\n const last = React.useRef(0);\n const timer = React.useRef<number | undefined>(undefined);\n React.useEffect(() => {\n // Playback moves the cursor every frame and is never spoken; a pointer leaving says nothing.\n if (snap.owner !== \"pointer\" || snap.at === null) return;\n const speak = () => {\n timer.current = undefined;\n last.current = Date.now();\n const { snap: s, format: f } = latest.current;\n if (s.owner === \"pointer\" && s.at !== null) setText(f(s.at));\n };\n const wait = last.current + every - Date.now();\n if (wait <= 0) speak();\n else timer.current ??= window.setTimeout(speak, wait);\n }, [snap, every]);\n React.useEffect(() => () => window.clearTimeout(timer.current), []);\n return (\n <p role=\"status\" aria-live=\"polite\" className=\"sr-only\">\n {text}\n </p>\n );\n}\n\n/** What a member reads and writes. */\nexport type SharedCursor = Snapshot & {\n /** This member's own id: positions it writes are not drawn back at it. */\n source: string;\n /** The position another member (or playback) put there, in the scope's unit; null when none or when this member wrote it. */\n other: number | null;\n /** The pointer or keyboard is at `at` over this member (the scope's unit). `null`: it left. */\n setPointer: (at: number | null) => void;\n /** Playback is at `at` (the scope's unit). Call it from the player's clock; `null` when it stops. */\n setPlayback: (at: number | null) => void;\n};\n\n/**\n * Join the nearest `CursorScope` as one member. Returns null outside a scope, so a component can take a\n * `cursor` prop and do nothing when the app has not set one up. `source` is this member's id; the\n * default is a unique one.\n */\nexport function useSharedCursor(source?: string): SharedCursor | null {\n const store = React.useContext(Scope);\n const own = React.useId();\n const id = source ?? own;\n const subscribe = React.useCallback((fn: () => void) => (store ? store.subscribe(fn) : () => {}), [store]);\n const snap = React.useSyncExternalStore(subscribe, () => store?.snapshot ?? EMPTY, () => EMPTY);\n const setPointer = React.useCallback((at: number | null) => store?.setPointer(at, id), [store, id]);\n const setPlayback = React.useCallback((at: number | null) => store?.setPlayback(at, id), [store, id]);\n return React.useMemo(\n () => (store ? { ...snap, source: id, other: snap.at !== null && snap.source !== id ? snap.at : null, setPointer, setPlayback } : null),\n [store, snap, id, setPointer, setPlayback],\n );\n}\n"],"mappings":";;;AAcA,IAAM,MAAM,KAAK,KAAK;AACtB,IAAM,iBAAiB;;AAGvB,SAAgB,SAAS,CAAC,MAAM,OAAe,CAAC,MAAM,OAAuB;CAC3E,MAAM,IAAI,KAAK,KAAM,OAAO,QAAQ,MAAO,CAAC,KAAK,IAAI,KAAK,IAAI,OAAO,GAAG,IAAI,KAAK,IAAI,OAAO,GAAG,IAAI,KAAK,KAAM,OAAO,QAAQ,MAAO,CAAC,KAAK;CAC1I,OAAO,IAAI,iBAAiB,KAAK,KAAK,KAAK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