@testgorilla/tgo-ui 11.22.3 → 12.0.1

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 (225) hide show
  1. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs +335 -229
  2. package/fesm2022/testgorilla-tgo-ui-components-accordion.mjs.map +1 -1
  3. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs +547 -465
  4. package/fesm2022/testgorilla-tgo-ui-components-ai-audio-circle.mjs.map +1 -1
  5. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs +160 -75
  6. package/fesm2022/testgorilla-tgo-ui-components-ai-caveat.mjs.map +1 -1
  7. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs +678 -278
  8. package/fesm2022/testgorilla-tgo-ui-components-ai-feedback.mjs.map +1 -1
  9. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs +337 -274
  10. package/fesm2022/testgorilla-tgo-ui-components-alert-banner.mjs.map +1 -1
  11. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs +351 -192
  12. package/fesm2022/testgorilla-tgo-ui-components-audio-waveform.mjs.map +1 -1
  13. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs +1950 -960
  14. package/fesm2022/testgorilla-tgo-ui-components-autocomplete-v2.mjs.map +1 -1
  15. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs +1206 -1044
  16. package/fesm2022/testgorilla-tgo-ui-components-autocomplete.mjs.map +1 -1
  17. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs +328 -182
  18. package/fesm2022/testgorilla-tgo-ui-components-avatar.mjs.map +1 -1
  19. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs +383 -203
  20. package/fesm2022/testgorilla-tgo-ui-components-badge.mjs.map +1 -1
  21. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs +553 -261
  22. package/fesm2022/testgorilla-tgo-ui-components-breadcrumb.mjs.map +1 -1
  23. package/fesm2022/testgorilla-tgo-ui-components-button.mjs +709 -739
  24. package/fesm2022/testgorilla-tgo-ui-components-button.mjs.map +1 -1
  25. package/fesm2022/testgorilla-tgo-ui-components-card.mjs +219 -184
  26. package/fesm2022/testgorilla-tgo-ui-components-card.mjs.map +1 -1
  27. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs +515 -458
  28. package/fesm2022/testgorilla-tgo-ui-components-checkbox.mjs.map +1 -1
  29. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs +423 -162
  30. package/fesm2022/testgorilla-tgo-ui-components-checklist.mjs.map +1 -1
  31. package/fesm2022/testgorilla-tgo-ui-components-core.mjs +10784 -10996
  32. package/fesm2022/testgorilla-tgo-ui-components-core.mjs.map +1 -1
  33. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs +810 -533
  34. package/fesm2022/testgorilla-tgo-ui-components-datepicker.mjs.map +1 -1
  35. package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs +473 -116
  36. package/fesm2022/testgorilla-tgo-ui-components-device-control.mjs.map +1 -1
  37. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs +1149 -540
  38. package/fesm2022/testgorilla-tgo-ui-components-dialog.mjs.map +1 -1
  39. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs +148 -84
  40. package/fesm2022/testgorilla-tgo-ui-components-divider.mjs.map +1 -1
  41. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs +239 -142
  42. package/fesm2022/testgorilla-tgo-ui-components-donut-chart.mjs.map +1 -1
  43. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs +599 -467
  44. package/fesm2022/testgorilla-tgo-ui-components-dropdown.mjs.map +1 -1
  45. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs +126 -70
  46. package/fesm2022/testgorilla-tgo-ui-components-elevation-shadow.mjs.map +1 -1
  47. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs +324 -329
  48. package/fesm2022/testgorilla-tgo-ui-components-empty-state.mjs.map +1 -1
  49. package/fesm2022/testgorilla-tgo-ui-components-field.mjs +969 -648
  50. package/fesm2022/testgorilla-tgo-ui-components-field.mjs.map +1 -1
  51. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs +553 -419
  52. package/fesm2022/testgorilla-tgo-ui-components-file-upload.mjs.map +1 -1
  53. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs +847 -452
  54. package/fesm2022/testgorilla-tgo-ui-components-filter-button.mjs.map +1 -1
  55. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs +398 -302
  56. package/fesm2022/testgorilla-tgo-ui-components-gaussian-chart.mjs.map +1 -1
  57. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs +162 -95
  58. package/fesm2022/testgorilla-tgo-ui-components-icon-label.mjs.map +1 -1
  59. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs +1825 -1795
  60. package/fesm2022/testgorilla-tgo-ui-components-icon.mjs.map +1 -1
  61. package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs +1018 -672
  62. package/fesm2022/testgorilla-tgo-ui-components-infinite-scroll-table.mjs.map +1 -1
  63. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs +758 -368
  64. package/fesm2022/testgorilla-tgo-ui-components-inline-field.mjs.map +1 -1
  65. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs +204 -212
  66. package/fesm2022/testgorilla-tgo-ui-components-logo.mjs.map +1 -1
  67. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs +183 -48
  68. package/fesm2022/testgorilla-tgo-ui-components-media-card.mjs.map +1 -1
  69. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs +243 -79
  70. package/fesm2022/testgorilla-tgo-ui-components-media-dialog.mjs.map +1 -1
  71. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs +751 -361
  72. package/fesm2022/testgorilla-tgo-ui-components-multi-input.mjs.map +1 -1
  73. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs +1122 -385
  74. package/fesm2022/testgorilla-tgo-ui-components-navbar.mjs.map +1 -1
  75. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs +689 -413
  76. package/fesm2022/testgorilla-tgo-ui-components-overflow-menu.mjs.map +1 -1
  77. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs +227 -92
  78. package/fesm2022/testgorilla-tgo-ui-components-page-header.mjs.map +1 -1
  79. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs +174 -113
  80. package/fesm2022/testgorilla-tgo-ui-components-paginator.mjs.map +1 -1
  81. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs +367 -165
  82. package/fesm2022/testgorilla-tgo-ui-components-password-criteria.mjs.map +1 -1
  83. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs +253 -118
  84. package/fesm2022/testgorilla-tgo-ui-components-password-strength.mjs.map +1 -1
  85. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs +730 -444
  86. package/fesm2022/testgorilla-tgo-ui-components-phone-input.mjs.map +1 -1
  87. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs +533 -221
  88. package/fesm2022/testgorilla-tgo-ui-components-popover.mjs.map +1 -1
  89. package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs +274 -76
  90. package/fesm2022/testgorilla-tgo-ui-components-popup-tip.mjs.map +1 -1
  91. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs +184 -124
  92. package/fesm2022/testgorilla-tgo-ui-components-progress-bar.mjs.map +1 -1
  93. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs +1223 -574
  94. package/fesm2022/testgorilla-tgo-ui-components-prompt.mjs.map +1 -1
  95. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs +249 -160
  96. package/fesm2022/testgorilla-tgo-ui-components-radial-progress.mjs.map +1 -1
  97. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs +447 -439
  98. package/fesm2022/testgorilla-tgo-ui-components-radio-button.mjs.map +1 -1
  99. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs +226 -150
  100. package/fesm2022/testgorilla-tgo-ui-components-rating.mjs.map +1 -1
  101. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs +255 -67
  102. package/fesm2022/testgorilla-tgo-ui-components-scale-table.mjs.map +1 -1
  103. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs +205 -162
  104. package/fesm2022/testgorilla-tgo-ui-components-scale.mjs.map +1 -1
  105. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs +245 -153
  106. package/fesm2022/testgorilla-tgo-ui-components-segmented-bar.mjs.map +1 -1
  107. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs +274 -140
  108. package/fesm2022/testgorilla-tgo-ui-components-segmented-button.mjs.map +1 -1
  109. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs +319 -147
  110. package/fesm2022/testgorilla-tgo-ui-components-segmented-toggle.mjs.map +1 -1
  111. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs +286 -84
  112. package/fesm2022/testgorilla-tgo-ui-components-selectable-card.mjs.map +1 -1
  113. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs +660 -208
  114. package/fesm2022/testgorilla-tgo-ui-components-side-navigation.mjs.map +1 -1
  115. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs +579 -320
  116. package/fesm2022/testgorilla-tgo-ui-components-side-panel.mjs.map +1 -1
  117. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs +419 -200
  118. package/fesm2022/testgorilla-tgo-ui-components-side-sheet.mjs.map +1 -1
  119. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs +132 -80
  120. package/fesm2022/testgorilla-tgo-ui-components-skeleton.mjs.map +1 -1
  121. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs +741 -390
  122. package/fesm2022/testgorilla-tgo-ui-components-slider.mjs.map +1 -1
  123. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs +455 -329
  124. package/fesm2022/testgorilla-tgo-ui-components-snackbar.mjs.map +1 -1
  125. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs +543 -514
  126. package/fesm2022/testgorilla-tgo-ui-components-spider-chart.mjs.map +1 -1
  127. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs +193 -104
  128. package/fesm2022/testgorilla-tgo-ui-components-spinner.mjs.map +1 -1
  129. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs +760 -524
  130. package/fesm2022/testgorilla-tgo-ui-components-stepper.mjs.map +1 -1
  131. package/fesm2022/testgorilla-tgo-ui-components-table.mjs +714 -415
  132. package/fesm2022/testgorilla-tgo-ui-components-table.mjs.map +1 -1
  133. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs +847 -438
  134. package/fesm2022/testgorilla-tgo-ui-components-tabs.mjs.map +1 -1
  135. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs +535 -275
  136. package/fesm2022/testgorilla-tgo-ui-components-tag.mjs.map +1 -1
  137. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs +316 -246
  138. package/fesm2022/testgorilla-tgo-ui-components-toggle.mjs.map +1 -1
  139. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs +404 -284
  140. package/fesm2022/testgorilla-tgo-ui-components-tooltip.mjs.map +1 -1
  141. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs +664 -383
  142. package/fesm2022/testgorilla-tgo-ui-components-universal-skills.mjs.map +1 -1
  143. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs +201 -112
  144. package/fesm2022/testgorilla-tgo-ui-components-validation-error.mjs.map +1 -1
  145. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs +1014 -458
  146. package/fesm2022/testgorilla-tgo-ui-components-write-with-ai.mjs.map +1 -1
  147. package/fesm2022/testgorilla-tgo-ui.mjs +147 -155
  148. package/fesm2022/testgorilla-tgo-ui.mjs.map +1 -1
  149. package/mcp/catalog.json +1 -1
  150. package/package.json +16 -17
  151. package/projects/tgo-canopy-ui/theme/_palette.scss +23 -18
  152. package/types/testgorilla-tgo-ui-components-accordion.d.ts +214 -158
  153. package/types/testgorilla-tgo-ui-components-ai-audio-circle.d.ts +93 -69
  154. package/types/testgorilla-tgo-ui-components-ai-caveat.d.ts +37 -34
  155. package/types/testgorilla-tgo-ui-components-ai-feedback.d.ts +126 -86
  156. package/types/testgorilla-tgo-ui-components-alert-banner.d.ts +260 -185
  157. package/types/testgorilla-tgo-ui-components-audio-waveform.d.ts +96 -67
  158. package/types/testgorilla-tgo-ui-components-autocomplete-v2.d.ts +455 -256
  159. package/types/testgorilla-tgo-ui-components-autocomplete.d.ts +545 -390
  160. package/types/testgorilla-tgo-ui-components-avatar.d.ts +128 -102
  161. package/types/testgorilla-tgo-ui-components-badge.d.ts +191 -139
  162. package/types/testgorilla-tgo-ui-components-breadcrumb.d.ts +100 -62
  163. package/types/testgorilla-tgo-ui-components-button.d.ts +479 -340
  164. package/types/testgorilla-tgo-ui-components-card.d.ts +153 -114
  165. package/types/testgorilla-tgo-ui-components-checkbox.d.ts +299 -223
  166. package/types/testgorilla-tgo-ui-components-checklist.d.ts +149 -97
  167. package/types/testgorilla-tgo-ui-components-core.d.ts +307 -295
  168. package/types/testgorilla-tgo-ui-components-datepicker.d.ts +404 -299
  169. package/types/testgorilla-tgo-ui-components-device-control.d.ts +151 -81
  170. package/types/testgorilla-tgo-ui-components-dialog.d.ts +442 -329
  171. package/types/testgorilla-tgo-ui-components-divider.d.ts +64 -51
  172. package/types/testgorilla-tgo-ui-components-donut-chart.d.ts +41 -37
  173. package/types/testgorilla-tgo-ui-components-dropdown.d.ts +335 -241
  174. package/types/testgorilla-tgo-ui-components-elevation-shadow.d.ts +48 -43
  175. package/types/testgorilla-tgo-ui-components-empty-state.d.ts +317 -215
  176. package/types/testgorilla-tgo-ui-components-field.d.ts +559 -388
  177. package/types/testgorilla-tgo-ui-components-file-upload.d.ts +230 -168
  178. package/types/testgorilla-tgo-ui-components-filter-button.d.ts +263 -206
  179. package/types/testgorilla-tgo-ui-components-gaussian-chart.d.ts +107 -94
  180. package/types/testgorilla-tgo-ui-components-icon-label.d.ts +84 -61
  181. package/types/testgorilla-tgo-ui-components-icon.d.ts +137 -110
  182. package/types/testgorilla-tgo-ui-components-infinite-scroll-table.d.ts +429 -303
  183. package/types/testgorilla-tgo-ui-components-inline-field.d.ts +338 -254
  184. package/types/testgorilla-tgo-ui-components-logo.d.ts +119 -101
  185. package/types/testgorilla-tgo-ui-components-media-card.d.ts +51 -35
  186. package/types/testgorilla-tgo-ui-components-media-dialog.d.ts +40 -45
  187. package/types/testgorilla-tgo-ui-components-multi-input.d.ts +283 -194
  188. package/types/testgorilla-tgo-ui-components-navbar.d.ts +326 -208
  189. package/types/testgorilla-tgo-ui-components-overflow-menu.d.ts +276 -204
  190. package/types/testgorilla-tgo-ui-components-page-header.d.ts +67 -50
  191. package/types/testgorilla-tgo-ui-components-paginator.d.ts +103 -70
  192. package/types/testgorilla-tgo-ui-components-password-criteria.d.ts +67 -58
  193. package/types/testgorilla-tgo-ui-components-password-strength.d.ts +66 -57
  194. package/types/testgorilla-tgo-ui-components-phone-input.d.ts +217 -175
  195. package/types/testgorilla-tgo-ui-components-popover.d.ts +94 -53
  196. package/types/testgorilla-tgo-ui-components-popup-tip.d.ts +81 -44
  197. package/types/testgorilla-tgo-ui-components-progress-bar.d.ts +115 -84
  198. package/types/testgorilla-tgo-ui-components-prompt.d.ts +315 -219
  199. package/types/testgorilla-tgo-ui-components-radial-progress.d.ts +146 -107
  200. package/types/testgorilla-tgo-ui-components-radio-button.d.ts +296 -219
  201. package/types/testgorilla-tgo-ui-components-rating.d.ts +134 -95
  202. package/types/testgorilla-tgo-ui-components-scale-table.d.ts +67 -47
  203. package/types/testgorilla-tgo-ui-components-scale.d.ts +91 -66
  204. package/types/testgorilla-tgo-ui-components-segmented-bar.d.ts +118 -89
  205. package/types/testgorilla-tgo-ui-components-segmented-button.d.ts +107 -80
  206. package/types/testgorilla-tgo-ui-components-segmented-toggle.d.ts +138 -105
  207. package/types/testgorilla-tgo-ui-components-selectable-card.d.ts +90 -56
  208. package/types/testgorilla-tgo-ui-components-side-navigation.d.ts +183 -107
  209. package/types/testgorilla-tgo-ui-components-side-panel.d.ts +156 -145
  210. package/types/testgorilla-tgo-ui-components-side-sheet.d.ts +98 -89
  211. package/types/testgorilla-tgo-ui-components-skeleton.d.ts +50 -33
  212. package/types/testgorilla-tgo-ui-components-slider.d.ts +278 -198
  213. package/types/testgorilla-tgo-ui-components-snackbar.d.ts +211 -159
  214. package/types/testgorilla-tgo-ui-components-spider-chart.d.ts +140 -121
  215. package/types/testgorilla-tgo-ui-components-spinner.d.ts +93 -72
  216. package/types/testgorilla-tgo-ui-components-stepper.d.ts +480 -338
  217. package/types/testgorilla-tgo-ui-components-table.d.ts +280 -233
  218. package/types/testgorilla-tgo-ui-components-tabs.d.ts +282 -183
  219. package/types/testgorilla-tgo-ui-components-tag.d.ts +266 -193
  220. package/types/testgorilla-tgo-ui-components-toggle.d.ts +180 -132
  221. package/types/testgorilla-tgo-ui-components-tooltip.d.ts +142 -105
  222. package/types/testgorilla-tgo-ui-components-universal-skills.d.ts +165 -144
  223. package/types/testgorilla-tgo-ui-components-validation-error.d.ts +70 -51
  224. package/types/testgorilla-tgo-ui-components-write-with-ai.d.ts +210 -133
  225. package/types/testgorilla-tgo-ui.d.ts +52 -45
@@ -1,459 +1,1015 @@
1
- import { AsyncPipe } from '@angular/common';
2
- import * as i0 from '@angular/core';
3
- import { Injectable, input, booleanAttribute, output, inject, DestroyRef, signal, viewChild, computed, effect, untracked, afterRenderEffect, forwardRef, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
4
- import { toSignal, takeUntilDestroyed } from '@angular/core/rxjs-interop';
5
- import * as i1$1 from '@angular/forms';
6
- import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
7
- import { map, of, delay, Subject, combineLatest, takeUntil } from 'rxjs';
8
- import * as i6 from '@testgorilla/tgo-ui/components/ai-caveat';
9
- import { AiCaveatComponentModule } from '@testgorilla/tgo-ui/components/ai-caveat';
10
- import * as i7 from '@testgorilla/tgo-ui/components/alert-banner';
11
- import { AlertBannerComponentModule } from '@testgorilla/tgo-ui/components/alert-banner';
12
- import * as i3 from '@testgorilla/tgo-ui/components/button';
13
- import { ButtonComponentModule } from '@testgorilla/tgo-ui/components/button';
14
- import { UiTranslatePipe } from '@testgorilla/tgo-ui/components/core';
15
- import * as i2 from '@testgorilla/tgo-ui/components/field';
16
- import { FieldComponentModule } from '@testgorilla/tgo-ui/components/field';
17
- import * as i4 from '@testgorilla/tgo-ui/components/icon';
18
- import { IconComponentModule } from '@testgorilla/tgo-ui/components/icon';
19
- import * as i5 from '@testgorilla/tgo-ui/components/prompt';
20
- import { PromptModule } from '@testgorilla/tgo-ui/components/prompt';
21
- import * as i8 from '@testgorilla/tgo-ui/components/tag';
22
- import { TagComponentModule } from '@testgorilla/tgo-ui/components/tag';
23
- import * as i1 from '@angular/common/http';
24
- import { HttpHeaders, HttpParams } from '@angular/common/http';
25
-
26
- const OPENAI_DEFAULT_ENDPOINT = 'https://api.openai.com/v1/chat/completions';
27
- const OPENAI_DEFAULT_MODEL = 'gpt-5-mini';
28
- const GEMINI_DEFAULT_MODEL = 'gemini-3.0-flash';
29
- class WriteWithAiLlmService {
30
- constructor(http) {
31
- this.http = http;
32
- }
33
- generate(request, config) {
34
- if (!config.apiKey) {
35
- return this.simulateResponse(request, config);
36
- }
37
- if (config.provider === 'gemini') {
38
- return this.callGemini(request, config);
39
- }
40
- return this.callOpenAi(request, config);
41
- }
42
- resolveEndpoint(config) {
43
- return config.endpoint ?? config.baseUrl ?? OPENAI_DEFAULT_ENDPOINT;
44
- }
45
- callOpenAi(request, config) {
46
- const endpoint = this.resolveEndpoint(config);
47
- const model = config.model ?? OPENAI_DEFAULT_MODEL;
48
- const systemMessage = this.buildSystemMessage(request.sourceText, request.context ?? config.context);
49
- const body = {
50
- model,
51
- messages: [
52
- { role: 'system', content: systemMessage },
53
- { role: 'user', content: request.prompt },
54
- ],
55
- };
56
- const headers = new HttpHeaders({
57
- 'Content-Type': 'application/json',
58
- Authorization: `Bearer ${config.apiKey}`,
59
- });
60
- return this.http
61
- .post(endpoint, body, { headers })
62
- .pipe(map(res => res.choices[0]?.message?.content ?? ''));
63
- }
64
- callGemini(request, config) {
65
- const model = config.model ?? GEMINI_DEFAULT_MODEL;
66
- const baseUrl = config.endpoint ??
67
- config.baseUrl ??
68
- `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent`;
69
- const systemMessage = this.buildSystemMessage(request.sourceText, request.context ?? config.context);
70
- const body = {
71
- system_instruction: { parts: [{ text: systemMessage }] },
72
- contents: [{ role: 'user', parts: [{ text: request.prompt }] }],
73
- };
74
- const apiKey = config.apiKey;
75
- if (!apiKey) {
76
- return this.simulateResponse(request, config);
77
- }
78
- const headers = new HttpHeaders({ 'Content-Type': 'application/json' });
79
- const params = new HttpParams().set('key', apiKey);
80
- return this.http
81
- .post(baseUrl, body, { headers, params })
82
- .pipe(map(res => res.candidates?.[0]?.content?.parts?.[0]?.text ?? ''));
83
- }
84
- simulateResponse(request, _config) {
85
- const source = request.sourceText?.trim();
86
- const prompt = request.prompt?.trim();
87
- let response;
88
- if (source && prompt) {
89
- const truncated = source.length > 200 ? `${source.substring(0, 200)}…` : source;
90
- response =
91
- `Based on the following text:\n\n"${truncated}"\n\n` +
92
- `Here is the result for "${prompt}":\n\n${this.generatePlaceholderContent(prompt, source)}`;
93
- }
94
- else if (prompt) {
95
- response = this.generatePlaceholderContent(prompt, '');
96
- }
97
- else {
98
- response = 'Please provide a prompt describing what you would like me to write.';
99
- }
100
- return of(response).pipe(delay(1200));
101
- }
102
- generatePlaceholderContent(prompt, source) {
103
- const lower = prompt.toLowerCase();
104
- if (lower.includes('shorter') || lower.includes('concise') || lower.includes('summarize')) {
105
- const sentences = source.split(/[.!?]+/).filter(s => s.trim());
106
- if (sentences.length > 1) {
107
- return `${sentences
108
- .slice(0, Math.ceil(sentences.length / 2))
109
- .join('. ')
110
- .trim()}.`;
111
- }
112
- return `${source.substring(0, Math.ceil(source.length * 0.6)).trim()}…`;
113
- }
114
- if (lower.includes('formal') || lower.includes('professional') || lower.includes('tone')) {
115
- return `Dear Recipient,\n\nI hope this message finds you well. ${source || 'I am writing to follow up on our recent discussion.'}\n\nPlease do not hesitate to reach out should you require further information.\n\nBest regards`;
116
- }
117
- if (lower.includes('email') || lower.includes('draft') || lower.includes('write')) {
118
- return `Subject: Follow-up\n\nHi there,\n\n${source || 'Thank you for your time. I wanted to reach out regarding the next steps.'}\n\nLooking forward to hearing from you.\n\nBest regards`;
119
- }
120
- return `[Simulated LLM response]\n\nPrompt: ${prompt}\n\nThis is a simulated response. To enable real LLM calls, provide an apiKey in the llmConfig input. The service supports OpenAI-compatible and Gemini endpoints.`;
121
- }
122
- buildSystemMessage(sourceText, context) {
123
- const parts = [];
124
- if (context) {
125
- parts.push(context);
126
- }
127
- if (sourceText) {
128
- parts.push(`The user is working with the following source text:\n\n"""${sourceText}"""`);
129
- }
130
- parts.push('Respond with only the requested content. Do not include explanations or preamble.');
131
- return parts.join('\n\n');
132
- }
133
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiLlmService, deps: [{ token: i1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable }); }
134
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiLlmService, providedIn: 'root' }); }
135
- }
136
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiLlmService, decorators: [{
137
- type: Injectable,
138
- args: [{ providedIn: 'root' }]
139
- }], ctorParameters: () => [{ type: i1.HttpClient }] });
140
-
141
- class WriteWithAiComponent {
142
- constructor() {
143
- this.value = input('', ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
144
- this.standalone = input(false, ...(ngDevMode ? [{ debugName: "standalone" }] : /* istanbul ignore next */ []));
145
- this.defaultOpen = input(false, ...(ngDevMode ? [{ debugName: "defaultOpen" }] : /* istanbul ignore next */ []));
146
- this.fieldLabel = input('', ...(ngDevMode ? [{ debugName: "fieldLabel" }] : /* istanbul ignore next */ []));
147
- this.header = input('', ...(ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []));
148
- this.placeholder = input('', ...(ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []));
149
- this.promptValue = input('', ...(ngDevMode ? [{ debugName: "promptValue" }] : /* istanbul ignore next */ []));
150
- this.tags = input([], ...(ngDevMode ? [{ debugName: "tags" }] : /* istanbul ignore next */ []));
151
- this.status = input('idle', ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
152
- this.subheader = input(undefined, ...(ngDevMode ? [{ debugName: "subheader" }] : /* istanbul ignore next */ []));
153
- this.llmConfig = input(undefined, ...(ngDevMode ? [{ debugName: "llmConfig" }] : /* istanbul ignore next */ []));
154
- /** Layout: make the inner field stretch to fill its container height. */
155
- this.fullHeight = input(false, ...(ngDevMode ? [{ debugName: "fullHeight" }] : /* istanbul ignore next */ []));
156
- /** Layout: render the inner field without a visible border. */
157
- this.borderless = input(false, ...(ngDevMode ? [{ debugName: "borderless" }] : /* istanbul ignore next */ []));
158
- /**
159
- * When true, hides the free-text `ui-prompt` and renders the `tags` chips on their own.
160
- * Clicking a chip submits its label as the prompt via `promptSubmit`.
161
- * Use this when the host backend only accepts a constrained set of prompts (e.g. an enum).
162
- */
163
- this.tagsOnly = input(false, { ...(ngDevMode ? { debugName: "tagsOnly" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
164
- /** Opaque host metadata emitted with promptSubmit for backend integrations. */
165
- this.metadata = input({}, ...(ngDevMode ? [{ debugName: "metadata" }] : /* istanbul ignore next */ []));
166
- this.valueChange = output();
167
- this.promptChange = output();
168
- this.promptSubmit = output();
169
- this.cancelPending = output();
170
- this.acceptResult = output();
171
- this.requestRefine = output();
172
- this.destroyRef = inject(DestroyRef);
173
- this.llmService = inject(WriteWithAiLlmService);
174
- this.uiTranslate = inject(UiTranslatePipe);
175
- this.promptModel = signal('', ...(ngDevMode ? [{ debugName: "promptModel" }] : /* istanbul ignore next */ []));
176
- this.isPanelManuallyOpen = signal(false, ...(ngDevMode ? [{ debugName: "isPanelManuallyOpen" }] : /* istanbul ignore next */ []));
177
- this.internalStatus = signal('idle', ...(ngDevMode ? [{ debugName: "internalStatus" }] : /* istanbul ignore next */ []));
178
- this.internalValue = signal('', ...(ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []));
179
- this.cancelRequest$ = new Subject();
180
- /** ControlValueAccessor: whether the form control is disabled. */
181
- this.cvaDisabled = signal(false, ...(ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []));
182
- /** Tag carousel (tagsOnly mode): scroll container + arrow-enabled state. */
183
- this.tagsScrollRef = viewChild('tagsScrollContainer', ...(ngDevMode ? [{ debugName: "tagsScrollRef" }] : /* istanbul ignore next */ []));
184
- this.canScrollTagsLeft = signal(false, ...(ngDevMode ? [{ debugName: "canScrollTagsLeft" }] : /* istanbul ignore next */ []));
185
- this.canScrollTagsRight = signal(false, ...(ngDevMode ? [{ debugName: "canScrollTagsRight" }] : /* istanbul ignore next */ []));
186
- /** ControlValueAccessor callbacks. */
187
- this.onChange = () => { };
188
- this.onTouched = () => { };
189
- this.translationContext = 'WRITE_WITH_AI.';
190
- this.labels = toSignal(combineLatest([
191
- this.uiTranslate.transform(`${this.translationContext}CANCEL`),
192
- this.uiTranslate.transform(`${this.translationContext}ACCEPT`),
193
- this.uiTranslate.transform(`${this.translationContext}MAKE_CHANGES`),
194
- this.uiTranslate.transform(`${this.translationContext}TRY_AGAIN`),
195
- ]).pipe(map(([cancel, accept, makeChanges, tryAgain]) => ({ cancel, accept, makeChanges, tryAgain }))), { initialValue: { cancel: '', accept: '', makeChanges: '', tryAgain: '' } });
196
- this.isDefaultMode = computed(() => this.llmConfig()?.default === true, ...(ngDevMode ? [{ debugName: "isDefaultMode" }] : /* istanbul ignore next */ []));
197
- this.effectiveStatus = computed(() => (this.isDefaultMode() ? this.internalStatus() : this.status()), ...(ngDevMode ? [{ debugName: "effectiveStatus" }] : /* istanbul ignore next */ []));
198
- this.effectiveValue = computed(() => (this.isDefaultMode() ? this.internalValue() : this.value()), ...(ngDevMode ? [{ debugName: "effectiveValue" }] : /* istanbul ignore next */ []));
199
- this.isPanelVisible = computed(() => this.standalone() || this.isPanelManuallyOpen(), ...(ngDevMode ? [{ debugName: "isPanelVisible" }] : /* istanbul ignore next */ []));
200
- this.promptTags = computed(() => this.tags().map(tag => ({ id: tag.id, label: tag.label, autocomplete: tag.description ?? '' })), ...(ngDevMode ? [{ debugName: "promptTags" }] : /* istanbul ignore next */ []));
201
- this.statusConfig = computed(() => {
202
- const l = this.labels();
203
- switch (this.effectiveStatus()) {
204
- case 'loading':
205
- return {
206
- variant: 'loading',
207
- alertType: 'info',
208
- messageKey: `${this.translationContext}WRITING`,
209
- actions: [{ label: l.cancel, onClick: () => this.handleCancel() }],
210
- };
211
- case 'success':
212
- return {
213
- variant: 'success',
214
- alertType: 'success',
215
- messageKey: `${this.translationContext}CONTENT_GENERATED`,
216
- actions: [
217
- { label: l.makeChanges, onClick: () => this.handleRefine() },
218
- { label: l.accept, onClick: () => this.handleAccept() },
219
- ],
220
- };
221
- case 'error':
222
- return {
223
- variant: 'error',
224
- alertType: 'error',
225
- messageKey: `${this.translationContext}ERROR_MESSAGE`,
226
- actions: [{ label: l.tryAgain, onClick: () => this.handleRefine() }],
227
- };
228
- case 'idle':
229
- return null;
230
- default:
231
- return null;
232
- }
233
- }, ...(ngDevMode ? [{ debugName: "statusConfig" }] : /* istanbul ignore next */ []));
234
- this.promptModelData = computed(() => ({ text: this.promptModel(), files: [] }), ...(ngDevMode ? [{ debugName: "promptModelData" }] : /* istanbul ignore next */ []));
235
- effect(() => {
236
- const promptValue = this.promptValue();
237
- const isDefault = this.isDefaultMode();
238
- if (!isDefault) {
239
- untracked(() => this.promptModel.set(promptValue));
240
- }
241
- });
242
- effect(() => {
243
- const value = this.value();
244
- const isDefault = this.isDefaultMode();
245
- if (isDefault) {
246
- untracked(() => this.internalValue.set(value));
247
- }
248
- });
249
- // Scroll events don't trigger change detection, so the arrow disabled-state
250
- // is kept in signals. This re-measures whenever the carousel (re)mounts or
251
- // the tag set changes; runtime scrolling is handled by the (scroll) listener.
252
- // It only reads layout, so it runs in the dedicated `read` phase.
253
- afterRenderEffect({
254
- read: () => {
255
- this.tags();
256
- const el = this.tagsScrollRef()?.nativeElement;
257
- if (el) {
258
- this.measureTagScroll(el);
259
- }
260
- },
261
- });
262
- // Resizing the host can change overflow without a scroll or tag-set change,
263
- // so observe the carousel and re-measure when its box changes.
264
- effect(onCleanup => {
265
- const el = this.tagsScrollRef()?.nativeElement;
266
- if (!el || typeof ResizeObserver === 'undefined') {
267
- return;
268
- }
269
- const observer = new ResizeObserver(() => this.measureTagScroll(el));
270
- observer.observe(el);
271
- onCleanup(() => observer.disconnect());
272
- });
273
- }
274
- handlePromptModelChange(value) {
275
- const text = typeof value === 'string' ? value : (value?.text ?? '');
276
- this.promptModel.set(text);
277
- this.promptChange.emit(text);
278
- }
279
- ngOnInit() {
280
- if (this.defaultOpen()) {
281
- this.isPanelManuallyOpen.set(true);
282
- }
283
- }
284
- togglePanel() {
285
- if (this.standalone()) {
286
- return;
287
- }
288
- this.isPanelManuallyOpen.update(current => !current);
289
- }
290
- handleValueInput(value) {
291
- if (this.isDefaultMode()) {
292
- this.internalValue.set(value);
293
- }
294
- this.valueChange.emit(value);
295
- this.onChange(value);
296
- this.onTouched();
297
- }
298
- handlePromptSubmit(promptData) {
299
- const prompt = typeof promptData === 'string' ? promptData : (promptData?.text ?? this.promptModel());
300
- this.promptModel.set(prompt);
301
- this.promptChange.emit(prompt);
302
- const submitEvent = {
303
- prompt,
304
- content: this.effectiveValue(),
305
- metadata: this.metadata(),
306
- };
307
- if (this.isDefaultMode()) {
308
- this.executeDefaultFlow(prompt);
309
- }
310
- this.promptSubmit.emit(submitEvent);
311
- }
312
- handleTagClick(tag) {
313
- // ui-tag's press fires even when isDisabled, so guard here.
314
- if (this.cvaDisabled()) {
315
- return;
316
- }
317
- this.handlePromptSubmit(tag.label);
318
- }
319
- measureTagScroll(el) {
320
- this.canScrollTagsLeft.set(el.scrollLeft > 0);
321
- this.canScrollTagsRight.set(Math.ceil(el.scrollLeft + el.clientWidth) < el.scrollWidth);
322
- }
323
- scrollTags(el, direction) {
324
- el.scrollBy({ left: direction * el.clientWidth * 0.8, behavior: 'smooth' });
325
- }
326
- handlePrimaryAction() {
327
- const status = this.effectiveStatus();
328
- if (status === 'loading') {
329
- this.handleCancel();
330
- }
331
- else if (status === 'success') {
332
- this.handleAccept();
333
- }
334
- else if (status === 'error') {
335
- this.handleRefine();
336
- }
337
- }
338
- handleSecondaryAction() {
339
- if (this.effectiveStatus() === 'success') {
340
- this.handleRefine();
341
- }
342
- }
343
- // --- ControlValueAccessor ---
344
- writeValue(value) {
345
- const v = value ?? '';
346
- if (this.isDefaultMode()) {
347
- this.internalValue.set(v);
348
- }
349
- // For integration mode the host uses the [value] input directly,
350
- // but we still keep internal state in sync for CVA consumers.
351
- this.internalValue.set(v);
352
- }
353
- registerOnChange(fn) {
354
- this.onChange = fn;
355
- }
356
- registerOnTouched(fn) {
357
- this.onTouched = fn;
358
- }
359
- setDisabledState(isDisabled) {
360
- this.cvaDisabled.set(isDisabled);
361
- }
362
- // --- Private helpers ---
363
- executeDefaultFlow(prompt) {
364
- const config = this.llmConfig();
365
- if (!config) {
366
- return;
367
- }
368
- this.cancelRequest$.next();
369
- this.internalStatus.set('loading');
370
- this.llmService
371
- .generate({ sourceText: this.effectiveValue(), prompt, context: config.context }, config)
372
- .pipe(takeUntilDestroyed(this.destroyRef), takeUntil(this.cancelRequest$))
373
- .subscribe({
374
- next: result => {
375
- this.internalValue.set(result);
376
- this.valueChange.emit(result);
377
- this.onChange(result);
378
- this.internalStatus.set('success');
379
- },
380
- error: () => {
381
- this.internalStatus.set('error');
382
- },
383
- });
384
- }
385
- handleCancel() {
386
- if (this.isDefaultMode()) {
387
- this.cancelRequest$.next();
388
- this.internalStatus.set('idle');
389
- }
390
- this.cancelPending.emit();
391
- }
392
- handleAccept() {
393
- if (this.isDefaultMode()) {
394
- this.internalStatus.set('idle');
395
- this.promptModel.set('');
396
- }
397
- if (!this.standalone()) {
398
- this.isPanelManuallyOpen.set(false);
399
- }
400
- this.acceptResult.emit();
401
- }
402
- handleRefine() {
403
- if (this.isDefaultMode()) {
404
- this.internalStatus.set('idle');
405
- }
406
- this.requestRefine.emit();
407
- }
408
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
409
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.25", type: WriteWithAiComponent, isStandalone: true, selector: "ui-write-with-ai", inputs: { value: { classPropertyName: "value", publicName: "value", isSignal: true, isRequired: false, transformFunction: null }, standalone: { classPropertyName: "standalone", publicName: "standalone", isSignal: true, isRequired: false, transformFunction: null }, defaultOpen: { classPropertyName: "defaultOpen", publicName: "defaultOpen", isSignal: true, isRequired: false, transformFunction: null }, fieldLabel: { classPropertyName: "fieldLabel", publicName: "fieldLabel", isSignal: true, isRequired: false, transformFunction: null }, header: { classPropertyName: "header", publicName: "header", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, promptValue: { classPropertyName: "promptValue", publicName: "promptValue", isSignal: true, isRequired: false, transformFunction: null }, tags: { classPropertyName: "tags", publicName: "tags", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, subheader: { classPropertyName: "subheader", publicName: "subheader", isSignal: true, isRequired: false, transformFunction: null }, llmConfig: { classPropertyName: "llmConfig", publicName: "llmConfig", isSignal: true, isRequired: false, transformFunction: null }, fullHeight: { classPropertyName: "fullHeight", publicName: "fullHeight", isSignal: true, isRequired: false, transformFunction: null }, borderless: { classPropertyName: "borderless", publicName: "borderless", isSignal: true, isRequired: false, transformFunction: null }, tagsOnly: { classPropertyName: "tagsOnly", publicName: "tagsOnly", isSignal: true, isRequired: false, transformFunction: null }, metadata: { classPropertyName: "metadata", publicName: "metadata", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", promptChange: "promptChange", promptSubmit: "promptSubmit", cancelPending: "cancelPending", acceptResult: "acceptResult", requestRefine: "requestRefine" }, host: { styleAttribute: "display: block" }, providers: [
410
- UiTranslatePipe,
411
- {
412
- provide: NG_VALUE_ACCESSOR,
413
- useExisting: forwardRef(() => WriteWithAiComponent),
414
- multi: true,
415
- },
416
- ], viewQueries: [{ propertyName: "tagsScrollRef", first: true, predicate: ["tagsScrollContainer"], descendants: true, isSignal: true }], ngImport: i0, template: "<div\n class=\"write-with-ai\"\n [class.write-with-ai--standalone]=\"standalone()\"\n [class.write-with-ai--full-height]=\"fullHeight()\"\n>\n @if (!standalone()) {\n <div class=\"write-with-ai__host\">\n <ui-field\n [label]=\"fieldLabel() || (translationContext + 'FIELD_LABEL' | uiTranslate | async)!\"\n type=\"textarea\"\n [showBottomContent]=\"false\"\n [fullHeight]=\"fullHeight()\"\n [borderless]=\"borderless()\"\n [disabled]=\"cvaDisabled()\"\n [ngModel]=\"effectiveValue()\"\n (ngModelChange)=\"handleValueInput($event)\"\n ></ui-field>\n <ui-button\n class=\"write-with-ai__cta\"\n variant=\"ghost-ai\"\n size=\"small\"\n [label]=\"(translationContext + 'AI_ASSIST' | uiTranslate | async)!\"\n iconName=\"Sparkle-in-line\"\n iconPosition=\"left\"\n [disabled]=\"isPanelVisible() || cvaDisabled()\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n </div>\n }\n\n @if (isPanelVisible()) {\n <section\n class=\"write-with-ai__panel\"\n [class.write-with-ai__panel--loading]=\"effectiveStatus() === 'loading'\"\n role=\"region\"\n [attr.aria-label]=\"(translationContext + 'AI_WRITING_ASSISTANT' | uiTranslate | async)!\"\n >\n <header class=\"write-with-ai__panel-header\">\n <div class=\"write-with-ai__panel-heading\">\n <div class=\"write-with-ai__title-row\">\n @if (effectiveStatus() !== 'loading') {\n <ui-icon class=\"write-with-ai__title-icon\" name=\"Sparkle-in-line\" color=\"ai\"></ui-icon>\n }\n <h4 class=\"write-with-ai__title\">\n {{ header() || (translationContext + 'HEADER' | uiTranslate | async) }}\n </h4>\n </div>\n @if (subheader()) {\n <p class=\"write-with-ai__subheader\">{{ subheader() }}</p>\n }\n </div>\n @if (!standalone()) {\n <ui-button\n variant=\"icon-button\"\n iconName=\"Close\"\n size=\"small\"\n [tooltip]=\"(translationContext + 'CLOSE' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'CLOSE_AI_ASSISTANT' | uiTranslate | async)!\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n }\n </header>\n\n @if (effectiveStatus() === 'idle') {\n @if (tagsOnly()) {\n @if (tags().length) {\n <div class=\"write-with-ai__tags-prompt\">\n <div\n class=\"write-with-ai__tags-container\"\n role=\"group\"\n [attr.aria-label]=\"header() || (translationContext + 'HEADER' | uiTranslate | async)\"\n #tagsScrollContainer\n (scroll)=\"measureTagScroll(tagsScrollContainer)\"\n >\n @for (tag of tags(); track tag.id) {\n <ui-tag\n [label]=\"tag.label\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"cvaDisabled()\"\n (press)=\"handleTagClick(tag)\"\n ></ui-tag>\n }\n </div>\n <div class=\"write-with-ai__tags-arrows\">\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-left-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsLeft()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, -1)\"\n ></ui-button>\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-right-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsRight()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, 1)\"\n ></ui-button>\n </div>\n </div>\n }\n } @else {\n <div class=\"write-with-ai__prompt\">\n <ui-prompt\n [ngModel]=\"promptModelData()\"\n (ngModelChange)=\"handlePromptModelChange($event)\"\n [tags]=\"promptTags()\"\n [placeholder]=\"placeholder() || (translationContext + 'PLACEHOLDER' | uiTranslate | async)!\"\n [showSendButton]=\"true\"\n (promptData)=\"handlePromptSubmit($event)\"\n ></ui-prompt>\n </div>\n }\n }\n\n @if (statusConfig(); as cfg) {\n <ui-alert-banner\n [alertType]=\"cfg.alertType\"\n alertVariant=\"callout\"\n [message]=\"(cfg.messageKey | uiTranslate | async)!\"\n [includeDismissButton]=\"false\"\n [isLoading]=\"cfg.variant === 'loading'\"\n [hasIcon]=\"cfg.variant !== 'loading'\"\n [actions]=\"cfg.actions\"\n [isFullWidth]=\"true\"\n ></ui-alert-banner>\n }\n\n <div class=\"write-with-ai__caveat\">\n <ui-ai-caveat></ui-ai-caveat>\n </div>\n </section>\n }\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.write-with-ai{display:flex;flex-direction:column;gap:8px;padding-top:8px;max-width:100%;overflow:hidden}.write-with-ai--full-height{height:100%}.write-with-ai--full-height .write-with-ai__host{flex:1}.write-with-ai__host{position:relative;display:flex;flex-direction:column}.write-with-ai__cta{position:absolute;right:8px;bottom:8px;z-index:1;background-color:#fff;border-radius:100px}.write-with-ai__panel{border:none;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:8px;background-color:#f4f4f4}.write-with-ai__panel-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.write-with-ai__panel-heading{display:flex;flex-direction:column;gap:8px}.write-with-ai__title-row{display:flex;align-items:center;gap:8px}.write-with-ai__title{margin:0}.write-with-ai__subheader{margin:0;font-size:14px;line-height:22px;font-weight:400;color:#242424}.write-with-ai__quick-actions{display:flex;gap:8px;flex-wrap:wrap}.write-with-ai__prompt{display:flex;flex-direction:column;gap:4px}.write-with-ai__tags-prompt{display:flex;align-items:center;gap:4px;padding:8px;border:1px solid #919191;border-radius:10px;background-color:#fff}.write-with-ai__tags-container{display:flex;flex-flow:row nowrap;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.write-with-ai__tags-container::-webkit-scrollbar{display:none}.write-with-ai__tags-arrows{display:flex;align-items:center;gap:4px;flex-shrink:0}.write-with-ai__status-actions{display:flex;gap:8px;justify-content:flex-end}.write-with-ai__caveat{font-size:12px}@keyframes pulse-text{0%,to{opacity:1}50%{opacity:.5}}:host ::ng-deep .write-with-ai__host textarea{padding-bottom:48px!important}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: FieldComponentModule }, { kind: "component", type: i2.FieldComponent, selector: "ui-field", inputs: ["fullWidth", "fullHeight", "label", "labelHtml", "labelIcon", "fieldName", "placeholder", "id", "value", "badgeVariant", "errors", "disabled", "required", "readOnly", "hintMessage", "type", "updateOnBlur", "allowOnlyDigits", "isAutocompleteOff", "allowNegative", "showBottomContent", "applicationTheme", "ariaLabel", "testId", "loading", "isValid", "maxCharacters", "trimOnBlur", "trimOnSubmit", "maxRows", "hasTextAreaCounter", "hideBuiltInErrors", "hideLabelInErrors", "max", "min", "textareaHeight", "borderless", "autosizableTextarea", "isAIVariant", "ariaLabelledby", "ariaDescribedby", "hasError"], outputs: ["validateEvent", "fieldBlur"] }, { kind: "ngmodule", type: ButtonComponentModule }, { kind: "component", type: i3.ButtonComponent, selector: "ui-button", inputs: ["size", "variant", "label", "iconPosition", "justIcon", "iconName", "trailingIconName", "trailingIconFilled", "disabled", "loading", "loadingWithLabel", "fullWidth", "url", "urlTarget", "value", "tooltip", "isPremium", "type", "companyColor", "buttonBadgeConfig", "applicationTheme", "disabledScaleOnClick", "ariaLabel", "ariaExpanded", "ariaControls", "ariaPressed", "ariaRequired", "ariaLabelledby", "ariaDescribedby", "preventDefault", "hasBackground", "tooltipPosition", "role", "iconFilled", "testId"], outputs: ["buttonClickEvent", "buttonHoverEvent"] }, { kind: "ngmodule", type: IconComponentModule }, { kind: "component", type: i4.IconComponent, selector: "ui-icon", inputs: ["size", "cssClass", "name", "color", "filled", "toggleIconStyle", "applicationTheme", "useFullIconName"] }, { kind: "ngmodule", type: PromptModule }, { kind: "component", type: i5.PromptComponent, selector: "ui-prompt", inputs: ["tags", "actionTag", "secondaryActionTag", "collapseActionTags", "maxCharacters", "supportedFileTypes", "autoClear", "showSendButton", "sendButtonDisabled", "enableFileUpload", "loading", "placeholder", "errorMessage", "dropdownItems", "dropdownHeading", "showDropdownClose", "showCharacterCount", "helpText", "disabled"], outputs: ["promptData", "actionTagFileSelected", "secondaryActionTagPress", "dropdownItemSelected", "dropdownClosed"] }, { kind: "ngmodule", type: AiCaveatComponentModule }, { kind: "component", type: i6.AiCaveatComponent, selector: "ui-ai-caveat", inputs: ["applicationTheme"] }, { kind: "ngmodule", type: AlertBannerComponentModule }, { kind: "component", type: i7.AlertBannerComponent, selector: "ui-alert-banner", inputs: ["alertType", "alertVariant", "message", "includeDismissButton", "shadow", "linkText", "linkUrl", "linkTarget", "actions", "applicationTheme", "size", "isFullWidth", "closeButtonTooltip", "testId", "hasIcon", "isLoading", "fixed", "ariaDescribedby", "secondaryAlerts"], outputs: ["dismiss"] }, { kind: "ngmodule", type: TagComponentModule }, { kind: "component", type: i8.TagComponent, selector: "ui-tag", inputs: ["label", "icon", "allowClose", "readOnly", "isSelected", "showIconWhenSelected", "pinnedBackground", "constrainWidth", "isDisabled", "applicationTheme", "ariaLabel", "testId", "ariaRequired", "showBadge", "notificationsAmount"], outputs: ["isSelectedChange", "close", "press"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: UiTranslatePipe, name: "uiTranslate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
417
- }
418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiComponent, decorators: [{
419
- type: Component,
420
- args: [{ selector: 'ui-write-with-ai', changeDetection: ChangeDetectionStrategy.OnPush, host: { style: 'display: block' }, providers: [
421
- UiTranslatePipe,
422
- {
423
- provide: NG_VALUE_ACCESSOR,
424
- useExisting: forwardRef(() => WriteWithAiComponent),
425
- multi: true,
426
- },
427
- ], imports: [
428
- AsyncPipe,
429
- FormsModule,
430
- FieldComponentModule,
431
- ButtonComponentModule,
432
- IconComponentModule,
433
- PromptModule,
434
- AiCaveatComponentModule,
435
- AlertBannerComponentModule,
436
- TagComponentModule,
437
- UiTranslatePipe,
438
- ], template: "<div\n class=\"write-with-ai\"\n [class.write-with-ai--standalone]=\"standalone()\"\n [class.write-with-ai--full-height]=\"fullHeight()\"\n>\n @if (!standalone()) {\n <div class=\"write-with-ai__host\">\n <ui-field\n [label]=\"fieldLabel() || (translationContext + 'FIELD_LABEL' | uiTranslate | async)!\"\n type=\"textarea\"\n [showBottomContent]=\"false\"\n [fullHeight]=\"fullHeight()\"\n [borderless]=\"borderless()\"\n [disabled]=\"cvaDisabled()\"\n [ngModel]=\"effectiveValue()\"\n (ngModelChange)=\"handleValueInput($event)\"\n ></ui-field>\n <ui-button\n class=\"write-with-ai__cta\"\n variant=\"ghost-ai\"\n size=\"small\"\n [label]=\"(translationContext + 'AI_ASSIST' | uiTranslate | async)!\"\n iconName=\"Sparkle-in-line\"\n iconPosition=\"left\"\n [disabled]=\"isPanelVisible() || cvaDisabled()\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n </div>\n }\n\n @if (isPanelVisible()) {\n <section\n class=\"write-with-ai__panel\"\n [class.write-with-ai__panel--loading]=\"effectiveStatus() === 'loading'\"\n role=\"region\"\n [attr.aria-label]=\"(translationContext + 'AI_WRITING_ASSISTANT' | uiTranslate | async)!\"\n >\n <header class=\"write-with-ai__panel-header\">\n <div class=\"write-with-ai__panel-heading\">\n <div class=\"write-with-ai__title-row\">\n @if (effectiveStatus() !== 'loading') {\n <ui-icon class=\"write-with-ai__title-icon\" name=\"Sparkle-in-line\" color=\"ai\"></ui-icon>\n }\n <h4 class=\"write-with-ai__title\">\n {{ header() || (translationContext + 'HEADER' | uiTranslate | async) }}\n </h4>\n </div>\n @if (subheader()) {\n <p class=\"write-with-ai__subheader\">{{ subheader() }}</p>\n }\n </div>\n @if (!standalone()) {\n <ui-button\n variant=\"icon-button\"\n iconName=\"Close\"\n size=\"small\"\n [tooltip]=\"(translationContext + 'CLOSE' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'CLOSE_AI_ASSISTANT' | uiTranslate | async)!\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n }\n </header>\n\n @if (effectiveStatus() === 'idle') {\n @if (tagsOnly()) {\n @if (tags().length) {\n <div class=\"write-with-ai__tags-prompt\">\n <div\n class=\"write-with-ai__tags-container\"\n role=\"group\"\n [attr.aria-label]=\"header() || (translationContext + 'HEADER' | uiTranslate | async)\"\n #tagsScrollContainer\n (scroll)=\"measureTagScroll(tagsScrollContainer)\"\n >\n @for (tag of tags(); track tag.id) {\n <ui-tag\n [label]=\"tag.label\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"cvaDisabled()\"\n (press)=\"handleTagClick(tag)\"\n ></ui-tag>\n }\n </div>\n <div class=\"write-with-ai__tags-arrows\">\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-left-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsLeft()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, -1)\"\n ></ui-button>\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-right-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsRight()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, 1)\"\n ></ui-button>\n </div>\n </div>\n }\n } @else {\n <div class=\"write-with-ai__prompt\">\n <ui-prompt\n [ngModel]=\"promptModelData()\"\n (ngModelChange)=\"handlePromptModelChange($event)\"\n [tags]=\"promptTags()\"\n [placeholder]=\"placeholder() || (translationContext + 'PLACEHOLDER' | uiTranslate | async)!\"\n [showSendButton]=\"true\"\n (promptData)=\"handlePromptSubmit($event)\"\n ></ui-prompt>\n </div>\n }\n }\n\n @if (statusConfig(); as cfg) {\n <ui-alert-banner\n [alertType]=\"cfg.alertType\"\n alertVariant=\"callout\"\n [message]=\"(cfg.messageKey | uiTranslate | async)!\"\n [includeDismissButton]=\"false\"\n [isLoading]=\"cfg.variant === 'loading'\"\n [hasIcon]=\"cfg.variant !== 'loading'\"\n [actions]=\"cfg.actions\"\n [isFullWidth]=\"true\"\n ></ui-alert-banner>\n }\n\n <div class=\"write-with-ai__caveat\">\n <ui-ai-caveat></ui-ai-caveat>\n </div>\n </section>\n }\n</div>\n", styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.write-with-ai{display:flex;flex-direction:column;gap:8px;padding-top:8px;max-width:100%;overflow:hidden}.write-with-ai--full-height{height:100%}.write-with-ai--full-height .write-with-ai__host{flex:1}.write-with-ai__host{position:relative;display:flex;flex-direction:column}.write-with-ai__cta{position:absolute;right:8px;bottom:8px;z-index:1;background-color:#fff;border-radius:100px}.write-with-ai__panel{border:none;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:8px;background-color:#f4f4f4}.write-with-ai__panel-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.write-with-ai__panel-heading{display:flex;flex-direction:column;gap:8px}.write-with-ai__title-row{display:flex;align-items:center;gap:8px}.write-with-ai__title{margin:0}.write-with-ai__subheader{margin:0;font-size:14px;line-height:22px;font-weight:400;color:#242424}.write-with-ai__quick-actions{display:flex;gap:8px;flex-wrap:wrap}.write-with-ai__prompt{display:flex;flex-direction:column;gap:4px}.write-with-ai__tags-prompt{display:flex;align-items:center;gap:4px;padding:8px;border:1px solid #919191;border-radius:10px;background-color:#fff}.write-with-ai__tags-container{display:flex;flex-flow:row nowrap;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.write-with-ai__tags-container::-webkit-scrollbar{display:none}.write-with-ai__tags-arrows{display:flex;align-items:center;gap:4px;flex-shrink:0}.write-with-ai__status-actions{display:flex;gap:8px;justify-content:flex-end}.write-with-ai__caveat{font-size:12px}@keyframes pulse-text{0%,to{opacity:1}50%{opacity:.5}}:host ::ng-deep .write-with-ai__host textarea{padding-bottom:48px!important}\n"] }]
439
- }], ctorParameters: () => [], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], standalone: [{ type: i0.Input, args: [{ isSignal: true, alias: "standalone", required: false }] }], defaultOpen: [{ type: i0.Input, args: [{ isSignal: true, alias: "defaultOpen", required: false }] }], fieldLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "fieldLabel", required: false }] }], header: [{ type: i0.Input, args: [{ isSignal: true, alias: "header", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], promptValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "promptValue", required: false }] }], tags: [{ type: i0.Input, args: [{ isSignal: true, alias: "tags", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], subheader: [{ type: i0.Input, args: [{ isSignal: true, alias: "subheader", required: false }] }], llmConfig: [{ type: i0.Input, args: [{ isSignal: true, alias: "llmConfig", required: false }] }], fullHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "fullHeight", required: false }] }], borderless: [{ type: i0.Input, args: [{ isSignal: true, alias: "borderless", required: false }] }], tagsOnly: [{ type: i0.Input, args: [{ isSignal: true, alias: "tagsOnly", required: false }] }], metadata: [{ type: i0.Input, args: [{ isSignal: true, alias: "metadata", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], promptChange: [{ type: i0.Output, args: ["promptChange"] }], promptSubmit: [{ type: i0.Output, args: ["promptSubmit"] }], cancelPending: [{ type: i0.Output, args: ["cancelPending"] }], acceptResult: [{ type: i0.Output, args: ["acceptResult"] }], requestRefine: [{ type: i0.Output, args: ["requestRefine"] }], tagsScrollRef: [{ type: i0.ViewChild, args: ['tagsScrollContainer', { isSignal: true }] }] } });
440
-
441
- class WriteWithAiComponentModule {
442
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiComponentModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
443
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiComponentModule, imports: [WriteWithAiComponent], exports: [WriteWithAiComponent] }); }
444
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiComponentModule, imports: [WriteWithAiComponent] }); }
445
- }
446
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: WriteWithAiComponentModule, decorators: [{
447
- type: NgModule,
448
- args: [{
449
- imports: [WriteWithAiComponent],
450
- exports: [WriteWithAiComponent],
451
- }]
452
- }] });
453
-
454
- /**
455
- * Generated bundle index. Do not edit.
456
- */
457
-
1
+ import { AsyncPipe } from "@angular/common";
2
+ import * as i0 from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, DestroyRef, Injectable, NgModule, afterRenderEffect, booleanAttribute, computed, effect, forwardRef, inject, input, output, signal, untracked, viewChild } from "@angular/core";
4
+ import { takeUntilDestroyed, toSignal } from "@angular/core/rxjs-interop";
5
+ import * as i1 from "@angular/forms";
6
+ import { FormsModule, NG_VALUE_ACCESSOR } from "@angular/forms";
7
+ import { Subject, combineLatest, delay, map, of, takeUntil } from "rxjs";
8
+ import * as i6 from "@testgorilla/tgo-ui/components/ai-caveat";
9
+ import { AiCaveatComponentModule } from "@testgorilla/tgo-ui/components/ai-caveat";
10
+ import * as i7 from "@testgorilla/tgo-ui/components/alert-banner";
11
+ import { AlertBannerComponentModule } from "@testgorilla/tgo-ui/components/alert-banner";
12
+ import * as i3 from "@testgorilla/tgo-ui/components/button";
13
+ import { ButtonComponentModule } from "@testgorilla/tgo-ui/components/button";
14
+ import { UiTranslatePipe } from "@testgorilla/tgo-ui/components/core";
15
+ import * as i2 from "@testgorilla/tgo-ui/components/field";
16
+ import { FieldComponentModule } from "@testgorilla/tgo-ui/components/field";
17
+ import * as i4 from "@testgorilla/tgo-ui/components/icon";
18
+ import { IconComponentModule } from "@testgorilla/tgo-ui/components/icon";
19
+ import * as i5 from "@testgorilla/tgo-ui/components/prompt";
20
+ import { PromptModule } from "@testgorilla/tgo-ui/components/prompt";
21
+ import * as i8 from "@testgorilla/tgo-ui/components/tag";
22
+ import { TagComponentModule } from "@testgorilla/tgo-ui/components/tag";
23
+ import * as i1$1 from "@angular/common/http";
24
+ import { HttpHeaders, HttpParams } from "@angular/common/http";
25
+ const OPENAI_DEFAULT_ENDPOINT = "https://api.openai.com/v1/chat/completions";
26
+ const OPENAI_DEFAULT_MODEL = "gpt-5-mini";
27
+ const GEMINI_DEFAULT_MODEL = "gemini-3.0-flash";
28
+ var WriteWithAiLlmService = class WriteWithAiLlmService {
29
+ constructor(http) {
30
+ this.http = http;
31
+ }
32
+ generate(request, config) {
33
+ if (!config.apiKey) return this.simulateResponse(request, config);
34
+ if (config.provider === "gemini") return this.callGemini(request, config);
35
+ return this.callOpenAi(request, config);
36
+ }
37
+ resolveEndpoint(config) {
38
+ return config.endpoint ?? config.baseUrl ?? OPENAI_DEFAULT_ENDPOINT;
39
+ }
40
+ callOpenAi(request, config) {
41
+ const endpoint = this.resolveEndpoint(config);
42
+ const body = {
43
+ model: config.model ?? OPENAI_DEFAULT_MODEL,
44
+ messages: [{
45
+ role: "system",
46
+ content: this.buildSystemMessage(request.sourceText, request.context ?? config.context)
47
+ }, {
48
+ role: "user",
49
+ content: request.prompt
50
+ }]
51
+ };
52
+ const headers = new HttpHeaders({
53
+ "Content-Type": "application/json",
54
+ Authorization: `Bearer ${config.apiKey}`
55
+ });
56
+ return this.http.post(endpoint, body, { headers }).pipe(map((res) => res.choices[0]?.message?.content ?? ""));
57
+ }
58
+ callGemini(request, config) {
59
+ const model = config.model ?? GEMINI_DEFAULT_MODEL;
60
+ const baseUrl = config.endpoint ?? config.baseUrl ?? `https://generativelanguage.googleapis.com/v1beta/models/${model}:generateContent`;
61
+ const body = {
62
+ system_instruction: { parts: [{ text: this.buildSystemMessage(request.sourceText, request.context ?? config.context) }] },
63
+ contents: [{
64
+ role: "user",
65
+ parts: [{ text: request.prompt }]
66
+ }]
67
+ };
68
+ const apiKey = config.apiKey;
69
+ if (!apiKey) return this.simulateResponse(request, config);
70
+ const headers = new HttpHeaders({ "Content-Type": "application/json" });
71
+ const params = new HttpParams().set("key", apiKey);
72
+ return this.http.post(baseUrl, body, {
73
+ headers,
74
+ params
75
+ }).pipe(map((res) => res.candidates?.[0]?.content?.parts?.[0]?.text ?? ""));
76
+ }
77
+ simulateResponse(request, _config) {
78
+ const source = request.sourceText?.trim();
79
+ const prompt = request.prompt?.trim();
80
+ let response;
81
+ if (source && prompt) response = `Based on the following text:\n\n"${source.length > 200 ? `${source.substring(0, 200)}…` : source}"\n\nHere is the result for "${prompt}":\n\n${this.generatePlaceholderContent(prompt, source)}`;
82
+ else if (prompt) response = this.generatePlaceholderContent(prompt, "");
83
+ else response = "Please provide a prompt describing what you would like me to write.";
84
+ return of(response).pipe(delay(1200));
85
+ }
86
+ generatePlaceholderContent(prompt, source) {
87
+ const lower = prompt.toLowerCase();
88
+ if (lower.includes("shorter") || lower.includes("concise") || lower.includes("summarize")) {
89
+ const sentences = source.split(/[.!?]+/).filter((s) => s.trim());
90
+ if (sentences.length > 1) return `${sentences.slice(0, Math.ceil(sentences.length / 2)).join(". ").trim()}.`;
91
+ return `${source.substring(0, Math.ceil(source.length * .6)).trim()}…`;
92
+ }
93
+ if (lower.includes("formal") || lower.includes("professional") || lower.includes("tone")) return `Dear Recipient,\n\nI hope this message finds you well. ${source || "I am writing to follow up on our recent discussion."}\n\nPlease do not hesitate to reach out should you require further information.\n\nBest regards`;
94
+ if (lower.includes("email") || lower.includes("draft") || lower.includes("write")) return `Subject: Follow-up\n\nHi there,\n\n${source || "Thank you for your time. I wanted to reach out regarding the next steps."}\n\nLooking forward to hearing from you.\n\nBest regards`;
95
+ return `[Simulated LLM response]\n\nPrompt: ${prompt}\n\nThis is a simulated response. To enable real LLM calls, provide an apiKey in the llmConfig input. The service supports OpenAI-compatible and Gemini endpoints.`;
96
+ }
97
+ buildSystemMessage(sourceText, context) {
98
+ const parts = [];
99
+ if (context) parts.push(context);
100
+ if (sourceText) parts.push(`The user is working with the following source text:\n\n"""${sourceText}"""`);
101
+ parts.push("Respond with only the requested content. Do not include explanations or preamble.");
102
+ return parts.join("\n\n");
103
+ }
104
+ static {
105
+ this.ɵfac = i0.ɵɵngDeclareFactory({
106
+ minVersion: "12.0.0",
107
+ version: "22.2.4",
108
+ ngImport: i0,
109
+ type: WriteWithAiLlmService,
110
+ deps: [{ token: i1$1.HttpClient }],
111
+ target: i0.ɵɵFactoryTarget.Injectable
112
+ });
113
+ }
114
+ static {
115
+ this.ɵprov = i0.ɵɵngDeclareInjectable({
116
+ minVersion: "12.0.0",
117
+ version: "22.2.4",
118
+ ngImport: i0,
119
+ type: WriteWithAiLlmService,
120
+ providedIn: "root"
121
+ });
122
+ }
123
+ };
124
+ i0.ɵɵngDeclareClassMetadata({
125
+ minVersion: "12.0.0",
126
+ version: "22.2.4",
127
+ ngImport: i0,
128
+ type: WriteWithAiLlmService,
129
+ decorators: [{
130
+ type: Injectable,
131
+ args: [{ providedIn: "root" }]
132
+ }],
133
+ ctorParameters: () => [{ type: i1$1.HttpClient }]
134
+ });
135
+ var WriteWithAiComponent = class WriteWithAiComponent {
136
+ constructor() {
137
+ this.value = input("", ...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
138
+ this.standalone = input(false, ...ngDevMode ? [{ debugName: "standalone" }] : /* istanbul ignore next */ []);
139
+ this.defaultOpen = input(false, ...ngDevMode ? [{ debugName: "defaultOpen" }] : /* istanbul ignore next */ []);
140
+ this.fieldLabel = input("", ...ngDevMode ? [{ debugName: "fieldLabel" }] : /* istanbul ignore next */ []);
141
+ this.header = input("", ...ngDevMode ? [{ debugName: "header" }] : /* istanbul ignore next */ []);
142
+ this.placeholder = input("", ...ngDevMode ? [{ debugName: "placeholder" }] : /* istanbul ignore next */ []);
143
+ this.promptValue = input("", ...ngDevMode ? [{ debugName: "promptValue" }] : /* istanbul ignore next */ []);
144
+ this.tags = input([], ...ngDevMode ? [{ debugName: "tags" }] : /* istanbul ignore next */ []);
145
+ this.status = input("idle", ...ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []);
146
+ this.subheader = input(void 0, ...ngDevMode ? [{ debugName: "subheader" }] : /* istanbul ignore next */ []);
147
+ this.llmConfig = input(void 0, ...ngDevMode ? [{ debugName: "llmConfig" }] : /* istanbul ignore next */ []);
148
+ this.fullHeight = input(false, ...ngDevMode ? [{ debugName: "fullHeight" }] : /* istanbul ignore next */ []);
149
+ this.borderless = input(false, ...ngDevMode ? [{ debugName: "borderless" }] : /* istanbul ignore next */ []);
150
+ this.tagsOnly = input(false, {
151
+ ...ngDevMode ? { debugName: "tagsOnly" } : /* istanbul ignore next */ {},
152
+ transform: booleanAttribute
153
+ });
154
+ this.metadata = input({}, ...ngDevMode ? [{ debugName: "metadata" }] : /* istanbul ignore next */ []);
155
+ this.valueChange = output();
156
+ this.promptChange = output();
157
+ this.promptSubmit = output();
158
+ this.cancelPending = output();
159
+ this.acceptResult = output();
160
+ this.requestRefine = output();
161
+ this.destroyRef = inject(DestroyRef);
162
+ this.llmService = inject(WriteWithAiLlmService);
163
+ this.uiTranslate = inject(UiTranslatePipe);
164
+ this.promptModel = signal("", ...ngDevMode ? [{ debugName: "promptModel" }] : /* istanbul ignore next */ []);
165
+ this.isPanelManuallyOpen = signal(false, ...ngDevMode ? [{ debugName: "isPanelManuallyOpen" }] : /* istanbul ignore next */ []);
166
+ this.internalStatus = signal("idle", ...ngDevMode ? [{ debugName: "internalStatus" }] : /* istanbul ignore next */ []);
167
+ this.internalValue = signal("", ...ngDevMode ? [{ debugName: "internalValue" }] : /* istanbul ignore next */ []);
168
+ this.cancelRequest$ = new Subject();
169
+ this.cvaDisabled = signal(false, ...ngDevMode ? [{ debugName: "cvaDisabled" }] : /* istanbul ignore next */ []);
170
+ this.tagsScrollRef = viewChild("tagsScrollContainer", ...ngDevMode ? [{ debugName: "tagsScrollRef" }] : /* istanbul ignore next */ []);
171
+ this.canScrollTagsLeft = signal(false, ...ngDevMode ? [{ debugName: "canScrollTagsLeft" }] : /* istanbul ignore next */ []);
172
+ this.canScrollTagsRight = signal(false, ...ngDevMode ? [{ debugName: "canScrollTagsRight" }] : /* istanbul ignore next */ []);
173
+ this.onChange = () => {};
174
+ this.onTouched = () => {};
175
+ this.translationContext = "WRITE_WITH_AI.";
176
+ this.labels = toSignal(combineLatest([
177
+ this.uiTranslate.transform(`${this.translationContext}CANCEL`),
178
+ this.uiTranslate.transform(`${this.translationContext}ACCEPT`),
179
+ this.uiTranslate.transform(`${this.translationContext}MAKE_CHANGES`),
180
+ this.uiTranslate.transform(`${this.translationContext}TRY_AGAIN`)
181
+ ]).pipe(map(([cancel, accept, makeChanges, tryAgain]) => ({
182
+ cancel,
183
+ accept,
184
+ makeChanges,
185
+ tryAgain
186
+ }))), { initialValue: {
187
+ cancel: "",
188
+ accept: "",
189
+ makeChanges: "",
190
+ tryAgain: ""
191
+ } });
192
+ this.isDefaultMode = computed(() => this.llmConfig()?.default === true, ...ngDevMode ? [{ debugName: "isDefaultMode" }] : /* istanbul ignore next */ []);
193
+ this.effectiveStatus = computed(() => this.isDefaultMode() ? this.internalStatus() : this.status(), ...ngDevMode ? [{ debugName: "effectiveStatus" }] : /* istanbul ignore next */ []);
194
+ this.effectiveValue = computed(() => this.isDefaultMode() ? this.internalValue() : this.value(), ...ngDevMode ? [{ debugName: "effectiveValue" }] : /* istanbul ignore next */ []);
195
+ this.isPanelVisible = computed(() => this.standalone() || this.isPanelManuallyOpen(), ...ngDevMode ? [{ debugName: "isPanelVisible" }] : /* istanbul ignore next */ []);
196
+ this.promptTags = computed(() => this.tags().map((tag) => ({
197
+ id: tag.id,
198
+ label: tag.label,
199
+ autocomplete: tag.description ?? ""
200
+ })), ...ngDevMode ? [{ debugName: "promptTags" }] : /* istanbul ignore next */ []);
201
+ this.statusConfig = computed(() => {
202
+ const l = this.labels();
203
+ switch (this.effectiveStatus()) {
204
+ case "loading": return {
205
+ variant: "loading",
206
+ alertType: "info",
207
+ messageKey: `${this.translationContext}WRITING`,
208
+ actions: [{
209
+ label: l.cancel,
210
+ onClick: () => this.handleCancel()
211
+ }]
212
+ };
213
+ case "success": return {
214
+ variant: "success",
215
+ alertType: "success",
216
+ messageKey: `${this.translationContext}CONTENT_GENERATED`,
217
+ actions: [{
218
+ label: l.makeChanges,
219
+ onClick: () => this.handleRefine()
220
+ }, {
221
+ label: l.accept,
222
+ onClick: () => this.handleAccept()
223
+ }]
224
+ };
225
+ case "error": return {
226
+ variant: "error",
227
+ alertType: "error",
228
+ messageKey: `${this.translationContext}ERROR_MESSAGE`,
229
+ actions: [{
230
+ label: l.tryAgain,
231
+ onClick: () => this.handleRefine()
232
+ }]
233
+ };
234
+ case "idle": return null;
235
+ default: return null;
236
+ }
237
+ }, ...ngDevMode ? [{ debugName: "statusConfig" }] : /* istanbul ignore next */ []);
238
+ this.promptModelData = computed(() => ({
239
+ text: this.promptModel(),
240
+ files: []
241
+ }), ...ngDevMode ? [{ debugName: "promptModelData" }] : /* istanbul ignore next */ []);
242
+ effect(() => {
243
+ const promptValue = this.promptValue();
244
+ if (!this.isDefaultMode()) untracked(() => this.promptModel.set(promptValue));
245
+ });
246
+ effect(() => {
247
+ const value = this.value();
248
+ if (this.isDefaultMode()) untracked(() => this.internalValue.set(value));
249
+ });
250
+ afterRenderEffect({ read: () => {
251
+ this.tags();
252
+ const el = this.tagsScrollRef()?.nativeElement;
253
+ if (el) this.measureTagScroll(el);
254
+ } });
255
+ effect((onCleanup) => {
256
+ const el = this.tagsScrollRef()?.nativeElement;
257
+ if (!el || typeof ResizeObserver === "undefined") return;
258
+ const observer = new ResizeObserver(() => this.measureTagScroll(el));
259
+ observer.observe(el);
260
+ onCleanup(() => observer.disconnect());
261
+ });
262
+ }
263
+ handlePromptModelChange(value) {
264
+ const text = typeof value === "string" ? value : value?.text ?? "";
265
+ this.promptModel.set(text);
266
+ this.promptChange.emit(text);
267
+ }
268
+ ngOnInit() {
269
+ if (this.defaultOpen()) this.isPanelManuallyOpen.set(true);
270
+ }
271
+ togglePanel() {
272
+ if (this.standalone()) return;
273
+ this.isPanelManuallyOpen.update((current) => !current);
274
+ }
275
+ handleValueInput(value) {
276
+ if (this.isDefaultMode()) this.internalValue.set(value);
277
+ this.valueChange.emit(value);
278
+ this.onChange(value);
279
+ this.onTouched();
280
+ }
281
+ handlePromptSubmit(promptData) {
282
+ const prompt = typeof promptData === "string" ? promptData : promptData?.text ?? this.promptModel();
283
+ this.promptModel.set(prompt);
284
+ this.promptChange.emit(prompt);
285
+ const submitEvent = {
286
+ prompt,
287
+ content: this.effectiveValue(),
288
+ metadata: this.metadata()
289
+ };
290
+ if (this.isDefaultMode()) this.executeDefaultFlow(prompt);
291
+ this.promptSubmit.emit(submitEvent);
292
+ }
293
+ handleTagClick(tag) {
294
+ if (this.cvaDisabled()) return;
295
+ this.handlePromptSubmit(tag.label);
296
+ }
297
+ measureTagScroll(el) {
298
+ this.canScrollTagsLeft.set(el.scrollLeft > 0);
299
+ this.canScrollTagsRight.set(Math.ceil(el.scrollLeft + el.clientWidth) < el.scrollWidth);
300
+ }
301
+ scrollTags(el, direction) {
302
+ el.scrollBy({
303
+ left: direction * el.clientWidth * .8,
304
+ behavior: "smooth"
305
+ });
306
+ }
307
+ handlePrimaryAction() {
308
+ const status = this.effectiveStatus();
309
+ if (status === "loading") this.handleCancel();
310
+ else if (status === "success") this.handleAccept();
311
+ else if (status === "error") this.handleRefine();
312
+ }
313
+ handleSecondaryAction() {
314
+ if (this.effectiveStatus() === "success") this.handleRefine();
315
+ }
316
+ writeValue(value) {
317
+ const v = value ?? "";
318
+ if (this.isDefaultMode()) this.internalValue.set(v);
319
+ this.internalValue.set(v);
320
+ }
321
+ registerOnChange(fn) {
322
+ this.onChange = fn;
323
+ }
324
+ registerOnTouched(fn) {
325
+ this.onTouched = fn;
326
+ }
327
+ setDisabledState(isDisabled) {
328
+ this.cvaDisabled.set(isDisabled);
329
+ }
330
+ executeDefaultFlow(prompt) {
331
+ const config = this.llmConfig();
332
+ if (!config) return;
333
+ this.cancelRequest$.next();
334
+ this.internalStatus.set("loading");
335
+ this.llmService.generate({
336
+ sourceText: this.effectiveValue(),
337
+ prompt,
338
+ context: config.context
339
+ }, config).pipe(takeUntilDestroyed(this.destroyRef), takeUntil(this.cancelRequest$)).subscribe({
340
+ next: (result) => {
341
+ this.internalValue.set(result);
342
+ this.valueChange.emit(result);
343
+ this.onChange(result);
344
+ this.internalStatus.set("success");
345
+ },
346
+ error: () => {
347
+ this.internalStatus.set("error");
348
+ }
349
+ });
350
+ }
351
+ handleCancel() {
352
+ if (this.isDefaultMode()) {
353
+ this.cancelRequest$.next();
354
+ this.internalStatus.set("idle");
355
+ }
356
+ this.cancelPending.emit();
357
+ }
358
+ handleAccept() {
359
+ if (this.isDefaultMode()) {
360
+ this.internalStatus.set("idle");
361
+ this.promptModel.set("");
362
+ }
363
+ if (!this.standalone()) this.isPanelManuallyOpen.set(false);
364
+ this.acceptResult.emit();
365
+ }
366
+ handleRefine() {
367
+ if (this.isDefaultMode()) this.internalStatus.set("idle");
368
+ this.requestRefine.emit();
369
+ }
370
+ static {
371
+ this.ɵfac = i0.ɵɵngDeclareFactory({
372
+ minVersion: "12.0.0",
373
+ version: "22.2.4",
374
+ ngImport: i0,
375
+ type: WriteWithAiComponent,
376
+ deps: [],
377
+ target: i0.ɵɵFactoryTarget.Component
378
+ });
379
+ }
380
+ static {
381
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
382
+ minVersion: "17.0.0",
383
+ version: "22.2.4",
384
+ type: WriteWithAiComponent,
385
+ isStandalone: true,
386
+ selector: "ui-write-with-ai",
387
+ inputs: {
388
+ value: {
389
+ classPropertyName: "value",
390
+ publicName: "value",
391
+ isSignal: true,
392
+ isRequired: false,
393
+ transformFunction: null
394
+ },
395
+ standalone: {
396
+ classPropertyName: "standalone",
397
+ publicName: "standalone",
398
+ isSignal: true,
399
+ isRequired: false,
400
+ transformFunction: null
401
+ },
402
+ defaultOpen: {
403
+ classPropertyName: "defaultOpen",
404
+ publicName: "defaultOpen",
405
+ isSignal: true,
406
+ isRequired: false,
407
+ transformFunction: null
408
+ },
409
+ fieldLabel: {
410
+ classPropertyName: "fieldLabel",
411
+ publicName: "fieldLabel",
412
+ isSignal: true,
413
+ isRequired: false,
414
+ transformFunction: null
415
+ },
416
+ header: {
417
+ classPropertyName: "header",
418
+ publicName: "header",
419
+ isSignal: true,
420
+ isRequired: false,
421
+ transformFunction: null
422
+ },
423
+ placeholder: {
424
+ classPropertyName: "placeholder",
425
+ publicName: "placeholder",
426
+ isSignal: true,
427
+ isRequired: false,
428
+ transformFunction: null
429
+ },
430
+ promptValue: {
431
+ classPropertyName: "promptValue",
432
+ publicName: "promptValue",
433
+ isSignal: true,
434
+ isRequired: false,
435
+ transformFunction: null
436
+ },
437
+ tags: {
438
+ classPropertyName: "tags",
439
+ publicName: "tags",
440
+ isSignal: true,
441
+ isRequired: false,
442
+ transformFunction: null
443
+ },
444
+ status: {
445
+ classPropertyName: "status",
446
+ publicName: "status",
447
+ isSignal: true,
448
+ isRequired: false,
449
+ transformFunction: null
450
+ },
451
+ subheader: {
452
+ classPropertyName: "subheader",
453
+ publicName: "subheader",
454
+ isSignal: true,
455
+ isRequired: false,
456
+ transformFunction: null
457
+ },
458
+ llmConfig: {
459
+ classPropertyName: "llmConfig",
460
+ publicName: "llmConfig",
461
+ isSignal: true,
462
+ isRequired: false,
463
+ transformFunction: null
464
+ },
465
+ fullHeight: {
466
+ classPropertyName: "fullHeight",
467
+ publicName: "fullHeight",
468
+ isSignal: true,
469
+ isRequired: false,
470
+ transformFunction: null
471
+ },
472
+ borderless: {
473
+ classPropertyName: "borderless",
474
+ publicName: "borderless",
475
+ isSignal: true,
476
+ isRequired: false,
477
+ transformFunction: null
478
+ },
479
+ tagsOnly: {
480
+ classPropertyName: "tagsOnly",
481
+ publicName: "tagsOnly",
482
+ isSignal: true,
483
+ isRequired: false,
484
+ transformFunction: null
485
+ },
486
+ metadata: {
487
+ classPropertyName: "metadata",
488
+ publicName: "metadata",
489
+ isSignal: true,
490
+ isRequired: false,
491
+ transformFunction: null
492
+ }
493
+ },
494
+ outputs: {
495
+ valueChange: "valueChange",
496
+ promptChange: "promptChange",
497
+ promptSubmit: "promptSubmit",
498
+ cancelPending: "cancelPending",
499
+ acceptResult: "acceptResult",
500
+ requestRefine: "requestRefine"
501
+ },
502
+ host: { styleAttribute: "display: block" },
503
+ providers: [UiTranslatePipe, {
504
+ provide: NG_VALUE_ACCESSOR,
505
+ useExisting: forwardRef(() => WriteWithAiComponent),
506
+ multi: true
507
+ }],
508
+ viewQueries: [{
509
+ propertyName: "tagsScrollRef",
510
+ first: true,
511
+ predicate: ["tagsScrollContainer"],
512
+ descendants: true,
513
+ isSignal: true
514
+ }],
515
+ ngImport: i0,
516
+ template: "<div\n class=\"write-with-ai\"\n [class.write-with-ai--standalone]=\"standalone()\"\n [class.write-with-ai--full-height]=\"fullHeight()\"\n>\n @if (!standalone()) {\n <div class=\"write-with-ai__host\">\n <ui-field\n [label]=\"fieldLabel() || (translationContext + 'FIELD_LABEL' | uiTranslate | async)!\"\n type=\"textarea\"\n [showBottomContent]=\"false\"\n [fullHeight]=\"fullHeight()\"\n [borderless]=\"borderless()\"\n [disabled]=\"cvaDisabled()\"\n [ngModel]=\"effectiveValue()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"handleValueInput($event)\"\n ></ui-field>\n <ui-button\n class=\"write-with-ai__cta\"\n variant=\"ghost-ai\"\n size=\"small\"\n [label]=\"(translationContext + 'AI_ASSIST' | uiTranslate | async)!\"\n iconName=\"Sparkle-in-line\"\n iconPosition=\"left\"\n [disabled]=\"isPanelVisible() || cvaDisabled()\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n </div>\n }\n\n @if (isPanelVisible()) {\n <section\n class=\"write-with-ai__panel\"\n [class.write-with-ai__panel--loading]=\"effectiveStatus() === 'loading'\"\n role=\"region\"\n [attr.aria-label]=\"(translationContext + 'AI_WRITING_ASSISTANT' | uiTranslate | async)!\"\n >\n <header class=\"write-with-ai__panel-header\">\n <div class=\"write-with-ai__panel-heading\">\n <div class=\"write-with-ai__title-row\">\n @if (effectiveStatus() !== 'loading') {\n <ui-icon class=\"write-with-ai__title-icon\" name=\"Sparkle-in-line\" color=\"ai\"></ui-icon>\n }\n <h4 class=\"write-with-ai__title\">\n {{ header() || (translationContext + 'HEADER' | uiTranslate | async) }}\n </h4>\n </div>\n @if (subheader()) {\n <p class=\"write-with-ai__subheader\">{{ subheader() }}</p>\n }\n </div>\n @if (!standalone()) {\n <ui-button\n variant=\"icon-button\"\n iconName=\"Close\"\n size=\"small\"\n [tooltip]=\"(translationContext + 'CLOSE' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'CLOSE_AI_ASSISTANT' | uiTranslate | async)!\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n }\n </header>\n\n @if (effectiveStatus() === 'idle') {\n @if (tagsOnly()) {\n @if (tags().length) {\n <div class=\"write-with-ai__tags-prompt\">\n <div\n class=\"write-with-ai__tags-container\"\n role=\"group\"\n [attr.aria-label]=\"header() || (translationContext + 'HEADER' | uiTranslate | async)\"\n #tagsScrollContainer\n (scroll)=\"measureTagScroll(tagsScrollContainer)\"\n >\n @for (tag of tags(); track tag.id) {\n <ui-tag\n [label]=\"tag.label\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"cvaDisabled()\"\n (press)=\"handleTagClick(tag)\"\n ></ui-tag>\n }\n </div>\n <div class=\"write-with-ai__tags-arrows\">\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-left-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsLeft()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, -1)\"\n ></ui-button>\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-right-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsRight()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, 1)\"\n ></ui-button>\n </div>\n </div>\n }\n } @else {\n <div class=\"write-with-ai__prompt\">\n <ui-prompt\n [ngModel]=\"promptModelData()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"handlePromptModelChange($event)\"\n [tags]=\"promptTags()\"\n [placeholder]=\"placeholder() || (translationContext + 'PLACEHOLDER' | uiTranslate | async)!\"\n [showSendButton]=\"true\"\n (promptData)=\"handlePromptSubmit($event)\"\n ></ui-prompt>\n </div>\n }\n }\n\n @if (statusConfig(); as cfg) {\n <ui-alert-banner\n [alertType]=\"cfg.alertType\"\n alertVariant=\"callout\"\n [message]=\"(cfg.messageKey | uiTranslate | async)!\"\n [includeDismissButton]=\"false\"\n [isLoading]=\"cfg.variant === 'loading'\"\n [hasIcon]=\"cfg.variant !== 'loading'\"\n [actions]=\"cfg.actions\"\n [isFullWidth]=\"true\"\n ></ui-alert-banner>\n }\n\n <div class=\"write-with-ai__caveat\">\n <ui-ai-caveat></ui-ai-caveat>\n </div>\n </section>\n }\n</div>\n",
517
+ styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.write-with-ai{display:flex;flex-direction:column;gap:8px;padding-top:8px;max-width:100%;overflow:hidden}.write-with-ai--full-height{height:100%}.write-with-ai--full-height .write-with-ai__host{flex:1}.write-with-ai__host{position:relative;display:flex;flex-direction:column}.write-with-ai__cta{position:absolute;right:8px;bottom:8px;z-index:1;background-color:#fff;border-radius:100px}.write-with-ai__panel{border:none;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:8px;background-color:#f4f4f4}.write-with-ai__panel-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.write-with-ai__panel-heading{display:flex;flex-direction:column;gap:8px}.write-with-ai__title-row{display:flex;align-items:center;gap:8px}.write-with-ai__title{margin:0}.write-with-ai__subheader{margin:0;font-size:14px;line-height:22px;font-weight:400;color:#242424}.write-with-ai__quick-actions{display:flex;gap:8px;flex-wrap:wrap}.write-with-ai__prompt{display:flex;flex-direction:column;gap:4px}.write-with-ai__tags-prompt{display:flex;align-items:center;gap:4px;padding:8px;border:1px solid #919191;border-radius:10px;background-color:#fff}.write-with-ai__tags-container{display:flex;flex-flow:row nowrap;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.write-with-ai__tags-container::-webkit-scrollbar{display:none}.write-with-ai__tags-arrows{display:flex;align-items:center;gap:4px;flex-shrink:0}.write-with-ai__status-actions{display:flex;gap:8px;justify-content:flex-end}.write-with-ai__caveat{font-size:12px}@keyframes pulse-text{0%,to{opacity:1}50%{opacity:.5}}:host ::ng-deep .write-with-ai__host textarea{padding-bottom:48px!important}\n"],
518
+ dependencies: [
519
+ {
520
+ kind: "ngmodule",
521
+ type: FormsModule
522
+ },
523
+ {
524
+ kind: "directive",
525
+ type: i1.NgControlStatus,
526
+ selector: "[formControlName],[ngModel],[formControl]"
527
+ },
528
+ {
529
+ kind: "directive",
530
+ type: i1.NgModel,
531
+ selector: "[ngModel]:not([formControlName]):not([formControl])",
532
+ inputs: [
533
+ "name",
534
+ "disabled",
535
+ "ngModel",
536
+ "ngModelOptions"
537
+ ],
538
+ outputs: ["ngModelChange"],
539
+ exportAs: ["ngModel"]
540
+ },
541
+ {
542
+ kind: "ngmodule",
543
+ type: FieldComponentModule
544
+ },
545
+ {
546
+ kind: "component",
547
+ type: i2.FieldComponent,
548
+ selector: "ui-field",
549
+ inputs: [
550
+ "fullWidth",
551
+ "fullHeight",
552
+ "label",
553
+ "labelHtml",
554
+ "labelIcon",
555
+ "fieldName",
556
+ "placeholder",
557
+ "id",
558
+ "value",
559
+ "badgeVariant",
560
+ "errors",
561
+ "disabled",
562
+ "required",
563
+ "readOnly",
564
+ "hintMessage",
565
+ "type",
566
+ "updateOnBlur",
567
+ "allowOnlyDigits",
568
+ "isAutocompleteOff",
569
+ "allowNegative",
570
+ "showBottomContent",
571
+ "applicationTheme",
572
+ "ariaLabel",
573
+ "testId",
574
+ "loading",
575
+ "isValid",
576
+ "maxCharacters",
577
+ "trimOnBlur",
578
+ "trimOnSubmit",
579
+ "maxRows",
580
+ "hasTextAreaCounter",
581
+ "hideBuiltInErrors",
582
+ "hideLabelInErrors",
583
+ "max",
584
+ "min",
585
+ "textareaHeight",
586
+ "borderless",
587
+ "autosizableTextarea",
588
+ "isAIVariant",
589
+ "ariaLabelledby",
590
+ "ariaDescribedby",
591
+ "hasError"
592
+ ],
593
+ outputs: ["validateEvent", "fieldBlur"]
594
+ },
595
+ {
596
+ kind: "ngmodule",
597
+ type: ButtonComponentModule
598
+ },
599
+ {
600
+ kind: "component",
601
+ type: i3.ButtonComponent,
602
+ selector: "ui-button",
603
+ inputs: [
604
+ "size",
605
+ "variant",
606
+ "label",
607
+ "iconPosition",
608
+ "justIcon",
609
+ "iconName",
610
+ "trailingIconName",
611
+ "trailingIconFilled",
612
+ "disabled",
613
+ "loading",
614
+ "loadingWithLabel",
615
+ "fullWidth",
616
+ "url",
617
+ "urlTarget",
618
+ "value",
619
+ "tooltip",
620
+ "isPremium",
621
+ "type",
622
+ "companyColor",
623
+ "buttonBadgeConfig",
624
+ "applicationTheme",
625
+ "disabledScaleOnClick",
626
+ "ariaLabel",
627
+ "ariaExpanded",
628
+ "ariaControls",
629
+ "ariaPressed",
630
+ "ariaRequired",
631
+ "ariaLabelledby",
632
+ "ariaDescribedby",
633
+ "preventDefault",
634
+ "hasBackground",
635
+ "tooltipPosition",
636
+ "role",
637
+ "iconFilled",
638
+ "testId"
639
+ ],
640
+ outputs: ["buttonClickEvent", "buttonHoverEvent"]
641
+ },
642
+ {
643
+ kind: "ngmodule",
644
+ type: IconComponentModule
645
+ },
646
+ {
647
+ kind: "component",
648
+ type: i4.IconComponent,
649
+ selector: "ui-icon",
650
+ inputs: [
651
+ "size",
652
+ "cssClass",
653
+ "name",
654
+ "color",
655
+ "filled",
656
+ "toggleIconStyle",
657
+ "applicationTheme",
658
+ "useFullIconName"
659
+ ]
660
+ },
661
+ {
662
+ kind: "ngmodule",
663
+ type: PromptModule
664
+ },
665
+ {
666
+ kind: "component",
667
+ type: i5.PromptComponent,
668
+ selector: "ui-prompt",
669
+ inputs: [
670
+ "tags",
671
+ "actionTag",
672
+ "secondaryActionTag",
673
+ "collapseActionTags",
674
+ "maxCharacters",
675
+ "supportedFileTypes",
676
+ "autoClear",
677
+ "showSendButton",
678
+ "sendButtonDisabled",
679
+ "enableFileUpload",
680
+ "loading",
681
+ "placeholder",
682
+ "errorMessage",
683
+ "dropdownItems",
684
+ "dropdownHeading",
685
+ "showDropdownClose",
686
+ "showCharacterCount",
687
+ "helpText",
688
+ "disabled"
689
+ ],
690
+ outputs: [
691
+ "promptData",
692
+ "actionTagFileSelected",
693
+ "secondaryActionTagPress",
694
+ "dropdownItemSelected",
695
+ "dropdownClosed"
696
+ ]
697
+ },
698
+ {
699
+ kind: "ngmodule",
700
+ type: AiCaveatComponentModule
701
+ },
702
+ {
703
+ kind: "component",
704
+ type: i6.AiCaveatComponent,
705
+ selector: "ui-ai-caveat",
706
+ inputs: ["applicationTheme"]
707
+ },
708
+ {
709
+ kind: "ngmodule",
710
+ type: AlertBannerComponentModule
711
+ },
712
+ {
713
+ kind: "component",
714
+ type: i7.AlertBannerComponent,
715
+ selector: "ui-alert-banner",
716
+ inputs: [
717
+ "alertType",
718
+ "alertVariant",
719
+ "message",
720
+ "includeDismissButton",
721
+ "shadow",
722
+ "linkText",
723
+ "linkUrl",
724
+ "linkTarget",
725
+ "actions",
726
+ "applicationTheme",
727
+ "size",
728
+ "isFullWidth",
729
+ "closeButtonTooltip",
730
+ "testId",
731
+ "hasIcon",
732
+ "isLoading",
733
+ "fixed",
734
+ "ariaDescribedby",
735
+ "secondaryAlerts"
736
+ ],
737
+ outputs: ["dismiss"]
738
+ },
739
+ {
740
+ kind: "ngmodule",
741
+ type: TagComponentModule
742
+ },
743
+ {
744
+ kind: "component",
745
+ type: i8.TagComponent,
746
+ selector: "ui-tag",
747
+ inputs: [
748
+ "label",
749
+ "icon",
750
+ "allowClose",
751
+ "readOnly",
752
+ "isSelected",
753
+ "showIconWhenSelected",
754
+ "pinnedBackground",
755
+ "constrainWidth",
756
+ "isDisabled",
757
+ "applicationTheme",
758
+ "ariaLabel",
759
+ "testId",
760
+ "ariaRequired",
761
+ "showBadge",
762
+ "notificationsAmount"
763
+ ],
764
+ outputs: [
765
+ "isSelectedChange",
766
+ "close",
767
+ "press"
768
+ ]
769
+ },
770
+ {
771
+ kind: "pipe",
772
+ type: AsyncPipe,
773
+ name: "async"
774
+ },
775
+ {
776
+ kind: "pipe",
777
+ type: UiTranslatePipe,
778
+ name: "uiTranslate"
779
+ }
780
+ ],
781
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
782
+ });
783
+ }
784
+ };
785
+ i0.ɵɵngDeclareClassMetadata({
786
+ minVersion: "12.0.0",
787
+ version: "22.2.4",
788
+ ngImport: i0,
789
+ type: WriteWithAiComponent,
790
+ decorators: [{
791
+ type: Component,
792
+ args: [{
793
+ selector: "ui-write-with-ai",
794
+ changeDetection: ChangeDetectionStrategy.OnPush,
795
+ host: { style: "display: block" },
796
+ providers: [UiTranslatePipe, {
797
+ provide: NG_VALUE_ACCESSOR,
798
+ useExisting: forwardRef(() => WriteWithAiComponent),
799
+ multi: true
800
+ }],
801
+ imports: [
802
+ AsyncPipe,
803
+ FormsModule,
804
+ FieldComponentModule,
805
+ ButtonComponentModule,
806
+ IconComponentModule,
807
+ PromptModule,
808
+ AiCaveatComponentModule,
809
+ AlertBannerComponentModule,
810
+ TagComponentModule,
811
+ UiTranslatePipe
812
+ ],
813
+ template: "<div\n class=\"write-with-ai\"\n [class.write-with-ai--standalone]=\"standalone()\"\n [class.write-with-ai--full-height]=\"fullHeight()\"\n>\n @if (!standalone()) {\n <div class=\"write-with-ai__host\">\n <ui-field\n [label]=\"fieldLabel() || (translationContext + 'FIELD_LABEL' | uiTranslate | async)!\"\n type=\"textarea\"\n [showBottomContent]=\"false\"\n [fullHeight]=\"fullHeight()\"\n [borderless]=\"borderless()\"\n [disabled]=\"cvaDisabled()\"\n [ngModel]=\"effectiveValue()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"handleValueInput($event)\"\n ></ui-field>\n <ui-button\n class=\"write-with-ai__cta\"\n variant=\"ghost-ai\"\n size=\"small\"\n [label]=\"(translationContext + 'AI_ASSIST' | uiTranslate | async)!\"\n iconName=\"Sparkle-in-line\"\n iconPosition=\"left\"\n [disabled]=\"isPanelVisible() || cvaDisabled()\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n </div>\n }\n\n @if (isPanelVisible()) {\n <section\n class=\"write-with-ai__panel\"\n [class.write-with-ai__panel--loading]=\"effectiveStatus() === 'loading'\"\n role=\"region\"\n [attr.aria-label]=\"(translationContext + 'AI_WRITING_ASSISTANT' | uiTranslate | async)!\"\n >\n <header class=\"write-with-ai__panel-header\">\n <div class=\"write-with-ai__panel-heading\">\n <div class=\"write-with-ai__title-row\">\n @if (effectiveStatus() !== 'loading') {\n <ui-icon class=\"write-with-ai__title-icon\" name=\"Sparkle-in-line\" color=\"ai\"></ui-icon>\n }\n <h4 class=\"write-with-ai__title\">\n {{ header() || (translationContext + 'HEADER' | uiTranslate | async) }}\n </h4>\n </div>\n @if (subheader()) {\n <p class=\"write-with-ai__subheader\">{{ subheader() }}</p>\n }\n </div>\n @if (!standalone()) {\n <ui-button\n variant=\"icon-button\"\n iconName=\"Close\"\n size=\"small\"\n [tooltip]=\"(translationContext + 'CLOSE' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'CLOSE_AI_ASSISTANT' | uiTranslate | async)!\"\n (buttonClickEvent)=\"togglePanel()\"\n ></ui-button>\n }\n </header>\n\n @if (effectiveStatus() === 'idle') {\n @if (tagsOnly()) {\n @if (tags().length) {\n <div class=\"write-with-ai__tags-prompt\">\n <div\n class=\"write-with-ai__tags-container\"\n role=\"group\"\n [attr.aria-label]=\"header() || (translationContext + 'HEADER' | uiTranslate | async)\"\n #tagsScrollContainer\n (scroll)=\"measureTagScroll(tagsScrollContainer)\"\n >\n @for (tag of tags(); track tag.id) {\n <ui-tag\n [label]=\"tag.label\"\n [ariaLabel]=\"tag.label\"\n [isDisabled]=\"cvaDisabled()\"\n (press)=\"handleTagClick(tag)\"\n ></ui-tag>\n }\n </div>\n <div class=\"write-with-ai__tags-arrows\">\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-left-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_LEFT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsLeft()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, -1)\"\n ></ui-button>\n <ui-button\n variant=\"icon-button\"\n size=\"small\"\n iconName=\"Arrow-chevron-right-in-line\"\n [tooltip]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [ariaLabel]=\"(translationContext + 'SCROLL_TAGS_RIGHT' | uiTranslate | async)!\"\n [disabled]=\"cvaDisabled() || !canScrollTagsRight()\"\n (buttonClickEvent)=\"scrollTags(tagsScrollContainer, 1)\"\n ></ui-button>\n </div>\n </div>\n }\n } @else {\n <div class=\"write-with-ai__prompt\">\n <ui-prompt\n [ngModel]=\"promptModelData()\"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"handlePromptModelChange($event)\"\n [tags]=\"promptTags()\"\n [placeholder]=\"placeholder() || (translationContext + 'PLACEHOLDER' | uiTranslate | async)!\"\n [showSendButton]=\"true\"\n (promptData)=\"handlePromptSubmit($event)\"\n ></ui-prompt>\n </div>\n }\n }\n\n @if (statusConfig(); as cfg) {\n <ui-alert-banner\n [alertType]=\"cfg.alertType\"\n alertVariant=\"callout\"\n [message]=\"(cfg.messageKey | uiTranslate | async)!\"\n [includeDismissButton]=\"false\"\n [isLoading]=\"cfg.variant === 'loading'\"\n [hasIcon]=\"cfg.variant !== 'loading'\"\n [actions]=\"cfg.actions\"\n [isFullWidth]=\"true\"\n ></ui-alert-banner>\n }\n\n <div class=\"write-with-ai__caveat\">\n <ui-ai-caveat></ui-ai-caveat>\n </div>\n </section>\n }\n</div>\n",
814
+ styles: [".bg-teal-60b{background:#1c443c}.bg-teal-30b{background:#31766a}.bg-teal-default{background:#46a997}.bg-teal-30w{background:#7ec3b6}.bg-teal-60w{background:#b5ddd5}.bg-teal-secondary{background:#cbd6cb}.bg-teal-90w{background:#ecf6f5}.bg-petrol-60b{background:#102930}.bg-petrol-30b{background:#1b4754}.bg-petrol-default{background:#276678}.bg-petrol-30w{background:#6894a0}.bg-petrol-60w{background:#a9c2c9}.bg-petrol-secondary{background:#c8d7de}.bg-petrol-90w{background:#e9f0f1}.bg-error-60b{background:#513131}.bg-error-30b{background:#8e5655}.bg-error-60w{background:#e3c3c6}.bg-error-secondary{background:#f0dad9}.bg-error-default{background:#cb7b7a}.bg-warning-secondary{background:#f0d6bb}.bg-warning-default{background:#cca45f}.bg-black{background:#000}.bg-dark{background:#888}.bg-medium{background:#e0e0e0}.bg-grey{background:#ededed}.bg-light{background:#f6f6f6}.bg-white{background:#fff}.bg-box-shadow{background:#00000014}.bg-navigation-subtitle{background:#528593}.bgc-teal-60b{background-color:#1c443c}.bgc-teal-30b{background-color:#31766a}.bgc-teal-default{background-color:#46a997}.bgc-teal-30w{background-color:#7ec3b6}.bgc-teal-60w{background-color:#b5ddd5}.bgc-teal-secondary{background-color:#cbd6cb}.bgc-teal-90w{background-color:#ecf6f5}.bgc-petrol-60b{background-color:#102930}.bgc-petrol-30b{background-color:#1b4754}.bgc-petrol-default{background-color:#276678}.bgc-petrol-30w{background-color:#6894a0}.bgc-petrol-60w{background-color:#a9c2c9}.bgc-petrol-secondary{background-color:#c8d7de}.bgc-petrol-90w{background-color:#e9f0f1}.bgc-error-60b{background-color:#513131}.bgc-error-30b{background-color:#8e5655}.bgc-error-60w{background-color:#e3c3c6}.bgc-error-secondary{background-color:#f0dad9}.bgc-error-default{background-color:#cb7b7a}.bgc-warning-secondary{background-color:#f0d6bb}.bgc-warning-default{background-color:#cca45f}.bgc-black{background-color:#000}.bgc-dark{background-color:#888}.bgc-medium{background-color:#e0e0e0}.bgc-grey{background-color:#ededed}.bgc-light{background-color:#f6f6f6}.bgc-white{background-color:#fff}.bgc-box-shadow{background-color:#00000014}.bgc-navigation-subtitle{background-color:#528593}.write-with-ai{display:flex;flex-direction:column;gap:8px;padding-top:8px;max-width:100%;overflow:hidden}.write-with-ai--full-height{height:100%}.write-with-ai--full-height .write-with-ai__host{flex:1}.write-with-ai__host{position:relative;display:flex;flex-direction:column}.write-with-ai__cta{position:absolute;right:8px;bottom:8px;z-index:1;background-color:#fff;border-radius:100px}.write-with-ai__panel{border:none;border-radius:10px;padding:16px;display:flex;flex-direction:column;gap:8px;background-color:#f4f4f4}.write-with-ai__panel-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.write-with-ai__panel-heading{display:flex;flex-direction:column;gap:8px}.write-with-ai__title-row{display:flex;align-items:center;gap:8px}.write-with-ai__title{margin:0}.write-with-ai__subheader{margin:0;font-size:14px;line-height:22px;font-weight:400;color:#242424}.write-with-ai__quick-actions{display:flex;gap:8px;flex-wrap:wrap}.write-with-ai__prompt{display:flex;flex-direction:column;gap:4px}.write-with-ai__tags-prompt{display:flex;align-items:center;gap:4px;padding:8px;border:1px solid #919191;border-radius:10px;background-color:#fff}.write-with-ai__tags-container{display:flex;flex-flow:row nowrap;align-items:center;gap:4px;flex:1;min-width:0;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.write-with-ai__tags-container::-webkit-scrollbar{display:none}.write-with-ai__tags-arrows{display:flex;align-items:center;gap:4px;flex-shrink:0}.write-with-ai__status-actions{display:flex;gap:8px;justify-content:flex-end}.write-with-ai__caveat{font-size:12px}@keyframes pulse-text{0%,to{opacity:1}50%{opacity:.5}}:host ::ng-deep .write-with-ai__host textarea{padding-bottom:48px!important}\n"]
815
+ }]
816
+ }],
817
+ ctorParameters: () => [],
818
+ propDecorators: {
819
+ value: [{
820
+ type: i0.Input,
821
+ args: [{
822
+ isSignal: true,
823
+ alias: "value",
824
+ required: false
825
+ }]
826
+ }],
827
+ standalone: [{
828
+ type: i0.Input,
829
+ args: [{
830
+ isSignal: true,
831
+ alias: "standalone",
832
+ required: false
833
+ }]
834
+ }],
835
+ defaultOpen: [{
836
+ type: i0.Input,
837
+ args: [{
838
+ isSignal: true,
839
+ alias: "defaultOpen",
840
+ required: false
841
+ }]
842
+ }],
843
+ fieldLabel: [{
844
+ type: i0.Input,
845
+ args: [{
846
+ isSignal: true,
847
+ alias: "fieldLabel",
848
+ required: false
849
+ }]
850
+ }],
851
+ header: [{
852
+ type: i0.Input,
853
+ args: [{
854
+ isSignal: true,
855
+ alias: "header",
856
+ required: false
857
+ }]
858
+ }],
859
+ placeholder: [{
860
+ type: i0.Input,
861
+ args: [{
862
+ isSignal: true,
863
+ alias: "placeholder",
864
+ required: false
865
+ }]
866
+ }],
867
+ promptValue: [{
868
+ type: i0.Input,
869
+ args: [{
870
+ isSignal: true,
871
+ alias: "promptValue",
872
+ required: false
873
+ }]
874
+ }],
875
+ tags: [{
876
+ type: i0.Input,
877
+ args: [{
878
+ isSignal: true,
879
+ alias: "tags",
880
+ required: false
881
+ }]
882
+ }],
883
+ status: [{
884
+ type: i0.Input,
885
+ args: [{
886
+ isSignal: true,
887
+ alias: "status",
888
+ required: false
889
+ }]
890
+ }],
891
+ subheader: [{
892
+ type: i0.Input,
893
+ args: [{
894
+ isSignal: true,
895
+ alias: "subheader",
896
+ required: false
897
+ }]
898
+ }],
899
+ llmConfig: [{
900
+ type: i0.Input,
901
+ args: [{
902
+ isSignal: true,
903
+ alias: "llmConfig",
904
+ required: false
905
+ }]
906
+ }],
907
+ fullHeight: [{
908
+ type: i0.Input,
909
+ args: [{
910
+ isSignal: true,
911
+ alias: "fullHeight",
912
+ required: false
913
+ }]
914
+ }],
915
+ borderless: [{
916
+ type: i0.Input,
917
+ args: [{
918
+ isSignal: true,
919
+ alias: "borderless",
920
+ required: false
921
+ }]
922
+ }],
923
+ tagsOnly: [{
924
+ type: i0.Input,
925
+ args: [{
926
+ isSignal: true,
927
+ alias: "tagsOnly",
928
+ required: false
929
+ }]
930
+ }],
931
+ metadata: [{
932
+ type: i0.Input,
933
+ args: [{
934
+ isSignal: true,
935
+ alias: "metadata",
936
+ required: false
937
+ }]
938
+ }],
939
+ valueChange: [{
940
+ type: i0.Output,
941
+ args: ["valueChange"]
942
+ }],
943
+ promptChange: [{
944
+ type: i0.Output,
945
+ args: ["promptChange"]
946
+ }],
947
+ promptSubmit: [{
948
+ type: i0.Output,
949
+ args: ["promptSubmit"]
950
+ }],
951
+ cancelPending: [{
952
+ type: i0.Output,
953
+ args: ["cancelPending"]
954
+ }],
955
+ acceptResult: [{
956
+ type: i0.Output,
957
+ args: ["acceptResult"]
958
+ }],
959
+ requestRefine: [{
960
+ type: i0.Output,
961
+ args: ["requestRefine"]
962
+ }],
963
+ tagsScrollRef: [{
964
+ type: i0.ViewChild,
965
+ args: ["tagsScrollContainer", { isSignal: true }]
966
+ }]
967
+ }
968
+ });
969
+ var WriteWithAiComponentModule = class WriteWithAiComponentModule {
970
+ static {
971
+ this.ɵfac = i0.ɵɵngDeclareFactory({
972
+ minVersion: "12.0.0",
973
+ version: "22.2.4",
974
+ ngImport: i0,
975
+ type: WriteWithAiComponentModule,
976
+ deps: [],
977
+ target: i0.ɵɵFactoryTarget.NgModule
978
+ });
979
+ }
980
+ static {
981
+ this.ɵmod = i0.ɵɵngDeclareNgModule({
982
+ minVersion: "14.0.0",
983
+ version: "22.2.4",
984
+ ngImport: i0,
985
+ type: WriteWithAiComponentModule,
986
+ imports: [WriteWithAiComponent],
987
+ exports: [WriteWithAiComponent]
988
+ });
989
+ }
990
+ static {
991
+ this.ɵinj = i0.ɵɵngDeclareInjector({
992
+ minVersion: "12.0.0",
993
+ version: "22.2.4",
994
+ ngImport: i0,
995
+ type: WriteWithAiComponentModule,
996
+ imports: [WriteWithAiComponent]
997
+ });
998
+ }
999
+ };
1000
+ i0.ɵɵngDeclareClassMetadata({
1001
+ minVersion: "12.0.0",
1002
+ version: "22.2.4",
1003
+ ngImport: i0,
1004
+ type: WriteWithAiComponentModule,
1005
+ decorators: [{
1006
+ type: NgModule,
1007
+ args: [{
1008
+ imports: [WriteWithAiComponent],
1009
+ exports: [WriteWithAiComponent]
1010
+ }]
1011
+ }]
1012
+ });
458
1013
  export { WriteWithAiComponent, WriteWithAiComponentModule, WriteWithAiLlmService };
459
- //# sourceMappingURL=testgorilla-tgo-ui-components-write-with-ai.mjs.map
1014
+
1015
+ //# sourceMappingURL=testgorilla-tgo-ui-components-write-with-ai.mjs.map