@veracity/ai 2.4.1 → 2.4.3

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/README.md ADDED
@@ -0,0 +1,81 @@
1
+ # How to create the frontend of a chat box using @veracity.ai npm package
2
+
3
+ This guide will walk you through the steps to create a simple chat box frontend using the `@veracity.ai` npm package. Follow the instructions below to set up your project and implement the chat box functionality. This example uses React as the frontend framework.
4
+
5
+ ## Prerequisites
6
+ Before you begin, ensure you have the following installed on your machine:
7
+ - Node.js (version 20 or higher)
8
+ - npm (Node Package Manager)
9
+ - A code editor (e.g., Visual Studio Code)
10
+ - A React application set up (you can use Create React App to quickly set up a new project)
11
+ - @veracity.ai Package
12
+ - @veracity/vui Package
13
+
14
+
15
+ ## Step 1: Set Up Your React Application
16
+
17
+ If you haven't already set up a React application, you can create one using Create React App:
18
+ ```bash
19
+ npx create-react-app chat-box-app
20
+ cd chat-box-app
21
+ ```
22
+
23
+ ## Step 2: Install the @veracity.ai & @veracity/vui Package
24
+
25
+ Install the `@veracity.ai` npm package by running the following command in your project directory:
26
+ ```bash
27
+ npm install @veracity.ai
28
+ ```
29
+
30
+ Install the `@veracity/vui` npm package by running the following command in your project directory:
31
+ ```bash
32
+ npm install @veracity/vui
33
+ ```
34
+
35
+ ## Step 3: Create the `Chat` component
36
+
37
+ In @veracity.ai package, it provides a reusable chat component named `Chat` that you can easily integrate into your React application. It provides the main chat features to ask questions and get responses, store the chat history in table storage.
38
+
39
+ You can create a new Chat by providing four endpoints:
40
+ - `url`: The endpoint to send chat messages.
41
+ - `historyUrl`: The endpoint to fetch chat history of current chat, so chat id should be included in the url.
42
+ - `feedbackUrl`: The endpoint to send and retrieve feedback on chat responses in current chat, so chat id should be included in the url.
43
+ - `summarizeTitleUrl`: The endpoint to create chat title based on current chat content, so chat id should be included in the url.
44
+
45
+ After the component is created, you can call the methods it provides:
46
+ - LoadHistoryMessages: load current chat history messages from the `historyUrl`.
47
+ - SubmitMessageAsync: submit a new message to the `url` and get the response.
48
+ - SummarizeTitleAsync: generate a title based on current chat content using the `summarizeTitleUrl`.
49
+ - SetLikeAsync: set like and dislike feedback for a specific message using the `feedbackUrl`.
50
+ - LoadLikesAsync: load likes and dislikes for messages in the current chat using the `feedbackUrl`.
51
+
52
+ Here is an example to create a react hook component to use the `Chat` component:
53
+ ```jsx
54
+ import { useEffect, useState } from 'react'
55
+ import { Chat } from '@veracity/ai'
56
+ import { LoginDto } from '../types'
57
+
58
+ export const useAIChat = (endpoint: string, historyEndpoint: string, feedbackUrl: string, titleUrl: string, userInfo: LoginDto | null) => {
59
+ const [aiChat, setAiChat] = useState<Chat | null>(null)
60
+
61
+ useEffect(() => {
62
+ if (userInfo && !aiChat) {
63
+ const newAiChat = new Chat({
64
+ url: endpoint,
65
+ historyUrl: historyEndpoint,
66
+ feedbackUrl: feedbackUrl,
67
+ summarizeTitleUrl: titleUrl
68
+ })
69
+ setAiChat(newAiChat)
70
+ }
71
+ }, [aiChat, endpoint, feedbackUrl, historyEndpoint, titleUrl, userInfo])
72
+
73
+ return aiChat
74
+ }
75
+ ```
76
+
77
+ ## Step 4: Integrate the `Chat` Component into Your Application
78
+
79
+ Please refer to the example project to see how to integrate the `Chat` component into your React application.
80
+ You can find the example project [here](https://dnvgl-one.visualstudio.com/Veracity/_git/AN_Veracity.AI_ExampleVuiApp)
81
+
@@ -44,7 +44,7 @@ export declare class Chat {
44
44
  SummarizeTitleAsync(chatId: string, message: string): Promise<any>;
45
45
  submitMessageAsync(message: string, chatId: string, copilotId: string): Promise<void>;
46
46
  stop(): void;
47
- setLike(messageId: string, copilotId: string, like: boolean, category?: string | null, comment?: string | null): Promise<void>;
48
- LoadLikes(): Promise<void>;
47
+ setLikeAsync(messageId: string, copilotId: string, like: boolean, category?: string | null, comment?: string | null): Promise<void>;
48
+ LoadLikesAsync(): Promise<void>;
49
49
  }
50
50
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;CAC/B;AAED,qBAAa,IAAI;IACf,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IACpC,QAAQ,CAAC,iBAAiB,4BAAmC;IAC7D,QAAQ,CAAC,mBAAmB,uBAAqC;IACjE,QAAQ,CAAC,gBAAgB,eAAgC;IACzD,QAAQ,CAAC,gCAAgC,EAAE;QACzC,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,+BAA+B,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,wBAAwB,CAAC;KACxG,CAAM;IACP,QAAQ,CAAC,uCAAuC,EAAE;QAChD,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,+BAA+B,EAAE,YAAY,EAAE,YAAY,KAAK,wBAAwB,CAAC;KACpH,CAAM;IACP,QAAQ,CAAC,sCAAsC,EAAE;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAAA;KAAE,CAAM;IAC1G,QAAQ,CAAC,eAAe,EAAE,SAAS,EAAE,CAAM;IAE3C,OAAO,EAAE,GAAG,CAAC;IAEb,OAAO,CAAC,6BAA6B,CAA8C;IAEnF,0BAA0B,IAAI,OAAO,CAAC,GAAG,CAAC;IAIpC,mBAAmB;IASzB,yGAAyG;IACnG,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAKrC,2HAA2H;IAC3H,OAAO,CAAC,WAAW,CAAa;IAEhC,IAAI,SAAS,YAEZ;gBAEW,OAAO,EAAE,aAAa;IAoB1B,mBAAmB;IAsCrB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IA2BnD,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAsD3E,IAAI;IAIE,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAM,GAAG,IAAW,EAAE,OAAO,GAAE,MAAM,GAAG,IAAW;IAc1H,SAAS;CAehB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Chat/index.tsx"],"names":[],"mappings":"AASA,OAAO,cAAc,CAAC;AACtB,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAG/C,OAAO,EAAE,+BAA+B,EAAE,MAAM,uCAAuC,CAAC;AACxF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAErD,MAAM,WAAW,aAAa;IAC1B,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,CAAC,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;CAC/B;AAED,qBAAa,IAAI;IACf,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,KAAK,EAAE,OAAO,MAAM,CAAC,KAAK,CAAC;IACpC,QAAQ,CAAC,iBAAiB,4BAAmC;IAC7D,QAAQ,CAAC,mBAAmB,uBAAqC;IACjE,QAAQ,CAAC,gBAAgB,eAAgC;IACzD,QAAQ,CAAC,gCAAgC,EAAE;QACzC,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,+BAA+B,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,wBAAwB,CAAC;KACxG,CAAM;IACP,QAAQ,CAAC,uCAAuC,EAAE;QAChD,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,+BAA+B,EAAE,YAAY,EAAE,YAAY,KAAK,wBAAwB,CAAC;KACpH,CAAM;IACP,QAAQ,CAAC,sCAAsC,EAAE;QAAE,CAAC,WAAW,EAAE,MAAM,GAAG,wBAAwB,CAAA;KAAE,CAAM;IAC1G,QAAQ,CAAC,eAAe,EAAE,SAAS,EAAE,CAAM;IAE3C,OAAO,EAAE,GAAG,CAAC;IAEb,OAAO,CAAC,6BAA6B,CAA8C;IAEnF,0BAA0B,IAAI,OAAO,CAAC,GAAG,CAAC;IAIpC,mBAAmB;IASzB,yGAAyG;IACnG,kBAAkB,CAAC,IAAI,EAAE,MAAM;IAKrC,2HAA2H;IAC3H,OAAO,CAAC,WAAW,CAAa;IAEhC,IAAI,SAAS,YAEZ;gBAEW,OAAO,EAAE,aAAa;IAoB1B,mBAAmB;IAsCrB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IA2BnD,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;IAsD3E,IAAI;IAIE,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,GAAE,MAAM,GAAG,IAAW,EAAE,OAAO,GAAE,MAAM,GAAG,IAAW;IAc/H,cAAc;CAerB"}
@@ -5643,7 +5643,7 @@ class mr {
5643
5643
  this.removePulseNodeIfItIsThere(), this._toolCallBuilder.clear(), this._clientFunctionInvocationsByLlmFunctionId = {}, this._subConversations = {};
5644
5644
  const n = this.conversation.chat.feedbackByMessageId.get(this.messageId);
5645
5645
  n != null ? this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1" }, /* @__PURE__ */ b(n ? kt : zt, null))) : this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1", onclick: () => {
5646
- this.conversation.chat.setLike(this.messageId, this.copilitId, !0), this._feedbackNode.replaceWith(
5646
+ this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !0), this._feedbackNode.replaceWith(
5647
5647
  this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1" }, /* @__PURE__ */ b(kt, null)))
5648
5648
  );
5649
5649
  } }, /* @__PURE__ */ b(kt, null)), /* @__PURE__ */ b("a", { class: "btn btn-link p-1", onclick: () => {
@@ -5656,7 +5656,7 @@ class mr {
5656
5656
  });
5657
5657
  let s = "";
5658
5658
  const i = t.querySelector(".feedback-comment-text").value;
5659
- i !== "" && (s = i), this.conversation.chat.setLike(this.messageId, this.copilitId, !1, r, s), t.remove(), this._feedbackNode.replaceWith(
5659
+ i !== "" && (s = i), this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !1, r, s), t.remove(), this._feedbackNode.replaceWith(
5660
5660
  this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link p-1" }, /* @__PURE__ */ b(zt, null)))
5661
5661
  );
5662
5662
  } }, "Submit"))));
@@ -6013,7 +6013,7 @@ class eo {
6013
6013
  }
6014
6014
  async LoadHistoryMessages() {
6015
6015
  let n = new ft();
6016
- await this.LoadLikes();
6016
+ await this.LoadLikesAsync();
6017
6017
  try {
6018
6018
  await n.initializeExistingAsync(this.fetch, this.historyUrl);
6019
6019
  } catch (t) {
@@ -6111,7 +6111,7 @@ class eo {
6111
6111
  var n;
6112
6112
  (n = this._completion) == null || n.stop();
6113
6113
  }
6114
- async setLike(n, t, r, s = null, i = null) {
6114
+ async setLikeAsync(n, t, r, s = null, i = null) {
6115
6115
  const a = await this.fetch(this.feedbackUrl, {
6116
6116
  method: "POST",
6117
6117
  headers: {
@@ -6123,7 +6123,7 @@ class eo {
6123
6123
  throw new Error(`Failed to send feedback: ${a.status} ${a.statusText}`);
6124
6124
  this.feedbackByMessageId.set(n, r);
6125
6125
  }
6126
- async LoadLikes() {
6126
+ async LoadLikesAsync() {
6127
6127
  const n = await this.fetch(`${this.feedbackUrl}`, {
6128
6128
  method: "GET",
6129
6129
  headers: {
@@ -267,9 +267,9 @@ l0,-`+(r+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
267
267
  `);break;case"t":e.push(" ");break;case"r":e.push("\r");break;case"\\":e.push("\\");break;case"'":e.push("'");break;case'"':e.push('"');break;case"b":e.push("\b");break;case"f":e.push("\f");break;case"v":e.push("\v");break;case"a":e.push("a");break;case"0":e.push("\0");break;case"u":r+5<t.length&&(e.push(String.fromCharCode(parseInt(t.substring(r+2,r+6),16))),r+=4);break;case"U":r+9<t.length&&(e.push(String.fromCodePoint(parseInt(t.substring(r+2,r+10),16))),r+=8);break;default:e.push(t[r+1]);break}r+=2}else e.push(t[r]),r++;return e.join("")}function ad(t){const e=[...sd(t)];if(e.length){const n=e[e.length-1];n===","?e.pop():n===":"&&e.push("undefined")}const r=[];for(const n of e)if(n==="{"||n==="[")r.push(n);else if(n==="}")if(r.length&&r[r.length-1]==="{")r.pop();else throw new Error("Invalid JSON");else if(n==="]")if(r.length&&r[r.length-1]==="[")r.pop();else throw new Error("Invalid JSON");for(;r.length;)r.pop()==="{"?e.push("}"):e.push("]");return JSON.parse(e.join(""))}function*sd(t){for(let e=0;e<t.length;++e){let r=t[e];switch(r){case" ":case" ":case`
268
268
  `:case"\r":break;case",":case":":case"{":case"}":case"[":case"]":yield r;break;case'"':let n=e++;for(;;++e)if(e<t.length){if(r=t[e],r==='"'){yield t.substring(n,e+1);break}if(r==="\\")if(e+1<t.length)if(t[e+1]==="u")if(e+5<t.length)e+=5;else{yield t.substring(n,e)+'"';return}else++e;else{yield t.substring(n,e)+'"';return}}else{yield t.substring(n,e)+'"';return}break;default:yield r;break}}}function Ao({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 256 512"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M119.5 326.9L3.5 209.1c-4.7-4.7-4.7-12.3 0-17l7.1-7.1c4.7-4.7 12.3-4.7 17 0L128 287.3l100.4-102.2c4.7-4.7 12.3-4.7 17 0l7.1 7.1c4.7 4.7 4.7 12.3 0 17L136.5 327c-4.7 4.6-12.3 4.6-17-.1z"),r.appendChild(n),r.classList.add("icon"),r}function ka({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 320 512"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M193.94 256L296.5 153.44l21.15-21.15c3.12-3.12 3.12-8.19 0-11.31l-22.63-22.63c-3.12-3.12-8.19-3.12-11.31 0L160 222.06 36.29 98.34c-3.12-3.12-8.19-3.12-11.31 0L2.34 120.97c-3.12 3.12-3.12 8.19 0 11.31L126.06 256 2.34 379.71c-3.12 3.12-3.12 8.19 0 11.31l22.63 22.63c3.12 3.12 8.19 3.12 11.31 0L160 289.94 262.56 392.5l21.15 21.15c3.12 3.12 8.19 3.12 11.31 0l22.63-22.63c3.12-3.12 3.12-8.19 0-11.31L193.94 256z"),r.appendChild(n),r.classList.add("icon"),r}class Mo{constructor(e,r){P(this,"node");P(this,"_buttonNode");P(this,"_buttonIconWrapperNode");P(this,"_expanded",!1);P(this,"_expandedCt");P(this,"_contentWrapperNode");P(this,"_contentNode");P(this,"_highlightCode");P(this,"_stdoutStderrNode");P(this,"_stdoutNode");P(this,"_stderrNode");P(this,"_resultNode");P(this,"_resultRawNode");P(this,"_errorNode");P(this,"_ignoreSetResult");this.context=e,this.context.conversationMessage.chat.lazyInitializePyodideAsync(),this._highlightCode=new H0("python",r instanceof To?Co(r.functionArguments):r),this._highlightCode.node.classList.add("p-3","bg-Sandstone-97","text-Black","overflow-x-auto"),this.node=_("div",{class:"my-2"},this._buttonNode=_(tn,{class:"p-2 gap-2 group",variant:Ft.Badge,size:$r.Medium,onclick:()=>this.expanded=!this.expanded},this._buttonIconWrapperNode=_("div",{width:"24px",height:"24px"},_(Jn,{size:dn.Small})),"Generate and run Python code",_(Ao,{class:"transition-all duration-300 group-data-[expanded=true]:-rotate-180"})),this._contentWrapperNode=_("div",{class:"grid",gridTemplateRows:this._expanded?"1fr":"0fr",opacity:this._expanded?"1":"0","aria-expanded":this._expanded},_("div",{class:"overflow-hidden"},this._contentNode=_("section",{class:"mt-2 border border-Light flex flex-col text-sm"},this._highlightCode.node))))}get expanded(){return this._expanded}set expanded(e){var r;if(e!==this._expanded){(r=this._expandedCt)==null||r.cancel();const n=this._expandedCt=new Kt;this._buttonNode.setAttribute("data-expanded",String(this._expanded=e)),e?(async()=>{try{await cr(this._contentWrapperNode,[{gridTemplateRows:"1fr"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt),await cr(this._contentWrapperNode,[{opacity:"1"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt)}catch(i){if(!n.isCancellationRequested)throw i}})():(async()=>{try{await cr(this._contentWrapperNode,[{opacity:"0"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt),await cr(this._contentWrapperNode,[{gridTemplateRows:"0fr"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt)}catch(i){if(!n.isCancellationRequested)throw i}})()}}setButtonSuccess(){this._buttonNode.setAttribute("data-status","success"),this._buttonIconWrapperNode.replaceChild(_(Yn,null),this._buttonIconWrapperNode.firstChild)}setButtonError(){this._buttonNode.setAttribute("data-status","error"),this._buttonIconWrapperNode.replaceChild(_(ka,null),this._buttonIconWrapperNode.firstChild)}getOrAddStdoutStderrNode(){return this._stdoutStderrNode?this._stdoutStderrNode:(this._stdoutStderrNode=_("section",{class:"border-t border-t-Light p-3 bg-Black text-White text-sm"},_("h1",{class:"mb-2"},"STDOUT / STDERR")),this._contentNode.insertBefore(this._stdoutStderrNode,this._highlightCode.node.nextSibling),this._stdoutStderrNode)}getOrAddStdoutNode(){return this._stdoutNode?this._stdoutNode:(this._stderrNode=null,this._stdoutNode=_("pre",null),this.getOrAddStdoutStderrNode().appendChild(this._stdoutNode),this._stdoutNode)}getOrAddStderrNode(){return this._stderrNode?this._stderrNode:(this._stdoutNode=null,this._stderrNode=_("pre",{class:"text-Energy-Red-45"}),this.getOrAddStdoutStderrNode().appendChild(this._stderrNode),this._stderrNode)}getOrAddErrorNode(){return this._errorNode?this._errorNode:(this._errorNode=_("pre",{class:"border-t border-t-Light border-l-4 border-Energy-Red-45 p-3 text-sm"}),this._contentNode.appendChild(this._errorNode),this._errorNode)}getOrAddResultRawNode(){return this._resultRawNode?this._resultRawNode:(this._resultNode=_("section",{class:"border-t border-t-Light p-3 bg-Black text-White text-sm"},_("h1",{class:"mb-2"},"RESULT"),this._resultRawNode=_("pre",null)),this._contentNode.appendChild(this._resultNode),this._resultRawNode)}onClientResult(e){if(!this._ignoreSetResult){if(e.stdoutAndStderr)for(const r of e.stdoutAndStderr)r.isStderr?this.getOrAddStderrNode().textContent+=r.text:this.getOrAddStdoutNode().textContent+=r.text;e.terminatedWithError?(this.setButtonError(),e.error&&(this.getOrAddErrorNode().textContent=e.error)):e.result&&(this.setButtonSuccess(),this.getOrAddResultRawNode().textContent=e.result)}}onOpcodeMessageToolCallErrorReceived(e){this.setButtonError()}onErrorWhileReadingBodyStream(e){this.setButtonError()}async run(e){this._ignoreSetResult=!0;const r=this.context.conversationMessage.chat,n=[];try{await r.lazyInitializePyodideAsync(),r.pyodide.setStdout({batched:s=>{const o=s.split(`
269
269
  `);if(n.length){const u=n[n.length-1];u.isStderr?n.push(...o.map(h=>({isStderr:!1,text:h}))):(u.text+=o.shift(),n.push(...o.map(h=>({isStderr:!1,text:h}))))}else n.push(...o.map(u=>({isStderr:!1,text:u})));this.getOrAddStdoutNode().textContent+=s}}),r.pyodide.setStderr({batched:s=>{const o=s.split(`
270
- `);if(n.length){const u=n[n.length-1];u.isStderr?(u.text+=o.shift(),n.push(...o.map(h=>({isStderr:!0,text:h})))):n.push(...o.map(h=>({isStderr:!0,text:h})))}else n.push(...o.map(u=>({isStderr:!0,text:u})));this.getOrAddStderrNode().textContent+=s}});const a=await r.runPythonCodeAsync(e);var i=a===void 0?"None":String(a)}catch(a){this.setButtonError();const s=String(a);this.getOrAddErrorNode().textContent=s,console.error(a),await this.context.postResultAsync({terminatedWithError:!0,error:s,stdoutAndStderr:n});return}this.setButtonSuccess(),i&&(this.getOrAddResultRawNode().textContent=i),await this.context.postResultAsync({result:i,stdoutAndStderr:n})}updateWithToolCallData(e){this._highlightCode.updateCode("python",Co(e.functionArguments))}}function Co(t){if(!t.startsWith("{"))return t;var e=t.indexOf("Code:");if(e!=-1&&t.substring(0,e).trim()=="{"&&(t='{"Code":'+t.substring(e+5)),e=t.indexOf('"""'),e!=-1){var r=t.lastIndexOf('"""');if(e<r&&t.substring(r+3).trim()=="}"){var n=id(t.substring(e+3,r-(e+3))),i=t.substring(0,e)+JSON.stringify(n)+t.substring(r+3);t=i}}try{var a=ad(t)}catch{return console.warn("Error parsing Python code arguments provided as JSON.",t),""}return(a==null?void 0:a.Code)||(a==null?void 0:a.code)||""}class od{constructor(e,r){P(this,"node");P(this,"_buttonNode");P(this,"_buttonIconWrapperNode");this.context=e,this.node=_("div",{class:"my-2"},this._buttonNode=_(tn,{as:"div",class:"p-2 pr-3 gap-2 select-none",variant:Ft.Badge,size:$r.Medium},this._buttonIconWrapperNode=_("div",{width:"24px",height:"24px"},_(Jn,{size:dn.Small})),`Search for '${r}'`))}setButtonSuccess(){this._buttonNode.setAttribute("data-status","success"),this._buttonIconWrapperNode.replaceChild(_(Yn,null),this._buttonIconWrapperNode.firstChild)}setButtonError(){this._buttonNode.setAttribute("data-status","error"),this._buttonIconWrapperNode.replaceChild(_(ka,null),this._buttonIconWrapperNode.firstChild)}onOpcodeMessageToolCallResultReceived(e){this.setButtonSuccess()}onOpcodeMessageToolCallErrorReceived(e){this.setButtonError()}onErrorWhileReadingBodyStream(e){this.setButtonError()}run(e){}}class ld extends Qn{constructor(r,n){super();P(this,"node");this.context=r;let i;switch(n.type){case Rt.Error:i=_(wa,{class:"text-Energy-Red-45"});break;case Rt.Danger:i=_(Zn,{class:"text-Energy-Red-45"});break;case Rt.Warning:i=_(Zn,{class:"text-Terracotta-30"});break;case Rt.Info:i=_(xa,{class:"text-Sea-Blue-Main-28"});break;case Rt.Success:i=_(Eo,{class:"text-Land-Green-30"});break}i.classList.add("shrink-0");let a;this.node=_("section",{class:"max-w-lg text-left my-2 bg-Sandstone-97 select-none border border-Light"},_("div",{class:"p-6 pb-3 flex gap-5"},i,_("div",null,_("h6",null,n.title),a=_("div",{class:"prose prose-sm prose-neutral"}))),_("fieldset",{class:"p-6 pt-3 flex justify-end gap-3"},_(tn,{as:"a",variant:Ft.Tertiary,class:"min-w-24",size:$r.Medium,target:"_blank",href:n.url},"Open in new tab"))),ba(a,n.textInMarkdown,this.context.conversationMessage.chat.pyodide,this.context.conversationMessage.chat.mdastExtensions),n.openRightAway&&window.open(n.url,n.target,n.windowFeatures)}onOpcodeMessageToolCallErrorReceived(r){}onErrorWhileReadingBodyStream(r){}}function Sa({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M10.9153 1.83987L11.2942 1.88772L11.4749 1.91507C13.2633 2.24201 14.4107 4.01717 13.9749 5.78225L13.9261 5.95901L13.3987 7.6719C13.7708 7.67575 14.0961 7.68389 14.3792 7.70608C14.8737 7.74486 15.3109 7.82759 15.7015 8.03323L15.8528 8.11819C16.5966 8.56353 17.1278 9.29625 17.3167 10.1475L17.347 10.3096C17.403 10.69 17.3647 11.0832 17.2835 11.5098C17.2375 11.7517 17.1735 12.0212 17.096 12.3233L16.8255 13.3321L16.4456 14.7276C16.2076 15.6001 16.0438 16.2356 15.7366 16.7305L15.595 16.9346C15.2989 17.318 14.9197 17.628 14.4866 17.8408L14.2982 17.9258C13.6885 18.1774 12.9785 18.1651 11.9446 18.1651H7.33331C6.64422 18.1651 6.08726 18.1657 5.63702 18.1289C5.23638 18.0962 4.87565 18.031 4.53936 17.8867L4.39679 17.8203C3.87576 17.5549 3.43916 17.151 3.13507 16.6553L3.013 16.4366C2.82119 16.0599 2.74182 15.6541 2.7044 15.1963C2.66762 14.7461 2.66827 14.1891 2.66827 13.5V11.667C2.66827 10.9349 2.66214 10.4375 2.77569 10.0137L2.83722 9.81253C3.17599 8.81768 3.99001 8.05084 5.01397 7.77639L5.17706 7.73928C5.56592 7.66435 6.02595 7.66799 6.66632 7.66799C6.9429 7.66799 7.19894 7.52038 7.33624 7.2803L10.2562 2.16995L10.3118 2.08792C10.4544 1.90739 10.6824 1.81092 10.9153 1.83987ZM7.33136 14.167C7.33136 14.9841 7.33714 15.2627 7.39386 15.4746L7.42999 15.5918C7.62644 16.1686 8.09802 16.6134 8.69171 16.7725L8.87042 16.8067C9.07652 16.8323 9.38687 16.835 10.0003 16.835H11.9446C13.099 16.835 13.4838 16.8228 13.7903 16.6963L13.8997 16.6465C14.1508 16.5231 14.3716 16.3444 14.5433 16.1221L14.6155 16.0166C14.7769 15.7552 14.8968 15.3517 15.1624 14.378L15.5433 12.9824L15.8079 11.9922C15.8804 11.7102 15.9368 11.4711 15.9769 11.2608C16.0364 10.948 16.0517 10.7375 16.0394 10.5791L16.0179 10.4356C15.9156 9.97497 15.641 9.57381 15.2542 9.31253L15.0814 9.20999C14.9253 9.12785 14.6982 9.06544 14.2747 9.03225C13.8477 8.99881 13.2923 8.99807 12.5003 8.99807C12.2893 8.99807 12.0905 8.89822 11.9651 8.72854C11.8398 8.55879 11.8025 8.33942 11.8646 8.13772L12.6556 5.56741L12.7054 5.36331C12.8941 4.35953 12.216 3.37956 11.1878 3.2178L8.49054 7.93948C8.23033 8.39484 7.81431 8.72848 7.33136 8.88967V14.167ZM3.99835 13.5C3.99835 14.2111 3.99924 14.7044 4.03058 15.0879C4.06128 15.4636 4.11804 15.675 4.19854 15.833L4.26886 15.959C4.44517 16.2466 4.69805 16.4808 5.0003 16.6348L5.13019 16.6905C5.27397 16.7419 5.46337 16.7797 5.74542 16.8028C5.97772 16.8217 6.25037 16.828 6.58722 16.8311C6.41249 16.585 6.27075 16.3136 6.1712 16.0215L6.10968 15.8194C5.99614 15.3956 6.00128 14.899 6.00128 14.167V9.00296C5.79386 9.0067 5.65011 9.01339 5.53741 9.02737L5.3587 9.06057C4.76502 9.21965 4.29247 9.66448 4.09601 10.2412L4.06085 10.3584C4.00404 10.5705 3.99835 10.8493 3.99835 11.667V13.5Z"),r.appendChild(n),r.classList.add("icon"),r}function za({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M12.6687 5.83304C12.6687 5.22006 12.6649 4.91019 12.6394 4.70413L12.6062 4.52542C12.4471 3.93179 12.0022 3.45922 11.4255 3.26272L11.3083 3.22757C11.0963 3.17075 10.8175 3.16507 9.99974 3.16507H8.0554C7.04558 3.16507 6.62456 3.17475 6.32982 3.26175L6.2097 3.30374C5.95005 3.41089 5.71908 3.57635 5.53392 3.78616L5.45677 3.87796C5.30475 4.0748 5.20336 4.33135 5.03392 4.91702L4.83763 5.6221L4.45677 7.01761C4.24829 7.78204 4.10326 8.31846 4.02318 8.73929C3.94374 9.15672 3.94298 9.39229 3.98119 9.56448L4.03587 9.75784C4.18618 10.1996 4.50043 10.5702 4.91771 10.7901L5.05052 10.8477C5.20009 10.9014 5.40751 10.9429 5.72533 10.9678C6.15231 11.0012 6.70771 11.002 7.49974 11.002C7.71076 11.002 7.90952 11.1018 8.0349 11.2715C8.14465 11.4201 8.18683 11.6067 8.15404 11.7862L8.13548 11.8623L7.34447 14.4326C7.01523 15.5033 7.71404 16.6081 8.81126 16.7813L11.5095 12.0606L11.5827 11.9405C11.8445 11.5461 12.2289 11.2561 12.6687 11.1094V5.83304ZM17.3318 8.33304C17.3318 8.97366 17.3364 9.43432 17.2615 9.82327L17.2234 9.98538C16.949 11.0094 16.1821 11.8233 15.1872 12.1621L14.9861 12.2237C14.5624 12.3372 14.0656 12.3321 13.3337 12.3321C13.0915 12.3321 12.8651 12.4453 12.7204 12.6348L12.6638 12.7198L9.74388 17.8301C9.61066 18.0631 9.35005 18.1935 9.08372 18.1602L8.70579 18.1123C6.75379 17.8682 5.49542 15.9213 6.07396 14.041L6.60033 12.3272C6.22861 12.3233 5.90377 12.3161 5.62083 12.294C5.18804 12.26 4.79914 12.1931 4.44701 12.0391L4.29857 11.9668C3.52688 11.5605 2.95919 10.8555 2.72533 10.0205L2.68333 9.85257C2.58769 9.42154 2.62379 8.97768 2.71654 8.49026C2.80865 8.00634 2.97082 7.41139 3.17357 6.668L3.55443 5.27249L3.74583 4.58011C3.9286 3.94171 4.10186 3.45682 4.40404 3.06546L4.53685 2.9053C4.85609 2.54372 5.25433 2.25896 5.70189 2.07425L5.93626 1.99222C6.49455 1.82612 7.15095 1.83499 8.0554 1.83499H12.6667C13.3558 1.83499 13.9128 1.83434 14.363 1.87112C14.8208 1.90854 15.2266 1.98789 15.6033 2.17972L15.821 2.30179C16.317 2.6059 16.7215 3.04226 16.987 3.56351L17.0535 3.70608C17.1977 4.04236 17.2629 4.40311 17.2956 4.80374C17.3324 5.25398 17.3318 5.81094 17.3318 6.50003V8.33304ZM13.9978 10.9961C14.3321 10.9901 14.5013 10.977 14.6413 10.9395L14.7585 10.9033C15.3353 10.7069 15.7801 10.2353 15.9392 9.64163L15.9724 9.46292C15.998 9.25682 16.0017 8.94657 16.0017 8.33304V6.50003C16.0017 5.78899 16.0008 5.29566 15.9695 4.91214C15.9464 4.6301 15.9086 4.44069 15.8572 4.2969L15.8015 4.16702C15.6475 3.86478 15.4133 3.6119 15.1257 3.43558L14.9997 3.36526C14.8418 3.28477 14.6302 3.228 14.2546 3.19729C14.0221 3.1783 13.7491 3.17109 13.4118 3.168C13.6267 3.47028 13.7914 3.81126 13.8904 4.18069L13.9275 4.34378C13.981 4.62163 13.9947 4.93582 13.9978 5.3262V10.9961Z"),r.appendChild(n),r.classList.add("icon"),r}function ud({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 32 32"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M18.1215 16.0003L24.5315 9.59034L25.8534 8.26846C26.0484 8.07346 26.0484 7.75659 25.8534 7.56159L24.439 6.14721C24.244 5.95221 23.9271 5.95221 23.7321 6.14721L16.0002 13.8791L8.26837 6.14659C8.07337 5.95159 7.75649 5.95159 7.56149 6.14659L6.14649 7.56096C5.95149 7.75596 5.95149 8.07284 6.14649 8.26784L13.879 16.0003L6.14649 23.7322C5.95149 23.9272 5.95149 24.2441 6.14649 24.4391L7.56087 25.8535C7.75587 26.0485 8.07274 26.0485 8.26774 25.8535L16.0002 18.1216L22.4102 24.5316L23.7321 25.8535C23.9271 26.0485 24.244 26.0485 24.439 25.8535L25.8534 24.4391C26.0484 24.2441 26.0484 23.9272 25.8534 23.7322L18.1215 16.0003Z"),r.appendChild(n),r.classList.add("icon"),r}class _o{constructor(e,r,n,i,a,s,o,u){P(this,"node");P(this,"_rightColumnNode");P(this,"_feedbackNode");P(this,"_showToolCallResult",!1);P(this,"_toolCallInfoNode");P(this,"_currentMessageBlockNode");P(this,"_currentMessageBlockNodeMarkdown");P(this,"_accumulatedMarkdown","");P(this,"_toolCallBuilder",new nd);P(this,"_clientFunctionInvocationsByOperationId",{});P(this,"_clientFunctionInvocationsByLlmFunctionId",{});P(this,"_subConversations",{});P(this,"_pulseNode");P(this,"_pulseNodeAnimation");P(this,"_suggestionTextList");this.conversation=e,this.authorRole=r,this.authorId=n,this.authorPictureUrl=i,this.authorDisplayName=a,this.authorEmail=s,this.messageId=o,this.copilitId=u,this.node=_("li",{class:"p-2 flex gap-2"},_(Zh,{class:"shrink-0",id:this.authorId,title:this.authorDisplayName},this.authorPictureUrl?_("img",{src:this.authorPictureUrl,class:"w-full h-full"}):_("span",{marginTop:"-.1em"},Yh(this.authorDisplayName))),this._rightColumnNode=_("div",{class:"shrink-0 flex-1"},_("div",{class:"font-medium text-base leading-5"},this.authorDisplayName))),this.ensureCurrentMessageBlockNode(),this._suggestionTextList=[{text:"Irrelevant answer",isActive:!1},{text:"Incorrect information",isActive:!1},{text:"Incomplete answer",isActive:!1},{text:"Offensive content",isActive:!1},{text:"Other",isActive:!1}]}get chat(){return this.conversation.chat}ensureCurrentMessageBlockNode(){if(!this._currentMessageBlockNode&&(this._rightColumnNode.appendChild(this._toolCallInfoNode=_("div",{class:"prose prose-neutral prose-sm max-w-none"})),this._rightColumnNode.appendChild(this._currentMessageBlockNode=_("div",{class:"prose prose-neutral prose-sm max-w-none"})),this._currentMessageBlockNodeMarkdown="",this.authorRole==="assistant")){this._pulseNode=_("div",{class:"inline-flex relative h-3 w-3"},_("div",{class:"absolute inline-flex h-full w-full rounded-full bg-Sky-Blue-80"}),_("div",{class:"relative inline-flex rounded-full h-full w-full bg-Sky-Blue-Main-77"})),this._currentMessageBlockNode.appendChild(this._pulseNode);const e=[{transform:"scale(2.5)",opacity:0,offset:.75},{transform:"scale(2.5)",opacity:0,offset:1}],r={duration:1500,iterations:1/0,easing:"cubic-bezier(0, 0, 0.2, 1)"};this._pulseNodeAnimation=this._pulseNode.firstElementChild.animate(e,r)}}removePulseNodeIfItIsThere(){const e=this._pulseNode;e&&(this._pulseNode=null,this._pulseNodeAnimation.cancel(),e.remove())}append(e){if(this._accumulatedMarkdown+=e,this.ensureCurrentMessageBlockNode(),this._currentMessageBlockNodeMarkdown+=e,this._pulseNode){var r=this._pulseNodeAnimation.currentTime;this._pulseNodeAnimation.pause(),this._pulseNode.remove()}ba(this._currentMessageBlockNode,this._currentMessageBlockNodeMarkdown,this.chat.pyodide,this.chat.mdastExtensions),this._pulseNode&&(this._pulseNodeAnimation.currentTime=r,this._pulseNode.classList.add("ml-[1ch]"),cd(this._currentMessageBlockNode).appendChild(this._pulseNode),this._pulseNodeAnimation.play())}toolCallUpdate(e){var n;const r=this._toolCallBuilder.append(e);if(r.llmFunctionId&&r.functionName){let i=this._clientFunctionInvocationsByLlmFunctionId[r.llmFunctionId];if(i){(n=i.updateWithToolCallData)==null||n.call(i,r);return}const a=this.chat.clientFunctionInvocationHandlersPartial[r.functionName];if(a){const s=new d0(r.llmFunctionId,null,this),o=a(s,r);this._clientFunctionInvocationsByLlmFunctionId[r.llmFunctionId]=o,this.removePulseNodeIfItIsThere(),o.node&&(this._rightColumnNode.appendChild(o.node),o instanceof Qn&&o.context.conversationMessage.expandAsync(),this._currentMessageBlockNode=null,this._currentMessageBlockNodeMarkdown=null)}}}onOpcodeMessageInvokeClientFunctionReceived(e,r,n,i){var h,d;const a=JSON.parse(i);let s=this._clientFunctionInvocationsByOperationId[r];if(s){s.run(...a);return}if(s=this._clientFunctionInvocationsByLlmFunctionId[e],s&&!s.context.operationId){s.context.operationId=r,this.chat.clientFunctionInvocationsByOperationId[r]=s,this._clientFunctionInvocationsByOperationId[r]=s,(h=s.run)==null||h.call(s,...a);return}const o=new d0(e,r,this),u=this.chat.clientFunctionInvocationHandlers[n];if(u)s=u(o,...a),this.chat.clientFunctionInvocationsByOperationId[r]=s,this._clientFunctionInvocationsByOperationId[r]=s,this._clientFunctionInvocationsByLlmFunctionId[e]=s,(d=s.run)==null||d.call(s,...a),this.removePulseNodeIfItIsThere(),s.node&&(this._rightColumnNode.appendChild(s.node),s instanceof Qn&&s.context.conversationMessage.expandAsync(),this._currentMessageBlockNode=null,this._currentMessageBlockNodeMarkdown=null);else{const p=`Function '${n}' not found. This occurs if a tool / function has been invoked, that requires some sort of user interaction (e.g. to obtain confirmation or to fill out some form values), then contacts the front-end to obtain a response, but the front-end is unable to handle the request because the function to be invoked does not exist. This error was thrown in the front-end. This most likely indicates that the bot is set up incorrectly, and the user should contact support.`;o.postErrorAsync(p)}}setClientInvocationResult(e,r){var n;(n=e.onClientResult)==null||n.call(e,r)}setClientInvocationError(e,r){var n;(n=e.onClientError)==null||n.call(e,r)}onOpcodeMessageToolCallBeginReceived(e,r){this._showToolCallResult=!0,this.ensureCurrentMessageBlockNode(),this._toolCallInfoNode.appendChild(_("div",{class:"flex"},_("div",{class:"p-1"},_("label",null,r))))}onOpcodeMessageToolCallResultReceived(e,r){var a;let n;try{n=JSON.parse(r)}catch{n=r}this.ensureCurrentMessageBlockNode(),this._showToolCallResult&&this._toolCallInfoNode.appendChild(_("div",{class:"flex"},_("div",{class:"p-1"},_("pre",{class:"whitespace-pre-wrap"},JSON.stringify(n,null,2)))));let i=this._clientFunctionInvocationsByLlmFunctionId[e];i&&((a=i.onOpcodeMessageToolCallResultReceived)==null||a.call(i,r),this.onClientFunctionInvocationCompleted(i))}onOpcodeMessageToolCallErrorReceived(e,r){const n=this._clientFunctionInvocationsByLlmFunctionId[e];n&&(n.onOpcodeMessageToolCallErrorReceived(r),this.onClientFunctionInvocationCompleted(n))}onClientFunctionInvocationCompleted(e){e.context.llmFunctionId in this._clientFunctionInvocationsByLlmFunctionId&&(delete this._clientFunctionInvocationsByLlmFunctionId[e.context.llmFunctionId],!Object.keys(this._subConversations).length&&!Object.keys(this._clientFunctionInvocationsByLlmFunctionId).length&&this.ensureCurrentMessageBlockNode())}executeLlmFunctionsBegin(){this._toolCallBuilder.clear()}executeLlmFunctionsEnd(){this.ensureCurrentMessageBlockNode(),this._clientFunctionInvocationsByLlmFunctionId={},this._subConversations={}}subConversationBegin(e,r,n,i,a,s){const o=new Bo(this.chat,e,this,s);this.chat.conversationsById.set(e,o),this._subConversations[e]=o,this.removePulseNodeIfItIsThere(),this._rightColumnNode.appendChild(o.node),this._currentMessageBlockNode=null,this._currentMessageBlockNodeMarkdown=null}notifySubConversationEnded(e,r){delete this._subConversations[e.id],!r&&!Object.keys(this._subConversations).length&&!Object.keys(this._clientFunctionInvocationsByLlmFunctionId).length&&this.ensureCurrentMessageBlockNode()}onOpcodeEndReceived(){this.removePulseNodeIfItIsThere(),this._toolCallBuilder.clear(),this._clientFunctionInvocationsByLlmFunctionId={},this._subConversations={};const e=this.conversation.chat.feedbackByMessageId.get(this.messageId);e!=null?this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1"},_(e?Sa:za,null))):this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1",onclick:()=>{this.conversation.chat.setLike(this.messageId,this.copilitId,!0),this._feedbackNode.replaceWith(this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1"},_(Sa,null))))}},_(Sa,null)),_("a",{class:"btn btn-link p-1",onclick:()=>{const r=_("div",{class:"vui-dialog-overlay-rac"},_("div",{role:"dialog",class:"vui-dialog-content-rac w-[600px] gap-5"},_("button",{onclick:()=>r.remove(),class:"vui-dialog-close-button-rac"},_(ud,{size:"18"})),_("div",{class:"vui-dialog-header-rac"},_("label",{class:"text-label-md pl-7"},"Tell us more")),_("div",{class:"vui-dialog-body-rac flex flex-col gap-5"},_("div",{class:"text-label-sm pl-7"},this._suggestionTextList.map((n,i)=>_("span",{class:"feedback-suggestion-text",onclick:a=>{this._suggestionTextList.filter((u,h)=>h!==i&&u.isActive).forEach(u=>u.isActive=!1),r.querySelectorAll(".feedback-suggestion-text").forEach(u=>u.classList.toggle("feedback-suggestion-text-active",!1)),n.isActive=!n.isActive,a.currentTarget.classList.toggle("feedback-suggestion-text-active",n.isActive)}},n.text))),_("textarea",{placeholder:"Add special details (optional)",class:"feedback-comment-text"})),_("div",{class:"vui-dialog-footer-rac flex justify-end gap-2"},_("button",{class:"btn-rac btn-primary-rac btn-lg",onclick:()=>{let n="";this._suggestionTextList.map((s,o)=>{s.isActive&&(n=s.text)});let i="";const a=r.querySelector(".feedback-comment-text").value;a!==""&&(i=a),this.conversation.chat.setLike(this.messageId,this.copilitId,!1,n,i),r.remove(),this._feedbackNode.replaceWith(this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1"},_(za,null))))}},"Submit"))));document.body.appendChild(r)}},_(za,null))),this._rightColumnNode.appendChild(this._feedbackNode)}onErrorWhileReadingBodyStream(e){console.log("ConversationMessage.onErrorWhileReadingBodyStream",e),this.removePulseNodeIfItIsThere();for(const r in this._clientFunctionInvocationsByLlmFunctionId)this._clientFunctionInvocationsByLlmFunctionId[r].onErrorWhileReadingBodyStream(e);this._toolCallBuilder.clear(),this._clientFunctionInvocationsByLlmFunctionId={};for(const r in this._subConversations)this._subConversations[r].onErrorWhileReadingBodyStream(e);this._subConversations={}}toDto(){return{role:this.authorRole,content:this._accumulatedMarkdown}}expandAsync(){if(this.conversation instanceof Bo)return this.conversation.expandAsync()}static installClientFunctions(e){e.clientFunctionInvocationHandlers.python=(r,n)=>{const i=new Mo(r,n);return i.run(n),i},e.clientFunctionInvocationHandlersPartial.python=(r,n)=>new Mo(r,n),e.clientFunctionInvocationHandlers.ButtonOptionsDialog=(r,n)=>new ed(r,n),e.clientFunctionInvocationHandlers.search=(r,n)=>new od(r,n),e.clientFunctionInvocationHandlers.WindowOpenDialog=(r,n)=>new ld(r,n)}}function cd(t){for(;;)for(let e=t.lastChild;;e=e.previousSibling)if(e){if(e.nodeType===Node.TEXT_NODE)return t;if(e.nodeType===Node.ELEMENT_NODE){if(e.tagName==="TABLE")return t;t=e;break}}else return t}class No{constructor(e,r){P(this,"node");P(this,"messagesListNode");P(this,"messages",[]);P(this,"activeMessage");P(this,"_opcodeConversationEndReceived");P(this,"_opcodeConversationErrorReceived");P(this,"_onErrorWhileReadingBodyStreamCalled");this.chat=e,this.id=r,this.node=this.messagesListNode=_("ol",null)}onOpcodeMessageBeginReceived(e,r,n,i,a,s,o){const u=new _o(this,e,r,n,i,a,s,o);return this.messages.push(this.activeMessage=u),this.messagesListNode.appendChild(u.node),u}onOpcodeMessageAppendReceived(e){this.activeMessage.append(e)}onOpcodeMessageExecuteLlmFunctionsBeginReceived(){this.activeMessage.executeLlmFunctionsBegin()}onOpcodeMessageExecuteLlmFunctionsEndReceived(){this.activeMessage.executeLlmFunctionsEnd()}onOpcodeMessageToolCallUpdateReceived(e){this.activeMessage.toolCallUpdate(e)}onOpcodeMessageToolCallBeginReceived(e,r){this.activeMessage.onOpcodeMessageToolCallBeginReceived(e,r)}onOpcodeMessageToolCallResultReceived(e,r){this.activeMessage.onOpcodeMessageToolCallResultReceived(e,r)}onOpcodeMessageToolCallErrorReceived(e,r){this.activeMessage.onOpcodeMessageToolCallErrorReceived(e,r)}onOpcodeMessageInvokeClientFunctionReceived(e,r,n,i){this.activeMessage.onOpcodeMessageInvokeClientFunctionReceived(e,r,n,i)}onOpcodeMessageSubConversationBeginReceived(e,r,n,i,a,s){this.activeMessage.subConversationBegin(e,r,n,i,a,s)}handleMessage(e){switch(e.type){case Me.MessageBegin:return this.onOpcodeMessageBeginReceived(e.messageAuthorRole,e.messageAuthorId,e.messageAuthorPictureUrl,e.messageAuthorDisplayName,e.messageAuthorEmail,e.messageId,e.copilotId),!0;case Me.MessageAppend:return this.onOpcodeMessageAppendReceived(e.appendMessageMarkdown),!0;case Me.MessageToolCallUpdate:return this.onOpcodeMessageToolCallUpdateReceived(e),!0;case Me.MessageToolCallBegin:return this.onOpcodeMessageToolCallBeginReceived(e.llmFunctionId,e.toolCallBeginInfo),!0;case Me.MessageToolCallResult:return this.onOpcodeMessageToolCallResultReceived(e.llmFunctionId,e.result),!0;case Me.MessageToolCallError:return this.onOpcodeMessageToolCallErrorReceived(e.llmFunctionId,e.error),!0;case Me.MessageExecuteLlmFunctionsBegin:return this.onOpcodeMessageExecuteLlmFunctionsBeginReceived(),!0;case Me.MessageExecuteLlmFunctionsEnd:return this.onOpcodeMessageExecuteLlmFunctionsEndReceived(),!0;case Me.MessageInvokeClientFunction:return this.onOpcodeMessageInvokeClientFunctionReceived(e.llmFunctionId,e.operationId,e.clientFunctionName,e.argumentsAsJSON),!0;case Me.MessageSubConversationBegin:return this.onOpcodeMessageSubConversationBeginReceived(e.subConversationId,e.messageAuthorId,e.messageAuthorPictureUrl,e.messageAuthorDisplayName,e.messageAuthorEmail,e.subConversationTitle),!0;case Me.ConversationEnd:return this.onOpcodeConversationEndReceived(),!0;case Me.ConversationError:return this.onOpcodeConversationErrorReceived(e.error,e.stackTrace),!0}return!1}onRootConversationEndOfBodyStream(){!this._opcodeConversationEndReceived&&!this._opcodeConversationErrorReceived&&!this._onErrorWhileReadingBodyStreamCalled&&this.onRootConversationUnexpectedEndOfBodyStream(),this.activeMessage=null,this._opcodeConversationEndReceived=!1,this._opcodeConversationErrorReceived=!1,this._onErrorWhileReadingBodyStreamCalled=!1}onRootConversationUnexpectedEndOfBodyStream(){var e,r;(r=(e=this.activeMessage)==null?void 0:e.onErrorWhileReadingBodyStream)==null||r.call(e,new _l),this.displayError("Unexpected end of response","The response ended unexpectedly. Please check your connectivity. Other possible causes include server instability or a bug.")}onOpcodeConversationEndReceived(){var e;this._opcodeConversationEndReceived=!0,(e=this.activeMessage)==null||e.onOpcodeEndReceived()}onOpcodeConversationErrorReceived(e,r){this._opcodeConversationErrorReceived=!0,e&&console.debug(e,r),this.displayError("Error","An undisclosed error occurred. Please contact Veracity Support.")}onErrorBeforeReadingBodyStreamStarted(e,r){if(r){this.displayInfo("Stopped","The generation of the response was stopped.");return}if(e instanceof Oa){this.displayError("Max limit reached","You have reached the maximum input limit. Please try again later.");return}else this.displayError("Error",String(e.message))}onErrorWhileReadingBodyStream(e,r){var n;this._onErrorWhileReadingBodyStreamCalled=!0,(n=this.activeMessage)==null||n.onErrorWhileReadingBodyStream(e),r?this.displayInfo("Stopped","The generation of the response was stopped."):this.displayError("Error while reading response",String(e.message))}displayError(e,r){this.messagesListNode.appendChild(_("li",{class:"m-2 border border-Light p-6 flex gap-5 bg-Sandstone-97"},_(wa,{class:"text-Energy-Red-45"}),_("div",null,_("h6",null,e),_("div",{class:"prose prose-sm prose-neutral"},_("p",null,r)))))}displayInfo(e,r){this.messagesListNode.appendChild(_("li",{class:"m-2 border border-Light p-6 flex gap-5 bg-Sandstone-97"},_(xa,{class:"text-Sea-Blue-Main-28"}),_("div",null,_("h6",null,e),_("div",{class:"prose prose-sm prose-neutral"},_("p",null,r)))))}}class Bo extends No{constructor(r,n,i,a){super(r,n);P(this,"_buttonNode");P(this,"_buttonIconWrapperNode");P(this,"_buttonTextNode");P(this,"_contentWrapperNode");P(this,"_contentNode");P(this,"_expanded",!1);P(this,"_expandedCt");P(this,"_expandPromise");this.parentMessage=i,this.title=a,this.node=_("div",{class:"my-2"},this._buttonNode=_(tn,{class:"p-2 gap-2 group",variant:Ft.Badge,size:$r.Medium,onclick:()=>this.expanded=!this.expanded},this._buttonIconWrapperNode=_("div",{width:"24px",height:"24px"},_(Jn,{size:dn.Small})),this.title,_(Ao,{class:"transition-all duration-300 group-data-[expanded=true]:-rotate-180"})),this._contentWrapperNode=_("div",{class:"grid",gridTemplateRows:this._expanded?"1fr":"0fr",opacity:this._expanded?"1":"0","aria-expanded":this._expanded},_("div",{class:"overflow-hidden"},this._contentNode=_("section",{class:"mt-2 border border-Light flex flex-col bg-Sandstone-95 p-3"},this.messagesListNode))))}get expanded(){return this._expanded}set expanded(r){r!==this._expanded&&(r?this.doExpandAsync():this.doCollapseAsync())}async doExpandAsync(){var n;(n=this._expandedCt)==null||n.cancel();const r=this._expandedCt=new Kt;this._buttonNode.setAttribute("data-expanded",String(this._expanded=!0)),this._expandPromise=(async()=>{try{await cr(this._contentWrapperNode,[{gridTemplateRows:"1fr"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt),await cr(this._contentWrapperNode,[{opacity:"1"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt)}catch(i){if(!r.isCancellationRequested)throw i}})(),await this._expandPromise}async doCollapseAsync(){var n;(n=this._expandedCt)==null||n.cancel();const r=this._expandedCt=new Kt;this._buttonNode.setAttribute("data-expanded",String(this._expanded=!1));try{await cr(this._contentWrapperNode,[{opacity:"0"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt),await cr(this._contentWrapperNode,[{gridTemplateRows:"0fr"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt)}catch(i){if(!r.isCancellationRequested)throw i}}onErrorWhileReadingBodyStream(r){var n;(n=this.activeMessage)==null||n.onErrorWhileReadingBodyStream(r),this.setButtonError(),this.parentMessage.notifySubConversationEnded(this,!0)}onOpcodeConversationEndReceived(){var r;(r=this.activeMessage)==null||r.onOpcodeEndReceived(),this.setButtonSuccess(),this.parentMessage.notifySubConversationEnded(this,!1)}onOpcodeConversationErrorReceived(r,n){var s;r&&console.debug(r,n);const i="An undisclosed error occurred. Please contact Veracity Support.";this.displayError("Error",i);const a=new Error(i);(s=this.activeMessage)==null||s.onErrorWhileReadingBodyStream(a),this.setButtonError(),this.parentMessage.notifySubConversationEnded(this,!1)}setButtonSuccess(){this._buttonNode.setAttribute("data-status","success"),this._buttonIconWrapperNode.replaceChild(_(Yn,null),this._buttonIconWrapperNode.firstChild)}setButtonError(){this._buttonNode.setAttribute("data-status","error"),this._buttonIconWrapperNode.replaceChild(_(ka,null),this._buttonIconWrapperNode.firstChild)}async expandAsync(){await this.parentMessage.expandAsync(),this._expanded?this._expandPromise&&await this._expandPromise:await this.doExpandAsync()}}class hd{constructor(e){P(this,"node");P(this,"url");P(this,"historyUrl");P(this,"feedbackUrl");P(this,"summarizeTitleUrl");P(this,"fetch");P(this,"conversationsById",new Map);P(this,"feedbackByMessageId",new Map);P(this,"rootConversation",new No(this,null));P(this,"clientFunctionInvocationHandlers",{});P(this,"clientFunctionInvocationHandlersPartial",{});P(this,"clientFunctionInvocationsByOperationId",{});P(this,"mdastExtensions",[]);P(this,"pyodide");P(this,"_lazyInitializePyodidePromise");P(this,"_completion");this.conversationsById.set(null,this.rootConversation),this.url=e.url,this.historyUrl=e.historyUrl,this.feedbackUrl=e.feedbackUrl,this.summarizeTitleUrl=e.summarizeTitleUrl,this.fetch=e.fetch??fetch.bind(window),this.node=_("div",null);const r=document.createElement("style");r.textContent=il+`
270
+ `);if(n.length){const u=n[n.length-1];u.isStderr?(u.text+=o.shift(),n.push(...o.map(h=>({isStderr:!0,text:h})))):n.push(...o.map(h=>({isStderr:!0,text:h})))}else n.push(...o.map(u=>({isStderr:!0,text:u})));this.getOrAddStderrNode().textContent+=s}});const a=await r.runPythonCodeAsync(e);var i=a===void 0?"None":String(a)}catch(a){this.setButtonError();const s=String(a);this.getOrAddErrorNode().textContent=s,console.error(a),await this.context.postResultAsync({terminatedWithError:!0,error:s,stdoutAndStderr:n});return}this.setButtonSuccess(),i&&(this.getOrAddResultRawNode().textContent=i),await this.context.postResultAsync({result:i,stdoutAndStderr:n})}updateWithToolCallData(e){this._highlightCode.updateCode("python",Co(e.functionArguments))}}function Co(t){if(!t.startsWith("{"))return t;var e=t.indexOf("Code:");if(e!=-1&&t.substring(0,e).trim()=="{"&&(t='{"Code":'+t.substring(e+5)),e=t.indexOf('"""'),e!=-1){var r=t.lastIndexOf('"""');if(e<r&&t.substring(r+3).trim()=="}"){var n=id(t.substring(e+3,r-(e+3))),i=t.substring(0,e)+JSON.stringify(n)+t.substring(r+3);t=i}}try{var a=ad(t)}catch{return console.warn("Error parsing Python code arguments provided as JSON.",t),""}return(a==null?void 0:a.Code)||(a==null?void 0:a.code)||""}class od{constructor(e,r){P(this,"node");P(this,"_buttonNode");P(this,"_buttonIconWrapperNode");this.context=e,this.node=_("div",{class:"my-2"},this._buttonNode=_(tn,{as:"div",class:"p-2 pr-3 gap-2 select-none",variant:Ft.Badge,size:$r.Medium},this._buttonIconWrapperNode=_("div",{width:"24px",height:"24px"},_(Jn,{size:dn.Small})),`Search for '${r}'`))}setButtonSuccess(){this._buttonNode.setAttribute("data-status","success"),this._buttonIconWrapperNode.replaceChild(_(Yn,null),this._buttonIconWrapperNode.firstChild)}setButtonError(){this._buttonNode.setAttribute("data-status","error"),this._buttonIconWrapperNode.replaceChild(_(ka,null),this._buttonIconWrapperNode.firstChild)}onOpcodeMessageToolCallResultReceived(e){this.setButtonSuccess()}onOpcodeMessageToolCallErrorReceived(e){this.setButtonError()}onErrorWhileReadingBodyStream(e){this.setButtonError()}run(e){}}class ld extends Qn{constructor(r,n){super();P(this,"node");this.context=r;let i;switch(n.type){case Rt.Error:i=_(wa,{class:"text-Energy-Red-45"});break;case Rt.Danger:i=_(Zn,{class:"text-Energy-Red-45"});break;case Rt.Warning:i=_(Zn,{class:"text-Terracotta-30"});break;case Rt.Info:i=_(xa,{class:"text-Sea-Blue-Main-28"});break;case Rt.Success:i=_(Eo,{class:"text-Land-Green-30"});break}i.classList.add("shrink-0");let a;this.node=_("section",{class:"max-w-lg text-left my-2 bg-Sandstone-97 select-none border border-Light"},_("div",{class:"p-6 pb-3 flex gap-5"},i,_("div",null,_("h6",null,n.title),a=_("div",{class:"prose prose-sm prose-neutral"}))),_("fieldset",{class:"p-6 pt-3 flex justify-end gap-3"},_(tn,{as:"a",variant:Ft.Tertiary,class:"min-w-24",size:$r.Medium,target:"_blank",href:n.url},"Open in new tab"))),ba(a,n.textInMarkdown,this.context.conversationMessage.chat.pyodide,this.context.conversationMessage.chat.mdastExtensions),n.openRightAway&&window.open(n.url,n.target,n.windowFeatures)}onOpcodeMessageToolCallErrorReceived(r){}onErrorWhileReadingBodyStream(r){}}function Sa({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M10.9153 1.83987L11.2942 1.88772L11.4749 1.91507C13.2633 2.24201 14.4107 4.01717 13.9749 5.78225L13.9261 5.95901L13.3987 7.6719C13.7708 7.67575 14.0961 7.68389 14.3792 7.70608C14.8737 7.74486 15.3109 7.82759 15.7015 8.03323L15.8528 8.11819C16.5966 8.56353 17.1278 9.29625 17.3167 10.1475L17.347 10.3096C17.403 10.69 17.3647 11.0832 17.2835 11.5098C17.2375 11.7517 17.1735 12.0212 17.096 12.3233L16.8255 13.3321L16.4456 14.7276C16.2076 15.6001 16.0438 16.2356 15.7366 16.7305L15.595 16.9346C15.2989 17.318 14.9197 17.628 14.4866 17.8408L14.2982 17.9258C13.6885 18.1774 12.9785 18.1651 11.9446 18.1651H7.33331C6.64422 18.1651 6.08726 18.1657 5.63702 18.1289C5.23638 18.0962 4.87565 18.031 4.53936 17.8867L4.39679 17.8203C3.87576 17.5549 3.43916 17.151 3.13507 16.6553L3.013 16.4366C2.82119 16.0599 2.74182 15.6541 2.7044 15.1963C2.66762 14.7461 2.66827 14.1891 2.66827 13.5V11.667C2.66827 10.9349 2.66214 10.4375 2.77569 10.0137L2.83722 9.81253C3.17599 8.81768 3.99001 8.05084 5.01397 7.77639L5.17706 7.73928C5.56592 7.66435 6.02595 7.66799 6.66632 7.66799C6.9429 7.66799 7.19894 7.52038 7.33624 7.2803L10.2562 2.16995L10.3118 2.08792C10.4544 1.90739 10.6824 1.81092 10.9153 1.83987ZM7.33136 14.167C7.33136 14.9841 7.33714 15.2627 7.39386 15.4746L7.42999 15.5918C7.62644 16.1686 8.09802 16.6134 8.69171 16.7725L8.87042 16.8067C9.07652 16.8323 9.38687 16.835 10.0003 16.835H11.9446C13.099 16.835 13.4838 16.8228 13.7903 16.6963L13.8997 16.6465C14.1508 16.5231 14.3716 16.3444 14.5433 16.1221L14.6155 16.0166C14.7769 15.7552 14.8968 15.3517 15.1624 14.378L15.5433 12.9824L15.8079 11.9922C15.8804 11.7102 15.9368 11.4711 15.9769 11.2608C16.0364 10.948 16.0517 10.7375 16.0394 10.5791L16.0179 10.4356C15.9156 9.97497 15.641 9.57381 15.2542 9.31253L15.0814 9.20999C14.9253 9.12785 14.6982 9.06544 14.2747 9.03225C13.8477 8.99881 13.2923 8.99807 12.5003 8.99807C12.2893 8.99807 12.0905 8.89822 11.9651 8.72854C11.8398 8.55879 11.8025 8.33942 11.8646 8.13772L12.6556 5.56741L12.7054 5.36331C12.8941 4.35953 12.216 3.37956 11.1878 3.2178L8.49054 7.93948C8.23033 8.39484 7.81431 8.72848 7.33136 8.88967V14.167ZM3.99835 13.5C3.99835 14.2111 3.99924 14.7044 4.03058 15.0879C4.06128 15.4636 4.11804 15.675 4.19854 15.833L4.26886 15.959C4.44517 16.2466 4.69805 16.4808 5.0003 16.6348L5.13019 16.6905C5.27397 16.7419 5.46337 16.7797 5.74542 16.8028C5.97772 16.8217 6.25037 16.828 6.58722 16.8311C6.41249 16.585 6.27075 16.3136 6.1712 16.0215L6.10968 15.8194C5.99614 15.3956 6.00128 14.899 6.00128 14.167V9.00296C5.79386 9.0067 5.65011 9.01339 5.53741 9.02737L5.3587 9.06057C4.76502 9.21965 4.29247 9.66448 4.09601 10.2412L4.06085 10.3584C4.00404 10.5705 3.99835 10.8493 3.99835 11.667V13.5Z"),r.appendChild(n),r.classList.add("icon"),r}function za({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 20 20"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M12.6687 5.83304C12.6687 5.22006 12.6649 4.91019 12.6394 4.70413L12.6062 4.52542C12.4471 3.93179 12.0022 3.45922 11.4255 3.26272L11.3083 3.22757C11.0963 3.17075 10.8175 3.16507 9.99974 3.16507H8.0554C7.04558 3.16507 6.62456 3.17475 6.32982 3.26175L6.2097 3.30374C5.95005 3.41089 5.71908 3.57635 5.53392 3.78616L5.45677 3.87796C5.30475 4.0748 5.20336 4.33135 5.03392 4.91702L4.83763 5.6221L4.45677 7.01761C4.24829 7.78204 4.10326 8.31846 4.02318 8.73929C3.94374 9.15672 3.94298 9.39229 3.98119 9.56448L4.03587 9.75784C4.18618 10.1996 4.50043 10.5702 4.91771 10.7901L5.05052 10.8477C5.20009 10.9014 5.40751 10.9429 5.72533 10.9678C6.15231 11.0012 6.70771 11.002 7.49974 11.002C7.71076 11.002 7.90952 11.1018 8.0349 11.2715C8.14465 11.4201 8.18683 11.6067 8.15404 11.7862L8.13548 11.8623L7.34447 14.4326C7.01523 15.5033 7.71404 16.6081 8.81126 16.7813L11.5095 12.0606L11.5827 11.9405C11.8445 11.5461 12.2289 11.2561 12.6687 11.1094V5.83304ZM17.3318 8.33304C17.3318 8.97366 17.3364 9.43432 17.2615 9.82327L17.2234 9.98538C16.949 11.0094 16.1821 11.8233 15.1872 12.1621L14.9861 12.2237C14.5624 12.3372 14.0656 12.3321 13.3337 12.3321C13.0915 12.3321 12.8651 12.4453 12.7204 12.6348L12.6638 12.7198L9.74388 17.8301C9.61066 18.0631 9.35005 18.1935 9.08372 18.1602L8.70579 18.1123C6.75379 17.8682 5.49542 15.9213 6.07396 14.041L6.60033 12.3272C6.22861 12.3233 5.90377 12.3161 5.62083 12.294C5.18804 12.26 4.79914 12.1931 4.44701 12.0391L4.29857 11.9668C3.52688 11.5605 2.95919 10.8555 2.72533 10.0205L2.68333 9.85257C2.58769 9.42154 2.62379 8.97768 2.71654 8.49026C2.80865 8.00634 2.97082 7.41139 3.17357 6.668L3.55443 5.27249L3.74583 4.58011C3.9286 3.94171 4.10186 3.45682 4.40404 3.06546L4.53685 2.9053C4.85609 2.54372 5.25433 2.25896 5.70189 2.07425L5.93626 1.99222C6.49455 1.82612 7.15095 1.83499 8.0554 1.83499H12.6667C13.3558 1.83499 13.9128 1.83434 14.363 1.87112C14.8208 1.90854 15.2266 1.98789 15.6033 2.17972L15.821 2.30179C16.317 2.6059 16.7215 3.04226 16.987 3.56351L17.0535 3.70608C17.1977 4.04236 17.2629 4.40311 17.2956 4.80374C17.3324 5.25398 17.3318 5.81094 17.3318 6.50003V8.33304ZM13.9978 10.9961C14.3321 10.9901 14.5013 10.977 14.6413 10.9395L14.7585 10.9033C15.3353 10.7069 15.7801 10.2353 15.9392 9.64163L15.9724 9.46292C15.998 9.25682 16.0017 8.94657 16.0017 8.33304V6.50003C16.0017 5.78899 16.0008 5.29566 15.9695 4.91214C15.9464 4.6301 15.9086 4.44069 15.8572 4.2969L15.8015 4.16702C15.6475 3.86478 15.4133 3.6119 15.1257 3.43558L14.9997 3.36526C14.8418 3.28477 14.6302 3.228 14.2546 3.19729C14.0221 3.1783 13.7491 3.17109 13.4118 3.168C13.6267 3.47028 13.7914 3.81126 13.8904 4.18069L13.9275 4.34378C13.981 4.62163 13.9947 4.93582 13.9978 5.3262V10.9961Z"),r.appendChild(n),r.classList.add("icon"),r}function ud({size:t=Ct.Medium,...e}){const r=qe("svg");r.setAttribute("viewBox","0 0 32 32"),r.setAttribute("fill","currentColor"),r.setAttribute("width",t),r.setAttribute("height",t),Je(r,e);const n=qe("path");return n.setAttribute("d","M18.1215 16.0003L24.5315 9.59034L25.8534 8.26846C26.0484 8.07346 26.0484 7.75659 25.8534 7.56159L24.439 6.14721C24.244 5.95221 23.9271 5.95221 23.7321 6.14721L16.0002 13.8791L8.26837 6.14659C8.07337 5.95159 7.75649 5.95159 7.56149 6.14659L6.14649 7.56096C5.95149 7.75596 5.95149 8.07284 6.14649 8.26784L13.879 16.0003L6.14649 23.7322C5.95149 23.9272 5.95149 24.2441 6.14649 24.4391L7.56087 25.8535C7.75587 26.0485 8.07274 26.0485 8.26774 25.8535L16.0002 18.1216L22.4102 24.5316L23.7321 25.8535C23.9271 26.0485 24.244 26.0485 24.439 25.8535L25.8534 24.4391C26.0484 24.2441 26.0484 23.9272 25.8534 23.7322L18.1215 16.0003Z"),r.appendChild(n),r.classList.add("icon"),r}class _o{constructor(e,r,n,i,a,s,o,u){P(this,"node");P(this,"_rightColumnNode");P(this,"_feedbackNode");P(this,"_showToolCallResult",!1);P(this,"_toolCallInfoNode");P(this,"_currentMessageBlockNode");P(this,"_currentMessageBlockNodeMarkdown");P(this,"_accumulatedMarkdown","");P(this,"_toolCallBuilder",new nd);P(this,"_clientFunctionInvocationsByOperationId",{});P(this,"_clientFunctionInvocationsByLlmFunctionId",{});P(this,"_subConversations",{});P(this,"_pulseNode");P(this,"_pulseNodeAnimation");P(this,"_suggestionTextList");this.conversation=e,this.authorRole=r,this.authorId=n,this.authorPictureUrl=i,this.authorDisplayName=a,this.authorEmail=s,this.messageId=o,this.copilitId=u,this.node=_("li",{class:"p-2 flex gap-2"},_(Zh,{class:"shrink-0",id:this.authorId,title:this.authorDisplayName},this.authorPictureUrl?_("img",{src:this.authorPictureUrl,class:"w-full h-full"}):_("span",{marginTop:"-.1em"},Yh(this.authorDisplayName))),this._rightColumnNode=_("div",{class:"shrink-0 flex-1"},_("div",{class:"font-medium text-base leading-5"},this.authorDisplayName))),this.ensureCurrentMessageBlockNode(),this._suggestionTextList=[{text:"Irrelevant answer",isActive:!1},{text:"Incorrect information",isActive:!1},{text:"Incomplete answer",isActive:!1},{text:"Offensive content",isActive:!1},{text:"Other",isActive:!1}]}get chat(){return this.conversation.chat}ensureCurrentMessageBlockNode(){if(!this._currentMessageBlockNode&&(this._rightColumnNode.appendChild(this._toolCallInfoNode=_("div",{class:"prose prose-neutral prose-sm max-w-none"})),this._rightColumnNode.appendChild(this._currentMessageBlockNode=_("div",{class:"prose prose-neutral prose-sm max-w-none"})),this._currentMessageBlockNodeMarkdown="",this.authorRole==="assistant")){this._pulseNode=_("div",{class:"inline-flex relative h-3 w-3"},_("div",{class:"absolute inline-flex h-full w-full rounded-full bg-Sky-Blue-80"}),_("div",{class:"relative inline-flex rounded-full h-full w-full bg-Sky-Blue-Main-77"})),this._currentMessageBlockNode.appendChild(this._pulseNode);const e=[{transform:"scale(2.5)",opacity:0,offset:.75},{transform:"scale(2.5)",opacity:0,offset:1}],r={duration:1500,iterations:1/0,easing:"cubic-bezier(0, 0, 0.2, 1)"};this._pulseNodeAnimation=this._pulseNode.firstElementChild.animate(e,r)}}removePulseNodeIfItIsThere(){const e=this._pulseNode;e&&(this._pulseNode=null,this._pulseNodeAnimation.cancel(),e.remove())}append(e){if(this._accumulatedMarkdown+=e,this.ensureCurrentMessageBlockNode(),this._currentMessageBlockNodeMarkdown+=e,this._pulseNode){var r=this._pulseNodeAnimation.currentTime;this._pulseNodeAnimation.pause(),this._pulseNode.remove()}ba(this._currentMessageBlockNode,this._currentMessageBlockNodeMarkdown,this.chat.pyodide,this.chat.mdastExtensions),this._pulseNode&&(this._pulseNodeAnimation.currentTime=r,this._pulseNode.classList.add("ml-[1ch]"),cd(this._currentMessageBlockNode).appendChild(this._pulseNode),this._pulseNodeAnimation.play())}toolCallUpdate(e){var n;const r=this._toolCallBuilder.append(e);if(r.llmFunctionId&&r.functionName){let i=this._clientFunctionInvocationsByLlmFunctionId[r.llmFunctionId];if(i){(n=i.updateWithToolCallData)==null||n.call(i,r);return}const a=this.chat.clientFunctionInvocationHandlersPartial[r.functionName];if(a){const s=new d0(r.llmFunctionId,null,this),o=a(s,r);this._clientFunctionInvocationsByLlmFunctionId[r.llmFunctionId]=o,this.removePulseNodeIfItIsThere(),o.node&&(this._rightColumnNode.appendChild(o.node),o instanceof Qn&&o.context.conversationMessage.expandAsync(),this._currentMessageBlockNode=null,this._currentMessageBlockNodeMarkdown=null)}}}onOpcodeMessageInvokeClientFunctionReceived(e,r,n,i){var h,d;const a=JSON.parse(i);let s=this._clientFunctionInvocationsByOperationId[r];if(s){s.run(...a);return}if(s=this._clientFunctionInvocationsByLlmFunctionId[e],s&&!s.context.operationId){s.context.operationId=r,this.chat.clientFunctionInvocationsByOperationId[r]=s,this._clientFunctionInvocationsByOperationId[r]=s,(h=s.run)==null||h.call(s,...a);return}const o=new d0(e,r,this),u=this.chat.clientFunctionInvocationHandlers[n];if(u)s=u(o,...a),this.chat.clientFunctionInvocationsByOperationId[r]=s,this._clientFunctionInvocationsByOperationId[r]=s,this._clientFunctionInvocationsByLlmFunctionId[e]=s,(d=s.run)==null||d.call(s,...a),this.removePulseNodeIfItIsThere(),s.node&&(this._rightColumnNode.appendChild(s.node),s instanceof Qn&&s.context.conversationMessage.expandAsync(),this._currentMessageBlockNode=null,this._currentMessageBlockNodeMarkdown=null);else{const p=`Function '${n}' not found. This occurs if a tool / function has been invoked, that requires some sort of user interaction (e.g. to obtain confirmation or to fill out some form values), then contacts the front-end to obtain a response, but the front-end is unable to handle the request because the function to be invoked does not exist. This error was thrown in the front-end. This most likely indicates that the bot is set up incorrectly, and the user should contact support.`;o.postErrorAsync(p)}}setClientInvocationResult(e,r){var n;(n=e.onClientResult)==null||n.call(e,r)}setClientInvocationError(e,r){var n;(n=e.onClientError)==null||n.call(e,r)}onOpcodeMessageToolCallBeginReceived(e,r){this._showToolCallResult=!0,this.ensureCurrentMessageBlockNode(),this._toolCallInfoNode.appendChild(_("div",{class:"flex"},_("div",{class:"p-1"},_("label",null,r))))}onOpcodeMessageToolCallResultReceived(e,r){var a;let n;try{n=JSON.parse(r)}catch{n=r}this.ensureCurrentMessageBlockNode(),this._showToolCallResult&&this._toolCallInfoNode.appendChild(_("div",{class:"flex"},_("div",{class:"p-1"},_("pre",{class:"whitespace-pre-wrap"},JSON.stringify(n,null,2)))));let i=this._clientFunctionInvocationsByLlmFunctionId[e];i&&((a=i.onOpcodeMessageToolCallResultReceived)==null||a.call(i,r),this.onClientFunctionInvocationCompleted(i))}onOpcodeMessageToolCallErrorReceived(e,r){const n=this._clientFunctionInvocationsByLlmFunctionId[e];n&&(n.onOpcodeMessageToolCallErrorReceived(r),this.onClientFunctionInvocationCompleted(n))}onClientFunctionInvocationCompleted(e){e.context.llmFunctionId in this._clientFunctionInvocationsByLlmFunctionId&&(delete this._clientFunctionInvocationsByLlmFunctionId[e.context.llmFunctionId],!Object.keys(this._subConversations).length&&!Object.keys(this._clientFunctionInvocationsByLlmFunctionId).length&&this.ensureCurrentMessageBlockNode())}executeLlmFunctionsBegin(){this._toolCallBuilder.clear()}executeLlmFunctionsEnd(){this.ensureCurrentMessageBlockNode(),this._clientFunctionInvocationsByLlmFunctionId={},this._subConversations={}}subConversationBegin(e,r,n,i,a,s){const o=new Bo(this.chat,e,this,s);this.chat.conversationsById.set(e,o),this._subConversations[e]=o,this.removePulseNodeIfItIsThere(),this._rightColumnNode.appendChild(o.node),this._currentMessageBlockNode=null,this._currentMessageBlockNodeMarkdown=null}notifySubConversationEnded(e,r){delete this._subConversations[e.id],!r&&!Object.keys(this._subConversations).length&&!Object.keys(this._clientFunctionInvocationsByLlmFunctionId).length&&this.ensureCurrentMessageBlockNode()}onOpcodeEndReceived(){this.removePulseNodeIfItIsThere(),this._toolCallBuilder.clear(),this._clientFunctionInvocationsByLlmFunctionId={},this._subConversations={};const e=this.conversation.chat.feedbackByMessageId.get(this.messageId);e!=null?this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1"},_(e?Sa:za,null))):this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1",onclick:()=>{this.conversation.chat.setLikeAsync(this.messageId,this.copilitId,!0),this._feedbackNode.replaceWith(this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1"},_(Sa,null))))}},_(Sa,null)),_("a",{class:"btn btn-link p-1",onclick:()=>{const r=_("div",{class:"vui-dialog-overlay-rac"},_("div",{role:"dialog",class:"vui-dialog-content-rac w-[600px] gap-5"},_("button",{onclick:()=>r.remove(),class:"vui-dialog-close-button-rac"},_(ud,{size:"18"})),_("div",{class:"vui-dialog-header-rac"},_("label",{class:"text-label-md pl-7"},"Tell us more")),_("div",{class:"vui-dialog-body-rac flex flex-col gap-5"},_("div",{class:"text-label-sm pl-7"},this._suggestionTextList.map((n,i)=>_("span",{class:"feedback-suggestion-text",onclick:a=>{this._suggestionTextList.filter((u,h)=>h!==i&&u.isActive).forEach(u=>u.isActive=!1),r.querySelectorAll(".feedback-suggestion-text").forEach(u=>u.classList.toggle("feedback-suggestion-text-active",!1)),n.isActive=!n.isActive,a.currentTarget.classList.toggle("feedback-suggestion-text-active",n.isActive)}},n.text))),_("textarea",{placeholder:"Add special details (optional)",class:"feedback-comment-text"})),_("div",{class:"vui-dialog-footer-rac flex justify-end gap-2"},_("button",{class:"btn-rac btn-primary-rac btn-lg",onclick:()=>{let n="";this._suggestionTextList.map((s,o)=>{s.isActive&&(n=s.text)});let i="";const a=r.querySelector(".feedback-comment-text").value;a!==""&&(i=a),this.conversation.chat.setLikeAsync(this.messageId,this.copilitId,!1,n,i),r.remove(),this._feedbackNode.replaceWith(this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link p-1"},_(za,null))))}},"Submit"))));document.body.appendChild(r)}},_(za,null))),this._rightColumnNode.appendChild(this._feedbackNode)}onErrorWhileReadingBodyStream(e){console.log("ConversationMessage.onErrorWhileReadingBodyStream",e),this.removePulseNodeIfItIsThere();for(const r in this._clientFunctionInvocationsByLlmFunctionId)this._clientFunctionInvocationsByLlmFunctionId[r].onErrorWhileReadingBodyStream(e);this._toolCallBuilder.clear(),this._clientFunctionInvocationsByLlmFunctionId={};for(const r in this._subConversations)this._subConversations[r].onErrorWhileReadingBodyStream(e);this._subConversations={}}toDto(){return{role:this.authorRole,content:this._accumulatedMarkdown}}expandAsync(){if(this.conversation instanceof Bo)return this.conversation.expandAsync()}static installClientFunctions(e){e.clientFunctionInvocationHandlers.python=(r,n)=>{const i=new Mo(r,n);return i.run(n),i},e.clientFunctionInvocationHandlersPartial.python=(r,n)=>new Mo(r,n),e.clientFunctionInvocationHandlers.ButtonOptionsDialog=(r,n)=>new ed(r,n),e.clientFunctionInvocationHandlers.search=(r,n)=>new od(r,n),e.clientFunctionInvocationHandlers.WindowOpenDialog=(r,n)=>new ld(r,n)}}function cd(t){for(;;)for(let e=t.lastChild;;e=e.previousSibling)if(e){if(e.nodeType===Node.TEXT_NODE)return t;if(e.nodeType===Node.ELEMENT_NODE){if(e.tagName==="TABLE")return t;t=e;break}}else return t}class No{constructor(e,r){P(this,"node");P(this,"messagesListNode");P(this,"messages",[]);P(this,"activeMessage");P(this,"_opcodeConversationEndReceived");P(this,"_opcodeConversationErrorReceived");P(this,"_onErrorWhileReadingBodyStreamCalled");this.chat=e,this.id=r,this.node=this.messagesListNode=_("ol",null)}onOpcodeMessageBeginReceived(e,r,n,i,a,s,o){const u=new _o(this,e,r,n,i,a,s,o);return this.messages.push(this.activeMessage=u),this.messagesListNode.appendChild(u.node),u}onOpcodeMessageAppendReceived(e){this.activeMessage.append(e)}onOpcodeMessageExecuteLlmFunctionsBeginReceived(){this.activeMessage.executeLlmFunctionsBegin()}onOpcodeMessageExecuteLlmFunctionsEndReceived(){this.activeMessage.executeLlmFunctionsEnd()}onOpcodeMessageToolCallUpdateReceived(e){this.activeMessage.toolCallUpdate(e)}onOpcodeMessageToolCallBeginReceived(e,r){this.activeMessage.onOpcodeMessageToolCallBeginReceived(e,r)}onOpcodeMessageToolCallResultReceived(e,r){this.activeMessage.onOpcodeMessageToolCallResultReceived(e,r)}onOpcodeMessageToolCallErrorReceived(e,r){this.activeMessage.onOpcodeMessageToolCallErrorReceived(e,r)}onOpcodeMessageInvokeClientFunctionReceived(e,r,n,i){this.activeMessage.onOpcodeMessageInvokeClientFunctionReceived(e,r,n,i)}onOpcodeMessageSubConversationBeginReceived(e,r,n,i,a,s){this.activeMessage.subConversationBegin(e,r,n,i,a,s)}handleMessage(e){switch(e.type){case Me.MessageBegin:return this.onOpcodeMessageBeginReceived(e.messageAuthorRole,e.messageAuthorId,e.messageAuthorPictureUrl,e.messageAuthorDisplayName,e.messageAuthorEmail,e.messageId,e.copilotId),!0;case Me.MessageAppend:return this.onOpcodeMessageAppendReceived(e.appendMessageMarkdown),!0;case Me.MessageToolCallUpdate:return this.onOpcodeMessageToolCallUpdateReceived(e),!0;case Me.MessageToolCallBegin:return this.onOpcodeMessageToolCallBeginReceived(e.llmFunctionId,e.toolCallBeginInfo),!0;case Me.MessageToolCallResult:return this.onOpcodeMessageToolCallResultReceived(e.llmFunctionId,e.result),!0;case Me.MessageToolCallError:return this.onOpcodeMessageToolCallErrorReceived(e.llmFunctionId,e.error),!0;case Me.MessageExecuteLlmFunctionsBegin:return this.onOpcodeMessageExecuteLlmFunctionsBeginReceived(),!0;case Me.MessageExecuteLlmFunctionsEnd:return this.onOpcodeMessageExecuteLlmFunctionsEndReceived(),!0;case Me.MessageInvokeClientFunction:return this.onOpcodeMessageInvokeClientFunctionReceived(e.llmFunctionId,e.operationId,e.clientFunctionName,e.argumentsAsJSON),!0;case Me.MessageSubConversationBegin:return this.onOpcodeMessageSubConversationBeginReceived(e.subConversationId,e.messageAuthorId,e.messageAuthorPictureUrl,e.messageAuthorDisplayName,e.messageAuthorEmail,e.subConversationTitle),!0;case Me.ConversationEnd:return this.onOpcodeConversationEndReceived(),!0;case Me.ConversationError:return this.onOpcodeConversationErrorReceived(e.error,e.stackTrace),!0}return!1}onRootConversationEndOfBodyStream(){!this._opcodeConversationEndReceived&&!this._opcodeConversationErrorReceived&&!this._onErrorWhileReadingBodyStreamCalled&&this.onRootConversationUnexpectedEndOfBodyStream(),this.activeMessage=null,this._opcodeConversationEndReceived=!1,this._opcodeConversationErrorReceived=!1,this._onErrorWhileReadingBodyStreamCalled=!1}onRootConversationUnexpectedEndOfBodyStream(){var e,r;(r=(e=this.activeMessage)==null?void 0:e.onErrorWhileReadingBodyStream)==null||r.call(e,new _l),this.displayError("Unexpected end of response","The response ended unexpectedly. Please check your connectivity. Other possible causes include server instability or a bug.")}onOpcodeConversationEndReceived(){var e;this._opcodeConversationEndReceived=!0,(e=this.activeMessage)==null||e.onOpcodeEndReceived()}onOpcodeConversationErrorReceived(e,r){this._opcodeConversationErrorReceived=!0,e&&console.debug(e,r),this.displayError("Error","An undisclosed error occurred. Please contact Veracity Support.")}onErrorBeforeReadingBodyStreamStarted(e,r){if(r){this.displayInfo("Stopped","The generation of the response was stopped.");return}if(e instanceof Oa){this.displayError("Max limit reached","You have reached the maximum input limit. Please try again later.");return}else this.displayError("Error",String(e.message))}onErrorWhileReadingBodyStream(e,r){var n;this._onErrorWhileReadingBodyStreamCalled=!0,(n=this.activeMessage)==null||n.onErrorWhileReadingBodyStream(e),r?this.displayInfo("Stopped","The generation of the response was stopped."):this.displayError("Error while reading response",String(e.message))}displayError(e,r){this.messagesListNode.appendChild(_("li",{class:"m-2 border border-Light p-6 flex gap-5 bg-Sandstone-97"},_(wa,{class:"text-Energy-Red-45"}),_("div",null,_("h6",null,e),_("div",{class:"prose prose-sm prose-neutral"},_("p",null,r)))))}displayInfo(e,r){this.messagesListNode.appendChild(_("li",{class:"m-2 border border-Light p-6 flex gap-5 bg-Sandstone-97"},_(xa,{class:"text-Sea-Blue-Main-28"}),_("div",null,_("h6",null,e),_("div",{class:"prose prose-sm prose-neutral"},_("p",null,r)))))}}class Bo extends No{constructor(r,n,i,a){super(r,n);P(this,"_buttonNode");P(this,"_buttonIconWrapperNode");P(this,"_buttonTextNode");P(this,"_contentWrapperNode");P(this,"_contentNode");P(this,"_expanded",!1);P(this,"_expandedCt");P(this,"_expandPromise");this.parentMessage=i,this.title=a,this.node=_("div",{class:"my-2"},this._buttonNode=_(tn,{class:"p-2 gap-2 group",variant:Ft.Badge,size:$r.Medium,onclick:()=>this.expanded=!this.expanded},this._buttonIconWrapperNode=_("div",{width:"24px",height:"24px"},_(Jn,{size:dn.Small})),this.title,_(Ao,{class:"transition-all duration-300 group-data-[expanded=true]:-rotate-180"})),this._contentWrapperNode=_("div",{class:"grid",gridTemplateRows:this._expanded?"1fr":"0fr",opacity:this._expanded?"1":"0","aria-expanded":this._expanded},_("div",{class:"overflow-hidden"},this._contentNode=_("section",{class:"mt-2 border border-Light flex flex-col bg-Sandstone-95 p-3"},this.messagesListNode))))}get expanded(){return this._expanded}set expanded(r){r!==this._expanded&&(r?this.doExpandAsync():this.doCollapseAsync())}async doExpandAsync(){var n;(n=this._expandedCt)==null||n.cancel();const r=this._expandedCt=new Kt;this._buttonNode.setAttribute("data-expanded",String(this._expanded=!0)),this._expandPromise=(async()=>{try{await cr(this._contentWrapperNode,[{gridTemplateRows:"1fr"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt),await cr(this._contentWrapperNode,[{opacity:"1"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt)}catch(i){if(!r.isCancellationRequested)throw i}})(),await this._expandPromise}async doCollapseAsync(){var n;(n=this._expandedCt)==null||n.cancel();const r=this._expandedCt=new Kt;this._buttonNode.setAttribute("data-expanded",String(this._expanded=!1));try{await cr(this._contentWrapperNode,[{opacity:"0"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt),await cr(this._contentWrapperNode,[{gridTemplateRows:"0fr"}],{duration:300,easing:"ease-in-out",fill:"forwards"},this._expandedCt)}catch(i){if(!r.isCancellationRequested)throw i}}onErrorWhileReadingBodyStream(r){var n;(n=this.activeMessage)==null||n.onErrorWhileReadingBodyStream(r),this.setButtonError(),this.parentMessage.notifySubConversationEnded(this,!0)}onOpcodeConversationEndReceived(){var r;(r=this.activeMessage)==null||r.onOpcodeEndReceived(),this.setButtonSuccess(),this.parentMessage.notifySubConversationEnded(this,!1)}onOpcodeConversationErrorReceived(r,n){var s;r&&console.debug(r,n);const i="An undisclosed error occurred. Please contact Veracity Support.";this.displayError("Error",i);const a=new Error(i);(s=this.activeMessage)==null||s.onErrorWhileReadingBodyStream(a),this.setButtonError(),this.parentMessage.notifySubConversationEnded(this,!1)}setButtonSuccess(){this._buttonNode.setAttribute("data-status","success"),this._buttonIconWrapperNode.replaceChild(_(Yn,null),this._buttonIconWrapperNode.firstChild)}setButtonError(){this._buttonNode.setAttribute("data-status","error"),this._buttonIconWrapperNode.replaceChild(_(ka,null),this._buttonIconWrapperNode.firstChild)}async expandAsync(){await this.parentMessage.expandAsync(),this._expanded?this._expandPromise&&await this._expandPromise:await this.doExpandAsync()}}class hd{constructor(e){P(this,"node");P(this,"url");P(this,"historyUrl");P(this,"feedbackUrl");P(this,"summarizeTitleUrl");P(this,"fetch");P(this,"conversationsById",new Map);P(this,"feedbackByMessageId",new Map);P(this,"rootConversation",new No(this,null));P(this,"clientFunctionInvocationHandlers",{});P(this,"clientFunctionInvocationHandlersPartial",{});P(this,"clientFunctionInvocationsByOperationId",{});P(this,"mdastExtensions",[]);P(this,"pyodide");P(this,"_lazyInitializePyodidePromise");P(this,"_completion");this.conversationsById.set(null,this.rootConversation),this.url=e.url,this.historyUrl=e.historyUrl,this.feedbackUrl=e.feedbackUrl,this.summarizeTitleUrl=e.summarizeTitleUrl,this.fetch=e.fetch??fetch.bind(window),this.node=_("div",null);const r=document.createElement("style");r.textContent=il+`
271
271
  `+al+`
272
- `+sl;const n=this.node.attachShadow({mode:"closed"});n.appendChild(r),n.appendChild(this.rootConversation.node),_o.installClientFunctions(this)}lazyInitializePyodideAsync(){return this._lazyInitializePyodidePromise??(this._lazyInitializePyodidePromise=this.doInitializePyodide())}async doInitializePyodide(){return this.pyodide=await o0({indexURL:"https://cdn.veracity.com/vcb/pyodide-0.26.4/pyodide/"}),this.pyodide.FS.mkdir("/mnt"),this.pyodide.FS.mkdir("/mnt/data"),this.pyodide}async runPythonCodeAsync(e){return await this.pyodide.loadPackagesFromImports(e),await this.pyodide.runPythonAsync(e)}get canSubmit(){return!this._completion}async LoadHistoryMessages(){let e=new li;await this.LoadLikes();try{await e.initializeExistingAsync(this.fetch,this.historyUrl)}catch(r){let n=e.wasStopped;throw e=null,this.rootConversation.onErrorBeforeReadingBodyStreamStarted(r,n),r}try{for(;await e.waitToReadAsync();)for(const r of e.read()){switch(r.type){case Me.MessageInvokeClientFunctionResult:{const n=this.clientFunctionInvocationsByOperationId[r.operationId];n.context.conversationMessage.setClientInvocationResult(n,JSON.parse(r.result));continue}case Me.MessageInvokeClientFunctionError:{const n=this.clientFunctionInvocationsByOperationId[r.operationId];n.context.conversationMessage.setClientInvocationError(n,r.error);continue}}this.conversationsById.get(r.conversationId).handleMessage(r)}}catch(r){this.rootConversation.onErrorWhileReadingBodyStream(r,e.wasStopped)}finally{e=null,this.rootConversation.onRootConversationEndOfBodyStream()}}async SummarizeTitleAsync(e,r){const n=new li,i=this.rootConversation.messages.map(a=>a.toDto());i.push({role:"user",content:r});for(let a=0;a<i.length;++a)if(i[a].role==="user"){const s=a+1;for(;s<i.length&&i[s].role==="user";)i[a].content+=`
272
+ `+sl;const n=this.node.attachShadow({mode:"closed"});n.appendChild(r),n.appendChild(this.rootConversation.node),_o.installClientFunctions(this)}lazyInitializePyodideAsync(){return this._lazyInitializePyodidePromise??(this._lazyInitializePyodidePromise=this.doInitializePyodide())}async doInitializePyodide(){return this.pyodide=await o0({indexURL:"https://cdn.veracity.com/vcb/pyodide-0.26.4/pyodide/"}),this.pyodide.FS.mkdir("/mnt"),this.pyodide.FS.mkdir("/mnt/data"),this.pyodide}async runPythonCodeAsync(e){return await this.pyodide.loadPackagesFromImports(e),await this.pyodide.runPythonAsync(e)}get canSubmit(){return!this._completion}async LoadHistoryMessages(){let e=new li;await this.LoadLikesAsync();try{await e.initializeExistingAsync(this.fetch,this.historyUrl)}catch(r){let n=e.wasStopped;throw e=null,this.rootConversation.onErrorBeforeReadingBodyStreamStarted(r,n),r}try{for(;await e.waitToReadAsync();)for(const r of e.read()){switch(r.type){case Me.MessageInvokeClientFunctionResult:{const n=this.clientFunctionInvocationsByOperationId[r.operationId];n.context.conversationMessage.setClientInvocationResult(n,JSON.parse(r.result));continue}case Me.MessageInvokeClientFunctionError:{const n=this.clientFunctionInvocationsByOperationId[r.operationId];n.context.conversationMessage.setClientInvocationError(n,r.error);continue}}this.conversationsById.get(r.conversationId).handleMessage(r)}}catch(r){this.rootConversation.onErrorWhileReadingBodyStream(r,e.wasStopped)}finally{e=null,this.rootConversation.onRootConversationEndOfBodyStream()}}async SummarizeTitleAsync(e,r){const n=new li,i=this.rootConversation.messages.map(a=>a.toDto());i.push({role:"user",content:r});for(let a=0;a<i.length;++a)if(i[a].role==="user"){const s=a+1;for(;s<i.length&&i[s].role==="user";)i[a].content+=`
273
273
  `+i[s].content,i.splice(s,1)}try{return await n.summarizeTitleAsync(this.fetch,this.summarizeTitleUrl,i,e)}catch(a){return console.error("Error summarizing title:",a),null}}async submitMessageAsync(e,r,n){if(!this.canSubmit)throw new Error("Cannot submit message because another message is currently being processed");this._completion=new li;const i=this.rootConversation.messages.map(a=>a.toDto());i.push({role:"user",content:e});for(let a=0;a<i.length;++a)if(i[a].role==="user"){const s=a+1;for(;s<i.length&&i[s].role==="user";)i[a].content+=`
274
- `+i[s].content,i.splice(s,1)}try{await this._completion.startAsync(this.fetch,this.url,i,r,n)}catch(a){let s=this._completion.wasStopped;this._completion=null,this.rootConversation.onErrorBeforeReadingBodyStreamStarted(a,s);return}try{for(;await this._completion.waitToReadAsync();)for(const a of this._completion.read()){switch(a.type){case Me.MessageInvokeClientFunctionResult:{const s=this.clientFunctionInvocationsByOperationId[a.operationId];s.context.conversationMessage.setClientInvocationResult(s,JSON.parse(a.result));continue}case Me.MessageInvokeClientFunctionError:{const s=this.clientFunctionInvocationsByOperationId[a.operationId];s.context.conversationMessage.setClientInvocationError(s,a.error);continue}}this.conversationsById.get(a.conversationId).handleMessage(a)}}catch(a){this.rootConversation.onErrorWhileReadingBodyStream(a,this._completion.wasStopped)}finally{this._completion=null,this.rootConversation.onRootConversationEndOfBodyStream()}}stop(){var e;(e=this._completion)==null||e.stop()}async setLike(e,r,n,i=null,a=null){const s=await this.fetch(this.feedbackUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:e,isThumbsUp:n,copilotId:r,category:i,comment:a})});if(!s.ok)throw new Error(`Failed to send feedback: ${s.status} ${s.statusText}`);this.feedbackByMessageId.set(e,n)}async LoadLikes(){const e=await this.fetch(`${this.feedbackUrl}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Failed to get feedback: ${e.status} ${e.statusText}`);const r=await e.json();for(const n of r)this.feedbackByMessageId.set(n.messageId,n.isThumbsUp)}}const jt=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ea,Ro;function md(){if(Ro)return Ea;Ro=1;function t(x){return x instanceof Map?x.clear=x.delete=x.set=function(){throw new Error("map is read-only")}:x instanceof Set&&(x.add=x.clear=x.delete=function(){throw new Error("set is read-only")}),Object.freeze(x),Object.getOwnPropertyNames(x).forEach(R=>{const X=x[R],pe=typeof X;(pe==="object"||pe==="function")&&!Object.isFrozen(X)&&t(X)}),x}class e{constructor(R){R.data===void 0&&(R.data={}),this.data=R.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(x){return x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function n(x,...R){const X=Object.create(null);for(const pe in x)X[pe]=x[pe];return R.forEach(function(pe){for(const $e in pe)X[$e]=pe[$e]}),X}const i="</span>",a=x=>!!x.scope,s=(x,{prefix:R})=>{if(x.startsWith("language:"))return x.replace("language:","language-");if(x.includes(".")){const X=x.split(".");return[`${R}${X.shift()}`,...X.map((pe,$e)=>`${pe}${"_".repeat($e+1)}`)].join(" ")}return`${R}${x}`};class o{constructor(R,X){this.buffer="",this.classPrefix=X.classPrefix,R.walk(this)}addText(R){this.buffer+=r(R)}openNode(R){if(!a(R))return;const X=s(R.scope,{prefix:this.classPrefix});this.span(X)}closeNode(R){a(R)&&(this.buffer+=i)}value(){return this.buffer}span(R){this.buffer+=`<span class="${R}">`}}const u=(x={})=>{const R={children:[]};return Object.assign(R,x),R};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(R){this.top.children.push(R)}openNode(R){const X=u({scope:R});this.add(X),this.stack.push(X)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(R){return this.constructor._walk(R,this.rootNode)}static _walk(R,X){return typeof X=="string"?R.addText(X):X.children&&(R.openNode(X),X.children.forEach(pe=>this._walk(R,pe)),R.closeNode(X)),R}static _collapse(R){typeof R!="string"&&R.children&&(R.children.every(X=>typeof X=="string")?R.children=[R.children.join("")]:R.children.forEach(X=>{h._collapse(X)}))}}class d extends h{constructor(R){super(),this.options=R}addText(R){R!==""&&this.add(R)}startScope(R){this.openNode(R)}endScope(){this.closeNode()}__addSublanguage(R,X){const pe=R.root;X&&(pe.scope=`language:${X}`),this.add(pe)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(x){return x?typeof x=="string"?x:x.source:null}function b(x){return E("(?=",x,")")}function f(x){return E("(?:",x,")*")}function z(x){return E("(?:",x,")?")}function E(...x){return x.map(X=>p(X)).join("")}function O(x){const R=x[x.length-1];return typeof R=="object"&&R.constructor===Object?(x.splice(x.length-1,1),R):{}}function A(...x){return"("+(O(x).capture?"":"?:")+x.map(pe=>p(pe)).join("|")+")"}function N(x){return new RegExp(x.toString()+"|").exec("").length-1}function I(x,R){const X=x&&x.exec(R);return X&&X.index===0}const Y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function G(x,{joinWith:R}){let X=0;return x.map(pe=>{X+=1;const $e=X;let We=p(pe),te="";for(;We.length>0;){const Q=Y.exec(We);if(!Q){te+=We;break}te+=We.substring(0,Q.index),We=We.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?te+="\\"+String(Number(Q[1])+$e):(te+=Q[0],Q[0]==="("&&X++)}return te}).map(pe=>`(${pe})`).join(R)}const C=/\b\B/,V="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",j="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",be=(x={})=>{const R=/^#![ ]*\//;return x.binary&&(x.begin=E(R,/.*\b/,x.binary,/\b.*/)),n({scope:"meta",begin:R,end:/$/,relevance:0,"on:begin":(X,pe)=>{X.index!==0&&pe.ignoreMatch()}},x)},he={begin:"\\\\[\\s\\S]",relevance:0},le={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[he]},Ee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[he]},Ce={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ue=function(x,R,X={}){const pe=n({scope:"comment",begin:x,end:R,contains:[]},X);pe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const $e=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return pe.contains.push({begin:E(/[ ]+/,"(",$e,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),pe},_e=ue("//","$"),w=ue("/\\*","\\*/"),Te=ue("#","$"),Ae={scope:"number",begin:j,relevance:0},k={scope:"number",begin:M,relevance:0},et={scope:"number",begin:W,relevance:0},it={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[he,{begin:/\[/,end:/\]/,relevance:0,contains:[he]}]},He={scope:"title",begin:V,relevance:0},ft={scope:"title",begin:ee,relevance:0},tt={begin:"\\.\\s*"+ee,relevance:0};var at=Object.freeze({__proto__:null,APOS_STRING_MODE:le,BACKSLASH_ESCAPE:he,BINARY_NUMBER_MODE:et,BINARY_NUMBER_RE:W,COMMENT:ue,C_BLOCK_COMMENT_MODE:w,C_LINE_COMMENT_MODE:_e,C_NUMBER_MODE:k,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(x){return Object.assign(x,{"on:begin":(R,X)=>{X.data._beginMatch=R[1]},"on:end":(R,X)=>{X.data._beginMatch!==R[1]&&X.ignoreMatch()}})},HASH_COMMENT_MODE:Te,IDENT_RE:V,MATCH_NOTHING_RE:C,METHOD_GUARD:tt,NUMBER_MODE:Ae,NUMBER_RE:j,PHRASAL_WORDS_MODE:Ce,QUOTE_STRING_MODE:Ee,REGEXP_MODE:it,RE_STARTERS_RE:$,SHEBANG:be,TITLE_MODE:He,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:ft});function wr(x,R){x.input[x.index-1]==="."&&R.ignoreMatch()}function mn(x,R){x.className!==void 0&&(x.scope=x.className,delete x.className)}function pn(x,R){R&&x.beginKeywords&&(x.begin="\\b("+x.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",x.__beforeBegin=wr,x.keywords=x.keywords||x.beginKeywords,delete x.beginKeywords,x.relevance===void 0&&(x.relevance=0))}function Or(x,R){Array.isArray(x.illegal)&&(x.illegal=A(...x.illegal))}function Lr(x,R){if(x.match){if(x.begin||x.end)throw new Error("begin & end are not supported with match");x.begin=x.match,delete x.match}}function Dr(x,R){x.relevance===void 0&&(x.relevance=1)}const xr=(x,R)=>{if(!x.beforeMatch)return;if(x.starts)throw new Error("beforeMatch cannot be used with starts");const X=Object.assign({},x);Object.keys(x).forEach(pe=>{delete x[pe]}),x.keywords=X.keywords,x.begin=E(X.beforeMatch,b(X.begin)),x.starts={relevance:0,contains:[Object.assign(X,{endsParent:!0})]},x.relevance=0,delete X.beforeMatch},kr=["of","and","for","in","not","or","if","then","parent","list","value"],ar="keyword";function fn(x,R,X=ar){const pe=Object.create(null);return typeof x=="string"?$e(X,x.split(" ")):Array.isArray(x)?$e(X,x):Object.keys(x).forEach(function(We){Object.assign(pe,fn(x[We],R,We))}),pe;function $e(We,te){R&&(te=te.map(Q=>Q.toLowerCase())),te.forEach(function(Q){const me=Q.split("|");pe[me[0]]=[We,Ta(me[0],me[1])]})}}function Ta(x,R){return R?Number(R):Aa(x)?0:1}function Aa(x){return kr.includes(x.toLowerCase())}const ti={},sr=x=>{console.error(x)},ri=(x,...R)=>{console.log(`WARN: ${x}`,...R)},B=(x,R)=>{ti[`${x}/${R}`]||(console.log(`Deprecated as of ${x}. ${R}`),ti[`${x}/${R}`]=!0)},U=new Error;function de(x,R,{key:X}){let pe=0;const $e=x[X],We={},te={};for(let Q=1;Q<=R.length;Q++)te[Q+pe]=$e[Q],We[Q+pe]=!0,pe+=N(R[Q-1]);x[X]=te,x[X]._emit=We,x[X]._multi=!0}function ye(x){if(Array.isArray(x.begin)){if(x.skip||x.excludeBegin||x.returnBegin)throw sr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),U;if(typeof x.beginScope!="object"||x.beginScope===null)throw sr("beginScope must be object"),U;de(x,x.begin,{key:"beginScope"}),x.begin=G(x.begin,{joinWith:""})}}function Ne(x){if(Array.isArray(x.end)){if(x.skip||x.excludeEnd||x.returnEnd)throw sr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),U;if(typeof x.endScope!="object"||x.endScope===null)throw sr("endScope must be object"),U;de(x,x.end,{key:"endScope"}),x.end=G(x.end,{joinWith:""})}}function yt(x){x.scope&&typeof x.scope=="object"&&x.scope!==null&&(x.beginScope=x.scope,delete x.scope)}function or(x){yt(x),typeof x.beginScope=="string"&&(x.beginScope={_wrap:x.beginScope}),typeof x.endScope=="string"&&(x.endScope={_wrap:x.endScope}),ye(x),Ne(x)}function It(x){function R(te,Q){return new RegExp(p(te),"m"+(x.case_insensitive?"i":"")+(x.unicodeRegex?"u":"")+(Q?"g":""))}class X{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,me){me.position=this.position++,this.matchIndexes[this.matchAt]=me,this.regexes.push([me,Q]),this.matchAt+=N(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(me=>me[1]);this.matcherRe=R(G(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const me=this.matcherRe.exec(Q);if(!me)return null;const Ze=me.findIndex((gn,Ma)=>Ma>0&&gn!==void 0),Ve=this.matchIndexes[Ze];return me.splice(0,Ze),Object.assign(me,Ve)}}class pe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const me=new X;return this.rules.slice(Q).forEach(([Ze,Ve])=>me.addRule(Ze,Ve)),me.compile(),this.multiRegexes[Q]=me,me}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,me){this.rules.push([Q,me]),me.type==="begin"&&this.count++}exec(Q){const me=this.getMatcher(this.regexIndex);me.lastIndex=this.lastIndex;let Ze=me.exec(Q);if(this.resumingScanAtSamePosition()&&!(Ze&&Ze.index===this.lastIndex)){const Ve=this.getMatcher(0);Ve.lastIndex=this.lastIndex+1,Ze=Ve.exec(Q)}return Ze&&(this.regexIndex+=Ze.position+1,this.regexIndex===this.count&&this.considerAll()),Ze}}function $e(te){const Q=new pe;return te.contains.forEach(me=>Q.addRule(me.begin,{rule:me,type:"begin"})),te.terminatorEnd&&Q.addRule(te.terminatorEnd,{type:"end"}),te.illegal&&Q.addRule(te.illegal,{type:"illegal"}),Q}function We(te,Q){const me=te;if(te.isCompiled)return me;[mn,Lr,or,xr].forEach(Ve=>Ve(te,Q)),x.compilerExtensions.forEach(Ve=>Ve(te,Q)),te.__beforeBegin=null,[pn,Or,Dr].forEach(Ve=>Ve(te,Q)),te.isCompiled=!0;let Ze=null;return typeof te.keywords=="object"&&te.keywords.$pattern&&(te.keywords=Object.assign({},te.keywords),Ze=te.keywords.$pattern,delete te.keywords.$pattern),Ze=Ze||/\w+/,te.keywords&&(te.keywords=fn(te.keywords,x.case_insensitive)),me.keywordPatternRe=R(Ze,!0),Q&&(te.begin||(te.begin=/\B|\b/),me.beginRe=R(me.begin),!te.end&&!te.endsWithParent&&(te.end=/\B|\b/),te.end&&(me.endRe=R(me.end)),me.terminatorEnd=p(me.end)||"",te.endsWithParent&&Q.terminatorEnd&&(me.terminatorEnd+=(te.end?"|":"")+Q.terminatorEnd)),te.illegal&&(me.illegalRe=R(te.illegal)),te.contains||(te.contains=[]),te.contains=[].concat(...te.contains.map(function(Ve){return Fr(Ve==="self"?te:Ve)})),te.contains.forEach(function(Ve){We(Ve,me)}),te.starts&&We(te.starts,Q),me.matcher=$e(me),me}if(x.compilerExtensions||(x.compilerExtensions=[]),x.contains&&x.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return x.classNameAliases=n(x.classNameAliases||{}),We(x)}function Sr(x){return x?x.endsWithParent||Sr(x.starts):!1}function Fr(x){return x.variants&&!x.cachedVariants&&(x.cachedVariants=x.variants.map(function(R){return n(x,{variants:null},R)})),x.cachedVariants?x.cachedVariants:Sr(x)?n(x,{starts:x.starts?n(x.starts):null}):Object.isFrozen(x)?n(x):x}var ht="11.10.0";class zr extends Error{constructor(R,X){super(R),this.name="HTMLInjectionError",this.html=X}}const wt=r,jo=n,Vo=Symbol("nomatch"),Pd=7,Xo=function(x){const R=Object.create(null),X=Object.create(null),pe=[];let $e=!0;const We="Could not find the language '{}', did you forget to load/include a language module?",te={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function me(q){return Q.noHighlightRe.test(q)}function Ze(q){let ae=q.className+" ";ae+=q.parentNode?q.parentNode.className:"";const ke=Q.languageDetectRe.exec(ae);if(ke){const Oe=Er(ke[1]);return Oe||(ri(We.replace("{}",ke[1])),ri("Falling back to no-highlight mode for this block.",q)),Oe?ke[1]:"no-highlight"}return ae.split(/\s+/).find(Oe=>me(Oe)||Er(Oe))}function Ve(q,ae,ke){let Oe="",Ye="";typeof ae=="object"?(Oe=q,ke=ae.ignoreIllegals,Ye=ae.language):(B("10.7.0","highlight(lang, code, ...args) has been deprecated."),B("10.7.0",`Please use highlight(code, options) instead.
274
+ `+i[s].content,i.splice(s,1)}try{await this._completion.startAsync(this.fetch,this.url,i,r,n)}catch(a){let s=this._completion.wasStopped;this._completion=null,this.rootConversation.onErrorBeforeReadingBodyStreamStarted(a,s);return}try{for(;await this._completion.waitToReadAsync();)for(const a of this._completion.read()){switch(a.type){case Me.MessageInvokeClientFunctionResult:{const s=this.clientFunctionInvocationsByOperationId[a.operationId];s.context.conversationMessage.setClientInvocationResult(s,JSON.parse(a.result));continue}case Me.MessageInvokeClientFunctionError:{const s=this.clientFunctionInvocationsByOperationId[a.operationId];s.context.conversationMessage.setClientInvocationError(s,a.error);continue}}this.conversationsById.get(a.conversationId).handleMessage(a)}}catch(a){this.rootConversation.onErrorWhileReadingBodyStream(a,this._completion.wasStopped)}finally{this._completion=null,this.rootConversation.onRootConversationEndOfBodyStream()}}stop(){var e;(e=this._completion)==null||e.stop()}async setLikeAsync(e,r,n,i=null,a=null){const s=await this.fetch(this.feedbackUrl,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messageId:e,isThumbsUp:n,copilotId:r,category:i,comment:a})});if(!s.ok)throw new Error(`Failed to send feedback: ${s.status} ${s.statusText}`);this.feedbackByMessageId.set(e,n)}async LoadLikesAsync(){const e=await this.fetch(`${this.feedbackUrl}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(!e.ok)throw new Error(`Failed to get feedback: ${e.status} ${e.statusText}`);const r=await e.json();for(const n of r)this.feedbackByMessageId.set(n.messageId,n.isThumbsUp)}}const jt=Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"}));function dd(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Ea,Ro;function md(){if(Ro)return Ea;Ro=1;function t(x){return x instanceof Map?x.clear=x.delete=x.set=function(){throw new Error("map is read-only")}:x instanceof Set&&(x.add=x.clear=x.delete=function(){throw new Error("set is read-only")}),Object.freeze(x),Object.getOwnPropertyNames(x).forEach(R=>{const X=x[R],pe=typeof X;(pe==="object"||pe==="function")&&!Object.isFrozen(X)&&t(X)}),x}class e{constructor(R){R.data===void 0&&(R.data={}),this.data=R.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(x){return x.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;")}function n(x,...R){const X=Object.create(null);for(const pe in x)X[pe]=x[pe];return R.forEach(function(pe){for(const $e in pe)X[$e]=pe[$e]}),X}const i="</span>",a=x=>!!x.scope,s=(x,{prefix:R})=>{if(x.startsWith("language:"))return x.replace("language:","language-");if(x.includes(".")){const X=x.split(".");return[`${R}${X.shift()}`,...X.map((pe,$e)=>`${pe}${"_".repeat($e+1)}`)].join(" ")}return`${R}${x}`};class o{constructor(R,X){this.buffer="",this.classPrefix=X.classPrefix,R.walk(this)}addText(R){this.buffer+=r(R)}openNode(R){if(!a(R))return;const X=s(R.scope,{prefix:this.classPrefix});this.span(X)}closeNode(R){a(R)&&(this.buffer+=i)}value(){return this.buffer}span(R){this.buffer+=`<span class="${R}">`}}const u=(x={})=>{const R={children:[]};return Object.assign(R,x),R};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(R){this.top.children.push(R)}openNode(R){const X=u({scope:R});this.add(X),this.stack.push(X)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(R){return this.constructor._walk(R,this.rootNode)}static _walk(R,X){return typeof X=="string"?R.addText(X):X.children&&(R.openNode(X),X.children.forEach(pe=>this._walk(R,pe)),R.closeNode(X)),R}static _collapse(R){typeof R!="string"&&R.children&&(R.children.every(X=>typeof X=="string")?R.children=[R.children.join("")]:R.children.forEach(X=>{h._collapse(X)}))}}class d extends h{constructor(R){super(),this.options=R}addText(R){R!==""&&this.add(R)}startScope(R){this.openNode(R)}endScope(){this.closeNode()}__addSublanguage(R,X){const pe=R.root;X&&(pe.scope=`language:${X}`),this.add(pe)}toHTML(){return new o(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(x){return x?typeof x=="string"?x:x.source:null}function b(x){return E("(?=",x,")")}function f(x){return E("(?:",x,")*")}function z(x){return E("(?:",x,")?")}function E(...x){return x.map(X=>p(X)).join("")}function O(x){const R=x[x.length-1];return typeof R=="object"&&R.constructor===Object?(x.splice(x.length-1,1),R):{}}function A(...x){return"("+(O(x).capture?"":"?:")+x.map(pe=>p(pe)).join("|")+")"}function N(x){return new RegExp(x.toString()+"|").exec("").length-1}function I(x,R){const X=x&&x.exec(R);return X&&X.index===0}const Y=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function G(x,{joinWith:R}){let X=0;return x.map(pe=>{X+=1;const $e=X;let We=p(pe),te="";for(;We.length>0;){const Q=Y.exec(We);if(!Q){te+=We;break}te+=We.substring(0,Q.index),We=We.substring(Q.index+Q[0].length),Q[0][0]==="\\"&&Q[1]?te+="\\"+String(Number(Q[1])+$e):(te+=Q[0],Q[0]==="("&&X++)}return te}).map(pe=>`(${pe})`).join(R)}const C=/\b\B/,V="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",j="\\b\\d+(\\.\\d+)?",M="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",$="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",be=(x={})=>{const R=/^#![ ]*\//;return x.binary&&(x.begin=E(R,/.*\b/,x.binary,/\b.*/)),n({scope:"meta",begin:R,end:/$/,relevance:0,"on:begin":(X,pe)=>{X.index!==0&&pe.ignoreMatch()}},x)},he={begin:"\\\\[\\s\\S]",relevance:0},le={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[he]},Ee={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[he]},Ce={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},ue=function(x,R,X={}){const pe=n({scope:"comment",begin:x,end:R,contains:[]},X);pe.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const $e=A("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return pe.contains.push({begin:E(/[ ]+/,"(",$e,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),pe},_e=ue("//","$"),w=ue("/\\*","\\*/"),Te=ue("#","$"),Ae={scope:"number",begin:j,relevance:0},k={scope:"number",begin:M,relevance:0},et={scope:"number",begin:W,relevance:0},it={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[he,{begin:/\[/,end:/\]/,relevance:0,contains:[he]}]},He={scope:"title",begin:V,relevance:0},ft={scope:"title",begin:ee,relevance:0},tt={begin:"\\.\\s*"+ee,relevance:0};var at=Object.freeze({__proto__:null,APOS_STRING_MODE:le,BACKSLASH_ESCAPE:he,BINARY_NUMBER_MODE:et,BINARY_NUMBER_RE:W,COMMENT:ue,C_BLOCK_COMMENT_MODE:w,C_LINE_COMMENT_MODE:_e,C_NUMBER_MODE:k,C_NUMBER_RE:M,END_SAME_AS_BEGIN:function(x){return Object.assign(x,{"on:begin":(R,X)=>{X.data._beginMatch=R[1]},"on:end":(R,X)=>{X.data._beginMatch!==R[1]&&X.ignoreMatch()}})},HASH_COMMENT_MODE:Te,IDENT_RE:V,MATCH_NOTHING_RE:C,METHOD_GUARD:tt,NUMBER_MODE:Ae,NUMBER_RE:j,PHRASAL_WORDS_MODE:Ce,QUOTE_STRING_MODE:Ee,REGEXP_MODE:it,RE_STARTERS_RE:$,SHEBANG:be,TITLE_MODE:He,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:ft});function wr(x,R){x.input[x.index-1]==="."&&R.ignoreMatch()}function mn(x,R){x.className!==void 0&&(x.scope=x.className,delete x.className)}function pn(x,R){R&&x.beginKeywords&&(x.begin="\\b("+x.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",x.__beforeBegin=wr,x.keywords=x.keywords||x.beginKeywords,delete x.beginKeywords,x.relevance===void 0&&(x.relevance=0))}function Or(x,R){Array.isArray(x.illegal)&&(x.illegal=A(...x.illegal))}function Lr(x,R){if(x.match){if(x.begin||x.end)throw new Error("begin & end are not supported with match");x.begin=x.match,delete x.match}}function Dr(x,R){x.relevance===void 0&&(x.relevance=1)}const xr=(x,R)=>{if(!x.beforeMatch)return;if(x.starts)throw new Error("beforeMatch cannot be used with starts");const X=Object.assign({},x);Object.keys(x).forEach(pe=>{delete x[pe]}),x.keywords=X.keywords,x.begin=E(X.beforeMatch,b(X.begin)),x.starts={relevance:0,contains:[Object.assign(X,{endsParent:!0})]},x.relevance=0,delete X.beforeMatch},kr=["of","and","for","in","not","or","if","then","parent","list","value"],ar="keyword";function fn(x,R,X=ar){const pe=Object.create(null);return typeof x=="string"?$e(X,x.split(" ")):Array.isArray(x)?$e(X,x):Object.keys(x).forEach(function(We){Object.assign(pe,fn(x[We],R,We))}),pe;function $e(We,te){R&&(te=te.map(Q=>Q.toLowerCase())),te.forEach(function(Q){const me=Q.split("|");pe[me[0]]=[We,Ta(me[0],me[1])]})}}function Ta(x,R){return R?Number(R):Aa(x)?0:1}function Aa(x){return kr.includes(x.toLowerCase())}const ti={},sr=x=>{console.error(x)},ri=(x,...R)=>{console.log(`WARN: ${x}`,...R)},B=(x,R)=>{ti[`${x}/${R}`]||(console.log(`Deprecated as of ${x}. ${R}`),ti[`${x}/${R}`]=!0)},U=new Error;function de(x,R,{key:X}){let pe=0;const $e=x[X],We={},te={};for(let Q=1;Q<=R.length;Q++)te[Q+pe]=$e[Q],We[Q+pe]=!0,pe+=N(R[Q-1]);x[X]=te,x[X]._emit=We,x[X]._multi=!0}function ye(x){if(Array.isArray(x.begin)){if(x.skip||x.excludeBegin||x.returnBegin)throw sr("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),U;if(typeof x.beginScope!="object"||x.beginScope===null)throw sr("beginScope must be object"),U;de(x,x.begin,{key:"beginScope"}),x.begin=G(x.begin,{joinWith:""})}}function Ne(x){if(Array.isArray(x.end)){if(x.skip||x.excludeEnd||x.returnEnd)throw sr("skip, excludeEnd, returnEnd not compatible with endScope: {}"),U;if(typeof x.endScope!="object"||x.endScope===null)throw sr("endScope must be object"),U;de(x,x.end,{key:"endScope"}),x.end=G(x.end,{joinWith:""})}}function yt(x){x.scope&&typeof x.scope=="object"&&x.scope!==null&&(x.beginScope=x.scope,delete x.scope)}function or(x){yt(x),typeof x.beginScope=="string"&&(x.beginScope={_wrap:x.beginScope}),typeof x.endScope=="string"&&(x.endScope={_wrap:x.endScope}),ye(x),Ne(x)}function It(x){function R(te,Q){return new RegExp(p(te),"m"+(x.case_insensitive?"i":"")+(x.unicodeRegex?"u":"")+(Q?"g":""))}class X{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Q,me){me.position=this.position++,this.matchIndexes[this.matchAt]=me,this.regexes.push([me,Q]),this.matchAt+=N(Q)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Q=this.regexes.map(me=>me[1]);this.matcherRe=R(G(Q,{joinWith:"|"}),!0),this.lastIndex=0}exec(Q){this.matcherRe.lastIndex=this.lastIndex;const me=this.matcherRe.exec(Q);if(!me)return null;const Ze=me.findIndex((gn,Ma)=>Ma>0&&gn!==void 0),Ve=this.matchIndexes[Ze];return me.splice(0,Ze),Object.assign(me,Ve)}}class pe{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Q){if(this.multiRegexes[Q])return this.multiRegexes[Q];const me=new X;return this.rules.slice(Q).forEach(([Ze,Ve])=>me.addRule(Ze,Ve)),me.compile(),this.multiRegexes[Q]=me,me}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Q,me){this.rules.push([Q,me]),me.type==="begin"&&this.count++}exec(Q){const me=this.getMatcher(this.regexIndex);me.lastIndex=this.lastIndex;let Ze=me.exec(Q);if(this.resumingScanAtSamePosition()&&!(Ze&&Ze.index===this.lastIndex)){const Ve=this.getMatcher(0);Ve.lastIndex=this.lastIndex+1,Ze=Ve.exec(Q)}return Ze&&(this.regexIndex+=Ze.position+1,this.regexIndex===this.count&&this.considerAll()),Ze}}function $e(te){const Q=new pe;return te.contains.forEach(me=>Q.addRule(me.begin,{rule:me,type:"begin"})),te.terminatorEnd&&Q.addRule(te.terminatorEnd,{type:"end"}),te.illegal&&Q.addRule(te.illegal,{type:"illegal"}),Q}function We(te,Q){const me=te;if(te.isCompiled)return me;[mn,Lr,or,xr].forEach(Ve=>Ve(te,Q)),x.compilerExtensions.forEach(Ve=>Ve(te,Q)),te.__beforeBegin=null,[pn,Or,Dr].forEach(Ve=>Ve(te,Q)),te.isCompiled=!0;let Ze=null;return typeof te.keywords=="object"&&te.keywords.$pattern&&(te.keywords=Object.assign({},te.keywords),Ze=te.keywords.$pattern,delete te.keywords.$pattern),Ze=Ze||/\w+/,te.keywords&&(te.keywords=fn(te.keywords,x.case_insensitive)),me.keywordPatternRe=R(Ze,!0),Q&&(te.begin||(te.begin=/\B|\b/),me.beginRe=R(me.begin),!te.end&&!te.endsWithParent&&(te.end=/\B|\b/),te.end&&(me.endRe=R(me.end)),me.terminatorEnd=p(me.end)||"",te.endsWithParent&&Q.terminatorEnd&&(me.terminatorEnd+=(te.end?"|":"")+Q.terminatorEnd)),te.illegal&&(me.illegalRe=R(te.illegal)),te.contains||(te.contains=[]),te.contains=[].concat(...te.contains.map(function(Ve){return Fr(Ve==="self"?te:Ve)})),te.contains.forEach(function(Ve){We(Ve,me)}),te.starts&&We(te.starts,Q),me.matcher=$e(me),me}if(x.compilerExtensions||(x.compilerExtensions=[]),x.contains&&x.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return x.classNameAliases=n(x.classNameAliases||{}),We(x)}function Sr(x){return x?x.endsWithParent||Sr(x.starts):!1}function Fr(x){return x.variants&&!x.cachedVariants&&(x.cachedVariants=x.variants.map(function(R){return n(x,{variants:null},R)})),x.cachedVariants?x.cachedVariants:Sr(x)?n(x,{starts:x.starts?n(x.starts):null}):Object.isFrozen(x)?n(x):x}var ht="11.10.0";class zr extends Error{constructor(R,X){super(R),this.name="HTMLInjectionError",this.html=X}}const wt=r,jo=n,Vo=Symbol("nomatch"),Pd=7,Xo=function(x){const R=Object.create(null),X=Object.create(null),pe=[];let $e=!0;const We="Could not find the language '{}', did you forget to load/include a language module?",te={disableAutodetect:!0,name:"Plain text",contains:[]};let Q={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:d};function me(q){return Q.noHighlightRe.test(q)}function Ze(q){let ae=q.className+" ";ae+=q.parentNode?q.parentNode.className:"";const ke=Q.languageDetectRe.exec(ae);if(ke){const Oe=Er(ke[1]);return Oe||(ri(We.replace("{}",ke[1])),ri("Falling back to no-highlight mode for this block.",q)),Oe?ke[1]:"no-highlight"}return ae.split(/\s+/).find(Oe=>me(Oe)||Er(Oe))}function Ve(q,ae,ke){let Oe="",Ye="";typeof ae=="object"?(Oe=q,ke=ae.ignoreIllegals,Ye=ae.language):(B("10.7.0","highlight(lang, code, ...args) has been deprecated."),B("10.7.0",`Please use highlight(code, options) instead.
275
275
  https://github.com/highlightjs/highlight.js/issues/2277`),Ye=q,Oe=ae),ke===void 0&&(ke=!0);const Ot={code:Oe,language:Ye};ii("before:highlight",Ot);const Tr=Ot.result?Ot.result:gn(Ot.language,Ot.code,ke);return Tr.code=Ot.code,ii("after:highlight",Tr),Tr}function gn(q,ae,ke,Oe){const Ye=Object.create(null);function Ot(Z,ne){return Z.keywords[ne]}function Tr(){if(!fe.keywords){rt.addText(Le);return}let Z=0;fe.keywordPatternRe.lastIndex=0;let ne=fe.keywordPatternRe.exec(Le),ve="";for(;ne;){ve+=Le.substring(Z,ne.index);const Be=Xt.case_insensitive?ne[0].toLowerCase():ne[0],st=Ot(fe,Be);if(st){const[lr,n4]=st;if(rt.addText(ve),ve="",Ye[Be]=(Ye[Be]||0)+1,Ye[Be]<=Pd&&(oi+=n4),lr.startsWith("_"))ve+=ne[0];else{const i4=Xt.classNameAliases[lr]||lr;Vt(ne[0],i4)}}else ve+=ne[0];Z=fe.keywordPatternRe.lastIndex,ne=fe.keywordPatternRe.exec(Le)}ve+=Le.substring(Z),rt.addText(ve)}function ai(){if(Le==="")return;let Z=null;if(typeof fe.subLanguage=="string"){if(!R[fe.subLanguage]){rt.addText(Le);return}Z=gn(fe.subLanguage,Le,!0,rl[fe.subLanguage]),rl[fe.subLanguage]=Z._top}else Z=Ca(Le,fe.subLanguage.length?fe.subLanguage:null);fe.relevance>0&&(oi+=Z.relevance),rt.__addSublanguage(Z._emitter,Z.language)}function xt(){fe.subLanguage!=null?ai():Tr(),Le=""}function Vt(Z,ne){Z!==""&&(rt.startScope(ne),rt.addText(Z),rt.endScope())}function Jo(Z,ne){let ve=1;const Be=ne.length-1;for(;ve<=Be;){if(!Z._emit[ve]){ve++;continue}const st=Xt.classNameAliases[Z[ve]]||Z[ve],lr=ne[ve];st?Vt(lr,st):(Le=lr,Tr(),Le=""),ve++}}function Qo(Z,ne){return Z.scope&&typeof Z.scope=="string"&&rt.openNode(Xt.classNameAliases[Z.scope]||Z.scope),Z.beginScope&&(Z.beginScope._wrap?(Vt(Le,Xt.classNameAliases[Z.beginScope._wrap]||Z.beginScope._wrap),Le=""):Z.beginScope._multi&&(Jo(Z.beginScope,ne),Le="")),fe=Object.create(Z,{parent:{value:fe}}),fe}function el(Z,ne,ve){let Be=I(Z.endRe,ve);if(Be){if(Z["on:end"]){const st=new e(Z);Z["on:end"](ne,st),st.isMatchIgnored&&(Be=!1)}if(Be){for(;Z.endsParent&&Z.parent;)Z=Z.parent;return Z}}if(Z.endsWithParent)return el(Z.parent,ne,ve)}function Jd(Z){return fe.matcher.regexIndex===0?(Le+=Z[0],1):(Ra=!0,0)}function Qd(Z){const ne=Z[0],ve=Z.rule,Be=new e(ve),st=[ve.__beforeBegin,ve["on:begin"]];for(const lr of st)if(lr&&(lr(Z,Be),Be.isMatchIgnored))return Jd(ne);return ve.skip?Le+=ne:(ve.excludeBegin&&(Le+=ne),xt(),!ve.returnBegin&&!ve.excludeBegin&&(Le=ne)),Qo(ve,Z),ve.returnBegin?0:ne.length}function e4(Z){const ne=Z[0],ve=ae.substring(Z.index),Be=el(fe,Z,ve);if(!Be)return Vo;const st=fe;fe.endScope&&fe.endScope._wrap?(xt(),Vt(ne,fe.endScope._wrap)):fe.endScope&&fe.endScope._multi?(xt(),Jo(fe.endScope,Z)):st.skip?Le+=ne:(st.returnEnd||st.excludeEnd||(Le+=ne),xt(),st.excludeEnd&&(Le=ne));do fe.scope&&rt.closeNode(),!fe.skip&&!fe.subLanguage&&(oi+=fe.relevance),fe=fe.parent;while(fe!==Be.parent);return Be.starts&&Qo(Be.starts,Z),st.returnEnd?0:ne.length}function t4(){const Z=[];for(let ne=fe;ne!==Xt;ne=ne.parent)ne.scope&&Z.unshift(ne.scope);Z.forEach(ne=>rt.openNode(ne))}let si={};function tl(Z,ne){const ve=ne&&ne[0];if(Le+=Z,ve==null)return xt(),0;if(si.type==="begin"&&ne.type==="end"&&si.index===ne.index&&ve===""){if(Le+=ae.slice(ne.index,ne.index+1),!$e){const Be=new Error(`0 width match regex (${q})`);throw Be.languageName=q,Be.badRule=si.rule,Be}return 1}if(si=ne,ne.type==="begin")return Qd(ne);if(ne.type==="illegal"&&!ke){const Be=new Error('Illegal lexeme "'+ve+'" for mode "'+(fe.scope||"<unnamed>")+'"');throw Be.mode=fe,Be}else if(ne.type==="end"){const Be=e4(ne);if(Be!==Vo)return Be}if(ne.type==="illegal"&&ve==="")return 1;if(Ba>1e5&&Ba>ne.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Le+=ve,ve.length}const Xt=Er(q);if(!Xt)throw sr(We.replace("{}",q)),new Error('Unknown language: "'+q+'"');const r4=It(Xt);let Na="",fe=Oe||r4;const rl={},rt=new Q.__emitter(Q);t4();let Le="",oi=0,Pr=0,Ba=0,Ra=!1;try{if(Xt.__emitTokens)Xt.__emitTokens(ae,rt);else{for(fe.matcher.considerAll();;){Ba++,Ra?Ra=!1:fe.matcher.considerAll(),fe.matcher.lastIndex=Pr;const Z=fe.matcher.exec(ae);if(!Z)break;const ne=ae.substring(Pr,Z.index),ve=tl(ne,Z);Pr=Z.index+ve}tl(ae.substring(Pr))}return rt.finalize(),Na=rt.toHTML(),{language:q,value:Na,relevance:oi,illegal:!1,_emitter:rt,_top:fe}}catch(Z){if(Z.message&&Z.message.includes("Illegal"))return{language:q,value:wt(ae),illegal:!0,relevance:0,_illegalBy:{message:Z.message,index:Pr,context:ae.slice(Pr-100,Pr+100),mode:Z.mode,resultSoFar:Na},_emitter:rt};if($e)return{language:q,value:wt(ae),illegal:!1,relevance:0,errorRaised:Z,_emitter:rt,_top:fe};throw Z}}function Ma(q){const ae={value:wt(q),illegal:!1,relevance:0,_top:te,_emitter:new Q.__emitter(Q)};return ae._emitter.addText(q),ae}function Ca(q,ae){ae=ae||Q.languages||Object.keys(R);const ke=Ma(q),Oe=ae.filter(Er).filter(Zo).map(xt=>gn(xt,q,!1));Oe.unshift(ke);const Ye=Oe.sort((xt,Vt)=>{if(xt.relevance!==Vt.relevance)return Vt.relevance-xt.relevance;if(xt.language&&Vt.language){if(Er(xt.language).supersetOf===Vt.language)return 1;if(Er(Vt.language).supersetOf===xt.language)return-1}return 0}),[Ot,Tr]=Ye,ai=Ot;return ai.secondBest=Tr,ai}function qd(q,ae,ke){const Oe=ae&&X[ae]||ke;q.classList.add("hljs"),q.classList.add(`language-${Oe}`)}function _a(q){let ae=null;const ke=Ze(q);if(me(ke))return;if(ii("before:highlightElement",{el:q,language:ke}),q.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",q);return}if(q.children.length>0&&(Q.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(q)),Q.throwUnescapedHTML))throw new zr("One of your code blocks includes unescaped HTML.",q.innerHTML);ae=q;const Oe=ae.textContent,Ye=ke?Ve(Oe,{language:ke,ignoreIllegals:!0}):Ca(Oe);q.innerHTML=Ye.value,q.dataset.highlighted="yes",qd(q,ke,Ye.language),q.result={language:Ye.language,re:Ye.relevance,relevance:Ye.relevance},Ye.secondBest&&(q.secondBest={language:Ye.secondBest.language,relevance:Ye.secondBest.relevance}),ii("after:highlightElement",{el:q,result:Ye,text:Oe})}function Ud(q){Q=jo(Q,q)}const Hd=()=>{ni(),B("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Gd(){ni(),B("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let Ko=!1;function ni(){if(document.readyState==="loading"){Ko=!0;return}document.querySelectorAll(Q.cssSelector).forEach(_a)}function $d(){Ko&&ni()}typeof window<"u"&&window.addEventListener&&window.addEventListener("DOMContentLoaded",$d,!1);function Wd(q,ae){let ke=null;try{ke=ae(x)}catch(Oe){if(sr("Language definition for '{}' could not be registered.".replace("{}",q)),$e)sr(Oe);else throw Oe;ke=te}ke.name||(ke.name=q),R[q]=ke,ke.rawDefinition=ae.bind(null,x),ke.aliases&&Yo(ke.aliases,{languageName:q})}function jd(q){delete R[q];for(const ae of Object.keys(X))X[ae]===q&&delete X[ae]}function Vd(){return Object.keys(R)}function Er(q){return q=(q||"").toLowerCase(),R[q]||R[X[q]]}function Yo(q,{languageName:ae}){typeof q=="string"&&(q=[q]),q.forEach(ke=>{X[ke.toLowerCase()]=ae})}function Zo(q){const ae=Er(q);return ae&&!ae.disableAutodetect}function Xd(q){q["before:highlightBlock"]&&!q["before:highlightElement"]&&(q["before:highlightElement"]=ae=>{q["before:highlightBlock"](Object.assign({block:ae.el},ae))}),q["after:highlightBlock"]&&!q["after:highlightElement"]&&(q["after:highlightElement"]=ae=>{q["after:highlightBlock"](Object.assign({block:ae.el},ae))})}function Kd(q){Xd(q),pe.push(q)}function Yd(q){const ae=pe.indexOf(q);ae!==-1&&pe.splice(ae,1)}function ii(q,ae){const ke=q;pe.forEach(function(Oe){Oe[ke]&&Oe[ke](ae)})}function Zd(q){return B("10.7.0","highlightBlock will be removed entirely in v12.0"),B("10.7.0","Please use highlightElement now."),_a(q)}Object.assign(x,{highlight:Ve,highlightAuto:Ca,highlightAll:ni,highlightElement:_a,highlightBlock:Zd,configure:Ud,initHighlighting:Hd,initHighlightingOnLoad:Gd,registerLanguage:Wd,unregisterLanguage:jd,listLanguages:Vd,getLanguage:Er,registerAliases:Yo,autoDetection:Zo,inherit:jo,addPlugin:Kd,removePlugin:Yd}),x.debugMode=function(){$e=!1},x.safeMode=function(){$e=!0},x.versionString=ht,x.regex={concat:E,lookahead:b,either:A,optional:z,anyNumberOfTimes:f};for(const q in at)typeof at[q]=="object"&&t(at[q]);return Object.assign(x,at),x},Qr=Xo({});return Qr.newInstance=()=>Xo({}),Ea=Qr,Qr.HighlightJS=Qr,Qr.default=Qr,Ea}var pd=md();const Io=dd(pd),fd=Object.freeze(Object.defineProperty({__proto__:null,HighlightJS:Io,default:Io},Symbol.toStringTag,{value:"Module"})),Oo="[A-Za-z$_][0-9A-Za-z$_]*",gd=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],bd=["true","false","null","undefined","NaN","Infinity"],Lo=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Do=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Fo=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],vd=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],yd=[].concat(Fo,Lo,Do);function wd(t){const e=t.regex,r=(ue,{after:_e})=>{const w="</"+ue[0].slice(1);return ue.input.indexOf(w,_e)!==-1},n=Oo,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ue,_e)=>{const w=ue[0].length+ue.index,Te=ue.input[w];if(Te==="<"||Te===","){_e.ignoreMatch();return}Te===">"&&(r(ue,{after:w})||_e.ignoreMatch());let Ae;const k=ue.input.substring(w);if(Ae=k.match(/^\s*=/)){_e.ignoreMatch();return}if((Ae=k.match(/^\s+extends\s+/))&&Ae.index===0){_e.ignoreMatch();return}}},o={$pattern:Oo,keyword:gd,literal:bd,built_in:yd,"variable.language":vd},u="[0-9](_?[0-9])*",h=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},z={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,b]},N={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},I=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,z,E,O,{match:/\$\d+/},p];b.contains=I.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(I)});const Y=[].concat(N,b.contains),G=Y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(Y)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:G},V={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Lo,...Do]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(ue){return e.concat("(?!",ue.join("|"),")")}const be={match:e.concat(/\b/,$([...Fo,"super","import"].map(ue=>`${ue}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},he={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},Ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Ce={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:G,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,z,E,O,N,{match:/\$\d+/},p,ee,{className:"attr",begin:n+e.lookahead(":"),relevance:0},Ce,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,t.REGEXP_MODE,{className:"function",begin:Ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:G}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},he,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},be,W,V,le,{match:/\$[(.]/}]}}const xd=Object.freeze(Object.defineProperty({__proto__:null,default:wd},Symbol.toStringTag,{value:"Module"}));function kd(t){const e=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],n=["default","false","null","true"],i=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],a=["add","alias","and","ascending","async","await","by","descending","equals","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","remove","select","set","unmanaged","value|0","var","when","where","with","yield"],s={keyword:i.concat(a),built_in:e,literal:n},o=t.inherit(t.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),u={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},d={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},p=t.inherit(d,{illegal:/\n/}),b={className:"subst",begin:/\{/,end:/\}/,keywords:s},f=t.inherit(b,{illegal:/\n/}),z={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},t.BACKSLASH_ESCAPE,f]},E={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]},O=t.inherit(E,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},f]});b.contains=[E,z,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.C_BLOCK_COMMENT_MODE],f.contains=[O,z,p,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,u,t.inherit(t.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const A={variants:[h,E,z,d,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},N={begin:"<",end:">",contains:[{beginKeywords:"in out"},o]},I=t.IDENT_RE+"(<"+t.IDENT_RE+"(\\s*,\\s*"+t.IDENT_RE+")*>)?(\\[\\])?",Y={begin:"@"+t.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:s,illegal:/::/,contains:[t.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},A,u,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},o,N,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[o,N,t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+I+"\\s+)+"+t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:s,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:t.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[t.TITLE_MODE,N],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:s,relevance:0,contains:[A,u,t.C_BLOCK_COMMENT_MODE]},t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE]},Y]}}const Sd=Object.freeze(Object.defineProperty({__proto__:null,default:kd},Symbol.toStringTag,{value:"Module"}));function zd(t){const e=t.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),n=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],o={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:n,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:o,illegal:/#/},d={begin:/\{\{/,relevance:0},p={className:"string",contains:[t.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[t.BACKSLASH_ESCAPE,u,d,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[t.BACKSLASH_ESCAPE,u,d,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[t.BACKSLASH_ESCAPE,d,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[t.BACKSLASH_ESCAPE,d,h]},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},b="[0-9](_?[0-9])*",f=`(\\b(${b}))?\\.(${b})|\\b(${b})\\.`,z=`\\b|${n.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${b})|(${f}))[eE][+-]?(${b})[jJ]?(?=${z})`},{begin:`(${f})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${z})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${z})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${z})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${z})`},{begin:`\\b(${b})[jJ](?=${z})`}]},O={className:"comment",begin:e.lookahead(/# type:/),end:/$/,keywords:o,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},A={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:["self",u,E,p,t.HASH_COMMENT_MODE]}]};return h.contains=[p,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:o,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,O,t.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[A]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,A,p]}]}}const Ed=Object.freeze(Object.defineProperty({__proto__:null,default:zd},Symbol.toStringTag,{value:"Module"})),Td=t=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:t.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:t.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),Ad=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],Md=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],Cd=[...Ad,...Md],_d=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Nd=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Bd=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),Rd=["accent-color","align-content","align-items","align-self","alignment-baseline","all","animation","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-timing-function","appearance","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-end-end-radius","border-end-start-radius","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-decoration-break","box-shadow","box-sizing","break-after","break-before","break-inside","cx","cy","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","content","content-visibility","counter-increment","counter-reset","cue","cue-after","cue-before","cursor","direction","display","dominant-baseline","empty-cells","enable-background","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flow","flood-color","flood-opacity","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-size","font-size-adjust","font-smoothing","font-stretch","font-style","font-synthesis","font-variant","font-variant-caps","font-variant-east-asian","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","inline-size","inset","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","kerning","justify-content","justify-items","justify-self","left","letter-spacing","lighting-color","line-break","line-height","list-style","list-style-image","list-style-position","list-style-type","marker","marker-end","marker-mid","marker-start","mask","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-wrap","overflow-x","overflow-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page-break-after","page-break-before","page-break-inside","pause","pause-after","pause-before","perspective","perspective-origin","pointer-events","position","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","scale","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","speak","speak-as","src","tab-size","table-layout","text-anchor","text-align","text-align-all","text-align-last","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-transform","text-underline-offset","text-underline-position","top","transform","transform-box","transform-origin","transform-style","transition","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","vector-effect","vertical-align","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index"].sort().reverse();function Id(t){const e=t.regex,r=Td(t),n={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},i="and or not only",a=/@-?\w[\w]*(-\w+)*/,s="[a-zA-Z-][a-zA-Z0-9_-]*",o=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,n,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+s,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+Nd.join("|")+")"},{begin:":(:)?("+Bd.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+Rd.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...o,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...o,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:e.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:a},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:i,attribute:_d.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...o,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+Cd.join("|")+")\\b"}]}}const Od=Object.freeze(Object.defineProperty({__proto__:null,default:Id},Symbol.toStringTag,{value:"Module"})),ei="[A-Za-z$_][0-9A-Za-z$_]*",Po=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],qo=["true","false","null","undefined","NaN","Infinity"],Uo=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Ho=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Go=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$o=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Wo=[].concat(Go,Uo,Ho);function Ld(t){const e=t.regex,r=(ue,{after:_e})=>{const w="</"+ue[0].slice(1);return ue.input.indexOf(w,_e)!==-1},n=ei,i={begin:"<>",end:"</>"},a=/<[A-Za-z0-9\\._:-]+\s*\/>/,s={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(ue,_e)=>{const w=ue[0].length+ue.index,Te=ue.input[w];if(Te==="<"||Te===","){_e.ignoreMatch();return}Te===">"&&(r(ue,{after:w})||_e.ignoreMatch());let Ae;const k=ue.input.substring(w);if(Ae=k.match(/^\s*=/)){_e.ignoreMatch();return}if((Ae=k.match(/^\s+extends\s+/))&&Ae.index===0){_e.ignoreMatch();return}}},o={$pattern:ei,keyword:Po,literal:qo,built_in:Wo,"variable.language":$o},u="[0-9](_?[0-9])*",h=`\\.(${u})`,d="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${d})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${d})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},b={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},f={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"xml"}},z={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,b],subLanguage:"graphql"}},O={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,b]},N={className:"comment",variants:[t.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:n+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]},I=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,z,E,O,{match:/\$\d+/},p];b.contains=I.concat({begin:/\{/,end:/\}/,keywords:o,contains:["self"].concat(I)});const Y=[].concat(N,b.contains),G=Y.concat([{begin:/(\s*)\(/,end:/\)/,keywords:o,contains:["self"].concat(Y)}]),C={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:G},V={variants:[{match:[/class/,/\s+/,n,/\s+/,/extends/,/\s+/,e.concat(n,"(",e.concat(/\./,n),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,n],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:e.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Uo,...Ho]}},j={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},M={variants:[{match:[/function/,/\s+/,n,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[C],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function $(ue){return e.concat("(?!",ue.join("|"),")")}const be={match:e.concat(/\b/,$([...Go,"super","import"].map(ue=>`${ue}\\s*\\(`)),n,e.lookahead(/\s*\(/)),className:"title.function",relevance:0},he={begin:e.concat(/\./,e.lookahead(e.concat(n,/(?![0-9A-Za-z$_(])/))),end:n,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},le={match:[/get|set/,/\s+/,n,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},C]},Ee="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",Ce={match:[/const|var|let/,/\s+/,n,/\s*/,/=\s*/,/(async\s*)?/,e.lookahead(Ee)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[C]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,exports:{PARAMS_CONTAINS:G,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[t.SHEBANG({label:"shebang",binary:"node",relevance:5}),j,t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,f,z,E,O,N,{match:/\$\d+/},p,ee,{className:"attr",begin:n+e.lookahead(":"),relevance:0},Ce,{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[N,t.REGEXP_MODE,{className:"function",begin:Ee,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:G}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:i.begin,end:i.end},{match:a},{begin:s.begin,"on:begin":s.isTrulyOpeningTag,end:s.end}],subLanguage:"xml",contains:[{begin:s.begin,end:s.end,skip:!0,contains:["self"]}]}]},M,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+t.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[C,t.inherit(t.TITLE_MODE,{begin:n,className:"title.function"})]},{match:/\.\.\./,relevance:0},he,{match:"\\$"+n,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[C]},be,W,V,le,{match:/\$[(.]/}]}}function Dd(t){const e=Ld(t),r=ei,n=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],i={begin:[/namespace/,/\s+/,t.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},a={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:n},contains:[e.exports.CLASS_REFERENCE]},s={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},o=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],u={$pattern:ei,keyword:Po.concat(o),literal:qo,built_in:Wo.concat(n),"variable.language":$o},h={className:"meta",begin:"@"+r},d=(f,z,E)=>{const O=f.contains.findIndex(A=>A.label===z);if(O===-1)throw new Error("can not find mode to replace");f.contains.splice(O,1,E)};Object.assign(e.keywords,u),e.exports.PARAMS_CONTAINS.push(h);const p=e.contains.find(f=>f.className==="attr");e.exports.PARAMS_CONTAINS.push([e.exports.CLASS_REFERENCE,p]),e.contains=e.contains.concat([h,i,a]),d(e,"shebang",t.SHEBANG()),d(e,"use_strict",s);const b=e.contains.find(f=>f.label==="func.def");return b.relevance=0,Object.assign(e,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),e}const Fd=Object.freeze(Object.defineProperty({__proto__:null,default:Dd},Symbol.toStringTag,{value:"Module"}));kt.Chat=hd,Object.defineProperty(kt,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/ai",
3
- "version": "2.4.1",
3
+ "version": "2.4.3",
4
4
  "description": "Veracity AI UI",
5
5
  "repository": {
6
6
  "type": "git",