ftui-core 0.4.0

Terminal lifecycle, capabilities, and event parsing for FrankenTUI.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
#![forbid(unsafe_code)]

//! Key sequence interpreter for multi-key sequences (bd-2vne.2).
//!
//! This module provides a stateful interpreter for detecting key sequences like
//! Esc Esc, independent of the low-level input parsing. It operates on the
//! [`KeyEvent`] stream and uses a configurable timeout window to detect sequences.
//!
//! # Design
//!
//! ## Invariants
//! 1. Sequences are always non-empty when emitted.
//! 2. The timeout window is measured from the first key in a potential sequence.
//! 3. If no sequence is detected within the timeout, the buffered key(s) are
//!    emitted individually via [`KeySequenceAction::Emit`].
//! 4. Non-blocking: [`KeySequenceAction::Pending`] signals that more input is
//!    needed, but the caller can continue with other work.
//!
//! ## Failure Modes
//! - If the timeout expires mid-sequence, buffered keys are flushed as individual
//!   [`Emit`](KeySequenceAction::Emit) actions (graceful degradation).
//! - Unknown keys that don't match any sequence pattern are passed through immediately.
//!
//! # Example
//!
//! ```
//! use ftui_core::key_sequence::{KeySequenceInterpreter, KeySequenceConfig, KeySequenceAction};
//! use ftui_core::event::{KeyEvent, KeyCode, KeyEventKind, Modifiers};
//! use std::time::{Duration, Instant};
//!
//! let config = KeySequenceConfig::default();
//! let mut interp = KeySequenceInterpreter::new(config);
//!
//! let esc = KeyEvent {
//!     code: KeyCode::Escape,
//!     modifiers: Modifiers::NONE,
//!     kind: KeyEventKind::Press,
//! };
//!
//! let now = Instant::now();
//!
//! // First Esc: pending (waiting for potential second Esc)
//! let action = interp.feed(&esc, now);
//! assert!(matches!(action, KeySequenceAction::Pending));
//!
//! // Second Esc within timeout: emit sequence
//! let action = interp.feed(&esc, now + Duration::from_millis(100));
//! assert!(matches!(action, KeySequenceAction::EmitSequence { .. }));
//! ```

use web_time::{Duration, Instant};

use crate::event::{KeyCode, KeyEvent, KeyEventKind, Modifiers};

// ---------------------------------------------------------------------------
// Configuration
// ---------------------------------------------------------------------------

/// Configuration for key sequence detection.
#[derive(Debug, Clone)]
pub struct KeySequenceConfig {
    /// Time window for sequence completion (default: 250ms).
    ///
    /// If a second key doesn't arrive within this window, the first key
    /// is emitted as a single key event.
    pub sequence_timeout: Duration,

    /// Whether to detect Esc Esc sequences (default: true).
    pub detect_double_escape: bool,
}

impl Default for KeySequenceConfig {
    fn default() -> Self {
        Self {
            sequence_timeout: Duration::from_millis(250),
            detect_double_escape: true,
        }
    }
}

impl KeySequenceConfig {
    /// Create a config with a custom timeout.
    #[must_use]
    pub fn with_timeout(timeout: Duration) -> Self {
        Self {
            sequence_timeout: timeout,
            ..Default::default()
        }
    }
}

// ---------------------------------------------------------------------------
// KeySequenceKind
// ---------------------------------------------------------------------------

/// Recognized key sequence patterns.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum KeySequenceKind {
    /// Double Escape (Esc Esc) - typically used for tree view toggle.
    DoubleEscape,
}

impl KeySequenceKind {
    /// Human-readable name for this sequence.
    #[must_use]
    pub const fn name(&self) -> &'static str {
        match self {
            Self::DoubleEscape => "Esc Esc",
        }
    }
}

// ---------------------------------------------------------------------------
// KeySequenceAction
// ---------------------------------------------------------------------------

/// Action returned by the key sequence interpreter.
#[derive(Debug, Clone, PartialEq)]
pub enum KeySequenceAction {
    /// Emit the key event immediately (no sequence detected).
    Emit(KeyEvent),

    /// A complete key sequence was detected.
    EmitSequence {
        /// The kind of sequence that was detected.
        kind: KeySequenceKind,
        /// The raw key events that formed the sequence.
        keys: Vec<KeyEvent>,
    },

    /// Waiting for more keys to complete a potential sequence.
    ///
    /// The caller should continue with other work; the interpreter will
    /// return the buffered keys if the timeout expires.
    Pending,
}

impl KeySequenceAction {
    /// Returns true if this action requires the caller to wait for more input.
    #[must_use]
    pub const fn is_pending(&self) -> bool {
        matches!(self, Self::Pending)
    }

    /// Returns true if this action emits a sequence.
    #[must_use]
    pub const fn is_sequence(&self) -> bool {
        matches!(self, Self::EmitSequence { .. })
    }
}

// ---------------------------------------------------------------------------
// KeySequenceInterpreter
// ---------------------------------------------------------------------------

/// Stateful interpreter for multi-key sequences.
///
/// Feed key events via [`feed`](Self::feed) and periodically call
/// [`check_timeout`](Self::check_timeout) to handle expired sequences.
pub struct KeySequenceInterpreter {
    config: KeySequenceConfig,

    /// Buffer for pending keys.
    buffer: Vec<KeyEvent>,

    /// Timestamp of the first key in the current buffer.
    buffer_start: Option<Instant>,
}

impl std::fmt::Debug for KeySequenceInterpreter {
    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
        f.debug_struct("KeySequenceInterpreter")
            .field("buffer_len", &self.buffer.len())
            .field("has_pending", &self.buffer_start.is_some())
            .finish()
    }
}

impl KeySequenceInterpreter {
    /// Create a new key sequence interpreter with the given configuration.
    #[must_use]
    pub fn new(config: KeySequenceConfig) -> Self {
        Self {
            config,
            buffer: Vec::with_capacity(4),
            buffer_start: None,
        }
    }

    /// Create a new interpreter with default configuration.
    #[must_use]
    pub fn with_defaults() -> Self {
        Self::new(KeySequenceConfig::default())
    }

    /// Feed a key event into the interpreter.
    ///
    /// Returns an action indicating what the caller should do:
    /// - [`Emit`](KeySequenceAction::Emit): Pass this key through immediately
    /// - [`EmitSequence`](KeySequenceAction::EmitSequence): A sequence was detected
    /// - [`Pending`](KeySequenceAction::Pending): Waiting for more keys
    ///
    /// # Key Event Filtering
    ///
    /// Only key press events are processed. Release and repeat events are
    /// passed through immediately.
    ///
    /// # Timeout Handling
    ///
    /// This method does NOT automatically handle timeouts. Callers should
    /// periodically call [`check_timeout`](Self::check_timeout) (e.g., on tick)
    /// to flush expired sequences. If a timeout has expired and you call `feed()`
    /// without calling `check_timeout()` first, buffered keys may be lost.
    pub fn feed(&mut self, event: &KeyEvent, now: Instant) -> KeySequenceAction {
        // Only process key press events
        if event.kind != KeyEventKind::Press {
            return KeySequenceAction::Emit(*event);
        }

        // Check if this key could start or continue a sequence
        match self.try_sequence(event, now) {
            SequenceResult::Complete(kind) => {
                // Add the completing key to the sequence
                self.buffer.push(*event);
                let keys = std::mem::take(&mut self.buffer);
                self.buffer_start = None;
                KeySequenceAction::EmitSequence { kind, keys }
            }
            SequenceResult::Continue => {
                if self.buffer.is_empty() {
                    self.buffer_start = Some(now);
                }
                self.buffer.push(*event);
                KeySequenceAction::Pending
            }
            SequenceResult::NoMatch => {
                // This key doesn't match any sequence pattern
                // If we have buffered keys, we need to flush them first
                if !self.buffer.is_empty() {
                    // The buffered keys didn't form a sequence, flush them
                    // For now, just clear and pass through the new key
                    // The caller should have called check_timeout to get the buffered keys
                    self.buffer.clear();
                    self.buffer_start = None;
                }
                KeySequenceAction::Emit(*event)
            }
        }
    }

    /// Check if the sequence timeout has expired.
    ///
    /// Call this periodically (e.g., on tick) to flush expired sequences.
    /// Returns buffered keys as individual [`Emit`](KeySequenceAction::Emit) actions
    /// if the timeout has expired.
    ///
    /// Returns `None` if no timeout has expired or no keys are pending.
    pub fn check_timeout(&mut self, now: Instant) -> Option<Vec<KeySequenceAction>> {
        if let Some(start) = self.buffer_start {
            if now.saturating_duration_since(start) >= self.config.sequence_timeout {
                // Timeout expired - flush all buffered keys
                let actions: Vec<_> = self.buffer.drain(..).map(KeySequenceAction::Emit).collect();
                self.buffer_start = None;
                if actions.is_empty() {
                    None
                } else {
                    Some(actions)
                }
            } else {
                None
            }
        } else {
            None
        }
    }

    /// Returns true if there are pending keys waiting for a potential sequence.
    #[must_use]
    pub fn has_pending(&self) -> bool {
        self.buffer_start.is_some()
    }

    /// Get the time remaining until the current pending sequence times out.
    ///
    /// Returns `None` if there are no pending keys.
    #[must_use]
    pub fn time_until_timeout(&self, now: Instant) -> Option<Duration> {
        self.buffer_start.map(|start| {
            let elapsed = now.saturating_duration_since(start);
            self.config.sequence_timeout.saturating_sub(elapsed)
        })
    }

    /// Reset all state, discarding any pending keys.
    pub fn reset(&mut self) {
        self.buffer.clear();
        self.buffer_start = None;
    }

    /// Flush any pending keys immediately as individual emit actions.
    ///
    /// Useful when the application needs to ensure all keys are processed
    /// before a state transition (e.g., on focus loss).
    pub fn flush(&mut self) -> Vec<KeySequenceAction> {
        let actions: Vec<_> = self.buffer.drain(..).map(KeySequenceAction::Emit).collect();
        self.buffer_start = None;
        actions
    }

    /// Get a reference to the current configuration.
    #[must_use]
    pub fn config(&self) -> &KeySequenceConfig {
        &self.config
    }

    /// Update the configuration.
    ///
    /// Note: This does not affect keys already in the buffer.
    pub fn set_config(&mut self, config: KeySequenceConfig) {
        self.config = config;
    }
}

// ---------------------------------------------------------------------------
// Internal
// ---------------------------------------------------------------------------

/// Result of trying to match a sequence pattern.
#[derive(Debug, Clone, Copy)]
enum SequenceResult {
    /// A complete sequence was detected.
    Complete(KeySequenceKind),
    /// Key could be part of a sequence, continue buffering.
    Continue,
    /// Key doesn't match any sequence pattern.
    NoMatch,
}

impl KeySequenceInterpreter {
    /// Try to match the current key against known sequence patterns.
    fn try_sequence(&self, event: &KeyEvent, _now: Instant) -> SequenceResult {
        // Double Escape detection
        if self.config.detect_double_escape
            && event.code == KeyCode::Escape
            && event.modifiers == Modifiers::NONE
        {
            // Check if we already have an Escape in the buffer
            if self.buffer.len() == 1
                && self.buffer[0].code == KeyCode::Escape
                && self.buffer[0].modifiers == Modifiers::NONE
            {
                return SequenceResult::Complete(KeySequenceKind::DoubleEscape);
            }
            // This could be the first Escape of a double-escape sequence
            if self.buffer.is_empty() {
                return SequenceResult::Continue;
            }
        }

        // No sequence pattern matched
        SequenceResult::NoMatch
    }
}

// ---------------------------------------------------------------------------
// Tests
// ---------------------------------------------------------------------------

#[cfg(test)]
mod tests {
    use super::*;

    fn now() -> Instant {
        Instant::now()
    }

    fn esc() -> KeyEvent {
        KeyEvent {
            code: KeyCode::Escape,
            modifiers: Modifiers::NONE,
            kind: KeyEventKind::Press,
        }
    }

    fn key(c: char) -> KeyEvent {
        KeyEvent {
            code: KeyCode::Char(c),
            modifiers: Modifiers::NONE,
            kind: KeyEventKind::Press,
        }
    }

    fn key_release(c: char) -> KeyEvent {
        KeyEvent {
            code: KeyCode::Char(c),
            modifiers: Modifiers::NONE,
            kind: KeyEventKind::Release,
        }
    }

    const MS_50: Duration = Duration::from_millis(50);
    const MS_100: Duration = Duration::from_millis(100);
    const MS_300: Duration = Duration::from_millis(300);

    // --- Double Escape tests ---

    #[test]
    fn double_escape_within_timeout() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        // First Esc
        let action = interp.feed(&esc(), t);
        assert!(matches!(action, KeySequenceAction::Pending));
        assert!(interp.has_pending());

        // Second Esc within timeout
        let action = interp.feed(&esc(), t + MS_100);
        assert!(matches!(
            action,
            KeySequenceAction::EmitSequence {
                kind: KeySequenceKind::DoubleEscape,
                ..
            }
        ));
        assert!(!interp.has_pending());
    }

    #[test]
    fn single_escape_timeout() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        // First Esc
        let action = interp.feed(&esc(), t);
        assert!(matches!(action, KeySequenceAction::Pending));

        // Timeout check after 300ms (default timeout is 250ms)
        let actions = interp.check_timeout(t + MS_300);
        assert!(actions.is_some());
        let actions = actions.unwrap();
        assert_eq!(actions.len(), 1);
        assert!(matches!(actions[0], KeySequenceAction::Emit(_)));
    }

    #[test]
    fn escape_then_different_key() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        // First Esc
        let action = interp.feed(&esc(), t);
        assert!(matches!(action, KeySequenceAction::Pending));

        // Different key - should emit immediately (Esc was cleared by timeout logic)
        let action = interp.feed(&key('a'), t + MS_50);
        assert!(matches!(action, KeySequenceAction::Emit(_)));
        assert!(!interp.has_pending());
    }

    #[test]
    fn non_escape_key_passes_through() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        let action = interp.feed(&key('x'), t);
        assert!(matches!(action, KeySequenceAction::Emit(_)));
        assert!(!interp.has_pending());
    }

    #[test]
    fn key_release_passes_through() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        let action = interp.feed(&key_release('x'), t);
        assert!(matches!(action, KeySequenceAction::Emit(_)));
        assert!(!interp.has_pending());
    }

    #[test]
    fn modified_escape_passes_through() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        // Ctrl+Escape should not start a sequence
        let ctrl_esc = KeyEvent {
            code: KeyCode::Escape,
            modifiers: Modifiers::CTRL,
            kind: KeyEventKind::Press,
        };

        let action = interp.feed(&ctrl_esc, t);
        assert!(matches!(action, KeySequenceAction::Emit(_)));
        assert!(!interp.has_pending());
    }

    // --- Configuration tests ---

    #[test]
    fn custom_timeout() {
        let config = KeySequenceConfig::with_timeout(Duration::from_millis(100));
        let mut interp = KeySequenceInterpreter::new(config);
        let t = now();

        // First Esc
        interp.feed(&esc(), t);
        assert!(interp.has_pending());

        // Before timeout (50ms)
        assert!(interp.check_timeout(t + MS_50).is_none());

        // After timeout (150ms > 100ms)
        let actions = interp.check_timeout(t + Duration::from_millis(150));
        assert!(actions.is_some());
    }

    #[test]
    fn disabled_double_escape() {
        let config = KeySequenceConfig {
            detect_double_escape: false,
            ..Default::default()
        };
        let mut interp = KeySequenceInterpreter::new(config);
        let t = now();

        // First Esc - should pass through immediately since detection is disabled
        let action = interp.feed(&esc(), t);
        assert!(matches!(action, KeySequenceAction::Emit(_)));
        assert!(!interp.has_pending());
    }

    // --- Helper method tests ---

    #[test]
    fn time_until_timeout() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        assert!(interp.time_until_timeout(t).is_none());

        interp.feed(&esc(), t);
        let remaining = interp.time_until_timeout(t + MS_100);
        assert!(remaining.is_some());
        let remaining = remaining.unwrap();
        // Default timeout is 250ms, we're at 100ms, so ~150ms remaining
        assert!(remaining >= Duration::from_millis(140));
        assert!(remaining <= Duration::from_millis(160));
    }

    #[test]
    fn reset_clears_state() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        interp.feed(&esc(), t);
        assert!(interp.has_pending());

        interp.reset();
        assert!(!interp.has_pending());
    }

    #[test]
    fn flush_returns_pending_keys() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        interp.feed(&esc(), t);
        assert!(interp.has_pending());

        let actions = interp.flush();
        assert_eq!(actions.len(), 1);
        assert!(matches!(actions[0], KeySequenceAction::Emit(_)));
        assert!(!interp.has_pending());
    }

    #[test]
    fn flush_on_empty_returns_empty() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let actions = interp.flush();
        assert!(actions.is_empty());
    }

    #[test]
    fn config_getter_and_setter() {
        let mut interp = KeySequenceInterpreter::with_defaults();

        assert_eq!(interp.config().sequence_timeout, Duration::from_millis(250));

        let new_config = KeySequenceConfig::with_timeout(Duration::from_millis(500));
        interp.set_config(new_config);

        assert_eq!(interp.config().sequence_timeout, Duration::from_millis(500));
    }

    #[test]
    fn debug_format() {
        let interp = KeySequenceInterpreter::with_defaults();
        let dbg = format!("{:?}", interp);
        assert!(dbg.contains("KeySequenceInterpreter"));
    }

    // --- Action method tests ---

    #[test]
    fn action_is_pending() {
        assert!(KeySequenceAction::Pending.is_pending());
        assert!(!KeySequenceAction::Emit(esc()).is_pending());
        assert!(
            !KeySequenceAction::EmitSequence {
                kind: KeySequenceKind::DoubleEscape,
                keys: vec![],
            }
            .is_pending()
        );
    }

    #[test]
    fn action_is_sequence() {
        assert!(!KeySequenceAction::Pending.is_sequence());
        assert!(!KeySequenceAction::Emit(esc()).is_sequence());
        assert!(
            KeySequenceAction::EmitSequence {
                kind: KeySequenceKind::DoubleEscape,
                keys: vec![],
            }
            .is_sequence()
        );
    }

    // --- KeySequenceKind tests ---

    #[test]
    fn sequence_kind_name() {
        assert_eq!(KeySequenceKind::DoubleEscape.name(), "Esc Esc");
    }

    // --- Default config tests ---

    #[test]
    fn default_config_values() {
        let config = KeySequenceConfig::default();
        assert_eq!(config.sequence_timeout, Duration::from_millis(250));
        assert!(config.detect_double_escape);
    }

    // --- Edge cases ---

    #[test]
    fn triple_escape_produces_sequence_then_pending() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        // First Esc - pending
        let action = interp.feed(&esc(), t);
        assert!(matches!(action, KeySequenceAction::Pending));

        // Second Esc - sequence
        let action = interp.feed(&esc(), t + MS_50);
        assert!(matches!(
            action,
            KeySequenceAction::EmitSequence {
                kind: KeySequenceKind::DoubleEscape,
                ..
            }
        ));

        // Third Esc - starts new sequence (pending)
        let action = interp.feed(&esc(), t + MS_100);
        assert!(matches!(action, KeySequenceAction::Pending));
    }

    #[test]
    fn sequence_keys_are_captured() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        interp.feed(&esc(), t);
        let action = interp.feed(&esc(), t + MS_50);

        if let KeySequenceAction::EmitSequence { keys, kind } = action {
            // Buffer should contain BOTH escape keys that formed the sequence
            assert_eq!(keys.len(), 2, "Sequence should capture both keys");
            assert_eq!(keys[0].code, KeyCode::Escape);
            assert_eq!(keys[1].code, KeyCode::Escape);
            assert_eq!(kind, KeySequenceKind::DoubleEscape);
        } else {
            panic!("Expected EmitSequence");
        }
    }

    #[test]
    fn rapid_non_escape_keys() {
        let mut interp = KeySequenceInterpreter::with_defaults();
        let t = now();

        // Rapid regular keys should all pass through immediately
        for (i, c) in "hello".chars().enumerate() {
            let action = interp.feed(&key(c), t + Duration::from_millis(i as u64 * 10));
            assert!(
                matches!(action, KeySequenceAction::Emit(_)),
                "Key '{}' should pass through",
                c
            );
        }
        assert!(!interp.has_pending());
    }
}