@veracity/ai 2.4.6 → 2.4.8

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../src/components/Conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAQ7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,qBAAa,YAAY;aAML,IAAI,EAAE,IAAI;aACV,EAAE,EAAE,MAAM;IAN5B,IAAI,EAAE,WAAW,CAAC;IAClB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,EAAE,mBAAmB,EAAE,CAAM;IACrC,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC;gBAE3B,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM;IAK5B,OAAO,CAAC,4BAA4B;IAwBpC,OAAO,CAAC,6BAA6B;IAIrC,OAAO,CAAC,+CAA+C;IAIvD,OAAO,CAAC,6CAA6C;IAIrD,OAAO,CAAC,qCAAqC;IAI7C,OAAO,CAAC,oCAAoC;IAI5C,OAAO,CAAC,qCAAqC;IAI7C,OAAO,CAAC,oCAAoC;IAI5C,OAAO,CAAC,2CAA2C;IAcnD,OAAO,CAAC,2CAA2C;IAkBnD,aAAa,CAAC,OAAO,EAAE,4BAA4B;IA8DnD,OAAO,CAAC,8BAA8B,CAAU;IAChD,OAAO,CAAC,gCAAgC,CAAU;IAClD,OAAO,CAAC,oCAAoC,CAAU;IAEtD,iCAAiC;IAgBjC,SAAS,CAAC,2CAA2C;IAQrD,gLAAgL;IAChL,+BAA+B;IAK/B,SAAS,CAAC,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAM7E,qCAAqC,CAAC,KAAK,KAAA,EAAE,UAAU,EAAE,OAAO;IAahE,6BAA6B,CAAC,KAAK,KAAA,EAAE,UAAU,EAAE,OAAO;IAOxD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAcrD,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAarD;AAED,qBAAa,eAAgB,SAAQ,YAAY;aA2E7B,aAAa,EAAE,mBAAmB;aAClC,KAAK,EAAE,MAAM;IA3E/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAChD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAc;IACrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAO;IAEvC,OAAO,CAAC,mBAAmB,CAAc;IACzC,OAAO,CAAC,YAAY,CAAc;IAElC,OAAO,CAAC,SAAS,CAAS;IAE1B,IAAI,QAAQ,IAMQ,OAAO,CAJ1B;IAED,OAAO,CAAC,WAAW,CAAoB;IAEvC,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAK1B;IAED,OAAO,CAAC,cAAc,CAAe;YAEvB,aAAa;YAyBb,eAAe;gBAuB3B,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,EACM,aAAa,EAAE,mBAAmB,EAClC,KAAK,EAAE,MAAM;IAkD/B,6BAA6B,CAAC,KAAK,KAAA;IAMnC,+BAA+B;IAM/B,SAAS,CAAC,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAc7E,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,cAAc;IAKhB,WAAW;CAQlB"}
1
+ {"version":3,"file":"Conversation.d.ts","sourceRoot":"","sources":["../../src/components/Conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAQ7D,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAQ5D,qBAAa,YAAY;aAML,IAAI,EAAE,IAAI;aACV,EAAE,EAAE,MAAM;IAN5B,IAAI,EAAE,WAAW,CAAC;IAClB,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,QAAQ,EAAE,mBAAmB,EAAE,CAAM;IACrC,SAAS,CAAC,aAAa,EAAE,mBAAmB,CAAC;gBAE3B,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM;IAK5B,OAAO,CAAC,4BAA4B;IAwBpC,OAAO,CAAC,6BAA6B;IAIrC,OAAO,CAAC,+CAA+C;IAIvD,OAAO,CAAC,6CAA6C;IAIrD,OAAO,CAAC,qCAAqC;IAI7C,OAAO,CAAC,oCAAoC;IAI5C,OAAO,CAAC,qCAAqC;IAI7C,OAAO,CAAC,oCAAoC;IAI5C,OAAO,CAAC,2CAA2C;IAcnD,OAAO,CAAC,2CAA2C;IAkBnD,aAAa,CAAC,OAAO,EAAE,4BAA4B;IA8DnD,OAAO,CAAC,8BAA8B,CAAU;IAChD,OAAO,CAAC,gCAAgC,CAAU;IAClD,OAAO,CAAC,oCAAoC,CAAU;IAEtD,iCAAiC;IAgBjC,SAAS,CAAC,2CAA2C;IAQrD,gLAAgL;IAChL,+BAA+B;IAK/B,SAAS,CAAC,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAU7E,qCAAqC,CAAC,KAAK,KAAA,EAAE,UAAU,EAAE,OAAO;IAahE,6BAA6B,CAAC,KAAK,KAAA,EAAE,UAAU,EAAE,OAAO;IAOxD,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;IAcrD,SAAS,CAAC,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;CAarD;AAED,qBAAa,eAAgB,SAAQ,YAAY;aA2E7B,aAAa,EAAE,mBAAmB;aAClC,KAAK,EAAE,MAAM;IA3E/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAoB;IAChD,OAAO,CAAC,QAAQ,CAAC,sBAAsB,CAAc;IACrD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAO;IAEvC,OAAO,CAAC,mBAAmB,CAAc;IACzC,OAAO,CAAC,YAAY,CAAc;IAElC,OAAO,CAAC,SAAS,CAAS;IAE1B,IAAI,QAAQ,IAMQ,OAAO,CAJ1B;IAED,OAAO,CAAC,WAAW,CAAoB;IAEvC,IAAI,QAAQ,CAAC,KAAK,EAAE,OAAO,EAK1B;IAED,OAAO,CAAC,cAAc,CAAe;YAEvB,aAAa;YAyBb,eAAe;gBAuB3B,IAAI,EAAE,IAAI,EACV,EAAE,EAAE,MAAM,EACM,aAAa,EAAE,mBAAmB,EAClC,KAAK,EAAE,MAAM;IAkD/B,6BAA6B,CAAC,KAAK,KAAA;IAMnC,+BAA+B;IAM/B,SAAS,CAAC,iCAAiC,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM;IAc7E,OAAO,CAAC,gBAAgB;IAKxB,OAAO,CAAC,cAAc;IAKhB,WAAW;CAQlB"}
@@ -30,7 +30,6 @@ export declare class ConversationMessage implements ChatMessageItem {
30
30
  private _pulseNodeAnimation;
31
31
  private _suggestionTextList;
32
32
  constructor(conversation: Conversation, authorRole: "assistant" | "user", authorId: string, authorPictureUrl: string, authorDisplayName: string, authorEmail: string, messageId: string, copilitId: string);
33
- private ensureStyles;
34
33
  ensureCurrentMessageBlockNode(): void;
35
34
  private removePulseNodeIfItIsThere;
36
35
  append(markdown: string): void;
@@ -1 +1 @@
1
- {"version":3,"file":"ConversationMessage.d.ts","sourceRoot":"","sources":["../../src/components/ConversationMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAA0B,cAAc,EAAuB,MAAM,SAAS,CAAC;AAMtF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAwD7D,qBAAa,mBAAoB,YAAW,eAAe;IA6BhD,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,WAAW,GAAG,MAAM;IAChC,QAAQ,EAAE,MAAM;IAChB,gBAAgB,EAAE,MAAM;IACxB,iBAAiB,EAAE,MAAM;IACzB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IAnC1B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,gBAAgB,CAAiB;IACzC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,wBAAwB,CAAiB;IACjD,OAAO,CAAC,gCAAgC,CAAS;IACjD,OAAO,CAAC,oBAAoB,CAAM;IAElC,OAAO,CAAC,gBAAgB,CAAyB;IAEjD,OAAO,CAAC,uCAAuC,CAA2D;IAC1G,OAAO,CAAC,yCAAyC,CAA6D;IAI9G,OAAO,CAAC,iBAAiB,CAAwD;IAGjF,IAAI,IAAI,SAEP;IAED,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,mBAAmB,CAAY;IACvC,OAAO,CAAC,mBAAmB,CAAQ;gBAG1B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,GAAG,MAAM,EAChC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM;IA0B1B,OAAO,CAAC,YAAY;IASpB,6BAA6B;IAsC7B,OAAO,CAAC,0BAA0B;IASlC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAuBvB,cAAc,CAAC,OAAO,EAAE,4BAA4B;IAyBpD,2CAA2C,CACzC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,eAAe,EAAE,MAAM;IAsCzB,yBAAyB,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,KAAA;IAGpF,wBAAwB,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM;IAI1F,oCAAoC,CAAC,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM;IAYrF,qCAAqC,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAwB3E,oCAAoC,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAQzE,OAAO,CAAC,mCAAmC;IAU3C,wBAAwB;IAIxB,sBAAsB;IAMtB,oBAAoB,CAClB,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,MAAM;IAY9B,0BAA0B,CAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO;IAUjF,mBAAmB;IA4GnB,6BAA6B,CAAC,KAAK,KAAA;IAiBnC,KAAK,IAAI,cAAc;IAOvB,WAAW;IAMX,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI;CAsCzC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,WAarD"}
1
+ {"version":3,"file":"ConversationMessage.d.ts","sourceRoot":"","sources":["../../src/components/ConversationMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAA0B,cAAc,EAAuB,MAAM,SAAS,CAAC;AAMtF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAE/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,6BAA6B,CAAC;AAGvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAwD7D,qBAAa,mBAAoB,YAAW,eAAe;IA6BhD,YAAY,EAAE,YAAY;IAC1B,UAAU,EAAE,WAAW,GAAG,MAAM;IAChC,QAAQ,EAAE,MAAM;IAChB,gBAAgB,EAAE,MAAM;IACxB,iBAAiB,EAAE,MAAM;IACzB,WAAW,EAAE,MAAM;IACnB,SAAS,EAAE,MAAM;IACjB,SAAS,EAAE,MAAM;IAnC1B,IAAI,EAAE,aAAa,CAAC;IACpB,OAAO,CAAC,gBAAgB,CAAiB;IACzC,OAAO,CAAC,aAAa,CAAiB;IACtC,OAAO,CAAC,mBAAmB,CAAkB;IAC7C,OAAO,CAAC,iBAAiB,CAAiB;IAC1C,OAAO,CAAC,wBAAwB,CAAiB;IACjD,OAAO,CAAC,gCAAgC,CAAS;IACjD,OAAO,CAAC,oBAAoB,CAAM;IAElC,OAAO,CAAC,gBAAgB,CAAyB;IAEjD,OAAO,CAAC,uCAAuC,CAA2D;IAC1G,OAAO,CAAC,yCAAyC,CAA6D;IAI9G,OAAO,CAAC,iBAAiB,CAAwD;IAGjF,IAAI,IAAI,SAEP;IAED,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,mBAAmB,CAAY;IACvC,OAAO,CAAC,mBAAmB,CAAQ;gBAG1B,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,WAAW,GAAG,MAAM,EAChC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM;IA0B1B,6BAA6B;IAsC7B,OAAO,CAAC,0BAA0B;IASlC,MAAM,CAAC,QAAQ,EAAE,MAAM;IAuBvB,cAAc,CAAC,OAAO,EAAE,4BAA4B;IAyBpD,2CAA2C,CACzC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,kBAAkB,EAAE,MAAM,EAC1B,eAAe,EAAE,MAAM;IAsCzB,yBAAyB,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,MAAM,KAAA;IAGpF,wBAAwB,CAAC,wBAAwB,EAAE,wBAAwB,EAAE,KAAK,EAAE,MAAM;IAI1F,oCAAoC,CAAC,aAAa,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM;IAYrF,qCAAqC,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAwB3E,oCAAoC,CAAC,aAAa,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAQzE,OAAO,CAAC,mCAAmC;IAU3C,wBAAwB;IAIxB,sBAAsB;IAMtB,oBAAoB,CAClB,iBAAiB,EAAE,MAAM,EACzB,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,MAAM,EACxB,iBAAiB,EAAE,MAAM,EACzB,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,MAAM;IAY9B,0BAA0B,CAAC,eAAe,EAAE,eAAe,EAAE,WAAW,EAAE,OAAO;IAUjF,mBAAmB;IAoHnB,6BAA6B,CAAC,KAAK,KAAA;IAiBnC,KAAK,IAAI,cAAc;IAOvB,WAAW;IAMX,MAAM,CAAC,sBAAsB,CAAC,IAAI,EAAE,IAAI;CAsCzC;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,OAAO,WAarD"}
@@ -661,8 +661,8 @@ function Pn(e) {
661
661
  }, reconcile: async (i, o, a) => {
662
662
  let u = 0, l = [];
663
663
  Object.keys(o.entries).forEach(function(m) {
664
- let d = o.entries[m], C = a.entries[m];
665
- (!C || n.isFile(d.mode) && d.timestamp.getTime() > C.timestamp.getTime()) && (l.push(m), u++);
664
+ let d = o.entries[m], v = a.entries[m];
665
+ (!v || n.isFile(d.mode) && d.timestamp.getTime() > v.timestamp.getTime()) && (l.push(m), u++);
666
666
  }), l.sort();
667
667
  let c = [];
668
668
  if (Object.keys(a.entries).forEach(function(m) {
@@ -672,11 +672,11 @@ function Pn(e) {
672
672
  for (let m of l) {
673
673
  let d = r.normalize(m.replace(i.mountpoint, "/")).substring(1);
674
674
  if (a.type === "local") {
675
- let C = p.get(d), S = await s.loadRemoteEntry(C);
675
+ let v = p.get(d), S = await s.loadRemoteEntry(v);
676
676
  s.storeLocalEntry(m, S);
677
677
  } else {
678
- let C = s.loadLocalEntry(m);
679
- await s.storeRemoteEntry(p, d, C);
678
+ let v = s.loadLocalEntry(m);
679
+ await s.storeRemoteEntry(p, d, v);
680
680
  }
681
681
  }
682
682
  for (let m of c) if (a.type === "local") s.removeLocalEntry(m);
@@ -1386,7 +1386,7 @@ function gi(e) {
1386
1386
  }
1387
1387
  function u(_) {
1388
1388
  if (r++, n.containerState._closeFlow) {
1389
- n.containerState._closeFlow = void 0, s && v();
1389
+ n.containerState._closeFlow = void 0, s && C();
1390
1390
  const U = n.events.length;
1391
1391
  let D = U, x;
1392
1392
  for (; D--; )
@@ -1412,7 +1412,7 @@ function gi(e) {
1412
1412
  if (!s)
1413
1413
  return m(_);
1414
1414
  if (s.currentConstruct && s.currentConstruct.concrete)
1415
- return C(_);
1415
+ return v(_);
1416
1416
  n.interrupt = !!(s.currentConstruct && !s._gfmTableDynamicInterruptHack);
1417
1417
  }
1418
1418
  return n.containerState = {}, e.check(
@@ -1422,24 +1422,24 @@ function gi(e) {
1422
1422
  )(_);
1423
1423
  }
1424
1424
  function c(_) {
1425
- return s && v(), z(r), m(_);
1425
+ return s && C(), z(r), m(_);
1426
1426
  }
1427
1427
  function p(_) {
1428
- return n.parser.lazy[n.now().line] = r !== t.length, o = n.now().offset, C(_);
1428
+ return n.parser.lazy[n.now().line] = r !== t.length, o = n.now().offset, v(_);
1429
1429
  }
1430
1430
  function m(_) {
1431
1431
  return n.containerState = {}, e.attempt(
1432
1432
  en,
1433
1433
  d,
1434
- C
1434
+ v
1435
1435
  )(_);
1436
1436
  }
1437
1437
  function d(_) {
1438
1438
  return r++, t.push([n.currentConstruct, n.containerState]), m(_);
1439
1439
  }
1440
- function C(_) {
1440
+ function v(_) {
1441
1441
  if (_ === null) {
1442
- s && v(), z(0), e.consume(_);
1442
+ s && C(), z(0), e.consume(_);
1443
1443
  return;
1444
1444
  }
1445
1445
  return s = s || n.parser.flow(n.now()), e.enter("chunkFlow", {
@@ -1495,7 +1495,7 @@ function gi(e) {
1495
1495
  }
1496
1496
  t.length = _;
1497
1497
  }
1498
- function v() {
1498
+ function C() {
1499
1499
  s.write([null]), i = void 0, s = void 0, n.containerState._closeFlow = void 0;
1500
1500
  }
1501
1501
  }
@@ -1635,8 +1635,8 @@ function ki(e, n, t) {
1635
1635
  }
1636
1636
  function m(d) {
1637
1637
  if ((d === 45 || de(d)) && r++ < 63) {
1638
- const C = d === 45 ? m : p;
1639
- return e.consume(d), C;
1638
+ const v = d === 45 ? m : p;
1639
+ return e.consume(d), v;
1640
1640
  }
1641
1641
  return t(d);
1642
1642
  }
@@ -1770,10 +1770,10 @@ function Ti(e, n, t) {
1770
1770
  function d(x) {
1771
1771
  return x === null || E(x) ? p(x) : (e.enter("codeFencedFenceMeta"), e.enter("chunkString", {
1772
1772
  contentType: "string"
1773
- }), C(x));
1773
+ }), v(x));
1774
1774
  }
1775
- function C(x) {
1776
- return x === null || E(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(x)) : x === 96 && x === a ? t(x) : (e.consume(x), C);
1775
+ function v(x) {
1776
+ return x === null || E(x) ? (e.exit("chunkString"), e.exit("codeFencedFenceMeta"), p(x)) : x === 96 && x === a ? t(x) : (e.consume(x), v);
1777
1777
  }
1778
1778
  function S(x) {
1779
1779
  return e.attempt(s, U, P)(x);
@@ -1784,16 +1784,16 @@ function Ti(e, n, t) {
1784
1784
  function z(x) {
1785
1785
  return i > 0 && F(x) ? R(
1786
1786
  e,
1787
- v,
1787
+ C,
1788
1788
  "linePrefix",
1789
1789
  i + 1
1790
- )(x) : v(x);
1790
+ )(x) : C(x);
1791
1791
  }
1792
- function v(x) {
1792
+ function C(x) {
1793
1793
  return x === null || E(x) ? e.check(rn, S, U)(x) : (e.enter("codeFlowValue"), _(x));
1794
1794
  }
1795
1795
  function _(x) {
1796
- return x === null || E(x) ? (e.exit("codeFlowValue"), v(x)) : (e.consume(x), _);
1796
+ return x === null || E(x) ? (e.exit("codeFlowValue"), C(x)) : (e.consume(x), _);
1797
1797
  }
1798
1798
  function U(x) {
1799
1799
  return e.exit("codeFenced"), n(x);
@@ -1935,7 +1935,7 @@ function Oi(e, n) {
1935
1935
  const t = e[n][1], r = e[n][2];
1936
1936
  let s = n - 1;
1937
1937
  const i = [], o = t._tokenizer || r.parser[t.contentType](t.start), a = o.events, u = [], l = {};
1938
- let c, p, m = -1, d = t, C = 0, S = 0;
1938
+ let c, p, m = -1, d = t, v = 0, S = 0;
1939
1939
  const P = [S];
1940
1940
  for (; d; ) {
1941
1941
  for (; e[++s][1] !== d; )
@@ -1946,11 +1946,11 @@ function Oi(e, n) {
1946
1946
  // Find a void token that includes a break.
1947
1947
  a[m][0] === "exit" && a[m - 1][0] === "enter" && a[m][1].type === a[m - 1][1].type && a[m][1].start.line !== a[m][1].end.line && (S = m + 1, P.push(S), d._tokenizer = void 0, d.previous = void 0, d = d.next);
1948
1948
  for (o.events = [], d ? (d._tokenizer = void 0, d.previous = void 0) : P.pop(), m = P.length; m--; ) {
1949
- const z = a.slice(P[m], P[m + 1]), v = i.pop();
1950
- u.unshift([v, v + z.length - 1]), me(e, v, 2, z);
1949
+ const z = a.slice(P[m], P[m + 1]), C = i.pop();
1950
+ u.unshift([C, C + z.length - 1]), me(e, C, 2, z);
1951
1951
  }
1952
1952
  for (m = -1; ++m < u.length; )
1953
- l[C + u[m][0]] = C + u[m][1], C += u[m][1] - u[m][0] - 1;
1953
+ l[v + u[m][0]] = v + u[m][1], v += u[m][1] - u[m][0] - 1;
1954
1954
  return l;
1955
1955
  }
1956
1956
  const Di = {
@@ -2016,9 +2016,9 @@ function rr(e, n, t, r, s, i, o, a, u) {
2016
2016
  }), d(z));
2017
2017
  }
2018
2018
  function d(z) {
2019
- return z === 62 ? (e.exit("chunkString"), e.exit(a), m(z)) : z === null || z === 60 || E(z) ? t(z) : (e.consume(z), z === 92 ? C : d);
2019
+ return z === 62 ? (e.exit("chunkString"), e.exit(a), m(z)) : z === null || z === 60 || E(z) ? t(z) : (e.consume(z), z === 92 ? v : d);
2020
2020
  }
2021
- function C(z) {
2021
+ function v(z) {
2022
2022
  return z === 60 || z === 62 || z === 92 ? (e.consume(z), d) : d(z);
2023
2023
  }
2024
2024
  function S(z) {
@@ -2316,14 +2316,14 @@ function rs(e, n, t) {
2316
2316
  return f === 33 ? (e.consume(f), m) : f === 47 ? (e.consume(f), i = !0, S) : f === 63 ? (e.consume(f), s = 3, r.interrupt ? n : h) : pe(f) ? (e.consume(f), o = String.fromCharCode(f), P) : t(f);
2317
2317
  }
2318
2318
  function m(f) {
2319
- return f === 45 ? (e.consume(f), s = 2, d) : f === 91 ? (e.consume(f), s = 5, a = 0, C) : pe(f) ? (e.consume(f), s = 4, r.interrupt ? n : h) : t(f);
2319
+ return f === 45 ? (e.consume(f), s = 2, d) : f === 91 ? (e.consume(f), s = 5, a = 0, v) : pe(f) ? (e.consume(f), s = 4, r.interrupt ? n : h) : t(f);
2320
2320
  }
2321
2321
  function d(f) {
2322
2322
  return f === 45 ? (e.consume(f), r.interrupt ? n : h) : t(f);
2323
2323
  }
2324
- function C(f) {
2324
+ function v(f) {
2325
2325
  const le = "CDATA[";
2326
- return f === le.charCodeAt(a++) ? (e.consume(f), a === le.length ? r.interrupt ? n : A : C) : t(f);
2326
+ return f === le.charCodeAt(a++) ? (e.consume(f), a === le.length ? r.interrupt ? n : A : v) : t(f);
2327
2327
  }
2328
2328
  function S(f) {
2329
2329
  return pe(f) ? (e.consume(f), o = String.fromCharCode(f), P) : t(f);
@@ -2331,15 +2331,15 @@ function rs(e, n, t) {
2331
2331
  function P(f) {
2332
2332
  if (f === null || f === 47 || f === 62 || Z(f)) {
2333
2333
  const le = f === 47, Te = o.toLowerCase();
2334
- return !le && !i && on.includes(Te) ? (s = 1, r.interrupt ? n(f) : A(f)) : Zi.includes(o.toLowerCase()) ? (s = 6, le ? (e.consume(f), z) : r.interrupt ? n(f) : A(f)) : (s = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(f) : i ? v(f) : _(f));
2334
+ return !le && !i && on.includes(Te) ? (s = 1, r.interrupt ? n(f) : A(f)) : Zi.includes(o.toLowerCase()) ? (s = 6, le ? (e.consume(f), z) : r.interrupt ? n(f) : A(f)) : (s = 7, r.interrupt && !r.parser.lazy[r.now().line] ? t(f) : i ? C(f) : _(f));
2335
2335
  }
2336
2336
  return f === 45 || de(f) ? (e.consume(f), o += String.fromCharCode(f), P) : t(f);
2337
2337
  }
2338
2338
  function z(f) {
2339
2339
  return f === 62 ? (e.consume(f), r.interrupt ? n : A) : t(f);
2340
2340
  }
2341
- function v(f) {
2342
- return F(f) ? (e.consume(f), v) : g(f);
2341
+ function C(f) {
2342
+ return F(f) ? (e.consume(f), C) : g(f);
2343
2343
  }
2344
2344
  function _(f) {
2345
2345
  return f === 47 ? (e.consume(f), g) : f === 58 || f === 95 || pe(f) ? (e.consume(f), U) : F(f) ? (e.consume(f), _) : g(f);
@@ -2445,7 +2445,7 @@ function as(e, n, t) {
2445
2445
  return h === 33 ? (e.consume(h), l) : h === 47 ? (e.consume(h), D) : h === 63 ? (e.consume(h), _) : pe(h) ? (e.consume(h), q) : t(h);
2446
2446
  }
2447
2447
  function l(h) {
2448
- return h === 45 ? (e.consume(h), c) : h === 91 ? (e.consume(h), i = 0, C) : pe(h) ? (e.consume(h), v) : t(h);
2448
+ return h === 45 ? (e.consume(h), c) : h === 91 ? (e.consume(h), i = 0, v) : pe(h) ? (e.consume(h), C) : t(h);
2449
2449
  }
2450
2450
  function c(h) {
2451
2451
  return h === 45 ? (e.consume(h), d) : t(h);
@@ -2459,9 +2459,9 @@ function as(e, n, t) {
2459
2459
  function d(h) {
2460
2460
  return h === 62 ? J(h) : h === 45 ? m(h) : p(h);
2461
2461
  }
2462
- function C(h) {
2462
+ function v(h) {
2463
2463
  const ae = "CDATA[";
2464
- return h === ae.charCodeAt(i++) ? (e.consume(h), i === ae.length ? S : C) : t(h);
2464
+ return h === ae.charCodeAt(i++) ? (e.consume(h), i === ae.length ? S : v) : t(h);
2465
2465
  }
2466
2466
  function S(h) {
2467
2467
  return h === null ? t(h) : h === 93 ? (e.consume(h), P) : E(h) ? (o = S, $(h)) : (e.consume(h), S);
@@ -2472,8 +2472,8 @@ function as(e, n, t) {
2472
2472
  function z(h) {
2473
2473
  return h === 62 ? J(h) : h === 93 ? (e.consume(h), z) : S(h);
2474
2474
  }
2475
- function v(h) {
2476
- return h === null || h === 62 ? J(h) : E(h) ? (o = v, $(h)) : (e.consume(h), v);
2475
+ function C(h) {
2476
+ return h === null || h === 62 ? J(h) : E(h) ? (o = C, $(h)) : (e.consume(h), C);
2477
2477
  }
2478
2478
  function _(h) {
2479
2479
  return h === null ? t(h) : h === 63 ? (e.consume(h), U) : E(h) ? (o = _, $(h)) : (e.consume(h), _);
@@ -2799,11 +2799,11 @@ function Ss(e, n, t) {
2799
2799
  let i = s && s[1].type === "linePrefix" ? s[2].sliceSerialize(s[1], !0).length : 0, o = 0;
2800
2800
  return a;
2801
2801
  function a(d) {
2802
- const C = r.containerState.type || (d === 42 || d === 43 || d === 45 ? "listUnordered" : "listOrdered");
2803
- if (C === "listUnordered" ? !r.containerState.marker || d === r.containerState.marker : _t(d)) {
2804
- if (r.containerState.type || (r.containerState.type = C, e.enter(C, {
2802
+ const v = r.containerState.type || (d === 42 || d === 43 || d === 45 ? "listUnordered" : "listOrdered");
2803
+ if (v === "listUnordered" ? !r.containerState.marker || d === r.containerState.marker : _t(d)) {
2804
+ if (r.containerState.type || (r.containerState.type = v, e.enter(v, {
2805
2805
  _container: !0
2806
- })), C === "listUnordered")
2806
+ })), v === "listUnordered")
2807
2807
  return e.enter("listItemPrefix"), d === 42 || d === 45 ? e.check(rt, t, l)(d) : l(d);
2808
2808
  if (!r.interrupt || d === 49)
2809
2809
  return e.enter("listItemPrefix"), e.enter("listItemValue"), u(d);
@@ -3080,7 +3080,7 @@ function Ds(e, n, t) {
3080
3080
  const s = {}, i = [];
3081
3081
  let o = [], a = [];
3082
3082
  const u = {
3083
- consume: v,
3083
+ consume: C,
3084
3084
  enter: _,
3085
3085
  exit: U,
3086
3086
  attempt: L(D),
@@ -3096,7 +3096,7 @@ function Ds(e, n, t) {
3096
3096
  parser: e,
3097
3097
  sliceStream: d,
3098
3098
  sliceSerialize: m,
3099
- now: C,
3099
+ now: v,
3100
3100
  defineSkip: S,
3101
3101
  write: p
3102
3102
  };
@@ -3111,7 +3111,7 @@ function Ds(e, n, t) {
3111
3111
  function d(T) {
3112
3112
  return Ps(o, T);
3113
3113
  }
3114
- function C() {
3114
+ function v() {
3115
3115
  const { line: T, column: A, offset: W, _index: H, _bufferIndex: O } = r;
3116
3116
  return {
3117
3117
  line: T,
@@ -3138,16 +3138,16 @@ function Ds(e, n, t) {
3138
3138
  function z(T) {
3139
3139
  c = c(T);
3140
3140
  }
3141
- function v(T) {
3141
+ function C(T) {
3142
3142
  E(T) ? (r.line++, r.column = 1, r.offset += T === -3 ? 2 : 1, g()) : T !== -1 && (r.column++, r.offset++), r._bufferIndex < 0 ? r._index++ : (r._bufferIndex++, r._bufferIndex === o[r._index].length && (r._bufferIndex = -1, r._index++)), l.previous = T;
3143
3143
  }
3144
3144
  function _(T, A) {
3145
3145
  const W = A || {};
3146
- return W.type = T, W.start = C(), l.events.push(["enter", W, l]), a.push(W), W;
3146
+ return W.type = T, W.start = v(), l.events.push(["enter", W, l]), a.push(W), W;
3147
3147
  }
3148
3148
  function U(T) {
3149
3149
  const A = a.pop();
3150
- return A.end = C(), l.events.push(["exit", A, l]), A;
3150
+ return A.end = v(), l.events.push(["exit", A, l]), A;
3151
3151
  }
3152
3152
  function D(T, A) {
3153
3153
  q(T, A.from);
@@ -3209,7 +3209,7 @@ function Ds(e, n, t) {
3209
3209
  ), T.resolveTo && (l.events = T.resolveTo(l.events, l));
3210
3210
  }
3211
3211
  function I() {
3212
- const T = C(), A = l.previous, W = l.currentConstruct, H = l.events.length, O = Array.from(a);
3212
+ const T = v(), A = l.previous, W = l.currentConstruct, H = l.events.length, O = Array.from(a);
3213
3213
  return {
3214
3214
  restore: J,
3215
3215
  from: H
@@ -3495,7 +3495,7 @@ function io(e) {
3495
3495
  codeFenced: u(P),
3496
3496
  codeFencedFence: S,
3497
3497
  codeFencedFenceInfo: d,
3498
- codeFencedFenceMeta: C,
3498
+ codeFencedFenceMeta: v,
3499
3499
  codeFlowValue: g,
3500
3500
  codeIndented: u(z),
3501
3501
  codeText: u(O),
@@ -3503,7 +3503,7 @@ function io(e) {
3503
3503
  data: g,
3504
3504
  definition: u(),
3505
3505
  definitionDestinationString: U,
3506
- definitionLabelString: v,
3506
+ definitionLabelString: C,
3507
3507
  definitionTitleString: _,
3508
3508
  emphasis: u(),
3509
3509
  hardBreakEscape: u(A),
@@ -3685,7 +3685,7 @@ function io(e) {
3685
3685
  const w = this.resume(), k = this.stack[this.stack.length - 1];
3686
3686
  k.lang = w;
3687
3687
  }
3688
- function C() {
3688
+ function v() {
3689
3689
  const w = this.resume(), k = this.stack[this.stack.length - 1];
3690
3690
  k.meta = w;
3691
3691
  }
@@ -3700,7 +3700,7 @@ function io(e) {
3700
3700
  const w = this.resume(), k = this.stack[this.stack.length - 1];
3701
3701
  k.value = w.replace(/(\r?\n|\r)$/g, "");
3702
3702
  }
3703
- function v(w) {
3703
+ function C(w) {
3704
3704
  const k = this.resume(), B = this.stack[this.stack.length - 1];
3705
3705
  B.label = k, B.identifier = We(this.sliceSerialize(w)).toLowerCase();
3706
3706
  }
@@ -4125,9 +4125,9 @@ function co(e, n, t) {
4125
4125
  return g === 92 || g === 124 ? (e.consume(g), p) : p(g);
4126
4126
  }
4127
4127
  function d(g) {
4128
- return r.interrupt = !1, r.parser.lazy[r.now().line] ? t(g) : (e.enter("tableDelimiterRow"), o = !1, F(g) ? R(e, C, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(g) : C(g));
4128
+ return r.interrupt = !1, r.parser.lazy[r.now().line] ? t(g) : (e.enter("tableDelimiterRow"), o = !1, F(g) ? R(e, v, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4)(g) : v(g));
4129
4129
  }
4130
- function C(g) {
4130
+ function v(g) {
4131
4131
  return g === 45 || g === 58 ? P(g) : g === 124 ? (o = !0, e.enter("tableCellDivider"), e.consume(g), e.exit("tableCellDivider"), S) : D(g);
4132
4132
  }
4133
4133
  function S(g) {
@@ -4137,16 +4137,16 @@ function co(e, n, t) {
4137
4137
  return g === 58 ? (i += 1, o = !0, e.enter("tableDelimiterMarker"), e.consume(g), e.exit("tableDelimiterMarker"), z) : g === 45 ? (i += 1, z(g)) : g === null || E(g) ? U(g) : D(g);
4138
4138
  }
4139
4139
  function z(g) {
4140
- return g === 45 ? (e.enter("tableDelimiterFiller"), v(g)) : D(g);
4140
+ return g === 45 ? (e.enter("tableDelimiterFiller"), C(g)) : D(g);
4141
4141
  }
4142
- function v(g) {
4143
- return g === 45 ? (e.consume(g), v) : g === 58 ? (o = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(g), e.exit("tableDelimiterMarker"), _) : (e.exit("tableDelimiterFiller"), _(g));
4142
+ function C(g) {
4143
+ return g === 45 ? (e.consume(g), C) : g === 58 ? (o = !0, e.exit("tableDelimiterFiller"), e.enter("tableDelimiterMarker"), e.consume(g), e.exit("tableDelimiterMarker"), _) : (e.exit("tableDelimiterFiller"), _(g));
4144
4144
  }
4145
4145
  function _(g) {
4146
4146
  return F(g) ? R(e, U, "whitespace")(g) : U(g);
4147
4147
  }
4148
4148
  function U(g) {
4149
- return g === 124 ? C(g) : g === null || E(g) ? !o || s !== i ? D(g) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(g)) : D(g);
4149
+ return g === 124 ? v(g) : g === null || E(g) ? !o || s !== i ? D(g) : (e.exit("tableDelimiterRow"), e.exit("tableHead"), n(g)) : D(g);
4150
4150
  }
4151
4151
  function D(g) {
4152
4152
  return t(g);
@@ -4168,18 +4168,18 @@ function ho(e, n) {
4168
4168
  let t = -1, r = !0, s = 0, i = [0, 0, 0, 0], o = [0, 0, 0, 0], a = !1, u = 0, l, c, p;
4169
4169
  const m = new oo();
4170
4170
  for (; ++t < e.length; ) {
4171
- const d = e[t], C = d[1];
4172
- d[0] === "enter" ? C.type === "tableHead" ? (a = !1, u !== 0 && (hn(m, n, u, l, c), c = void 0, u = 0), l = {
4171
+ const d = e[t], v = d[1];
4172
+ d[0] === "enter" ? v.type === "tableHead" ? (a = !1, u !== 0 && (hn(m, n, u, l, c), c = void 0, u = 0), l = {
4173
4173
  type: "table",
4174
- start: Object.assign({}, C.start),
4174
+ start: Object.assign({}, v.start),
4175
4175
  // Note: correct end is set later.
4176
- end: Object.assign({}, C.end)
4177
- }, m.add(t, 0, [["enter", l, n]])) : C.type === "tableRow" || C.type === "tableDelimiterRow" ? (r = !0, p = void 0, i = [0, 0, 0, 0], o = [0, t + 1, 0, 0], a && (a = !1, c = {
4176
+ end: Object.assign({}, v.end)
4177
+ }, m.add(t, 0, [["enter", l, n]])) : v.type === "tableRow" || v.type === "tableDelimiterRow" ? (r = !0, p = void 0, i = [0, 0, 0, 0], o = [0, t + 1, 0, 0], a && (a = !1, c = {
4178
4178
  type: "tableBody",
4179
- start: Object.assign({}, C.start),
4179
+ start: Object.assign({}, v.start),
4180
4180
  // Note: correct end is set later.
4181
- end: Object.assign({}, C.end)
4182
- }, m.add(t, 0, [["enter", c, n]])), s = C.type === "tableDelimiterRow" ? 2 : c ? 3 : 1) : s && (C.type === "data" || C.type === "tableDelimiterMarker" || C.type === "tableDelimiterFiller") ? (r = !1, o[2] === 0 && (i[1] !== 0 && (o[0] = o[1], p = tt(m, n, i, s, void 0, p), i = [0, 0, 0, 0]), o[2] = t)) : C.type === "tableCellDivider" && (r ? r = !1 : (i[1] !== 0 && (o[0] = o[1], p = tt(m, n, i, s, void 0, p)), i = o, o = [i[1], t, 0, 0])) : C.type === "tableHead" ? (a = !0, u = t) : C.type === "tableRow" || C.type === "tableDelimiterRow" ? (u = t, i[1] !== 0 ? (o[0] = o[1], p = tt(m, n, i, s, t, p)) : o[1] !== 0 && (p = tt(m, n, o, s, t, p)), s = 0) : s && (C.type === "data" || C.type === "tableDelimiterMarker" || C.type === "tableDelimiterFiller") && (o[3] = t);
4181
+ end: Object.assign({}, v.end)
4182
+ }, m.add(t, 0, [["enter", c, n]])), s = v.type === "tableDelimiterRow" ? 2 : c ? 3 : 1) : s && (v.type === "data" || v.type === "tableDelimiterMarker" || v.type === "tableDelimiterFiller") ? (r = !1, o[2] === 0 && (i[1] !== 0 && (o[0] = o[1], p = tt(m, n, i, s, void 0, p), i = [0, 0, 0, 0]), o[2] = t)) : v.type === "tableCellDivider" && (r ? r = !1 : (i[1] !== 0 && (o[0] = o[1], p = tt(m, n, i, s, void 0, p)), i = o, o = [i[1], t, 0, 0])) : v.type === "tableHead" ? (a = !0, u = t) : v.type === "tableRow" || v.type === "tableDelimiterRow" ? (u = t, i[1] !== 0 ? (o[0] = o[1], p = tt(m, n, i, s, t, p)) : o[1] !== 0 && (p = tt(m, n, o, s, t, p)), s = 0) : s && (v.type === "data" || v.type === "tableDelimiterMarker" || v.type === "tableDelimiterFiller") && (o[3] = t);
4183
4183
  }
4184
4184
  for (u !== 0 && hn(m, n, u, l, c), m.consume(n.events), t = -1; ++t < n.events.length; ) {
4185
4185
  const d = n.events[t];
@@ -4205,8 +4205,8 @@ function tt(e, n, t, r, s, i) {
4205
4205
  if (e.add(t[2], 0, [["enter", p, n]]), r !== 2) {
4206
4206
  const m = n.events[t[2]], d = n.events[t[3]];
4207
4207
  if (m[1].end = Object.assign({}, d[1].end), m[1].type = "chunkText", m[1].contentType = "text", t[3] > t[2] + 1) {
4208
- const C = t[2] + 1, S = t[3] - t[2] - 1;
4209
- e.add(C, S, []);
4208
+ const v = t[2] + 1, S = t[3] - t[2] - 1;
4209
+ e.add(v, S, []);
4210
4210
  }
4211
4211
  }
4212
4212
  e.add(t[3] + 1, 0, [["exit", p, n]]);
@@ -4349,52 +4349,52 @@ function vo(e, n, t) {
4349
4349
  const r = this, s = r.events[r.events.length - 1], i = s && s[1].type === "linePrefix" ? s[2].sliceSerialize(s[1], !0).length : 0;
4350
4350
  let o = 0;
4351
4351
  return a;
4352
- function a(v) {
4353
- return e.enter("mathFlow"), e.enter("mathFlowFence"), e.enter("mathFlowFenceSequence"), u(v);
4352
+ function a(C) {
4353
+ return e.enter("mathFlow"), e.enter("mathFlowFence"), e.enter("mathFlowFenceSequence"), u(C);
4354
4354
  }
4355
- function u(v) {
4356
- return v === 36 ? (e.consume(v), o++, u) : o < 2 ? t(v) : (e.exit("mathFlowFenceSequence"), R(e, l, "whitespace")(v));
4355
+ function u(C) {
4356
+ return C === 36 ? (e.consume(C), o++, u) : o < 2 ? t(C) : (e.exit("mathFlowFenceSequence"), R(e, l, "whitespace")(C));
4357
4357
  }
4358
- function l(v) {
4359
- return v === null || E(v) ? p(v) : (e.enter("mathFlowFenceMeta"), e.enter("chunkString", {
4358
+ function l(C) {
4359
+ return C === null || E(C) ? p(C) : (e.enter("mathFlowFenceMeta"), e.enter("chunkString", {
4360
4360
  contentType: "string"
4361
- }), c(v));
4361
+ }), c(C));
4362
4362
  }
4363
- function c(v) {
4364
- return v === null || E(v) ? (e.exit("chunkString"), e.exit("mathFlowFenceMeta"), p(v)) : v === 36 ? t(v) : (e.consume(v), c);
4363
+ function c(C) {
4364
+ return C === null || E(C) ? (e.exit("chunkString"), e.exit("mathFlowFenceMeta"), p(C)) : C === 36 ? t(C) : (e.consume(C), c);
4365
4365
  }
4366
- function p(v) {
4367
- return e.exit("mathFlowFence"), r.interrupt ? n(v) : e.attempt(mn, m, P)(v);
4366
+ function p(C) {
4367
+ return e.exit("mathFlowFence"), r.interrupt ? n(C) : e.attempt(mn, m, P)(C);
4368
4368
  }
4369
- function m(v) {
4369
+ function m(C) {
4370
4370
  return e.attempt({
4371
4371
  tokenize: z,
4372
4372
  partial: !0
4373
- }, P, d)(v);
4373
+ }, P, d)(C);
4374
4374
  }
4375
- function d(v) {
4376
- return (i ? R(e, C, "linePrefix", i + 1) : C)(v);
4375
+ function d(C) {
4376
+ return (i ? R(e, v, "linePrefix", i + 1) : v)(C);
4377
4377
  }
4378
- function C(v) {
4379
- return v === null ? P(v) : E(v) ? e.attempt(mn, m, P)(v) : (e.enter("mathFlowValue"), S(v));
4378
+ function v(C) {
4379
+ return C === null ? P(C) : E(C) ? e.attempt(mn, m, P)(C) : (e.enter("mathFlowValue"), S(C));
4380
4380
  }
4381
- function S(v) {
4382
- return v === null || E(v) ? (e.exit("mathFlowValue"), C(v)) : (e.consume(v), S);
4381
+ function S(C) {
4382
+ return C === null || E(C) ? (e.exit("mathFlowValue"), v(C)) : (e.consume(C), S);
4383
4383
  }
4384
- function P(v) {
4385
- return e.exit("mathFlow"), n(v);
4384
+ function P(C) {
4385
+ return e.exit("mathFlow"), n(C);
4386
4386
  }
4387
- function z(v, _, U) {
4387
+ function z(C, _, U) {
4388
4388
  let D = 0;
4389
- return R(v, x, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
4389
+ return R(C, x, "linePrefix", r.parser.constructs.disable.null.includes("codeIndented") ? void 0 : 4);
4390
4390
  function x(I) {
4391
- return v.enter("mathFlowFence"), v.enter("mathFlowFenceSequence"), L(I);
4391
+ return C.enter("mathFlowFence"), C.enter("mathFlowFenceSequence"), L(I);
4392
4392
  }
4393
4393
  function L(I) {
4394
- return I === 36 ? (D++, v.consume(I), L) : D < o ? U(I) : (v.exit("mathFlowFenceSequence"), R(v, q, "whitespace")(I));
4394
+ return I === 36 ? (D++, C.consume(I), L) : D < o ? U(I) : (C.exit("mathFlowFenceSequence"), R(C, q, "whitespace")(I));
4395
4395
  }
4396
4396
  function q(I) {
4397
- return I === null || E(I) ? (v.exit("mathFlowFence"), _(I)) : U(I);
4397
+ return I === null || E(I) ? (C.exit("mathFlowFence"), _(I)) : U(I);
4398
4398
  }
4399
4399
  }
4400
4400
  }
@@ -4426,13 +4426,13 @@ function So(e) {
4426
4426
  return S === 36 ? (s.consume(S), a++, p) : a < 2 && !t ? o(S) : (s.exit("mathTextSequence"), m(S));
4427
4427
  }
4428
4428
  function m(S) {
4429
- return S === null ? o(S) : S === 36 ? (l = s.enter("mathTextSequence"), u = 0, C(S)) : S === 32 ? (s.enter("space"), s.consume(S), s.exit("space"), m) : E(S) ? (s.enter("lineEnding"), s.consume(S), s.exit("lineEnding"), m) : (s.enter("mathTextData"), d(S));
4429
+ return S === null ? o(S) : S === 36 ? (l = s.enter("mathTextSequence"), u = 0, v(S)) : S === 32 ? (s.enter("space"), s.consume(S), s.exit("space"), m) : E(S) ? (s.enter("lineEnding"), s.consume(S), s.exit("lineEnding"), m) : (s.enter("mathTextData"), d(S));
4430
4430
  }
4431
4431
  function d(S) {
4432
4432
  return S === null || S === 32 || S === 36 || E(S) ? (s.exit("mathTextData"), m(S)) : (s.consume(S), d);
4433
4433
  }
4434
- function C(S) {
4435
- return S === 36 ? (s.consume(S), u++, C) : u === a ? (s.exit("mathTextSequence"), s.exit("mathText"), i(S)) : (l.type = "mathTextData", d(S));
4434
+ function v(S) {
4435
+ return S === 36 ? (s.consume(S), u++, v) : u === a ? (s.exit("mathTextSequence"), s.exit("mathText"), i(S)) : (l.type = "mathTextData", d(S));
4436
4436
  }
4437
4437
  }
4438
4438
  }
@@ -5522,11 +5522,6 @@ class mr {
5522
5522
  get chat() {
5523
5523
  return this.conversation.chat;
5524
5524
  }
5525
- ensureStyles() {
5526
- if (document.getElementById("FeedBackDialog")) return;
5527
- const n = document.createElement("style");
5528
- n.id = "FeedBackDialog", n.textContent = Yo, document.head.appendChild(n);
5529
- }
5530
5525
  ensureCurrentMessageBlockNode() {
5531
5526
  if (!this._currentMessageBlockNode && (this._rightColumnNode.appendChild(
5532
5527
  this._toolCallInfoNode = /* @__PURE__ */ b("div", { class: "prose prose-neutral prose-sm max-w-none" })
@@ -5646,30 +5641,30 @@ class mr {
5646
5641
  delete this._subConversations[n.id], !t && !Object.keys(this._subConversations).length && !Object.keys(this._clientFunctionInvocationsByLlmFunctionId).length && this.ensureCurrentMessageBlockNode();
5647
5642
  }
5648
5643
  onOpcodeEndReceived() {
5649
- this.removePulseNodeIfItIsThere(), this._toolCallBuilder.clear(), this._clientFunctionInvocationsByLlmFunctionId = {}, this._subConversations = {}, this.ensureStyles();
5644
+ this.removePulseNodeIfItIsThere(), this._toolCallBuilder.clear(), this._clientFunctionInvocationsByLlmFunctionId = {}, this._subConversations = {};
5650
5645
  const n = this.conversation.chat.feedbackByMessageId.get(this.messageId);
5651
5646
  n != null ? this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link-feedback p-1" }, /* @__PURE__ */ b(n ? kt : zt, null))) : this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link-feedback p-1", onclick: () => {
5652
5647
  this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !0), this._feedbackNode.replaceWith(
5653
5648
  this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link-feedback p-1" }, /* @__PURE__ */ b(kt, null)))
5654
5649
  );
5655
5650
  } }, /* @__PURE__ */ b(kt, null)), /* @__PURE__ */ b("a", { class: "btn btn-link-feedback p-1", onclick: () => {
5656
- const t = /* @__PURE__ */ b("div", { class: "dialog-overlay" }, /* @__PURE__ */ b("div", { role: "dialog", class: "dialog-content w-[600px] gap-5-feedback" }, /* @__PURE__ */ b("button", { onclick: () => t.remove(), class: "dialog-close-button" }, /* @__PURE__ */ b(Zo, { size: "22" })), /* @__PURE__ */ b("div", { class: "dialog-header" }, /* @__PURE__ */ b("label", { class: "text-label-md pl-7-feedback" }, "Tell us more")), /* @__PURE__ */ b("div", { class: "dialog-body flex flex-col gap-5-feedback" }, /* @__PURE__ */ b("div", { class: "text-label-sm pl-7-feedback" }, this._suggestionTextList.map((s, i) => /* @__PURE__ */ b("span", { class: "feedback-suggestion-text", onclick: (o) => {
5657
- const a = this;
5658
- this._suggestionTextList.filter((c, p) => p !== i && c.isActive).forEach((c) => c.isActive = !1), t.querySelectorAll(".feedback-suggestion-text").forEach((c) => c.classList.toggle("feedback-suggestion-text-active", !1)), s.isActive = !s.isActive, o.currentTarget.classList.toggle("feedback-suggestion-text-active", s.isActive), r.call(a);
5659
- } }, s.text))), /* @__PURE__ */ b("textarea", { placeholder: "Add special details (optional)", class: "feedback-comment-text" }), /* @__PURE__ */ b("div", { class: "footer-note" }, /* @__PURE__ */ b("a", { href: "https://id.veracity.com/terms-of-use", target: "_blank", rel: "noopener noreferrer" }, "Learn more"), " about how this data is used and your rights. By pressing Submit, your conversation will be used to improve Veracity products and services. ", /* @__PURE__ */ b("a", { href: "https://services.veracity.com/PrivacyStatement", target: "_blank", rel: "noopener noreferrer" }, "Privacy statement."))), /* @__PURE__ */ b("div", { class: "dialog-footer flex justify-end gap-2-feedback" }, /* @__PURE__ */ b(
5651
+ const t = /* @__PURE__ */ b("div", { class: "dialog-overlay" }, /* @__PURE__ */ b("div", { role: "dialog", class: "dialog-content w-[600px] gap-5-feedback" }, /* @__PURE__ */ b("button", { onclick: () => t.remove(), class: "dialog-close-button" }, /* @__PURE__ */ b(Zo, { size: "22" })), /* @__PURE__ */ b("div", { class: "dialog-header" }, /* @__PURE__ */ b("label", { class: "text-label-md pl-7-feedback" }, "Tell us more")), /* @__PURE__ */ b("div", { class: "dialog-body flex flex-col gap-5-feedback" }, /* @__PURE__ */ b("div", { class: "text-label-sm pl-7-feedback" }, this._suggestionTextList.map((a, u) => /* @__PURE__ */ b("span", { class: "feedback-suggestion-text", onclick: (l) => {
5652
+ const c = this;
5653
+ this._suggestionTextList.filter((d, v) => v !== u && d.isActive).forEach((d) => d.isActive = !1), t.querySelectorAll(".feedback-suggestion-text").forEach((d) => d.classList.toggle("feedback-suggestion-text-active", !1)), a.isActive = !a.isActive, l.currentTarget.classList.toggle("feedback-suggestion-text-active", a.isActive), r.call(c);
5654
+ } }, a.text))), /* @__PURE__ */ b("textarea", { placeholder: "Add special details (optional)", class: "feedback-comment-text" }), /* @__PURE__ */ b("div", { class: "footer-note" }, /* @__PURE__ */ b("a", { href: "https://id.veracity.com/terms-of-use", target: "_blank", rel: "noopener noreferrer" }, "Learn more"), " about how this data is used and your rights. By pressing Submit, your conversation will be used to improve Veracity products and services. ", /* @__PURE__ */ b("a", { href: "https://services.veracity.com/PrivacyStatement", target: "_blank", rel: "noopener noreferrer" }, "Privacy statement."))), /* @__PURE__ */ b("div", { class: "dialog-footer flex justify-end gap-2-feedback" }, /* @__PURE__ */ b(
5660
5655
  "button",
5661
5656
  {
5662
5657
  id: "submit-btn",
5663
5658
  class: "btn-base-feedback btn-primary-feedback btn-lg-feedback",
5664
5659
  disabled: !0,
5665
5660
  onclick: () => {
5666
- let s = "";
5667
- this._suggestionTextList.map((a, u) => {
5668
- a.isActive && (s = a.text);
5661
+ let a = "";
5662
+ this._suggestionTextList.map((c, p) => {
5663
+ c.isActive && (a = c.text);
5669
5664
  });
5670
- let i = "";
5671
- const o = t.querySelector(".feedback-comment-text").value;
5672
- o !== "" && (i = o), this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !1, s, i), t.remove(), this._feedbackNode.replaceWith(
5665
+ let u = "";
5666
+ const l = t.querySelector(".feedback-comment-text").value;
5667
+ l !== "" && (u = l), this.conversation.chat.setLikeAsync(this.messageId, this.copilitId, !1, a, u), t.remove(), this._feedbackNode.replaceWith(
5673
5668
  this._feedbackNode = /* @__PURE__ */ b("div", { class: "flex" }, /* @__PURE__ */ b("a", { class: "btn btn-link-feedback p-1" }, /* @__PURE__ */ b(zt, null)))
5674
5669
  );
5675
5670
  }
@@ -5677,13 +5672,15 @@ class mr {
5677
5672
  "Submit"
5678
5673
  ))));
5679
5674
  function r() {
5680
- const s = t.querySelector("#submit-btn");
5681
- if (s) {
5682
- const i = this._suggestionTextList.some((o) => o.isActive);
5683
- s.disabled = !i;
5675
+ const a = t.querySelector("#submit-btn");
5676
+ if (a) {
5677
+ const u = this._suggestionTextList.some((l) => l.isActive);
5678
+ a.disabled = !u;
5684
5679
  }
5685
5680
  }
5686
- r.call(this), document.body.appendChild(t);
5681
+ r.call(this);
5682
+ const s = document.createElement("div"), i = s.attachShadow({ mode: "open" }), o = document.createElement("style");
5683
+ o.textContent = Yo, i.appendChild(o), i.appendChild(t), document.body.appendChild(s);
5687
5684
  } }, /* @__PURE__ */ b(zt, null))), this._rightColumnNode.appendChild(this._feedbackNode);
5688
5685
  }
5689
5686
  onErrorWhileReadingBodyStream(n) {
@@ -5852,7 +5849,7 @@ class gr {
5852
5849
  this._opcodeConversationEndReceived = !0, (n = this.activeMessage) == null || n.onOpcodeEndReceived();
5853
5850
  }
5854
5851
  onOpcodeConversationErrorReceived(n, t) {
5855
- this._opcodeConversationErrorReceived = !0, n && console.debug(n, t), this.displayError("Error", "An undisclosed error occurred. Please contact Veracity Support.");
5852
+ this._opcodeConversationErrorReceived = !0, n ? this.displayError("Error", n) : this.displayError("Error", "An undisclosed error occurred. Please contact Veracity Support.");
5856
5853
  }
5857
5854
  onErrorBeforeReadingBodyStreamStarted(n, t) {
5858
5855
  if (t) {
@@ -5972,9 +5969,8 @@ class kn extends gr {
5972
5969
  }
5973
5970
  onOpcodeConversationErrorReceived(t, r) {
5974
5971
  var o;
5975
- t && console.debug(t, r);
5976
- const s = "An undisclosed error occurred. Please contact Veracity Support.";
5977
- this.displayError("Error", s);
5972
+ let s = "An undisclosed error occurred. Please contact Veracity Support.";
5973
+ t && (s = t), this.displayError("Error", s);
5978
5974
  const i = new Error(s);
5979
5975
  (o = this.activeMessage) == null || o.onErrorWhileReadingBodyStream(i), this.setButtonError(), this.parentMessage.notifySubConversationEnded(this, !1);
5980
5976
  }
@@ -267,7 +267,7 @@ 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}const cd=".dialog-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;font-family:Gantari,sans-serif}.dialog-content{background:#fff;box-shadow:0 4px 20px #00000026;position:relative;max-width:600px;width:90%;max-height:90vh;overflow-y:auto}.dialog-close-button{position:absolute;top:16px;right:16px;background:transparent;border:none;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:background .1s ease-out;color:#2248aa}.dialog-close-button:hover{background:#f0f0f0}.dialog-header{padding:24px 24px 0;border-bottom:none}.dialog-body{padding:0 24px;display:flex;flex-direction:column;gap:20px}.dialog-footer{padding:0 24px 24px;border-top:none}.text-label-md{font-size:var(--text-lg, 1.5rem);font-weight:var(--font-weight-semibold, 600);color:#08122b;margin:0}.text-label-sm{font-size:var(--text-sm, .875rem);font-weight:var(--font-weight-normal, 400);color:#08122b;line-height:1.5}.feedback-suggestion-text{display:inline-block;padding:8px 16px;margin:4px 8px 4px 0;background:#d3eef8;border-radius:6px;cursor:pointer;transition:all .1s ease-out;font-size:var(--text-sm, .875rem);letter-spacing:.05rem;color:#2248aa}.feedback-suggestion-text:hover:not(.feedback-suggestion-text-active){background:#bce6f5;border-color:#17789b}.feedback-suggestion-text-active{background:#001333;color:#fff;border-color:#001333}.feedback-comment-text{width:100%;min-height:100px;padding:8px;border:2px solid hsl(40,3%,79%);font-family:Gantari,sans-serif;font-size:var(--text-sm, 1rem);font-weight:var(--font-weight-normal, 400);letter-spacing:.05rem;resize:none;box-sizing:border-box;transition:border-color .1s ease-out}.feedback-comment-text:focus{outline:none;border:4px solid hsl(218,100%,50%);box-shadow:0 0 0 2px #1e6ea71a}.feedback-comment-text::-moz-placeholder{color:#b5b3b0}.feedback-comment-text::placeholder{color:#b5b3b0}.btn-base-feedback{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:0;display:inline-flex;height:auto;margin:0;outline:none;text-decoration:none;transition:background .1s ease-out,border-color .1s ease-out,color .1s ease-out,box-shadow .1s ease-out;white-space:nowrap;cursor:pointer;font-family:Gantari,sans-serif;font-size:var(--text-sm, .875rem);font-weight:var(--font-weight-medium, 500);justify-content:center}.btn-primary-feedback{background:#193680;color:#fff;border:1px solid hsl(223,67%,30%)}.btn-primary-feedback:disabled{background:#95adea;color:#fff;border-color:#0000;cursor:not-allowed;opacity:.5}.btn-primary-feedback:hover,.btn-primary-feedback:active{background:#002566}.btn-primary-feedback:disabled:hover{background:#95adea;color:#fff;border-color:#0000}.btn-lg-feedback{padding:10px 20px;min-width:100px;font-size:16px;letter-spacing:.05rem;height:50px}.flex{display:flex}.flex-col{flex-direction:column}.justify-end{justify-content:flex-end}.gap-2-feedback{gap:8px;padding-top:40px}.gap-5-feedback{gap:20px}.w-\\[600px\\]{width:600px}.pl-7-feedback{padding-top:28px}.footer-note{font-size:12px;color:#6c757d;line-height:1.5;margin:0;padding:0;text-align:left;font-weight:400;font-family:Gantari,sans-serif;letter-spacing:.02rem}.footer-note a{color:#6c757d;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;font-weight:500;transition:color .1s ease-out}.footer-note a:hover{color:#6c757d;text-decoration-thickness:2px}@media (prefers-color-scheme: dark){.dialog-content{background:#0f214d;color:#fff}.text-label-md,.text-label-sm{color:#fff}.dialog-close-button:hover{background:#152d6a}.feedback-suggestion-text{background:#0d1b40;border-color:#0d1b40;color:#e0e0e0}.feedback-suggestion-text:hover:not(.feedback-suggestion-text-active){background:#1d3f95;border-color:#8fffb2}.feedback-suggestion-text-active{background:#2651c0;color:#00e649;border-color:#8fffb2}.feedback-comment-text{background:#2d2d2d;border-color:#404040;color:#fff}.feedback-comment-text:focus{border-color:#009930;box-shadow:0 0 0 2px #4caf501a}.feedback-comment-text::-moz-placeholder{color:#b5b3b0}.feedback-comment-text::placeholder{color:#b5b3b0}.btn-primary-feedback{background:#8fffb2;color:#0f214d;border-color:#8fffb2}.btn-primary-feedback:disabled{background:#dcf2d9;color:#d4def7;border-color:#dcf2d9}.btn-primary-feedback:disabled:hover{background:#00cc41;color:#0d1b40;border-color:#00cc41}.btn-primary-feedback:hover{background:#00cc41}.btn-link-feedback{color:#009930}.btn-link-feedback:hover{background:#1e6ea740}.footer-note{color:#8d8d8d}.footer-note a{color:#8fffb2;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.footer-note a:hover{color:#00cc41;text-decoration-thickness:2px}}.dialog-close-button:focus-visible,.btn-base-feedback:focus-visible,.btn-link-feedback:focus-visible{box-shadow:0 0 0 2px #8bc8f0}.btn-base-feedback:disabled{opacity:.5;cursor:not-allowed}";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}ensureStyles(){if(document.getElementById("FeedBackDialog"))return;const e=document.createElement("style");e.id="FeedBackDialog",e.textContent=cd,document.head.appendChild(e)}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]"),hd(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&&r.length>0&&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={},this.ensureStyles();const e=this.conversation.chat.feedbackByMessageId.get(this.messageId);e!=null?this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link-feedback p-1"},_(e?Sa:za,null))):this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link-feedback 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-feedback p-1"},_(Sa,null))))}},_(Sa,null)),_("a",{class:"btn btn-link-feedback p-1",onclick:()=>{const r=_("div",{class:"dialog-overlay"},_("div",{role:"dialog",class:"dialog-content w-[600px] gap-5-feedback"},_("button",{onclick:()=>r.remove(),class:"dialog-close-button"},_(ud,{size:"22"})),_("div",{class:"dialog-header"},_("label",{class:"text-label-md pl-7-feedback"},"Tell us more")),_("div",{class:"dialog-body flex flex-col gap-5-feedback"},_("div",{class:"text-label-sm pl-7-feedback"},this._suggestionTextList.map((i,a)=>_("span",{class:"feedback-suggestion-text",onclick:s=>{const o=this;this._suggestionTextList.filter((d,p)=>p!==a&&d.isActive).forEach(d=>d.isActive=!1),r.querySelectorAll(".feedback-suggestion-text").forEach(d=>d.classList.toggle("feedback-suggestion-text-active",!1)),i.isActive=!i.isActive,s.currentTarget.classList.toggle("feedback-suggestion-text-active",i.isActive),n.call(o)}},i.text))),_("textarea",{placeholder:"Add special details (optional)",class:"feedback-comment-text"}),_("div",{class:"footer-note"},_("a",{href:"https://id.veracity.com/terms-of-use",target:"_blank",rel:"noopener noreferrer"},"Learn more")," about how this data is used and your rights. By pressing Submit, your conversation will be used to improve Veracity products and services. ",_("a",{href:"https://services.veracity.com/PrivacyStatement",target:"_blank",rel:"noopener noreferrer"},"Privacy statement."))),_("div",{class:"dialog-footer flex justify-end gap-2-feedback"},_("button",{id:"submit-btn",class:"btn-base-feedback btn-primary-feedback btn-lg-feedback",disabled:!0,onclick:()=>{let i="";this._suggestionTextList.map((o,u)=>{o.isActive&&(i=o.text)});let a="";const s=r.querySelector(".feedback-comment-text").value;s!==""&&(a=s),this.conversation.chat.setLikeAsync(this.messageId,this.copilitId,!1,i,a),r.remove(),this._feedbackNode.replaceWith(this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link-feedback p-1"},_(za,null))))}},"Submit"))));function n(){const i=r.querySelector("#submit-btn");if(i){const a=this._suggestionTextList.some(s=>s.isActive);i.disabled=!a}}n.call(this),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 hd(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 dd{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}const cd=".dialog-overlay{position:fixed;top:0;left:0;width:100%;height:100%;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:10000;font-family:Gantari,sans-serif}.dialog-content{background:#fff;box-shadow:0 4px 20px #00000026;position:relative;max-width:600px;width:90%;max-height:90vh;overflow-y:auto}.dialog-close-button{position:absolute;top:16px;right:16px;background:transparent;border:none;cursor:pointer;padding:4px;border-radius:4px;display:flex;align-items:center;justify-content:center;transition:background .1s ease-out;color:#2248aa}.dialog-close-button:hover{background:#f0f0f0}.dialog-header{padding:24px 24px 0;border-bottom:none}.dialog-body{padding:0 24px;display:flex;flex-direction:column;gap:20px}.dialog-footer{padding:0 24px 24px;border-top:none}.text-label-md{font-size:var(--text-lg, 1.5rem);font-weight:var(--font-weight-semibold, 600);color:#08122b;margin:0}.text-label-sm{font-size:var(--text-sm, .875rem);font-weight:var(--font-weight-normal, 400);color:#08122b;line-height:1.5}.feedback-suggestion-text{display:inline-block;padding:8px 16px;margin:4px 8px 4px 0;background:#d3eef8;border-radius:6px;cursor:pointer;transition:all .1s ease-out;font-size:var(--text-sm, .875rem);letter-spacing:.05rem;color:#2248aa}.feedback-suggestion-text:hover:not(.feedback-suggestion-text-active){background:#bce6f5;border-color:#17789b}.feedback-suggestion-text-active{background:#001333;color:#fff;border-color:#001333}.feedback-comment-text{width:100%;min-height:100px;padding:8px;border:2px solid hsl(40,3%,79%);font-family:Gantari,sans-serif;font-size:var(--text-sm, 1rem);font-weight:var(--font-weight-normal, 400);letter-spacing:.05rem;resize:none;box-sizing:border-box;transition:border-color .1s ease-out}.feedback-comment-text:focus{outline:none;border:4px solid hsl(218,100%,50%);box-shadow:0 0 0 2px #1e6ea71a}.feedback-comment-text::-moz-placeholder{color:#b5b3b0}.feedback-comment-text::placeholder{color:#b5b3b0}.btn-base-feedback{align-items:center;-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;border-radius:0;display:inline-flex;height:auto;margin:0;outline:none;text-decoration:none;transition:background .1s ease-out,border-color .1s ease-out,color .1s ease-out,box-shadow .1s ease-out;white-space:nowrap;cursor:pointer;font-family:Gantari,sans-serif;font-size:var(--text-sm, .875rem);font-weight:var(--font-weight-medium, 500);justify-content:center}.btn-primary-feedback{background:#193680;color:#fff;border:1px solid hsl(223,67%,30%)}.btn-primary-feedback:disabled{background:#95adea;color:#fff;border-color:#0000;cursor:not-allowed;opacity:.5}.btn-primary-feedback:hover,.btn-primary-feedback:active{background:#002566}.btn-primary-feedback:disabled:hover{background:#95adea;color:#fff;border-color:#0000}.btn-lg-feedback{padding:10px 20px;min-width:100px;font-size:16px;letter-spacing:.05rem;height:50px}.flex{display:flex}.flex-col{flex-direction:column}.justify-end{justify-content:flex-end}.gap-2-feedback{gap:8px;padding-top:40px}.gap-5-feedback{gap:20px}.w-\\[600px\\]{width:600px}.pl-7-feedback{padding-top:28px}.footer-note{font-size:12px;color:#6c757d;line-height:1.5;margin:0;padding:0;text-align:left;font-weight:400;font-family:Gantari,sans-serif;letter-spacing:.02rem}.footer-note a{color:#6c757d;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px;font-weight:500;transition:color .1s ease-out}.footer-note a:hover{color:#6c757d;text-decoration-thickness:2px}@media (prefers-color-scheme: dark){.dialog-content{background:#0f214d;color:#fff}.text-label-md,.text-label-sm{color:#fff}.dialog-close-button:hover{background:#152d6a}.feedback-suggestion-text{background:#0d1b40;border-color:#0d1b40;color:#e0e0e0}.feedback-suggestion-text:hover:not(.feedback-suggestion-text-active){background:#1d3f95;border-color:#8fffb2}.feedback-suggestion-text-active{background:#2651c0;color:#00e649;border-color:#8fffb2}.feedback-comment-text{background:#2d2d2d;border-color:#404040;color:#fff}.feedback-comment-text:focus{border-color:#009930;box-shadow:0 0 0 2px #4caf501a}.feedback-comment-text::-moz-placeholder{color:#b5b3b0}.feedback-comment-text::placeholder{color:#b5b3b0}.btn-primary-feedback{background:#8fffb2;color:#0f214d;border-color:#8fffb2}.btn-primary-feedback:disabled{background:#dcf2d9;color:#d4def7;border-color:#dcf2d9}.btn-primary-feedback:disabled:hover{background:#00cc41;color:#0d1b40;border-color:#00cc41}.btn-primary-feedback:hover{background:#00cc41}.btn-link-feedback{color:#009930}.btn-link-feedback:hover{background:#1e6ea740}.footer-note{color:#8d8d8d}.footer-note a{color:#8fffb2;text-decoration:underline;text-underline-offset:2px;text-decoration-thickness:1px}.footer-note a:hover{color:#00cc41;text-decoration-thickness:2px}}.dialog-close-button:focus-visible,.btn-base-feedback:focus-visible,.btn-link-feedback:focus-visible{box-shadow:0 0 0 2px #8bc8f0}.btn-base-feedback:disabled{opacity:.5;cursor:not-allowed}";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]"),hd(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&&r.length>0&&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-feedback p-1"},_(e?Sa:za,null))):this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link-feedback 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-feedback p-1"},_(Sa,null))))}},_(Sa,null)),_("a",{class:"btn btn-link-feedback p-1",onclick:()=>{const r=_("div",{class:"dialog-overlay"},_("div",{role:"dialog",class:"dialog-content w-[600px] gap-5-feedback"},_("button",{onclick:()=>r.remove(),class:"dialog-close-button"},_(ud,{size:"22"})),_("div",{class:"dialog-header"},_("label",{class:"text-label-md pl-7-feedback"},"Tell us more")),_("div",{class:"dialog-body flex flex-col gap-5-feedback"},_("div",{class:"text-label-sm pl-7-feedback"},this._suggestionTextList.map((o,u)=>_("span",{class:"feedback-suggestion-text",onclick:h=>{const d=this;this._suggestionTextList.filter((f,z)=>z!==u&&f.isActive).forEach(f=>f.isActive=!1),r.querySelectorAll(".feedback-suggestion-text").forEach(f=>f.classList.toggle("feedback-suggestion-text-active",!1)),o.isActive=!o.isActive,h.currentTarget.classList.toggle("feedback-suggestion-text-active",o.isActive),n.call(d)}},o.text))),_("textarea",{placeholder:"Add special details (optional)",class:"feedback-comment-text"}),_("div",{class:"footer-note"},_("a",{href:"https://id.veracity.com/terms-of-use",target:"_blank",rel:"noopener noreferrer"},"Learn more")," about how this data is used and your rights. By pressing Submit, your conversation will be used to improve Veracity products and services. ",_("a",{href:"https://services.veracity.com/PrivacyStatement",target:"_blank",rel:"noopener noreferrer"},"Privacy statement."))),_("div",{class:"dialog-footer flex justify-end gap-2-feedback"},_("button",{id:"submit-btn",class:"btn-base-feedback btn-primary-feedback btn-lg-feedback",disabled:!0,onclick:()=>{let o="";this._suggestionTextList.map((d,p)=>{d.isActive&&(o=d.text)});let u="";const h=r.querySelector(".feedback-comment-text").value;h!==""&&(u=h),this.conversation.chat.setLikeAsync(this.messageId,this.copilitId,!1,o,u),r.remove(),this._feedbackNode.replaceWith(this._feedbackNode=_("div",{class:"flex"},_("a",{class:"btn btn-link-feedback p-1"},_(za,null))))}},"Submit"))));function n(){const o=r.querySelector("#submit-btn");if(o){const u=this._suggestionTextList.some(h=>h.isActive);o.disabled=!u}}n.call(this);const i=document.createElement("div"),a=i.attachShadow({mode:"open"}),s=document.createElement("style");s.textContent=cd,a.appendChild(s),a.appendChild(r),document.body.appendChild(i)}},_(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 hd(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?this.displayError("Error",e):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;let i="An undisclosed error occurred. Please contact Veracity Support.";r&&(i=r),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 dd{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
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+=`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veracity/ai",
3
- "version": "2.4.6",
3
+ "version": "2.4.8",
4
4
  "description": "Veracity AI UI",
5
5
  "repository": {
6
6
  "type": "git",