@progress/kendo-react-conversational-ui 12.0.0-develop.1 → 12.0.0-develop.11

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/chat/utils.mjs CHANGED
@@ -6,27 +6,29 @@
6
6
  *-------------------------------------------------------------------------------------------
7
7
  */
8
8
  import i from "react";
9
- import { messages as n, chatSenderDeletedMessage as l, chatReceiverDeletedMessage as g } from "../messages/index.mjs";
10
- const m = (t, e) => t && e.author && t.id === e.author.id, p = (t, e) => {
11
- const s = e.toLanguageString(
9
+ import { messages as n, chatSenderDeletedMessage as d, chatReceiverDeletedMessage as g } from "../messages/index.mjs";
10
+ const f = (t, o) => t && o.author && t.id === o.author.id, p = (t, o) => {
11
+ const s = o.toLanguageString(
12
12
  "chatSender.deletedMessage",
13
- n[l]
14
- ), o = e.toLanguageString(
13
+ n[d]
14
+ ), e = o.toLanguageString(
15
15
  "chatReceiver.deletedMessage",
16
16
  n[g]
17
17
  );
18
- return t ? s : o;
19
- }, f = (t) => {
18
+ return t ? s : e;
19
+ }, m = (t) => {
20
20
  navigator.clipboard.writeText(t);
21
- }, T = (t, e) => t.find((s) => s.id === e), M = (t, e) => {
22
- const s = e ? e.querySelector(`[data-message-id="${t}"]`) : document.querySelector(`[data-message-id="${t}"]`);
21
+ }, T = (t, o) => t.find((s) => s.id === o), M = (t, o) => {
22
+ if (!o)
23
+ return;
24
+ const s = o.querySelector(`[data-message-id="${t}"]`);
23
25
  if (!s)
24
26
  return;
25
- const o = e == null ? void 0 : e.querySelector(".k-message-list");
26
- if (o) {
27
- const c = o.getBoundingClientRect().top, a = s.getBoundingClientRect().top, d = o.scrollTop + (a - c);
28
- o.scrollTo({
29
- top: d,
27
+ const e = o.querySelector(".k-message-list");
28
+ if (e) {
29
+ const c = e.getBoundingClientRect().top, a = s.getBoundingClientRect().top, l = e.scrollTop + (a - c);
30
+ e.scrollTo({
31
+ top: l,
30
32
  behavior: "smooth"
31
33
  });
32
34
  } else
@@ -37,29 +39,29 @@ const m = (t, e) => t && e.author && t.id === e.author.id, p = (t, e) => {
37
39
  }, r = /(https?:\/\/[^\s]+)/g, y = (t) => {
38
40
  if (!t)
39
41
  return [""];
40
- const e = t.split(r), s = [];
41
- return e.forEach((o) => {
42
- o && r.test(o) ? (r.lastIndex = 0, s.push(
42
+ const o = t.split(r), s = [];
43
+ return o.forEach((e) => {
44
+ e && r.test(e) ? (r.lastIndex = 0, s.push(
43
45
  i.createElement(
44
46
  "a",
45
47
  {
46
- key: o,
47
- href: o,
48
+ key: e,
49
+ href: e,
48
50
  target: "_blank",
49
51
  rel: "noopener noreferrer",
50
52
  style: { color: "inherit", textDecoration: "underline" }
51
53
  },
52
- o
54
+ e
53
55
  )
54
- )) : o && s.push(o);
56
+ )) : e && s.push(e);
55
57
  }), s;
56
58
  };
57
59
  export {
58
60
  r as URL_REGEX,
59
61
  y as convertTextToLinkedContent,
60
- f as copyToClipboard,
62
+ m as copyToClipboard,
61
63
  p as getDeletedMessageText,
62
64
  T as getMessageById,
63
- m as isAuthor,
65
+ f as isAuthor,
64
66
  M as scrollToMessageById
65
67
  };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const i=require("./utils.js");function l(f,p){const e=p.jscodeshift,s=e(f.source),m=i.findImportedName(e,s,"Chat","@progress/kendo-react-conversational-ui")||"Chat",c=new Set;s.find(e.Identifier).forEach(t=>c.add(t.node.name));const b=t=>e.JSXIdentifier.check(t.name)&&t.name.name===m,h=(t,o)=>{const r=e(t).closest(e.Statement);if(r.size()>0){r.insertBefore(o);return}s.get().node.program.body.unshift(o)};return s.find(e.JSXOpeningElement).forEach(t=>{const o=t.node;if(!b(o))return;const r=o.attributes||[],a=i.findAttribute(r,"user");if(!a)return;if(i.doesAttributeExist(r,"authorId")){i.removeAttribute(r,"user");return}if(a.type!=="JSXAttribute"||!a.value||a.value.type!=="JSXExpressionContainer")return;const n=a.value.expression,d=u=>{r.push(e.jsxAttribute(e.jsxIdentifier("authorId"),e.jsxExpressionContainer(e.memberExpression(u,e.identifier("id")))))};if(n.type==="ObjectExpression"){const u=i.generateUniqueName("kendoUserDataObject",c);c.add(u);const x=e.variableDeclaration("const",[e.variableDeclarator(e.identifier(u),n)]);h(t,x),d(e.identifier(u)),i.removeAttribute(r,"user");return}(n.type==="Identifier"||n.type==="MemberExpression"||n.type==="CallExpression"||n.type==="ThisExpression")&&(d(n),i.removeAttribute(r,"user"))}),s.toSource()}module.exports=l;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXV0aG9yLWlkLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvYXV0aG9yLWlkLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB0eXBlIHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCBnZW5lcmF0ZVVuaXF1ZU5hbWUsIGZpbmRBdHRyaWJ1dGUsIGRvZXNBdHRyaWJ1dGVFeGlzdCwgcmVtb3ZlQXR0cmlidXRlIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHRyYW5zZm9ybWVyKGZpbGU6IEZpbGVJbmZvLCBhcGk6IEFQSSkge1xuICBjb25zdCBqOiBKU0NvZGVzaGlmdCA9IGFwaS5qc2NvZGVzaGlmdDtcbiAgY29uc3Qgcm9vdCA9IGooZmlsZS5zb3VyY2UpO1xuXG4gIGNvbnN0IGNoYXROYW1lID1c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DLENBQ0QsRUFFTVosRUFBSyxVQUNkIn0=
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const p=require("./utils.js");function l(d,f){const e=f.jscodeshift,t=e(d.source),s="@progress/kendo-react-conversational-ui",c=p.findImportedName(e,t,"ChatMessageSendEvent",s);if(!c)return t.toSource();const m=(o=>p.ensureTypeImport(e,t,o,s))("ChatSendMessageEvent");return t.find(e.TSTypeReference,{typeName:{type:"Identifier",name:c}}).forEach(o=>{o.node.typeName.name=m}),t.find(e.ImportDeclaration,{source:{value:s}}).forEach(o=>{var i;const n=o.node.specifiers||[];for(let r=n.length-1;r>=0;r--){const a=n[r];a.type==="ImportSpecifier"&&((i=a.imported)==null?void 0:i.name)==="ChatMessageSendEvent"&&n.splice(r,1)}n.length===0&&e(o).remove()}),t.toSource()}module.exports=l;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2hhdC1zZW5kLW1lc3NhZ2UuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbnZlcnNhdGlvbmFsLXVpL2NvZGVtb2RzL3YxMi9jaGF0LXNlbmQtbWVzc2FnZS50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBUEksIEZpbGVJbmZvLCBKU0NvZGVzaGlmdCB9IGZyb20gJ2pzY29kZXNoaWZ0JztcbmltcG9ydCB7IGVuc3VyZVR5cGVJbXBvcnQsIGZpbmRJbXBvcnRlZE5hbWUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTogRmlsZUluZm8sIGFwaTogQVBJKSB7XG4g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FQUNILE9BQU9GLEVBQUssV0FLUixNQUFBSSxHQUZnQkMsR0FBeUJDLG1CQUFpQlAsRUFBR0MsRUFBTUssRUFBY0osQ0FBRyxHQUV2RCxzQkFBc0IsRUFHcEQsT0FBQUQsRUFBQSxLQUFLRCxFQUFFLGdCQUFpQixDQUMzQixTQUFVLENBQUUsS0FBTSxhQUFjLEtBQU1HLENBQWMsQ0FBQSxDQUNyRCxFQUFFLFFBQVNLLEdBQU0sQ0FDZkEsRUFBRSxLQUFLLFNBQWlCLEtBQU9ILENBQUEsQ0FDakMsRUFHREosRUFBSyxLQUFLRCxFQUFFLGtCQUFtQixDQUFFLE9BQVEsQ0FBRSxNQUFPRSxDQUFBLENBQU8sQ0FBQSxFQUFFLFFBQVNPLEdBQVksT0FFeEUsTUFBQUMsRUFET0QsRUFBUSxLQUNGLFlBQWMsR0FDakMsUUFBU0UsRUFBSUQsRUFBTSxPQUFTLEVBQUdDLEdBQUssRUFBR0EsSUFBSyxDQUNwQyxNQUFBQyxFQUFJRixFQUFNQyxDQUFDLEVBQ2JDLEVBQUUsT0FBUyxxQkFBcUJDLEVBQUFELEVBQUUsV0FBRixZQUFBQyxFQUFZLFFBQVMsd0JBQ2pESCxFQUFBLE9BQU9DLEVBQUcsQ0FBQyxDQUVyQixDQUNJRCxFQUFNLFNBQVcsR0FDakJWLEVBQUFTLENBQU8sRUFBRSxRQUNiLENBQ0QsRUFFTVIsRUFBSyxVQUNkIn0=
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./send-message.js"),o=require("./author-id.js"),r=require("./chat-send-message.js"),t=require("./message-template.js"),s=require("./show-toolbar.js"),a=require("./toolbar-action-execute.js"),n=require("./toolbar.js");exports.SendMessage=e;exports.AuthorId=o;exports.ChatSendMessageEvent=r;exports.MessageTemplate=t;exports.ShowToolbar=s;exports.ToolbarActionExecute=a;exports.Toolbar=n;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VzIjpbXSwic291cmNlc0NvbnRlbnQiOltdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIn0=
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const e=require("./utils.js");function u(a,o){const t=o.jscodeshift,s=t(a.source),i=e.findImportedName(t,s,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return s.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(m=>{const r=m.node.attributes||[],c=e.doesAttributeExist(r,"messageTemplate"),n=e.findAttribute(r,"message");if(n){if(c){e.removeAttribute(r,"message");return}n.name.name="messageTemplate"}}),s.toSource()}module.exports=u;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWVzc2FnZS10ZW1wbGF0ZS5qcyIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvY29udmVyc2F0aW9uYWwtdWkvY29kZW1vZHMvdjEyL21lc3NhZ2UtdGVtcGxhdGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgQVBJLCBGaWxlSW5mbywgSlNDb2Rlc2hpZnQgfSBmcm9tICdqc2NvZGVzaGlmdCc7XG5pbXBvcnQgeyBmaW5kSW1wb3J0ZWROYW1lLCBmaW5kQXR0cmlidXRlLCBkb2VzQXR0cmlidXRlRXhpc3QsIHJlbW92ZU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0ZSc7XG4gIH0pO1xuXG4gIHJldHVybiByb290LnRvU291cmNlKCk7XG59XG4iXSwibmFtZXMiOlsidHJhbnNmb3JtZXIiLCJmaWxlIiwiYXBpIiwiaiIsInJvb3QiLCJjaGF0TmFtZSIsImZpbmRJbXBvcnRlZE5hbWUiLCJwYXRoIiwiYXR0cnMiLCJoYXNNZXNzYWdlVGVtcGxhdGUiLCJkb2VzQXR0cmlidXRlRXhpc3QiLCJtZXNzYWdlQXR0ciIsImZpbmRBdHRyaWJ1dGUiLCJyZW1vdmVBdHRyaWJ1dGUiXSwibWFwcGluZ3MiOiIyQ0FHd0IsU0FBQUEsRUFBWUMsRUFBZ0JDLEVBQVUsQ0FDNUQsTUFBTUMsRUFBaUJELEVBQUksWUFDckJFLEVBQU9ELEVBQUVGLEVBQUssTUFBTSxFQUVwQkksRUFDSkMsRUFBQUEsaUJBQWlCSCxFQUFHQyxFQUFNLE9BQVEseUNBQXlDLEdBQUssT0FFN0UsT0FBQUEsRUFBQSxLQUFLRCxFQUFFLGtCQUFtQixDQUM3QixLQUFNLENBQUUsS0FBTSxnQkFBaUIsS0FBTUUsQ0FBUyxDQUFBLENBQy9DLEVBQUUsUUFBU0UsR0FBUyxDQUNuQixNQUFNQyxFQUFRRCxFQUFLLEtBQUssWUFBYyxDQUFBLEVBRWhDRSxFQUFxQkMsRUFBQUEsbUJBQW1CRixFQUFnQixpQkFBaUIsRUFDekVHLEVBQWNDLEVBQUFBLGNBQWNKLEVBQWdCLFNBQVMsRUFFM0QsR0FBS0csRUFFTCxJQUFJRixFQUFvQixDQUN0Qkksa0JBQWdCTCxFQUFnQixTQUFTLEVBQ3pDLE1BQ0YsQ0FFQ0csRUFBWSxLQUFhLEtBQU8sa0JBQUEsQ0FDbEMsRUFFTVAsRUFBSyxVQUNkIn0=
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const e=require("./utils.js");function u(r,a){const t=a.jscodeshift,n=t(r.source),i=e.findImportedName(t,n,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return n.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:i}}).forEach(c=>{const s=c.node.attributes||[],d=e.doesAttributeExist(s,"onSendMessage"),o=e.findAttribute(s,"onMessageSend");if(o){if(d){e.removeAttribute(s,"onMessageSend");return}o.name.name="onSendMessage"}}),n.toSource()}module.exports=u;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VuZC1tZXNzYWdlLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvc2VuZC1tZXNzYWdlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFQSSwgRmlsZUluZm8sIEpTQ29kZXNoaWZ0IH0gZnJvbSAnanNjb2Rlc2hpZnQnO1xuaW1wb3J0IHsgZmluZEltcG9ydGVkTmFtZSwgZmluZEF0dHJpYnV0ZSwgZG9lc0F0dHJpYnV0ZUV4aXN0LCByZW1vdmVBdHRyaWJ1dGUgfSBmcm9tICcuL3V0aWxzJztcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gdHJhbnNmb3JtZXIoZmlsZTogRmlsZUluZm8sIGFwaTogQVBJKSB7XG4gIGNvbnN0IGo6IEpTQ29kZXNoaWZ0ID0gYXBpLmpzY29kZXNoaWZ0O1xuICBjb25zdCByb290ID0gaihmaWxlLnNvdXJjZSk7XG5cbiAgY29uc3QgY2hhdE5hbWUgPVxuICAgIGZpbmRJbXBvcnRlZE5hbWUoaiwgcm9vdCwgJ0NoYXQnLCAnQHByb2dyZXNzL2tlbmRvLXJlYWN0LWNvbnZlcnNhdGlvbmF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ImF0dHJzIiwiaGFzT25TZW5kTWVzc2FnZSIsImRvZXNBdHRyaWJ1dGVFeGlzdCIsIm9uTWVzc2FnZVNlbmRBdHRyIiwiZmluZEF0dHJpYnV0ZSIsInJlbW92ZUF0dHJpYnV0ZSJdLCJtYXBwaW5ncyI6IjJDQUd3QixTQUFBQSxFQUFZQyxFQUFnQkMsRUFBVSxDQUM1RCxNQUFNQyxFQUFpQkQsRUFBSSxZQUNyQkUsRUFBT0QsRUFBRUYsRUFBSyxNQUFNLEVBRXBCSSxFQUNKQyxFQUFBQSxpQkFBaUJILEVBQUdDLEVBQU0sT0FBUSx5Q0FBeUMsR0FBSyxPQUU3RSxPQUFBQSxFQUFBLEtBQUtELEVBQUUsa0JBQW1CLENBQzdCLEtBQU0sQ0FBRSxLQUFNLGdCQUFpQixLQUFNRSxDQUFTLENBQUEsQ0FDL0MsRUFBRSxRQUFTRSxHQUFTLENBQ25CLE1BQU1DLEVBQVFELEVBQUssS0FBSyxZQUFjLENBQUEsRUFFaENFLEVBQW1CQyxFQUFBQSxtQkFBbUJGLEVBQWdCLGVBQWUsRUFDckVHLEVBQW9CQyxFQUFBQSxjQUFjSixFQUFnQixlQUFlLEVBRXZFLEdBQUtHLEVBRUwsSUFBSUYsRUFBa0IsQ0FFcEJJLGtCQUFnQkwsRUFBZ0IsZUFBZSxFQUMvQyxNQUNGLENBR0NHLEVBQWtCLEtBQWEsS0FBTyxnQkFBQSxDQUN4QyxFQUVNUCxFQUFLLFVBQ2QifQ==
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const o=require("./utils.js");function i(r,n){const t=n.jscodeshift,e=t(r.source),s=o.findImportedName(t,e,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return e.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(a=>{const c=a.node.attributes||[];o.removeAttribute(c,"showToolbar")}),e.toSource()}module.exports=i;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2hvdy10b29sYmFyLmpzIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb252ZXJzYXRpb25hbC11aS9jb2RlbW9kcy92MTIvc2hvdy10b29sYmFyLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEFQSSwgRmlsZUluZm8sIEpTQ29kZXNoaWZ0IH0gZnJvbSAnanNjb2Rlc2hpZnQnO1xuaW1wb3J0IHsgZmluZEltcG9ydGVkTmFtZSwgcmVtb3ZlQXR0cmlidXRlIH0gZnJvbSAnLi91dGlscyc7XG5cbmV4cG9ydCBkZWZhdWx0IGZ1bmN0aW9uIHRyYW5zZm9ybWVyKGZpbGU6IEZpbGVJbmZvLCBhcGk6IEFQSSkge1xuICBjb25zdCBqOiBKU0NvZGVzaGlmdCA9IGFwaS5qc2NvZGVzaGlmdDtcbiAgY29uc3Qgcm9vdCA9IGooZmlsZS5zb3VyY2UpO1xuXG4gIGNvbnN0IGNoYXROYW1lID1cbiAgICBmaW5kSW1wb3J0ZWROYW1lKGosIHJvb3QsICdDaGF0JywgJ0Bwcm9ncmVzcy9rZW5kby1yZWFjdC1jb252ZXJzYXRpb25hbC11aScpIHx8ICdDaGF0JztcblxuICByb290LmZpbmQoai5KU1hPcGVuaW5nRWxlbWVudCwge1xuICAgIG5hbWU6IHsgdHlwZTogJ0pTWElkZW50aWZpZXInLCBuYW1lOiBjaGF0TmFtZSB9XG4gIH0pLmZvckVhY2goKHBhdGgpID0+IHtcbiAgICBjb25zdCBhdHRycyA9IHBhdGgubm9kZS5hdHRyaWJ1dGVzIHx8IFtdO1xuICAgIHJlbW92ZUF0dHJpYnV0ZShhdHRycyBhcyBhbnlbXSwgJ3Nob3dUb29sYmFyJyk7XG4gIH0pO1xuXG4gIHJldHVybiByb290LnRvU291cmNlKCk7XG59XG4iXSwibmFtZXMiOlsidHJhbnNmb3JtZXIiLCJmaWxlIiwiYXBpIiwiaiIsInJvb3QiLCJjaGF0TmFtZSIsImZpbmRJbXBvcnRlZE5hbWUiLCJwYXRoIiwiYXR0cnMiLCJyZW1vdmVBdHRyaWJ1dGUiXSwibWFwcGluZ3MiOiIyQ0FHd0IsU0FBQUEsRUFBWUMsRUFBZ0JDLEVBQVUsQ0FDNUQsTUFBTUMsRUFBaUJELEVBQUksWUFDckJFLEVBQU9ELEVBQUVGLEVBQUssTUFBTSxFQUVwQkksRUFDSkMsRUFBQUEsaUJBQWlCSCxFQUFHQyxFQUFNLE9BQVEseUNBQXlDLEdBQUssT0FFN0UsT0FBQUEsRUFBQSxLQUFLRCxFQUFFLGtCQUFtQixDQUM3QixLQUFNLENBQUUsS0FBTSxnQkFBaUIsS0FBTUUsQ0FBUyxDQUFBLENBQy9DLEVBQUUsUUFBU0UsR0FBUyxDQUNuQixNQUFNQyxFQUFRRCxFQUFLLEtBQUssWUFBYyxDQUFBLEVBQ3RDRSxrQkFBZ0JELEVBQWdCLGFBQWEsQ0FBQSxDQUM5QyxFQUVNSixFQUFLLFVBQ2QifQ==
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const o=require("./utils.js");function i(r,n){const t=n.jscodeshift,e=t(r.source),s=o.findImportedName(t,e,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return e.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(c=>{const a=c.node.attributes||[];o.removeAttribute(a,"onToolbarActionExecute")}),e.toSource()}module.exports=i;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base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ZSgpO1xufVxuIl0sIm5hbWVzIjpbInRyYW5zZm9ybWVyIiwiZmlsZSIsImFwaSIsImoiLCJyb290IiwiY2hhdE5hbWUiLCJmaW5kSW1wb3J0ZWROYW1lIiwicGF0aCIsImF0dHJzIiwicmVtb3ZlQXR0cmlidXRlIl0sIm1hcHBpbmdzIjoiMkNBR3dCLFNBQUFBLEVBQVlDLEVBQWdCQyxFQUFVLENBQzVELE1BQU1DLEVBQWlCRCxFQUFJLFlBQ3JCRSxFQUFPRCxFQUFFRixFQUFLLE1BQU0sRUFFcEJJLEVBQ0pDLEVBQUFBLGlCQUFpQkgsRUFBR0MsRUFBTSxPQUFRLHlDQUF5QyxHQUFLLE9BRTdFLE9BQUFBLEVBQUEsS0FBS0QsRUFBRSxrQkFBbUIsQ0FDN0IsS0FBTSxDQUFFLEtBQU0sZ0JBQWlCLEtBQU1FLENBQVMsQ0FBQSxDQUMvQyxFQUFFLFFBQVNFLEdBQVMsQ0FDbkIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUN0Q0Usa0JBQWdCRCxFQUFnQix3QkFBd0IsQ0FBQSxDQUN6RCxFQUVNSixFQUFLLFVBQ2QifQ==
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";const o=require("./utils.js");function i(r,n){const t=n.jscodeshift,e=t(r.source),s=o.findImportedName(t,e,"Chat","@progress/kendo-react-conversational-ui")||"Chat";return e.find(t.JSXOpeningElement,{name:{type:"JSXIdentifier",name:s}}).forEach(a=>{const c=a.node.attributes||[];o.removeAttribute(c,"toolbar")}),e.toSource()}module.exports=i;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidG9vbGJhci5qcyI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YW1lIiwicGF0aCIsImF0dHJzIiwicmVtb3ZlQXR0cmlidXRlIl0sIm1hcHBpbmdzIjoiMkNBR3dCLFNBQUFBLEVBQVlDLEVBQWdCQyxFQUFVLENBQzVELE1BQU1DLEVBQWlCRCxFQUFJLFlBQ3JCRSxFQUFPRCxFQUFFRixFQUFLLE1BQU0sRUFFcEJJLEVBQ0pDLEVBQUFBLGlCQUFpQkgsRUFBR0MsRUFBTSxPQUFRLHlDQUF5QyxHQUFLLE9BRTdFLE9BQUFBLEVBQUEsS0FBS0QsRUFBRSxrQkFBbUIsQ0FDN0IsS0FBTSxDQUFFLEtBQU0sZ0JBQWlCLEtBQU1FLENBQVMsQ0FBQSxDQUMvQyxFQUFFLFFBQVNFLEdBQVMsQ0FDbkIsTUFBTUMsRUFBUUQsRUFBSyxLQUFLLFlBQWMsQ0FBQSxFQUN0Q0Usa0JBQWdCRCxFQUFnQixTQUFTLENBQUEsQ0FDMUMsRUFFTUosRUFBSyxVQUNkIn0=
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ *-------------------------------------------------------------------------------------------
4
+ * Copyright © 2025 Progress Software Corporation. All rights reserved.
5
+ * Licensed under commercial license. See LICENSE.md in the package root for more information
6
+ *-------------------------------------------------------------------------------------------
7
+ */
8
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=(e,n,t,i)=>{if(i==="class"){if(n.size()>0&&n.get(0).node.value.body){const o=n.get(0).node.value.body.body;if(o){const r=e.emptyStatement();r.comments=[e.commentBlock(` ${t} `)],o.unshift(r)}}}else{let o;if(n.get(0).node.declarations&&n.get(0).node.declarations[0].init?o=n.get(0).node.declarations[0].init.body.body:n.get(0).node.body&&(o=n.get(0).node.body.body),o){const r=e.emptyStatement();r.comments=[e.commentBlock(` ${t} `)],o.unshift(r)}}},b=(e,n,t,i)=>{const o=n.find(e.ImportDeclaration,{source:{value:i}});if(o.size()>0){const r=o.get(0).node.specifiers;r.some(s=>s.type==="ImportSpecifier"&&s.imported.name===t)||r.push(e.importSpecifier(e.identifier(t)))}else{const r=e.importDeclaration([e.importSpecifier(e.identifier(t))],e.literal(i));n.get().node.program.body.unshift(r)}},y=(e,n)=>{let t=n.parentPath,i=!1,o=!1;for(;t;){if(e.ClassDeclaration.check(t.node)){i=!0;break}else if(e.FunctionDeclaration.check(t.node)||e.FunctionExpression.check(t.node)||e.ArrowFunctionExpression.check(t.node)){o=!0;break}t=t.parentPath}return{isClassComponent:i,isFunctionalComponent:o,parentNode:t}},x=(e,n)=>{let t=e,i=1;for(;n.has(t);)t=`${e}$${i}`,i++;return t},p=(e,n)=>e.find(t=>t.type==="JSXAttribute"&&t.name.name===n),h=(e,n)=>e.some(t=>t.type==="JSXAttribute"&&t.name.name===n),l=(e,n,t,i)=>{if(n.value&&n.value.type==="JSXExpressionContainer"){const o=n.value.expression;o.type==="ObjectExpression"&&o.properties.push(e.property("init",e.identifier(t),e.identifier(i)))}},f=(e,n,t,i,o)=>{const r=e.jsxAttribute(e.jsxIdentifier(t),e.jsxExpressionContainer(e.objectExpression([e.property("init",e.identifier(i),e.identifier(o))])));n.push(r)},S=(e,n)=>{const t=e==null?void 0:e.findIndex(i=>i.type==="JSXAttribute"&&i.name.name===n);return t!==-1?(e.splice(t,1),!0):!1},A=(e,n,t,i,o)=>{const r=p(n,t);r?l(e,r,i,o):f(e,n,t,i,o)},E=(e,n,t,i)=>e.jsxAttribute(e.jsxIdentifier(n),e.jsxExpressionContainer(e.objectExpression([e.property("init",e.identifier(t),e.identifier(i))]))),g=(e,n,t,i)=>{n.type==="ObjectExpression"&&n.properties.push(e.property("init",e.identifier(t),e.identifier(i)))},C=(e,n,t,i)=>e.methodDefinition("method",e.identifier(n),e.functionExpression(null,[e.identifier(t?`event: ${i}`:"event")],e.blockStatement([e.returnStatement(e.jsxFragment(e.jsxOpeningFragment(),e.jsxClosingFragment(),[]))]))),v=(e,n,t,i)=>e.variableDeclaration("const",[e.variableDeclarator(e.identifier(n),e.arrowFunctionExpression([e.identifier(`(event${t?`: ${i}`:""})`)],e.blockStatement([e.returnStatement(e.jsxFragment(e.jsxOpeningFragment(),e.jsxClosingFragment(),[]))])))]),D=(e,n,t,i)=>{i?n.node.body.body.push(t):(n.node.body.body||n.node.body).unshift(t)},u=(e,n,t,i)=>{const o=n.find(e.ImportDeclaration,{source:{value:i}});if(o.size()>0){const r=o.find(e.ImportSpecifier,{imported:{name:t}});if(r.size()>0)return r.get(0).node.local.name}return null},I=(e,n,t,i)=>{const o=n.node.body.body.find(r=>r.type==="ClassProperty"&&r.key.name==="state");o&&o.value.type==="ObjectExpression"?o.value.properties.some(a=>a.key.name===t)||o.value.properties.push(e.property("init",e.identifier(t),i)):n.node.body.body.unshift(e.classProperty(e.identifier("state"),e.objectExpression([e.property("init",e.identifier(t),i)])))},F=(e,n)=>(e==null?void 0:e.some(t=>t.type==="JSXAttribute"&&t.name.name===n))||!1,w=(e,n,t,i,o,r,a)=>{const s=e.variableDeclaration("const",[e.variableDeclarator(e.arrayPattern([e.identifier(t),e.identifier(i)]),e.callExpression(e.identifier(`React.useState${r?`<${a}>`:""}`),[o]))]);n.node.body.body.unshift(s)},k=(e,n,t,i)=>{n.push(e.jsxAttribute(e.jsxIdentifier(t),e.jsxExpressionContainer(e.identifier(i))))},P=(e,n,t,i)=>{n.push(e.jsxAttribute(e.jsxIdentifier(t),e.jsxExpressionContainer(e.identifier(i))))},$=(e,n,t,i)=>e.methodDefinition("method",e.identifier(n),e.functionExpression(null,t.map(o=>e.identifier(o)),e.blockStatement(i))),B=(e,n,t,i)=>e.variableDeclaration("const",[e.variableDeclarator(e.identifier(n),e.arrowFunctionExpression(t.map(o=>e.identifier(o)),e.blockStatement(i)))]),M=(e,n,t,i)=>{const o=u(e,n,t,i);if(o)return o;const r=n.find(e.ImportDeclaration,{source:{value:i}}).filter(d=>d.node.importKind==="type").at(0);if(r.size()>0)return r.get().node.specifiers.push(e.importSpecifier(e.identifier(t))),t;const a=e.importSpecifier(e.identifier(t)),s=e.importDeclaration([a],e.literal(i));s.importKind="type";const c=n.find(e.ImportDeclaration).at(0);return c.size()>0?c.insertBefore(s):n.get().node.program.body.unshift(s),t};exports.addCommentToMethod=m;exports.addEventAttribute=k;exports.addMethodToComponent=D;exports.addNewAttribute=f;exports.addPropertyToObjectExpression=g;exports.addStateAttribute=P;exports.addStateDeclaration=I;exports.addUseStateDeclaration=w;exports.createArrowFunction=B;exports.createArrowFunctionForFunctionalComponent=v;exports.createAttribute=E;exports.createClassMethod=$;exports.createMethodForClassComponent=C;exports.doesAttributeExist=h;exports.ensureAttributeExists=A;exports.ensureImportExists=b;exports.ensureTypeImport=M;exports.findAttribute=p;exports.findImportedName=u;exports.findParentComponent=y;exports.generateUniqueName=x;exports.hasJSXAttribute=F;exports.modifyExistingAttribute=l;exports.removeAttribute=S;
9
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbHMuanMiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvbnZlcnNhdGlvbmFsLXVpL2NvZGVtb2RzL3YxMi91dGlscy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICAgIENvbGxlY3Rpb24sXG4gICAgRnVuY3Rpb25EZWNsYXJhdGlvbixcbiAgICBKU0NvZGVzaGlmdCxcbiAgICBKU1hBdHRyaWJ1dGUsXG4gICAgSlNYU3ByZWFkQXR0cmlidXRlLFxuICAgIFZhcmlhYmxlRGVjbGFyYXRpb25cbn0gZnJvbSAnanNjb2Rlc2hpZnQnO1xuXG5leHBvcnQgY29uc3QgYWRkQ29tbWVudFRvTWV0aG9kID0gKFxuICAgIGo6IEpTQ29kZXNoaWZ0LFxuICAgIG1ldGhvZDogQ29sbGVjdGlvbjxWYXJpYWJsZURlY2xhcmF0aW9uPiB8IENvbGxlY3Rpb248RnVuY3Rpb25EZWNsYXJhdGlvbj4sXG4gICAgY29tbWVudFRleHQ6IH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Q0FDVCJ9
@@ -12,4 +12,4 @@
12
12
  * Licensed under commercial license. See LICENSE.md in the package root for more information
13
13
  *-------------------------------------------------------------------------------------------
14
14
  */
15
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-layout"),require("prop-types"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-animation"),require("@progress/kendo-react-notification"),require("@progress/kendo-react-popup")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-intl","@progress/kendo-react-layout","prop-types","@progress/kendo-react-upload","@progress/kendo-react-inputs","@progress/kendo-react-animation","@progress/kendo-react-notification","@progress/kendo-react-popup"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactIntl,e.KendoReactLayout,e.PropTypes,e.KendoReactUpload,e.KendoReactInputs,e.KendoReactAnimation,e.KendoReactNotification,e.KendoReactPopup)}(this,(function(e,t,a,n,l,o,s,r,i,c,u,m,d){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var g=p(t);const h="newMessage.sendButton",k="newMessage.messageInput",f="avatar.alt",v="messageList.ariaLabel",C="aIPrompt.noOutputs",y="aIPrompt.cancel",b="chat.senderDeletedMessage",E="chat.receiverDeletedMessage",I="chat.copyNotification",x="chat.downloadAllFiles",F="chat.closeReply",w="chat.collapseMessage",T="chat.expandMessage",N="chat.removeFile",A="chat.fileActions",S="chat.attachFile",M="chat.downloadAll",D={[h]:"Send","newMessage.optionsButton":"Options",[k]:"Message",[f]:"Avatar",[v]:"Message list",[y]:"Cancel",[C]:"No output from AI available",[b]:"You removed this message",[E]:"The message was removed by its sender",[I]:"Text copied to clipboard",[x]:"Download all files",[F]:"Close reply",[w]:"Collapse message",[T]:"Expand message",[N]:"Remove file",[A]:"File actions for",[S]:"Attach file",[M]:"Download all"},R=(e,t)=>e&&t.author&&e.id===t.author.id,P=(e,t)=>{const a=t.toLanguageString("chatSender.deletedMessage",D[b]),n=t.toLanguageString("chatReceiver.deletedMessage",D[E]);return e?a:n},B=(e,t)=>{const a=t?t.querySelector(`[data-message-id="${e}"]`):document.querySelector(`[data-message-id="${e}"]`);if(!a)return;const n=null==t?void 0:t.querySelector(".k-message-list");if(n){const e=n.getBoundingClientRect().top,t=a.getBoundingClientRect().top,l=n.scrollTop+(t-e);n.scrollTo({top:l,behavior:"smooth"})}else a.scrollIntoView({behavior:"smooth",block:"start"})},L=/(https?:\/\/[^\s]+)/g,K=e=>{if(!e)return[""];const a=e.split(L),n=[];return a.forEach((e=>{e&&L.test(e)?(L.lastIndex=0,n.push(t.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&n.push(e)})),n},V=g.createContext(void 0),O=()=>{const e=t.useContext(V);if(void 0===e)throw new Error("useChatContext must be used within a ChatContext.Provider");return e},q=e=>{const{files:t,onFileRemove:s,onFileAction:r,onDownload:i,fileActions:c,renderInTextarea:u=!1}=e,m=o.useLocalization(),d=c||[{id:"download",label:"Download",svgIcon:l.downloadIcon}],p=e=>"."+e.split(".").pop()||"",h=e=>u?g.createElement(n.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),null==s||s(e.name)},"aria-label":`${m.toLanguageString(N,D[N])} ${e.name}`}):"uid"in e||!("rawFile"in e)?d.length>0&&g.createElement(n.DropDownButton,{fillMode:"flat",themeColor:"base",svgIcon:l.moreVerticalIcon,onItemClick:t=>((e,t)=>{"download"===e.item.id&&(null==i||i([t])),null==r||r(e.item,e,t)})(t,e),items:d.map((e=>({id:e.id,icon:e.icon,text:e.label,svgIcon:e.svgIcon}))),"aria-label":`${m.toLanguageString(A,D[A])} ${e.name}`}):g.createElement(n.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),null==s||s(e.name)},"aria-label":`${m.toLanguageString(N,D[N])} ${e.name}`});return g.createElement("ul",{className:"k-chat-file-wrapper"},t.map((e=>g.createElement("li",{key:e.name,className:"k-chat-file"},g.createElement(a.IconWrap,{size:"xxlarge",...a.getFileExtensionIcon(p(e.name))}),g.createElement("div",{className:"k-chat-file-info"},g.createElement("span",{className:"k-chat-file-name"},e.name),g.createElement("span",{className:"k-chat-file-size"},(e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`})(e.size))),h(e)))))},z=g.forwardRef(((e,t)=>{const{item:r,template:i,onRequestSelection:c,tabIndex:u=-1,dateFormat:m="g",selected:d,allowMessageCollapse:p,messageToolbarActions:h,messageContextMenuActions:k,isSender:f}=e,{setReplyToMessage:v,messages:C,user:y,internalScrollContainerRef:b,onToolbarAction:E,onContextMenuAction:I,onFileAction:F,onDownload:N,fileActions:A,setShowCopyNotification:S,statusTemplate:L}=O(),[V,z]=g.useState(!1),[U,j]=g.useState(!0),[$,W]=g.useState(!1),H=o.useLocalization(),G=g.useRef({left:0,top:0}),_=g.useCallback((()=>{null!=r&&r.text&&(e=>{navigator.clipboard.writeText(e)})(r.text),S&&(S(!0),setTimeout((()=>{S(!1)}),3e3))}),[r,S]),Y=g.useCallback((e=>{e.stopPropagation(),j((e=>!e))}),[]),X=g.useCallback((()=>{W(!1)}),[]),J=g.useCallback((e=>{("Tab"===e.key||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)&&W(!0)}),[]),Q=g.useRef(null);g.useEffect((()=>{d&&Q.current&&Q.current.focus()}),[d]);const Z=g.useCallback((e=>{G.current={left:e.pageX,top:e.pageY},e.preventDefault(),z(!0)}),[]),ee=g.useCallback((()=>{z(!1)}),[]),te=g.useCallback(((e,t)=>!e.isDeleted&&e.text?e.text:P(t,H)),[H]),ae=g.useCallback((e=>{var t;null!=(t=e.item)&&t.text&&("copy"!==e.item.data.id||r.isDeleted?"reply"===e.item.data.id&&v(r):_(),I&&I(e.item.data,e,r)),z(!1)}),[r,I,v,_]),ne=g.useCallback((()=>{if(r.replyToId){const e=((e,t)=>e.find((e=>e.id===t)))(C,r.replyToId);if(e){const t=t=>{t.preventDefault(),t.stopPropagation();const a=null==b?void 0:b.current;B(e.id,a)};return g.createElement("div",{className:a.classNames("k-message-reference",R(y,e)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:t},g.createElement("div",{className:"k-message-reference-content"},K(te(e,R(y,e)))))}}return null}),[r.replyToId,C,y,te,b]),le=g.useCallback((()=>{const e=[{id:"reply",label:"Reply",svgIcon:l.undoIcon},{id:"copy",label:"Copy",svgIcon:l.copyIcon}],t=k?[...e.map((e=>k.find((t=>t.id===e.id))||e)),...k.filter((t=>!e.some((e=>e.id===t.id))))]:e;return g.createElement(s.ContextMenu,{onSelect:ae,onClose:ee,vertical:!0,show:V,offset:G.current},t.map((e=>"delete"!==e.id||f?g.createElement(s.MenuItem,{key:e.id,text:e.label,icon:e.icon,svgIcon:e.svgIcon,data:e}):null)))}),[k,ae,ee,V,f]),oe=g.useCallback((()=>r.files&&r.files.length>1?g.createElement("div",{className:"k-chat-download-button-wrapper"},g.createElement(n.Button,{className:"k-chat-download-button",fillMode:"flat",themeColor:"base",svgIcon:l.downloadIcon,onClick:e=>{e.stopPropagation(),N&&N(r.files,r)},"aria-label":H.toLanguageString(x,D[x])},g.createElement("span",{className:"k-button-text"},H.toLanguageString(M,D[M])))):null),[r,N,H]),se=g.useCallback((()=>{if(r.typing)return g.createElement("div",{className:"k-chat-bubble"},g.createElement("div",{className:"k-typing-indicator"},g.createElement("span",null),g.createElement("span",null),g.createElement("span",null)));if(i){const e=i;return g.createElement(e,{item:r})}return r.text||r.files&&r.files.length>0?g.createElement(g.Fragment,null,g.createElement("div",{className:a.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":p,"k-expanded":p&&U,"k-selected":d}),onContextMenu:Z},g.createElement("div",{className:"k-bubble-content",onClick:e=>{e.stopPropagation(),e.preventDefault()}},g.createElement("span",{className:"k-chat-bubble-text"},!r.isDeleted&&ne(),K(te(r,R(y,r)))),r.files&&g.createElement(q,{files:r.files,message:r,onFileAction:F,onDownload:e=>null==N?void 0:N(e,r),renderInTextarea:!1,fileActions:A}),oe()),p&&g.createElement("span",{className:"k-bubble-expandable-indicator",onClick:Y,role:"button","aria-label":U?H.toLanguageString(w,D[w]):H.toLanguageString(T,D[T]),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),Y(e))}},g.createElement(a.IconWrap,{icon:U?l.chevronUpIcon:l.chevronDownIcon,size:"medium"}))),le()):null}),[r,i,p,U,d,Z,ne,te,y,F,A,oe,Y,H,le,N]),re=g.useCallback((()=>{let t=null;return r.timestamp&&(t=g.createElement("time",{className:"k-message-time","aria-hidden":!d},o.provideIntlService({props:e}).formatDate(r.timestamp,m))),t}),[r.timestamp,d,m,e]),ie=g.useCallback((()=>{let e=null;return r.status&&d&&(e=L?g.createElement(L,{item:r}):g.createElement("span",{className:"k-message-status"},g.createElement(a.IconWrap,{icon:l.checkCircleIcon,size:"xsmall"}),r.status)),e}),[r,d,L]),ce=g.useCallback((()=>a.classNames({"k-focus":d,"k-message-removed":r.isDeleted},"k-message")),[d,r.isDeleted]),ue=g.useCallback((()=>h&&h.length>0&&g.createElement("div",{className:"k-chat-message-toolbar k-toolbar k-toolbar-md k-toolbar-flat"},h.map((e=>"delete"!==e.id||f?g.createElement(n.Button,{key:e.id,fillMode:"flat",className:"k-toolbar-button",themeColor:"base",icon:e.icon,svgIcon:e.svgIcon,onClick:t=>{t.stopPropagation(),"copy"!==e.id||r.isDeleted?"reply"===e.id&&v(r):_(),E&&E(e,t,r)},onMouseDown:e=>e.preventDefault()}):null)))),[_,f,r,h,E,v]);return g.createElement("div",{"data-message-id":r.id,className:ce(),tabIndex:u,onClick:()=>c(d?void 0:r.selectionIndex),onMouseDown:X,onKeyDown:J,onFocus:e=>{$&&c(r.selectionIndex)},ref:e=>{Q.current=e,"function"==typeof t?t(e):t&&(t.current=e)}},re(),se(),ie(),ue())}));z.displayName="ChatMessage";class U extends g.Component{render(){return g.createElement(z,{...this.props})}}o.registerForIntl(U);const j=e=>e[e.length-1],$=e=>(t,a,n)=>{const l=n===e-1;return((e,t)=>{const a=t.timestamp,n=j(e);if(a&&(!n||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(a,n.timestamp))){const t={type:"date-marker",timestamp:a,trackBy:a.getTime()};e.push(t)}})(t,a),((e,t,a)=>{const n=j(e);let l;t.typing&&!a||(n&&"message-group"===n.type&&(l=n.messages),l&&R(t.author,j(l))?l.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,a,l),a.attachments&&a.attachments.length>1&&t.push({type:"attachment-group",attachments:a.attachments,attachmentLayout:a.attachmentLayout,timestamp:a.timestamp,trackBy:a}),a.suggestedActions&&l&&t.push({type:"action-group",actions:a.suggestedActions,timestamp:a.timestamp,trackBy:a}),t};const W=e=>{const t=e.slice().reduce($(e.length),[]);return function(e){let t=0;e.forEach((e=>{"message-group"===e.type?e.messages.forEach((e=>{e.selectionIndex=t++})):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)})),e.lastSelectionIndex=t-1}(t),t},H=e=>{const{item:t,onActionExecute:n,selected:l}=e,o=g.useRef(null);g.useEffect((()=>{l&&o.current&&o.current.focus()}),[l]);const s=g.useCallback((e=>{(e.keyCode===a.Keys.enter||" "===e.key)&&(e.preventDefault(),n(t,e))}),[n,t]),r=g.useCallback((()=>a.classNames("k-suggestion k-suggestion-primary",{"k-selected":l},{"k-focus":l})),[l]);return g.createElement("span",{role:"button",className:r(),onClick:e=>n(t,e),ref:o,onKeyDown:s,tabIndex:0,"aria-label":t.title||t.value},t.title||t.value)},G=e=>{var t;const{group:n,onActionExecute:l,selected:o,onRequestSelection:s}=e,[r,i]=g.useState(null);g.useEffect((()=>{o||null===r?o&&null===r&&i(0):i(null)}),[o,r]);const c=g.useCallback((()=>n.actions?n.actions.length-1:-1),[n.actions]),u=g.useCallback(((e,t=0)=>{let a=null;return e?null===r?a=t:r<c()&&(a=r+1):null===r?a=0:r>0&&(a=r-1),null!==a&&i(a),a}),[r,c]),m=g.useCallback((()=>{s(n.selectionIndex)}),[s,n.selectionIndex]),d=g.useCallback((e=>{let t=null;const n=a.Keys.left,l=a.Keys.right;e.keyCode===n?t=u(!1):e.keyCode===l&&(t=u(!0)),null!==t&&(e.preventDefault(),e.stopPropagation())}),[u]),p=g.useCallback((()=>a.classNames("k-suggestion-group")),[]);return g.createElement("div",{className:p(),onClick:m,onKeyDown:d,role:"toolbar",tabIndex:0,"aria-label":"Action group"},null==(t=n.actions)?void 0:t.map(((e,t)=>g.createElement(H,{item:e,onActionExecute:l,selected:t===r,key:e.value}))))},_=e=>{const{item:t,template:n,tabbable:l,onClick:o,selected:s}=e,r=g.useRef(null);g.useEffect((()=>{s&&r.current&&r.current.focus()}),[s]);const i=g.useCallback((()=>{if(void 0!==l)return l?0:-1}),[l]),c=g.useCallback((()=>a.classNames({"k-selected":s},{"k-focus":s})),[s]),u=g.useCallback((()=>t.title?g.createElement("h5",{className:"k-card-title"},t.title):null),[t.title]),m=g.useCallback((()=>t.subtitle?g.createElement("h6",{className:"k-card-subtitle"},t.subtitle):null),[t.subtitle]),d=g.useCallback((()=>0===t.contentType.indexOf("image/")?g.createElement("img",{src:t.content,alt:t.title||"Attachment"}):t.content),[t.contentType,t.content,t.title]),p=n;return g.createElement("div",{className:c(),tabIndex:i(),onClick:o,ref:r},n?g.createElement(p,{item:t}):g.createElement("div",{className:"k-card"},g.createElement("div",{className:"k-card-body"},u(),m(),d())))},Y=e=>{const{group:t,itemTemplate:o,selected:s,isLastGroup:r,onRequestSelection:i}=e,[c,u]=g.useState(null);g.useEffect((()=>{s||null===c?s&&null===c&&u(0):u(null)}),[s,c]);const m=g.useCallback((e=>"list"!==e.attachmentLayout),[]),d=g.useCallback((()=>t.attachments?t.attachments.length-1:-1),[t.attachments]),p=g.useCallback((()=>t.attachments.length-1),[t.attachments]),h=g.useCallback(((e,t=0)=>{let a=null;return e?null===c?a=t:c<d()&&(a=c+1):null===c?a=0:c>0&&(a=c-1),null!==a&&u(a),a}),[c,d]),k=g.useCallback((()=>{i(t.selectionIndex)}),[i,t.selectionIndex]),f=g.useCallback((e=>{let n,l,o=null;m(t)?(n=a.Keys.left,l=a.Keys.right):(n=a.Keys.up,l=a.Keys.down),e.keyCode===n?o=h(!1):e.keyCode===l&&(o=h(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())}),[h,m,t]),v=g.useCallback((e=>{k(),u(e)}),[k]),C=g.useCallback((e=>{k(),h(e,1)}),[k,h]),y=g.useCallback((()=>{let e=null;return m(t)&&c&&(e=g.createElement(n.Button,{icon:"chevron-left",onClick:()=>C(!1),svgIcon:l.chevronLeftIcon})),e}),[m,t,c,C]),b=g.useCallback((()=>{let e=null;return m(t)&&c!==p()&&(e=g.createElement(n.Button,{icon:"chevron-right",onClick:()=>C(!0),svgIcon:l.chevronRightIcon})),e}),[m,t,c,p,C]),E=g.useCallback((()=>a.classNames({"k-card-list":t.attachmentLayout,"k-card-deck":m(t)})),[t.attachmentLayout,t,m]),I=m(t),x=g.createElement("div",{className:E(),onKeyDown:I?void 0:f},t.attachments.map(((e,t)=>g.createElement(_,{item:e,template:o,selected:t===c,tabbable:r&&t===c,onClick:()=>v(t),key:e.content}))));return I?g.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:f},y(),x,b()):x},X=({item:e,timestampTemplate:t})=>{const a=t;return g.createElement("div",{className:"k-timestamp"},a?g.createElement(a,{item:e}):o.provideIntlService({props:{item:e}}).formatDate(e.timestamp,"D"))};let J=class extends g.Component{render(){return g.createElement(X,{...this.props})}};o.registerForIntl(J);const Q=e=>{const{group:t,user:n,itemTemplate:l,attachmentTemplate:r,onRequestSelection:i,selectedItemIndex:c,isLastGroup:u,message:m,allowMessageCollapse:d,messageToolbarActions:p,messageContextMenuActions:h,messageWidthMode:k="standard"}=e,v=o.useLocalization(),C=t.messages.length>0&&R(n,t.messages[0]),y=!C,b=g.useMemo((()=>a.classNames("k-message-group",{"k-message-group-sender k-no-avatar":C,"k-message-group-receiver":y,"k-message-group-full-width":"full"===k})),[C,y,k]),E=g.useMemo((()=>{const e=t.messages.length-1;return t.messages.map(((t,a)=>{const o=[g.createElement(m,{item:t,template:l,selected:t.selectionIndex===c,onRequestSelection:i,tabIndex:a===e&&u?0:-1,key:t.id,allowMessageCollapse:d,messageToolbarActions:p,messageContextMenuActions:h,isSender:R(n,t)})];return t.attachments&&1===t.attachments.length&&o.push(g.createElement(_,{item:t.attachments[0],template:r,selected:!1,key:`att-${t.attachments[0].content}`})),o}))}),[t.messages,m,l,c,i,u,d,p,h,n,r]),{avatarUrl:I,avatarAltText:x,name:F}=t.author,w=void 0!==x?x:v.toLanguageString(f,D[f]);return g.createElement("div",{className:b},(()=>{if(y&&I)return g.createElement(s.Avatar,{type:"image"},g.createElement("img",{src:I,alt:w}))})(),g.createElement("div",{className:"k-message-group-content"},g.createElement("span",{className:"k-message-author"},F),E))},Z=e=>{const{suggestions:t,onSuggestionClick:n,suggestionsView:l,suggestionTemplate:o}=e,s=g.useCallback(((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==n||n(t))}),[n]),r=g.useCallback((()=>t.map((e=>o?g.createElement(o,{key:e.id,suggestion:e,onClick:()=>{null==n||n(e)}}):g.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:()=>!e.disabled&&(null==n?void 0:n(e)),onKeyDown:t=>!e.disabled&&s(t,e),key:e.id,title:e.description,className:a.classNames("classic"===l?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},e.text)))),[t,o,n,l,s]);return t&&0!==t.length?"classic"===l?r():g.createElement("div",{role:"group",className:"k-suggestion-group"},r()):null},ee=g.forwardRef(((e,t)=>{const{onSendMessage:s,isDirectionRightToLeft:r,placeholder:u,MessageBox:m,suggestions:d,onSuggestionClick:p,inputValue:f,onInputValueChange:v,suggestionTemplate:C,sendButtonConfig:y}=e,{replyToMessage:b,setReplyToMessage:E,user:I,messageListScrollContainerRef:x,speechToTextConfig:w,uploadConfig:T}=O(),[N]=g.useState(!1),[A,M]=g.useState(void 0),[B,L]=g.useState([]),[K,V]=g.useState(!1),z=g.useRef(null),U=g.useRef(null),j=o.useLocalization(),$=g.useCallback((()=>{null!==z.current&&z.current.focus()}),[]);g.useEffect((()=>{void 0!==f&&f!==A&&(M(f),$())}),[f,A,$]),g.useEffect((()=>{b&&$()}),[b,$]),g.useLayoutEffect((()=>{K&&null!=x&&x.current&&(x.current.scrollTop=x.current.scrollHeight-x.current.clientHeight,V(!1))}),[K,x]);const W=g.useCallback((e=>{const t=e.value;M(t),v&&v(t)}),[v]),H=g.useMemo((()=>!!(null!=A&&A.trim()||B.length>0)),[A,B.length]),G=g.useCallback((e=>{if(e.preventDefault(),s){if(H){const t={id:"",author:I,text:A||"",timestamp:new Date,replyToId:b?b.id:void 0,files:B.map((e=>({name:e.name,size:e.size,type:e.extension,rawFile:e.getRawFile?e.getRawFile():e})))};E(null),s(t,e),L([]),M(""),v&&v(""),V(!0)}}}),[s,A,I,b,B,E,v,H]),_=g.useCallback((e=>{if("Enter"!==e.key||!e.shiftKey)switch(e.key){case"Enter":return e.preventDefault(),G(e);case"Escape":z.current&&z.current.blur();break;default:return}}),[G]);g.useImperativeHandle(t,(()=>({focusInput:$})),[$]);const Y=g.useCallback((e=>{L((t=>t.filter((t=>t.name!==e))))}),[]),X=g.useCallback((()=>g.createElement(q,{files:B,onFileRemove:Y,renderInTextarea:!0})),[B,Y]),J=g.useCallback(((e,t)=>e.isDeleted?P(t,j):e.text),[j]),Q=g.useCallback((()=>{if(b){const e=R(I,b);return g.createElement("div",{className:a.classNames("k-message-reference",e?"k-message-reference-sender":"k-message-reference-receiver")},g.createElement("div",{className:"k-message-reference-content"},J(b,e)),g.createElement("span",{className:"k-spacer"}),g.createElement(n.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:()=>E(null),"aria-label":j.toLanguageString(F,D[F])}))}return null}),[b,I,J,E,j]),ee=g.useCallback((e=>{try{const t=Array.from(e.newState);L((e=>[...e,...t])),$()}catch{}}),[$]),te=g.useCallback((()=>{U.current&&U.current.actionElement.click()}),[]),ae=g.useCallback((e=>{}),[]),ne=g.useCallback((e=>{const{isFinal:t,alternatives:a}=e;if(a.length>0){const e=a[0];t&&M((t=>(t?`${t} `:"")+e.transcript))}}),[]),le=g.useCallback((()=>g.createElement(g.Fragment,null,B.length>0&&X(),b&&g.createElement("span",{className:"k-input-prefix k-input-prefix-horizontal"},Q()))),[B.length,b,X,Q]),oe=g.useCallback((e=>{e.preventDefault()}),[]),se=g.useCallback((e=>{"Escape"===e.key&&e.currentTarget.blur()}),[]),re=g.useMemo((()=>g.createElement(n.Button,{rounded:"full",fillMode:"solid",themeColor:"primary",className:"k-chat-send",icon:"paper-plane",svgIcon:l.paperPlaneIcon,onClick:G,onMouseDown:oe,onKeyDown:se,"aria-label":j.toLanguageString(h,D[h]),dir:r?"rtl":void 0,disabled:!H,"aria-disabled":!H,...y})),[G,oe,se,j,r,H,y]),ie=g.useCallback((()=>{const e="object"==typeof w?w:void 0,t="object"==typeof T?T:{},{className:o,...s}=t,r=a.classNames("k-hidden",o);return g.createElement(c.InputSuffix,null,!1!==w&&g.createElement(n.SpeechToTextButton,{fillMode:"clear",themeColor:"base",onError:ae,onResult:ne,...e}),g.createElement(n.Button,{key:"attach-file",fillMode:"clear",themeColor:"base",svgIcon:l.paperclipIcon,onClick:te,"aria-label":j.toLanguageString(S,D[S])}),g.createElement(i.Upload,{ref:U,files:B,onAdd:ee,multiple:!0,autoUpload:!1,...s,className:r}),g.createElement("span",{className:"k-spacer"}),re)}),[w,T,B,ae,ne,te,ee,j,re]),ce=g.useMemo((()=>g.createElement(c.TextArea,{className:a.classNames("k-message-box","!k-flex-col",{"k-focus":N}),resizable:"none",rows:1,placeholder:u,value:A,onChange:W,onKeyDown:_,prefix:le,suffix:ie,ref:z,"aria-label":j.toLanguageString(k,D[k])})),[N,u,A,W,_,le,ie,j]);return g.createElement("div",{className:"k-message-box-wrapper"},d&&d.length>0&&g.createElement(Z,{onSuggestionClick:p,suggestions:d,suggestionTemplate:C}),m?g.createElement(m,{messageInput:ce,sendButton:re}):ce)}));ee.displayName="NewMessage";const te=e=>g.createElement(s.AppBar,{className:"k-chat-header",positionMode:"sticky",themeColor:"light"},e.children),ae=e=>{const{message:t,onUnpin:s,user:r}=e,i=o.useLocalization(),{internalScrollContainerRef:c}=O(),u=g.useCallback((e=>{e.preventDefault(),e.stopPropagation();const a=null==c?void 0:c.current;B(t.id,a)}),[t.id,c]);return g.createElement("div",{className:"k-message-reference k-message-reference-receiver k-message-pinned",onClick:u},g.createElement(a.IconWrap,{size:"xlarge",icon:l.pinIcon}),g.createElement("div",{className:"k-message-reference-content"},null!=t&&t.isDeleted?r&&P(R(r,t),i):null==t?void 0:t.text),g.createElement("span",{className:"k-spacer"}),g.createElement(n.Button,{svgIcon:l.xIcon,onClick:e=>{e.stopPropagation(),null==s||s(t)}}))},ne=e=>{const{show:t,text:a}=e;return g.createElement("div",{style:{position:"absolute",top:"90%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,pointerEvents:t?"auto":"none"}},g.createElement(u.Fade,null,t&&g.createElement(m.Notification,{type:{style:"dark"},closable:!1},g.createElement("span",null,a))))},le=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"12.0.0-develop.1",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/"}),oe={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions"},se=(e,t={})=>{const a={...oe,...t};let n;n=e.author&&"object"==typeof e.author?{id:e.author.id||e.author[a.authorIdField]||"",name:e.author.name||e.author[a.authorNameField],avatarUrl:e.author.avatarUrl||e.author[a.authorImageUrlField],avatarAltText:e.author.avatarAltText||e.author[a.authorImageAltTextField]}:{id:e[a.authorIdField]||"",name:e[a.authorNameField],avatarUrl:e[a.authorImageUrlField],avatarAltText:e[a.authorImageAltTextField]};const l={id:e[a.idField],text:e[a.textField]||"",author:n,timestamp:e[a.timestampField]?new Date(e[a.timestampField]):new Date,status:e[a.statusField],attachments:e[a.attachmentsField],attachmentLayout:e.attachmentLayout||"list",suggestedActions:e[a.suggestedActionsField],isPinned:e[a.isPinnedField]||!1,typing:e[a.typingField],files:e[a.filesField]||[]};return e.pinnedAt&&(l.pinnedAt=new Date(e.pinnedAt)),e.pinnedBy&&(l.pinnedBy=e.pinnedBy),e[a.replyToIdField]&&(l.replyToId=e[a.replyToIdField]),e[a.isDeletedField]&&(l.isDeleted=e[a.isDeletedField]),l},re=(e,t={})=>Array.isArray(e)?e.map((e=>se(e,t))):[],ie=e=>e&&void 0!==e.id&&"string"==typeof e.text&&e.author&&"object"==typeof e.author&&void 0!==e.author.id&&(e.timestamp instanceof Date||"string"==typeof e.timestamp||"number"==typeof e.timestamp),ce=g.forwardRef(((e,t)=>{const{messages:n=[],messageTemplate:l,attachmentTemplate:s,width:r,height:i,onSendMessage:c,onSuggestionClick:u,onInputValueChange:m,onActionExecute:d,dir:p,messageBox:h,placeholder:k,className:f,message:C=z,authorId:y,suggestions:b,suggestionTemplate:E,inputValue:x,headerTemplate:F,timestampTemplate:w,statusTemplate:T,allowMessageCollapse:N,messageToolbarActions:A,messageContextMenuActions:S,fileActions:M,onUnpin:R,messageWidthMode:P,onToolbarAction:B,onContextMenuAction:L,onFileAction:K,onDownload:O,speechToTextConfig:q,uploadConfig:U,sendButtonConfig:j,textField:$,statusField:H,authorIdField:_,authorNameField:J,authorImageUrlField:Z,authorImageAltTextField:oe,idField:se,timestampField:ce,filesField:ue,attachmentsField:me,replyToIdField:de,isDeletedField:pe,isPinnedField:ge,typingField:he,suggestedActionsField:ke,...fe}=e,[ve,Ce]=g.useState(null),[ye,be]=g.useState(!1),[Ee,Ie]=g.useState(!1),[xe,Fe]=g.useState(null),[we,Te]=g.useState(null),Ne=g.useRef(null),Ae=g.useRef(null),Se=g.useRef(null),Me=g.useRef(null),De=g.useRef(void 0),Re=g.useRef(void 0),Pe=g.useRef(null),Be=g.useRef(""),Le=g.useMemo((()=>n&&0!==n.length?ie(n[0])?n.map((e=>({...e,timestamp:e.timestamp?new Date(e.timestamp):e.timestamp}))):re(n,{textField:$,statusField:H,authorIdField:_,authorNameField:J,authorImageUrlField:Z,authorImageAltTextField:oe,idField:se,timestampField:ce,filesField:ue,attachmentsField:me,replyToIdField:de,isDeletedField:pe,isPinnedField:ge,typingField:he,suggestedActionsField:ke}):[]),[n,$,H,_,J,Z,oe,se,ce,ue,me,de,pe,ge,he,ke]);g.useEffect((()=>{if(y===Be.current&&Pe.current)Te(Pe.current);else if(y&&Le.length>0){const e=Le.find((e=>e.author&&(e.author.id===y||e.author.id===String(y)))),t=(null==e?void 0:e.author)||{id:y};Pe.current=t,Be.current=y,Te(t)}}),[y,Le]);const Ke=g.useMemo((()=>Le.length>0?W(Le):[]),[Le]),Ve=g.useMemo((()=>!a.validatePackage(le,{component:"Chat"})),[]),Oe=g.useMemo((()=>Le.find((e=>e.isPinned))),[Le]),qe=o.useLocalization(),ze=g.useCallback((()=>{clearTimeout(De.current)}),[]),Ue=g.useCallback((()=>{De.current=window.setTimeout((()=>{Ce(null)}),0)}),[]),je=g.useCallback((e=>{Ce(e)}),[]),$e=g.useCallback((e=>{let t=null;const n=null!==ve?ve:Ke.lastSelectionIndex;e.keyCode===a.Keys.up?null===n?t=0:n>0&&(t=n-1):e.keyCode===a.Keys.down?null===n?t=0:n<Ke.lastSelectionIndex&&(t=n+1):e.keyCode===a.Keys.home?t=0:e.keyCode===a.Keys.end&&(t=Ke.lastSelectionIndex),null!==t&&(Ce(t),e.preventDefault())}),[ve,Ke]),We=g.useCallback((()=>{Se.current&&(Se.current.scrollTop=Se.current.scrollHeight-Se.current.clientHeight)}),[]),He=g.useCallback((()=>{if(!Se.current)return!0;const{scrollTop:e,scrollHeight:t,clientHeight:a}=Se.current;return t-e-a<50}),[]),Ge=g.useCallback((()=>{He()&&requestAnimationFrame((()=>{We()}))}),[He,We]),_e=g.useCallback((()=>{requestAnimationFrame((()=>{We()}))}),[We]),Ye=g.useCallback(((e,t,a)=>{var n;if(d&&d({action:{value:e.value,title:e.title,type:e.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(e.type){case"reply":c&&c({message:{id:"",author:we,text:e.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value)}null==(n=Me.current)||n.focusInput()}}),[d,c,we]),Xe=g.useCallback((()=>a.classNames("k-chat",f,{"k-rtl":ye})),[f,ye]),Je=g.useCallback((()=>{const e=Ke.length-1;return Ke.map(((t,a)=>"date-marker"===t.type?g.createElement(X,{item:t,key:t.trackBy,timestampTemplate:w}):"message-group"===t.type?g.createElement(Q,{group:t,itemTemplate:l,attachmentTemplate:s,user:we,selectedItemIndex:ve,onRequestSelection:je,isLastGroup:a===e,key:t.messages[0].selectionIndex,message:C,allowMessageCollapse:N,messageToolbarActions:A,messageContextMenuActions:S,messageWidthMode:P}):"attachment-group"===t.type?g.createElement(Y,{group:t,itemTemplate:s,onRequestSelection:je,selected:t.selectionIndex===ve,isLastGroup:a===e,key:t.selectionIndex}):"action-group"===t.type?g.createElement(G,{group:t,onActionExecute:Ye,onRequestSelection:je,selected:t.selectionIndex===ve,key:t.selectionIndex}):null))}),[Ke,w,l,s,we,ve,je,C,N,A,S,P,Ye]),Qe=g.useCallback((()=>F?"function"==typeof F?F():F:null),[F]);g.useEffect((()=>{const e=void 0!==p?"rtl"===p:Ne.current&&"rtl"===getComputedStyle(Ne.current).direction;be(!!e)}),[p]),g.useEffect((()=>(Re.current=window.setTimeout((()=>We()),250),()=>{clearTimeout(Re.current)})),[We]),g.useEffect((()=>()=>{clearTimeout(De.current),clearTimeout(Re.current)}),[]),g.useEffect((()=>{_e()}),[Le.length,_e]),g.useEffect((()=>{const e=window.setTimeout((()=>{Ge()}),50);return()=>{clearTimeout(e)}}),[Le,Ge]),g.useEffect((()=>{if(b&&b.length>0){const e=window.setTimeout((()=>{Ge()}),100);return()=>{clearTimeout(e)}}}),[b,Ge]);const Ze=g.useMemo((()=>({replyToMessage:xe,setReplyToMessage:Fe,messages:Le,user:we,internalScrollContainerRef:Ae,messageListScrollContainerRef:Se,onToolbarAction:B,onContextMenuAction:L,onFileAction:K,setShowCopyNotification:Ie,onDownload:O,fileActions:M,speechToTextConfig:q,uploadConfig:U,statusTemplate:T})),[xe,Fe,Le,we,B,L,K,Ie,O,M,q,U,T]);return g.createElement(V.Provider,{value:Ze},g.createElement("div",{style:{width:r,height:i,position:"relative",overflow:"hidden"},onKeyDown:$e,className:Xe(),ref:e=>{Ne.current=e,Ae.current=e,"function"==typeof t?t(e):t&&(t.current=e)},...fe},void 0!==F&&g.createElement(te,null,Qe()),Oe&&g.createElement(ae,{message:Oe,onUnpin:R,user:we}),g.createElement("div",{className:"k-message-list k-avatars",onBlur:Ue,onFocus:ze,role:"log","aria-label":qe.toLanguageString(v,D[v]),"aria-live":"polite",ref:Se},g.createElement("div",{className:"k-message-list-content"},Je())),g.createElement(ee,{onSendMessage:(e,t)=>{c&&c({message:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:e=>{u&&u(e)},isDirectionRightToLeft:ye,ref:Me,placeholder:k,MessageBox:h,suggestions:b,suggestionTemplate:E,inputValue:x,onInputValueChange:e=>{m&&m(e)},sendButtonConfig:j}),Ve&&g.createElement(a.WatermarkOverlay,null),g.createElement(ne,{show:Ee,text:qe.toLanguageString(I,D[I])})))}));ce.displayName="Chat",ce.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any};const ue=e=>{const{activeView:a,toolbarItems:l,activeViewChange:o}=e;return t.createElement("div",{className:"k-prompt-header"},t.createElement(n.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},l.map((e=>t.isValidElement(e)?e:t.createElement(n.Button,{key:e.name,className:a===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==o||o.call(null,e)})(e.name)},e.buttonText)))))},me={name:"Output view",buttonText:"Output",buttonIcon:l.commentIcon},de={name:"Commands view",buttonIcon:l.moreHorizontalIcon},pe={name:"Prompt view",buttonText:"Ask AI",buttonIcon:l.sparklesIcon},ge=t.createContext([{},()=>{}]),he=()=>t.useContext(ge),ke=e=>{const{children:a}=e;return t.createElement("div",{className:"k-prompt-footer"},t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},a))},fe=t.forwardRef(((e,a)=>{const{children:s,streaming:r,onCancel:i}=e,c=o.useLocalization().toLanguageString(y,D[y]),[u]=he(),m=u.activeView===me.name,d=r&&m,p=t.useCallback((e=>{"Escape"===e.key&&d&&i&&(e.preventDefault(),i())}),[d,i]);return t.createElement("div",{className:"k-prompt-content",ref:a,onKeyDown:p},d&&t.createElement(n.FloatingActionButton,{onClick:i,svgIcon:l.stopSmIcon,icon:"stop-sm",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":c,title:c}),t.createElement("div",{className:"k-prompt-view"},s))}));fe.displayName="KendoReactAIPromptContent";const ve=e=>{const[t]=he();return t.activeView===e.name?e.children:null},Ce=e=>{const[a,o]=t.useState(!0),{children:s,title:r}=e;return t.createElement("div",{className:"k-prompt-expander"},t.createElement(n.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:a?l.chevronUpIcon:l.chevronDownIcon,title:r,onClick:()=>o(!a),"aria-expanded":a},r),a&&t.createElement("div",{id:e.id,className:"k-prompt-expander-content"},s))},ye=e=>null==e?void 0:e.map((e=>t.createElement(s.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&ye(e.children||[])))),be=({show:e=!1,anchor:a,onOpen:n,onClose:l,animate:o=!0,appendTo:s,popupOptions:r={},children:i,style:c})=>t.createElement(d.Popup,{show:e,anchor:a,style:c,animate:o,appendTo:s,onOpen:n,onClose:l,...r},i),Ee=({placeholder:e="Ask or generate content with AI...",promptValue:o,onMenuClick:s,promptInput:r=c.TextArea,generateButton:i,enableSpeechToText:u=!1,streaming:m=!1,commands:d,onPromptRequest:p,onPromptCancel:g})=>{const[h,k]=t.useState(o||""),[f,v]=a.useCustomComponent(i),[C,y]=a.useCustomComponent(r),b={svgIcon:m?l.stopSmIcon:l.paperPlaneIcon,active:(!!m).toString(),title:"Send Button","aria-label":"Send Button",disabled:!h.trim()&&!m,"aria-disabled":!h.trim()&&!m},E={placeholder:e,className:"!k-flex-row",autoSize:!0,rows:1},I=d&&d.length>0,x=Object.keys(v).length>0?v:b,F=Object.keys(y).length>0?y:E,w=e=>{const{isFinal:t,alternatives:a}=e;if(t&&a.length>0){const e=a[0].transcript,t=(()=>{const t=h,a=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(a?" ":"")+e})();k(t)}},T=()=>{h.trim()&&p&&p(h.trim())};return t.createElement(C,{value:h,onChange:e=>{const t=e.target.value;k(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),T())},prefix:I||u?t.createElement(t.Fragment,null,t.createElement(c.InputPrefix,{className:"!k-align-items-start"},I&&t.createElement(n.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:l.menuIcon,onClick:s}),u&&t.createElement(n.SpeechToTextButton,{fillMode:"flat",..."object"==typeof u?{...u,onResult:u.onResult||w}:{onResult:w}})),t.createElement(c.InputSeparator,null)):void 0,suffix:t.createElement(c.InputSuffix,{className:"!k-align-items-start"},t.createElement(f,{className:a.classNames("k-prompt-send",{"k-generating":m,"k-active":m}),fillMode:"flat",onClick:m?g:T,...x})),...F})};e.AIPrompt=e=>{const n=!a.validatePackage(le,{component:"AIPrompt"}),l=a.getLicenseMessage(le),{activeView:o,toolbarItems:s,children:r,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u,style:m,dir:d,className:p,streaming:g,loading:h,onCancel:k,suggestionsView:f,...v}=e,C=s||[pe,me],[y,b]=t.useState({activeView:o}),E={...y,activeView:o,streaming:g,loading:h,suggestionsView:null!=f?f:"classic",onCancel:k,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u};return t.createElement(ge.Provider,{value:[E,e=>{b(e)}]},t.createElement("div",{className:a.classNames("k-prompt",p),style:m,dir:d,...v},t.createElement(ue,{activeView:E.activeView,toolbarItems:C,activeViewChange:i}),r,n&&t.createElement(a.WatermarkOverlay,{message:l})))},e.AIPromptCommandsView=e=>{const{commands:a}=e,[n]=he();return t.createElement(ve,{name:de.name},t.createElement(fe,{streaming:n.streaming,onCancel:n.onCancel},t.createElement("div",{className:"k-prompt-view"},t.createElement(s.PanelBar,{onSelect:e=>{var t,a,l;const o=null==(a=null==(t=e.target)?void 0:t.props)?void 0:a.data;null!=(l=o.children)&&l.length||n.onCommandExecute&&n.onCommandExecute.call(null,o)},selected:""},ye(null!=a?a:[])))))},e.AIPromptContent=fe,e.AIPromptFooter=ke,e.AIPromptOutputView=e=>{const[a,r]=t.useState(""),i=t.useRef(null),[c]=he(),{outputs:u,showOutputRating:m,outputCard:d}=e,{header:p,body:g,actions:h}=d||{},k=o.useLocalization(),f=(e,t)=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),v()},v=()=>{i&&i.current&&i.current.scrollTo({top:0,behavior:"smooth"})},y=t.createElement(s.Card,null,t.createElement(s.CardHeader,null,t.createElement(s.CardTitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),t.createElement(s.CardSubtitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),t.createElement(s.CardBody,null,t.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),t.createElement(s.CardActions,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),b=null==u?void 0:u.map(((e,o)=>t.createElement(s.Card,{key:`${e.id}_${o}`},t.createElement(s.CardHeader,null,p?p(e):t.createElement(t.Fragment,null,e.title&&t.createElement(s.CardTitle,null,e.title),e.subTitle&&t.createElement(s.CardSubtitle,null,e.subTitle))),t.createElement(s.CardBody,null,g?g(e):e.responseContent),t.createElement(s.CardActions,null,h?h(e):t.createElement(t.Fragment,null,t.createElement(n.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:a===e.id?l.checkIcon:l.copyIcon,onClick:()=>(e=>{null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),r(e.id),setTimeout((()=>{r("")}),1e3)})(e)},"Copy"),t.createElement(n.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,onClick:()=>(e=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),v()})(e)},"Retry"),m&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-spacer"}),t.createElement(n.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpOutlineIcon,onClick:()=>f(e,"positive")}),t.createElement(n.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownOutlineIcon,onClick:()=>f(e,"negative")}))))))),E=t.createElement(s.Card,null,t.createElement(s.CardBody,null,k.toLanguageString(C,D[C])));return t.createElement(ve,{name:me.name},t.createElement(fe,{ref:i,streaming:c.streaming,onCancel:c.onCancel},t.createElement("div",{className:"k-card-list"},c.loading&&y,b,(!b||0===b.length)&&!c.loading&&E)))},e.AIPromptView=e=>{const{promptInput:o=c.TextArea,generateButton:s=n.Button,enableSpeechToText:r=!1,promptValue:i,promptSuggestions:u}=e,[m,d]=t.useState(i||""),[p]=he(),[g,h]=a.useCustomComponent(s),[k,f]=a.useCustomComponent(o),v={title:"Generate",children:"Generate",svgIcon:l.sparklesIcon},C=Object.keys(h).length>0?h:v,y=Object.keys(f).length>0?f:{placeholder:"Ask or generate content with AI ...",rows:2},b=e=>{const{isFinal:t,alternatives:a}=e;if(t&&a.length>0){const e=a[0].transcript,t=(()=>{const t=m,a=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(a?" ":"")+e})();d(t)}};let E;return r&&(E="object"==typeof r?{...r,onResult:r.onResult||b}:{onResult:b}),t.createElement(ve,{name:pe.name},t.createElement(fe,{streaming:p.streaming,onCancel:p.onCancel},t.createElement(k,{value:m,className:"!k-flex-col",suffix:r?t.createElement(t.Fragment,null,t.createElement(c.InputSeparator,{orientation:"horizontal"}),t.createElement(c.InputSuffix,{orientation:"horizontal"},t.createElement(n.SpeechToTextButton,{fillMode:"flat",...E}))):void 0,onChange:e=>{d(e.target.value)},...y}),u&&u.length>0&&t.createElement(Ce,{title:"Prompt Suggestions"},t.createElement(Z,{suggestionsView:p.suggestionsView,suggestions:u.map(((e,t)=>({id:t,text:e,description:e}))),onSuggestionClick:e=>{(e=>{d(e)})(e.text)}}))),t.createElement(ke,null,t.createElement(g,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{p.onPromptRequest&&p.onPromptRequest.call(null,m),d("")},disabled:!m.trim(),...C},C.children)))},e.AIPromptViewRender=ve,e.Chat=ce,e.ChatMessage=z,e.DEFAULT_FIELD_MAPPING=oe,e.HeroCard=e=>{const{imageUrl:t,imageMaxWidth:a,title:l,subtitle:o,actions:s,onActionExecute:r,altText:i}=e,c=g.useCallback(((e,t)=>{null==r||r({action:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})}),[r]),u=i||l||"";return g.createElement("div",{className:"k-card"},g.createElement("img",{className:"k-card-image",src:t,style:{maxWidth:a},alt:u}),g.createElement("div",{className:"k-card-body"},l&&g.createElement("h5",{className:"k-card-title"},l),o&&g.createElement("h6",{className:"k-card-subtitle"},o)),g.createElement("div",{className:"k-card-actions k-card-actions-vertical"},s.map(((e,t)=>g.createElement("span",{className:"k-card-action",key:`action-${t}-${e.title||e.value||t}`},g.createElement(n.Button,{fillMode:"flat",onClick:t=>c(e,t)},e.title))))))},e.InlineAIPrompt=e=>{const o=!a.validatePackage(le,{component:"InlineAIPrompt"}),r=a.getLicenseMessage(le),{outputs:i=[],outputCard:u,promptInput:m=c.TextArea,generateButton:d=n.Button,promptPlaceholder:p="Ask or generate content with AI...",promptValue:g,onPromptRequest:h,onCopy:k,onDiscard:f,outputActions:v,onOutputAction:C,enableSpeechToText:y=!1,streaming:b,onPromptCancel:E,show:I=!1,anchor:x,width:F,height:w,onOpen:T,onClose:N,animate:A=!0,appendTo:S,commands:M,onCommandExecute:D,style:R,className:P,popupOptions:B={},...L}=e,[K,V]=t.useState(""),[O,q]=t.useState(!1),[z,U]=t.useState({left:0,top:0}),j=t.useRef(null),{body:$,actions:W}=u||{},H=v||[{id:"copy",text:"Copy",svgIcon:l.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:l.cancelOutlineIcon,themeColor:"base",title:"Discard"}],G=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),V(e.id),setTimeout((()=>V("")),1e3)),null==k||k(e)})(t);break;case"discard":(e=>{null==f||f(e)})(t);break;default:null==C||C(e,t)}},_=t.useCallback((e=>{"Escape"===e.key&&(b&&E?E():!b&&N&&N({target:null}))}),[b,E,N]),Y={...R,...F&&{width:F},...w&&{height:w}},X={...F&&{width:F},...w&&{height:w}},J=t.createElement(t.Fragment,null,t.createElement("div",{className:a.classNames("k-prompt",P),style:Y,onKeyDown:_,...L},t.createElement(fe,{ref:j},i&&i.length>0&&t.createElement("div",{className:"k-card-list"},i.map(((e,a)=>t.createElement(s.Card,{key:`${e.id}_${a}`},t.createElement(s.CardBody,null,$?$(e):e.responseContent),t.createElement(s.CardActions,null,W?W(e):t.createElement(t.Fragment,null,H.map((a=>{var o;return a.spacer?t.createElement("span",{key:a.id,className:"k-spacer"}):t.createElement(n.Button,{key:a.id,size:"medium",themeColor:a.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(o=a.title)?o:a.text,svgIcon:"copy"===a.id&&K===e.id?l.checkIcon:a.svgIcon,onClick:()=>G(a,e)},a.text)})))))))),t.createElement(Ee,{promptValue:g,placeholder:p,onPromptRequest:h,onMenuClick:e=>{if(!j.current)return;const t=j.current.getBoundingClientRect();U({left:t.left,top:t.bottom}),q(!0)},onPromptCancel:E,promptInput:m,generateButton:d,enableSpeechToText:y,streaming:b,commands:M}))),o&&t.createElement(a.WatermarkOverlay,{message:r}));return t.createElement(t.Fragment,null,t.createElement(be,{show:I,anchor:x,onOpen:T,onClose:N,animate:A,appendTo:S,popupOptions:B,style:X},J),t.createElement(s.ContextMenu,{show:O,offset:z,onClose:()=>{q(!1)},items:(e=>null==e?void 0:e.map((e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map((e=>({text:e.text,data:e}))):void 0}))))(M),onSelect:e=>{var t,a;const n=null==(t=e.item)?void 0:t.data;n&&(null==(a=n.children)||!a.length)&&(e=>{q(!1),D&&D(e)})(n)}}))},e.PromptHeader=ue,e.SuggestionGroup=Z,e.commandsViewDefaults=de,e.extractFieldMappingFromProps=e=>({textField:e.textField,statusField:e.statusField,authorIdField:e.authorIdField,authorNameField:e.authorNameField,authorImageUrlField:e.authorImageUrlField,authorImageAltTextField:e.authorImageAltTextField,idField:e.idField,timestampField:e.timestampField,filesField:e.filesField,attachmentsField:e.attachmentsField,replyToIdField:e.replyToIdField,isDeletedField:e.isDeletedField,isPinnedField:e.isPinnedField,typingField:e.typingField,suggestedActionsField:e.suggestedActionsField}),e.isStandardMessageFormat=ie,e.mapDataArrayToMessages=re,e.mapDataToMessage=se,e.mapMessageToCustomFormat=(e,t={})=>{const a={...oe,...t},n={};return void 0!==e.id&&(n[a.idField]=e.id),void 0!==e.text&&(n[a.textField]=e.text),void 0!==e.status&&(n[a.statusField]=e.status),void 0!==e.timestamp&&(n[a.timestampField]=e.timestamp),void 0!==e.attachments&&(n[a.attachmentsField]=e.attachments),void 0!==e.files&&(n[a.filesField]=e.files),void 0!==e.suggestedActions&&(n[a.suggestedActionsField]=e.suggestedActions),void 0!==e.replyToId&&(n[a.replyToIdField]=e.replyToId),void 0!==e.isDeleted&&(n[a.isDeletedField]=e.isDeleted),void 0!==e.isPinned&&(n[a.isPinnedField]=e.isPinned),void 0!==e.typing&&(n[a.typingField]=e.typing),e.author&&(void 0!==e.author.id&&(n[a.authorIdField]=e.author.id),void 0!==e.author.name&&(n[a.authorNameField]=e.author.name),void 0!==e.author.avatarUrl&&(n[a.authorImageUrlField]=e.author.avatarUrl),void 0!==e.author.avatarAltText&&(n[a.authorImageAltTextField]=e.author.avatarAltText)),void 0!==e.pinnedAt&&(n.pinnedAt=e.pinnedAt),void 0!==e.pinnedBy&&(n.pinnedBy=e.pinnedBy),void 0!==e.attachmentLayout&&(n.attachmentLayout=e.attachmentLayout),n},e.outputViewDefaults=me,e.promptViewDefaults=pe}));
15
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("react"),require("@progress/kendo-react-common"),require("@progress/kendo-react-buttons"),require("@progress/kendo-svg-icons"),require("@progress/kendo-react-intl"),require("@progress/kendo-react-layout"),require("prop-types"),require("@progress/kendo-react-upload"),require("@progress/kendo-react-inputs"),require("@progress/kendo-react-animation"),require("@progress/kendo-react-notification"),require("@progress/kendo-react-popup")):"function"==typeof define&&define.amd?define(["exports","react","@progress/kendo-react-common","@progress/kendo-react-buttons","@progress/kendo-svg-icons","@progress/kendo-react-intl","@progress/kendo-react-layout","prop-types","@progress/kendo-react-upload","@progress/kendo-react-inputs","@progress/kendo-react-animation","@progress/kendo-react-notification","@progress/kendo-react-popup"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).KendoReactConversationalUi={},e.React,e.KendoReactCommon,e.KendoReactButtons,e.KendoSvgIcons,e.KendoReactIntl,e.KendoReactLayout,e.PropTypes,e.KendoReactUpload,e.KendoReactInputs,e.KendoReactAnimation,e.KendoReactNotification,e.KendoReactPopup)}(this,(function(e,t,a,n,l,o,s,r,i,c,u,m,d){"use strict";function p(e){var t=Object.create(null);return e&&Object.keys(e).forEach((function(a){if("default"!==a){var n=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,n.get?n:{enumerable:!0,get:function(){return e[a]}})}})),t.default=e,Object.freeze(t)}var g=p(t);const h="newMessage.sendButton",k="newMessage.messageInput",f="avatar.alt",v="messageList.ariaLabel",C="aIPrompt.noOutputs",y="aIPrompt.cancel",b="chat.senderDeletedMessage",E="chat.receiverDeletedMessage",I="chat.copyNotification",x="chat.downloadAllFiles",F="chat.closeReply",T="chat.collapseMessage",w="chat.expandMessage",N="chat.removeFile",A="chat.fileActions",S="chat.attachFile",D="chat.downloadAll",M={[h]:"Send","newMessage.optionsButton":"Options",[k]:"Message",[f]:"Avatar",[v]:"Message list",[y]:"Cancel",[C]:"No output from AI available",[b]:"You removed this message",[E]:"The message was removed by its sender",[I]:"Text copied to clipboard",[x]:"Download all files",[F]:"Close reply",[T]:"Collapse message",[w]:"Expand message",[N]:"Remove file",[A]:"File actions for",[S]:"Attach file",[D]:"Download all"},R=(e,t)=>e&&t.author&&e.id===t.author.id,P=(e,t)=>{const a=t.toLanguageString("chatSender.deletedMessage",M[b]),n=t.toLanguageString("chatReceiver.deletedMessage",M[E]);return e?a:n},B=(e,t)=>{if(!t)return;const a=t.querySelector(`[data-message-id="${e}"]`);if(!a)return;const n=t.querySelector(".k-message-list");if(n){const e=n.getBoundingClientRect().top,t=a.getBoundingClientRect().top,l=n.scrollTop+(t-e);n.scrollTo({top:l,behavior:"smooth"})}else a.scrollIntoView({behavior:"smooth",block:"start"})},L=/(https?:\/\/[^\s]+)/g,K=e=>{if(!e)return[""];const a=e.split(L),n=[];return a.forEach((e=>{e&&L.test(e)?(L.lastIndex=0,n.push(t.createElement("a",{key:e,href:e,target:"_blank",rel:"noopener noreferrer",style:{color:"inherit",textDecoration:"underline"}},e))):e&&n.push(e)})),n},O=g.createContext(void 0),V=()=>{const e=t.useContext(O);if(void 0===e)throw new Error("useChatContext must be used within a ChatContext.Provider");return e},q=e=>{const{files:t,onFileRemove:s,onFileAction:r,onDownload:i,fileActions:c,renderInTextarea:u=!1}=e,m=o.useLocalization(),d=c||[{id:"download",label:"Download",svgIcon:l.downloadIcon}],p=e=>"."+e.split(".").pop()||"",h=e=>u?g.createElement(n.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),null==s||s(e.name)},"aria-label":`${m.toLanguageString(N,M[N])} ${e.name}`}):"uid"in e||!("rawFile"in e)?d.length>0&&g.createElement(n.DropDownButton,{fillMode:"flat",themeColor:"base",svgIcon:l.moreVerticalIcon,onClick:e=>{e.syntheticEvent.stopPropagation()},onItemClick:t=>((e,t)=>{"download"===e.item.id&&(null==i||i([t])),null==r||r(e.item,e,t)})(t,e),items:d.map((e=>({id:e.id,icon:e.icon,text:e.label,svgIcon:e.svgIcon}))),"aria-label":`${m.toLanguageString(A,M[A])} ${e.name}`}):g.createElement(n.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:t=>{t.stopPropagation(),null==s||s(e.name)},"aria-label":`${m.toLanguageString(N,M[N])} ${e.name}`});return g.createElement("ul",{className:"k-chat-file-wrapper"},t.map((e=>g.createElement("li",{key:e.name,className:"k-chat-file"},g.createElement(a.IconWrap,{size:"xxlarge",...a.getFileExtensionIcon(p(e.name))}),g.createElement("div",{className:"k-chat-file-info"},g.createElement("span",{className:"k-chat-file-name"},e.name),g.createElement("span",{className:"k-chat-file-size"},(e=>{if(null==e)return"";if(0===e)return"0 B";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/Math.pow(1024,t)).toFixed(2))} ${["B","KB","MB","GB","TB"][t]}`})(e.size))),h(e)))))},z=g.forwardRef(((e,t)=>{const{item:r,template:i,onRequestSelection:c,tabIndex:u=-1,dateFormat:m="g",selected:d,allowMessageCollapse:p,messageToolbarActions:h,messageContextMenuActions:k,isSender:f}=e,{setReplyToMessage:v,messages:C,user:y,internalScrollContainerRef:b,onToolbarAction:E,onContextMenuAction:I,onFileAction:F,onDownload:N,fileActions:A,setShowCopyNotification:S,statusTemplate:L}=V(),[O,z]=g.useState(!1),[U,j]=g.useState(!1),[$,W]=g.useState(!0),[H,G]=g.useState(!1),_=o.useLocalization(),Y=g.useRef({left:0,top:0}),X=g.useCallback((()=>{null!=r&&r.text&&(e=>{navigator.clipboard.writeText(e)})(r.text),S&&(S(!0),setTimeout((()=>{S(!1)}),3e3))}),[r,S]),J=g.useCallback((e=>{e.stopPropagation(),W((e=>!e))}),[]),Q=g.useCallback((()=>{G(!1)}),[]),Z=g.useCallback((e=>{("Tab"===e.key||"Enter"===e.key||" "===e.key||"ArrowUp"===e.key||"ArrowDown"===e.key)&&G(!0)}),[]),ee=g.useRef(null);g.useEffect((()=>{d&&ee.current&&ee.current.focus()}),[d]);const te=g.useCallback((e=>{Y.current={left:e.pageX,top:e.pageY},e.preventDefault(),j(!0),z(!0)}),[]),ae=g.useCallback((()=>{j(!1),z(!1)}),[]),ne=g.useCallback(((e,t)=>!e.isDeleted&&e.text?e.text:P(t,_)),[_]),le=g.useCallback((e=>{var t;null!=(t=e.item)&&t.text&&("copy"!==e.item.data.id||r.isDeleted?"reply"===e.item.data.id&&v(r):X(),I&&I(e.item.data,e,r)),z(!1)}),[r,I,v,X]),oe=g.useCallback((()=>{if(r.replyToId){const e=((e,t)=>e.find((e=>e.id===t)))(C,r.replyToId);if(e){const t=t=>{t.preventDefault(),t.stopPropagation();const a=null==b?void 0:b.current;B(e.id,a)};return g.createElement("div",{className:a.classNames("k-message-reference",R(y,e)?"k-message-reference-sender":"k-message-reference-receiver"),onClick:t},g.createElement("div",{className:"k-message-reference-content"},K(ne(e,R(y,e)))))}}return null}),[r.replyToId,C,y,ne,b]),se=g.useCallback((()=>{const e=[{id:"reply",label:"Reply",svgIcon:l.undoIcon},{id:"copy",label:"Copy",svgIcon:l.copyIcon}],t=k?[...e.map((e=>k.find((t=>t.id===e.id))||e)),...k.filter((t=>!e.some((e=>e.id===t.id))))]:e;return g.createElement(s.ContextMenu,{onSelect:le,onClose:ae,vertical:!0,show:O,offset:Y.current},t.map((e=>"delete"!==e.id||f?g.createElement(s.MenuItem,{key:e.id,text:e.label,icon:e.icon,svgIcon:e.svgIcon,data:e}):null)))}),[k,le,ae,O,f]),re=g.useCallback((()=>r.files&&r.files.length>1?g.createElement("div",{className:"k-chat-download-button-wrapper"},g.createElement(n.Button,{className:"k-chat-download-button",fillMode:"flat",themeColor:"base",svgIcon:l.downloadIcon,onClick:e=>{e.stopPropagation(),N&&N(r.files,r)},"aria-label":_.toLanguageString(x,M[x])},g.createElement("span",{className:"k-button-text"},_.toLanguageString(D,M[D])))):null),[r,N,_]),ie=g.useCallback((()=>{if(r.typing)return g.createElement("div",{className:"k-bubble k-chat-bubble"},g.createElement("div",{className:"k-typing-indicator"},g.createElement("span",null),g.createElement("span",null),g.createElement("span",null)));if(i){const e=i;return g.createElement(e,{item:r})}return r.text||r.files&&r.files.length>0?g.createElement(g.Fragment,null,g.createElement("div",{className:a.classNames("k-chat-bubble","k-bubble",{"k-bubble-expandable":p,"k-expanded":p&&$,"k-selected":d,"k-active":U}),onClick:()=>c(d?void 0:r.selectionIndex),onContextMenu:te},g.createElement("div",{className:"k-bubble-content"},g.createElement("span",{className:"k-chat-bubble-text"},!r.isDeleted&&oe(),K(ne(r,R(y,r)))),r.files&&g.createElement(q,{files:r.files,message:r,onFileAction:F,onDownload:e=>null==N?void 0:N(e,r),renderInTextarea:!1,fileActions:A}),re()),p&&g.createElement("span",{className:"k-bubble-expandable-indicator",onClick:J,role:"button","aria-label":$?_.toLanguageString(T,M[T]):_.toLanguageString(w,M[w]),tabIndex:0,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),J(e))}},g.createElement(a.IconWrap,{icon:$?l.chevronUpIcon:l.chevronDownIcon,size:"medium"}))),se()):null}),[r,i,p,$,d,te,oe,ne,y,F,A,re,J,_,se,N]),ce=g.useCallback((()=>{let t=null;return r.timestamp&&(t=g.createElement("time",{className:"k-message-time","aria-hidden":!d},o.provideIntlService({props:e}).formatDate(r.timestamp,m))),t}),[r.timestamp,d,m,e]),ue=g.useCallback((()=>{let e=null;return r.status&&d&&(e=L?g.createElement(L,{item:r}):g.createElement("span",{className:"k-message-status"},g.createElement(a.IconWrap,{icon:l.checkCircleIcon,size:"xsmall"}),r.status)),e}),[r,d,L]),me=g.useCallback((()=>a.classNames({"k-focus":d,"k-message-removed":r.isDeleted},"k-message")),[d,r.isDeleted]),de=g.useCallback((()=>h&&h.length>0&&g.createElement("div",{className:"k-chat-message-toolbar k-toolbar k-toolbar-md k-toolbar-flat"},h.map((e=>"delete"!==e.id||f?g.createElement(n.Button,{key:e.id,fillMode:"flat",className:"k-toolbar-button",themeColor:"base",icon:e.icon,svgIcon:e.svgIcon,onClick:t=>{t.stopPropagation(),"copy"!==e.id||r.isDeleted?"reply"===e.id&&v(r):X(),E&&E(e,t,r)},onMouseDown:e=>e.preventDefault()}):null)))),[X,f,r,h,E,v]);return g.createElement("div",{"data-message-id":r.id,className:me(),tabIndex:u,onMouseDown:Q,onKeyDown:Z,onFocus:e=>{H&&c(r.selectionIndex)},ref:e=>{ee.current=e,"function"==typeof t?t(e):t&&(t.current=e)}},ce(),ie(),ue(),de())}));z.displayName="ChatMessage";class U extends g.Component{render(){return g.createElement(z,{...this.props})}}o.registerForIntl(U);const j=e=>e[e.length-1],$=e=>(t,a,n)=>{const l=n===e-1;return((e,t)=>{const a=t.timestamp,n=j(e);if(a&&(!n||((e,t)=>e&&t&&(t.getDate()!==e.getDate()||t.getMonth()!==e.getMonth()||t.getFullYear()!==e.getFullYear()))(a,n.timestamp))){const t={type:"date-marker",timestamp:a,trackBy:a.getTime()};e.push(t)}})(t,a),((e,t,a)=>{const n=j(e);let l;t.typing&&!a||(n&&"message-group"===n.type&&(l=n.messages),l&&R(t.author,j(l))?l.push(t):e.push({type:"message-group",messages:[t],author:t.author,timestamp:t.timestamp,trackBy:t}))})(t,a,l),a.attachments&&a.attachments.length>1&&t.push({type:"attachment-group",attachments:a.attachments,attachmentLayout:a.attachmentLayout,timestamp:a.timestamp,trackBy:a}),a.suggestedActions&&l&&t.push({type:"action-group",actions:a.suggestedActions,timestamp:a.timestamp,trackBy:a}),t};const W=e=>{const{item:t,onActionExecute:n,selected:l}=e,o=g.useRef(null);g.useEffect((()=>{l&&o.current&&o.current.focus()}),[l]);const s=g.useCallback((e=>{(e.keyCode===a.Keys.enter||" "===e.key)&&(e.preventDefault(),n(t,e))}),[n,t]),r=g.useCallback((()=>a.classNames("k-suggestion k-suggestion-primary",{"k-selected":l},{"k-focus":l})),[l]);return g.createElement("span",{role:"button",className:r(),onClick:e=>n(t,e),ref:o,onKeyDown:s,tabIndex:0,"aria-label":t.title||t.value},t.title||t.value)},H=e=>{var t;const{group:n,onActionExecute:l,selected:o,onRequestSelection:s}=e,[r,i]=g.useState(null);g.useEffect((()=>{o||null===r?o&&null===r&&i(0):i(null)}),[o,r]);const c=g.useCallback((()=>n.actions?n.actions.length-1:-1),[n.actions]),u=g.useCallback(((e,t=0)=>{let a=null;return e?null===r?a=t:r<c()&&(a=r+1):null===r?a=0:r>0&&(a=r-1),null!==a&&i(a),a}),[r,c]),m=g.useCallback((()=>{s(n.selectionIndex)}),[s,n.selectionIndex]),d=g.useCallback((e=>{let t=null;const n=a.Keys.left,l=a.Keys.right;e.keyCode===n?t=u(!1):e.keyCode===l&&(t=u(!0)),null!==t&&(e.preventDefault(),e.stopPropagation())}),[u]),p=g.useCallback((()=>a.classNames("k-suggestion-group")),[]);return g.createElement("div",{className:p(),onClick:m,onKeyDown:d,role:"toolbar",tabIndex:0,"aria-label":"Action group"},null==(t=n.actions)?void 0:t.map(((e,t)=>g.createElement(W,{item:e,onActionExecute:l,selected:t===r,key:e.value}))))},G=e=>{const{item:t,template:n,tabbable:l,onClick:o,selected:s}=e,r=g.useRef(null);g.useEffect((()=>{s&&r.current&&r.current.focus()}),[s]);const i=g.useCallback((()=>{if(void 0!==l)return l?0:-1}),[l]),c=g.useCallback((()=>a.classNames({"k-selected":s},{"k-focus":s})),[s]),u=g.useCallback((()=>t.title?g.createElement("h5",{className:"k-card-title"},t.title):null),[t.title]),m=g.useCallback((()=>t.subtitle?g.createElement("h6",{className:"k-card-subtitle"},t.subtitle):null),[t.subtitle]),d=g.useCallback((()=>0===t.contentType.indexOf("image/")?g.createElement("img",{src:t.content,alt:t.title||"Attachment"}):t.content),[t.contentType,t.content,t.title]),p=n;return g.createElement("div",{className:c(),tabIndex:i(),onClick:o,ref:r},n?g.createElement(p,{item:t}):g.createElement("div",{className:"k-card"},g.createElement("div",{className:"k-card-body"},u(),m(),d())))},_=e=>{const{group:t,itemTemplate:o,selected:s,isLastGroup:r,onRequestSelection:i}=e,[c,u]=g.useState(null);g.useEffect((()=>{s||null===c?s&&null===c&&u(0):u(null)}),[s,c]);const m=g.useCallback((e=>"list"!==e.attachmentLayout),[]),d=g.useCallback((()=>t.attachments?t.attachments.length-1:-1),[t.attachments]),p=g.useCallback((()=>t.attachments.length-1),[t.attachments]),h=g.useCallback(((e,t=0)=>{let a=null;return e?null===c?a=t:c<d()&&(a=c+1):null===c?a=0:c>0&&(a=c-1),null!==a&&u(a),a}),[c,d]),k=g.useCallback((()=>{i(t.selectionIndex)}),[i,t.selectionIndex]),f=g.useCallback((e=>{let n,l,o=null;m(t)?(n=a.Keys.left,l=a.Keys.right):(n=a.Keys.up,l=a.Keys.down),e.keyCode===n?o=h(!1):e.keyCode===l&&(o=h(!0)),null!==o&&(e.preventDefault(),e.stopPropagation())}),[h,m,t]),v=g.useCallback((e=>{k(),u(e)}),[k]),C=g.useCallback((e=>{k(),h(e,1)}),[k,h]),y=g.useCallback((()=>{let e=null;return m(t)&&c&&(e=g.createElement(n.Button,{icon:"chevron-left",onClick:()=>C(!1),svgIcon:l.chevronLeftIcon})),e}),[m,t,c,C]),b=g.useCallback((()=>{let e=null;return m(t)&&c!==p()&&(e=g.createElement(n.Button,{icon:"chevron-right",onClick:()=>C(!0),svgIcon:l.chevronRightIcon})),e}),[m,t,c,p,C]),E=g.useCallback((()=>a.classNames({"k-card-list":t.attachmentLayout,"k-card-deck":m(t)})),[t.attachmentLayout,t,m]),I=m(t),x=g.createElement("div",{className:E(),onKeyDown:I?void 0:f},t.attachments.map(((e,t)=>g.createElement(G,{item:e,template:o,selected:t===c,tabbable:r&&t===c,onClick:()=>v(t),key:e.content}))));return I?g.createElement("div",{className:"k-card-deck-scrollwrap",onKeyDown:f},y(),x,b()):x},Y=({item:e,timestampTemplate:t})=>{const a=t;return g.createElement("div",{className:"k-timestamp"},a?g.createElement(a,{item:e}):o.provideIntlService({props:{item:e}}).formatDate(e.timestamp,"D"))};let X=class extends g.Component{render(){return g.createElement(Y,{...this.props})}};o.registerForIntl(X);const J=e=>{const{group:t,user:n,itemTemplate:l,attachmentTemplate:r,onRequestSelection:i,selectedItemIndex:c,isLastGroup:u,message:m,allowMessageCollapse:d,messageToolbarActions:p,messageContextMenuActions:h,messageWidthMode:k="standard"}=e,v=o.useLocalization(),C=t.messages.length>0&&R(n,t.messages[0]),y=!C,b=g.useMemo((()=>a.classNames("k-message-group",{"k-message-group-sender k-no-avatar":C,"k-message-group-receiver":y,"k-message-group-full-width":"full"===k})),[C,y,k]),E=g.useMemo((()=>{const e=t.messages.length-1;return t.messages.map(((t,a)=>{const o=[g.createElement(m,{item:t,template:l,selected:t.selectionIndex===c,onRequestSelection:i,tabIndex:a===e&&u?0:-1,key:t.id,allowMessageCollapse:d,messageToolbarActions:p,messageContextMenuActions:h,isSender:R(n,t)})];return t.attachments&&1===t.attachments.length&&o.push(g.createElement(G,{item:t.attachments[0],template:r,selected:!1,key:`att-${t.attachments[0].content}`})),o}))}),[t.messages,m,l,c,i,u,d,p,h,n,r]),{avatarUrl:I,avatarAltText:x,name:F}=t.author,T=void 0!==x?x:v.toLanguageString(f,M[f]);return g.createElement("div",{className:b},(()=>{if(y&&I)return g.createElement(s.Avatar,{type:"image"},g.createElement("img",{src:I,alt:T}))})(),g.createElement("div",{className:"k-message-group-content"},g.createElement("span",{className:"k-message-author"},F),E))},Q=e=>{const{suggestions:t,onSuggestionClick:n,suggestionsView:l,suggestionTemplate:o}=e,s=g.useCallback(((e,t)=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),null==n||n(t))}),[n]),r=g.useCallback((()=>t.map((e=>o?g.createElement(o,{key:e.id,suggestion:e,onClick:()=>{null==n||n(e)}}):g.createElement("span",{role:"button",tabIndex:e.disabled?-1:0,"aria-label":e.description,"aria-disabled":e.disabled,onClick:()=>!e.disabled&&(null==n?void 0:n(e)),onKeyDown:t=>!e.disabled&&s(t,e),key:e.id,title:e.description,className:a.classNames("classic"===l?"k-prompt-suggestion":"k-suggestion",{"k-disabled":e.disabled})},e.text)))),[t,o,n,l,s]);return t&&0!==t.length?"classic"===l?r():g.createElement("div",{role:"group",className:"k-suggestion-group"},r()):null},Z=g.forwardRef(((e,t)=>{const{onSendMessage:s,isDirectionRightToLeft:r,placeholder:u,MessageBox:m,suggestions:d,onSuggestionClick:p,inputValue:f,onInputValueChange:v,suggestionTemplate:C,sendButtonConfig:y}=e,{replyToMessage:b,setReplyToMessage:E,user:I,messageListScrollContainerRef:x,speechToTextConfig:T,uploadConfig:w}=V(),[N]=g.useState(!1),[A,D]=g.useState(void 0),[B,L]=g.useState([]),[K,O]=g.useState(!1),z=g.useRef(null),U=g.useRef(null),j=o.useLocalization(),$=g.useCallback((()=>{null!==z.current&&z.current.focus()}),[]);g.useEffect((()=>{void 0!==f&&f!==A&&(D(f),$())}),[f,A,$]),g.useEffect((()=>{b&&$()}),[b,$]),g.useLayoutEffect((()=>{K&&null!=x&&x.current&&(x.current.scrollTop=x.current.scrollHeight-x.current.clientHeight,O(!1))}),[K,x]);const W=g.useCallback((e=>{const t=e.value;D(t),v&&v(t)}),[v]),H=g.useMemo((()=>!!(null!=A&&A.trim()||B.length>0)),[A,B.length]),G=g.useCallback((e=>{if(e.preventDefault(),s){if(H){const t={id:"",author:I,text:A||"",timestamp:new Date,replyToId:b?b.id:void 0,files:B.map((e=>({name:e.name,size:e.size,type:e.extension,rawFile:e.getRawFile?e.getRawFile():e})))};E(null),s(t,e),L([]),D(""),v&&v(""),O(!0)}}}),[s,A,I,b,B,E,v,H]),_=g.useCallback((e=>{if("Enter"!==e.key||!e.shiftKey)switch(e.key){case"Enter":return e.preventDefault(),G(e);case"Escape":z.current&&z.current.blur();break;default:return}}),[G]);g.useImperativeHandle(t,(()=>({focusInput:$})),[$]);const Y=g.useCallback((e=>{L((t=>t.filter((t=>t.name!==e))))}),[]),X=g.useCallback((()=>g.createElement(q,{files:B,onFileRemove:Y,renderInTextarea:!0})),[B,Y]),J=g.useCallback(((e,t)=>e.isDeleted?P(t,j):e.text),[j]),Z=g.useCallback((()=>{if(b){const e=R(I,b);return g.createElement("div",{className:a.classNames("k-message-reference",e?"k-message-reference-sender":"k-message-reference-receiver")},g.createElement("div",{className:"k-message-reference-content"},J(b,e)),g.createElement("span",{className:"k-spacer"}),g.createElement(n.Button,{fillMode:"flat",themeColor:"base",svgIcon:l.xIcon,onClick:()=>E(null),"aria-label":j.toLanguageString(F,M[F])}))}return null}),[b,I,J,E,j]),ee=g.useCallback((e=>{try{const t=Array.from(e.newState);L((e=>[...e,...t])),$()}catch{}}),[$]),te=g.useCallback((()=>{U.current&&U.current.actionElement.click()}),[]),ae=g.useCallback((e=>{}),[]),ne=g.useCallback((e=>{const{isFinal:t,alternatives:a}=e;if(a.length>0){const e=a[0];t&&D((t=>(t?`${t} `:"")+e.transcript))}}),[]),le=g.useCallback((()=>g.createElement(g.Fragment,null,B.length>0&&X(),b&&g.createElement("span",{className:"k-input-prefix k-input-prefix-horizontal"},Z()))),[B.length,b,X,Z]),oe=g.useCallback((e=>{e.preventDefault()}),[]),se=g.useCallback((e=>{"Escape"===e.key&&e.currentTarget.blur()}),[]),re=g.useMemo((()=>g.createElement(n.Button,{rounded:"full",fillMode:"solid",themeColor:"primary",className:"k-chat-send",icon:"paper-plane",svgIcon:l.paperPlaneIcon,onClick:G,onMouseDown:oe,onKeyDown:se,"aria-label":j.toLanguageString(h,M[h]),dir:r?"rtl":void 0,disabled:!H,"aria-disabled":!H,...y})),[G,oe,se,j,r,H,y]),ie=g.useCallback((()=>{const e="object"==typeof T?T:void 0,t="object"==typeof w?w:{},{className:o,...s}=t,r=a.classNames("k-hidden",o);return g.createElement(c.InputSuffix,null,!1!==T&&g.createElement(n.SpeechToTextButton,{fillMode:"clear",themeColor:"base",onError:ae,onResult:ne,...e}),g.createElement(n.Button,{key:"attach-file",fillMode:"clear",themeColor:"base",svgIcon:l.paperclipIcon,onClick:te,"aria-label":j.toLanguageString(S,M[S])}),g.createElement(i.Upload,{ref:U,files:B,onAdd:ee,multiple:!0,autoUpload:!1,...s,className:r}),g.createElement("span",{className:"k-spacer"}),re)}),[T,w,B,ae,ne,te,ee,j,re]),ce=g.useMemo((()=>g.createElement(c.TextArea,{className:a.classNames("k-message-box","!k-flex-col",{"k-focus":N}),resizable:"none",rows:1,placeholder:u,value:A,onChange:W,onKeyDown:_,prefix:le,suffix:ie,ref:z,"aria-label":j.toLanguageString(k,M[k])})),[N,u,A,W,_,le,ie,j]);return g.createElement("div",{className:"k-message-box-wrapper"},d&&d.length>0&&g.createElement(Q,{onSuggestionClick:p,suggestions:d,suggestionTemplate:C}),m?g.createElement(m,{messageInput:ce,sendButton:re}):ce)}));Z.displayName="NewMessage";const ee=e=>g.createElement(s.AppBar,{className:"k-chat-header",positionMode:"sticky",themeColor:"light"},e.children),te=e=>{const{message:t,onUnpin:s,user:r}=e,i=o.useLocalization(),{internalScrollContainerRef:c}=V(),u=g.useCallback((e=>{e.preventDefault(),e.stopPropagation();const a=null==c?void 0:c.current;B(t.id,a)}),[t.id,c]);return g.createElement("div",{className:"k-message-reference k-message-reference-receiver k-message-pinned",onClick:u},g.createElement(a.IconWrap,{size:"xlarge",icon:l.pinIcon}),g.createElement("div",{className:"k-message-reference-content"},null!=t&&t.isDeleted?r&&P(R(r,t),i):null==t?void 0:t.text),g.createElement("span",{className:"k-spacer"}),g.createElement(n.Button,{svgIcon:l.xIcon,onClick:e=>{e.stopPropagation(),null==s||s(t)}}))},ae=e=>{const{show:t,text:a}=e;return g.createElement("div",{style:{position:"absolute",top:"90%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1e3,pointerEvents:t?"auto":"none"}},g.createElement(u.Fade,null,t&&g.createElement(m.Notification,{type:{style:"dark"},closable:!1},g.createElement("span",null,a))))},ne=Object.freeze({name:"@progress/kendo-react-conversational-ui",productName:"KendoReact",productCode:"KENDOUIREACT",productCodes:["KENDOUIREACT"],publishDate:0,version:"12.0.0-develop.11",licensingDocsUrl:"https://www.telerik.com/kendo-react-ui/components/my-license/?utm_medium=product&utm_source=kendoreact&utm_campaign=kendo-ui-react-purchase-license-keys-warning"}),le={textField:"text",statusField:"status",authorIdField:"authorId",authorNameField:"authorName",authorImageUrlField:"authorImageUrl",authorImageAltTextField:"authorImageAltText",idField:"id",timestampField:"timestamp",filesField:"files",attachmentsField:"attachments",replyToIdField:"replyToId",isDeletedField:"isDeleted",isPinnedField:"isPinned",typingField:"typing",suggestedActionsField:"suggestedActions"},oe=(e,t={})=>{const a={...le,...t};let n,l;n=e.author&&"object"==typeof e.author?{id:e.author.id||e.author[a.authorIdField]||e[a.authorIdField]||"",name:e.author.name||e.author[a.authorNameField]||e[a.authorNameField],avatarUrl:e.author.avatarUrl||e.author[a.authorImageUrlField]||e[a.authorImageUrlField],avatarAltText:e.author.avatarAltText||e.author[a.authorImageAltTextField]||e[a.authorImageAltTextField]}:{id:e[a.authorIdField]||e.authorId||"",name:e[a.authorNameField]||e.authorName,avatarUrl:e[a.authorImageUrlField]||e.authorImageUrl,avatarAltText:e[a.authorImageAltTextField]||e.authorImageAltText},l=e.timestamp?new Date(e.timestamp):e[a.timestampField]?new Date(e[a.timestampField]):new Date;const o={id:void 0!==e.id?e.id:e[a.idField],text:void 0!==e.text?e.text:e[a.textField]||"",author:n,timestamp:l,status:void 0!==e.status?e.status:e[a.statusField],attachments:void 0!==e.attachments?e.attachments:e[a.attachmentsField],attachmentLayout:e.attachmentLayout||"list",suggestedActions:void 0!==e.suggestedActions?e.suggestedActions:e[a.suggestedActionsField],isPinned:void 0!==e.isPinned?e.isPinned:e[a.isPinnedField]||!1,typing:void 0!==e.typing?e.typing:e[a.typingField],files:void 0!==e.files?e.files:e[a.filesField]||[]};return e.pinnedAt&&(o.pinnedAt=new Date(e.pinnedAt)),e.pinnedBy&&(o.pinnedBy=e.pinnedBy),void 0!==e.replyToId?o.replyToId=e.replyToId:void 0!==e[a.replyToIdField]&&(o.replyToId=e[a.replyToIdField]),void 0!==e.isDeleted?o.isDeleted=e.isDeleted:void 0!==e[a.isDeletedField]&&(o.isDeleted=e[a.isDeletedField]),o},se=(e,t={})=>Array.isArray(e)?e.map((e=>oe(e,t))):[],re=e=>e&&void 0!==e.id&&"string"==typeof e.text&&e.author&&"object"==typeof e.author&&void 0!==e.author.id&&(e.timestamp instanceof Date||"string"==typeof e.timestamp||"number"==typeof e.timestamp),ie=g.forwardRef(((e,t)=>{const{messages:n=[],messageTemplate:l,attachmentTemplate:s,width:r,height:i,onSendMessage:c,onSuggestionClick:u,onInputValueChange:m,onActionExecute:d,dir:p,messageBox:h,placeholder:k,className:f,message:C=z,authorId:y,suggestions:b,suggestionTemplate:E,inputValue:x,headerTemplate:F,timestampTemplate:T,statusTemplate:w,allowMessageCollapse:N,messageToolbarActions:A,messageContextMenuActions:S,fileActions:D,onUnpin:R,messageWidthMode:P,onToolbarAction:B,onContextMenuAction:L,onFileAction:K,onDownload:V,speechToTextConfig:q,uploadConfig:U,sendButtonConfig:j,textField:W,statusField:G,authorIdField:X,authorNameField:Q,authorImageUrlField:le,authorImageAltTextField:oe,idField:ie,timestampField:ce,filesField:ue,attachmentsField:me,replyToIdField:de,isDeletedField:pe,isPinnedField:ge,typingField:he,suggestedActionsField:ke,...fe}=e,[ve,Ce]=g.useState(null),[ye,be]=g.useState(!1),[Ee,Ie]=g.useState(!1),[xe,Fe]=g.useState(null),[Te,we]=g.useState(null),Ne=g.useRef(null),Ae=g.useRef(null),Se=g.useRef(null),De=g.useRef(null),Me=g.useRef(void 0),Re=g.useRef(void 0),Pe=g.useRef(null),Be=g.useRef(""),Le=g.useMemo((()=>{if(!n||0===n.length)return[];const e={textField:W,statusField:G,authorIdField:X,authorNameField:Q,authorImageUrlField:le,authorImageAltTextField:oe,idField:ie,timestampField:ce,filesField:ue,attachmentsField:me,replyToIdField:de,isDeletedField:pe,isPinnedField:ge,typingField:he,suggestedActionsField:ke};return!Object.values(e).some((e=>void 0!==e))&&re(n[0])?n.map((e=>({...e,timestamp:e.timestamp?new Date(e.timestamp):e.timestamp}))):se(n,e)}),[n,W,G,X,Q,le,oe,ie,ce,ue,me,de,pe,ge,he,ke]);g.useEffect((()=>{if(y===Be.current&&Pe.current)we(Pe.current);else if(y&&Le.length>0){const e=Le.find((e=>e.author&&(e.author.id===y||e.author.id===String(y)))),t=(null==e?void 0:e.author)||{id:y};Pe.current=t,Be.current=y,we(t)}}),[y,Le]);const Ke=g.useMemo((()=>Le.length>0?(e=>{const t=e.slice().reduce($(e.length),[]);return function(e){let t=0;e.forEach((e=>{"message-group"===e.type?e.messages.forEach((e=>{e.selectionIndex=t++})):("attachment-group"===e.type||"action-group"===e.type)&&(e.selectionIndex=t++)})),e.lastSelectionIndex=t-1}(t),t})(Le):[]),[Le]),Oe=g.useMemo((()=>!a.validatePackage(ne,{component:"Chat"})),[]),Ve=a.getLicenseMessage(ne),qe=g.useMemo((()=>Le.find((e=>e.isPinned))),[Le]),ze=o.useLocalization(),Ue=g.useCallback((()=>{clearTimeout(Me.current)}),[]),je=g.useCallback((()=>{Me.current=window.setTimeout((()=>{Ce(null)}),0)}),[]),$e=g.useCallback((e=>{Ce(e)}),[]),We=g.useCallback((e=>{let t=null;const n=null!==ve?ve:Ke.lastSelectionIndex;e.keyCode===a.Keys.up?null===n?t=0:n>0&&(t=n-1):e.keyCode===a.Keys.down?null===n?t=0:n<Ke.lastSelectionIndex&&(t=n+1):e.keyCode===a.Keys.home?t=0:e.keyCode===a.Keys.end&&(t=Ke.lastSelectionIndex),null!==t&&(Ce(t),e.preventDefault())}),[ve,Ke]),He=g.useCallback((()=>{Se.current&&(Se.current.scrollTop=Se.current.scrollHeight-Se.current.clientHeight)}),[]),Ge=g.useCallback((()=>{if(!Se.current)return!0;const{scrollTop:e,scrollHeight:t,clientHeight:a}=Se.current;return t-e-a<50}),[]),_e=g.useCallback((()=>{Ge()&&requestAnimationFrame((()=>{He()}))}),[Ge,He]),Ye=g.useCallback((()=>{requestAnimationFrame((()=>{He()}))}),[He]),Xe=g.useCallback(((e,t,a)=>{var n;if(d&&d({action:{value:e.value,title:e.title,type:e.type},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget}),!t.isDefaultPrevented()){switch(e.type){case"reply":c&&c({message:{id:"",author:Te,text:e.value,timestamp:new Date},syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget});break;case"call":window.open("tel:"+e.value);break;case"openUrl":window.open(e.value)}null==(n=De.current)||n.focusInput()}}),[d,c,Te]),Je=g.useCallback((()=>a.classNames("k-chat",f,{"k-rtl":ye})),[f,ye]),Qe=g.useCallback((()=>{const e=Ke.length-1;return Ke.map(((t,a)=>"date-marker"===t.type?g.createElement(Y,{item:t,key:t.trackBy,timestampTemplate:T}):"message-group"===t.type?g.createElement(J,{group:t,itemTemplate:l,attachmentTemplate:s,user:Te,selectedItemIndex:ve,onRequestSelection:$e,isLastGroup:a===e,key:t.messages[0].selectionIndex,message:C,allowMessageCollapse:N,messageToolbarActions:A,messageContextMenuActions:S,messageWidthMode:P}):"attachment-group"===t.type?g.createElement(_,{group:t,itemTemplate:s,onRequestSelection:$e,selected:t.selectionIndex===ve,isLastGroup:a===e,key:t.selectionIndex}):"action-group"===t.type?g.createElement(H,{group:t,onActionExecute:Xe,onRequestSelection:$e,selected:t.selectionIndex===ve,key:t.selectionIndex}):null))}),[Ke,T,l,s,Te,ve,$e,C,N,A,S,P,Xe]),Ze=g.useCallback((()=>F?"function"==typeof F?F():F:null),[F]);g.useEffect((()=>{const e=void 0!==p?"rtl"===p:Ne.current&&"rtl"===getComputedStyle(Ne.current).direction;be(!!e)}),[p]),g.useEffect((()=>(Re.current=window.setTimeout((()=>He()),250),()=>{clearTimeout(Re.current)})),[He]),g.useEffect((()=>()=>{clearTimeout(Me.current),clearTimeout(Re.current)}),[]),g.useEffect((()=>{Ye()}),[Le.length,Ye]),g.useEffect((()=>{const e=window.setTimeout((()=>{_e()}),50);return()=>{clearTimeout(e)}}),[Le,_e]),g.useEffect((()=>{if(b&&b.length>0){const e=window.setTimeout((()=>{_e()}),100);return()=>{clearTimeout(e)}}}),[b,_e]);const et=g.useMemo((()=>({replyToMessage:xe,setReplyToMessage:Fe,messages:Le,user:Te,internalScrollContainerRef:Ae,messageListScrollContainerRef:Se,onToolbarAction:B,onContextMenuAction:L,onFileAction:K,setShowCopyNotification:Ie,onDownload:V,fileActions:D,speechToTextConfig:q,uploadConfig:U,statusTemplate:w})),[xe,Fe,Le,Te,B,L,K,Ie,V,D,q,U,w]);return g.createElement(O.Provider,{value:et},g.createElement("div",{style:{width:r,height:i,position:"relative",overflow:"hidden"},onKeyDown:We,className:Je(),ref:e=>{Ne.current=e,Ae.current=e,"function"==typeof t?t(e):t&&(t.current=e)},...fe},void 0!==F&&g.createElement(ee,null,Ze()),qe&&g.createElement(te,{message:qe,onUnpin:R,user:Te}),g.createElement("div",{className:"k-message-list k-avatars",onBlur:je,onFocus:Ue,role:"log","aria-label":ze.toLanguageString(v,M[v]),"aria-live":"polite",ref:Se},g.createElement("div",{className:"k-message-list-content"},Qe())),g.createElement(Z,{onSendMessage:(e,t)=>{c&&c({message:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})},onSuggestionClick:e=>{u&&u(e)},isDirectionRightToLeft:ye,ref:De,placeholder:k,MessageBox:h,suggestions:b,suggestionTemplate:E,inputValue:x,onInputValueChange:e=>{m&&m(e)},sendButtonConfig:j}),g.createElement(ae,{show:Ee,text:ze.toLanguageString(I,M[I])}),Oe&&g.createElement(a.WatermarkOverlay,{message:Ve})))}));ie.displayName="Chat",ie.propTypes={messages:r.arrayOf(r.object),user:r.object,messageTemplate:r.any,attachmentTemplate:r.any,width:r.oneOfType([r.string,r.number]),onSendMessage:r.func,onActionExecute:r.func,dir:r.string,messageBox:r.any};const ce=e=>{const{activeView:a,toolbarItems:l,activeViewChange:o}=e;return t.createElement("div",{className:"k-prompt-header"},t.createElement(n.Toolbar,{keyboardNavigation:!1,role:"toolbar",className:"k-toolbar-flat"},l.map((e=>t.isValidElement(e)?e:t.createElement(n.Button,{key:e.name,className:a===e.name?"k-selected":"",size:"medium",themeColor:"primary",fillMode:"flat",rounded:"full",title:e.buttonText,svgIcon:e.buttonIcon,onClick:()=>(e=>{null==o||o.call(null,e)})(e.name)},e.buttonText)))))},ue={name:"Output view",buttonText:"Output",buttonIcon:l.commentIcon},me={name:"Commands view",buttonIcon:l.moreHorizontalIcon},de={name:"Prompt view",buttonText:"Ask AI",buttonIcon:l.sparklesIcon},pe=t.createContext([{},()=>{}]),ge=()=>t.useContext(pe),he=e=>{const{children:a}=e;return t.createElement("div",{className:"k-prompt-footer"},t.createElement("div",{className:"k-actions k-actions-start k-actions-horizontal k-prompt-actions"},a))},ke=t.forwardRef(((e,a)=>{const{children:s,streaming:r,onCancel:i}=e,c=o.useLocalization().toLanguageString(y,M[y]),[u]=ge(),m=u.activeView===ue.name,d=r&&m,p=t.useCallback((e=>{"Escape"===e.key&&d&&i&&(e.preventDefault(),i())}),[d,i]);return t.createElement("div",{className:"k-prompt-content",ref:a,onKeyDown:p},d&&t.createElement(n.FloatingActionButton,{onClick:i,svgIcon:l.stopSmIcon,icon:"stop-sm",size:"medium",positionMode:"absolute",className:"k-prompt-stop-fab k-generating","aria-label":c,title:c}),t.createElement("div",{className:"k-prompt-view"},s))}));ke.displayName="KendoReactAIPromptContent";const fe=e=>{const[t]=ge();return t.activeView===e.name?e.children:null},ve=e=>{const[a,o]=t.useState(!0),{children:s,title:r}=e;return t.createElement("div",{className:"k-prompt-expander"},t.createElement(n.Button,{"aria-controls":e.id,fillMode:"flat",svgIcon:a?l.chevronUpIcon:l.chevronDownIcon,title:r,onClick:()=>o(!a),"aria-expanded":a},r),a&&t.createElement("div",{id:e.id,className:"k-prompt-expander-content"},s))},Ce=e=>null==e?void 0:e.map((e=>t.createElement(s.PanelBarItem,{title:e.text,key:e.id,svgIcon:e.svgIcon,data:e},e.children&&Ce(e.children||[])))),ye=({show:e=!1,anchor:a,onOpen:n,onClose:l,animate:o=!0,appendTo:s,popupOptions:r={},children:i,style:c})=>t.createElement(d.Popup,{show:e,anchor:a,style:c,animate:o,appendTo:s,onOpen:n,onClose:l,...r},i),be=({placeholder:e="Ask or generate content with AI...",promptValue:o,onMenuClick:s,promptInput:r=c.TextArea,generateButton:i,enableSpeechToText:u=!1,streaming:m=!1,commands:d,onPromptRequest:p,onPromptCancel:g})=>{const[h,k]=t.useState(o||""),[f,v]=a.useCustomComponent(i),[C,y]=a.useCustomComponent(r),b={svgIcon:m?l.stopSmIcon:l.paperPlaneIcon,active:(!!m).toString(),title:"Send Button","aria-label":"Send Button",disabled:!h.trim()&&!m,"aria-disabled":!h.trim()&&!m},E={placeholder:e,className:"!k-flex-row",autoSize:!0,rows:1},I=d&&d.length>0,x=Object.keys(v).length>0?v:b,F=Object.keys(y).length>0?y:E,T=e=>{const{isFinal:t,alternatives:a}=e;if(t&&a.length>0){const e=a[0].transcript,t=(()=>{const t=h,a=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(a?" ":"")+e})();k(t)}},w=()=>{h.trim()&&p&&p(h.trim())};return t.createElement(C,{value:h,onChange:e=>{const t=e.target.value;k(t)},onKeyDown:e=>{"Enter"===e.key&&!e.shiftKey&&(e.preventDefault(),w())},prefix:I||u?t.createElement(t.Fragment,null,t.createElement(c.InputPrefix,{className:"!k-align-items-start"},I&&t.createElement(n.Button,{"aria-label":"Commands Button",title:"Commands Button",fillMode:"flat",svgIcon:l.menuIcon,onClick:s}),u&&t.createElement(n.SpeechToTextButton,{fillMode:"flat",..."object"==typeof u?{...u,onResult:u.onResult||T}:{onResult:T}})),t.createElement(c.InputSeparator,null)):void 0,suffix:t.createElement(c.InputSuffix,{className:"!k-align-items-start"},t.createElement(f,{className:a.classNames("k-prompt-send",{"k-generating":m,"k-active":m}),fillMode:"flat",onClick:m?g:w,...x})),...F})};e.AIPrompt=e=>{const n=!a.validatePackage(ne,{component:"AIPrompt"}),l=a.getLicenseMessage(ne),{activeView:o,toolbarItems:s,children:r,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u,style:m,dir:d,className:p,streaming:g,loading:h,onCancel:k,suggestionsView:f,...v}=e,C=s||[de,ue],[y,b]=t.useState({activeView:o}),E={...y,activeView:o,streaming:g,loading:h,suggestionsView:null!=f?f:"classic",onCancel:k,onActiveViewChange:i,onPromptRequest:c,onCommandExecute:u};return t.createElement(pe.Provider,{value:[E,e=>{b(e)}]},t.createElement("div",{className:a.classNames("k-prompt",p),style:m,dir:d,...v},t.createElement(ce,{activeView:E.activeView,toolbarItems:C,activeViewChange:i}),r,n&&t.createElement(a.WatermarkOverlay,{message:l})))},e.AIPromptCommandsView=e=>{const{commands:a}=e,[n]=ge();return t.createElement(fe,{name:me.name},t.createElement(ke,{streaming:n.streaming,onCancel:n.onCancel},t.createElement("div",{className:"k-prompt-view"},t.createElement(s.PanelBar,{onSelect:e=>{var t,a,l;const o=null==(a=null==(t=e.target)?void 0:t.props)?void 0:a.data;null!=(l=o.children)&&l.length||n.onCommandExecute&&n.onCommandExecute.call(null,o)},selected:""},Ce(null!=a?a:[])))))},e.AIPromptContent=ke,e.AIPromptFooter=he,e.AIPromptOutputView=e=>{const[a,r]=t.useState(""),i=t.useRef(null),[c]=ge(),{outputs:u,showOutputRating:m,outputCard:d}=e,{header:p,body:g,actions:h}=d||{},k=o.useLocalization(),f=(e,t)=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,ratingType:t,isRetry:!1}),v()},v=()=>{i&&i.current&&i.current.scrollTo({top:0,behavior:"smooth"})},y=t.createElement(s.Card,null,t.createElement(s.CardHeader,null,t.createElement(s.CardTitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"200px"}})),t.createElement(s.CardSubtitle,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),t.createElement(s.CardBody,null,t.createElement("span",{className:"k-skeleton k-skeleton-rect k-skeleton-pulse",style:{height:"80px"}})),t.createElement(s.CardActions,null,t.createElement("span",{className:"k-skeleton k-skeleton-text k-skeleton-pulse",style:{width:"100%"}}))),b=null==u?void 0:u.map(((e,o)=>t.createElement(s.Card,{key:`${e.id}_${o}`},t.createElement(s.CardHeader,null,p?p(e):t.createElement(t.Fragment,null,e.title&&t.createElement(s.CardTitle,null,e.title),e.subTitle&&t.createElement(s.CardSubtitle,null,e.subTitle))),t.createElement(s.CardBody,null,g?g(e):e.responseContent),t.createElement(s.CardActions,null,h?h(e):t.createElement(t.Fragment,null,t.createElement(n.Button,{size:"medium",themeColor:"primary",fillMode:"flat",rounded:"medium",title:"Copy",svgIcon:a===e.id?l.checkIcon:l.copyIcon,onClick:()=>(e=>{null!=e&&e.responseContent&&navigator.clipboard.writeText(e.responseContent),r(e.id),setTimeout((()=>{r("")}),1e3)})(e)},"Copy"),t.createElement(n.Button,{size:"medium",themeColor:"base",fillMode:"flat",rounded:"medium",title:"Retry",svgIcon:l.arrowRotateCwIcon,onClick:()=>(e=>{c.onPromptRequest&&c.onPromptRequest.call(null,e.prompt,{...e,isRetry:!0}),v()})(e)},"Retry"),m&&t.createElement(t.Fragment,null,t.createElement("span",{className:"k-spacer"}),t.createElement(n.Button,{size:"medium",themeColor:"positive"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate up",svgIcon:l.thumbUpOutlineIcon,onClick:()=>f(e,"positive")}),t.createElement(n.Button,{size:"medium",themeColor:"negative"===e.ratingType?"primary":"base",fillMode:"flat",rounded:"medium",title:"Rate down",svgIcon:l.thumbDownOutlineIcon,onClick:()=>f(e,"negative")}))))))),E=t.createElement(s.Card,null,t.createElement(s.CardBody,null,k.toLanguageString(C,M[C])));return t.createElement(fe,{name:ue.name},t.createElement(ke,{ref:i,streaming:c.streaming,onCancel:c.onCancel},t.createElement("div",{className:"k-card-list"},c.loading&&y,b,(!b||0===b.length)&&!c.loading&&E)))},e.AIPromptView=e=>{const{promptInput:o=c.TextArea,generateButton:s=n.Button,enableSpeechToText:r=!1,promptValue:i,promptSuggestions:u}=e,[m,d]=t.useState(i||""),[p]=ge(),[g,h]=a.useCustomComponent(s),[k,f]=a.useCustomComponent(o),v={title:"Generate",children:"Generate",svgIcon:l.sparklesIcon},C=Object.keys(h).length>0?h:v,y=Object.keys(f).length>0?f:{placeholder:"Ask or generate content with AI ...",rows:2},b=e=>{const{isFinal:t,alternatives:a}=e;if(t&&a.length>0){const e=a[0].transcript,t=(()=>{const t=m,a=t&&!t.endsWith(" ")&&!t.endsWith("\n");return t+(a?" ":"")+e})();d(t)}};let E;return r&&(E="object"==typeof r?{...r,onResult:r.onResult||b}:{onResult:b}),t.createElement(fe,{name:de.name},t.createElement(ke,{streaming:p.streaming,onCancel:p.onCancel},t.createElement(k,{value:m,className:"!k-flex-col",suffix:r?t.createElement(t.Fragment,null,t.createElement(c.InputSeparator,{orientation:"horizontal"}),t.createElement(c.InputSuffix,{orientation:"horizontal"},t.createElement(n.SpeechToTextButton,{fillMode:"flat",...E}))):void 0,onChange:e=>{d(e.target.value)},...y}),u&&u.length>0&&t.createElement(ve,{title:"Prompt Suggestions"},t.createElement(Q,{suggestionsView:p.suggestionsView,suggestions:u.map(((e,t)=>({id:t,text:e,description:e}))),onSuggestionClick:e=>{(e=>{d(e)})(e.text)}}))),t.createElement(he,null,t.createElement(g,{themeColor:"primary",fillMode:"solid",rounded:"full",size:"medium",onClick:()=>{p.onPromptRequest&&p.onPromptRequest.call(null,m),d("")},disabled:!m.trim(),...C},C.children)))},e.AIPromptViewRender=fe,e.Chat=ie,e.ChatMessage=z,e.DEFAULT_FIELD_MAPPING=le,e.HeroCard=e=>{const{imageUrl:t,imageMaxWidth:a,title:l,subtitle:o,actions:s,onActionExecute:r,altText:i}=e,c=g.useCallback(((e,t)=>{null==r||r({action:e,syntheticEvent:t,nativeEvent:t.nativeEvent,target:t.currentTarget})}),[r]),u=i||l||"";return g.createElement("div",{className:"k-card"},g.createElement("img",{className:"k-card-image",src:t,style:{maxWidth:a},alt:u}),g.createElement("div",{className:"k-card-body"},l&&g.createElement("h5",{className:"k-card-title"},l),o&&g.createElement("h6",{className:"k-card-subtitle"},o)),g.createElement("div",{className:"k-card-actions k-card-actions-vertical"},s.map(((e,t)=>g.createElement("span",{className:"k-card-action",key:`action-${t}-${e.title||e.value||t}`},g.createElement(n.Button,{fillMode:"flat",onClick:t=>c(e,t)},e.title))))))},e.InlineAIPrompt=e=>{const o=!a.validatePackage(ne,{component:"InlineAIPrompt"}),r=a.getLicenseMessage(ne),{outputs:i=[],outputCard:u,promptInput:m=c.TextArea,generateButton:d=n.Button,promptPlaceholder:p="Ask or generate content with AI...",promptValue:g,onPromptRequest:h,onCopy:k,onDiscard:f,outputActions:v,onOutputAction:C,enableSpeechToText:y=!1,streaming:b,onPromptCancel:E,show:I=!1,anchor:x,width:F,height:T,onOpen:w,onClose:N,animate:A=!0,appendTo:S,commands:D,onCommandExecute:M,style:R,className:P,popupOptions:B={},...L}=e,[K,O]=t.useState(""),[V,q]=t.useState(!1),[z,U]=t.useState({left:0,top:0}),j=t.useRef(null),{body:$,actions:W}=u||{},H=v||[{id:"copy",text:"Copy",svgIcon:l.copyIcon,themeColor:"primary",title:"Copy"},{id:"discard",text:"Discard",svgIcon:l.cancelOutlineIcon,themeColor:"base",title:"Discard"}],G=(e,t)=>{switch(e.id){case"copy":(e=>{e.responseContent&&(navigator.clipboard.writeText(e.responseContent),O(e.id),setTimeout((()=>O("")),1e3)),null==k||k(e)})(t);break;case"discard":(e=>{null==f||f(e)})(t);break;default:null==C||C(e,t)}},_=t.useCallback((e=>{"Escape"===e.key&&(b&&E?E():!b&&N&&N({target:null}))}),[b,E,N]),Y={...R,...F&&{width:F},...T&&{height:T}},X={...F&&{width:F},...T&&{height:T}},J=t.createElement(t.Fragment,null,t.createElement("div",{className:a.classNames("k-prompt",P),style:Y,onKeyDown:_,...L},t.createElement(ke,{ref:j},i&&i.length>0&&t.createElement("div",{className:"k-card-list"},i.map(((e,a)=>t.createElement(s.Card,{key:`${e.id}_${a}`},t.createElement(s.CardBody,null,$?$(e):e.responseContent),t.createElement(s.CardActions,null,W?W(e):t.createElement(t.Fragment,null,H.map((a=>{var o;return a.spacer?t.createElement("span",{key:a.id,className:"k-spacer"}):t.createElement(n.Button,{key:a.id,size:"medium",themeColor:a.themeColor||"primary",fillMode:"flat",rounded:"medium",title:null!=(o=a.title)?o:a.text,svgIcon:"copy"===a.id&&K===e.id?l.checkIcon:a.svgIcon,onClick:()=>G(a,e)},a.text)})))))))),t.createElement(be,{promptValue:g,placeholder:p,onPromptRequest:h,onMenuClick:e=>{if(!j.current)return;const t=j.current.getBoundingClientRect();U({left:t.left,top:t.bottom}),q(!0)},onPromptCancel:E,promptInput:m,generateButton:d,enableSpeechToText:y,streaming:b,commands:D}))),o&&t.createElement(a.WatermarkOverlay,{message:r}));return t.createElement(t.Fragment,null,t.createElement(ye,{show:I,anchor:x,onOpen:w,onClose:N,animate:A,appendTo:S,popupOptions:B,style:X},J),t.createElement(s.ContextMenu,{show:V,offset:z,onClose:()=>{q(!1)},items:(e=>null==e?void 0:e.map((e=>({text:e.text,svgIcon:e.svgIcon,data:e,items:e.children?e.children.map((e=>({text:e.text,data:e}))):void 0}))))(D),onSelect:e=>{var t,a;const n=null==(t=e.item)?void 0:t.data;n&&(null==(a=n.children)||!a.length)&&(e=>{q(!1),M&&M(e)})(n)}}))},e.PromptHeader=ce,e.SuggestionGroup=Q,e.commandsViewDefaults=me,e.extractFieldMappingFromProps=e=>({textField:e.textField,statusField:e.statusField,authorIdField:e.authorIdField,authorNameField:e.authorNameField,authorImageUrlField:e.authorImageUrlField,authorImageAltTextField:e.authorImageAltTextField,idField:e.idField,timestampField:e.timestampField,filesField:e.filesField,attachmentsField:e.attachmentsField,replyToIdField:e.replyToIdField,isDeletedField:e.isDeletedField,isPinnedField:e.isPinnedField,typingField:e.typingField,suggestedActionsField:e.suggestedActionsField}),e.isStandardMessageFormat=re,e.mapDataArrayToMessages=se,e.mapDataToMessage=oe,e.mapMessageToCustomFormat=(e,t={})=>{const a={...le,...t},n={};return void 0!==e.id&&(n[a.idField]=e.id),void 0!==e.text&&(n[a.textField]=e.text),void 0!==e.status&&(n[a.statusField]=e.status),void 0!==e.timestamp&&(n[a.timestampField]=e.timestamp),void 0!==e.attachments&&(n[a.attachmentsField]=e.attachments),void 0!==e.files&&(n[a.filesField]=e.files),void 0!==e.suggestedActions&&(n[a.suggestedActionsField]=e.suggestedActions),void 0!==e.replyToId&&(n[a.replyToIdField]=e.replyToId),void 0!==e.isDeleted&&(n[a.isDeletedField]=e.isDeleted),void 0!==e.isPinned&&(n[a.isPinnedField]=e.isPinned),void 0!==e.typing&&(n[a.typingField]=e.typing),e.author&&(void 0!==e.author.id&&(n[a.authorIdField]=e.author.id),void 0!==e.author.name&&(n[a.authorNameField]=e.author.name),void 0!==e.author.avatarUrl&&(n[a.authorImageUrlField]=e.author.avatarUrl),void 0!==e.author.avatarAltText&&(n[a.authorImageAltTextField]=e.author.avatarAltText)),void 0!==e.pinnedAt&&(n.pinnedAt=e.pinnedAt),void 0!==e.pinnedBy&&(n.pinnedBy=e.pinnedBy),void 0!==e.attachmentLayout&&(n.attachmentLayout=e.attachmentLayout),n},e.outputViewDefaults=ue,e.promptViewDefaults=de}));
package/index.d.mts CHANGED
@@ -41,7 +41,7 @@ export declare interface Action {
41
41
 
42
42
  /**
43
43
  * The button type of the quick action
44
- * ([see examples]({% slug suggested_actions_chat %})).
44
+ * ([see examples]({% slug quick_actions_suggested_actions_chat %})).
45
45
  *
46
46
  * * `openUrl`&mdash;Opens a new browser window with the specified URL.
47
47
  * * `reply`&mdash;Sends the action value as a reply in the Chat.
@@ -576,7 +576,7 @@ export declare interface ChatMessageProps {
576
576
  /**
577
577
  * Represents the properties available to the `messageTemplate` custom component.
578
578
  *
579
- * For more information, refer to the [Message Template]({% slug message_templates_chat %}) article.
579
+ * For more information, refer to the [Message Template]({% slug customization_message_templates_chat %}) article.
580
580
  */
581
581
  export declare interface ChatMessageTemplateProps {
582
582
  item: MessageModel;
@@ -632,7 +632,7 @@ export declare interface ChatProps extends FieldMappingConfig {
632
632
  placeholder?: string;
633
633
  /**
634
634
  * Enables the customization or the override of the default message box item in the Conversational UI
635
- * ([see example]({% slug custom-rendering_chat %})).
635
+ * ([see example]({% slug customization_messagebox_templates_chat %})).
636
636
  */
637
637
  messageBox?: React.ComponentType<ChatMessageBoxProps>;
638
638
  /**
@@ -1222,7 +1222,7 @@ export declare interface Message {
1222
1222
  attachments?: Attachment[];
1223
1223
  /**
1224
1224
  * The suggested quick actions that will be displayed below this message
1225
- * ([see example]({% slug suggested_actions_chat %}#toc-defining-quick-actions)).
1225
+ * ([see example]({% slug quick_actions_suggested_actions_chat %}#toc-defining-quick-actions)).
1226
1226
  *
1227
1227
  * > Suggested actions are displayed only for the last message in the conversation.
1228
1228
  */