@k2b/ui 0.39.0 → 0.41.0

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 (98) hide show
  1. package/dist/browser/chat/ChatComposer.js +759 -570
  2. package/dist/browser/chat/ChatComposer.js.map +1 -1
  3. package/dist/browser/inputs/ChoiceGroups.js +30 -18
  4. package/dist/browser/inputs/ChoiceGroups.js.map +1 -1
  5. package/dist/browser/inputs/Select.js +32 -19
  6. package/dist/browser/inputs/Select.js.map +1 -1
  7. package/dist/browser/inputs/SpecialInputs.js +54 -25
  8. package/dist/browser/inputs/SpecialInputs.js.map +1 -1
  9. package/dist/browser/inputs/choice.js +4 -1
  10. package/dist/browser/inputs/choice.js.map +1 -1
  11. package/dist/browser/inputs/dictation/Dictation.js +546 -0
  12. package/dist/browser/inputs/dictation/Dictation.js.map +1 -0
  13. package/dist/browser/inputs/dictation/create-dictation.js +324 -0
  14. package/dist/browser/inputs/dictation/create-dictation.js.map +1 -0
  15. package/dist/browser/inputs/dictation/dictation-messages.js +115 -0
  16. package/dist/browser/inputs/dictation/dictation-messages.js.map +1 -0
  17. package/dist/browser/inputs/dictation/text-dictation.js +152 -0
  18. package/dist/browser/inputs/dictation/text-dictation.js.map +1 -0
  19. package/dist/browser/inputs/dictation/types.js +2 -0
  20. package/dist/browser/inputs/dictation/types.js.map +1 -0
  21. package/dist/browser/inputs/icon-messages.js +29 -2
  22. package/dist/browser/inputs/icon-messages.js.map +1 -1
  23. package/dist/browser/inputs/icon-texts.js +172 -0
  24. package/dist/browser/inputs/icon-texts.js.map +1 -0
  25. package/dist/browser/inputs/index.js +2 -0
  26. package/dist/browser/inputs/index.js.map +1 -1
  27. package/dist/browser/layout/AnchoredPopover.js +1 -1
  28. package/dist/browser/layout/AnchoredPopover.js.map +1 -1
  29. package/dist/browser/layout/AppWorkspace.js +31 -17
  30. package/dist/browser/layout/AppWorkspace.js.map +1 -1
  31. package/dist/browser/layout/SettingsModal.js +10 -5
  32. package/dist/browser/layout/SettingsModal.js.map +1 -1
  33. package/dist/browser/layout/app-workspace-controller.js +49 -5
  34. package/dist/browser/layout/app-workspace-controller.js.map +1 -1
  35. package/dist/browser/text-editor/TextEditor.js +74 -25
  36. package/dist/browser/text-editor/TextEditor.js.map +1 -1
  37. package/dist/browser/text-editor/dictation.js +166 -0
  38. package/dist/browser/text-editor/dictation.js.map +1 -0
  39. package/dist/browser/text-editor.js +1 -0
  40. package/dist/browser/text-editor.js.map +1 -1
  41. package/dist/ssr/chat/ChatComposer.js +271 -99
  42. package/dist/ssr/chat/ChatComposer.js.map +1 -1
  43. package/dist/ssr/inputs/ChoiceGroups.js +12 -3
  44. package/dist/ssr/inputs/ChoiceGroups.js.map +1 -1
  45. package/dist/ssr/inputs/Select.js +8 -2
  46. package/dist/ssr/inputs/Select.js.map +1 -1
  47. package/dist/ssr/inputs/SpecialInputs.js +54 -25
  48. package/dist/ssr/inputs/SpecialInputs.js.map +1 -1
  49. package/dist/ssr/inputs/choice.js +4 -1
  50. package/dist/ssr/inputs/choice.js.map +1 -1
  51. package/dist/ssr/inputs/dictation/Dictation.js +386 -0
  52. package/dist/ssr/inputs/dictation/Dictation.js.map +1 -0
  53. package/dist/ssr/inputs/dictation/create-dictation.js +324 -0
  54. package/dist/ssr/inputs/dictation/create-dictation.js.map +1 -0
  55. package/dist/ssr/inputs/dictation/dictation-messages.js +115 -0
  56. package/dist/ssr/inputs/dictation/dictation-messages.js.map +1 -0
  57. package/dist/ssr/inputs/dictation/text-dictation.js +152 -0
  58. package/dist/ssr/inputs/dictation/text-dictation.js.map +1 -0
  59. package/dist/ssr/inputs/dictation/types.js +2 -0
  60. package/dist/ssr/inputs/dictation/types.js.map +1 -0
  61. package/dist/ssr/inputs/icon-messages.js +29 -2
  62. package/dist/ssr/inputs/icon-messages.js.map +1 -1
  63. package/dist/ssr/inputs/icon-texts.js +172 -0
  64. package/dist/ssr/inputs/icon-texts.js.map +1 -0
  65. package/dist/ssr/inputs/index.js +2 -0
  66. package/dist/ssr/inputs/index.js.map +1 -1
  67. package/dist/ssr/layout/AnchoredPopover.js +1 -1
  68. package/dist/ssr/layout/AnchoredPopover.js.map +1 -1
  69. package/dist/ssr/layout/AppWorkspace.js +31 -17
  70. package/dist/ssr/layout/AppWorkspace.js.map +1 -1
  71. package/dist/ssr/layout/SettingsModal.js +10 -5
  72. package/dist/ssr/layout/SettingsModal.js.map +1 -1
  73. package/dist/ssr/layout/app-workspace-controller.js +49 -5
  74. package/dist/ssr/layout/app-workspace-controller.js.map +1 -1
  75. package/dist/ssr/text-editor/TextEditor.js +74 -25
  76. package/dist/ssr/text-editor/TextEditor.js.map +1 -1
  77. package/dist/ssr/text-editor/dictation.js +166 -0
  78. package/dist/ssr/text-editor/dictation.js.map +1 -0
  79. package/dist/ssr/text-editor.js +1 -0
  80. package/dist/ssr/text-editor.js.map +1 -1
  81. package/dist/styles.css +1 -1
  82. package/dist/types/chat/ChatComposer.d.ts +9 -0
  83. package/dist/types/inputs/SpecialInputs.d.ts +8 -0
  84. package/dist/types/inputs/dictation/Dictation.d.ts +26 -0
  85. package/dist/types/inputs/dictation/create-dictation.d.ts +77 -0
  86. package/dist/types/inputs/dictation/dictation-messages.d.ts +54 -0
  87. package/dist/types/inputs/dictation/text-dictation.d.ts +36 -0
  88. package/dist/types/inputs/dictation/types.d.ts +74 -0
  89. package/dist/types/inputs/icon-messages.d.ts +14 -0
  90. package/dist/types/inputs/icon-texts.d.ts +13 -0
  91. package/dist/types/inputs/index.d.ts +5 -0
  92. package/dist/types/layout/AnchoredPopover.d.ts +5 -0
  93. package/dist/types/layout/AppWorkspace.d.ts +14 -0
  94. package/dist/types/layout/app-workspace-controller.d.ts +2 -0
  95. package/dist/types/text-editor/TextEditor.d.ts +10 -1
  96. package/dist/types/text-editor/dictation.d.ts +20 -0
  97. package/dist/types/text-editor.d.ts +1 -0
  98. package/package.json +1 -1
@@ -24,53 +24,58 @@ var _tmpl$ = /*#__PURE__*/_$template(`<span><strong>`),
24
24
  _tmpl$9 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__highlight aria-hidden=true><!$><!/>\n`),
25
25
  _tmpl$0 = /*#__PURE__*/_$template(`<textarea class=k2b-chat-composer__measure rows=1 tabindex=-1 aria-hidden=true readonly>`),
26
26
  _tmpl$1 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__input role=group><!$><!/><textarea rows=1></textarea><!$><!/>`),
27
- _tmpl$10 = /*#__PURE__*/_$template(`<span>`),
28
- _tmpl$11 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__command-detail><small></small><small><i class="ti ti-loader-2 k2b-spin"aria-hidden=true></i><!$><!/>`),
29
- _tmpl$12 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__command-end><i class="ti ti-check"aria-hidden=true></i><span class=k2b-sr-only>`),
30
- _tmpl$13 = /*#__PURE__*/_$template(`<button class=k2b-chat-composer__command type=button role=option tabindex=-1><i aria-hidden=true></i><span class=k2b-chat-composer__command-text><strong></strong><!$><!/></span><!$><!/>`),
31
- _tmpl$14 = /*#__PURE__*/_$template(`<b>`),
32
- _tmpl$15 = /*#__PURE__*/_$template(`<small>`),
33
- _tmpl$16 = /*#__PURE__*/_$template(`<span class=k2b-message-row__quote-author><span class=k2b-sr-only><!$><!/> </span><!$><!/>`),
34
- _tmpl$17 = /*#__PURE__*/_$template(`<span class=k2b-message-row__quote-text>`),
35
- _tmpl$18 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory><div class=k2b-chat-composer__commands role=listbox>`),
36
- _tmpl$19 = /*#__PURE__*/_$template(`<label class=k2b-chat-composer__command-search><i class="ti ti-search"aria-hidden=true></i><input type=text role=combobox aria-autocomplete=list aria-expanded=true autocomplete=off autocapitalize=off>`),
37
- _tmpl$20 = /*#__PURE__*/_$template(`<div role=status class=k2b-chat-composer__loading><i class="ti ti-loader-2 k2b-spin"aria-hidden=true></i><strong>`),
38
- _tmpl$21 = /*#__PURE__*/_$template(`<div role=status><i class="ti ti-alert-circle"></i> <!$><!/>`),
39
- _tmpl$22 = /*#__PURE__*/_$template(`<div role=status>`),
40
- _tmpl$23 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory data-commands><!$><!/><div class=k2b-chat-composer__commands role=listbox><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
41
- _tmpl$24 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-slot><div></div><!$><!/><!$><!/><!$><!/>`),
42
- _tmpl$25 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__hint aria-live=polite>`),
43
- _tmpl$26 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachments role=list tabindex=0>`),
44
- _tmpl$27 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__error role=alert><i class="ti ti-alert-circle"aria-hidden=true></i><!$><!/>`),
45
- _tmpl$28 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__row><!$><!/><!$><!/><div class=k2b-chat-composer__field><!$><!/><div class=k2b-chat-composer__field-tools><!$><!/><!$><!/><!$><!/></div></div><!$><!/>`),
46
- _tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-shell><!$><!/><section role=group><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></section><div class=k2b-sr-only role=status aria-live=polite></div><div class=k2b-chat-composer__status role=status><!$><!/><!$><!/>`),
47
- _tmpl$30 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><span class=k2b-chat-composer__emoji-glyph aria-hidden=true></span><strong></strong><!$><!/>`),
48
- _tmpl$31 = /*#__PURE__*/_$template(`<small>:<!$><!/>:`),
49
- _tmpl$32 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><i aria-hidden=true></i><strong></strong><!$><!/>`),
50
- _tmpl$33 = /*#__PURE__*/_$template(`<i class="ti ti-loader-2 k2b-spin"aria-hidden=true>`),
51
- _tmpl$34 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-group role=group><div class=k2b-chat-composer__command-heading role=presentation><span></span><!$><!/></div><!$><!/><!$><!/>`),
52
- _tmpl$35 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-placeholder aria-hidden=true><span></span><span><span></span><span>`),
53
- _tmpl$36 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__hint-text>`),
54
- _tmpl$37 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__dictation><i aria-hidden=true></i><span>`),
55
- _tmpl$38 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__hint-action>`),
56
- _tmpl$39 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__reply><!$><!/><button type=button class="k2b-chat-composer__icon-action k2b-chat-composer__reply-cancel"><i class="ti ti-x"aria-hidden=true>`),
57
- _tmpl$40 = /*#__PURE__*/_$template(`<div class=k2b-message-row__quote>`),
58
- _tmpl$41 = /*#__PURE__*/_$template(`<button type=button class=k2b-message-row__quote>`),
59
- _tmpl$42 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-remove><i class="ti ti-x"aria-hidden=true>`),
60
- _tmpl$43 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment role=listitem><div class=k2b-chat-composer__attachment-content><!$><!/><!$><!/></div><!$><!/>`),
61
- _tmpl$44 = /*#__PURE__*/_$template(`<img>`),
62
- _tmpl$45 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment-identity><!$><!/><!$><!/>`),
63
- _tmpl$46 = /*#__PURE__*/_$template(`<a class=k2b-chat-composer__attachment-link target=_blank rel="noopener noreferrer"><!$><!/><!$><!/>`),
64
- _tmpl$47 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-action><!$><!/><!$><!/>`),
65
- _tmpl$48 = /*#__PURE__*/_$template(`<footer class=k2b-chat-composer__footer>`),
66
- _tmpl$49 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__tools><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
67
- _tmpl$50 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__submit><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
68
- _tmpl$51 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__status-line><i aria-hidden=true></i><span>`),
69
- _tmpl$52 = /*#__PURE__*/_$template(`<span class=k2b-sr-only>`);
27
+ _tmpl$10 = /*#__PURE__*/_$template(`<span class=k2b-dictation-mark>`),
28
+ _tmpl$11 = /*#__PURE__*/_$template(`<span>`),
29
+ _tmpl$12 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__command-detail><small></small><small><i class="ti ti-loader-2 k2b-spin"aria-hidden=true></i><!$><!/>`),
30
+ _tmpl$13 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__command-end><i class="ti ti-check"aria-hidden=true></i><span class=k2b-sr-only>`),
31
+ _tmpl$14 = /*#__PURE__*/_$template(`<button class=k2b-chat-composer__command type=button role=option tabindex=-1><i aria-hidden=true></i><span class=k2b-chat-composer__command-text><strong></strong><!$><!/></span><!$><!/>`),
32
+ _tmpl$15 = /*#__PURE__*/_$template(`<b>`),
33
+ _tmpl$16 = /*#__PURE__*/_$template(`<small>`),
34
+ _tmpl$17 = /*#__PURE__*/_$template(`<span class=k2b-message-row__quote-author><span class=k2b-sr-only><!$><!/> </span><!$><!/>`),
35
+ _tmpl$18 = /*#__PURE__*/_$template(`<span class=k2b-message-row__quote-text>`),
36
+ _tmpl$19 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory><div class=k2b-chat-composer__commands role=listbox>`),
37
+ _tmpl$20 = /*#__PURE__*/_$template(`<label class=k2b-chat-composer__command-search><i class="ti ti-search"aria-hidden=true></i><input type=text role=combobox aria-autocomplete=list aria-expanded=true autocomplete=off autocapitalize=off>`),
38
+ _tmpl$21 = /*#__PURE__*/_$template(`<div role=status class=k2b-chat-composer__loading><i class="ti ti-loader-2 k2b-spin"aria-hidden=true></i><strong>`),
39
+ _tmpl$22 = /*#__PURE__*/_$template(`<div role=status><i class="ti ti-alert-circle"></i> <!$><!/>`),
40
+ _tmpl$23 = /*#__PURE__*/_$template(`<div role=status>`),
41
+ _tmpl$24 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-accessory data-commands><!$><!/><div class=k2b-chat-composer__commands role=listbox><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
42
+ _tmpl$25 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-slot><div></div><!$><!/><!$><!/><!$><!/>`),
43
+ _tmpl$26 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__hint aria-live=polite>`),
44
+ _tmpl$27 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachments role=list tabindex=0>`),
45
+ _tmpl$28 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__error role=alert><i class="ti ti-alert-circle"aria-hidden=true></i><!$><!/>`),
46
+ _tmpl$29 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__dictation>`),
47
+ _tmpl$30 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__row><!$><!/><!$><!/><div class=k2b-chat-composer__field><!$><!/><div class=k2b-chat-composer__field-tools><!$><!/><!$><!/><!$><!/><!$><!/></div></div><!$><!/>`),
48
+ _tmpl$31 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer-shell><!$><!/><section role=group><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/></section><div class=k2b-sr-only role=status aria-live=polite></div><div class=k2b-chat-composer__status role=status><!$><!/><!$><!/>`),
49
+ _tmpl$32 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><span class=k2b-chat-composer__emoji-glyph aria-hidden=true></span><strong></strong><!$><!/>`),
50
+ _tmpl$33 = /*#__PURE__*/_$template(`<small>:<!$><!/>:`),
51
+ _tmpl$34 = /*#__PURE__*/_$template(`<button type=button role=option tabindex=-1><i aria-hidden=true></i><strong></strong><!$><!/>`),
52
+ _tmpl$35 = /*#__PURE__*/_$template(`<i class="ti ti-loader-2 k2b-spin"aria-hidden=true>`),
53
+ _tmpl$36 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-group role=group><div class=k2b-chat-composer__command-heading role=presentation><span></span><!$><!/></div><!$><!/><!$><!/>`),
54
+ _tmpl$37 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__command-placeholder aria-hidden=true><span></span><span><span></span><span>`),
55
+ _tmpl$38 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__hint-text>`),
56
+ _tmpl$39 = /*#__PURE__*/_$template(`<span class=k2b-chat-composer__dictation><i aria-hidden=true></i><span>`),
57
+ _tmpl$40 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__hint-action>`),
58
+ _tmpl$41 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__reply><!$><!/><button type=button class="k2b-chat-composer__icon-action k2b-chat-composer__reply-cancel"><i class="ti ti-x"aria-hidden=true>`),
59
+ _tmpl$42 = /*#__PURE__*/_$template(`<div class=k2b-message-row__quote>`),
60
+ _tmpl$43 = /*#__PURE__*/_$template(`<button type=button class=k2b-message-row__quote>`),
61
+ _tmpl$44 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-remove><i class="ti ti-x"aria-hidden=true>`),
62
+ _tmpl$45 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment role=listitem><div class=k2b-chat-composer__attachment-content><!$><!/><!$><!/></div><!$><!/>`),
63
+ _tmpl$46 = /*#__PURE__*/_$template(`<img>`),
64
+ _tmpl$47 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__attachment-identity><!$><!/><!$><!/>`),
65
+ _tmpl$48 = /*#__PURE__*/_$template(`<a class=k2b-chat-composer__attachment-link target=_blank rel="noopener noreferrer"><!$><!/><!$><!/>`),
66
+ _tmpl$49 = /*#__PURE__*/_$template(`<button type=button class=k2b-chat-composer__attachment-action><!$><!/><!$><!/>`),
67
+ _tmpl$50 = /*#__PURE__*/_$template(`<footer class=k2b-chat-composer__footer>`),
68
+ _tmpl$51 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__tools><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
69
+ _tmpl$52 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__submit><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/><!$><!/>`),
70
+ _tmpl$53 = /*#__PURE__*/_$template(`<div class=k2b-chat-composer__status-line><i aria-hidden=true></i><span>`),
71
+ _tmpl$54 = /*#__PURE__*/_$template(`<span class=k2b-sr-only>`);
70
72
  import { batch, children, createEffect, createMemo, createSignal, createUniqueId, For, Index, on, onCleanup, onMount, Show, untrack } from "solid-js";
71
73
  import { Dropdown } from "../actions/Dropdown";
72
74
  import { dialogHistorySettled, holdDialogHistory } from "../feedback/dialog-core";
73
75
  import { Tooltip } from "../feedback/Tooltip";
76
+ import { createDictation } from "../inputs/dictation/create-dictation";
77
+ import { DictationBar, DictationButton, dictationBarShown } from "../inputs/dictation/Dictation";
78
+ import { beginTextDictation, discardTextDictation, insertTextDictation, mapTextDictation, mapTextOffset, splitDictationSegments } from "../inputs/dictation/text-dictation";
74
79
  import { replaceTextareaRange } from "../inputs/editor-dom";
75
80
  import { completedEmojiShortcode, emojiInTone, emojiName, emojiShortcodeQuery, loadEmojiIndex, suggestEmoji } from "../inputs/emoji/emoji-index";
76
81
  import { FileDropTarget } from "../inputs/FileDropTarget";
@@ -756,13 +761,126 @@ export function ChatComposer(props) {
756
761
  syncCaret();
757
762
  });
758
763
  };
764
+ /** Whether the person placed the caret in this field yet; before that, dictation starts at the end. */
765
+ let caretPlaced = false;
759
766
  const syncCaret = () => {
767
+ caretPlaced = true;
760
768
  // One update, so no effect sees a half-moved selection (it would read as "no `/` here" and reopen a closed list).
761
769
  batch(() => {
762
770
  setCaret(textareaRef?.selectionStart ?? props.value.length);
763
771
  setSelectionEnd(textareaRef?.selectionEnd ?? props.value.length);
764
772
  });
765
773
  };
774
+ // Live dictation writes at its own mark. Edits elsewhere move the mark and the dictated ranges along, and the
775
+ // person's own caret stays where it was while words arrive.
776
+ let dictated;
777
+ let dictatedValue = "";
778
+ const [dictationView, setDictationView] = createSignal();
779
+ let freshWords = [];
780
+ let freshTimer;
781
+ const freshMs = 1_500;
782
+ const showDictation = () => {
783
+ if (freshTimer) clearTimeout(freshTimer);
784
+ freshTimer = undefined;
785
+ if (!dictated) {
786
+ freshWords = [];
787
+ setDictationView(undefined);
788
+ return;
789
+ }
790
+ const now = performance.now();
791
+ freshWords = freshWords.filter(word => now - word.at < freshMs && word.to > word.from);
792
+ setDictationView({
793
+ mark: dictated.mark,
794
+ fresh: freshWords.map(word => [word.from, word.to])
795
+ });
796
+ if (freshWords.length) freshTimer = setTimeout(showDictation, Math.max(50, freshMs - (now - freshWords[0].at)));
797
+ };
798
+ createEffect(on(() => props.value, value => {
799
+ if (!dictated || value === dictatedValue) return;
800
+ const previous = dictatedValue;
801
+ dictated = mapTextDictation(dictated, previous, value);
802
+ freshWords = freshWords.map(word => ({
803
+ ...word,
804
+ from: mapTextOffset(previous, value, word.from, true),
805
+ to: mapTextOffset(previous, value, word.to, false)
806
+ }));
807
+ dictatedValue = value;
808
+ showDictation();
809
+ }));
810
+ const writeDictated = (value, mapSelection) => {
811
+ const field = textareaRef;
812
+ const focused = field && field.ownerDocument.activeElement === field;
813
+ const start = field ? mapSelection(field.selectionStart) : 0;
814
+ const end = field ? mapSelection(field.selectionEnd) : 0;
815
+ dictatedValue = value;
816
+ edit(value);
817
+ autoResize();
818
+ if (!field || !focused) return;
819
+ const restore = () => field.setSelectionRange(Math.min(start, field.value.length), Math.min(end, field.value.length));
820
+ restore();
821
+ queueMicrotask(restore);
822
+ };
823
+ const liveDictation = createDictation({
824
+ source: {
825
+ start: options => props.dictation.source.start(options),
826
+ devices: () => props.dictation?.source.devices() ?? Promise.resolve([])
827
+ },
828
+ get alternative() {
829
+ return props.dictation?.alternative;
830
+ },
831
+ disabled: () => !props.dictation || editBlocked(),
832
+ target: {
833
+ begin: () => {
834
+ if (dictated) {
835
+ dictated = {
836
+ ...dictated,
837
+ fresh: true
838
+ };
839
+ return;
840
+ }
841
+ const field = textareaRef;
842
+ dictated = beginTextDictation(field && caretPlaced ? Math.min(field.selectionEnd, props.value.length) : props.value.length);
843
+ dictatedValue = props.value;
844
+ freshWords = [];
845
+ showDictation();
846
+ },
847
+ insert: text => {
848
+ if (!dictated) return;
849
+ const before = dictated.mark;
850
+ const next = insertTextDictation(dictated, props.value, text);
851
+ const added = next.value.length - props.value.length;
852
+ if (!added) return;
853
+ dictated = next.state;
854
+ freshWords.push({
855
+ from: next.state.mark - added,
856
+ to: next.state.mark,
857
+ at: performance.now()
858
+ });
859
+ writeDictated(next.value, offset => offset >= before ? offset + added : offset);
860
+ showDictation();
861
+ },
862
+ discard: () => {
863
+ if (!dictated) return;
864
+ const state = dictated;
865
+ const next = discardTextDictation(state, props.value);
866
+ dictated = undefined;
867
+ writeDictated(next.value, offset => {
868
+ let moved = offset;
869
+ for (const [from, to] of state.ranges) if (offset >= to) moved -= to - from;else if (offset > from) moved -= offset - from;
870
+ return moved;
871
+ });
872
+ showDictation();
873
+ },
874
+ end: () => {
875
+ dictated = undefined;
876
+ showDictation();
877
+ }
878
+ }
879
+ });
880
+ onCleanup(() => {
881
+ if (freshTimer) clearTimeout(freshTimer);
882
+ });
883
+ const dictating = () => Boolean(props.dictation) && dictationBarShown(liveDictation);
766
884
  /** Closes the list opened from "+"; `refocus` gives the field its focus and the selection it had when "+" was pressed. */
767
885
  const endAddSearch = refocus => {
768
886
  const search = addSearch();
@@ -819,9 +937,17 @@ export function ChatComposer(props) {
819
937
  const blocked = () => busy() || submitting();
820
938
  /** The conversation field stays editable while a message is sent, so it keeps the focus and a phone its keyboard. */
821
939
  const editBlocked = () => conversation() ? busy() : blocked();
940
+ // Dictation belongs to one draft in one editable field: another draft, a field that turns read-only or a host that
941
+ // drops the source ends it; the words so far stay.
942
+ // Memos compare values, so typing and arriving words never end it.
943
+ const dictationField = createMemo(() => `${Boolean(props.dictation)}:${editBlocked()}`);
944
+ const dictationDraft = createMemo(() => props.draftKey);
945
+ createEffect(on([dictationField, dictationDraft], () => liveDictation.end(), {
946
+ defer: true
947
+ }));
822
948
  const hasDraft = () => Boolean(props.value.trim() || !running() && attachments().length > 0);
823
949
  /** The draft may go out now, apart from a submission that is already on its way. */
824
- const submittable = () => !busy() && !props.submitDisabled && hasDraft() && !(running() && runningSubmitIntent() === "steer" && mentions().length);
950
+ const submittable = () => !busy() && !props.submitDisabled && hasDraft() && !(props.dictation && liveDictation.active()) && !(running() && runningSubmitIntent() === "steer" && mentions().length);
825
951
  const canSubmit = () => !submitting() && submittable();
826
952
  const canSelectFiles = () => Boolean(props.fileSelection && !props.fileSelection.disabled && !running() && !blocked());
827
953
  const hasAddMenu = () => Boolean(props.fileSelection || props.menuActions?.length);
@@ -1990,7 +2116,7 @@ export function ChatComposer(props) {
1990
2116
  [_el$28, _co$5] = _$getNextMarker(_el$27.nextSibling);
1991
2117
  _$insert(_el$18, _$createComponent(Show, {
1992
2118
  get when() {
1993
- return mentions().length > 0;
2119
+ return mentions().length > 0 || dictationView();
1994
2120
  },
1995
2121
  get children() {
1996
2122
  var _el$19 = _$getNextElement(_tmpl$9),
@@ -2001,13 +2127,22 @@ export function ChatComposer(props) {
2001
2127
  typeof _ref$4 === "function" ? _$use(_ref$4, _el$19) : highlightRef = _el$19;
2002
2128
  _$insert(_el$19, _$createComponent(For, {
2003
2129
  get each() {
2004
- return chatMentionSegments(props.value, mentions());
2130
+ return splitDictationSegments(chatMentionSegments(props.value, mentions()), dictationView()?.fresh ?? [], dictationView()?.mark);
2005
2131
  },
2006
- children: part => (() => {
2007
- var _el$29 = _$getNextElement(_tmpl$10);
2008
- _$insert(_el$29, () => part.text);
2009
- _$effect(() => _el$29.classList.toggle("k2b-chat-composer__mention", !!Boolean(part.mention)));
2010
- return _el$29;
2132
+ children: part => part.mark ? _$getNextElement(_tmpl$10) : (() => {
2133
+ var _el$30 = _$getNextElement(_tmpl$11);
2134
+ _$insert(_el$30, () => part.text);
2135
+ _$effect(_p$ => {
2136
+ var _v$13 = !!Boolean(part.mention),
2137
+ _v$14 = !!Boolean(part.fresh);
2138
+ _v$13 !== _p$.e && _el$30.classList.toggle("k2b-chat-composer__mention", _p$.e = _v$13);
2139
+ _v$14 !== _p$.t && _el$30.classList.toggle("k2b-dictation-fresh", _p$.t = _v$14);
2140
+ return _p$;
2141
+ }, {
2142
+ e: undefined,
2143
+ t: undefined
2144
+ });
2145
+ return _el$30;
2011
2146
  })()
2012
2147
  }), _el$22, _co$3);
2013
2148
  return _el$19;
@@ -2075,7 +2210,7 @@ export function ChatComposer(props) {
2075
2210
  }), _el$28, _co$5);
2076
2211
  _$effect(_p$ => {
2077
2212
  var _v$3 = chatMessages().messageInput,
2078
- _v$4 = !!(mentions().length > 0),
2213
+ _v$4 = !!(mentions().length > 0 || Boolean(dictationView())),
2079
2214
  _v$5 = editBlocked() && openingRow() === undefined,
2080
2215
  _v$6 = openingRow() !== undefined,
2081
2216
  _v$7 = conversation() ? "enter" : undefined,
@@ -2154,28 +2289,28 @@ export function ChatComposer(props) {
2154
2289
  const opening = () => openingRow() === key;
2155
2290
  const failure = () => openFailures()[key];
2156
2291
  return (() => {
2157
- var _el$30 = _$getNextElement(_tmpl$13),
2158
- _el$31 = _el$30.firstChild,
2159
- _el$32 = _el$31.nextSibling,
2160
- _el$33 = _el$32.firstChild,
2161
- _el$40 = _el$33.nextSibling,
2162
- [_el$41, _co$7] = _$getNextMarker(_el$40.nextSibling),
2163
- _el$45 = _el$32.nextSibling,
2164
- [_el$46, _co$8] = _$getNextMarker(_el$45.nextSibling);
2165
- _el$30.$$click = event => {
2292
+ var _el$31 = _$getNextElement(_tmpl$14),
2293
+ _el$32 = _el$31.firstChild,
2294
+ _el$33 = _el$32.nextSibling,
2295
+ _el$34 = _el$33.firstChild,
2296
+ _el$41 = _el$34.nextSibling,
2297
+ [_el$42, _co$7] = _$getNextMarker(_el$41.nextSibling),
2298
+ _el$46 = _el$33.nextSibling,
2299
+ [_el$47, _co$8] = _$getNextMarker(_el$46.nextSibling);
2300
+ _el$31.$$click = event => {
2166
2301
  event.preventDefault();
2167
2302
  void executeCommand(command());
2168
2303
  };
2169
- _el$30.$$mousedown = keepFieldFocus;
2170
- _el$30.$$pointerdown = event => {
2304
+ _el$31.$$mousedown = keepFieldFocus;
2305
+ _el$31.$$pointerdown = event => {
2171
2306
  pressedCommand = {
2172
2307
  key,
2173
2308
  row: event.currentTarget
2174
2309
  };
2175
2310
  setHoldingRows(true);
2176
2311
  };
2177
- _$setAttribute(_el$30, "data-command-key", key);
2178
- _$insert(_el$33, _$createComponent(Show, {
2312
+ _$setAttribute(_el$31, "data-command-key", key);
2313
+ _$insert(_el$34, _$createComponent(Show, {
2179
2314
  get when() {
2180
2315
  return highlight();
2181
2316
  },
@@ -2183,12 +2318,12 @@ export function ChatComposer(props) {
2183
2318
  return title();
2184
2319
  },
2185
2320
  children: range => [_$memo(() => title().slice(0, range()[0])), (() => {
2186
- var _el$47 = _$getNextElement(_tmpl$14);
2187
- _$insert(_el$47, () => title().slice(range()[0], range()[1]));
2188
- return _el$47;
2321
+ var _el$48 = _$getNextElement(_tmpl$15);
2322
+ _$insert(_el$48, () => title().slice(range()[0], range()[1]));
2323
+ return _el$48;
2189
2324
  })(), _$memo(() => title().slice(range()[1]))]
2190
2325
  }));
2191
- _$insert(_el$32, _$createComponent(Show, {
2326
+ _$insert(_el$33, _$createComponent(Show, {
2192
2327
  get when() {
2193
2328
  return _$memo(() => !!command().open)() && !command().reason;
2194
2329
  },
@@ -2198,67 +2333,67 @@ export function ChatComposer(props) {
2198
2333
  return command().reason ?? command().description;
2199
2334
  },
2200
2335
  get children() {
2201
- var _el$48 = _$getNextElement(_tmpl$15);
2202
- _$insert(_el$48, () => command().reason ?? command().description);
2203
- _$effect(() => _$setAttribute(_el$48, "id", command().reason ? `${commandOptionId(command())}-reason` : undefined));
2204
- return _el$48;
2336
+ var _el$49 = _$getNextElement(_tmpl$16);
2337
+ _$insert(_el$49, () => command().reason ?? command().description);
2338
+ _$effect(() => _$setAttribute(_el$49, "id", command().reason ? `${commandOptionId(command())}-reason` : undefined));
2339
+ return _el$49;
2205
2340
  }
2206
2341
  });
2207
2342
  },
2208
2343
  get children() {
2209
- var _el$34 = _$getNextElement(_tmpl$11),
2210
- _el$35 = _el$34.firstChild,
2211
- _el$36 = _el$35.nextSibling,
2212
- _el$37 = _el$36.firstChild,
2213
- _el$38 = _el$37.nextSibling,
2214
- [_el$39, _co$6] = _$getNextMarker(_el$38.nextSibling);
2215
- _$insert(_el$35, () => failure() ?? command().description);
2216
- _$insert(_el$36, () => command().busyLabel ?? chatMessages().commandOpening, _el$39, _co$6);
2344
+ var _el$35 = _$getNextElement(_tmpl$12),
2345
+ _el$36 = _el$35.firstChild,
2346
+ _el$37 = _el$36.nextSibling,
2347
+ _el$38 = _el$37.firstChild,
2348
+ _el$39 = _el$38.nextSibling,
2349
+ [_el$40, _co$6] = _$getNextMarker(_el$39.nextSibling);
2350
+ _$insert(_el$36, () => failure() ?? command().description);
2351
+ _$insert(_el$37, () => command().busyLabel ?? chatMessages().commandOpening, _el$40, _co$6);
2217
2352
  _$effect(_p$ => {
2218
- var _v$13 = opening() ? "busy" : failure() ? "failed" : undefined,
2219
- _v$14 = opening() ? "true" : undefined,
2220
- _v$15 = opening() ? undefined : "true";
2221
- _v$13 !== _p$.e && _$setAttribute(_el$34, "data-state", _p$.e = _v$13);
2222
- _v$14 !== _p$.t && _$setAttribute(_el$35, "aria-hidden", _p$.t = _v$14);
2223
- _v$15 !== _p$.a && _$setAttribute(_el$36, "aria-hidden", _p$.a = _v$15);
2353
+ var _v$15 = opening() ? "busy" : failure() ? "failed" : undefined,
2354
+ _v$16 = opening() ? "true" : undefined,
2355
+ _v$17 = opening() ? undefined : "true";
2356
+ _v$15 !== _p$.e && _$setAttribute(_el$35, "data-state", _p$.e = _v$15);
2357
+ _v$16 !== _p$.t && _$setAttribute(_el$36, "aria-hidden", _p$.t = _v$16);
2358
+ _v$17 !== _p$.a && _$setAttribute(_el$37, "aria-hidden", _p$.a = _v$17);
2224
2359
  return _p$;
2225
2360
  }, {
2226
2361
  e: undefined,
2227
2362
  t: undefined,
2228
2363
  a: undefined
2229
2364
  });
2230
- return _el$34;
2365
+ return _el$35;
2231
2366
  }
2232
- }), _el$41, _co$7);
2233
- _$insert(_el$30, _$createComponent(Show, {
2367
+ }), _el$42, _co$7);
2368
+ _$insert(_el$31, _$createComponent(Show, {
2234
2369
  get when() {
2235
2370
  return command().selected;
2236
2371
  },
2237
2372
  get children() {
2238
- var _el$42 = _$getNextElement(_tmpl$12),
2239
- _el$43 = _el$42.firstChild,
2240
- _el$44 = _el$43.nextSibling;
2241
- _$insert(_el$44, () => chatMessages().commandSelected);
2242
- return _el$42;
2373
+ var _el$43 = _$getNextElement(_tmpl$13),
2374
+ _el$44 = _el$43.firstChild,
2375
+ _el$45 = _el$44.nextSibling;
2376
+ _$insert(_el$45, () => chatMessages().commandSelected);
2377
+ return _el$43;
2243
2378
  }
2244
- }), _el$46, _co$8);
2379
+ }), _el$47, _co$8);
2245
2380
  _$effect(_p$ => {
2246
- var _v$16 = commandOptionId(command()),
2247
- _v$17 = selectedCommandKey() === key,
2248
- _v$18 = Boolean(command().disabled || command().reason),
2249
- _v$19 = opening() ? "true" : undefined,
2250
- _v$20 = command().reason ? `${commandOptionId(command())}-reason` : undefined,
2251
- _v$21 = command().reason ? "true" : undefined,
2252
- _v$22 = selectedCommandKey() === key ? "true" : undefined,
2253
- _v$23 = command().icon ?? "ti ti-slash";
2254
- _v$16 !== _p$.e && _$setAttribute(_el$30, "id", _p$.e = _v$16);
2255
- _v$17 !== _p$.t && _$setAttribute(_el$30, "aria-selected", _p$.t = _v$17);
2256
- _v$18 !== _p$.a && _$setAttribute(_el$30, "aria-disabled", _p$.a = _v$18);
2257
- _v$19 !== _p$.o && _$setAttribute(_el$30, "aria-busy", _p$.o = _v$19);
2258
- _v$20 !== _p$.i && _$setAttribute(_el$30, "aria-describedby", _p$.i = _v$20);
2259
- _v$21 !== _p$.n && _$setAttribute(_el$30, "data-reason", _p$.n = _v$21);
2260
- _v$22 !== _p$.s && _$setAttribute(_el$30, "data-active", _p$.s = _v$22);
2261
- _v$23 !== _p$.h && _$className(_el$31, _p$.h = _v$23);
2381
+ var _v$18 = commandOptionId(command()),
2382
+ _v$19 = selectedCommandKey() === key,
2383
+ _v$20 = Boolean(command().disabled || command().reason),
2384
+ _v$21 = opening() ? "true" : undefined,
2385
+ _v$22 = command().reason ? `${commandOptionId(command())}-reason` : undefined,
2386
+ _v$23 = command().reason ? "true" : undefined,
2387
+ _v$24 = selectedCommandKey() === key ? "true" : undefined,
2388
+ _v$25 = command().icon ?? "ti ti-slash";
2389
+ _v$18 !== _p$.e && _$setAttribute(_el$31, "id", _p$.e = _v$18);
2390
+ _v$19 !== _p$.t && _$setAttribute(_el$31, "aria-selected", _p$.t = _v$19);
2391
+ _v$20 !== _p$.a && _$setAttribute(_el$31, "aria-disabled", _p$.a = _v$20);
2392
+ _v$21 !== _p$.o && _$setAttribute(_el$31, "aria-busy", _p$.o = _v$21);
2393
+ _v$22 !== _p$.i && _$setAttribute(_el$31, "aria-describedby", _p$.i = _v$22);
2394
+ _v$23 !== _p$.n && _$setAttribute(_el$31, "data-reason", _p$.n = _v$23);
2395
+ _v$24 !== _p$.s && _$setAttribute(_el$31, "data-active", _p$.s = _v$24);
2396
+ _v$25 !== _p$.h && _$className(_el$32, _p$.h = _v$25);
2262
2397
  return _p$;
2263
2398
  }, {
2264
2399
  e: undefined,
@@ -2271,109 +2406,109 @@ export function ChatComposer(props) {
2271
2406
  h: undefined
2272
2407
  });
2273
2408
  _$runHydrationEvents();
2274
- return _el$30;
2409
+ return _el$31;
2275
2410
  })();
2276
2411
  };
2277
2412
  const replyQuote = reply => [(() => {
2278
- var _el$49 = _$getNextElement(_tmpl$16),
2279
- _el$50 = _el$49.firstChild,
2280
- _el$52 = _el$50.firstChild,
2281
- [_el$53, _co$9] = _$getNextMarker(_el$52.nextSibling),
2282
- _el$51 = _el$53.nextSibling,
2283
- _el$54 = _el$50.nextSibling,
2284
- [_el$55, _co$0] = _$getNextMarker(_el$54.nextSibling);
2285
- _$insert(_el$50, () => chatMessages().replyingTo, _el$53, _co$9);
2286
- _$insert(_el$49, () => reply.author, _el$55, _co$0);
2287
- return _el$49;
2413
+ var _el$50 = _$getNextElement(_tmpl$17),
2414
+ _el$51 = _el$50.firstChild,
2415
+ _el$53 = _el$51.firstChild,
2416
+ [_el$54, _co$9] = _$getNextMarker(_el$53.nextSibling),
2417
+ _el$52 = _el$54.nextSibling,
2418
+ _el$55 = _el$51.nextSibling,
2419
+ [_el$56, _co$0] = _$getNextMarker(_el$55.nextSibling);
2420
+ _$insert(_el$51, () => chatMessages().replyingTo, _el$54, _co$9);
2421
+ _$insert(_el$50, () => reply.author, _el$56, _co$0);
2422
+ return _el$50;
2288
2423
  })(), (() => {
2289
- var _el$56 = _$getNextElement(_tmpl$17);
2290
- _$insert(_el$56, () => reply.text);
2291
- return _el$56;
2424
+ var _el$57 = _$getNextElement(_tmpl$18);
2425
+ _$insert(_el$57, () => reply.text);
2426
+ return _el$57;
2292
2427
  })()];
2293
2428
  return (() => {
2294
- var _el$57 = _$getNextElement(_tmpl$29),
2295
- _el$136 = _el$57.firstChild,
2296
- [_el$137, _co$34] = _$getNextMarker(_el$136.nextSibling),
2297
- _el$96 = _el$137.nextSibling,
2298
- _el$120 = _el$96.firstChild,
2299
- [_el$121, _co$27] = _$getNextMarker(_el$120.nextSibling),
2300
- _el$122 = _el$121.nextSibling,
2301
- [_el$123, _co$28] = _$getNextMarker(_el$122.nextSibling),
2302
- _el$124 = _el$123.nextSibling,
2303
- [_el$125, _co$29] = _$getNextMarker(_el$124.nextSibling),
2429
+ var _el$58 = _$getNextElement(_tmpl$31),
2430
+ _el$140 = _el$58.firstChild,
2431
+ [_el$141, _co$35] = _$getNextMarker(_el$140.nextSibling),
2432
+ _el$97 = _el$141.nextSibling,
2433
+ _el$124 = _el$97.firstChild,
2434
+ [_el$125, _co$28] = _$getNextMarker(_el$124.nextSibling),
2304
2435
  _el$126 = _el$125.nextSibling,
2305
- [_el$127, _co$30] = _$getNextMarker(_el$126.nextSibling),
2436
+ [_el$127, _co$29] = _$getNextMarker(_el$126.nextSibling),
2306
2437
  _el$128 = _el$127.nextSibling,
2307
- [_el$129, _co$31] = _$getNextMarker(_el$128.nextSibling),
2308
- _el$130 = _el$96.nextSibling,
2309
- _el$131 = _el$130.nextSibling,
2310
- _el$132 = _el$131.firstChild,
2438
+ [_el$129, _co$30] = _$getNextMarker(_el$128.nextSibling),
2439
+ _el$130 = _el$129.nextSibling,
2440
+ [_el$131, _co$31] = _$getNextMarker(_el$130.nextSibling),
2441
+ _el$132 = _el$131.nextSibling,
2311
2442
  [_el$133, _co$32] = _$getNextMarker(_el$132.nextSibling),
2312
- _el$134 = _el$133.nextSibling,
2313
- [_el$135, _co$33] = _$getNextMarker(_el$134.nextSibling);
2443
+ _el$134 = _el$97.nextSibling,
2444
+ _el$135 = _el$134.nextSibling,
2445
+ _el$136 = _el$135.firstChild,
2446
+ [_el$137, _co$33] = _$getNextMarker(_el$136.nextSibling),
2447
+ _el$138 = _el$137.nextSibling,
2448
+ [_el$139, _co$34] = _$getNextMarker(_el$138.nextSibling);
2314
2449
  var _ref$7 = shellRef;
2315
- typeof _ref$7 === "function" ? _$use(_ref$7, _el$57) : shellRef = _el$57;
2316
- _$insert(_el$57, _$createComponent(Show, {
2450
+ typeof _ref$7 === "function" ? _$use(_ref$7, _el$58) : shellRef = _el$58;
2451
+ _$insert(_el$58, _$createComponent(Show, {
2317
2452
  get when() {
2318
2453
  return suggestionsOpen() || hasAccessory();
2319
2454
  },
2320
2455
  get children() {
2321
- var _el$58 = _$getNextElement(_tmpl$24),
2322
- _el$59 = _el$58.firstChild,
2323
- _el$90 = _el$59.nextSibling,
2324
- [_el$91, _co$16] = _$getNextMarker(_el$90.nextSibling),
2325
- _el$92 = _el$91.nextSibling,
2326
- [_el$93, _co$17] = _$getNextMarker(_el$92.nextSibling),
2327
- _el$94 = _el$93.nextSibling,
2328
- [_el$95, _co$18] = _$getNextMarker(_el$94.nextSibling);
2329
- _$insert(_el$59, accessory);
2330
- _$insert(_el$58, _$createComponent(Show, {
2456
+ var _el$59 = _$getNextElement(_tmpl$25),
2457
+ _el$60 = _el$59.firstChild,
2458
+ _el$91 = _el$60.nextSibling,
2459
+ [_el$92, _co$16] = _$getNextMarker(_el$91.nextSibling),
2460
+ _el$93 = _el$92.nextSibling,
2461
+ [_el$94, _co$17] = _$getNextMarker(_el$93.nextSibling),
2462
+ _el$95 = _el$94.nextSibling,
2463
+ [_el$96, _co$18] = _$getNextMarker(_el$95.nextSibling);
2464
+ _$insert(_el$60, accessory);
2465
+ _$insert(_el$59, _$createComponent(Show, {
2331
2466
  get when() {
2332
2467
  return emojiOpen();
2333
2468
  },
2334
2469
  get children() {
2335
- var _el$60 = _$getNextElement(_tmpl$18),
2336
- _el$61 = _el$60.firstChild;
2470
+ var _el$61 = _$getNextElement(_tmpl$19),
2471
+ _el$62 = _el$61.firstChild;
2337
2472
  var _ref$8 = commandListRef;
2338
- typeof _ref$8 === "function" ? _$use(_ref$8, _el$61) : commandListRef = _el$61;
2339
- _$setAttribute(_el$61, "id", commandListId);
2340
- _$insert(_el$61, _$createComponent(For, {
2473
+ typeof _ref$8 === "function" ? _$use(_ref$8, _el$62) : commandListRef = _el$62;
2474
+ _$setAttribute(_el$62, "id", commandListId);
2475
+ _$insert(_el$62, _$createComponent(For, {
2341
2476
  get each() {
2342
2477
  return emojiMatches();
2343
2478
  },
2344
2479
  children: (entry, index) => (() => {
2345
- var _el$138 = _$getNextElement(_tmpl$30),
2346
- _el$139 = _el$138.firstChild,
2347
- _el$140 = _el$139.nextSibling,
2348
- _el$141 = _el$140.nextSibling,
2349
- [_el$142, _co$35] = _$getNextMarker(_el$141.nextSibling);
2350
- _el$138.$$click = () => pickEmojiSuggestion(index());
2351
- _el$138.$$mousedown = keepFieldFocus;
2352
- _$insert(_el$139, () => emojiInTone(entry, props.emoji?.skinTone ?? 0));
2353
- _$insert(_el$140, () => emojiName(entry, locale()));
2354
- _$insert(_el$138, _$createComponent(Show, {
2480
+ var _el$142 = _$getNextElement(_tmpl$32),
2481
+ _el$143 = _el$142.firstChild,
2482
+ _el$144 = _el$143.nextSibling,
2483
+ _el$145 = _el$144.nextSibling,
2484
+ [_el$146, _co$36] = _$getNextMarker(_el$145.nextSibling);
2485
+ _el$142.$$click = () => pickEmojiSuggestion(index());
2486
+ _el$142.$$mousedown = keepFieldFocus;
2487
+ _$insert(_el$143, () => emojiInTone(entry, props.emoji?.skinTone ?? 0));
2488
+ _$insert(_el$144, () => emojiName(entry, locale()));
2489
+ _$insert(_el$142, _$createComponent(Show, {
2355
2490
  get when() {
2356
2491
  return entry.shortcodes[0];
2357
2492
  },
2358
2493
  children: code => (() => {
2359
- var _el$143 = _$getNextElement(_tmpl$31),
2360
- _el$144 = _el$143.firstChild,
2361
- _el$146 = _el$144.nextSibling,
2362
- [_el$147, _co$36] = _$getNextMarker(_el$146.nextSibling),
2363
- _el$145 = _el$147.nextSibling;
2364
- _$insert(_el$143, code, _el$147, _co$36);
2365
- return _el$143;
2494
+ var _el$147 = _$getNextElement(_tmpl$33),
2495
+ _el$148 = _el$147.firstChild,
2496
+ _el$150 = _el$148.nextSibling,
2497
+ [_el$151, _co$37] = _$getNextMarker(_el$150.nextSibling),
2498
+ _el$149 = _el$151.nextSibling;
2499
+ _$insert(_el$147, code, _el$151, _co$37);
2500
+ return _el$147;
2366
2501
  })()
2367
- }), _el$142, _co$35);
2502
+ }), _el$146, _co$36);
2368
2503
  _$effect(_p$ => {
2369
- var _v$38 = `${commandListId}-${index()}`,
2370
- _v$39 = index() === selectedCommandIndex(),
2371
- _v$40 = emojiName(entry, locale()),
2372
- _v$41 = index() === selectedCommandIndex() ? "true" : undefined;
2373
- _v$38 !== _p$.e && _$setAttribute(_el$138, "id", _p$.e = _v$38);
2374
- _v$39 !== _p$.t && _$setAttribute(_el$138, "aria-selected", _p$.t = _v$39);
2375
- _v$40 !== _p$.a && _$setAttribute(_el$138, "aria-label", _p$.a = _v$40);
2376
- _v$41 !== _p$.o && _$setAttribute(_el$138, "data-active", _p$.o = _v$41);
2504
+ var _v$40 = `${commandListId}-${index()}`,
2505
+ _v$41 = index() === selectedCommandIndex(),
2506
+ _v$42 = emojiName(entry, locale()),
2507
+ _v$43 = index() === selectedCommandIndex() ? "true" : undefined;
2508
+ _v$40 !== _p$.e && _$setAttribute(_el$142, "id", _p$.e = _v$40);
2509
+ _v$41 !== _p$.t && _$setAttribute(_el$142, "aria-selected", _p$.t = _v$41);
2510
+ _v$42 !== _p$.a && _$setAttribute(_el$142, "aria-label", _p$.a = _v$42);
2511
+ _v$43 !== _p$.o && _$setAttribute(_el$142, "data-active", _p$.o = _v$43);
2377
2512
  return _p$;
2378
2513
  }, {
2379
2514
  e: undefined,
@@ -2382,55 +2517,55 @@ export function ChatComposer(props) {
2382
2517
  o: undefined
2383
2518
  });
2384
2519
  _$runHydrationEvents();
2385
- return _el$138;
2520
+ return _el$142;
2386
2521
  })()
2387
2522
  }));
2388
- _$effect(() => _$setAttribute(_el$61, "aria-label", chatMessages().emojiSuggestions));
2389
- return _el$60;
2523
+ _$effect(() => _$setAttribute(_el$62, "aria-label", chatMessages().emojiSuggestions));
2524
+ return _el$61;
2390
2525
  }
2391
- }), _el$91, _co$16);
2392
- _$insert(_el$58, _$createComponent(Show, {
2526
+ }), _el$92, _co$16);
2527
+ _$insert(_el$59, _$createComponent(Show, {
2393
2528
  get when() {
2394
2529
  return peopleOpen();
2395
2530
  },
2396
2531
  get children() {
2397
- var _el$62 = _$getNextElement(_tmpl$18),
2398
- _el$63 = _el$62.firstChild;
2532
+ var _el$63 = _$getNextElement(_tmpl$19),
2533
+ _el$64 = _el$63.firstChild;
2399
2534
  var _ref$9 = commandListRef;
2400
- typeof _ref$9 === "function" ? _$use(_ref$9, _el$63) : commandListRef = _el$63;
2401
- _$setAttribute(_el$63, "id", commandListId);
2402
- _$insert(_el$63, _$createComponent(For, {
2535
+ typeof _ref$9 === "function" ? _$use(_ref$9, _el$64) : commandListRef = _el$64;
2536
+ _$setAttribute(_el$64, "id", commandListId);
2537
+ _$insert(_el$64, _$createComponent(For, {
2403
2538
  get each() {
2404
2539
  return peopleMatches();
2405
2540
  },
2406
2541
  children: (person, index) => (() => {
2407
- var _el$148 = _$getNextElement(_tmpl$32),
2408
- _el$149 = _el$148.firstChild,
2409
- _el$150 = _el$149.nextSibling,
2410
- _el$152 = _el$150.nextSibling,
2411
- [_el$153, _co$37] = _$getNextMarker(_el$152.nextSibling);
2412
- _el$148.$$click = () => pickPersonSuggestion(index());
2413
- _el$148.$$mousedown = keepFieldFocus;
2414
- _$insert(_el$150, () => person.name);
2415
- _$insert(_el$148, _$createComponent(Show, {
2542
+ var _el$152 = _$getNextElement(_tmpl$34),
2543
+ _el$153 = _el$152.firstChild,
2544
+ _el$154 = _el$153.nextSibling,
2545
+ _el$156 = _el$154.nextSibling,
2546
+ [_el$157, _co$38] = _$getNextMarker(_el$156.nextSibling);
2547
+ _el$152.$$click = () => pickPersonSuggestion(index());
2548
+ _el$152.$$mousedown = keepFieldFocus;
2549
+ _$insert(_el$154, () => person.name);
2550
+ _$insert(_el$152, _$createComponent(Show, {
2416
2551
  get when() {
2417
2552
  return person.agent;
2418
2553
  },
2419
2554
  get children() {
2420
- var _el$151 = _$getNextElement(_tmpl$15);
2421
- _$insert(_el$151, () => chatMessages().agentLabel);
2422
- return _el$151;
2555
+ var _el$155 = _$getNextElement(_tmpl$16);
2556
+ _$insert(_el$155, () => chatMessages().agentLabel);
2557
+ return _el$155;
2423
2558
  }
2424
- }), _el$153, _co$37);
2559
+ }), _el$157, _co$38);
2425
2560
  _$effect(_p$ => {
2426
- var _v$42 = `${commandListId}-${index()}`,
2427
- _v$43 = index() === selectedCommandIndex(),
2428
- _v$44 = index() === selectedCommandIndex() ? "true" : undefined,
2429
- _v$45 = person.agent ? "ti ti-robot" : "ti ti-user";
2430
- _v$42 !== _p$.e && _$setAttribute(_el$148, "id", _p$.e = _v$42);
2431
- _v$43 !== _p$.t && _$setAttribute(_el$148, "aria-selected", _p$.t = _v$43);
2432
- _v$44 !== _p$.a && _$setAttribute(_el$148, "data-active", _p$.a = _v$44);
2433
- _v$45 !== _p$.o && _$className(_el$149, _p$.o = _v$45);
2561
+ var _v$44 = `${commandListId}-${index()}`,
2562
+ _v$45 = index() === selectedCommandIndex(),
2563
+ _v$46 = index() === selectedCommandIndex() ? "true" : undefined,
2564
+ _v$47 = person.agent ? "ti ti-robot" : "ti ti-user";
2565
+ _v$44 !== _p$.e && _$setAttribute(_el$152, "id", _p$.e = _v$44);
2566
+ _v$45 !== _p$.t && _$setAttribute(_el$152, "aria-selected", _p$.t = _v$45);
2567
+ _v$46 !== _p$.a && _$setAttribute(_el$152, "data-active", _p$.a = _v$46);
2568
+ _v$47 !== _p$.o && _$className(_el$153, _p$.o = _v$47);
2434
2569
  return _p$;
2435
2570
  }, {
2436
2571
  e: undefined,
@@ -2439,44 +2574,44 @@ export function ChatComposer(props) {
2439
2574
  o: undefined
2440
2575
  });
2441
2576
  _$runHydrationEvents();
2442
- return _el$148;
2577
+ return _el$152;
2443
2578
  })()
2444
2579
  }));
2445
- _$effect(() => _$setAttribute(_el$63, "aria-label", chatMessages().peopleSuggestions));
2446
- return _el$62;
2580
+ _$effect(() => _$setAttribute(_el$64, "aria-label", chatMessages().peopleSuggestions));
2581
+ return _el$63;
2447
2582
  }
2448
- }), _el$93, _co$17);
2449
- _$insert(_el$58, _$createComponent(Show, {
2583
+ }), _el$94, _co$17);
2584
+ _$insert(_el$59, _$createComponent(Show, {
2450
2585
  get when() {
2451
2586
  return commandsOpen();
2452
2587
  },
2453
2588
  get children() {
2454
- var _el$64 = _$getNextElement(_tmpl$23),
2455
- _el$88 = _el$64.firstChild,
2456
- [_el$89, _co$15] = _$getNextMarker(_el$88.nextSibling),
2457
- _el$68 = _el$89.nextSibling,
2458
- _el$78 = _el$68.firstChild,
2459
- [_el$79, _co$10] = _$getNextMarker(_el$78.nextSibling),
2460
- _el$80 = _el$79.nextSibling,
2461
- [_el$81, _co$11] = _$getNextMarker(_el$80.nextSibling),
2462
- _el$82 = _el$81.nextSibling,
2463
- [_el$83, _co$12] = _$getNextMarker(_el$82.nextSibling),
2464
- _el$84 = _el$83.nextSibling,
2465
- [_el$85, _co$13] = _$getNextMarker(_el$84.nextSibling),
2466
- _el$86 = _el$85.nextSibling,
2467
- [_el$87, _co$14] = _$getNextMarker(_el$86.nextSibling);
2468
- _el$64.$$mousedown = event => {
2589
+ var _el$65 = _$getNextElement(_tmpl$24),
2590
+ _el$89 = _el$65.firstChild,
2591
+ [_el$90, _co$15] = _$getNextMarker(_el$89.nextSibling),
2592
+ _el$69 = _el$90.nextSibling,
2593
+ _el$79 = _el$69.firstChild,
2594
+ [_el$80, _co$10] = _$getNextMarker(_el$79.nextSibling),
2595
+ _el$81 = _el$80.nextSibling,
2596
+ [_el$82, _co$11] = _$getNextMarker(_el$81.nextSibling),
2597
+ _el$83 = _el$82.nextSibling,
2598
+ [_el$84, _co$12] = _$getNextMarker(_el$83.nextSibling),
2599
+ _el$85 = _el$84.nextSibling,
2600
+ [_el$86, _co$13] = _$getNextMarker(_el$85.nextSibling),
2601
+ _el$87 = _el$86.nextSibling,
2602
+ [_el$88, _co$14] = _$getNextMarker(_el$87.nextSibling);
2603
+ _el$65.$$mousedown = event => {
2469
2604
  if (addSearch() && event.target !== addSearchRef) event.preventDefault();
2470
2605
  };
2471
- _$insert(_el$64, _$createComponent(Show, {
2606
+ _$insert(_el$65, _$createComponent(Show, {
2472
2607
  get when() {
2473
2608
  return addSearch();
2474
2609
  },
2475
2610
  get children() {
2476
- var _el$65 = _$getNextElement(_tmpl$19),
2477
- _el$66 = _el$65.firstChild,
2478
- _el$67 = _el$66.nextSibling;
2479
- _el$67.$$focusout = event => {
2611
+ var _el$66 = _$getNextElement(_tmpl$20),
2612
+ _el$67 = _el$66.firstChild,
2613
+ _el$68 = _el$67.nextSibling;
2614
+ _el$68.$$focusout = event => {
2480
2615
  const next = event.relatedTarget;
2481
2616
  if (next instanceof Node && commandListRef?.parentElement?.contains(next)) return;
2482
2617
  // Focus that leaves another way, such as with Shift+Tab, closes the list and stays where it went.
@@ -2484,27 +2619,27 @@ export function ChatComposer(props) {
2484
2619
  if (addSearch() && document.activeElement !== addSearchRef) endAddSearch(false);
2485
2620
  });
2486
2621
  };
2487
- _el$67.addEventListener("compositionend", () => {
2622
+ _el$68.addEventListener("compositionend", () => {
2488
2623
  addComposing = false;
2489
2624
  });
2490
- _el$67.addEventListener("compositionstart", () => {
2625
+ _el$68.addEventListener("compositionstart", () => {
2491
2626
  addComposing = true;
2492
2627
  });
2493
- _el$67.$$keydown = onAddSearchKeyDown;
2494
- _el$67.$$input = event => setAddQuery(event.currentTarget.value);
2628
+ _el$68.$$keydown = onAddSearchKeyDown;
2629
+ _el$68.$$input = event => setAddQuery(event.currentTarget.value);
2495
2630
  var _ref$0 = addSearchRef;
2496
- typeof _ref$0 === "function" ? _$use(_ref$0, _el$67) : addSearchRef = _el$67;
2497
- _$setAttribute(_el$67, "aria-controls", commandListId);
2498
- _$setAttribute(_el$67, "spellcheck", false);
2631
+ typeof _ref$0 === "function" ? _$use(_ref$0, _el$68) : addSearchRef = _el$68;
2632
+ _$setAttribute(_el$68, "aria-controls", commandListId);
2633
+ _$setAttribute(_el$68, "spellcheck", false);
2499
2634
  _$effect(_p$ => {
2500
- var _v$24 = chatMessages().commandSearch,
2501
- _v$25 = chatMessages().commandSearchLabel,
2502
- _v$26 = selectedCommand() ? commandOptionId(selectedCommand()) : undefined,
2503
- _v$27 = openingRow() !== undefined;
2504
- _v$24 !== _p$.e && _$setAttribute(_el$67, "placeholder", _p$.e = _v$24);
2505
- _v$25 !== _p$.t && _$setAttribute(_el$67, "aria-label", _p$.t = _v$25);
2506
- _v$26 !== _p$.a && _$setAttribute(_el$67, "aria-activedescendant", _p$.a = _v$26);
2507
- _v$27 !== _p$.o && _$setProperty(_el$67, "readOnly", _p$.o = _v$27);
2635
+ var _v$26 = chatMessages().commandSearch,
2636
+ _v$27 = chatMessages().commandSearchLabel,
2637
+ _v$28 = selectedCommand() ? commandOptionId(selectedCommand()) : undefined,
2638
+ _v$29 = openingRow() !== undefined;
2639
+ _v$26 !== _p$.e && _$setAttribute(_el$68, "placeholder", _p$.e = _v$26);
2640
+ _v$27 !== _p$.t && _$setAttribute(_el$68, "aria-label", _p$.t = _v$27);
2641
+ _v$28 !== _p$.a && _$setAttribute(_el$68, "aria-activedescendant", _p$.a = _v$28);
2642
+ _v$29 !== _p$.o && _$setProperty(_el$68, "readOnly", _p$.o = _v$29);
2508
2643
  return _p$;
2509
2644
  }, {
2510
2645
  e: undefined,
@@ -2512,15 +2647,15 @@ export function ChatComposer(props) {
2512
2647
  a: undefined,
2513
2648
  o: undefined
2514
2649
  });
2515
- _$effect(() => _$setProperty(_el$67, "value", addQuery()));
2650
+ _$effect(() => _$setProperty(_el$68, "value", addQuery()));
2516
2651
  _$runHydrationEvents();
2517
- return _el$65;
2652
+ return _el$66;
2518
2653
  }
2519
- }), _el$89, _co$15);
2654
+ }), _el$90, _co$15);
2520
2655
  var _ref$1 = commandListRef;
2521
- typeof _ref$1 === "function" ? _$use(_ref$1, _el$68) : commandListRef = _el$68;
2522
- _$setAttribute(_el$68, "id", commandListId);
2523
- _$insert(_el$68, _$createComponent(For, {
2656
+ typeof _ref$1 === "function" ? _$use(_ref$1, _el$69) : commandListRef = _el$69;
2657
+ _$setAttribute(_el$69, "id", commandListId);
2658
+ _$insert(_el$69, _$createComponent(For, {
2524
2659
  get each() {
2525
2660
  return commandModel().groups.map(commandGroupKey);
2526
2661
  },
@@ -2540,108 +2675,108 @@ export function ChatComposer(props) {
2540
2675
  });
2541
2676
  },
2542
2677
  get children() {
2543
- var _el$154 = _$getNextElement(_tmpl$34),
2544
- _el$155 = _el$154.firstChild,
2545
- _el$156 = _el$155.firstChild,
2546
- _el$158 = _el$156.nextSibling,
2547
- [_el$159, _co$38] = _$getNextMarker(_el$158.nextSibling),
2548
- _el$160 = _el$155.nextSibling,
2549
- [_el$161, _co$39] = _$getNextMarker(_el$160.nextSibling),
2550
- _el$162 = _el$161.nextSibling,
2551
- [_el$163, _co$40] = _$getNextMarker(_el$162.nextSibling);
2552
- _$insert(_el$156, () => group()?.scopeTitle ?? group()?.section?.label);
2553
- _$insert(_el$155, _$createComponent(Show, {
2678
+ var _el$158 = _$getNextElement(_tmpl$36),
2679
+ _el$159 = _el$158.firstChild,
2680
+ _el$160 = _el$159.firstChild,
2681
+ _el$162 = _el$160.nextSibling,
2682
+ [_el$163, _co$39] = _$getNextMarker(_el$162.nextSibling),
2683
+ _el$164 = _el$159.nextSibling,
2684
+ [_el$165, _co$40] = _$getNextMarker(_el$164.nextSibling),
2685
+ _el$166 = _el$165.nextSibling,
2686
+ [_el$167, _co$41] = _$getNextMarker(_el$166.nextSibling);
2687
+ _$insert(_el$160, () => group()?.scopeTitle ?? group()?.section?.label);
2688
+ _$insert(_el$159, _$createComponent(Show, {
2554
2689
  get when() {
2555
2690
  return group()?.loading;
2556
2691
  },
2557
2692
  get children() {
2558
- return _$getNextElement(_tmpl$33);
2693
+ return _$getNextElement(_tmpl$35);
2559
2694
  }
2560
- }), _el$159, _co$38);
2561
- _$insert(_el$154, _$createComponent(For, {
2695
+ }), _el$163, _co$39);
2696
+ _$insert(_el$158, _$createComponent(For, {
2562
2697
  get each() {
2563
2698
  return rows();
2564
2699
  },
2565
2700
  children: key => renderCommandRow(row(key))
2566
- }), _el$161, _co$39);
2567
- _$insert(_el$154, _$createComponent(Index, {
2701
+ }), _el$165, _co$40);
2702
+ _$insert(_el$158, _$createComponent(Index, {
2568
2703
  get each() {
2569
2704
  return Array.from({
2570
2705
  length: Math.max(group()?.placeholder ? 1 : 0, group()?.pendingRows ?? 0)
2571
2706
  });
2572
2707
  },
2573
- children: () => _$getNextElement(_tmpl$35)
2574
- }), _el$163, _co$40);
2708
+ children: () => _$getNextElement(_tmpl$37)
2709
+ }), _el$167, _co$41);
2575
2710
  _$effect(_p$ => {
2576
- var _v$46 = headingId(),
2577
- _v$47 = headingId();
2578
- _v$46 !== _p$.e && _$setAttribute(_el$154, "aria-labelledby", _p$.e = _v$46);
2579
- _v$47 !== _p$.t && _$setAttribute(_el$155, "id", _p$.t = _v$47);
2711
+ var _v$48 = headingId(),
2712
+ _v$49 = headingId();
2713
+ _v$48 !== _p$.e && _$setAttribute(_el$158, "aria-labelledby", _p$.e = _v$48);
2714
+ _v$49 !== _p$.t && _$setAttribute(_el$159, "id", _p$.t = _v$49);
2580
2715
  return _p$;
2581
2716
  }, {
2582
2717
  e: undefined,
2583
2718
  t: undefined
2584
2719
  });
2585
- return _el$154;
2720
+ return _el$158;
2586
2721
  }
2587
2722
  });
2588
2723
  }
2589
- }), _el$79, _co$10);
2590
- _$insert(_el$68, _$createComponent(Show, {
2724
+ }), _el$80, _co$10);
2725
+ _$insert(_el$69, _$createComponent(Show, {
2591
2726
  get when() {
2592
2727
  return _$memo(() => !!(searching() && foundCommandCount() === 0))() && !commandModel().groups.some(group => group.section || group.scopeTitle);
2593
2728
  },
2594
2729
  get children() {
2595
- var _el$69 = _$getNextElement(_tmpl$20),
2596
- _el$70 = _el$69.firstChild,
2597
- _el$71 = _el$70.nextSibling;
2598
- _$insert(_el$71, () => messages().loading);
2599
- return _el$69;
2730
+ var _el$70 = _$getNextElement(_tmpl$21),
2731
+ _el$71 = _el$70.firstChild,
2732
+ _el$72 = _el$71.nextSibling;
2733
+ _$insert(_el$72, () => messages().loading);
2734
+ return _el$70;
2600
2735
  }
2601
- }), _el$81, _co$11);
2602
- _$insert(_el$68, _$createComponent(Show, {
2736
+ }), _el$82, _co$11);
2737
+ _$insert(_el$69, _$createComponent(Show, {
2603
2738
  get when() {
2604
2739
  return searchError();
2605
2740
  },
2606
2741
  get children() {
2607
- var _el$72 = _$getNextElement(_tmpl$21),
2608
- _el$73 = _el$72.firstChild,
2609
- _el$74 = _el$73.nextSibling,
2742
+ var _el$73 = _$getNextElement(_tmpl$22),
2743
+ _el$74 = _el$73.firstChild,
2610
2744
  _el$75 = _el$74.nextSibling,
2611
- [_el$76, _co$1] = _$getNextMarker(_el$75.nextSibling);
2612
- _$insert(_el$72, () => messages().error, _el$76, _co$1);
2613
- return _el$72;
2745
+ _el$76 = _el$75.nextSibling,
2746
+ [_el$77, _co$1] = _$getNextMarker(_el$76.nextSibling);
2747
+ _$insert(_el$73, () => messages().error, _el$77, _co$1);
2748
+ return _el$73;
2614
2749
  }
2615
- }), _el$83, _co$12);
2616
- _$insert(_el$68, _$createComponent(Show, {
2750
+ }), _el$84, _co$12);
2751
+ _$insert(_el$69, _$createComponent(Show, {
2617
2752
  get when() {
2618
2753
  return _$memo(() => !!(!searching() && !searchError() && foundCommandCount() === 0))() && !commandModel().groups.some(group => group.pendingRows);
2619
2754
  },
2620
2755
  get children() {
2621
- var _el$77 = _$getNextElement(_tmpl$22);
2622
- _$insert(_el$77, (() => {
2756
+ var _el$78 = _$getNextElement(_tmpl$23);
2757
+ _$insert(_el$78, (() => {
2623
2758
  var _c$ = _$memo(() => !!!parsedCommandQuery().query.trim());
2624
2759
  return () => _c$() ? messages().noResults : chatMessages().commandsNothingFound({
2625
2760
  query: parsedCommandQuery().query.trim()
2626
2761
  });
2627
2762
  })());
2628
- return _el$77;
2763
+ return _el$78;
2629
2764
  }
2630
- }), _el$85, _co$13);
2631
- _$insert(_el$68, _$createComponent(Show, {
2765
+ }), _el$86, _co$13);
2766
+ _$insert(_el$69, _$createComponent(Show, {
2632
2767
  get when() {
2633
2768
  return commandModel().fallback?.command;
2634
2769
  },
2635
2770
  keyed: true,
2636
2771
  children: command => renderCommandRow(command)
2637
- }), _el$87, _co$14);
2772
+ }), _el$88, _co$14);
2638
2773
  _$effect(_p$ => {
2639
- var _v$28 = addSearch() ? "" : undefined,
2640
- _v$29 = chatMessages().commands,
2641
- _v$30 = searching() ? "true" : undefined;
2642
- _v$28 !== _p$.e && _$setAttribute(_el$64, "data-search", _p$.e = _v$28);
2643
- _v$29 !== _p$.t && _$setAttribute(_el$68, "aria-label", _p$.t = _v$29);
2644
- _v$30 !== _p$.a && _$setAttribute(_el$68, "aria-busy", _p$.a = _v$30);
2774
+ var _v$30 = addSearch() ? "" : undefined,
2775
+ _v$31 = chatMessages().commands,
2776
+ _v$32 = searching() ? "true" : undefined;
2777
+ _v$30 !== _p$.e && _$setAttribute(_el$65, "data-search", _p$.e = _v$30);
2778
+ _v$31 !== _p$.t && _$setAttribute(_el$69, "aria-label", _p$.t = _v$31);
2779
+ _v$32 !== _p$.a && _$setAttribute(_el$69, "aria-busy", _p$.a = _v$32);
2645
2780
  return _p$;
2646
2781
  }, {
2647
2782
  e: undefined,
@@ -2649,289 +2784,289 @@ export function ChatComposer(props) {
2649
2784
  a: undefined
2650
2785
  });
2651
2786
  _$runHydrationEvents();
2652
- return _el$64;
2787
+ return _el$65;
2653
2788
  }
2654
- }), _el$95, _co$18);
2789
+ }), _el$96, _co$18);
2655
2790
  _$effect(_p$ => {
2656
- var _v$31 = hasAccessory() ? undefined : "true",
2657
- _v$32 = suggestionsOpen() ? "hidden" : undefined,
2658
- _v$33 = suggestionsOpen();
2659
- _v$31 !== _p$.e && _$setAttribute(_el$58, "data-overlay", _p$.e = _v$31);
2660
- _v$32 !== _p$.t && _$setStyleProperty(_el$59, "visibility", _p$.t = _v$32);
2661
- _v$33 !== _p$.a && _$setProperty(_el$59, "inert", _p$.a = _v$33);
2791
+ var _v$33 = hasAccessory() ? undefined : "true",
2792
+ _v$34 = suggestionsOpen() ? "hidden" : undefined,
2793
+ _v$35 = suggestionsOpen();
2794
+ _v$33 !== _p$.e && _$setAttribute(_el$59, "data-overlay", _p$.e = _v$33);
2795
+ _v$34 !== _p$.t && _$setStyleProperty(_el$60, "visibility", _p$.t = _v$34);
2796
+ _v$35 !== _p$.a && _$setProperty(_el$60, "inert", _p$.a = _v$35);
2662
2797
  return _p$;
2663
2798
  }, {
2664
2799
  e: undefined,
2665
2800
  t: undefined,
2666
2801
  a: undefined
2667
2802
  });
2668
- return _el$58;
2803
+ return _el$59;
2669
2804
  }
2670
- }), _el$137, _co$34);
2805
+ }), _el$141, _co$35);
2671
2806
  var _ref$10 = composerRef;
2672
- typeof _ref$10 === "function" ? _$use(_ref$10, _el$96) : composerRef = _el$96;
2673
- _$insert(_el$96, _$createComponent(Show, {
2807
+ typeof _ref$10 === "function" ? _$use(_ref$10, _el$97) : composerRef = _el$97;
2808
+ _$insert(_el$97, _$createComponent(Show, {
2674
2809
  get when() {
2675
2810
  return showHint();
2676
2811
  },
2677
2812
  get children() {
2678
- var _el$97 = _$getNextElement(_tmpl$25);
2679
- _$insert(_el$97, _$createComponent(Show, {
2813
+ var _el$98 = _$getNextElement(_tmpl$26);
2814
+ _$insert(_el$98, _$createComponent(Show, {
2680
2815
  get when() {
2681
2816
  return dictationStatus();
2682
2817
  },
2683
2818
  get fallback() {
2684
2819
  return (() => {
2685
- var _el$165 = _$getNextElement(_tmpl$36);
2686
- _$insert(_el$165, hint);
2687
- return _el$165;
2820
+ var _el$169 = _$getNextElement(_tmpl$38);
2821
+ _$insert(_el$169, hint);
2822
+ return _el$169;
2688
2823
  })();
2689
2824
  },
2690
2825
  children: status => [(() => {
2691
- var _el$166 = _$getNextElement(_tmpl$37),
2692
- _el$167 = _el$166.firstChild,
2693
- _el$168 = _el$167.nextSibling;
2694
- _$insert(_el$168, () => status().text);
2826
+ var _el$170 = _$getNextElement(_tmpl$39),
2827
+ _el$171 = _el$170.firstChild,
2828
+ _el$172 = _el$171.nextSibling;
2829
+ _$insert(_el$172, () => status().text);
2695
2830
  _$effect(_p$ => {
2696
- var _v$48 = dictation() ?? undefined,
2697
- _v$49 = status().icon;
2698
- _v$48 !== _p$.e && _$setAttribute(_el$166, "data-state", _p$.e = _v$48);
2699
- _v$49 !== _p$.t && _$className(_el$167, _p$.t = _v$49);
2831
+ var _v$50 = dictation() ?? undefined,
2832
+ _v$51 = status().icon;
2833
+ _v$50 !== _p$.e && _$setAttribute(_el$170, "data-state", _p$.e = _v$50);
2834
+ _v$51 !== _p$.t && _$className(_el$171, _p$.t = _v$51);
2700
2835
  return _p$;
2701
2836
  }, {
2702
2837
  e: undefined,
2703
2838
  t: undefined
2704
2839
  });
2705
- return _el$166;
2840
+ return _el$170;
2706
2841
  })(), _$createComponent(Show, {
2707
2842
  get when() {
2708
2843
  return _$memo(() => dictation() === "refined")() ? props.microphone?.onRestoreOriginal : undefined;
2709
2844
  },
2710
2845
  children: restore => (() => {
2711
- var _el$169 = _$getNextElement(_tmpl$38);
2712
- _el$169.$$click = () => reportChatFailure(restore(), props.onError);
2713
- _el$169.$$mousedown = keepFieldFocus;
2714
- _$insert(_el$169, () => chatMessages().restoreOriginal);
2715
- _$effect(() => _$setProperty(_el$169, "disabled", microphoneDisabled()));
2846
+ var _el$173 = _$getNextElement(_tmpl$40);
2847
+ _el$173.$$click = () => reportChatFailure(restore(), props.onError);
2848
+ _el$173.$$mousedown = keepFieldFocus;
2849
+ _$insert(_el$173, () => chatMessages().restoreOriginal);
2850
+ _$effect(() => _$setProperty(_el$173, "disabled", microphoneDisabled()));
2716
2851
  _$runHydrationEvents();
2717
- return _el$169;
2852
+ return _el$173;
2718
2853
  })()
2719
2854
  })]
2720
2855
  }));
2721
- return _el$97;
2856
+ return _el$98;
2722
2857
  }
2723
- }), _el$121, _co$27);
2724
- _$insert(_el$96, _$createComponent(Show, {
2858
+ }), _el$125, _co$28);
2859
+ _$insert(_el$97, _$createComponent(Show, {
2725
2860
  get when() {
2726
2861
  return props.reply;
2727
2862
  },
2728
2863
  children: reply => (() => {
2729
- var _el$170 = _$getNextElement(_tmpl$39),
2730
- _el$172 = _el$170.firstChild,
2731
- [_el$173, _co$41] = _$getNextMarker(_el$172.nextSibling),
2732
- _el$171 = _el$173.nextSibling;
2733
- _$insert(_el$170, _$createComponent(Show, {
2864
+ var _el$174 = _$getNextElement(_tmpl$41),
2865
+ _el$176 = _el$174.firstChild,
2866
+ [_el$177, _co$42] = _$getNextMarker(_el$176.nextSibling),
2867
+ _el$175 = _el$177.nextSibling;
2868
+ _$insert(_el$174, _$createComponent(Show, {
2734
2869
  get when() {
2735
2870
  return reply().onSelect;
2736
2871
  },
2737
2872
  get fallback() {
2738
2873
  return (() => {
2739
- var _el$174 = _$getNextElement(_tmpl$40);
2740
- _$insert(_el$174, () => replyQuote(reply()));
2741
- return _el$174;
2874
+ var _el$178 = _$getNextElement(_tmpl$42);
2875
+ _$insert(_el$178, () => replyQuote(reply()));
2876
+ return _el$178;
2742
2877
  })();
2743
2878
  },
2744
2879
  children: select => (() => {
2745
- var _el$175 = _$getNextElement(_tmpl$41);
2746
- _el$175.$$click = () => select()();
2747
- _$insert(_el$175, () => replyQuote(reply()));
2880
+ var _el$179 = _$getNextElement(_tmpl$43);
2881
+ _el$179.$$click = () => select()();
2882
+ _$insert(_el$179, () => replyQuote(reply()));
2748
2883
  _$runHydrationEvents();
2749
- return _el$175;
2884
+ return _el$179;
2750
2885
  })()
2751
- }), _el$173, _co$41);
2752
- _el$171.$$click = () => reply().onCancel();
2753
- _el$171.$$mousedown = keepFieldFocus;
2886
+ }), _el$177, _co$42);
2887
+ _el$175.$$click = () => reply().onCancel();
2888
+ _el$175.$$mousedown = keepFieldFocus;
2754
2889
  _$effect(_p$ => {
2755
- var _v$50 = chatMessages().cancelReply,
2756
- _v$51 = chatMessages().cancelReply;
2757
- _v$50 !== _p$.e && _$setAttribute(_el$171, "aria-label", _p$.e = _v$50);
2758
- _v$51 !== _p$.t && _$setAttribute(_el$171, "title", _p$.t = _v$51);
2890
+ var _v$52 = chatMessages().cancelReply,
2891
+ _v$53 = chatMessages().cancelReply;
2892
+ _v$52 !== _p$.e && _$setAttribute(_el$175, "aria-label", _p$.e = _v$52);
2893
+ _v$53 !== _p$.t && _$setAttribute(_el$175, "title", _p$.t = _v$53);
2759
2894
  return _p$;
2760
2895
  }, {
2761
2896
  e: undefined,
2762
2897
  t: undefined
2763
2898
  });
2764
2899
  _$runHydrationEvents();
2765
- return _el$170;
2900
+ return _el$174;
2766
2901
  })()
2767
- }), _el$123, _co$28);
2768
- _$insert(_el$96, _$createComponent(Show, {
2902
+ }), _el$127, _co$29);
2903
+ _$insert(_el$97, _$createComponent(Show, {
2769
2904
  get when() {
2770
2905
  return attachments().length > 0;
2771
2906
  },
2772
2907
  get children() {
2773
- var _el$98 = _$getNextElement(_tmpl$26);
2774
- _$insert(_el$98, _$createComponent(For, {
2908
+ var _el$99 = _$getNextElement(_tmpl$27);
2909
+ _$insert(_el$99, _$createComponent(For, {
2775
2910
  get each() {
2776
2911
  return attachments();
2777
2912
  },
2778
2913
  children: attachment => (() => {
2779
- var _el$176 = _$getNextElement(_tmpl$43),
2780
- _el$177 = _el$176.firstChild,
2781
- _el$178 = _el$177.firstChild,
2782
- [_el$179, _co$42] = _$getNextMarker(_el$178.nextSibling),
2783
- _el$180 = _el$179.nextSibling,
2784
- [_el$181, _co$43] = _$getNextMarker(_el$180.nextSibling),
2785
- _el$183 = _el$177.nextSibling,
2786
- [_el$184, _co$44] = _$getNextMarker(_el$183.nextSibling);
2787
- _$insert(_el$177, _$createComponent(Show, {
2914
+ var _el$180 = _$getNextElement(_tmpl$45),
2915
+ _el$181 = _el$180.firstChild,
2916
+ _el$182 = _el$181.firstChild,
2917
+ [_el$183, _co$43] = _$getNextMarker(_el$182.nextSibling),
2918
+ _el$184 = _el$183.nextSibling,
2919
+ [_el$185, _co$44] = _$getNextMarker(_el$184.nextSibling),
2920
+ _el$187 = _el$181.nextSibling,
2921
+ [_el$188, _co$45] = _$getNextMarker(_el$187.nextSibling);
2922
+ _$insert(_el$181, _$createComponent(Show, {
2788
2923
  get when() {
2789
2924
  return attachment.href;
2790
2925
  },
2791
2926
  get fallback() {
2792
2927
  return (() => {
2793
- var _el$185 = _$getNextElement(_tmpl$45),
2794
- _el$187 = _el$185.firstChild,
2795
- [_el$188, _co$45] = _$getNextMarker(_el$187.nextSibling),
2796
- _el$189 = _el$188.nextSibling,
2797
- [_el$190, _co$46] = _$getNextMarker(_el$189.nextSibling);
2798
- _$insert(_el$185, _$createComponent(Show, {
2928
+ var _el$189 = _$getNextElement(_tmpl$47),
2929
+ _el$191 = _el$189.firstChild,
2930
+ [_el$192, _co$46] = _$getNextMarker(_el$191.nextSibling),
2931
+ _el$193 = _el$192.nextSibling,
2932
+ [_el$194, _co$47] = _$getNextMarker(_el$193.nextSibling);
2933
+ _$insert(_el$189, _$createComponent(Show, {
2799
2934
  get when() {
2800
2935
  return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
2801
2936
  },
2802
2937
  get fallback() {
2803
2938
  return (() => {
2804
- var _el$191 = _$getNextElement(_tmpl$3);
2805
- _$effect(() => _$className(_el$191, attachmentIcon(attachment)));
2806
- return _el$191;
2939
+ var _el$195 = _$getNextElement(_tmpl$3);
2940
+ _$effect(() => _$className(_el$195, attachmentIcon(attachment)));
2941
+ return _el$195;
2807
2942
  })();
2808
2943
  },
2809
2944
  get children() {
2810
- var _el$186 = _$getNextElement(_tmpl$44);
2945
+ var _el$190 = _$getNextElement(_tmpl$46);
2811
2946
  _$effect(_p$ => {
2812
- var _v$54 = attachment.previewUrl,
2813
- _v$55 = attachment.alt ?? "";
2814
- _v$54 !== _p$.e && _$setAttribute(_el$186, "src", _p$.e = _v$54);
2815
- _v$55 !== _p$.t && _$setAttribute(_el$186, "alt", _p$.t = _v$55);
2947
+ var _v$56 = attachment.previewUrl,
2948
+ _v$57 = attachment.alt ?? "";
2949
+ _v$56 !== _p$.e && _$setAttribute(_el$190, "src", _p$.e = _v$56);
2950
+ _v$57 !== _p$.t && _$setAttribute(_el$190, "alt", _p$.t = _v$57);
2816
2951
  return _p$;
2817
2952
  }, {
2818
2953
  e: undefined,
2819
2954
  t: undefined
2820
2955
  });
2821
- return _el$186;
2956
+ return _el$190;
2822
2957
  }
2823
- }), _el$188, _co$45);
2824
- _$insert(_el$185, () => renderAttachmentCopy(attachment), _el$190, _co$46);
2825
- return _el$185;
2958
+ }), _el$192, _co$46);
2959
+ _$insert(_el$189, () => renderAttachmentCopy(attachment), _el$194, _co$47);
2960
+ return _el$189;
2826
2961
  })();
2827
2962
  },
2828
2963
  children: href => (() => {
2829
- var _el$192 = _$getNextElement(_tmpl$46),
2830
- _el$194 = _el$192.firstChild,
2831
- [_el$195, _co$47] = _$getNextMarker(_el$194.nextSibling),
2832
- _el$196 = _el$195.nextSibling,
2833
- [_el$197, _co$48] = _$getNextMarker(_el$196.nextSibling);
2834
- _$insert(_el$192, _$createComponent(Show, {
2964
+ var _el$196 = _$getNextElement(_tmpl$48),
2965
+ _el$198 = _el$196.firstChild,
2966
+ [_el$199, _co$48] = _$getNextMarker(_el$198.nextSibling),
2967
+ _el$200 = _el$199.nextSibling,
2968
+ [_el$201, _co$49] = _$getNextMarker(_el$200.nextSibling);
2969
+ _$insert(_el$196, _$createComponent(Show, {
2835
2970
  get when() {
2836
2971
  return _$memo(() => attachment.kind === "image")() && attachment.previewUrl;
2837
2972
  },
2838
2973
  get fallback() {
2839
2974
  return (() => {
2840
- var _el$198 = _$getNextElement(_tmpl$3);
2841
- _$effect(() => _$className(_el$198, attachmentIcon(attachment)));
2842
- return _el$198;
2975
+ var _el$202 = _$getNextElement(_tmpl$3);
2976
+ _$effect(() => _$className(_el$202, attachmentIcon(attachment)));
2977
+ return _el$202;
2843
2978
  })();
2844
2979
  },
2845
2980
  get children() {
2846
- var _el$193 = _$getNextElement(_tmpl$44);
2981
+ var _el$197 = _$getNextElement(_tmpl$46);
2847
2982
  _$effect(_p$ => {
2848
- var _v$56 = attachment.previewUrl,
2849
- _v$57 = attachment.alt ?? "";
2850
- _v$56 !== _p$.e && _$setAttribute(_el$193, "src", _p$.e = _v$56);
2851
- _v$57 !== _p$.t && _$setAttribute(_el$193, "alt", _p$.t = _v$57);
2983
+ var _v$58 = attachment.previewUrl,
2984
+ _v$59 = attachment.alt ?? "";
2985
+ _v$58 !== _p$.e && _$setAttribute(_el$197, "src", _p$.e = _v$58);
2986
+ _v$59 !== _p$.t && _$setAttribute(_el$197, "alt", _p$.t = _v$59);
2852
2987
  return _p$;
2853
2988
  }, {
2854
2989
  e: undefined,
2855
2990
  t: undefined
2856
2991
  });
2857
- return _el$193;
2992
+ return _el$197;
2858
2993
  }
2859
- }), _el$195, _co$47);
2860
- _$insert(_el$192, () => renderAttachmentCopy(attachment), _el$197, _co$48);
2994
+ }), _el$199, _co$48);
2995
+ _$insert(_el$196, () => renderAttachmentCopy(attachment), _el$201, _co$49);
2861
2996
  _$effect(_p$ => {
2862
- var _v$58 = href(),
2863
- _v$59 = chatMessages().openInNewTab({
2997
+ var _v$60 = href(),
2998
+ _v$61 = chatMessages().openInNewTab({
2864
2999
  name: attachment.name
2865
3000
  });
2866
- _v$58 !== _p$.e && _$setAttribute(_el$192, "href", _p$.e = _v$58);
2867
- _v$59 !== _p$.t && _$setAttribute(_el$192, "aria-label", _p$.t = _v$59);
3001
+ _v$60 !== _p$.e && _$setAttribute(_el$196, "href", _p$.e = _v$60);
3002
+ _v$61 !== _p$.t && _$setAttribute(_el$196, "aria-label", _p$.t = _v$61);
2868
3003
  return _p$;
2869
3004
  }, {
2870
3005
  e: undefined,
2871
3006
  t: undefined
2872
3007
  });
2873
- return _el$192;
3008
+ return _el$196;
2874
3009
  })()
2875
- }), _el$179, _co$42);
2876
- _$insert(_el$177, _$createComponent(Show, {
3010
+ }), _el$183, _co$43);
3011
+ _$insert(_el$181, _$createComponent(Show, {
2877
3012
  get when() {
2878
3013
  return attachment.action;
2879
3014
  },
2880
3015
  children: action => (() => {
2881
- var _el$199 = _$getNextElement(_tmpl$47),
2882
- _el$200 = _el$199.firstChild,
2883
- [_el$201, _co$49] = _$getNextMarker(_el$200.nextSibling),
2884
- _el$202 = _el$201.nextSibling,
2885
- [_el$203, _co$50] = _$getNextMarker(_el$202.nextSibling);
2886
- _el$199.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
2887
- _$insert(_el$199, _$createComponent(Show, {
3016
+ var _el$203 = _$getNextElement(_tmpl$49),
3017
+ _el$204 = _el$203.firstChild,
3018
+ [_el$205, _co$50] = _$getNextMarker(_el$204.nextSibling),
3019
+ _el$206 = _el$205.nextSibling,
3020
+ [_el$207, _co$51] = _$getNextMarker(_el$206.nextSibling);
3021
+ _el$203.$$click = () => reportChatFailure(() => executeChatAction(action()), props.onError);
3022
+ _$insert(_el$203, _$createComponent(Show, {
2888
3023
  get when() {
2889
3024
  return action().icon;
2890
3025
  },
2891
3026
  children: icon => (() => {
2892
- var _el$204 = _$getNextElement(_tmpl$3);
2893
- _$effect(() => _$className(_el$204, icon()));
2894
- return _el$204;
3027
+ var _el$208 = _$getNextElement(_tmpl$3);
3028
+ _$effect(() => _$className(_el$208, icon()));
3029
+ return _el$208;
2895
3030
  })()
2896
- }), _el$201, _co$49);
2897
- _$insert(_el$199, () => action().label, _el$203, _co$50);
2898
- _$effect(() => _$setProperty(_el$199, "disabled", blocked() || action().disabled));
3031
+ }), _el$205, _co$50);
3032
+ _$insert(_el$203, () => action().label, _el$207, _co$51);
3033
+ _$effect(() => _$setProperty(_el$203, "disabled", blocked() || action().disabled));
2899
3034
  _$runHydrationEvents();
2900
- return _el$199;
3035
+ return _el$203;
2901
3036
  })()
2902
- }), _el$181, _co$43);
2903
- _$insert(_el$176, _$createComponent(Show, {
3037
+ }), _el$185, _co$44);
3038
+ _$insert(_el$180, _$createComponent(Show, {
2904
3039
  get when() {
2905
3040
  return props.onAttachmentsChange;
2906
3041
  },
2907
3042
  get children() {
2908
- var _el$182 = _$getNextElement(_tmpl$42);
2909
- _el$182.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
3043
+ var _el$186 = _$getNextElement(_tmpl$44);
3044
+ _el$186.$$click = () => setAttachments(attachments().filter(candidate => candidate.id !== attachment.id));
2910
3045
  _$effect(_p$ => {
2911
- var _v$52 = selectMessages().removeNamed({
3046
+ var _v$54 = selectMessages().removeNamed({
2912
3047
  name: attachment.name
2913
3048
  }),
2914
- _v$53 = blocked();
2915
- _v$52 !== _p$.e && _$setAttribute(_el$182, "aria-label", _p$.e = _v$52);
2916
- _v$53 !== _p$.t && _$setProperty(_el$182, "disabled", _p$.t = _v$53);
3049
+ _v$55 = blocked();
3050
+ _v$54 !== _p$.e && _$setAttribute(_el$186, "aria-label", _p$.e = _v$54);
3051
+ _v$55 !== _p$.t && _$setProperty(_el$186, "disabled", _p$.t = _v$55);
2917
3052
  return _p$;
2918
3053
  }, {
2919
3054
  e: undefined,
2920
3055
  t: undefined
2921
3056
  });
2922
3057
  _$runHydrationEvents();
2923
- return _el$182;
3058
+ return _el$186;
2924
3059
  }
2925
- }), _el$184, _co$44);
2926
- _$effect(() => _el$177.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
2927
- return _el$176;
3060
+ }), _el$188, _co$45);
3061
+ _$effect(() => _el$181.classList.toggle("k2b-chat-composer__attachment-content--action", !!Boolean(attachment.action)));
3062
+ return _el$180;
2928
3063
  })()
2929
3064
  }));
2930
- _$effect(() => _$setAttribute(_el$98, "aria-label", chatMessages().attachments));
2931
- return _el$98;
3065
+ _$effect(() => _$setAttribute(_el$99, "aria-label", chatMessages().attachments));
3066
+ return _el$99;
2932
3067
  }
2933
- }), _el$125, _co$29);
2934
- _$insert(_el$96, _$createComponent(Show, {
3068
+ }), _el$129, _co$30);
3069
+ _$insert(_el$97, _$createComponent(Show, {
2935
3070
  get when() {
2936
3071
  return conversation();
2937
3072
  },
@@ -2941,38 +3076,38 @@ export function ChatComposer(props) {
2941
3076
  return props.error;
2942
3077
  },
2943
3078
  get children() {
2944
- var _el$205 = _$getNextElement(_tmpl$27),
2945
- _el$206 = _el$205.firstChild,
2946
- _el$207 = _el$206.nextSibling,
2947
- [_el$208, _co$51] = _$getNextMarker(_el$207.nextSibling);
2948
- _$insert(_el$205, () => props.error, _el$208, _co$51);
2949
- return _el$205;
3079
+ var _el$209 = _$getNextElement(_tmpl$28),
3080
+ _el$210 = _el$209.firstChild,
3081
+ _el$211 = _el$210.nextSibling,
3082
+ [_el$212, _co$52] = _$getNextMarker(_el$211.nextSibling);
3083
+ _$insert(_el$209, () => props.error, _el$212, _co$52);
3084
+ return _el$209;
2950
3085
  }
2951
3086
  }), _$memo(formatRow), (() => {
2952
- var _el$209 = _$getNextElement(_tmpl$48);
2953
- _$insert(_el$209, _$createComponent(Show, {
3087
+ var _el$213 = _$getNextElement(_tmpl$50);
3088
+ _$insert(_el$213, _$createComponent(Show, {
2954
3089
  get when() {
2955
- return footer();
3090
+ return dictating() || footer();
2956
3091
  },
2957
3092
  get fallback() {
2958
3093
  return [(() => {
2959
- var _el$210 = _$getNextElement(_tmpl$49),
2960
- _el$211 = _el$210.firstChild,
2961
- [_el$212, _co$52] = _$getNextMarker(_el$211.nextSibling),
2962
- _el$213 = _el$212.nextSibling,
2963
- [_el$214, _co$53] = _$getNextMarker(_el$213.nextSibling),
2964
- _el$215 = _el$214.nextSibling,
2965
- [_el$216, _co$54] = _$getNextMarker(_el$215.nextSibling),
3094
+ var _el$214 = _$getNextElement(_tmpl$51),
3095
+ _el$215 = _el$214.firstChild,
3096
+ [_el$216, _co$53] = _$getNextMarker(_el$215.nextSibling),
2966
3097
  _el$217 = _el$216.nextSibling,
2967
- [_el$218, _co$55] = _$getNextMarker(_el$217.nextSibling),
3098
+ [_el$218, _co$54] = _$getNextMarker(_el$217.nextSibling),
2968
3099
  _el$219 = _el$218.nextSibling,
2969
- [_el$220, _co$56] = _$getNextMarker(_el$219.nextSibling),
3100
+ [_el$220, _co$55] = _$getNextMarker(_el$219.nextSibling),
2970
3101
  _el$221 = _el$220.nextSibling,
2971
- [_el$222, _co$57] = _$getNextMarker(_el$221.nextSibling),
3102
+ [_el$222, _co$56] = _$getNextMarker(_el$221.nextSibling),
2972
3103
  _el$223 = _el$222.nextSibling,
2973
- [_el$224, _co$58] = _$getNextMarker(_el$223.nextSibling);
2974
- _$insert(_el$210, () => props.footerTools, _el$212, _co$52);
2975
- _$insert(_el$210, _$createComponent(Show, {
3104
+ [_el$224, _co$57] = _$getNextMarker(_el$223.nextSibling),
3105
+ _el$225 = _el$224.nextSibling,
3106
+ [_el$226, _co$58] = _$getNextMarker(_el$225.nextSibling),
3107
+ _el$227 = _el$226.nextSibling,
3108
+ [_el$228, _co$59] = _$getNextMarker(_el$227.nextSibling);
3109
+ _$insert(_el$214, () => props.footerTools, _el$216, _co$53);
3110
+ _$insert(_el$214, _$createComponent(Show, {
2976
3111
  get when() {
2977
3112
  return addOpensCommands();
2978
3113
  },
@@ -2989,11 +3124,11 @@ export function ChatComposer(props) {
2989
3124
  get children() {
2990
3125
  return addSearchButton();
2991
3126
  }
2992
- }), _el$214, _co$53);
2993
- _$insert(_el$210, fileInput, _el$216, _co$54);
2994
- _$insert(_el$210, formatToggle, _el$218, _co$55);
2995
- _$insert(_el$210, emojiButton, _el$220, _co$56);
2996
- _$insert(_el$210, _$createComponent(Show, {
3127
+ }), _el$218, _co$54);
3128
+ _$insert(_el$214, fileInput, _el$220, _co$55);
3129
+ _$insert(_el$214, formatToggle, _el$222, _co$56);
3130
+ _$insert(_el$214, emojiButton, _el$224, _co$57);
3131
+ _$insert(_el$214, _$createComponent(Show, {
2997
3132
  get when() {
2998
3133
  return (props.models?.length ?? 0) > 0;
2999
3134
  },
@@ -3039,22 +3174,24 @@ export function ChatComposer(props) {
3039
3174
  }
3040
3175
  });
3041
3176
  }
3042
- }), _el$222, _co$57);
3043
- _$insert(_el$210, () => props.modelDetails, _el$224, _co$58);
3044
- return _el$210;
3177
+ }), _el$226, _co$58);
3178
+ _$insert(_el$214, () => props.modelDetails, _el$228, _co$59);
3179
+ return _el$214;
3045
3180
  })(), (() => {
3046
- var _el$225 = _$getNextElement(_tmpl$50),
3047
- _el$226 = _el$225.firstChild,
3048
- [_el$227, _co$59] = _$getNextMarker(_el$226.nextSibling),
3049
- _el$228 = _el$227.nextSibling,
3050
- [_el$229, _co$60] = _$getNextMarker(_el$228.nextSibling),
3051
- _el$230 = _el$229.nextSibling,
3052
- [_el$231, _co$61] = _$getNextMarker(_el$230.nextSibling),
3181
+ var _el$229 = _$getNextElement(_tmpl$52),
3182
+ _el$230 = _el$229.firstChild,
3183
+ [_el$231, _co$60] = _$getNextMarker(_el$230.nextSibling),
3053
3184
  _el$232 = _el$231.nextSibling,
3054
- [_el$233, _co$62] = _$getNextMarker(_el$232.nextSibling),
3185
+ [_el$233, _co$61] = _$getNextMarker(_el$232.nextSibling),
3055
3186
  _el$234 = _el$233.nextSibling,
3056
- [_el$235, _co$63] = _$getNextMarker(_el$234.nextSibling);
3057
- _$insert(_el$225, _$createComponent(For, {
3187
+ [_el$235, _co$62] = _$getNextMarker(_el$234.nextSibling),
3188
+ _el$236 = _el$235.nextSibling,
3189
+ [_el$237, _co$63] = _$getNextMarker(_el$236.nextSibling),
3190
+ _el$238 = _el$237.nextSibling,
3191
+ [_el$239, _co$64] = _$getNextMarker(_el$238.nextSibling),
3192
+ _el$240 = _el$239.nextSibling,
3193
+ [_el$241, _co$65] = _$getNextMarker(_el$240.nextSibling);
3194
+ _$insert(_el$229, _$createComponent(For, {
3058
3195
  get each() {
3059
3196
  return props.contextActions;
3060
3197
  },
@@ -3078,13 +3215,13 @@ export function ChatComposer(props) {
3078
3215
  },
3079
3216
  onClick: () => reportChatFailure(() => executeChatAction(action), props.onError),
3080
3217
  get children() {
3081
- var _el$236 = _$getNextElement(_tmpl$3);
3082
- _$effect(() => _$className(_el$236, action.icon ?? "ti ti-dots"));
3083
- return _el$236;
3218
+ var _el$242 = _$getNextElement(_tmpl$3);
3219
+ _$effect(() => _$className(_el$242, action.icon ?? "ti ti-dots"));
3220
+ return _el$242;
3084
3221
  }
3085
3222
  })
3086
- }), _el$227, _co$59);
3087
- _$insert(_el$225, _$createComponent(Show, {
3223
+ }), _el$231, _co$60);
3224
+ _$insert(_el$229, _$createComponent(Show, {
3088
3225
  get when() {
3089
3226
  return _$memo(() => !!hasContextUsage())() ? props.contextUsage ?? {} : undefined;
3090
3227
  },
@@ -3096,18 +3233,42 @@ export function ChatComposer(props) {
3096
3233
  return props.onError;
3097
3234
  }
3098
3235
  }))
3099
- }), _el$229, _co$60);
3100
- _$insert(_el$225, () => props.submitTools, _el$231, _co$61);
3101
- _$insert(_el$225, microphoneControl, _el$233, _co$62);
3102
- _$insert(_el$225, sendControl, _el$235, _co$63);
3103
- return _el$225;
3236
+ }), _el$233, _co$61);
3237
+ _$insert(_el$229, () => props.submitTools, _el$235, _co$62);
3238
+ _$insert(_el$229, _$createComponent(Show, {
3239
+ get when() {
3240
+ return props.dictation;
3241
+ },
3242
+ get children() {
3243
+ return _$createComponent(DictationButton, {
3244
+ dictation: liveDictation,
3245
+ "class": "k2b-chat-composer__icon-action",
3246
+ cardAnchor: () => shellRef
3247
+ });
3248
+ }
3249
+ }), _el$237, _co$63);
3250
+ _$insert(_el$229, microphoneControl, _el$239, _co$64);
3251
+ _$insert(_el$229, sendControl, _el$241, _co$65);
3252
+ return _el$229;
3104
3253
  })()];
3105
3254
  },
3106
3255
  get children() {
3107
- return footer();
3256
+ return _$createComponent(Show, {
3257
+ get when() {
3258
+ return dictating();
3259
+ },
3260
+ get fallback() {
3261
+ return footer();
3262
+ },
3263
+ get children() {
3264
+ return _$createComponent(DictationBar, {
3265
+ dictation: liveDictation
3266
+ });
3267
+ }
3268
+ });
3108
3269
  }
3109
3270
  }));
3110
- return _el$209;
3271
+ return _el$213;
3111
3272
  })()];
3112
3273
  },
3113
3274
  get children() {
@@ -3116,43 +3277,71 @@ export function ChatComposer(props) {
3116
3277
  return props.error;
3117
3278
  },
3118
3279
  get children() {
3119
- var _el$99 = _$getNextElement(_tmpl$27),
3120
- _el$100 = _el$99.firstChild,
3121
- _el$101 = _el$100.nextSibling,
3122
- [_el$102, _co$19] = _$getNextMarker(_el$101.nextSibling);
3123
- _$insert(_el$99, () => props.error, _el$102, _co$19);
3124
- return _el$99;
3280
+ var _el$100 = _$getNextElement(_tmpl$28),
3281
+ _el$101 = _el$100.firstChild,
3282
+ _el$102 = _el$101.nextSibling,
3283
+ [_el$103, _co$19] = _$getNextMarker(_el$102.nextSibling);
3284
+ _$insert(_el$100, () => props.error, _el$103, _co$19);
3285
+ return _el$100;
3286
+ }
3287
+ }), _$createComponent(Show, {
3288
+ get when() {
3289
+ return dictating();
3290
+ },
3291
+ get fallback() {
3292
+ return formatRow();
3293
+ },
3294
+ get children() {
3295
+ var _el$104 = _$getNextElement(_tmpl$29);
3296
+ _$insert(_el$104, _$createComponent(DictationBar, {
3297
+ dictation: liveDictation
3298
+ }));
3299
+ return _el$104;
3125
3300
  }
3126
- }), _$memo(() => formatRow()), (() => {
3127
- var _el$103 = _$getNextElement(_tmpl$28),
3128
- _el$114 = _el$103.firstChild,
3129
- [_el$115, _co$24] = _$getNextMarker(_el$114.nextSibling),
3130
- _el$116 = _el$115.nextSibling,
3131
- [_el$117, _co$25] = _$getNextMarker(_el$116.nextSibling),
3132
- _el$104 = _el$117.nextSibling,
3133
- _el$112 = _el$104.firstChild,
3134
- [_el$113, _co$23] = _$getNextMarker(_el$112.nextSibling),
3135
- _el$105 = _el$113.nextSibling,
3136
- _el$106 = _el$105.firstChild,
3137
- [_el$107, _co$20] = _$getNextMarker(_el$106.nextSibling),
3138
- _el$108 = _el$107.nextSibling,
3139
- [_el$109, _co$21] = _$getNextMarker(_el$108.nextSibling),
3301
+ }), (() => {
3302
+ var _el$105 = _$getNextElement(_tmpl$30),
3303
+ _el$118 = _el$105.firstChild,
3304
+ [_el$119, _co$25] = _$getNextMarker(_el$118.nextSibling),
3305
+ _el$120 = _el$119.nextSibling,
3306
+ [_el$121, _co$26] = _$getNextMarker(_el$120.nextSibling),
3307
+ _el$106 = _el$121.nextSibling,
3308
+ _el$116 = _el$106.firstChild,
3309
+ [_el$117, _co$24] = _$getNextMarker(_el$116.nextSibling),
3310
+ _el$107 = _el$117.nextSibling,
3311
+ _el$108 = _el$107.firstChild,
3312
+ [_el$109, _co$20] = _$getNextMarker(_el$108.nextSibling),
3140
3313
  _el$110 = _el$109.nextSibling,
3141
- [_el$111, _co$22] = _$getNextMarker(_el$110.nextSibling),
3142
- _el$118 = _el$104.nextSibling,
3143
- [_el$119, _co$26] = _$getNextMarker(_el$118.nextSibling);
3144
- _$insert(_el$103, attachControl, _el$115, _co$24);
3145
- _$insert(_el$103, fileInput, _el$117, _co$25);
3146
- _$insert(_el$104, field, _el$113, _co$23);
3147
- _$insert(_el$105, formatToggle, _el$107, _co$20);
3148
- _$insert(_el$105, emojiButton, _el$109, _co$21);
3149
- _$insert(_el$105, microphoneControl, _el$111, _co$22);
3150
- _$insert(_el$103, sendControl, _el$119, _co$26);
3151
- return _el$103;
3314
+ [_el$111, _co$21] = _$getNextMarker(_el$110.nextSibling),
3315
+ _el$112 = _el$111.nextSibling,
3316
+ [_el$113, _co$22] = _$getNextMarker(_el$112.nextSibling),
3317
+ _el$114 = _el$113.nextSibling,
3318
+ [_el$115, _co$23] = _$getNextMarker(_el$114.nextSibling),
3319
+ _el$122 = _el$106.nextSibling,
3320
+ [_el$123, _co$27] = _$getNextMarker(_el$122.nextSibling);
3321
+ _$insert(_el$105, attachControl, _el$119, _co$25);
3322
+ _$insert(_el$105, fileInput, _el$121, _co$26);
3323
+ _$insert(_el$106, field, _el$117, _co$24);
3324
+ _$insert(_el$107, formatToggle, _el$109, _co$20);
3325
+ _$insert(_el$107, emojiButton, _el$111, _co$21);
3326
+ _$insert(_el$107, _$createComponent(Show, {
3327
+ get when() {
3328
+ return props.dictation;
3329
+ },
3330
+ get children() {
3331
+ return _$createComponent(DictationButton, {
3332
+ dictation: liveDictation,
3333
+ "class": "k2b-chat-composer__icon-action",
3334
+ cardAnchor: () => shellRef
3335
+ });
3336
+ }
3337
+ }), _el$113, _co$22);
3338
+ _$insert(_el$107, microphoneControl, _el$115, _co$23);
3339
+ _$insert(_el$105, sendControl, _el$123, _co$27);
3340
+ return _el$105;
3152
3341
  })()];
3153
3342
  }
3154
- }), _el$127, _co$30);
3155
- _$insert(_el$96, _$createComponent(Show, {
3343
+ }), _el$131, _co$31);
3344
+ _$insert(_el$97, _$createComponent(Show, {
3156
3345
  get when() {
3157
3346
  return props.fileSelection;
3158
3347
  },
@@ -3171,60 +3360,60 @@ export function ChatComposer(props) {
3171
3360
  },
3172
3361
  onDrop: files => void runFiles(files)
3173
3362
  })
3174
- }), _el$129, _co$31);
3175
- _$insert(_el$130, _$createComponent(Show, {
3363
+ }), _el$133, _co$32);
3364
+ _$insert(_el$134, _$createComponent(Show, {
3176
3365
  get when() {
3177
3366
  return suggestionAnnouncement();
3178
3367
  },
3179
3368
  keyed: true,
3180
3369
  children: announced => (() => {
3181
- var _el$237 = _$getNextElement(_tmpl$10);
3182
- _$insert(_el$237, () => announced.text);
3183
- return _el$237;
3370
+ var _el$243 = _$getNextElement(_tmpl$11);
3371
+ _$insert(_el$243, () => announced.text);
3372
+ return _el$243;
3184
3373
  })()
3185
3374
  }));
3186
- _$insert(_el$131, _$createComponent(Show, {
3375
+ _$insert(_el$135, _$createComponent(Show, {
3187
3376
  get when() {
3188
3377
  return _$memo(() => !!!suggestionsOpen())() && commandStatus();
3189
3378
  },
3190
3379
  children: status => (() => {
3191
- var _el$238 = _$getNextElement(_tmpl$51),
3192
- _el$239 = _el$238.firstChild,
3193
- _el$240 = _el$239.nextSibling;
3194
- _$insert(_el$240, () => status().text);
3380
+ var _el$244 = _$getNextElement(_tmpl$53),
3381
+ _el$245 = _el$244.firstChild,
3382
+ _el$246 = _el$245.nextSibling;
3383
+ _$insert(_el$246, () => status().text);
3195
3384
  _$effect(_p$ => {
3196
- var _v$60 = status().tone,
3197
- _v$61 = status().tone === "busy" ? "ti ti-loader-2 k2b-spin" : status().tone === "done" ? "ti ti-check" : "ti ti-alert-circle";
3198
- _v$60 !== _p$.e && _$setAttribute(_el$238, "data-tone", _p$.e = _v$60);
3199
- _v$61 !== _p$.t && _$className(_el$239, _p$.t = _v$61);
3385
+ var _v$62 = status().tone,
3386
+ _v$63 = status().tone === "busy" ? "ti ti-loader-2 k2b-spin" : status().tone === "done" ? "ti ti-check" : "ti ti-alert-circle";
3387
+ _v$62 !== _p$.e && _$setAttribute(_el$244, "data-tone", _p$.e = _v$62);
3388
+ _v$63 !== _p$.t && _$className(_el$245, _p$.t = _v$63);
3200
3389
  return _p$;
3201
3390
  }, {
3202
3391
  e: undefined,
3203
3392
  t: undefined
3204
3393
  });
3205
- return _el$238;
3394
+ return _el$244;
3206
3395
  })()
3207
- }), _el$133, _co$32);
3208
- _$insert(_el$131, _$createComponent(Show, {
3396
+ }), _el$137, _co$33);
3397
+ _$insert(_el$135, _$createComponent(Show, {
3209
3398
  get when() {
3210
3399
  return _$memo(() => !!suggestionsOpen())() && announcement();
3211
3400
  },
3212
3401
  keyed: true,
3213
3402
  children: announced => (() => {
3214
- var _el$241 = _$getNextElement(_tmpl$52);
3215
- _$insert(_el$241, () => announced.text);
3216
- return _el$241;
3403
+ var _el$247 = _$getNextElement(_tmpl$54);
3404
+ _$insert(_el$247, () => announced.text);
3405
+ return _el$247;
3217
3406
  })()
3218
- }), _el$135, _co$33);
3407
+ }), _el$139, _co$34);
3219
3408
  _$effect(_p$ => {
3220
- var _v$34 = `k2b-chat-composer ${props.class ?? ""}`,
3221
- _v$35 = running() ? "true" : undefined,
3222
- _v$36 = conversation() ? "conversation" : undefined,
3223
- _v$37 = props.label ?? chatMessages().messageComposer;
3224
- _v$34 !== _p$.e && _$className(_el$96, _p$.e = _v$34);
3225
- _v$35 !== _p$.t && _$setAttribute(_el$96, "data-running", _p$.t = _v$35);
3226
- _v$36 !== _p$.a && _$setAttribute(_el$96, "data-variant", _p$.a = _v$36);
3227
- _v$37 !== _p$.o && _$setAttribute(_el$96, "aria-label", _p$.o = _v$37);
3409
+ var _v$36 = `k2b-chat-composer ${props.class ?? ""}`,
3410
+ _v$37 = running() ? "true" : undefined,
3411
+ _v$38 = conversation() ? "conversation" : undefined,
3412
+ _v$39 = props.label ?? chatMessages().messageComposer;
3413
+ _v$36 !== _p$.e && _$className(_el$97, _p$.e = _v$36);
3414
+ _v$37 !== _p$.t && _$setAttribute(_el$97, "data-running", _p$.t = _v$37);
3415
+ _v$38 !== _p$.a && _$setAttribute(_el$97, "data-variant", _p$.a = _v$38);
3416
+ _v$39 !== _p$.o && _$setAttribute(_el$97, "aria-label", _p$.o = _v$39);
3228
3417
  return _p$;
3229
3418
  }, {
3230
3419
  e: undefined,
@@ -3232,7 +3421,7 @@ export function ChatComposer(props) {
3232
3421
  a: undefined,
3233
3422
  o: undefined
3234
3423
  });
3235
- return _el$57;
3424
+ return _el$58;
3236
3425
  })();
3237
3426
  }
3238
3427
  _$delegateEvents(["input", "click", "keyup", "beforeinput", "keydown", "pointerdown", "mousedown", "focusout"]);