@carbon/ai-chat 1.13.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/css/chat-explainability-popover.css +161 -0
- package/dist/es/aiChatEntry.js +14 -2
- package/dist/es/aiChatEntry.js.map +1 -1
- package/dist/es/chat.ChatAppEntry.js +113 -21
- package/dist/es/chat.ChatAppEntry.js.map +1 -1
- package/dist/es/chat.index.js +581 -0
- package/dist/es/chat.index.js.map +1 -0
- package/dist/es/chat.languageUtils.js +2 -0
- package/dist/es/chat.languageUtils.js.map +1 -1
- package/dist/es/web-components/cds-aichat-container/index.js +10 -500
- package/dist/es/web-components/cds-aichat-container/index.js.map +1 -1
- package/dist/es/web-components/cds-aichat-custom-element/index.js +19 -227
- package/dist/es/web-components/cds-aichat-custom-element/index.js.map +1 -1
- package/dist/es-custom/aiChatEntry.js +14 -2
- package/dist/es-custom/aiChatEntry.js.map +1 -1
- package/dist/es-custom/chat.ChatAppEntry.js +113 -21
- package/dist/es-custom/chat.ChatAppEntry.js.map +1 -1
- package/dist/es-custom/chat.index.js +581 -0
- package/dist/es-custom/chat.index.js.map +1 -0
- package/dist/es-custom/chat.languageUtils.js +2 -0
- package/dist/es-custom/chat.languageUtils.js.map +1 -1
- package/dist/es-custom/web-components/cds-aichat-container/index.js +10 -500
- package/dist/es-custom/web-components/cds-aichat-container/index.js.map +1 -1
- package/dist/es-custom/web-components/cds-aichat-custom-element/index.js +19 -227
- package/dist/es-custom/web-components/cds-aichat-custom-element/index.js.map +1 -1
- package/dist/scss/_chat-explainability-popover.scss +154 -0
- package/dist/types/aiChatEntry.d.ts +2 -2
- package/dist/types/{serverEntry-CU81SMOz.d.ts → serverEntry-mONw-M8N.d.ts} +206 -47
- package/dist/types/serverEntry.d.ts +1 -1
- package/package.json +5 -5
- package/telemetry.yml +3 -24
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { F as FlattenedConfigElement } from "../../chat.index.js";
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
export { C as __cds_custom_aichat_container_register } from "../../chat.index.js";
|
|
6
|
+
|
|
7
|
+
import { html } from "lit";
|
|
6
8
|
|
|
7
9
|
import { property, state } from "lit/decorators.js";
|
|
8
10
|
|
|
@@ -228,7 +230,7 @@ import "dayjs/locale/en.js";
|
|
|
228
230
|
|
|
229
231
|
var ChatCustomElement_1;
|
|
230
232
|
|
|
231
|
-
let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends
|
|
233
|
+
let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends FlattenedConfigElement {
|
|
232
234
|
constructor() {
|
|
233
235
|
super(...arguments);
|
|
234
236
|
this._userDefinedSlotNames = [];
|
|
@@ -275,10 +277,12 @@ let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends Li
|
|
|
275
277
|
handler: this.userDefinedHandler
|
|
276
278
|
});
|
|
277
279
|
}
|
|
278
|
-
this.
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
280
|
+
if (!this.renderCustomMessageFooter) {
|
|
281
|
+
this._instance.on({
|
|
282
|
+
type: BusEventType.CUSTOM_FOOTER_SLOT,
|
|
283
|
+
handler: this.customFooterHandler
|
|
284
|
+
});
|
|
285
|
+
}
|
|
282
286
|
this.addWriteableElementSlots();
|
|
283
287
|
await (this.onBeforeRender?.(instance));
|
|
284
288
|
};
|
|
@@ -288,90 +292,6 @@ let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends Li
|
|
|
288
292
|
root.adoptedStyleSheets = [ ...root.adoptedStyleSheets, ChatCustomElement_1.hideSheet ];
|
|
289
293
|
return root;
|
|
290
294
|
}
|
|
291
|
-
get resolvedConfig() {
|
|
292
|
-
const baseConfig = this.config ?? {};
|
|
293
|
-
const resolvedConfig = {
|
|
294
|
-
...baseConfig
|
|
295
|
-
};
|
|
296
|
-
if (this.onError !== undefined) {
|
|
297
|
-
resolvedConfig.onError = this.onError;
|
|
298
|
-
}
|
|
299
|
-
if (this.openChatByDefault !== undefined) {
|
|
300
|
-
resolvedConfig.openChatByDefault = this.openChatByDefault;
|
|
301
|
-
}
|
|
302
|
-
if (this.disclaimer !== undefined) {
|
|
303
|
-
resolvedConfig.disclaimer = this.disclaimer;
|
|
304
|
-
}
|
|
305
|
-
if (this.disableCustomElementMobileEnhancements !== undefined) {
|
|
306
|
-
resolvedConfig.disableCustomElementMobileEnhancements = this.disableCustomElementMobileEnhancements;
|
|
307
|
-
}
|
|
308
|
-
if (this.debug !== undefined) {
|
|
309
|
-
resolvedConfig.debug = this.debug;
|
|
310
|
-
}
|
|
311
|
-
if (this.exposeServiceManagerForTesting !== undefined) {
|
|
312
|
-
resolvedConfig.exposeServiceManagerForTesting = this.exposeServiceManagerForTesting;
|
|
313
|
-
}
|
|
314
|
-
if (this.injectCarbonTheme !== undefined) {
|
|
315
|
-
resolvedConfig.injectCarbonTheme = this.injectCarbonTheme;
|
|
316
|
-
}
|
|
317
|
-
if (this.serviceDeskFactory !== undefined) {
|
|
318
|
-
resolvedConfig.serviceDeskFactory = this.serviceDeskFactory;
|
|
319
|
-
}
|
|
320
|
-
if (this.serviceDesk !== undefined) {
|
|
321
|
-
resolvedConfig.serviceDesk = this.serviceDesk;
|
|
322
|
-
}
|
|
323
|
-
if (this.shouldTakeFocusIfOpensAutomatically !== undefined) {
|
|
324
|
-
resolvedConfig.shouldTakeFocusIfOpensAutomatically = this.shouldTakeFocusIfOpensAutomatically;
|
|
325
|
-
}
|
|
326
|
-
if (this.namespace !== undefined) {
|
|
327
|
-
resolvedConfig.namespace = this.namespace;
|
|
328
|
-
}
|
|
329
|
-
if (this.shouldSanitizeHTML !== undefined) {
|
|
330
|
-
resolvedConfig.shouldSanitizeHTML = this.shouldSanitizeHTML;
|
|
331
|
-
}
|
|
332
|
-
if (this.header !== undefined) {
|
|
333
|
-
resolvedConfig.header = this.header;
|
|
334
|
-
}
|
|
335
|
-
if (this.input !== undefined) {
|
|
336
|
-
resolvedConfig.input = this.input;
|
|
337
|
-
}
|
|
338
|
-
if (this.upload !== undefined) {
|
|
339
|
-
resolvedConfig.upload = this.upload;
|
|
340
|
-
}
|
|
341
|
-
if (this.layout !== undefined) {
|
|
342
|
-
resolvedConfig.layout = this.layout;
|
|
343
|
-
}
|
|
344
|
-
if (this.messaging !== undefined) {
|
|
345
|
-
resolvedConfig.messaging = this.messaging;
|
|
346
|
-
}
|
|
347
|
-
if (this.isReadonly !== undefined) {
|
|
348
|
-
resolvedConfig.isReadonly = this.isReadonly;
|
|
349
|
-
}
|
|
350
|
-
if (this.assistantName !== undefined) {
|
|
351
|
-
resolvedConfig.assistantName = this.assistantName;
|
|
352
|
-
}
|
|
353
|
-
if (this.assistantAvatarUrl !== undefined) {
|
|
354
|
-
resolvedConfig.assistantAvatarUrl = this.assistantAvatarUrl;
|
|
355
|
-
}
|
|
356
|
-
if (this.locale !== undefined) {
|
|
357
|
-
resolvedConfig.locale = this.locale;
|
|
358
|
-
}
|
|
359
|
-
if (this.homescreen !== undefined) {
|
|
360
|
-
resolvedConfig.homescreen = this.homescreen;
|
|
361
|
-
}
|
|
362
|
-
if (this.launcher !== undefined) {
|
|
363
|
-
resolvedConfig.launcher = this.launcher;
|
|
364
|
-
}
|
|
365
|
-
if (this.strings !== undefined) {
|
|
366
|
-
resolvedConfig.strings = this.strings;
|
|
367
|
-
}
|
|
368
|
-
if (this.aiDisabled === true) {
|
|
369
|
-
resolvedConfig.aiEnabled = false;
|
|
370
|
-
} else if (this.aiEnabled !== undefined) {
|
|
371
|
-
resolvedConfig.aiEnabled = this.aiEnabled;
|
|
372
|
-
}
|
|
373
|
-
return resolvedConfig;
|
|
374
|
-
}
|
|
375
295
|
addWriteableElementSlots() {
|
|
376
296
|
this._writeableElementSlots = Object.keys(this._instance.writeableElements);
|
|
377
297
|
}
|
|
@@ -379,14 +299,16 @@ let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends Li
|
|
|
379
299
|
return html`
|
|
380
300
|
<cds-custom-aichat-container
|
|
381
301
|
.config=${this.resolvedConfig}
|
|
302
|
+
.header=${this.resolvedConfig.header}
|
|
382
303
|
.onAfterRender=${this.onAfterRender}
|
|
383
304
|
.onBeforeRender=${this.onBeforeRenderOverride}
|
|
384
305
|
.element=${this}
|
|
385
306
|
.renderUserDefinedResponse=${this.renderUserDefinedResponse}
|
|
307
|
+
.renderCustomMessageFooter=${this.renderCustomMessageFooter}
|
|
386
308
|
>
|
|
387
309
|
${this._writeableElementSlots.map(slot => html`<slot name=${slot} slot=${slot}></slot>`)}
|
|
388
310
|
${this.renderUserDefinedResponse ? null : this._userDefinedSlotNames.map(slot => html`<slot name=${slot} slot=${slot}></slot>`)}
|
|
389
|
-
${this._customFooterSlotNames.map(slot => html`<div slot=${slot}><slot name=${slot}></slot></div>`)}
|
|
311
|
+
${this.renderCustomMessageFooter ? null : this._customFooterSlotNames.map(slot => html`<div slot=${slot}><slot name=${slot}></slot></div>`)}
|
|
390
312
|
</cds-custom-aichat-container>
|
|
391
313
|
`;
|
|
392
314
|
}
|
|
@@ -395,143 +317,9 @@ let ChatCustomElement = ChatCustomElement_1 = class ChatCustomElement extends Li
|
|
|
395
317
|
ChatCustomElement.hideSheet = new CSSStyleSheet;
|
|
396
318
|
|
|
397
319
|
(() => {
|
|
398
|
-
ChatCustomElement_1.hideSheet.replaceSync(`\n :host {\n display: block;\n }\n :host(.cds-custom-aichat--hidden) {\n width: 0 !important;\n height: 0 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: 0 !important;\n max-height: 0 !important;\n inline-size: 0 !important;\n block-size: 0 !important;\n min-inline-size: 0 !important;\n min-block-size: 0 !important;\n max-inline-size: 0 !important;\n max-block-size: 0 !important;\n overflow: hidden !important;\n display: block !important;\n }\n `);
|
|
320
|
+
ChatCustomElement_1.hideSheet.replaceSync?.(`\n :host {\n display: block;\n }\n :host(.cds-custom-aichat--hidden) {\n width: 0 !important;\n height: 0 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: 0 !important;\n max-height: 0 !important;\n inline-size: 0 !important;\n block-size: 0 !important;\n min-inline-size: 0 !important;\n min-block-size: 0 !important;\n max-inline-size: 0 !important;\n max-block-size: 0 !important;\n overflow: hidden !important;\n display: block !important;\n }\n `);
|
|
399
321
|
})();
|
|
400
322
|
|
|
401
|
-
__decorate([ property({
|
|
402
|
-
attribute: false,
|
|
403
|
-
type: Object
|
|
404
|
-
}) ], ChatCustomElement.prototype, "config", void 0);
|
|
405
|
-
|
|
406
|
-
__decorate([ property({
|
|
407
|
-
attribute: false
|
|
408
|
-
}) ], ChatCustomElement.prototype, "onError", void 0);
|
|
409
|
-
|
|
410
|
-
__decorate([ property({
|
|
411
|
-
type: Boolean,
|
|
412
|
-
attribute: "open-chat-by-default"
|
|
413
|
-
}) ], ChatCustomElement.prototype, "openChatByDefault", void 0);
|
|
414
|
-
|
|
415
|
-
__decorate([ property({
|
|
416
|
-
type: Object
|
|
417
|
-
}) ], ChatCustomElement.prototype, "disclaimer", void 0);
|
|
418
|
-
|
|
419
|
-
__decorate([ property({
|
|
420
|
-
type: Boolean,
|
|
421
|
-
attribute: "disable-custom-element-mobile-enhancements"
|
|
422
|
-
}) ], ChatCustomElement.prototype, "disableCustomElementMobileEnhancements", void 0);
|
|
423
|
-
|
|
424
|
-
__decorate([ property({
|
|
425
|
-
type: Boolean
|
|
426
|
-
}) ], ChatCustomElement.prototype, "debug", void 0);
|
|
427
|
-
|
|
428
|
-
__decorate([ property({
|
|
429
|
-
type: Boolean,
|
|
430
|
-
attribute: "expose-service-manager-for-testing"
|
|
431
|
-
}) ], ChatCustomElement.prototype, "exposeServiceManagerForTesting", void 0);
|
|
432
|
-
|
|
433
|
-
__decorate([ property({
|
|
434
|
-
type: String,
|
|
435
|
-
attribute: "inject-carbon-theme"
|
|
436
|
-
}) ], ChatCustomElement.prototype, "injectCarbonTheme", void 0);
|
|
437
|
-
|
|
438
|
-
__decorate([ property({
|
|
439
|
-
attribute: "ai-enabled",
|
|
440
|
-
converter: {
|
|
441
|
-
fromAttribute: value => {
|
|
442
|
-
if (value === null) {
|
|
443
|
-
return undefined;
|
|
444
|
-
}
|
|
445
|
-
const v = String(value).trim().toLowerCase();
|
|
446
|
-
const falsey = v === "false" || v === "0" || v === "off" || v === "no";
|
|
447
|
-
return !falsey;
|
|
448
|
-
}
|
|
449
|
-
}
|
|
450
|
-
}) ], ChatCustomElement.prototype, "aiEnabled", void 0);
|
|
451
|
-
|
|
452
|
-
__decorate([ property({
|
|
453
|
-
type: Boolean,
|
|
454
|
-
attribute: "ai-disabled"
|
|
455
|
-
}) ], ChatCustomElement.prototype, "aiDisabled", void 0);
|
|
456
|
-
|
|
457
|
-
__decorate([ property({
|
|
458
|
-
type: Boolean,
|
|
459
|
-
attribute: "should-take-focus-if-opens-automatically"
|
|
460
|
-
}) ], ChatCustomElement.prototype, "shouldTakeFocusIfOpensAutomatically", void 0);
|
|
461
|
-
|
|
462
|
-
__decorate([ property({
|
|
463
|
-
type: String
|
|
464
|
-
}) ], ChatCustomElement.prototype, "namespace", void 0);
|
|
465
|
-
|
|
466
|
-
__decorate([ property({
|
|
467
|
-
type: Boolean,
|
|
468
|
-
attribute: "should-sanitize-html"
|
|
469
|
-
}) ], ChatCustomElement.prototype, "shouldSanitizeHTML", void 0);
|
|
470
|
-
|
|
471
|
-
__decorate([ property({
|
|
472
|
-
type: Object
|
|
473
|
-
}) ], ChatCustomElement.prototype, "header", void 0);
|
|
474
|
-
|
|
475
|
-
__decorate([ property({
|
|
476
|
-
type: Object
|
|
477
|
-
}) ], ChatCustomElement.prototype, "history", void 0);
|
|
478
|
-
|
|
479
|
-
__decorate([ property({
|
|
480
|
-
type: Object
|
|
481
|
-
}) ], ChatCustomElement.prototype, "input", void 0);
|
|
482
|
-
|
|
483
|
-
__decorate([ property({
|
|
484
|
-
attribute: false,
|
|
485
|
-
type: Object
|
|
486
|
-
}) ], ChatCustomElement.prototype, "upload", void 0);
|
|
487
|
-
|
|
488
|
-
__decorate([ property({
|
|
489
|
-
type: Object
|
|
490
|
-
}) ], ChatCustomElement.prototype, "layout", void 0);
|
|
491
|
-
|
|
492
|
-
__decorate([ property({
|
|
493
|
-
type: Object
|
|
494
|
-
}) ], ChatCustomElement.prototype, "messaging", void 0);
|
|
495
|
-
|
|
496
|
-
__decorate([ property({
|
|
497
|
-
type: Boolean,
|
|
498
|
-
attribute: "is-readonly"
|
|
499
|
-
}) ], ChatCustomElement.prototype, "isReadonly", void 0);
|
|
500
|
-
|
|
501
|
-
__decorate([ property({
|
|
502
|
-
type: String,
|
|
503
|
-
attribute: "assistant-name"
|
|
504
|
-
}) ], ChatCustomElement.prototype, "assistantName", void 0);
|
|
505
|
-
|
|
506
|
-
__decorate([ property({
|
|
507
|
-
type: String
|
|
508
|
-
}) ], ChatCustomElement.prototype, "assistantAvatarUrl", void 0);
|
|
509
|
-
|
|
510
|
-
__decorate([ property({
|
|
511
|
-
type: String
|
|
512
|
-
}) ], ChatCustomElement.prototype, "locale", void 0);
|
|
513
|
-
|
|
514
|
-
__decorate([ property({
|
|
515
|
-
type: Object
|
|
516
|
-
}) ], ChatCustomElement.prototype, "homescreen", void 0);
|
|
517
|
-
|
|
518
|
-
__decorate([ property({
|
|
519
|
-
type: Object
|
|
520
|
-
}) ], ChatCustomElement.prototype, "launcher", void 0);
|
|
521
|
-
|
|
522
|
-
__decorate([ property({
|
|
523
|
-
attribute: false
|
|
524
|
-
}) ], ChatCustomElement.prototype, "serviceDeskFactory", void 0);
|
|
525
|
-
|
|
526
|
-
__decorate([ property({
|
|
527
|
-
type: Object,
|
|
528
|
-
attribute: "service-desk"
|
|
529
|
-
}) ], ChatCustomElement.prototype, "serviceDesk", void 0);
|
|
530
|
-
|
|
531
|
-
__decorate([ property({
|
|
532
|
-
type: Object
|
|
533
|
-
}) ], ChatCustomElement.prototype, "strings", void 0);
|
|
534
|
-
|
|
535
323
|
__decorate([ property({
|
|
536
324
|
attribute: false
|
|
537
325
|
}) ], ChatCustomElement.prototype, "onBeforeRender", void 0);
|
|
@@ -548,6 +336,10 @@ __decorate([ property({
|
|
|
548
336
|
attribute: false
|
|
549
337
|
}) ], ChatCustomElement.prototype, "renderUserDefinedResponse", void 0);
|
|
550
338
|
|
|
339
|
+
__decorate([ property({
|
|
340
|
+
attribute: false
|
|
341
|
+
}) ], ChatCustomElement.prototype, "renderCustomMessageFooter", void 0);
|
|
342
|
+
|
|
551
343
|
__decorate([ state() ], ChatCustomElement.prototype, "_userDefinedSlotNames", void 0);
|
|
552
344
|
|
|
553
345
|
__decorate([ state() ], ChatCustomElement.prototype, "_writeableElementSlots", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../../src/web-components/cds-custom-aichat-custom-element/index.ts"],"sourcesContent":["/*\n * Copyright IBM Corp. 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @license\n */\n\n// Ensure the container custom element is registered whenever the\n// custom element module is imported by re-exporting its exports.\n// This prevents bundlers (and our own multi-entry Rollup build)\n// from pruning the side-effect-only import.\nexport { default as __cds-custom_aichat_container_register } from \"../cds-custom-aichat-container\";\nimport \"../cds-custom-aichat-container\";\n\nimport { html, LitElement } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n\nimport { carbonElement } from \"@carbon/ai-chat-components/es-custom/globals/decorators/index.js\";\nimport {\n PublicConfig,\n OnErrorData,\n DisclaimerPublicConfig,\n CarbonTheme,\n HeaderConfig,\n HistoryConfig,\n LayoutConfig,\n PublicConfigMessaging,\n LanguagePack,\n InputConfig,\n UploadConfig,\n} from \"../../types/config/PublicConfig\";\nimport { DeepPartial } from \"../../types/utilities/DeepPartial\";\nimport { HomeScreenConfig } from \"../../types/config/HomeScreenConfig\";\nimport { LauncherConfig } from \"../../types/config/LauncherConfig\";\nimport type {\n ServiceDesk,\n ServiceDeskFactoryParameters,\n ServiceDeskPublicConfig,\n} from \"../../types/config/ServiceDeskConfig\";\nimport { ChatInstance } from \"../../types/instance/ChatInstance\";\nimport {\n BusEventChunkUserDefinedResponse,\n BusEventCustomFooterSlot,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n} from \"../../types/events/eventBusTypes\";\nimport type { WCRenderUserDefinedResponse } from \"../../types/component/ChatContainer\";\n\n/**\n * cds-custom-aichat-custom-element will is a pass through to cds-custom-aichat-container. It takes any user_defined and writeable element\n * slotted content and forwards it to cds-custom-aichat-container. It also will setup the custom element with a default viewChange\n * pattern (e.g. hiding and showing the custom element when the chat should be open/closed) if a onViewChange property is not\n * defined. Finally, it registers the custom element with cds-custom-aichat-container so a default \"floating\" element will not be created.\n *\n * The custom element should be sized using external CSS. When hidden, the 'cds-custom-aichat--hidden' class is added to set dimensions to 0x0.\n */\n@carbonElement(\"cds-custom-aichat-custom-element\")\nclass ChatCustomElement extends LitElement {\n @property({ attribute: false, type: Object })\n config?: PublicConfig;\n\n /**\n * Shared stylesheet for hiding styles.\n */\n private static hideSheet = new CSSStyleSheet();\n static {\n // Hide styles that override any external sizing\n ChatCustomElement.hideSheet.replaceSync(`\n :host {\n display: block;\n }\n :host(.cds-custom-aichat--hidden) {\n width: 0 !important;\n height: 0 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: 0 !important;\n max-height: 0 !important;\n inline-size: 0 !important;\n block-size: 0 !important;\n min-inline-size: 0 !important;\n min-block-size: 0 !important;\n max-inline-size: 0 !important;\n max-block-size: 0 !important;\n overflow: hidden !important;\n display: block !important;\n }\n `);\n }\n\n /**\n * Adopt our stylesheet into every shadowRoot.\n */\n protected createRenderRoot(): ShadowRoot {\n // Lits default createRenderRoot actually returns a ShadowRoot\n const root = super.createRenderRoot() as ShadowRoot;\n\n // now TS knows root.adoptedStyleSheets exists\n root.adoptedStyleSheets = [\n ...root.adoptedStyleSheets,\n ChatCustomElement.hideSheet,\n ];\n return root;\n }\n\n // Flattened PublicConfig properties\n @property({ attribute: false })\n onError?: (data: OnErrorData) => void;\n\n @property({ type: Boolean, attribute: \"open-chat-by-default\" })\n openChatByDefault?: boolean;\n\n @property({ type: Object })\n disclaimer?: DisclaimerPublicConfig;\n\n @property({\n type: Boolean,\n attribute: \"disable-custom-element-mobile-enhancements\",\n })\n disableCustomElementMobileEnhancements?: boolean;\n\n @property({ type: Boolean })\n debug?: boolean;\n\n @property({ type: Boolean, attribute: \"expose-service-manager-for-testing\" })\n exposeServiceManagerForTesting?: boolean;\n\n @property({ type: String, attribute: \"inject-carbon-theme\" })\n injectCarbonTheme?: CarbonTheme;\n\n @property({\n attribute: \"ai-enabled\",\n converter: {\n fromAttribute: (value: string | null) => {\n if (value === null) {\n return undefined;\n }\n const v = String(value).trim().toLowerCase();\n const falsey = v === \"false\" || v === \"0\" || v === \"off\" || v === \"no\";\n return !falsey;\n },\n },\n })\n aiEnabled?: boolean;\n\n @property({ type: Boolean, attribute: \"ai-disabled\" })\n aiDisabled?: boolean;\n\n @property({\n type: Boolean,\n attribute: \"should-take-focus-if-opens-automatically\",\n })\n shouldTakeFocusIfOpensAutomatically?: boolean;\n\n @property({ type: String })\n namespace?: string;\n\n @property({ type: Boolean, attribute: \"should-sanitize-html\" })\n shouldSanitizeHTML?: boolean;\n\n @property({ type: Object })\n header?: HeaderConfig;\n\n @property({ type: Object })\n history?: HistoryConfig;\n\n @property({ type: Object })\n input?: InputConfig;\n\n @property({ attribute: false, type: Object })\n upload?: UploadConfig;\n\n @property({ type: Object })\n layout?: LayoutConfig;\n\n @property({ type: Object })\n messaging?: PublicConfigMessaging;\n\n @property({ type: Boolean, attribute: \"is-readonly\" })\n isReadonly?: boolean;\n\n @property({ type: String, attribute: \"assistant-name\" })\n assistantName?: string;\n\n @property({ type: String })\n assistantAvatarUrl?: string;\n\n @property({ type: String })\n locale?: string;\n\n @property({ type: Object })\n homescreen?: HomeScreenConfig;\n\n @property({ type: Object })\n launcher?: LauncherConfig;\n\n /** A factory for the {@link ServiceDesk} integration. */\n @property({ attribute: false })\n serviceDeskFactory?: (\n parameters: ServiceDeskFactoryParameters,\n ) => Promise<ServiceDesk>;\n\n /** Public configuration for the service desk integration. */\n @property({ type: Object, attribute: \"service-desk\" })\n serviceDesk?: ServiceDeskPublicConfig;\n\n /** Optional partial language pack overrides */\n @property({ type: Object })\n strings?: DeepPartial<LanguagePack>;\n\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n @property({ attribute: false })\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n @property({ attribute: false })\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * Called before a view change (chat opening/closing). The chat will hide the chat shell inside your custom element\n * to prevent invisible keyboard stops when the view change is complete.\n *\n * Use this callback to update your CSS class name values on this element before the view change happens if you want to add any open/close\n * animations to your custom element before the chat shell inner contents are hidden. It is async and so you can\n * tie it to native the AnimationEvent and only return when your animations have completed.\n *\n * A common pattern is to use this for when the chat is closing and to use onViewChange for when the chat opens.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the\n * chat renders. After Carbon AI Chat is loaded, the callback will not be updated.\n */\n @property()\n onViewPreChange?: (event: BusEventViewPreChange) => Promise<void> | void;\n\n /**\n * Called when the chat view change is complete. If no callback is provided here, the default behavior will be to set\n * the chat shell to 0x0 size and set all inner contents aside from the launcher, if you are using it, to display: none.\n * The inner contents of the chat shell (aside from the launcher if you are using it) are always set to display: none\n * regardless of what is configured with this callback to prevent invisible tab stops and screen reader issues.\n *\n * Use this callback to update your className value when the chat has finished being opened or closed.\n *\n * You can provide a different callback here if you want custom animation behavior when the chat is opened or closed.\n * The animation behavior defined here will run in concert with the chat inside your custom container being hidden.\n *\n * If you want to run animations before the inner contents of the chat shell is shrunk and the inner contents are hidden,\n * make use of onViewPreChange.\n *\n * A common pattern is to use this for when the chat is opening and to use onViewPreChange for when the chat closes.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the\n * chat renders. After Carbon AI Chat is loaded, the callback will not be updated.\n */\n @property()\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n\n /**\n * Optional callback to render user defined responses. When provided, the inner cds-custom-aichat-container\n * manages all event listening, slot tracking, and element lifecycle.\n */\n @property({ attribute: false })\n renderUserDefinedResponse?: WCRenderUserDefinedResponse;\n\n @state()\n private _userDefinedSlotNames: string[] = [];\n\n @state()\n private _writeableElementSlots: string[] = [];\n\n @state()\n private _customFooterSlotNames: string[] = [];\n\n @state()\n private _instance!: ChatInstance;\n\n private defaultViewChangeHandler = (event: BusEventViewChange) => {\n if (event.newViewState.mainWindow) {\n this.classList.remove(\"cds-custom-aichat--hidden\");\n } else {\n this.classList.add(\"cds-custom-aichat--hidden\");\n }\n };\n\n private userDefinedHandler = (\n event: BusEventUserDefinedResponse | BusEventChunkUserDefinedResponse,\n ) => {\n const { slot } = event.data;\n if (!this._userDefinedSlotNames.includes(slot)) {\n this._userDefinedSlotNames = [...this._userDefinedSlotNames, slot];\n }\n };\n\n private customFooterHandler = (event: BusEventCustomFooterSlot) => {\n const { slotName } = event.data;\n if (!this._customFooterSlotNames.includes(slotName)) {\n this._customFooterSlotNames = [...this._customFooterSlotNames, slotName];\n }\n };\n\n private get resolvedConfig(): PublicConfig {\n const baseConfig = this.config ?? {};\n const resolvedConfig: PublicConfig = { ...baseConfig };\n\n if (this.onError !== undefined) {\n resolvedConfig.onError = this.onError;\n }\n if (this.openChatByDefault !== undefined) {\n resolvedConfig.openChatByDefault = this.openChatByDefault;\n }\n if (this.disclaimer !== undefined) {\n resolvedConfig.disclaimer = this.disclaimer;\n }\n if (this.disableCustomElementMobileEnhancements !== undefined) {\n resolvedConfig.disableCustomElementMobileEnhancements =\n this.disableCustomElementMobileEnhancements;\n }\n if (this.debug !== undefined) {\n resolvedConfig.debug = this.debug;\n }\n if (this.exposeServiceManagerForTesting !== undefined) {\n resolvedConfig.exposeServiceManagerForTesting =\n this.exposeServiceManagerForTesting;\n }\n if (this.injectCarbonTheme !== undefined) {\n resolvedConfig.injectCarbonTheme = this.injectCarbonTheme;\n }\n if (this.serviceDeskFactory !== undefined) {\n resolvedConfig.serviceDeskFactory = this.serviceDeskFactory;\n }\n if (this.serviceDesk !== undefined) {\n resolvedConfig.serviceDesk = this.serviceDesk;\n }\n if (this.shouldTakeFocusIfOpensAutomatically !== undefined) {\n resolvedConfig.shouldTakeFocusIfOpensAutomatically =\n this.shouldTakeFocusIfOpensAutomatically;\n }\n if (this.namespace !== undefined) {\n resolvedConfig.namespace = this.namespace;\n }\n if (this.shouldSanitizeHTML !== undefined) {\n resolvedConfig.shouldSanitizeHTML = this.shouldSanitizeHTML;\n }\n if (this.header !== undefined) {\n resolvedConfig.header = this.header;\n }\n if (this.input !== undefined) {\n resolvedConfig.input = this.input;\n }\n if (this.upload !== undefined) {\n resolvedConfig.upload = this.upload;\n }\n if (this.layout !== undefined) {\n resolvedConfig.layout = this.layout;\n }\n if (this.messaging !== undefined) {\n resolvedConfig.messaging = this.messaging;\n }\n if (this.isReadonly !== undefined) {\n resolvedConfig.isReadonly = this.isReadonly;\n }\n if (this.assistantName !== undefined) {\n resolvedConfig.assistantName = this.assistantName;\n }\n if (this.assistantAvatarUrl !== undefined) {\n resolvedConfig.assistantAvatarUrl = this.assistantAvatarUrl;\n }\n if (this.locale !== undefined) {\n resolvedConfig.locale = this.locale;\n }\n if (this.homescreen !== undefined) {\n resolvedConfig.homescreen = this.homescreen;\n }\n if (this.launcher !== undefined) {\n resolvedConfig.launcher = this.launcher;\n }\n if (this.strings !== undefined) {\n resolvedConfig.strings = this.strings;\n }\n\n if (this.aiDisabled === true) {\n resolvedConfig.aiEnabled = false;\n } else if (this.aiEnabled !== undefined) {\n resolvedConfig.aiEnabled = this.aiEnabled;\n }\n\n return resolvedConfig;\n }\n\n private onBeforeRenderOverride = async (instance: ChatInstance) => {\n this._instance = instance;\n if (this.onViewPreChange) {\n this._instance.on({\n type: BusEventType.VIEW_PRE_CHANGE,\n handler: this.onViewPreChange,\n });\n }\n this._instance.on({\n type: BusEventType.VIEW_CHANGE,\n handler: this.onViewChange || this.defaultViewChangeHandler,\n });\n\n if (!this.renderUserDefinedResponse) {\n // Legacy path: custom-element tracks slot names for manual slotting.\n // When renderUserDefinedResponse is set, the inner cds-custom-aichat-container handles everything.\n this._instance.on({\n type: BusEventType.USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n this._instance.on({\n type: BusEventType.CHUNK_USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n }\n\n this._instance.on({\n type: BusEventType.CUSTOM_FOOTER_SLOT,\n handler: this.customFooterHandler,\n });\n this.addWriteableElementSlots();\n await this.onBeforeRender?.(instance);\n };\n\n private addWriteableElementSlots() {\n this._writeableElementSlots = Object.keys(this._instance.writeableElements);\n }\n\n render() {\n return html`\n <cds-custom-aichat-container\n .config=${this.resolvedConfig}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this.onBeforeRenderOverride}\n .element=${this}\n .renderUserDefinedResponse=${this.renderUserDefinedResponse}\n >\n ${this._writeableElementSlots.map(\n (slot) => html`<slot name=${slot} slot=${slot}></slot>`,\n )}\n ${this.renderUserDefinedResponse\n ? null\n : this._userDefinedSlotNames.map(\n (slot) => html`<slot name=${slot} slot=${slot}></slot>`,\n )}\n ${this._customFooterSlotNames.map(\n (slot) => html`<div slot=${slot}><slot name=${slot}></slot></div>`,\n )}\n </cds-custom-aichat-container>\n `;\n }\n}\n\n/**\n * Attributes interface for the cds-custom-aichat-custom-element web component.\n * This interface extends {@link CdsAiChatContainerAttributes} and {@link PublicConfig} with additional component-specific props,\n * flattening all config properties as top-level properties for better TypeScript IntelliSense.\n *\n * @category Web component\n */\ninterface CdsAiChatCustomElementAttributes extends PublicConfig {\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * An optional listener for \"view:change\" events. Such a listener is required when using a custom element in order\n * to control the visibility of the Carbon AI Chat main window. If no callback is provided here, a default one will be\n * used that injects styling into the app that will show and hide the Carbon AI Chat main window and also change the\n * size of the custom element so it doesn't take up space when the main window is closed.\n *\n * You can provide a different callback here if you want custom behavior such as an animation when the main window\n * is opened or closed.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded. After Carbon AI Chat is loaded, the event\n * handler will not be updated.\n */\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n\n /**\n * Optional callback to render user defined responses. When provided, the inner cds-custom-aichat-container\n * manages all event listening, slot tracking, streaming state, and element lifecycle.\n */\n renderUserDefinedResponse?: WCRenderUserDefinedResponse;\n}\n\nexport { CdsAiChatCustomElementAttributes };\n\nexport default ChatCustomElement;\n"],"names":["ChatCustomElement","ChatCustomElement_1","LitElement","constructor","this","_userDefinedSlotNames","_writeableElementSlots","_customFooterSlotNames","defaultViewChangeHandler","event","newViewState","mainWindow","classList","remove","add","userDefinedHandler","slot","data","includes","customFooterHandler","slotName","onBeforeRenderOverride","async","instance","_instance","onViewPreChange","on","type","BusEventType","VIEW_PRE_CHANGE","handler","VIEW_CHANGE","onViewChange","renderUserDefinedResponse","USER_DEFINED_RESPONSE","CHUNK_USER_DEFINED_RESPONSE","CUSTOM_FOOTER_SLOT","addWriteableElementSlots","onBeforeRender","createRenderRoot","root","super","adoptedStyleSheets","hideSheet","resolvedConfig","baseConfig","config","onError","undefined","openChatByDefault","disclaimer","disableCustomElementMobileEnhancements","debug","exposeServiceManagerForTesting","injectCarbonTheme","serviceDeskFactory","serviceDesk","shouldTakeFocusIfOpensAutomatically","namespace","shouldSanitizeHTML","header","input","upload","layout","messaging","isReadonly","assistantName","assistantAvatarUrl","locale","homescreen","launcher","strings","aiDisabled","aiEnabled","Object","keys","writeableElements","render","html","onAfterRender","map","CSSStyleSheet","replaceSync","__decorate","property","attribute","prototype","Boolean","String","converter","fromAttribute","value","v","trim","toLowerCase","falsey","state","carbonElement","ChatCustomElement_default"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6DA,IAAMA,oBAAiBC,sBAAvB,MAAMD,0BAA0BE;EAAhC,WAAAC;;IAoNUC,KAAAC,wBAAkC;IAGlCD,KAAAE,yBAAmC;IAGnCF,KAAAG,yBAAmC;IAKnCH,KAAAI,2BAA4BC;MAClC,IAAIA,MAAMC,aAAaC,YAAY;QACjCP,KAAKQ,UAAUC,OAAO;AACxB,aAAO;QACLT,KAAKQ,UAAUE,IAAI;AACrB;;IAGMV,KAAAW,qBACNN;MAEA,OAAMO,QAAWP,MAAMQ;MACvB,KAAKb,KAAKC,sBAAsBa,SAASF,OAAO;QAC9CZ,KAAKC,wBAAwB,KAAID,KAAKC,uBAAuBW;AAC/D;;IAGMZ,KAAAe,sBAAuBV;MAC7B,OAAMW,YAAeX,MAAMQ;MAC3B,KAAKb,KAAKG,uBAAuBW,SAASE,WAAW;QACnDhB,KAAKG,yBAAyB,KAAIH,KAAKG,wBAAwBa;AACjE;;IA4FMhB,KAAAiB,yBAAyBC,MAAOC;MACtCnB,KAAKoB,YAAYD;MACjB,IAAInB,KAAKqB,iBAAiB;QACxBrB,KAAKoB,UAAUE,GAAG;UAChBC,MAAMC,aAAaC;UACnBC,SAAS1B,KAAKqB;;AAElB;MACArB,KAAKoB,UAAUE,GAA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A,EADCC,SAAS;EAAEzD,MAAM6D;MACFxF,kBAAAsF,WAAA;;AAGhBH,WAAA,EADCC,SAAS;EAAEzD,MAAM+C;MACY1E,kBAAAsF,WAAA;;AAG9BH,WAAA,EADCC,SAAS;EAAEzD,MAAM+C;MACQ1E,kBAAAsF,WAAA;;AAI1BH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAGGrF,kBAAAsF,WAAA;;AAI1BH,WAAA,EADCC,SAAS;EAAEzD,MAAM+C;EAAQW,WAAW;MACCrF,kBAAAsF,WAAA;;AAItCH,WAAA,EADCC,SAAS;EAAEzD,MAAM+C;MACkB1E,kBAAAsF,WAAA;;AAOpCH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAC2CrF,kBAAAsF,WAAA;;AAMlEH,WAAA,EADCC,SAAS;EAAEC,WAAW;MAC0CrF,kBAAAsF,WAAA;;AAgBjEH,WAAA,EADCC,cACwEpF,kBAAAsF,WAAA;;AAsBzEH,WAAA,EADCC,cAC0EpF,kBAAAsF,WAAA;;AAO3EH,WAAA,EADCC,SAAS;EAAEC,WAAW;MACiCrF,kBAAAsF,WAAA;;AAGhDH,WAAA,EADPa,WAC4ChG,kBAAAsF,WAAA;;AAGrCH,WAAA,EADPa,WAC6ChG,kBAAAsF,WAAA;;AAGtCH,WAAA,EADPa,WAC6ChG,kBAAAsF,WAAA;;AAGtCH,WAAA,EADPa,WACgChG,kBAAAsF,WAAA;;AA7N7BtF,oBAAiBC,sBAAAkF,WAAA,EADtBc,cAAc,gCACTjG;;AAybN,IAAAkG,4BAAelG;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../../src/web-components/cds-custom-aichat-custom-element/index.ts"],"sourcesContent":["/*\n * Copyright IBM Corp. 2025, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @license\n */\n\n// Ensure the container custom element is registered whenever the\n// custom element module is imported by re-exporting its exports.\n// This prevents bundlers (and our own multi-entry Rollup build)\n// from pruning the side-effect-only import.\nexport { default as __cds-custom_aichat_container_register } from \"../cds-custom-aichat-container\";\nimport \"../cds-custom-aichat-container\";\n\nimport { html } from \"lit\";\nimport { property, state } from \"lit/decorators.js\";\n\nimport { carbonElement } from \"@carbon/ai-chat-components/es-custom/globals/decorators/index.js\";\nimport { PublicConfig } from \"../../types/config/PublicConfig\";\nimport { FlattenedConfigElement } from \"../shared/FlattenedConfigElement\";\nimport { ChatInstance } from \"../../types/instance/ChatInstance\";\nimport {\n BusEventChunkUserDefinedResponse,\n BusEventCustomFooterSlot,\n BusEventType,\n BusEventUserDefinedResponse,\n BusEventViewChange,\n BusEventViewPreChange,\n} from \"../../types/events/eventBusTypes\";\nimport type {\n WCRenderCustomMessageFooter,\n WCRenderUserDefinedResponse,\n} from \"../../types/component/ChatContainer\";\n\n/**\n * cds-custom-aichat-custom-element will is a pass through to cds-custom-aichat-container. It takes any user_defined and writeable element\n * slotted content and forwards it to cds-custom-aichat-container. It also will setup the custom element with a default viewChange\n * pattern (e.g. hiding and showing the custom element when the chat should be open/closed) if a onViewChange property is not\n * defined. Finally, it registers the custom element with cds-custom-aichat-container so a default \"floating\" element will not be created.\n *\n * The custom element should be sized using external CSS. When hidden, the 'cds-custom-aichat--hidden' class is added to set dimensions to 0x0.\n */\n@carbonElement(\"cds-custom-aichat-custom-element\")\nclass ChatCustomElement extends FlattenedConfigElement {\n /**\n * Shared stylesheet for hiding styles.\n */\n private static hideSheet = new CSSStyleSheet();\n static {\n // Hide styles that override any external sizing. `replaceSync` is absent\n // in non-browser environments (e.g. the jsdom-based test environment), so\n // skip styling there rather than throwing at module-evaluation time.\n ChatCustomElement.hideSheet.replaceSync?.(`\n :host {\n display: block;\n }\n :host(.cds-custom-aichat--hidden) {\n width: 0 !important;\n height: 0 !important;\n min-width: 0 !important;\n min-height: 0 !important;\n max-width: 0 !important;\n max-height: 0 !important;\n inline-size: 0 !important;\n block-size: 0 !important;\n min-inline-size: 0 !important;\n min-block-size: 0 !important;\n max-inline-size: 0 !important;\n max-block-size: 0 !important;\n overflow: hidden !important;\n display: block !important;\n }\n `);\n }\n\n /**\n * Adopt our stylesheet into every shadowRoot.\n */\n protected createRenderRoot(): ShadowRoot {\n // Lits default createRenderRoot actually returns a ShadowRoot\n const root = super.createRenderRoot() as ShadowRoot;\n\n // now TS knows root.adoptedStyleSheets exists\n root.adoptedStyleSheets = [\n ...root.adoptedStyleSheets,\n ChatCustomElement.hideSheet,\n ];\n return root;\n }\n\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n @property({ attribute: false })\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n @property({ attribute: false })\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * Called before a view change (chat opening/closing). The chat will hide the chat shell inside your custom element\n * to prevent invisible keyboard stops when the view change is complete.\n *\n * Use this callback to update your CSS class name values on this element before the view change happens if you want to add any open/close\n * animations to your custom element before the chat shell inner contents are hidden. It is async and so you can\n * tie it to native the AnimationEvent and only return when your animations have completed.\n *\n * A common pattern is to use this for when the chat is closing and to use onViewChange for when the chat opens.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the\n * chat renders. After Carbon AI Chat is loaded, the callback will not be updated.\n */\n @property()\n onViewPreChange?: (event: BusEventViewPreChange) => Promise<void> | void;\n\n /**\n * Called when the chat view change is complete. If no callback is provided here, the default behavior will be to set\n * the chat shell to 0x0 size and set all inner contents aside from the launcher, if you are using it, to display: none.\n * The inner contents of the chat shell (aside from the launcher if you are using it) are always set to display: none\n * regardless of what is configured with this callback to prevent invisible tab stops and screen reader issues.\n *\n * Use this callback to update your className value when the chat has finished being opened or closed.\n *\n * You can provide a different callback here if you want custom animation behavior when the chat is opened or closed.\n * The animation behavior defined here will run in concert with the chat inside your custom container being hidden.\n *\n * If you want to run animations before the inner contents of the chat shell is shrunk and the inner contents are hidden,\n * make use of onViewPreChange.\n *\n * A common pattern is to use this for when the chat is opening and to use onViewPreChange for when the chat closes.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded as it is registered before the\n * chat renders. After Carbon AI Chat is loaded, the callback will not be updated.\n */\n @property()\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n\n /**\n * Optional callback to render user defined responses. When provided, the inner cds-custom-aichat-container\n * manages all event listening, slot tracking, and element lifecycle.\n */\n @property({ attribute: false })\n renderUserDefinedResponse?: WCRenderUserDefinedResponse;\n\n /**\n * Optional callback to render custom message footers. When provided, the inner cds-custom-aichat-container\n * manages all event listening, slot tracking, and element lifecycle.\n */\n @property({ attribute: false })\n renderCustomMessageFooter?: WCRenderCustomMessageFooter;\n\n @state()\n private _userDefinedSlotNames: string[] = [];\n\n @state()\n private _writeableElementSlots: string[] = [];\n\n @state()\n private _customFooterSlotNames: string[] = [];\n\n @state()\n private _instance!: ChatInstance;\n\n private defaultViewChangeHandler = (event: BusEventViewChange) => {\n if (event.newViewState.mainWindow) {\n this.classList.remove(\"cds-custom-aichat--hidden\");\n } else {\n this.classList.add(\"cds-custom-aichat--hidden\");\n }\n };\n\n private userDefinedHandler = (\n event: BusEventUserDefinedResponse | BusEventChunkUserDefinedResponse,\n ) => {\n const { slot } = event.data;\n if (!this._userDefinedSlotNames.includes(slot)) {\n this._userDefinedSlotNames = [...this._userDefinedSlotNames, slot];\n }\n };\n\n private customFooterHandler = (event: BusEventCustomFooterSlot) => {\n const { slotName } = event.data;\n if (!this._customFooterSlotNames.includes(slotName)) {\n this._customFooterSlotNames = [...this._customFooterSlotNames, slotName];\n }\n };\n\n private onBeforeRenderOverride = async (instance: ChatInstance) => {\n this._instance = instance;\n if (this.onViewPreChange) {\n this._instance.on({\n type: BusEventType.VIEW_PRE_CHANGE,\n handler: this.onViewPreChange,\n });\n }\n this._instance.on({\n type: BusEventType.VIEW_CHANGE,\n handler: this.onViewChange || this.defaultViewChangeHandler,\n });\n\n if (!this.renderUserDefinedResponse) {\n // Legacy path: custom-element tracks slot names for manual slotting.\n // When renderUserDefinedResponse is set, the inner cds-custom-aichat-container handles everything.\n this._instance.on({\n type: BusEventType.USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n this._instance.on({\n type: BusEventType.CHUNK_USER_DEFINED_RESPONSE,\n handler: this.userDefinedHandler,\n });\n }\n\n if (!this.renderCustomMessageFooter) {\n // Legacy path: custom-element tracks slot names for manual slotting.\n // When renderCustomMessageFooter is set, the inner cds-custom-aichat-container handles everything.\n this._instance.on({\n type: BusEventType.CUSTOM_FOOTER_SLOT,\n handler: this.customFooterHandler,\n });\n }\n this.addWriteableElementSlots();\n await this.onBeforeRender?.(instance);\n };\n\n private addWriteableElementSlots() {\n this._writeableElementSlots = Object.keys(this._instance.writeableElements);\n }\n\n render() {\n return html`\n <cds-custom-aichat-container\n .config=${this.resolvedConfig}\n .header=${this.resolvedConfig.header}\n .onAfterRender=${this.onAfterRender}\n .onBeforeRender=${this.onBeforeRenderOverride}\n .element=${this}\n .renderUserDefinedResponse=${this.renderUserDefinedResponse}\n .renderCustomMessageFooter=${this.renderCustomMessageFooter}\n >\n ${this._writeableElementSlots.map(\n (slot) => html`<slot name=${slot} slot=${slot}></slot>`,\n )}\n ${this.renderUserDefinedResponse\n ? null\n : this._userDefinedSlotNames.map(\n (slot) => html`<slot name=${slot} slot=${slot}></slot>`,\n )}\n ${this.renderCustomMessageFooter\n ? null\n : this._customFooterSlotNames.map(\n (slot) =>\n html`<div slot=${slot}><slot name=${slot}></slot></div>`,\n )}\n </cds-custom-aichat-container>\n `;\n }\n}\n\n/**\n * Attributes interface for the cds-custom-aichat-custom-element web component.\n * This interface extends {@link PublicConfig} with additional component-specific props,\n * flattening all config properties as top-level properties for better TypeScript IntelliSense.\n *\n * @category Web component\n */\ninterface CdsAiChatCustomElementAttributes extends PublicConfig {\n /**\n * This function is called before the render function of Carbon AI Chat is called. This function can return a Promise\n * which will cause Carbon AI Chat to wait for it before rendering.\n */\n onBeforeRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * This function is called after the render function of Carbon AI Chat is called.\n */\n onAfterRender?: (instance: ChatInstance) => Promise<void> | void;\n\n /**\n * An optional listener for \"view:change\" events. Such a listener is required when using a custom element in order\n * to control the visibility of the Carbon AI Chat main window. If no callback is provided here, a default one will be\n * used that injects styling into the app that will show and hide the Carbon AI Chat main window and also change the\n * size of the custom element so it doesn't take up space when the main window is closed.\n *\n * You can provide a different callback here if you want custom behavior such as an animation when the main window\n * is opened or closed.\n *\n * Note that this function can only be provided before Carbon AI Chat is loaded. After Carbon AI Chat is loaded, the event\n * handler will not be updated.\n */\n onViewChange?: (event: BusEventViewChange, instance: ChatInstance) => void;\n\n /**\n * Optional callback to render user defined responses. When provided, the inner cds-custom-aichat-container\n * manages all event listening, slot tracking, streaming state, and element lifecycle.\n */\n renderUserDefinedResponse?: WCRenderUserDefinedResponse;\n\n /**\n * Optional callback to render custom message footers. When provided, the inner cds-custom-aichat-container\n * manages all event listening, slot tracking, and element lifecycle.\n */\n renderCustomMessageFooter?: WCRenderCustomMessageFooter;\n}\n\nexport { CdsAiChatCustomElementAttributes };\n\nexport default ChatCustomElement;\n"],"names":["ChatCustomElement","ChatCustomElement_1","FlattenedConfigElement","constructor","this","_userDefinedSlotNames","_writeableElementSlots","_customFooterSlotNames","defaultViewChangeHandler","event","newViewState","mainWindow","classList","remove","add","userDefinedHandler","slot","data","includes","customFooterHandler","slotName","onBeforeRenderOverride","async","instance","_instance","onViewPreChange","on","type","BusEventType","VIEW_PRE_CHANGE","handler","VIEW_CHANGE","onViewChange","renderUserDefinedResponse","USER_DEFINED_RESPONSE","CHUNK_USER_DEFINED_RESPONSE","renderCustomMessageFooter","CUSTOM_FOOTER_SLOT","addWriteableElementSlots","onBeforeRender","createRenderRoot","root","super","adoptedStyleSheets","hideSheet","Object","keys","writeableElements","render","html","resolvedConfig","header","onAfterRender","map","CSSStyleSheet","replaceSync","__dec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AEC,WAAW;MACiC1D,kBAAA2D,WAAA;;AAOxDH,WAAA,EADCC,SAAS;EAAEC,WAAW;MACiC1D,kBAAA2D,WAAA;;AAGhDH,WAAA,EADPI,WAC4C5D,kBAAA2D,WAAA;;AAGrCH,WAAA,EADPI,WAC6C5D,kBAAA2D,WAAA;;AAGtCH,WAAA,EADPI,WAC6C5D,kBAAA2D,WAAA;;AAGtCH,WAAA,EADPI,WACgC5D,kBAAA2D,WAAA;;AA1H7B3D,oBAAiBC,sBAAAuD,WAAA,EADtBK,cAAc,gCACT7D;;AA4QN,IAAA8D,4BAAe9D;;"}
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright IBM Corp. 2026, 2026
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* AI Explainability Popover content styles for Carbon AI Chat.
|
|
10
|
+
* Following @carbon/styles component patterns where styles are wrapped in mixins.
|
|
11
|
+
*
|
|
12
|
+
* These styles provide consistent typography and spacing for AI explainability
|
|
13
|
+
* popover content used in AI Chat.
|
|
14
|
+
*
|
|
15
|
+
* Usage (Sass — mixin, for composing into your own stylesheet):
|
|
16
|
+
* @use "@carbon/ai-chat/scss/chat-explainability-popover";
|
|
17
|
+
* @include chat-explainability-popover.explainability-popover-content;
|
|
18
|
+
*
|
|
19
|
+
* Usage (CSS — pre-compiled, no Sass pipeline needed):
|
|
20
|
+
* @import "@carbon/ai-chat/css/chat-explainability-popover.css";
|
|
21
|
+
*
|
|
22
|
+
* Classes generated:
|
|
23
|
+
* - .cds-aichat-explainability-popover--content — container wrapper
|
|
24
|
+
* - .cds-aichat-explainability-popover--content__header — header section
|
|
25
|
+
* - .cds-aichat-explainability-popover--content__eyebrow-row — top header row with label and tag
|
|
26
|
+
* - .cds-aichat-explainability-popover--content__label — eyebrow label text
|
|
27
|
+
* - .cds-aichat-explainability-popover--content__title — main heading
|
|
28
|
+
* - .cds-aichat-explainability-popover--content__description — description text below title
|
|
29
|
+
* - .cds-aichat-explainability-popover--content__section — content section with spacing
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
@use "@carbon/layout";
|
|
33
|
+
@use "@carbon/styles/scss/theme";
|
|
34
|
+
@use "@carbon/styles/scss/type";
|
|
35
|
+
@use "@carbon/ai-chat-components/scss/utilities" as *;
|
|
36
|
+
|
|
37
|
+
@mixin explainability-popover-content {
|
|
38
|
+
/* ============================================================================
|
|
39
|
+
EXPLAINABILITY POPOVER - CONTENT WRAPPER
|
|
40
|
+
Container for all explainability popover content
|
|
41
|
+
============================================================================ */
|
|
42
|
+
|
|
43
|
+
.#{$prefix}-explainability-popover--content {
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
gap: layout.$spacing-06;
|
|
47
|
+
padding-block-start: layout.$spacing-03;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* ============================================================================
|
|
51
|
+
EXPLAINABILITY POPOVER - HEADER
|
|
52
|
+
Header containing eyebrow label, confidence score, title, and description
|
|
53
|
+
============================================================================ */
|
|
54
|
+
|
|
55
|
+
.#{$prefix}-explainability-popover--content__header {
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: layout.$spacing-03;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/* ============================================================================
|
|
62
|
+
EXPLAINABILITY POPOVER - EYEBROW ROW
|
|
63
|
+
Top row containing label and optional tag/badge
|
|
64
|
+
============================================================================ */
|
|
65
|
+
|
|
66
|
+
.#{$prefix}-explainability-popover--content__eyebrow-row {
|
|
67
|
+
display: flex;
|
|
68
|
+
align-items: center;
|
|
69
|
+
justify-content: space-between;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/* ============================================================================
|
|
73
|
+
EXPLAINABILITY POPOVER - LABEL
|
|
74
|
+
Secondary text label (eyebrow text)
|
|
75
|
+
============================================================================ */
|
|
76
|
+
|
|
77
|
+
.#{$prefix}-explainability-popover--content__label {
|
|
78
|
+
@include type.type-style("label-02");
|
|
79
|
+
|
|
80
|
+
color: theme.$text-secondary;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/* ============================================================================
|
|
84
|
+
EXPLAINABILITY POPOVER - TITLE
|
|
85
|
+
Main heading for the explainability content
|
|
86
|
+
============================================================================ */
|
|
87
|
+
|
|
88
|
+
.#{$prefix}-explainability-popover--content__title {
|
|
89
|
+
@include type.type-style("heading-04");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/* ============================================================================
|
|
93
|
+
EXPLAINABILITY POPOVER - DESCRIPTION
|
|
94
|
+
Text description below header title
|
|
95
|
+
============================================================================ */
|
|
96
|
+
|
|
97
|
+
.#{$prefix}-explainability-popover--content__description {
|
|
98
|
+
@include type.type-style("body-01");
|
|
99
|
+
|
|
100
|
+
color: theme.$text-secondary;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/* ============================================================================
|
|
104
|
+
EXPLAINABILITY POPOVER - CONTENT SECTION
|
|
105
|
+
Reusable section container for markdown or other content blocks
|
|
106
|
+
============================================================================ */
|
|
107
|
+
|
|
108
|
+
// Add top spacing to all sections except the first one
|
|
109
|
+
.#{$prefix}-explainability-popover--content__section {
|
|
110
|
+
display: flex;
|
|
111
|
+
flex-direction: column;
|
|
112
|
+
border-block-start: 1px solid theme.$border-subtle-00;
|
|
113
|
+
gap: layout.$spacing-06;
|
|
114
|
+
padding-block-start: layout.$spacing-06;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Extra padding after last section
|
|
118
|
+
.#{$prefix}-explainability-popover--content__section:last-of-type {
|
|
119
|
+
padding-block-end: layout.$spacing-06;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Subheadings within explainability content sections
|
|
123
|
+
.#{$prefix}-explainability-popover--content__section h3,
|
|
124
|
+
.#{$prefix}-explainability-popover--content__section h4,
|
|
125
|
+
.#{$prefix}-explainability-popover--content__section h5,
|
|
126
|
+
.#{$prefix}-explainability-popover--content__section h6 {
|
|
127
|
+
@include type.type-style("body-01");
|
|
128
|
+
|
|
129
|
+
color: theme.$text-secondary;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.#{$prefix}-explainability-popover--content__section p {
|
|
133
|
+
@include type.type-style("body-01");
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.#{$prefix}-explainability-popover--content__section
|
|
137
|
+
.cds--list--ordered
|
|
138
|
+
.cds--list__item::before {
|
|
139
|
+
position: static;
|
|
140
|
+
display: inline-block;
|
|
141
|
+
margin-inline-end: layout.$spacing-03;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* ============================================================================
|
|
145
|
+
EXPLAINABILITY POPOVER - ACTIONS
|
|
146
|
+
Container for action buttons in the popover
|
|
147
|
+
============================================================================ */
|
|
148
|
+
|
|
149
|
+
.#{$prefix}-explainability-popover--actions {
|
|
150
|
+
display: flex;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@include explainability-popover-content;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { P as PersistedState, C as ChatContainerProps, B as BusEventViewPreChange, a as ChatInstance, b as BusEventViewChange } from './serverEntry-
|
|
2
|
-
export { A as AdditionalDataToAgent, c as AgentAvailability, d as AudioItem, e as AutoScrollOptions, f as BaseGenericItem, g as BaseMessageInput, h as BusEvent, i as BusEventChatReady, j as BusEventChunkUserDefinedResponse, k as BusEventClosePanelButtonClicked, l as BusEventCustomFooterSlot, m as BusEventCustomPanelClose, n as BusEventCustomPanelOpen, o as BusEventCustomPanelPreClose, p as BusEventCustomPanelPreOpen, q as BusEventFeedback, r as BusEventHeaderMenuClick, s as BusEventHistoryBegin, t as BusEventHistoryEnd, u as BusEventHumanAgentAreAnyAgentsOnline, v as BusEventHumanAgentEndChat, w as BusEventHumanAgentPreEndChat, x as BusEventHumanAgentPreReceive, y as BusEventHumanAgentPreSend, z as BusEventHumanAgentPreStartChat, D as BusEventHumanAgentReceive, E as BusEventHumanAgentSend, F as BusEventMessageItemCustom, G as BusEventPreReceive, H as BusEventPreReset, I as BusEventPreSend, J as BusEventReceive, K as BusEventReset, L as BusEventSend, M as BusEventStateChange, N as BusEventType, O as BusEventUserDefinedResponse, Q as BusEventWorkspaceClose, R as BusEventWorkspaceOpen, S as BusEventWorkspacePreClose, T as BusEventWorkspacePreOpen, U as ButtonItem, V as ButtonItemKind, W as ButtonItemType, X as CancellationReason, Y as CarbonTheme, Z as CardItem, _ as CarouselItem, $ as CatastrophicErrorPanelState, a0 as CdsAiChatContainerAttributes, a1 as CdsAiChatCustomElementAttributes, a2 as ChainOfThoughtStep, a3 as ChangeFunction, a4 as ChatInstanceInput, a5 as ChatInstanceMessaging, a6 as ChatInstanceServiceDeskActions, a7 as ChatShortcutConfig, a8 as Chunk, a9 as CompleteItemChunk, aa as ConnectToHumanAgentItem, ab as ConnectToHumanAgentItemTransferInfo, ac as ConnectingErrorInfo, ad as ConversationalSearchItem, ae as ConversationalSearchItemCitation, af as CornersType, ag as CustomMenuOption, ah as CustomPanelConfigOptions, ai as CustomPanelInstance, aj as CustomPanelOpenOptions, ak as CustomPanels, al as CustomSendMessageOptions, am as DateItem, an as DeepPartial, ao as DefaultCustomPanelConfigOptions, ap as DisclaimerPublicConfig, aq as DisconnectedErrorInfo, ar as EndChatInfo, as as ErrorType, at as EventBusHandler, au as EventHandlers, av as EventInput, aw as EventInputData, ax as ExternalFileReference, ay as FeedbackInteractionType, az as FileFieldValue, aA as FileStatusValue, aB as FileUpload, aC as FileUploadCapabilities, aD as FinalResponseChunk, aE as GenericItem, aF as GenericItemCustomFooterSlotOptions, aG as GenericItemMessageFeedbackCategories, aH as GenericItemMessageFeedbackOptions, aI as GenericItemMessageOptions, aJ as GridItem, aK as HeaderConfig, aL as HeaderMenuClickType, aM as HistoryConfig, aN as HistoryItem, aO as HomeScreenConfig, aP as HomeScreenStarterButton, aQ as HomeScreenStarterButtons, aR as HomeScreenState, aS as HorizontalCellAlignment, aT as HumanAgentMessageType, aU as HumanAgentsOnlineStatus, aV as IFrameItem, aW as IFrameItemDisplayOption, aX as ImageItem, aY as IncreaseOrDecrease, aZ as InlineErrorItem, a_ as InlineFile, a$ as InputConfig, b0 as ItemStreamingMetadata, b1 as KeyboardShortcuts, b2 as LanguagePack, b3 as LauncherCallToActionConfig, b4 as LauncherConfig, b5 as LayoutConfig, b6 as LayoutCustomProperties, b7 as MediaFileAccessibility, b8 as MediaItem, b9 as MediaItemDimensions, ba as MediaSubtitleTrack, bb as MediaTranscript, bc as Message, bd as MessageErrorState, be as MessageHistoryFeedback, bf as MessageInput, bg as MessageInputType, bh as MessageItemPanelInfo, bi as MessageOutput, bj as MessageRequest, bk as MessageRequestHistory, bl as MessageResponse, bm as MessageResponseHistory, bn as MessageResponseOptions, bo as MessageResponseTypes, bp as MessageSendSource, bq as MinimizeButtonIconType, br as ObjectMap, bs as OnErrorData, bt as OnErrorType, bu as OptionItem, bv as OptionItemPreference, bw as PageObjectId, bx as PanelType, by as PartialItemChunk, bz as PartialItemChunkWithId, bA as PartialOrCompleteItemChunk, bB as PartialResponse, bC as PauseItem, bD as PerCornerConfig, bE as PersistedHumanAgentState, bF as PreviewCardItem, bG as PublicChatHumanAgentState, bH as PublicChatState, bI as PublicConfig, bJ as PublicConfigMessaging, bK as PublicCustomPanelsState, bL as PublicDefaultCustomPanelState, bM as PublicHistoryPanelState, bN as PublicInputState, bO as PublicWorkspaceCustomPanelState, bP as ReasoningStep, bQ as ReasoningStepOpenState, bR as ReasoningSteps, bS as RenderCustomMessageFooter, bT as
|
|
1
|
+
import { P as PersistedState, C as ChatContainerProps, B as BusEventViewPreChange, a as ChatInstance, b as BusEventViewChange } from './serverEntry-mONw-M8N.js';
|
|
2
|
+
export { A as AdditionalDataToAgent, c as AgentAvailability, d as AudioItem, e as AutoScrollOptions, f as BaseGenericItem, g as BaseMessageInput, h as BusEvent, i as BusEventChatReady, j as BusEventChunkUserDefinedResponse, k as BusEventClosePanelButtonClicked, l as BusEventCustomFooterSlot, m as BusEventCustomPanelClose, n as BusEventCustomPanelOpen, o as BusEventCustomPanelPreClose, p as BusEventCustomPanelPreOpen, q as BusEventFeedback, r as BusEventHeaderMenuClick, s as BusEventHistoryBegin, t as BusEventHistoryEnd, u as BusEventHumanAgentAreAnyAgentsOnline, v as BusEventHumanAgentEndChat, w as BusEventHumanAgentPreEndChat, x as BusEventHumanAgentPreReceive, y as BusEventHumanAgentPreSend, z as BusEventHumanAgentPreStartChat, D as BusEventHumanAgentReceive, E as BusEventHumanAgentSend, F as BusEventMessageItemCustom, G as BusEventPreReceive, H as BusEventPreReset, I as BusEventPreSend, J as BusEventReceive, K as BusEventReset, L as BusEventSend, M as BusEventStateChange, N as BusEventType, O as BusEventUserDefinedResponse, Q as BusEventWorkspaceClose, R as BusEventWorkspaceOpen, S as BusEventWorkspacePreClose, T as BusEventWorkspacePreOpen, U as ButtonItem, V as ButtonItemKind, W as ButtonItemType, X as CancellationReason, Y as CarbonTheme, Z as CardItem, _ as CarouselItem, $ as CatastrophicErrorPanelState, a0 as CdsAiChatContainerAttributes, a1 as CdsAiChatCustomElementAttributes, a2 as ChainOfThoughtStep, a3 as ChangeFunction, a4 as ChatInstanceInput, a5 as ChatInstanceMessaging, a6 as ChatInstanceServiceDeskActions, a7 as ChatShortcutConfig, a8 as Chunk, a9 as CompleteItemChunk, aa as ConnectToHumanAgentItem, ab as ConnectToHumanAgentItemTransferInfo, ac as ConnectingErrorInfo, ad as ConversationalSearchItem, ae as ConversationalSearchItemCitation, af as CornersType, ag as CustomMenuOption, ah as CustomPanelConfigOptions, ai as CustomPanelInstance, aj as CustomPanelOpenOptions, ak as CustomPanels, al as CustomSendMessageOptions, am as DateItem, an as DeepPartial, ao as DefaultCustomPanelConfigOptions, ap as DisclaimerPublicConfig, aq as DisconnectedErrorInfo, ar as EndChatInfo, as as ErrorType, at as EventBusHandler, au as EventHandlers, av as EventInput, aw as EventInputData, ax as ExternalFileReference, ay as FeedbackInteractionType, az as FileFieldValue, aA as FileStatusValue, aB as FileUpload, aC as FileUploadCapabilities, aD as FinalResponseChunk, aE as GenericItem, aF as GenericItemCustomFooterSlotOptions, aG as GenericItemMessageFeedbackCategories, aH as GenericItemMessageFeedbackOptions, aI as GenericItemMessageOptions, aJ as GridItem, aK as HeaderConfig, aL as HeaderMenuClickType, aM as HistoryConfig, aN as HistoryItem, aO as HomeScreenConfig, aP as HomeScreenStarterButton, aQ as HomeScreenStarterButtons, aR as HomeScreenState, aS as HorizontalCellAlignment, aT as HumanAgentMessageType, aU as HumanAgentsOnlineStatus, aV as IFrameItem, aW as IFrameItemDisplayOption, aX as ImageItem, aY as IncreaseOrDecrease, aZ as InlineErrorItem, a_ as InlineFile, a$ as InputConfig, b0 as ItemStreamingMetadata, b1 as KeyboardShortcuts, b2 as LanguagePack, b3 as LauncherCallToActionConfig, b4 as LauncherConfig, b5 as LayoutConfig, b6 as LayoutCustomProperties, b7 as MediaFileAccessibility, b8 as MediaItem, b9 as MediaItemDimensions, ba as MediaSubtitleTrack, bb as MediaTranscript, bc as Message, bd as MessageErrorState, be as MessageHistoryFeedback, bf as MessageInput, bg as MessageInputType, bh as MessageItemPanelInfo, bi as MessageOutput, bj as MessageRequest, bk as MessageRequestHistory, bl as MessageResponse, bm as MessageResponseHistory, bn as MessageResponseOptions, bo as MessageResponseTypes, bp as MessageSendSource, bq as MinimizeButtonIconType, br as ObjectMap, bs as OnErrorData, bt as OnErrorType, bu as OptionItem, bv as OptionItemPreference, bw as PageObjectId, bx as PanelType, by as PartialItemChunk, bz as PartialItemChunkWithId, bA as PartialOrCompleteItemChunk, bB as PartialResponse, bC as PauseItem, bD as PerCornerConfig, bE as PersistedHumanAgentState, bF as PreviewCardItem, bG as PublicChatHumanAgentState, bH as PublicChatState, bI as PublicConfig, bJ as PublicConfigMessaging, bK as PublicCustomPanelsState, bL as PublicDefaultCustomPanelState, bM as PublicHistoryPanelState, bN as PublicInputState, bO as PublicWorkspaceCustomPanelState, bP as ReasoningStep, bQ as ReasoningStepOpenState, bR as ReasoningSteps, bS as RenderCustomMessageFooter, bT as RenderCustomMessageFooterState, bU as RenderUserDefinedResponse, bV as RenderUserDefinedState, bW as RenderWriteableElementResponse, bX as ResolvedCornerConfig, bY as ResponseUserProfile, bZ as ScreenShareState, b_ as SearchResult, b$ as SendOptions, c0 as ServiceDesk, c1 as ServiceDeskCallback, c2 as ServiceDeskCapabilities, c3 as ServiceDeskErrorInfo, c4 as ServiceDeskFactoryParameters, c5 as ServiceDeskPublicConfig, c6 as SingleOption, c7 as StartChatOptions, c8 as StreamChunk, c9 as StructuredData, ca as StructuredField, cb as StructuredFieldType, cc as StructuredFieldValue, cd as SystemMessageItem, ce as SystemMessageVariant, cf as TestId, cg as TextItem, ch as TypeAndHandler, ci as UploadConfig, cj as UserDefinedItem, ck as UserMessageErrorInfo, cl as UserType, cm as VerticalCellAlignment, cn as VideoItem, co as ViewChangeReason, cp as ViewState, cq as ViewType, cr as WCRenderCustomMessageFooter, cs as WCRenderUserDefinedResponse, ct as WidthOptions, cu as WithBodyAndFooter, cv as WithWidthOptions, cw as WorkspaceCustomPanelConfigOptions, cx as WriteableElementName, cy as WriteableElements, cz as enLanguagePack, cA as loadAllLazyDeps } from './serverEntry-mONw-M8N.js';
|
|
3
3
|
import React, { HTMLAttributes } from 'react';
|
|
4
4
|
export { ChainOfThoughtStepStatus } from '@carbon/ai-chat-components/es/components/chain-of-thought/defs.js';
|
|
5
5
|
import '@carbon/web-components/es/components/button/defs.js';
|