@difizen/libro-ai-native 0.2.41-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1 -0
  3. package/es/ai-native-code-block.d.ts +4 -0
  4. package/es/ai-native-code-block.d.ts.map +1 -0
  5. package/es/ai-native-code-block.js +176 -0
  6. package/es/ai-native-command-contribution.d.ts +16 -0
  7. package/es/ai-native-command-contribution.d.ts.map +1 -0
  8. package/es/ai-native-command-contribution.js +297 -0
  9. package/es/ai-native-command.d.ts +5 -0
  10. package/es/ai-native-command.d.ts.map +1 -0
  11. package/es/ai-native-command.js +17 -0
  12. package/es/ai-native-for-cell-view.d.ts +20 -0
  13. package/es/ai-native-for-cell-view.d.ts.map +1 -0
  14. package/es/ai-native-for-cell-view.js +190 -0
  15. package/es/ai-native-output-top.d.ts +6 -0
  16. package/es/ai-native-output-top.d.ts.map +1 -0
  17. package/es/ai-native-output-top.js +37 -0
  18. package/es/ai-native-service.d.ts +13 -0
  19. package/es/ai-native-service.d.ts.map +1 -0
  20. package/es/ai-native-service.js +75 -0
  21. package/es/ai-side-toolbar-selector.d.ts +3 -0
  22. package/es/ai-side-toolbar-selector.d.ts.map +1 -0
  23. package/es/ai-side-toolbar-selector.js +47 -0
  24. package/es/chat-slot-contribution.d.ts +15 -0
  25. package/es/chat-slot-contribution.d.ts.map +1 -0
  26. package/es/chat-slot-contribution.js +71 -0
  27. package/es/chat-view.d.ts +15 -0
  28. package/es/chat-view.d.ts.map +1 -0
  29. package/es/chat-view.js +114 -0
  30. package/es/error-output-model.d.ts +8 -0
  31. package/es/error-output-model.d.ts.map +1 -0
  32. package/es/error-output-model.js +140 -0
  33. package/es/icon.d.ts +4 -0
  34. package/es/icon.d.ts.map +1 -0
  35. package/es/icon.js +92 -0
  36. package/es/index.d.ts +6 -0
  37. package/es/index.d.ts.map +1 -0
  38. package/es/index.js +5 -0
  39. package/es/index.less +297 -0
  40. package/es/libro-ai-msg-item-model.d.ts +18 -0
  41. package/es/libro-ai-msg-item-model.d.ts.map +1 -0
  42. package/es/libro-ai-msg-item-model.js +85 -0
  43. package/es/libro-ai-native-chat-service.d.ts +8 -0
  44. package/es/libro-ai-native-chat-service.d.ts.map +1 -0
  45. package/es/libro-ai-native-chat-service.js +157 -0
  46. package/es/libro-ai-native-chat-view.d.ts +42 -0
  47. package/es/libro-ai-native-chat-view.d.ts.map +1 -0
  48. package/es/libro-ai-native-chat-view.js +88 -0
  49. package/es/libro-ai-native-color-registry.d.ts +6 -0
  50. package/es/libro-ai-native-color-registry.d.ts.map +1 -0
  51. package/es/libro-ai-native-color-registry.js +46 -0
  52. package/es/module.d.ts +3 -0
  53. package/es/module.d.ts.map +1 -0
  54. package/es/module.js +28 -0
  55. package/es/protocol.d.ts +10 -0
  56. package/es/protocol.d.ts.map +1 -0
  57. package/es/protocol.js +1 -0
  58. package/es/utils.js +114 -0
  59. package/package.json +74 -0
  60. package/src/ai-native-code-block.tsx +138 -0
  61. package/src/ai-native-command-contribution.tsx +248 -0
  62. package/src/ai-native-command.ts +23 -0
  63. package/src/ai-native-for-cell-view.tsx +156 -0
  64. package/src/ai-native-output-top.tsx +43 -0
  65. package/src/ai-native-service.ts +39 -0
  66. package/src/ai-side-toolbar-selector.tsx +51 -0
  67. package/src/chat-slot-contribution.ts +36 -0
  68. package/src/chat-view.tsx +141 -0
  69. package/src/error-output-model.tsx +103 -0
  70. package/src/icon.tsx +80 -0
  71. package/src/index.less +330 -0
  72. package/src/index.spec.ts +8 -0
  73. package/src/index.ts +5 -0
  74. package/src/libro-ai-msg-item-model.ts +69 -0
  75. package/src/libro-ai-native-chat-service.ts +95 -0
  76. package/src/libro-ai-native-chat-view.tsx +54 -0
  77. package/src/libro-ai-native-color-registry.ts +33 -0
  78. package/src/module.ts +44 -0
  79. package/src/protocol.ts +18 -0
  80. package/src/utils.tsx +115 -0
@@ -0,0 +1,190 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
13
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
14
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
15
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
16
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
17
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
18
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
19
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
20
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
21
+ import { CloseOutlined } from '@ant-design/icons';
22
+ import { AnswerState } from '@difizen/magent-chat';
23
+ import { ChatComponents } from '@difizen/magent-chat';
24
+ import { ChatEvent } from '@difizen/magent-chat';
25
+ import { Fetcher } from '@difizen/magent-core';
26
+ import { toAutoFactory } from '@difizen/magent-core';
27
+ import { ViewOption } from '@difizen/mana-app';
28
+ import { prop } from '@difizen/mana-app';
29
+ import { useObserve } from '@difizen/mana-app';
30
+ import { useInject, ViewInstance } from '@difizen/mana-app';
31
+ import { inject } from '@difizen/mana-app';
32
+ import { BaseView, transient, view } from '@difizen/mana-app';
33
+ import { Button } from 'antd';
34
+ import { EventSourceParserStream } from 'eventsource-parser/stream';
35
+ import breaks from 'remark-breaks';
36
+ import remarkGfm from 'remark-gfm';
37
+ import { CodeBlockInCell } from "./ai-native-code-block.js";
38
+ import { AILoadding } from "./icon.js";
39
+ import { LibroAIChatMessageItemModel } from "./libro-ai-msg-item-model.js";
40
+ import { stringToReadableStream } from "./utils.js";
41
+ import { jsx as _jsx } from "react/jsx-runtime";
42
+ import { jsxs as _jsxs } from "react/jsx-runtime";
43
+ export function LibroAINativeForCellRender() {
44
+ var LLMRender = ChatComponents.Markdown;
45
+ var instance = useInject(ViewInstance);
46
+ var msgItem = useObserve(instance.libroAIChatMessageItemModel);
47
+ if (!instance.showAI) {
48
+ return null;
49
+ }
50
+ return /*#__PURE__*/_jsxs("div", {
51
+ className: "libro-ai-native-for-cell-container",
52
+ children: [/*#__PURE__*/_jsx(LLMRender, {
53
+ type: "message",
54
+ components: {
55
+ code: CodeBlockInCell
56
+ },
57
+ remarkPlugins: [remarkGfm, breaks],
58
+ children: (msgItem === null || msgItem === void 0 ? void 0 : msgItem.content) || ''
59
+ }), /*#__PURE__*/_jsx(Button, {
60
+ color: "default",
61
+ variant: "outlined",
62
+ className: "libro-ai-native-for-cell-cancel-btn",
63
+ onClick: function onClick() {
64
+ instance.showAI = false;
65
+ instance.cell.parent.model.libroViewClass = instance.cell.parent.model.libroViewClass.replace('ai-cell-chat', '');
66
+ },
67
+ icon: (msgItem === null || msgItem === void 0 ? void 0 : msgItem.state) === AnswerState.SUCCESS ? /*#__PURE__*/_jsx(CloseOutlined, {}) : /*#__PURE__*/_jsx(AILoadding, {}),
68
+ children: "\u53D6\u6D88"
69
+ })]
70
+ });
71
+ }
72
+ export var LibroAINativeForCellView = (_dec = transient(), _dec2 = view('libro-ai-native-for-cell-view'), _dec3 = inject(Fetcher), _dec4 = inject(toAutoFactory(LibroAIChatMessageItemModel)), _dec5 = prop(), _dec6 = prop(), _dec(_class = _dec2(_class = (_class2 = /*#__PURE__*/function (_BaseView) {
73
+ _inherits(LibroAINativeForCellView, _BaseView);
74
+ var _super = _createSuper(LibroAINativeForCellView);
75
+ function LibroAINativeForCellView(options) {
76
+ var _this;
77
+ _classCallCheck(this, LibroAINativeForCellView);
78
+ _this = _super.call(this);
79
+ _this.view = LibroAINativeForCellRender;
80
+ _initializerDefineProperty(_this, "fetcher", _descriptor, _assertThisInitialized(_this));
81
+ _initializerDefineProperty(_this, "libroAiChatMessageItemFactory", _descriptor2, _assertThisInitialized(_this));
82
+ _initializerDefineProperty(_this, "libroAIChatMessageItemModel", _descriptor3, _assertThisInitialized(_this));
83
+ _initializerDefineProperty(_this, "showAI", _descriptor4, _assertThisInitialized(_this));
84
+ _this.chatStream = /*#__PURE__*/function () {
85
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(option) {
86
+ var chat_key, content, url, msg, res, reader, stream, msgItem, alreayDone, _yield$reader$read, value, done, data, event;
87
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
88
+ while (1) switch (_context.prev = _context.next) {
89
+ case 0:
90
+ chat_key = option.chat_key, content = option.content;
91
+ url = "/libro/api/chatstream";
92
+ msg = {
93
+ chat_key: chat_key,
94
+ prompt: content
95
+ };
96
+ _context.next = 5;
97
+ return _this.fetcher.post(url, msg, {
98
+ headers: {
99
+ Accept: 'text/event-stream'
100
+ },
101
+ responseType: 'stream',
102
+ adapter: 'fetch'
103
+ });
104
+ case 5:
105
+ res = _context.sent;
106
+ if (!(res.status === 200)) {
107
+ _context.next = 27;
108
+ break;
109
+ }
110
+ if (typeof res.data === 'string') {
111
+ reader = stringToReadableStream(res.data).pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).getReader();
112
+ } else {
113
+ stream = res.data;
114
+ reader = stream.pipeThrough(new TextDecoderStream()).pipeThrough(new EventSourceParserStream()).getReader();
115
+ }
116
+ msgItem = _this.libroAiChatMessageItemFactory({
117
+ sender: {
118
+ type: 'AI',
119
+ id: chat_key
120
+ },
121
+ content: ''
122
+ });
123
+ _this.libroAIChatMessageItemModel = msgItem;
124
+ alreayDone = false;
125
+ case 11:
126
+ if (alreayDone) {
127
+ _context.next = 26;
128
+ break;
129
+ }
130
+ _context.next = 14;
131
+ return reader.read();
132
+ case 14:
133
+ _yield$reader$read = _context.sent;
134
+ value = _yield$reader$read.value;
135
+ done = _yield$reader$read.done;
136
+ if (!done) {
137
+ _context.next = 21;
138
+ break;
139
+ }
140
+ alreayDone = true;
141
+ msgItem.handleEventData({
142
+ type: 'done'
143
+ });
144
+ return _context.abrupt("break", 26);
145
+ case 21:
146
+ data = JSON.parse(value.data);
147
+ event = ChatEvent.format(value.event || 'chunk', data);
148
+ msgItem.handleEventData(event);
149
+ _context.next = 11;
150
+ break;
151
+ case 26:
152
+ return _context.abrupt("return");
153
+ case 27:
154
+ case "end":
155
+ return _context.stop();
156
+ }
157
+ }, _callee);
158
+ }));
159
+ return function (_x) {
160
+ return _ref.apply(this, arguments);
161
+ };
162
+ }();
163
+ _this.cell = options.cell;
164
+ return _this;
165
+ }
166
+ LibroAINativeForCellView = inject(ViewOption)(LibroAINativeForCellView, undefined, 0) || LibroAINativeForCellView;
167
+ return _createClass(LibroAINativeForCellView);
168
+ }(BaseView), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "fetcher", [_dec3], {
169
+ configurable: true,
170
+ enumerable: true,
171
+ writable: true,
172
+ initializer: null
173
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "libroAiChatMessageItemFactory", [_dec4], {
174
+ configurable: true,
175
+ enumerable: true,
176
+ writable: true,
177
+ initializer: null
178
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "libroAIChatMessageItemModel", [_dec5], {
179
+ configurable: true,
180
+ enumerable: true,
181
+ writable: true,
182
+ initializer: null
183
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "showAI", [_dec6], {
184
+ configurable: true,
185
+ enumerable: true,
186
+ writable: true,
187
+ initializer: function initializer() {
188
+ return false;
189
+ }
190
+ })), _class2)) || _class) || _class);
@@ -0,0 +1,6 @@
1
+ import type { CellView } from '@difizen/libro-jupyter';
2
+ import './index.less';
3
+ export declare function LibroAINativeCellTopBlank({ cell }: {
4
+ cell: CellView;
5
+ }): import("react/jsx-runtime").JSX.Element | null;
6
+ //# sourceMappingURL=ai-native-output-top.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-native-output-top.d.ts","sourceRoot":"","sources":["../src/ai-native-output-top.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGvD,OAAO,cAAc,CAAC;AAKtB,wBAAgB,yBAAyB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,QAAQ,CAAA;CAAE,kDAkCrE"}
@@ -0,0 +1,37 @@
1
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
6
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
+ import { useInject, ViewManager, ViewRender } from '@difizen/mana-app';
8
+ import { useEffect, useState } from 'react';
9
+ import "./index.less";
10
+ import { LibroAINativeService } from "./ai-native-service.js";
11
+ import { jsx as _jsx } from "react/jsx-runtime";
12
+ export function LibroAINativeCellTopBlank(_ref) {
13
+ var cell = _ref.cell;
14
+ var viewManager = useInject(ViewManager);
15
+ var _useState = useState(),
16
+ _useState2 = _slicedToArray(_useState, 2),
17
+ aiNativeForCellView = _useState2[0],
18
+ setAiNativeForCellView = _useState2[1];
19
+ var libroAINativeService = useInject(LibroAINativeService);
20
+ useEffect(function () {
21
+ libroAINativeService.getOrCreateLibroAINativeForCellView(cell.id, cell).then(function (view) {
22
+ setAiNativeForCellView(view);
23
+ return;
24
+ }).catch(function () {
25
+ //
26
+ });
27
+ }, [cell, cell.id, libroAINativeService, libroAINativeService.libroAINativeForCellViewMap, viewManager]);
28
+ if (!aiNativeForCellView) {
29
+ return null;
30
+ }
31
+ return /*#__PURE__*/_jsx("div", {
32
+ className: "libro-ai-native-output-top",
33
+ children: /*#__PURE__*/_jsx(ViewRender, {
34
+ view: aiNativeForCellView
35
+ })
36
+ });
37
+ }
@@ -0,0 +1,13 @@
1
+ import type { CellView } from '@difizen/libro-jupyter';
2
+ import { ViewManager } from '@difizen/mana-app';
3
+ import { LibroAINativeForCellView } from './ai-native-for-cell-view.js';
4
+ import type { LibroChatView } from './chat-view.js';
5
+ export declare class LibroAINativeService {
6
+ showSideToolbar: boolean;
7
+ chatViewMap: Map<string, LibroChatView>;
8
+ showChatMap: Map<string, boolean>;
9
+ viewManager: ViewManager;
10
+ libroAINativeForCellViewMap: Map<string, LibroAINativeForCellView>;
11
+ getOrCreateLibroAINativeForCellView(id: string, cell: CellView): Promise<LibroAINativeForCellView>;
12
+ }
13
+ //# sourceMappingURL=ai-native-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-native-service.d.ts","sourceRoot":"","sources":["../src/ai-native-service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAsC,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEpF,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD,qBACa,oBAAoB;IAE/B,eAAe,UAAS;IAExB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,CAAa;IAEpD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAa;IAE9C,WAAW,EAAE,WAAW,CAAC;IAEzB,2BAA2B,EAAE,GAAG,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAa;IAEzE,mCAAmC,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;CAarE"}
@@ -0,0 +1,75 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
8
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
9
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
11
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
12
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
13
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
14
+ import { getOrigin, inject, prop, singleton, ViewManager } from '@difizen/mana-app';
15
+ import { LibroAINativeForCellView } from "./ai-native-for-cell-view.js";
16
+ export var LibroAINativeService = (_dec = singleton(), _dec2 = prop(), _dec3 = inject(ViewManager), _dec(_class = (_class2 = /*#__PURE__*/function () {
17
+ function LibroAINativeService() {
18
+ _classCallCheck(this, LibroAINativeService);
19
+ _initializerDefineProperty(this, "showSideToolbar", _descriptor, this);
20
+ this.chatViewMap = new Map();
21
+ this.showChatMap = new Map();
22
+ _initializerDefineProperty(this, "viewManager", _descriptor2, this);
23
+ this.libroAINativeForCellViewMap = new Map();
24
+ }
25
+ _createClass(LibroAINativeService, [{
26
+ key: "getOrCreateLibroAINativeForCellView",
27
+ value: function () {
28
+ var _getOrCreateLibroAINativeForCellView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(id, cell) {
29
+ var libroAINativeForCellView;
30
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
31
+ while (1) switch (_context.prev = _context.next) {
32
+ case 0:
33
+ libroAINativeForCellView = this.libroAINativeForCellViewMap.get(id);
34
+ if (!libroAINativeForCellView) {
35
+ _context.next = 5;
36
+ break;
37
+ }
38
+ return _context.abrupt("return", libroAINativeForCellView);
39
+ case 5:
40
+ _context.next = 7;
41
+ return this.viewManager.getOrCreateView(LibroAINativeForCellView, {
42
+ id: id,
43
+ cell: getOrigin(cell)
44
+ });
45
+ case 7:
46
+ libroAINativeForCellView = _context.sent;
47
+ this.libroAINativeForCellViewMap.set(cell.id, libroAINativeForCellView);
48
+ case 9:
49
+ return _context.abrupt("return", libroAINativeForCellView);
50
+ case 10:
51
+ case "end":
52
+ return _context.stop();
53
+ }
54
+ }, _callee, this);
55
+ }));
56
+ function getOrCreateLibroAINativeForCellView(_x, _x2) {
57
+ return _getOrCreateLibroAINativeForCellView.apply(this, arguments);
58
+ }
59
+ return getOrCreateLibroAINativeForCellView;
60
+ }()
61
+ }]);
62
+ return LibroAINativeService;
63
+ }(), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "showSideToolbar", [_dec2], {
64
+ configurable: true,
65
+ enumerable: true,
66
+ writable: true,
67
+ initializer: function initializer() {
68
+ return false;
69
+ }
70
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec3], {
71
+ configurable: true,
72
+ enumerable: true,
73
+ writable: true,
74
+ initializer: null
75
+ })), _class2)) || _class);
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ export declare const AIToolbarSelector: React.FC;
3
+ //# sourceMappingURL=ai-side-toolbar-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ai-side-toolbar-selector.d.ts","sourceRoot":"","sources":["../src/ai-side-toolbar-selector.tsx"],"names":[],"mappings":";AAUA,eAAO,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAwCrC,CAAC"}
@@ -0,0 +1,47 @@
1
+ import { LibroSideToolbarMenu } from '@difizen/libro-jupyter';
2
+ import { useInject } from '@difizen/mana-app';
3
+ import { l10n } from '@difizen/mana-l10n';
4
+ import { Popover } from 'antd';
5
+ import { AINativeCommands } from "./ai-native-command.js";
6
+ import { LibroAINativeService } from "./ai-native-service.js";
7
+ import { AIIcon } from "./icon.js";
8
+ import { jsx as _jsx } from "react/jsx-runtime";
9
+ import { Fragment as _Fragment } from "react/jsx-runtime";
10
+ export var AIToolbarSelector = function AIToolbarSelector() {
11
+ var items = [{
12
+ id: AINativeCommands['CellChat'].id,
13
+ label: /*#__PURE__*/_jsx(_Fragment, {
14
+ children: /*#__PURE__*/_jsx("span", {
15
+ className: "libro-menu-item-label",
16
+ children: l10n.t('AI 对话')
17
+ })
18
+ }),
19
+ group: 'ai'
20
+ }, {
21
+ id: AINativeCommands['Explain'].id,
22
+ label: /*#__PURE__*/_jsx(_Fragment, {
23
+ children: /*#__PURE__*/_jsx("span", {
24
+ className: "libro-menu-item-label",
25
+ children: l10n.t('代码解释')
26
+ })
27
+ }),
28
+ group: 'ai'
29
+ }];
30
+ var libroAINativeService = useInject(LibroAINativeService);
31
+ var handleOpenChange = function handleOpenChange(newOpen) {
32
+ libroAINativeService.showSideToolbar = newOpen;
33
+ };
34
+ return /*#__PURE__*/_jsx(Popover, {
35
+ placement: "leftTop",
36
+ content: /*#__PURE__*/_jsx(LibroSideToolbarMenu, {
37
+ items: items
38
+ }),
39
+ trigger: "hover",
40
+ open: libroAINativeService.showSideToolbar,
41
+ onOpenChange: handleOpenChange,
42
+ overlayClassName: "libro-popover-side-toolbar-menu libro-side-toolbar-ai-select-menu",
43
+ children: /*#__PURE__*/_jsx("div", {
44
+ children: /*#__PURE__*/_jsx(AIIcon, {})
45
+ })
46
+ });
47
+ };
@@ -0,0 +1,15 @@
1
+ import type { LibroExtensionSlotFactory, LibroSlot } from '@difizen/libro-jupyter';
2
+ import { LibroExtensionSlotContribution } from '@difizen/libro-jupyter';
3
+ import { ViewManager } from '@difizen/mana-app';
4
+ import { LibroAINativeService } from './ai-native-service.js';
5
+ export declare class LibroAIChatSlotContribution implements LibroExtensionSlotContribution {
6
+ viewManager: ViewManager;
7
+ libroAINativeService: LibroAINativeService;
8
+ readonly slot: LibroSlot;
9
+ factory: LibroExtensionSlotFactory;
10
+ viewOpenOption: {
11
+ reveal: boolean;
12
+ order: string;
13
+ };
14
+ }
15
+ //# sourceMappingURL=chat-slot-contribution.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-slot-contribution.d.ts","sourceRoot":"","sources":["../src/chat-slot-contribution.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,yBAAyB,EACzB,SAAS,EACV,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAG9D,qBACa,2BAA4B,YAAW,8BAA8B;IAC3D,WAAW,EAAE,WAAW,CAAC;IAChB,oBAAoB,EAAE,oBAAoB,CAAC;IAEzE,SAAgB,IAAI,EAAE,SAAS,CAAW;IAE1C,OAAO,EAAE,yBAAyB,CAYhC;IACF,cAAc;;;MAGZ;CACH"}
@@ -0,0 +1,71 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
3
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
4
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
5
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
6
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
7
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
8
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
9
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
10
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
11
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
12
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
13
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'transform-class-properties is enabled and runs after the decorators transform.'); }
14
+ import { LibroExtensionSlotContribution } from '@difizen/libro-jupyter';
15
+ import { ViewManager } from '@difizen/mana-app';
16
+ import { inject, singleton } from '@difizen/mana-app';
17
+ import { LibroAINativeService } from "./ai-native-service.js";
18
+ import { LibroChatView } from "./chat-view.js";
19
+ export var LibroAIChatSlotContribution = (_dec = singleton({
20
+ contrib: [LibroExtensionSlotContribution]
21
+ }), _dec2 = inject(ViewManager), _dec3 = inject(LibroAINativeService), _dec(_class = (_class2 = /*#__PURE__*/_createClass(function LibroAIChatSlotContribution() {
22
+ var _this = this;
23
+ _classCallCheck(this, LibroAIChatSlotContribution);
24
+ _initializerDefineProperty(this, "viewManager", _descriptor, this);
25
+ _initializerDefineProperty(this, "libroAINativeService", _descriptor2, this);
26
+ this.slot = 'right';
27
+ this.factory = /*#__PURE__*/function () {
28
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(libro) {
29
+ var view;
30
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
31
+ while (1) switch (_context.prev = _context.next) {
32
+ case 0:
33
+ _context.next = 2;
34
+ return _this.viewManager.getOrCreateView(LibroChatView, {
35
+ parentId: libro.id
36
+ });
37
+ case 2:
38
+ view = _context.sent;
39
+ view.parent = libro;
40
+ view.chatView.libro = libro;
41
+ _this.libroAINativeService.chatViewMap.set(libro.id, view);
42
+ _this.libroAINativeService.showChatMap.set(libro.id, false);
43
+ view.onDisposed(function () {
44
+ _this.libroAINativeService.chatViewMap.delete(libro.id);
45
+ });
46
+ return _context.abrupt("return", view);
47
+ case 9:
48
+ case "end":
49
+ return _context.stop();
50
+ }
51
+ }, _callee);
52
+ }));
53
+ return function (_x) {
54
+ return _ref.apply(this, arguments);
55
+ };
56
+ }();
57
+ this.viewOpenOption = {
58
+ reveal: false,
59
+ order: 'a'
60
+ };
61
+ }), (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "viewManager", [_dec2], {
62
+ configurable: true,
63
+ enumerable: true,
64
+ writable: true,
65
+ initializer: null
66
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "libroAINativeService", [_dec3], {
67
+ configurable: true,
68
+ enumerable: true,
69
+ writable: true,
70
+ initializer: null
71
+ })), _class2)) || _class);
@@ -0,0 +1,15 @@
1
+ import type { DisplayView, LibroView } from '@difizen/libro-jupyter';
2
+ import type { ConfigurationService } from '@difizen/mana-app';
3
+ import { BaseView, ViewManager } from '@difizen/mana-app';
4
+ import { LibroAiNativeChatView } from './libro-ai-native-chat-view.js';
5
+ export declare const ChatRender: () => import("react/jsx-runtime").JSX.Element;
6
+ export declare class LibroChatView extends BaseView implements DisplayView {
7
+ parent: LibroView | undefined;
8
+ protected configurationService: ConfigurationService;
9
+ viewManager: ViewManager;
10
+ view: () => import("react/jsx-runtime").JSX.Element;
11
+ chatView: LibroAiNativeChatView;
12
+ isDisplay: boolean;
13
+ constructor(viewManager: ViewManager);
14
+ }
15
+ //# sourceMappingURL=chat-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chat-view.d.ts","sourceRoot":"","sources":["../src/chat-view.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EACL,QAAQ,EAKR,WAAW,EAIZ,MAAM,mBAAmB,CAAC;AAI3B,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAEvE,eAAO,MAAM,UAAU,+CAoDtB,CAAC;AAEF,qBAEa,aAAc,SAAQ,QAAS,YAAW,WAAW;IAChE,MAAM,EAAE,SAAS,GAAG,SAAS,CAAa;IAC1C,SAAS,CAAC,oBAAoB,EAAE,oBAAoB,CAAC;IAChC,WAAW,EAAE,WAAW,CAAC;IAErC,IAAI,gDAAc;IAG3B,QAAQ,EAAE,qBAAqB,CAAC;IAGhC,SAAS,UAAQ;gBAEgB,WAAW,EAAE,WAAW;CAe1D"}