@lorikeetai/react-native-sdk 2.2.0-beta.1 → 2.2.0-beta.3

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.
package/dist/voice.js CHANGED
@@ -1,7 +1,274 @@
1
- import { useCallback, useEffect, useRef, useState } from "react";
1
+ import { useCallback, useEffect, useMemo, useRef, useState } from "react";
2
+ import { AccessibilityInfo, Animated, Easing, Image, Linking, Platform, StyleSheet, Text, TouchableOpacity, View, processColor } from "react-native";
3
+ import { SafeAreaView } from "react-native-safe-area-context";
4
+ import Svg, { Line, Path, SvgUri } from "react-native-svg";
5
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
6
  import { AudioSession, registerGlobals } from "@livekit/react-native";
3
7
  import { RemoteAudioTrack, Room, RoomEvent, Track, createLocalAudioTrack } from "livekit-client";
4
8
 
9
+ // src/voice/call-icons.tsx
10
+ const Icon = ({ children }) => /* @__PURE__ */ jsx(Svg, {
11
+ fill: "none",
12
+ height: 24,
13
+ viewBox: "0 0 24 24",
14
+ width: 24,
15
+ children
16
+ });
17
+ const stroke = (color) => ({
18
+ stroke: color,
19
+ strokeLinecap: "round",
20
+ strokeLinejoin: "round",
21
+ strokeWidth: 2
22
+ });
23
+ const MicIcon = ({ color }) => /* @__PURE__ */ jsxs(Icon, { children: [
24
+ /* @__PURE__ */ jsx(Path, {
25
+ d: "M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",
26
+ ...stroke(color)
27
+ }),
28
+ /* @__PURE__ */ jsx(Path, {
29
+ d: "M19 10v2a7 7 0 0 1-14 0v-2",
30
+ ...stroke(color)
31
+ }),
32
+ /* @__PURE__ */ jsx(Line, {
33
+ x1: "12",
34
+ x2: "12",
35
+ y1: "19",
36
+ y2: "22",
37
+ ...stroke(color)
38
+ })
39
+ ] });
40
+ const MicOffIcon = ({ color }) => /* @__PURE__ */ jsxs(Icon, { children: [
41
+ /* @__PURE__ */ jsx(Line, {
42
+ x1: "2",
43
+ x2: "22",
44
+ y1: "2",
45
+ y2: "22",
46
+ ...stroke(color)
47
+ }),
48
+ /* @__PURE__ */ jsx(Path, {
49
+ d: "M18.89 13.23A7.12 7.12 0 0 0 19 12v-2",
50
+ ...stroke(color)
51
+ }),
52
+ /* @__PURE__ */ jsx(Path, {
53
+ d: "M5 10v2a7 7 0 0 0 12 5",
54
+ ...stroke(color)
55
+ }),
56
+ /* @__PURE__ */ jsx(Path, {
57
+ d: "M15 9.34V5a3 3 0 0 0-5.68-1.33",
58
+ ...stroke(color)
59
+ }),
60
+ /* @__PURE__ */ jsx(Path, {
61
+ d: "M9 9v3a3 3 0 0 0 5.12 2.12",
62
+ ...stroke(color)
63
+ }),
64
+ /* @__PURE__ */ jsx(Line, {
65
+ x1: "12",
66
+ x2: "12",
67
+ y1: "19",
68
+ y2: "22",
69
+ ...stroke(color)
70
+ })
71
+ ] });
72
+ const PhoneOffIcon = ({ color }) => /* @__PURE__ */ jsxs(Icon, { children: [/* @__PURE__ */ jsx(Path, {
73
+ d: "M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",
74
+ ...stroke(color)
75
+ }), /* @__PURE__ */ jsx(Line, {
76
+ x1: "22",
77
+ x2: "2",
78
+ y1: "2",
79
+ y2: "22",
80
+ ...stroke(color)
81
+ })] });
82
+ const SPEAKER = "M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z";
83
+ const Volume2Icon = ({ color }) => /* @__PURE__ */ jsxs(Icon, { children: [
84
+ /* @__PURE__ */ jsx(Path, {
85
+ d: SPEAKER,
86
+ ...stroke(color)
87
+ }),
88
+ /* @__PURE__ */ jsx(Path, {
89
+ d: "M16 9a5 5 0 0 1 0 6",
90
+ ...stroke(color)
91
+ }),
92
+ /* @__PURE__ */ jsx(Path, {
93
+ d: "M19.364 18.364a9 9 0 0 0 0-12.728",
94
+ ...stroke(color)
95
+ })
96
+ ] });
97
+ const VolumeXIcon = ({ color }) => /* @__PURE__ */ jsxs(Icon, { children: [
98
+ /* @__PURE__ */ jsx(Path, {
99
+ d: SPEAKER,
100
+ ...stroke(color)
101
+ }),
102
+ /* @__PURE__ */ jsx(Line, {
103
+ x1: "22",
104
+ x2: "16",
105
+ y1: "9",
106
+ y2: "15",
107
+ ...stroke(color)
108
+ }),
109
+ /* @__PURE__ */ jsx(Line, {
110
+ x1: "16",
111
+ x2: "22",
112
+ y1: "9",
113
+ y2: "15",
114
+ ...stroke(color)
115
+ })
116
+ ] });
117
+ /** The design system's `LorikeetLogoMark`. `color` paints the whole mark in one colour. */
118
+ const LorikeetLogoMark = ({ color, size }) => /* @__PURE__ */ jsxs(Svg, {
119
+ fill: "none",
120
+ height: size,
121
+ viewBox: "-45 -20 274 274",
122
+ width: size,
123
+ children: [
124
+ /* @__PURE__ */ jsx(Path, {
125
+ d: "M112.661 179.008C152.133 154.751 173.914 119.21 161.82 96.8859L81.0549 140.608L10.1309 179.008H112.667H112.661Z",
126
+ fill: color !== null && color !== void 0 ? color : "#FF29E5"
127
+ }),
128
+ /* @__PURE__ */ jsx(Path, {
129
+ d: "M0.242676 184.284C0.242676 211.383 41.3656 233.356 92.0903 233.356C142.815 233.356 183.938 211.389 183.938 184.29H0.242676V184.284Z",
130
+ fill: color !== null && color !== void 0 ? color : "#4348DC"
131
+ }),
132
+ /* @__PURE__ */ jsx(Path, {
133
+ d: "M83.4604 133.156C84.7013 131.069 85.9155 128.94 87.0924 126.763C111.185 82.1465 111.376 35.539 87.5131 22.6682L43.8872 103.459L4.88379 175.692L83.4604 133.156Z",
134
+ fill: color !== null && color !== void 0 ? color : "#EA4921"
135
+ }),
136
+ /* @__PURE__ */ jsx(Path, {
137
+ d: "M49.0555 82.6487C46.4408 36.5522 25.5864 0.643799 0.242676 0.643799V92.4482V173.048L49.0555 82.6487Z",
138
+ fill: color !== null && color !== void 0 ? color : "#FACB12"
139
+ })
140
+ ]
141
+ });
142
+
143
+ // src/voice/call-theme.ts
144
+ const LIGHT = {
145
+ accent: "hsl(233, 69%, 55%)",
146
+ card: "hsl(240, 3%, 97%)",
147
+ control: "hsl(0, 0%, 100%)",
148
+ inverseText: "hsl(0, 0%, 100%)",
149
+ ring: "hsl(240, 31%, 94%)",
150
+ shell: "hsl(0, 0%, 100%)",
151
+ subtleText: "hsl(240, 3%, 31%)",
152
+ text: "hsl(240, 3%, 4%)"
153
+ };
154
+ const DARK = {
155
+ accent: "hsl(233, 68%, 65%)",
156
+ card: "hsl(240, 3%, 8%)",
157
+ control: "hsl(240, 3%, 4%)",
158
+ inverseText: "hsl(240, 0%, 2%)",
159
+ ring: "hsl(233, 69%, 15%)",
160
+ shell: "hsl(240, 0%, 2%)",
161
+ subtleText: "hsl(240, 3%, 61%)",
162
+ text: "hsl(240, 3%, 81%)"
163
+ };
164
+ const paintable = (colour) => {
165
+ var _processColor;
166
+ return colour !== void 0 && ((_processColor = processColor(colour)) !== null && _processColor !== void 0 ? _processColor : void 0) !== void 0 ? colour : void 0;
167
+ };
168
+ const hsl = (components) => components ? paintable(`hsl(${components})`) : void 0;
169
+ /** `generateVoiceWidgetThemeStyle` from the web Voice Widget, for React Native. */
170
+ function callColours(theme) {
171
+ var _hsl, _ref, _paintable, _hsl2, _hsl3, _ref2, _paintable2, _hsl4;
172
+ const base = (theme === null || theme === void 0 ? void 0 : theme.colorMode) === "dark" ? DARK : LIGHT;
173
+ return {
174
+ accent: (_hsl = hsl(theme === null || theme === void 0 ? void 0 : theme.brandColor)) !== null && _hsl !== void 0 ? _hsl : base.accent,
175
+ card: (_ref = (_paintable = paintable(theme === null || theme === void 0 ? void 0 : theme.headerBackground)) !== null && _paintable !== void 0 ? _paintable : hsl(theme === null || theme === void 0 ? void 0 : theme.brandAccentColor)) !== null && _ref !== void 0 ? _ref : base.card,
176
+ control: base.control,
177
+ inverseText: (_hsl2 = hsl(theme === null || theme === void 0 ? void 0 : theme.inverseTextColor)) !== null && _hsl2 !== void 0 ? _hsl2 : base.inverseText,
178
+ ring: (_hsl3 = hsl(theme === null || theme === void 0 ? void 0 : theme.subtleBrandColor)) !== null && _hsl3 !== void 0 ? _hsl3 : base.ring,
179
+ shell: (_ref2 = (_paintable2 = paintable(theme === null || theme === void 0 ? void 0 : theme.background)) !== null && _paintable2 !== void 0 ? _paintable2 : hsl(theme === null || theme === void 0 ? void 0 : theme.backgroundColor)) !== null && _ref2 !== void 0 ? _ref2 : base.shell,
180
+ subtleText: base.subtleText,
181
+ text: (_hsl4 = hsl(theme === null || theme === void 0 ? void 0 : theme.textColor)) !== null && _hsl4 !== void 0 ? _hsl4 : base.text
182
+ };
183
+ }
184
+
185
+ // src/voice/call-wave.tsx
186
+ const BARS = 24;
187
+ const PHASES = 8;
188
+ const CYCLE_MS = 1440;
189
+ const STAGGER_MS = 90;
190
+ const MIN_HEIGHT = 8;
191
+ const MAX_HEIGHT = 38;
192
+ const STILL_HEIGHT = 20;
193
+ const triangle = (x) => 1 - Math.abs(2 * x - 1);
194
+ /**
195
+ * Where one bar's height peaks and troughs as the loop runs from 0 to 1, so a
196
+ * single animated value drives every phase.
197
+ */
198
+ const phaseKeyframes = (phase) => {
199
+ const frames = /* @__PURE__ */ new Map([[0, triangle(phase)], [1, triangle(phase)]]);
200
+ for (const x of [0, .5]) frames.set((x - phase + 1) % 1, triangle(x));
201
+ const sorted = [...frames.entries()].sort(([a], [b]) => a - b);
202
+ return {
203
+ inputRange: sorted.map(([at]) => at),
204
+ outputRange: sorted.map(([, height]) => (MIN_HEIGHT + height * 30) / MAX_HEIGHT)
205
+ };
206
+ };
207
+ const useReduceMotion = () => {
208
+ const [reduceMotion, setReduceMotion] = useState(false);
209
+ useEffect(() => {
210
+ let mounted = true;
211
+ AccessibilityInfo.isReduceMotionEnabled().then((enabled) => {
212
+ if (mounted) setReduceMotion(enabled);
213
+ });
214
+ const subscription = AccessibilityInfo.addEventListener("reduceMotionChanged", setReduceMotion);
215
+ return () => {
216
+ mounted = false;
217
+ subscription.remove();
218
+ };
219
+ }, []);
220
+ return reduceMotion;
221
+ };
222
+ function CallWave({ active, color }) {
223
+ const reduceMotion = useReduceMotion();
224
+ const progress = useRef(new Animated.Value(0)).current;
225
+ const animate = active && !reduceMotion;
226
+ useEffect(() => {
227
+ if (!animate) return;
228
+ const loop = Animated.loop(Animated.timing(progress, {
229
+ duration: CYCLE_MS,
230
+ easing: Easing.linear,
231
+ toValue: 1,
232
+ useNativeDriver: true
233
+ }));
234
+ loop.start();
235
+ return () => {
236
+ loop.stop();
237
+ progress.setValue(0);
238
+ };
239
+ }, [animate, progress]);
240
+ const scales = useMemo(() => Array.from({ length: PHASES }, (_, index) => progress.interpolate(phaseKeyframes(index * STAGGER_MS / CYCLE_MS))), [progress]);
241
+ const stillScale = (active ? STILL_HEIGHT : MIN_HEIGHT) / MAX_HEIGHT;
242
+ return /* @__PURE__ */ jsx(View, {
243
+ accessibilityElementsHidden: true,
244
+ importantForAccessibility: "no-hide-descendants",
245
+ style: styles$1.wave,
246
+ children: Array.from({ length: BARS }, (_, index) => {
247
+ var _scales;
248
+ return /* @__PURE__ */ jsx(Animated.View, { style: [
249
+ styles$1.bar,
250
+ { backgroundColor: color },
251
+ { transform: [{ scaleY: animate ? (_scales = scales[index % PHASES]) !== null && _scales !== void 0 ? _scales : stillScale : stillScale }] }
252
+ ] }, index);
253
+ })
254
+ });
255
+ }
256
+ const styles$1 = StyleSheet.create({
257
+ bar: {
258
+ borderRadius: 999,
259
+ height: MAX_HEIGHT,
260
+ opacity: .45,
261
+ width: 3
262
+ },
263
+ wave: {
264
+ alignItems: "center",
265
+ flexDirection: "row",
266
+ gap: 3,
267
+ height: 48,
268
+ justifyContent: "center"
269
+ }
270
+ });
271
+
5
272
  // src/voice/use-lorikeet-call.ts
6
273
  /** The server's `LORIKEET_AGENT_IDENTITY`. The call ends when it leaves. */
7
274
  const LORIKEET_AGENT_IDENTITY = "lorikeet-agent";
@@ -170,5 +437,332 @@ function useLorikeetCall({ getSession, onError }) {
170
437
  };
171
438
  }
172
439
 
173
- export { useLorikeetCall };
440
+ // src/voice/lorikeet-call-view.tsx
441
+ const ERROR_MESSAGES = {
442
+ failed: "The call could not start. Please try again.",
443
+ microphone_denied: "Allow microphone access, then try again.",
444
+ microphone_system_denied: "Enable microphone access for your browser in system settings.",
445
+ not_available: "We can't start a call on this page. Please try again later."
446
+ };
447
+ const errorHeading = (error) => error === "not_available" ? "Calling isn't available right now" : "Something went wrong";
448
+ const formatDuration = (seconds) => `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
449
+ const statusLabel = (state, seconds) => {
450
+ switch (state) {
451
+ case "active": return formatDuration(seconds);
452
+ case "starting": return "Starting call";
453
+ case "connecting": return "Connecting";
454
+ case "error":
455
+ case "idle": return;
456
+ }
457
+ };
458
+ /** What a screen reader hears when the call state changes. The clock is left out. */
459
+ const announcementFor = ({ ended, error, state }) => {
460
+ switch (state) {
461
+ case "active": return "Listening";
462
+ case "error": return `${errorHeading(error !== null && error !== void 0 ? error : "failed")}. ${ERROR_MESSAGES[error !== null && error !== void 0 ? error : "failed"]}`;
463
+ case "idle": return ended ? "Call ended" : void 0;
464
+ case "starting":
465
+ case "connecting": return statusLabel(state, 0);
466
+ }
467
+ };
468
+ const useCallSeconds = (state) => {
469
+ const [seconds, setSeconds] = useState(0);
470
+ useEffect(() => {
471
+ if (state !== "active") {
472
+ setSeconds(0);
473
+ return;
474
+ }
475
+ const interval = setInterval(() => setSeconds((value) => value + 1), 1e3);
476
+ return () => clearInterval(interval);
477
+ }, [state]);
478
+ return seconds;
479
+ };
480
+ function CallLogo({ logoUrl }) {
481
+ if (!logoUrl) return /* @__PURE__ */ jsx(LorikeetLogoMark, { size: 48 });
482
+ if (/\.svg($|[?#])/i.test(logoUrl)) return /* @__PURE__ */ jsx(SvgUri, {
483
+ height: 48,
484
+ uri: logoUrl,
485
+ width: 48
486
+ });
487
+ return /* @__PURE__ */ jsx(Image, {
488
+ resizeMode: "contain",
489
+ source: { uri: logoUrl },
490
+ style: styles.logo
491
+ });
492
+ }
493
+ function CallMessage({ call, colours }) {
494
+ if (call.state === "error") {
495
+ var _call$error;
496
+ const error = (_call$error = call.error) !== null && _call$error !== void 0 ? _call$error : "failed";
497
+ return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(Text, {
498
+ style: [styles.bold, { color: colours.text }],
499
+ children: errorHeading(error)
500
+ }), /* @__PURE__ */ jsx(Text, {
501
+ style: [styles.body, { color: colours.subtleText }],
502
+ children: ERROR_MESSAGES[error]
503
+ })] });
504
+ }
505
+ if (call.state === "active") return /* @__PURE__ */ jsx(Text, {
506
+ style: [styles.body, { color: colours.text }],
507
+ children: "Listening"
508
+ });
509
+ if (call.ended) return /* @__PURE__ */ jsxs(View, {
510
+ style: styles.marker,
511
+ children: [
512
+ /* @__PURE__ */ jsx(View, { style: [styles.markerRule, { backgroundColor: colours.subtleText }] }),
513
+ /* @__PURE__ */ jsx(Text, {
514
+ style: [styles.small, { color: colours.subtleText }],
515
+ children: "Call ended"
516
+ }),
517
+ /* @__PURE__ */ jsx(View, { style: [styles.markerRule, { backgroundColor: colours.subtleText }] })
518
+ ]
519
+ });
520
+ return null;
521
+ }
522
+ function RoundButton({ children, disabled = false, label, onPress, style }) {
523
+ return /* @__PURE__ */ jsx(TouchableOpacity, {
524
+ accessibilityLabel: label,
525
+ accessibilityRole: "button",
526
+ accessibilityState: { disabled },
527
+ disabled,
528
+ onPress,
529
+ style: [
530
+ styles.roundButton,
531
+ style,
532
+ disabled && styles.disabled
533
+ ],
534
+ children
535
+ });
536
+ }
537
+ function CallActions({ call, colours }) {
538
+ if (call.state === "idle" || call.state === "error") return /* @__PURE__ */ jsx(TouchableOpacity, {
539
+ accessibilityRole: "button",
540
+ onPress: () => void call.start(),
541
+ style: [styles.startButton, { backgroundColor: colours.accent }],
542
+ children: /* @__PURE__ */ jsx(Text, {
543
+ style: [styles.bold, { color: colours.inverseText }],
544
+ children: "Start call"
545
+ })
546
+ });
547
+ const inactive = call.state !== "active";
548
+ const control = { backgroundColor: colours.control };
549
+ return /* @__PURE__ */ jsxs(View, {
550
+ style: styles.controls,
551
+ children: [
552
+ /* @__PURE__ */ jsx(RoundButton, {
553
+ disabled: inactive,
554
+ label: call.microphoneMuted ? "Unmute microphone" : "Mute microphone",
555
+ onPress: () => call.setMicrophoneMuted(!call.microphoneMuted),
556
+ style: control,
557
+ children: call.microphoneMuted ? /* @__PURE__ */ jsx(MicOffIcon, { color: colours.accent }) : /* @__PURE__ */ jsx(MicIcon, { color: colours.accent })
558
+ }),
559
+ /* @__PURE__ */ jsx(RoundButton, {
560
+ label: "End call",
561
+ onPress: call.end,
562
+ style: { backgroundColor: colours.accent },
563
+ children: /* @__PURE__ */ jsx(PhoneOffIcon, { color: colours.inverseText })
564
+ }),
565
+ /* @__PURE__ */ jsx(RoundButton, {
566
+ disabled: inactive,
567
+ label: call.speakerMuted ? "Unmute speaker" : "Mute speaker",
568
+ onPress: () => call.setSpeakerMuted(!call.speakerMuted),
569
+ style: control,
570
+ children: call.speakerMuted ? /* @__PURE__ */ jsx(VolumeXIcon, { color: colours.accent }) : /* @__PURE__ */ jsx(Volume2Icon, { color: colours.accent })
571
+ })
572
+ ]
573
+ });
574
+ }
575
+ function PoweredBy({ color }) {
576
+ return /* @__PURE__ */ jsxs(TouchableOpacity, {
577
+ accessibilityLabel: "Powered by Lorikeet",
578
+ accessibilityRole: "link",
579
+ onPress: () => void Linking.openURL("https://lorikeetcx.ai"),
580
+ style: styles.poweredBy,
581
+ children: [/* @__PURE__ */ jsx(LorikeetLogoMark, {
582
+ color,
583
+ size: 16
584
+ }), /* @__PURE__ */ jsx(Text, {
585
+ style: [styles.small, { color }],
586
+ children: "Powered by Lorikeet"
587
+ })]
588
+ });
589
+ }
590
+ /** The web Voice Widget's call screen and copy, on `useLorikeetCall`. */
591
+ function LorikeetCallView({ customisations, getSession, onError, style }) {
592
+ const call = useLorikeetCall({
593
+ getSession,
594
+ onError
595
+ });
596
+ const seconds = useCallSeconds(call.state);
597
+ const colours = callColours(customisations === null || customisations === void 0 ? void 0 : customisations.theme);
598
+ const status = statusLabel(call.state, seconds);
599
+ const announcement = announcementFor(call);
600
+ const liveRegion = Platform.OS === "android" ? "polite" : void 0;
601
+ useEffect(() => {
602
+ if (Platform.OS === "ios" && announcement) AccessibilityInfo.announceForAccessibilityWithOptions(announcement, { queue: true });
603
+ }, [announcement]);
604
+ return /* @__PURE__ */ jsx(SafeAreaView, {
605
+ style: [
606
+ styles.shell,
607
+ { backgroundColor: colours.shell },
608
+ style
609
+ ],
610
+ children: /* @__PURE__ */ jsxs(View, {
611
+ style: styles.ringed,
612
+ children: [/* @__PURE__ */ jsx(View, { style: [
613
+ StyleSheet.absoluteFill,
614
+ styles.ring,
615
+ { backgroundColor: colours.ring }
616
+ ] }), /* @__PURE__ */ jsxs(View, {
617
+ style: [styles.card, {
618
+ backgroundColor: colours.card,
619
+ shadowColor: colours.accent
620
+ }],
621
+ children: [
622
+ /* @__PURE__ */ jsxs(View, {
623
+ style: styles.identity,
624
+ children: [
625
+ /* @__PURE__ */ jsx(CallLogo, { logoUrl: customisations === null || customisations === void 0 ? void 0 : customisations.logoUrl }),
626
+ /* @__PURE__ */ jsx(Text, {
627
+ accessibilityRole: "header",
628
+ numberOfLines: 1,
629
+ style: [styles.bold, { color: colours.text }],
630
+ children: (customisations === null || customisations === void 0 ? void 0 : customisations.title) || "Lorikeet AI Agent"
631
+ }),
632
+ /* @__PURE__ */ jsx(Text, {
633
+ accessibilityElementsHidden: !status,
634
+ accessibilityLiveRegion: call.state === "active" ? "none" : liveRegion,
635
+ style: [styles.small, { color: colours.text }],
636
+ children: status
637
+ })
638
+ ]
639
+ }),
640
+ /* @__PURE__ */ jsx(CallWave, {
641
+ active: call.state === "active",
642
+ color: colours.accent
643
+ }),
644
+ /* @__PURE__ */ jsx(View, {
645
+ accessibilityLiveRegion: liveRegion,
646
+ style: styles.message,
647
+ children: /* @__PURE__ */ jsx(CallMessage, {
648
+ call,
649
+ colours
650
+ })
651
+ }),
652
+ /* @__PURE__ */ jsxs(View, {
653
+ style: styles.footer,
654
+ children: [/* @__PURE__ */ jsx(CallActions, {
655
+ call,
656
+ colours
657
+ }), (customisations === null || customisations === void 0 ? void 0 : customisations.useSubtleBranding) ? null : /* @__PURE__ */ jsx(PoweredBy, { color: colours.subtleText })]
658
+ })
659
+ ]
660
+ })]
661
+ })
662
+ });
663
+ }
664
+ const styles = StyleSheet.create({
665
+ body: {
666
+ fontSize: 14,
667
+ lineHeight: 20,
668
+ textAlign: "center"
669
+ },
670
+ bold: {
671
+ fontSize: 14,
672
+ fontWeight: "600",
673
+ lineHeight: 20,
674
+ textAlign: "center"
675
+ },
676
+ card: {
677
+ alignItems: "center",
678
+ borderColor: "rgba(255, 255, 255, 0.8)",
679
+ borderRadius: 20,
680
+ borderWidth: 1,
681
+ elevation: 8,
682
+ flex: 1,
683
+ justifyContent: "space-between",
684
+ paddingHorizontal: 24,
685
+ paddingVertical: 32,
686
+ shadowOffset: {
687
+ height: 18,
688
+ width: 0
689
+ },
690
+ shadowOpacity: .28,
691
+ shadowRadius: 17
692
+ },
693
+ controls: {
694
+ alignItems: "center",
695
+ flexDirection: "row",
696
+ gap: 12
697
+ },
698
+ disabled: { opacity: .5 },
699
+ footer: {
700
+ alignItems: "center",
701
+ gap: 16
702
+ },
703
+ identity: {
704
+ alignItems: "center",
705
+ gap: 8,
706
+ maxWidth: 320
707
+ },
708
+ logo: {
709
+ height: 48,
710
+ width: 48
711
+ },
712
+ marker: {
713
+ alignItems: "center",
714
+ flexDirection: "row",
715
+ gap: 8,
716
+ width: "100%"
717
+ },
718
+ markerRule: {
719
+ flex: 1,
720
+ height: StyleSheet.hairlineWidth,
721
+ opacity: .4
722
+ },
723
+ message: {
724
+ gap: 4,
725
+ justifyContent: "center",
726
+ maxWidth: 320,
727
+ minHeight: 96,
728
+ width: "100%"
729
+ },
730
+ poweredBy: {
731
+ alignItems: "center",
732
+ flexDirection: "row",
733
+ gap: 2
734
+ },
735
+ ring: {
736
+ borderRadius: 27,
737
+ opacity: .8
738
+ },
739
+ ringed: {
740
+ flex: 1,
741
+ padding: 7
742
+ },
743
+ roundButton: {
744
+ alignItems: "center",
745
+ borderRadius: 24,
746
+ height: 48,
747
+ justifyContent: "center",
748
+ width: 48
749
+ },
750
+ shell: {
751
+ flex: 1,
752
+ padding: 16
753
+ },
754
+ small: {
755
+ fontSize: 12,
756
+ lineHeight: 16,
757
+ textAlign: "center"
758
+ },
759
+ startButton: {
760
+ borderRadius: 8,
761
+ justifyContent: "center",
762
+ minHeight: 40,
763
+ paddingHorizontal: 16
764
+ }
765
+ });
766
+
767
+ export { LorikeetCallView, useLorikeetCall };
174
768
  //# sourceMappingURL=voice.js.map